src/mame/machine/snes.c
| r8168 | r8169 | |
| 999 | 999 | } |
| 1000 | 1000 | else if ((state->cart[0].mode == SNES_MODE_21) && (state->cart[0].sram > 0)) |
| 1001 | 1001 | { |
| 1002 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1003 | | value = snes_ram[0x300000 + (offset & mask)]; |
| 1002 | // int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1003 | value = snes_ram[0x300000 + offset]; |
| 1004 | 1004 | } |
| 1005 | 1005 | else |
| 1006 | 1006 | { |
| r8168 | r8169 | |
| 1123 | 1123 | { |
| 1124 | 1124 | if (state->cart[0].sram > 0) |
| 1125 | 1125 | { |
| 1126 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1126 | int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1127 | 1127 | value = snes_ram[0x700000 + (offset & mask)]; |
| 1128 | 1128 | } |
| 1129 | 1129 | else |
| r8168 | r8169 | |
| 1162 | 1162 | value = memory_read_byte(space, offset); |
| 1163 | 1163 | else if ((offset >= 0x300000) && (state->cart[0].sram > 0)) |
| 1164 | 1164 | { |
| 1165 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1166 | | value = snes_ram[0x800000 + (offset & mask)]; |
| 1165 | // int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1166 | value = snes_ram[0x800000 + offset]; |
| 1167 | 1167 | } |
| 1168 | 1168 | else /* Area 0x6000-0x8000 with offset < 0x300000 is reserved */ |
| 1169 | 1169 | { |
| r8168 | r8169 | |
| 1324 | 1324 | } |
| 1325 | 1325 | else if ((state->cart[0].mode == SNES_MODE_21) && (state->cart[0].sram > 0)) |
| 1326 | 1326 | { |
| 1327 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1328 | | snes_ram[0x300000 + (offset & mask)] = data; |
| 1327 | // int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1328 | snes_ram[0x300000 + offset] = data; |
| 1329 | 1329 | } |
| 1330 | 1330 | else |
| 1331 | 1331 | logerror("snes_w_bank2: Attempt to write to reserved address: %X = %02x\n", offset + 0x300000, data); |
| r8168 | r8169 | |
| 1389 | 1389 | { |
| 1390 | 1390 | if (state->cart[0].sram > 0) |
| 1391 | 1391 | { |
| 1392 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1393 | | snes_ram[0x700000 + (offset & mask)] = data; |
| 1392 | int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1393 | snes_ram[0x700000 + + (offset & mask)] = data; |
| 1394 | 1394 | } |
| 1395 | 1395 | else |
| 1396 | 1396 | logerror("snes_w_bank5: Attempt to write to reserved address: %X = %02x\n", offset + 0x700000, data); |
| r8168 | r8169 | |
| 1423 | 1423 | memory_write_byte(space, offset, data); |
| 1424 | 1424 | else if ((offset >= 0x300000) && (state->cart[0].sram > 0)) |
| 1425 | 1425 | { |
| 1426 | | int mask = (state->cart[0].sram - 1) | 0xff0000; /* Limit SRAM size to what's actually present */ |
| 1427 | | snes_ram[0x800000 + (offset & mask)] = data; |
| 1426 | // int mask = state->cart[0].sram - 1; /* Limit SRAM size to what's actually present */ |
| 1427 | snes_ram[0x800000 + offset] = data; |
| 1428 | 1428 | } |
| 1429 | 1429 | else /* Area in 0x6000-0x8000 && offset < 0x300000 is Reserved! */ |
| 1430 | 1430 | logerror("snes_w_bank6: Attempt to write to reserved address: %X = %02x\n", offset + 0x800000, data); |