trunk/src/mess/drivers/a2600.c
r18316 | r18317 | |
1195 | 1195 | |
1196 | 1196 | DIRECT_UPDATE_MEMBER(a2600_state::modeFE_opbase_handler) |
1197 | 1197 | { |
1198 | | if ( ! direct.space().debugger_access() ) |
1199 | | { |
1200 | | if ( ! m_FETimer ) |
1201 | | { |
1202 | | /* Still cheating a bit here by looking bit 13 of the address..., but the high byte of the |
1203 | | cpu should be the last byte that was on the data bus and so should determine the bank |
1204 | | we should switch in. */ |
1205 | | m_bank_base[1] = memregion("user1")->base() + 0x1000 * ( ( address & 0x2000 ) ? 0 : 1 ); |
1206 | | membank("bank1")->set_base(m_bank_base[1] ); |
1207 | | /* and restore old opbase handler */ |
1208 | | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(m_FE_old_opbase_handler); |
1209 | | } |
1210 | | else |
1211 | | { |
1212 | | /* Wait for one memory access to have passed (reading of new PCH either from code or from stack) */ |
1213 | | m_FETimer--; |
1214 | | } |
1215 | | } |
| 1198 | /* Still cheating a bit here by looking bit 13 of the address..., but the high byte of the |
| 1199 | cpu should be the last byte that was on the data bus and so should determine the bank |
| 1200 | we should switch in. */ |
| 1201 | m_bank_base[1] = memregion("user1")->base() + 0x1000 * ( ( machine().device("maincpu")->safe_pc() & 0x2000 ) ? 0 : 1 ); |
| 1202 | membank("bank1")->set_base(m_bank_base[1] ); |
| 1203 | /* and restore old opbase handler */ |
| 1204 | machine().device("maincpu")->memory().space(AS_PROGRAM).set_direct_update_handler(m_FE_old_opbase_handler); |
1216 | 1205 | return address; |
1217 | 1206 | } |
1218 | 1207 | |
r18316 | r18317 | |
1222 | 1211 | /* Retrieve last byte read by the cpu (for this mapping scheme this |
1223 | 1212 | should be the last byte that was on the data bus |
1224 | 1213 | */ |
1225 | | m_FETimer = 1; |
1226 | 1214 | m_FE_old_opbase_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), this)); |
1227 | 1215 | } |
1228 | 1216 | |
1229 | 1217 | READ8_MEMBER(a2600_state::modeFE_switch_r) |
1230 | 1218 | { |
1231 | | modeFE_switch(offset, 0 ); |
1232 | | return space.read_byte(0xFE ); |
| 1219 | if ( ! space.debugger_access() ) |
| 1220 | { |
| 1221 | modeFE_switch(offset, 0 ); |
| 1222 | } |
| 1223 | return space.read_byte(0xFE); |
1233 | 1224 | } |
1234 | 1225 | |
1235 | 1226 | WRITE8_MEMBER(a2600_state::modeFE_switch_w) |
1236 | 1227 | { |
1237 | 1228 | space.write_byte(0xFE, data ); |
1238 | | modeFE_switch(offset, 0 ); |
| 1229 | if ( ! space.debugger_access() ) |
| 1230 | { |
| 1231 | modeFE_switch(offset, 0 ); |
| 1232 | } |
1239 | 1233 | } |
1240 | 1234 | |
1241 | 1235 | READ8_MEMBER(a2600_state::current_bank_r) |