Fix pokeymans pirate roms on gpgx (#1986)

mapper_32k_w expects to be able to write to rom area, so those roms now need larger savestate space
We could be extra clever and alloc_invisible the space and then restore after loadstate, but this pokeymans garbage doesn't deserve that work
This commit is contained in:
nattthebear 2020-05-06 09:39:51 -04:00 committed by GitHub
parent 974792cdfe
commit 722358c1b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

Binary file not shown.

View File

@ -50,7 +50,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
SbrkHeapSizeKB = 512,
SealedHeapSizeKB = 36 * 1024,
InvisibleHeapSizeKB = 4 * 1024,
PlainHeapSizeKB = 64,
PlainHeapSizeKB = 64 + 1024,
MmapHeapSizeKB = 1 * 1024,
SkipCoreConsistencyCheck = comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxCoreConsistencyCheck),
SkipMemoryConsistencyCheck = comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxMemoryConsistencyCheck),

View File

@ -45,6 +45,7 @@
#include "eeprom_i2c.h"
#include "eeprom_spi.h"
#include "gamepad.h"
#include <emulibc.h>
#define CART_CNT (55)
@ -239,6 +240,9 @@ static const md_entry_t rom_database[CART_CNT] =
};
static uint8* mapper_32k_scratch = NULL;
/************************************************************
Cart Hardware initialization
*************************************************************/
@ -544,6 +548,12 @@ void md_cart_init(void)
j++;
}
if (rom_database[i].cart_hw.regs_w == custom_regs_w)
{
// allocate extra memory needed for the bank swapping on these carts
mapper_32k_scratch = alloc_plain(1 << 20);
}
/* leave loop */
i = CART_CNT;
}
@ -1479,8 +1489,8 @@ static void mapper_32k_w(uint32 data)
{
for (i=0; i<0x10; i++)
{
/* Remap to unused ROM area */
m68k.memory_map[i].base = &cart.rom[0x400000 + (i << 16)];
/* Remap to extra scratch area */
m68k.memory_map[i].base = &mapper_32k_scratch[i << 16];
/* address = address OR (value << 15) */
memcpy(m68k.memory_map[i].base, cart.rom + ((i << 16) | (data & 0x3f) << 15), 0x8000);