[Core/MD] fixed ROM size detection when enabling/disabling SRAM on power-on (fixes SRAM support in Hardball 95, NBA Hang Time and other 3MB games with SRAM mapped at 0x300000)

This commit is contained in:
ekeeke 2019-03-29 01:51:23 +01:00
parent 77f1529661
commit 5f8156ef72
4 changed files with 1 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 MiB

After

Width:  |  Height:  |  Size: 3.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 MiB

After

Width:  |  Height:  |  Size: 3.9 MiB

View File

@ -380,7 +380,7 @@ void md_cart_init(void)
if (sram.on && !sram.custom) if (sram.on && !sram.custom)
{ {
/* SRAM is mapped by default unless it overlaps with ROM area (Phantasy Star 4, Beyond Oasis/Legend of Thor, World Series Baseball 9x, Duke Nukem 3D,...) */ /* SRAM is mapped by default unless it overlaps with ROM area (Phantasy Star 4, Beyond Oasis/Legend of Thor, World Series Baseball 9x, Duke Nukem 3D,...) */
if (sram.start >= size) if (sram.start >= cart.romsize)
{ {
m68k.memory_map[sram.start >> 16].base = sram.sram; m68k.memory_map[sram.start >> 16].base = sram.sram;
m68k.memory_map[sram.start >> 16].read8 = sram_read_byte; m68k.memory_map[sram.start >> 16].read8 = sram_read_byte;