src/mame/machine/snes.c
| r7761 | r7762 | |
| 955 | 955 | else |
| 956 | 956 | value = snes_ram[offset]; |
| 957 | 957 | |
| 958 | | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 958 | if(!space->debugger_access) |
| 959 | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 960 | |
| 959 | 961 | return value; |
| 960 | 962 | } |
| 961 | 963 | |
| r7761 | r7762 | |
| 1012 | 1014 | else |
| 1013 | 1015 | value = snes_ram[0x300000 + offset]; |
| 1014 | 1016 | |
| 1015 | | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1017 | if(!space->debugger_access) |
| 1018 | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1016 | 1019 | |
| 1017 | 1020 | return value; |
| 1018 | 1021 | } |
| r7761 | r7762 | |
| 1052 | 1055 | else /* Mode 21 & 25 + SuperFX games */ |
| 1053 | 1056 | value = snes_ram[0x400000 + offset]; |
| 1054 | 1057 | |
| 1055 | | cpu_adjust_icount(space->cpu, -8); |
| 1058 | if(!space->debugger_access) |
| 1059 | cpu_adjust_icount(space->cpu, -8); |
| 1060 | |
| 1056 | 1061 | return value; |
| 1057 | 1062 | } |
| 1058 | 1063 | |
| r7761 | r7762 | |
| 1088 | 1093 | else if (snes_cart.mode & 0x0a) /* Mode 21 & 25 */ |
| 1089 | 1094 | value = snes_ram[0x600000 + offset]; |
| 1090 | 1095 | |
| 1091 | | cpu_adjust_icount(space->cpu, -8); |
| 1096 | if(!space->debugger_access) |
| 1097 | cpu_adjust_icount(space->cpu, -8); |
| 1098 | |
| 1092 | 1099 | return value; |
| 1093 | 1100 | } |
| 1094 | 1101 | |
| r7761 | r7762 | |
| 1122 | 1129 | else |
| 1123 | 1130 | value = snes_ram[0x700000 + offset]; |
| 1124 | 1131 | |
| 1125 | | cpu_adjust_icount(space->cpu, -8); |
| 1132 | if(!space->debugger_access) |
| 1133 | cpu_adjust_icount(space->cpu, -8); |
| 1134 | |
| 1126 | 1135 | return value; |
| 1127 | 1136 | } |
| 1128 | 1137 | |
| r7761 | r7762 | |
| 1168 | 1177 | else |
| 1169 | 1178 | value = snes_ram[0x800000 + offset]; |
| 1170 | 1179 | |
| 1171 | | cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset)); |
| 1180 | if(!space->debugger_access) |
| 1181 | cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset)); |
| 1182 | |
| 1172 | 1183 | return value; |
| 1173 | 1184 | } |
| 1174 | 1185 | |
| r7761 | r7762 | |
| 1219 | 1230 | else /* Mode 21 & 25 + SuperFX Games */ |
| 1220 | 1231 | value = snes_ram[0xc00000 + offset]; |
| 1221 | 1232 | |
| 1222 | | cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8)); |
| 1233 | if(!space->debugger_access) |
| 1234 | cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8)); |
| 1223 | 1235 | |
| 1224 | 1236 | return value; |
| 1225 | 1237 | } |
| r7761 | r7762 | |
| 1266 | 1278 | else |
| 1267 | 1279 | logerror( "(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset ); |
| 1268 | 1280 | |
| 1269 | | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1281 | if(!space->debugger_access) |
| 1282 | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1270 | 1283 | } |
| 1271 | 1284 | |
| 1272 | 1285 | /* 0x300000 - 0x3fffff */ |
| r7761 | r7762 | |
| 1317 | 1330 | else |
| 1318 | 1331 | logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x300000); |
| 1319 | 1332 | |
| 1320 | | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1333 | if(!space->debugger_access) |
| 1334 | cpu_adjust_icount(space->cpu, -snes_bank_0x00_0x3f_cycles(space->machine, offset)); |
| 1321 | 1335 | } |
| 1322 | 1336 | |
| 1323 | 1337 | /* 0x600000 - 0x6fffff */ |
| r7761 | r7762 | |
| 1341 | 1355 | else if (snes_cart.mode & 0x0a) |
| 1342 | 1356 | logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x600000); |
| 1343 | 1357 | |
| 1344 | | cpu_adjust_icount(space->cpu, -8); |
| 1358 | if(!space->debugger_access) |
| 1359 | cpu_adjust_icount(space->cpu, -8); |
| 1345 | 1360 | } |
| 1346 | 1361 | |
| 1347 | 1362 | /* 0x700000 - 0x7dffff */ |
| r7761 | r7762 | |
| 1364 | 1379 | else if (snes_cart.mode & 0x0a) |
| 1365 | 1380 | logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x700000); |
| 1366 | 1381 | |
| 1367 | | cpu_adjust_icount(space->cpu, -8); |
| 1382 | if(!space->debugger_access) |
| 1383 | cpu_adjust_icount(space->cpu, -8); |
| 1368 | 1384 | } |
| 1369 | 1385 | |
| 1370 | 1386 | |
| r7761 | r7762 | |
| 1411 | 1427 | else |
| 1412 | 1428 | logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0x800000); |
| 1413 | 1429 | |
| 1414 | | cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset)); |
| 1430 | if(!space->debugger_access) |
| 1431 | cpu_adjust_icount(space->cpu, -snes_bank_0x80_0xbf_cycles(space->machine, offset)); |
| 1415 | 1432 | } |
| 1416 | 1433 | |
| 1417 | 1434 | |
| r7761 | r7762 | |
| 1449 | 1466 | else if (snes_cart.mode & 0x0a) |
| 1450 | 1467 | logerror("(PC=%06x) Attempt to write to ROM address: %X\n",cpu_get_pc(space->cpu),offset + 0xc00000); |
| 1451 | 1468 | |
| 1452 | | cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8)); |
| 1469 | if(!space->debugger_access) |
| 1470 | cpu_adjust_icount(space->cpu, -((snes_ram[MEMSEL] & 1) ? 6 : 8)); |
| 1453 | 1471 | } |
| 1454 | 1472 | |
| 1455 | 1473 | |