Correct LoROM SRAM mapping for smaller ROMs

SRAM is sometimes mapped not just to 70:0000-7fff but also to
70:8000-ffff if ROM size permits it (i.e. the ROM is small enough
to avoid overlap).
Map SRAM to 8000-ffff if the ROM mask denotes a ROM <= 16 MBits.
This commit is contained in:
Maximilian Rehkopf
2013-06-30 23:16:27 +02:00
parent 78beed80d7
commit 39b07df47e

View File

@@ -86,12 +86,12 @@ assign IS_SAVERAM = SAVERAM_MASK[0]
& &SNES_ADDR[14:13]
& !SNES_ADDR[15]
)
/* LoROM: SRAM @ Bank 0x70-0x7d, 0xf0-0xfd Offset 0000-7fff
TODO: 0000-ffff for small ROMs? */
/* LoROM: SRAM @ Bank 0x70-0x7d, 0xf0-0xfd
* Offset 0000-7fff for ROM >= 32 MBit, otherwise 0000-ffff */
:(MAPPER == 3'b001)
? (&SNES_ADDR[22:20]
& (SNES_ADDR[19:16] < 4'b1110)
& !SNES_ADDR[15]
& (~SNES_ADDR[15] | ~ROM_MASK[21])
)
/* BS-X: SRAM @ Bank 0x10-0x17 Offset 5000-5fff */
:(MAPPER == 3'b011)