Previous 199869 Revisions Next

r18013 Wednesday 19th September, 2012 at 10:51:16 UTC by Robbbert
(MESS) p8000, p8000_16, bigbord2: fix regression in keyboard due to 'address_space' problem.
[src/mess/drivers]bigbord2.c p8k.c

trunk/src/mess/drivers/bigbord2.c
r18012r18013
175175
176176WRITE8_MEMBER( bigbord2_state::bigbord2_kbd_put )
177177{
178   address_space &mem = *m_maincpu->space(AS_PROGRAM);
179
178180   if (data)
179181   {
180182      m_term_data = data;
181183      m_term_status = 8;
182184      m_ctca->trg0(0);
183185      m_ctca->trg0(1);
184      if (space.read_byte(0xf13d) == 0x4d)
186      if (mem.read_byte(0xf13d) == 0x4d)
185187      {
186188         // simulate interrupt by saving current pc on
187189         // the stack and jumping to interrupt handler.
188190         UINT16 spreg = m_maincpu->state_int(Z80_SP);
189191         UINT16 pcreg = m_maincpu->state_int(Z80_PC);
190192         spreg--;
191         space.write_byte(spreg, pcreg >> 8);
193         mem.write_byte(spreg, pcreg >> 8);
192194         spreg--;
193         space.write_byte(spreg, pcreg);
195         mem.write_byte(spreg, pcreg);
194196         m_maincpu->set_state_int(Z80_SP, spreg);
195197         m_maincpu->set_state_int(Z80_PC, 0xF120);
196198      }
trunk/src/mess/drivers/p8k.c
r18012r18013
175175
176176WRITE8_MEMBER( p8k_state::kbd_put )
177177{
178   address_space &mem = *m_maincpu->space(AS_PROGRAM);
178179   m_term_data = data;
179180   // This is a dreadful hack..
180181   // simulate interrupt by saving current pc on
r18012r18013
182183   UINT16 spreg = m_maincpu->state_int(Z80_SP);
183184   UINT16 pcreg = m_maincpu->state_int(Z80_PC);
184185   spreg--;
185   space.write_byte(spreg, pcreg >> 8);
186   mem.write_byte(spreg, pcreg >> 8);
186187   spreg--;
187   space.write_byte(spreg, pcreg);
188   mem.write_byte(spreg, pcreg);
188189   m_maincpu->set_state_int(Z80_SP, spreg);
189190   m_maincpu->set_state_int(Z80_PC, 0x078A);
190191}
r18012r18013
438439
439440WRITE8_MEMBER( p8k_state::kbd_put_16 )
440441{
442   address_space &mem = *m_maincpu->space(AS_PROGRAM);
441443   // keyboard int handler is at 0x0700
442444   m_term_data = data;
443445   // This is another dire hack..
444   UINT8 offs = space.read_byte(0x43a5);
446   UINT8 offs = mem.read_byte(0x43a5);
445447   UINT16 addr = 0x41b0 + (UINT16) offs;
446   space.write_byte(addr, data);
447   space.write_byte(0x43a0, 1);
448   mem.write_byte(addr, data);
449   mem.write_byte(0x43a0, 1);
448450}
449451
450452static GENERIC_TERMINAL_INTERFACE( terminal_intf_16 )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team