summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2011-11-15 13:52:36 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2011-11-15 13:52:36 +0000
commit2eaa06af747f142c171c5298c6b0d71e58e70f39 (patch)
tree5dde50f1bbc2a5d07470e326bb136731d53b868a
parenta1a413a621bdd4dd48d3409af5f97296e33c883d (diff)
fixed a SRAM issue with SNES. no whatsnew. (credited in MESS)
-rw-r--r--src/mame/machine/snes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c
index 20239605df5..81b5c29c565 100644
--- a/src/mame/machine/snes.c
+++ b/src/mame/machine/snes.c
@@ -1050,8 +1050,9 @@ READ8_HANDLER( snes_r_bank2 )
}
else if ((state->m_cart[0].mode == SNES_MODE_21) && (state->m_cart[0].sram > 0))
{
- /* Donkey Kong Country checks this */
- int mask = state->m_cart[0].sram - 1; /* Limit SRAM size to what's actually present */
+ /* Donkey Kong Country checks this and detects a copier if 0x800 is not masked out due to sram size */
+ /* OTOH Secret of Mana does not work properly if sram is not mirrored on later banks */
+ int mask = (state->m_cart[0].sram - 1) | 0xffe000; /* Limit SRAM size to what's actually present */
value = snes_ram[0x300000 + (offset & mask)];
}
else
@@ -1411,8 +1412,9 @@ WRITE8_HANDLER( snes_w_bank2 )
}
else if ((state->m_cart[0].mode == SNES_MODE_21) && (state->m_cart[0].sram > 0))
{
- /* Donkey Kong Country checks this */
- int mask = state->m_cart[0].sram - 1; /* Limit SRAM size to what's actually present */
+ /* Donkey Kong Country checks this and detects a copier if 0x800 is not masked out due to sram size */
+ /* OTOH Secret of Mana does not work properly if sram is not mirrored on later banks */
+ int mask = (state->m_cart[0].sram - 1) | 0xffe000; /* Limit SRAM size to what's actually present */
snes_ram[0x300000 + (offset & mask)] = data;
}
else