src/mame/machine/snes.c
| r13262 | r13263 | |
| 1050 | 1050 | } |
| 1051 | 1051 | else if ((state->m_cart[0].mode == SNES_MODE_21) && (state->m_cart[0].sram > 0)) |
| 1052 | 1052 | { |
| 1053 | | /* Donkey Kong Country checks this */ |
| 1054 | | int mask = state->m_cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1053 | /* Donkey Kong Country checks this and detects a copier if 0x800 is not masked out due to sram size */ |
| 1054 | /* OTOH Secret of Mana does not work properly if sram is not mirrored on later banks */ |
| 1055 | int mask = (state->m_cart[0].sram - 1) | 0xffe000; /* Limit SRAM size to what's actually present */ |
| 1055 | 1056 | value = snes_ram[0x300000 + (offset & mask)]; |
| 1056 | 1057 | } |
| 1057 | 1058 | else |
| r13262 | r13263 | |
| 1411 | 1412 | } |
| 1412 | 1413 | else if ((state->m_cart[0].mode == SNES_MODE_21) && (state->m_cart[0].sram > 0)) |
| 1413 | 1414 | { |
| 1414 | | /* Donkey Kong Country checks this */ |
| 1415 | | int mask = state->m_cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1415 | /* Donkey Kong Country checks this and detects a copier if 0x800 is not masked out due to sram size */ |
| 1416 | /* OTOH Secret of Mana does not work properly if sram is not mirrored on later banks */ |
| 1417 | int mask = (state->m_cart[0].sram - 1) | 0xffe000; /* Limit SRAM size to what's actually present */ |
| 1416 | 1418 | snes_ram[0x300000 + (offset & mask)] = data; |
| 1417 | 1419 | } |
| 1418 | 1420 | else |