mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Fixed various SNES SRAM issues [Fabio Priuli, Angelo Salese]
This commit is contained in:
parent
ba841c0efe
commit
cc52d6e803
@ -23,7 +23,7 @@
|
||||
#define DOTCLK_NTSC (MCLK_NTSC/4)
|
||||
#define DOTCLK_PAL (MCLK_PAL/4)
|
||||
|
||||
#define SNES_LAYER_DEBUG 0
|
||||
#define SNES_LAYER_DEBUG 1
|
||||
|
||||
/* Debug definitions */
|
||||
#ifdef MAME_DEBUG
|
||||
|
@ -994,9 +994,7 @@ READ8_HANDLER( snes_r_bank2 )
|
||||
}
|
||||
else if ((snes_cart.mode == SNES_MODE_21) && (snes_cart.sram > 0))
|
||||
{
|
||||
int mask = (snes_cart.sram - 1); /* Limit SRAM size to what's actually present */
|
||||
offset -= 0x6000;
|
||||
value = snes_ram[0x306000 + (offset & mask)];
|
||||
value = snes_ram[0x300000 + offset];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1157,9 +1155,7 @@ READ8_HANDLER( snes_r_bank6 )
|
||||
value = memory_read_byte(space, offset);
|
||||
else if ((offset >= 0x300000) && (snes_cart.sram > 0))
|
||||
{
|
||||
int mask = (snes_cart.sram - 1); /* Limit SRAM size to what's actually present */
|
||||
offset -= 0x6000;
|
||||
value = snes_ram[0x806000 + (offset & mask)]; /* SRAM */
|
||||
value = snes_ram[0x800000 + offset]; /* SRAM */
|
||||
}
|
||||
else /* Area 0x6000-0x8000 with offset < 0x300000 is reserved */
|
||||
{
|
||||
@ -1308,9 +1304,7 @@ WRITE8_HANDLER( snes_w_bank2 )
|
||||
}
|
||||
else if ((snes_cart.mode == SNES_MODE_21) && (snes_cart.sram > 0))
|
||||
{
|
||||
int mask = (snes_cart.sram - 1); /* Limit SRAM size to what's actually present */
|
||||
offset -= 0x6000;
|
||||
snes_ram[0x306000 + (offset & mask)] = data;
|
||||
snes_ram[0x300000 + offset] = data;
|
||||
}
|
||||
else
|
||||
logerror("snes_w_bank2: Attempt to write to reserved address: %X = %02x\n", offset + 0x300000, data);
|
||||
@ -1405,9 +1399,7 @@ WRITE8_HANDLER( snes_w_bank6 )
|
||||
memory_write_byte(space, offset, data);
|
||||
else if ((offset >= 0x300000) && (snes_cart.sram > 0))
|
||||
{
|
||||
int mask = (snes_cart.sram - 1); /* Limit SRAM size to what's actually present */
|
||||
offset -= 0x6000;
|
||||
snes_ram[0xb06000 + (offset & mask)] = data;
|
||||
snes_ram[0xb00000 + offset] = data;
|
||||
}
|
||||
else /* Area in 0x6000-0x8000 && offset < 0x300000 is Reserved! */
|
||||
logerror("snes_w_bank6: Attempt to write to reserved address: %X = %02x\n", offset + 0x800000, data);
|
||||
|
Loading…
Reference in New Issue
Block a user