[Core/MD] fixed SRAM bankswitching for games also using ROM bankswitching (fixes Astebros)

This commit is contained in:
ekeeke 2023-06-13 01:00:56 +02:00
parent 95bde804a6
commit 4bb149ba0b
4 changed files with 7 additions and 12 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 MiB

After

Width:  |  Height:  |  Size: 4.0 MiB

View File

@ -999,7 +999,6 @@ static void mapper_sega_w(uint32 data)
if (sram.on) if (sram.on)
{ {
/* Backup RAM mapped to $200000-$20ffff (normally mirrored up to $3fffff but this breaks Sonic Megamix and no game need it) */ /* Backup RAM mapped to $200000-$20ffff (normally mirrored up to $3fffff but this breaks Sonic Megamix and no game need it) */
m68k.memory_map[0x20].base = sram.sram;
m68k.memory_map[0x20].read8 = sram_read_byte; m68k.memory_map[0x20].read8 = sram_read_byte;
m68k.memory_map[0x20].read16 = sram_read_word; m68k.memory_map[0x20].read16 = sram_read_word;
zbank_memory_map[0x20].read = sram_read_byte; zbank_memory_map[0x20].read = sram_read_byte;
@ -1031,17 +1030,13 @@ static void mapper_sega_w(uint32 data)
} }
else else
{ {
/* cartridge ROM mapped to $200000-$3fffff */ /* cartridge ROM mapped to $200000-$20ffff */
for (i=0x20; i<0x40; i++) m68k.memory_map[0x20].read8 = NULL;
{ m68k.memory_map[0x20].read16 = NULL;
m68k.memory_map[i].base = cart.rom + ((i<<16) & cart.mask); zbank_memory_map[0x20].read = NULL;
m68k.memory_map[i].read8 = NULL; m68k.memory_map[0x20].write8 = m68k_unused_8_w;
m68k.memory_map[i].read16 = NULL; m68k.memory_map[0x20].write16 = m68k_unused_16_w;
zbank_memory_map[i].read = NULL; zbank_memory_map[0x20].write = zbank_unused_w;
m68k.memory_map[i].write8 = m68k_unused_8_w;
m68k.memory_map[i].write16 = m68k_unused_16_w;
zbank_memory_map[i].write = zbank_unused_w;
}
} }
} }