MMC1: Fix some NES 2.0 games not saving or loading battery backup files
This commit is contained in:
@@ -205,7 +205,7 @@ static int DetectMMC1WRAMSize(CartInfo *info, int *saveRAM) {
|
|||||||
int workRAM = 8;
|
int workRAM = 8;
|
||||||
switch (info->CRC32) {
|
switch (info->CRC32) {
|
||||||
case 0xc6182024: /* Romance of the 3 Kingdoms */
|
case 0xc6182024: /* Romance of the 3 Kingdoms */
|
||||||
case 0xabbf7217: /* "" "" (J) (PRG0) */
|
case 0xabbf7217: /* "" "" (J) (PRG0) or Sangokushi */
|
||||||
case 0xccf35c02: /* "" "" (J) (PRG1) */
|
case 0xccf35c02: /* "" "" (J) (PRG1) */
|
||||||
case 0x2225c20f: /* Genghis Khan */
|
case 0x2225c20f: /* Genghis Khan */
|
||||||
case 0xfb69743a: /* "" "" (J) */
|
case 0xfb69743a: /* "" "" (J) */
|
||||||
@@ -222,22 +222,28 @@ static int DetectMMC1WRAMSize(CartInfo *info, int *saveRAM) {
|
|||||||
workRAM = 32;
|
workRAM = 32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (info->iNES2) {
|
/* FIXME:
|
||||||
|
* According to NesCartDB, the games above are the only ones using 16K / 32K wram or battery,
|
||||||
|
* the rest of the roms for this mapper can either have 8KB wram or 8KB battery save or both.
|
||||||
|
* Some NES 2.0 headered roms have been found to have incorrect wram size causing save issues, so we
|
||||||
|
* override games here that have battery bit enabled but not listed above to ignore header and use default 8 KB battery/wram instead.
|
||||||
|
* Nes 2.0 roms without battery bit can use the header to set wram size. */
|
||||||
|
if (info->battery) {
|
||||||
|
workRAM = 8;
|
||||||
|
*saveRAM = 8;
|
||||||
|
}
|
||||||
|
else if (info->iNES2) {
|
||||||
workRAM = (info->PRGRamSize + info->PRGRamSaveSize) / 1024;
|
workRAM = (info->PRGRamSize + info->PRGRamSaveSize) / 1024;
|
||||||
*saveRAM = info->PRGRamSaveSize / 1024;
|
|
||||||
/* we only support sizes between 8K and 32K */
|
/* we only support sizes between 8K and 32K */
|
||||||
if (workRAM > 0 && workRAM < 8)
|
if (workRAM > 0 && workRAM < 8)
|
||||||
workRAM = 8;
|
workRAM = 8;
|
||||||
if (workRAM > 32)
|
if (workRAM > 32)
|
||||||
workRAM = 32;
|
workRAM = 32;
|
||||||
if (*saveRAM > workRAM)
|
} /* the rest use default 8KB wram by default*/
|
||||||
*saveRAM = workRAM;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (workRAM > 8)
|
if (workRAM > 8)
|
||||||
FCEU_printf(" >8KB external WRAM present. Use NES 2.0 if you hack the ROM image.\n");
|
FCEU_printf(" >8KB external WRAM present. Use NES 2.0 if you hack the ROM image.\n");
|
||||||
|
|
||||||
return workRAM;
|
return workRAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user