Previous 199869 Revisions Next

r18317 Saturday 6th October, 2012 at 19:23:52 UTC by Wilbert Pol
(MESS) a2600.c: Fixed regressions for decathln and thwocker introduced with opbase handler/direct update handler changes. (nw)
[src/mess/drivers]a2600.c

trunk/src/mess/drivers/a2600.c
r18316r18317
11951195
11961196DIRECT_UPDATE_MEMBER(a2600_state::modeFE_opbase_handler)
11971197{
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);
12161205   return address;
12171206}
12181207
r18316r18317
12221211   /* Retrieve last byte read by the cpu (for this mapping scheme this
12231212       should be the last byte that was on the data bus
12241213    */
1225   m_FETimer = 1;
12261214   m_FE_old_opbase_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), this));
12271215}
12281216
12291217READ8_MEMBER(a2600_state::modeFE_switch_r)
12301218{
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);
12331224}
12341225
12351226WRITE8_MEMBER(a2600_state::modeFE_switch_w)
12361227{
12371228   space.write_byte(0xFE, data );
1238   modeFE_switch(offset, 0 );
1229   if ( ! space.debugger_access() )
1230   {
1231      modeFE_switch(offset, 0 );
1232   }
12391233}
12401234
12411235READ8_MEMBER(a2600_state::current_bank_r)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team