many of the flags did not respect -d (debug) flag. this fixes them.

This commit is contained in:
anthony
2010-01-04 20:04:25 -07:00
parent 3649cec52d
commit f0361ee025

View File

@@ -474,11 +474,12 @@ main(int argc, char *argv[])
if (!(ulOptions & OPTF_QUIET)) {
printf("Setting RAM size\n");
}
if (!(ulOptions & OPTF_DEBUG)) {
fflush(f);
fseek(f, 0x149L, SEEK_SET);
fputc(ram_size, f);
fflush(f);
}
if (!(ulOptions & OPTF_QUIET)) {
printf("\tRAM size set to %#02X\n", ram_size);
}
@@ -487,11 +488,12 @@ main(int argc, char *argv[])
* -j (Set region flag) option code
*/
if (ulOptions & OPTF_JAPAN) {
if (!(ulOptions & OPTF_DEBUG)) {
fflush(f);
fseek(f, 0x14A, SEEK_SET);
fputc(1, f);
fflush(f);
}
if (!(ulOptions & OPTF_QUIET)) {
printf("\tRegion code set to non-Japan\n");
}
@@ -504,11 +506,12 @@ main(int argc, char *argv[])
if (!(ulOptions & OPTF_QUIET)) {
printf("Setting MBC type\n");
}
if (!(ulOptions & OPTF_DEBUG)) {
fflush(f);
fseek(f, 0x147L, SEEK_SET);
fputc(mbc_type, f);
fflush(f);
}
if (!(ulOptions & OPTF_QUIET)) {
printf("\tMBC type set to %#02X (%s)\n", mbc_type, MBC_String(mbc_type));
}
@@ -523,11 +526,12 @@ main(int argc, char *argv[])
if (!(ulOptions & OPTF_QUIET) && gbc_mode == 0xC0) {
printf("Setting Game Boy Color only mode\n");
}
if (!(ulOptions & OPTF_DEBUG)) {
fflush(f);
fseek(f, 0x143L, SEEK_SET);
fputc(gbc_mode, f);
fflush(f);
}
if (!(ulOptions & OPTF_QUIET) && gbc_mode == 0x80) {
printf("\tGame Boy Color compatible mode set\n");
}
@@ -545,6 +549,7 @@ main(int argc, char *argv[])
* -s (Set SGB mode) option code
*/
if (ulOptions & OPTF_SGBMODE) {
if (!(ulOptions & OPTF_DEBUG)) {
fflush(f);
// set old licensee code to 0x33
fseek(f, 0x14B, SEEK_SET);
@@ -553,7 +558,7 @@ main(int argc, char *argv[])
fseek(f, 0x146, SEEK_SET);
fputc(3, f);
fflush(f);
}
if (!(ulOptions & OPTF_QUIET)) {
printf("Setting SGB mode flag\n");
}