ref: cba8933c1125cfcc1d747146ef651ed4e0c867ea
parent: b2a4f54f59546938a3aeb441e53f53b13b5572fd
author: bentley <[email protected]>
date: Tue Jan 12 16:21:48 EST 2010
remove unneeded carttype checking in -v To simplify the code, remove the carttype work in the -v option. Because the MBC option already alters it, this one is superfluous.
--- a/src/fix/main.c
+++ b/src/fix/main.c
@@ -473,7 +473,6 @@
if (ulOptions & OPTF_VALIDATE) {
long i, byteschanged = 0;
long cartromsize, calcromsize = 0, filesize;
- long carttype;
unsigned short cartchecksum = 0, calcchecksum = 0;
unsigned char cartcompchecksum = 0, calccompchecksum =
0;
@@ -542,35 +541,6 @@
}
} else if (!(ulOptions & OPTF_QUIET)) {
printf("\tROM size byte is OK\n");
- }
- /* Cartridge type */
-
- fflush(f);
- fseek(f, 0x0147L, SEEK_SET);
- carttype = fgetc(f);
- if (carttype == EOF)
- carttype = 0x00;
-
- if (FileSize(f) > 0x8000L) {
- /* carttype byte must != 0x00 */
- if (carttype == 0x00) {
- if ((ulOptions & OPTF_DEBUG) == 0) {
- fseek(f, -1, SEEK_CUR);
- fputc(0x01, f);
- fflush(f);
- }
- if (!(ulOptions & OPTF_QUIET)) {
- printf
- ("\tCartridge type byte changed to 0x01\n");
- }
- } else if (!(ulOptions & OPTF_QUIET)) {
- printf("\tCartridge type byte is OK\n");
- }
- } else {
- /* carttype byte can be anything? */
- if (!(ulOptions & OPTF_QUIET)) {
- printf("\tCartridge type byte is OK\n");
- }
}
/* Checksum */