From 7e745cc5eb55c04799dcb69c93da99c869aeff6b Mon Sep 17 00:00:00 2001 From: retro-wertz Date: Sat, 1 Jun 2019 18:29:20 +0800 Subject: [PATCH] Assign a few more games as mapper 215 - these games were assigned to mapper 217 in goodnes. this mapper is deprecated and the said games are Mapper 215's - Minor adjustment of rom info logs at startup --- src/ines-correct.h | 3 +++ src/ines.c | 17 ++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ines-correct.h b/src/ines-correct.h index 1a0c89d..e52a69b 100644 --- a/src/ines-correct.h +++ b/src/ines-correct.h @@ -335,6 +335,9 @@ {0xb3be2f71, 3, 0}, /* Yanshan Chess (Unl) */ {0x8dedea07, 3, 1}, /* Shui Guo Li (Ch) [a1] */ {0x1a71fd06, 1, 1}, /* Kujaku Ou (J) [T+Eng1.1_Snark] */ + {0x99748230, 215, 0}, /* EarthWorm Jim 2 (SuperGame) */ + {0x37876ac7, 215, 0}, /* Golden Card 6-in-1 (Unl) [!] */ + {0x1a3320a3, 215, 0}, /* Mortal Kombat 3 (SuperGame) */ {0x00000000, -1, -1} diff --git a/src/ines.c b/src/ines.c index 94f6087..b14b248 100644 --- a/src/ines.c +++ b/src/ines.c @@ -295,6 +295,8 @@ static void CheckHInfo(void) { }; int32 tofix = 0, x; uint64 partialmd5 = 0; + int current_mapper = 0; + int cur_mirr = 0; for (x = 0; x < 8; x++) partialmd5 |= (uint64)iNESCart.MD5[15 - x] << (x * 8); @@ -312,10 +314,12 @@ static void CheckHInfo(void) { } if (MapperNo != (moo[x].mapper & 0xFF)) { tofix |= 1; + current_mapper = MapperNo; MapperNo = moo[x].mapper & 0xFF; } } if (moo[x].mirror >= 0) { + cur_mirr = Mirroring; if (moo[x].mirror == 8) { if (Mirroring == 2) { /* Anything but hard-wired(four screen). */ tofix |= 2; @@ -361,12 +365,12 @@ static void CheckHInfo(void) { if (tofix) { char gigastr[768]; - strcpy(gigastr, "The iNES header contains incorrect information. For now, the information will be corrected in RAM. "); + strcpy(gigastr, "The iNES header contains incorrect information. For now, the information will be corrected in RAM. "); if (tofix & 1) - sprintf(gigastr + strlen(gigastr), "The mapper number should be set to %d. ", MapperNo); + sprintf(gigastr + strlen(gigastr), "Current mapper # is %d. The mapper number should be set to %d. ", current_mapper, MapperNo); if (tofix & 2) { uint8 *mstr[3] = { (uint8_t*)"Horizontal", (uint8_t*)"Vertical", (uint8_t*)"Four-screen" }; - sprintf(gigastr + strlen(gigastr), "Mirroring should be set to \"%s\". ", mstr[Mirroring & 3]); + sprintf(gigastr + strlen(gigastr), "Current mirroring is %s. Mirroring should be set to \"%s\". ", mstr[cur_mirr & 3], mstr[Mirroring & 3]); } if (tofix & 4) strcat(gigastr, "The battery-backed bit should be set. "); @@ -604,7 +608,7 @@ static BMAPPINGLocal bmap[] = { {(uint8_t*)"", 212, Mapper212_Init}, {(uint8_t*)"", 213, Mapper213_Init}, {(uint8_t*)"", 214, Mapper214_Init}, - {(uint8_t*)"", 215, UNL8237_Init}, + {(uint8_t*)"UNL-8237", 215, UNL8237_Init}, {(uint8_t*)"", 216, Mapper216_Init}, {(uint8_t*)"", 217, Mapper217_Init}, /* Redefined to a new Discrete BMC mapper */ /* {(uint8_t*)"", 218, Mapper218_Init}, */ @@ -743,6 +747,8 @@ int iNESLoad(const char *name, FCEUFILE *fp) { iNESCart.CRC32 = iNESGameCRC32; + SetInput(); + CheckHInfo(); mappername = "Not Listed"; for (mappertest = 0; mappertest < (sizeof bmap / sizeof bmap[0]) - 1; mappertest++) { @@ -751,9 +757,6 @@ int iNESLoad(const char *name, FCEUFILE *fp) { break; } } - - SetInput(); - CheckHInfo(); { int x; uint64 partialmd5 = 0;