trunk/src/mess/drivers/bigbord2.c
r18012 | r18013 | |
175 | 175 | |
176 | 176 | WRITE8_MEMBER( bigbord2_state::bigbord2_kbd_put ) |
177 | 177 | { |
| 178 | address_space &mem = *m_maincpu->space(AS_PROGRAM); |
| 179 | |
178 | 180 | if (data) |
179 | 181 | { |
180 | 182 | m_term_data = data; |
181 | 183 | m_term_status = 8; |
182 | 184 | m_ctca->trg0(0); |
183 | 185 | m_ctca->trg0(1); |
184 | | if (space.read_byte(0xf13d) == 0x4d) |
| 186 | if (mem.read_byte(0xf13d) == 0x4d) |
185 | 187 | { |
186 | 188 | // simulate interrupt by saving current pc on |
187 | 189 | // the stack and jumping to interrupt handler. |
188 | 190 | UINT16 spreg = m_maincpu->state_int(Z80_SP); |
189 | 191 | UINT16 pcreg = m_maincpu->state_int(Z80_PC); |
190 | 192 | spreg--; |
191 | | space.write_byte(spreg, pcreg >> 8); |
| 193 | mem.write_byte(spreg, pcreg >> 8); |
192 | 194 | spreg--; |
193 | | space.write_byte(spreg, pcreg); |
| 195 | mem.write_byte(spreg, pcreg); |
194 | 196 | m_maincpu->set_state_int(Z80_SP, spreg); |
195 | 197 | m_maincpu->set_state_int(Z80_PC, 0xF120); |
196 | 198 | } |
trunk/src/mess/drivers/p8k.c
r18012 | r18013 | |
175 | 175 | |
176 | 176 | WRITE8_MEMBER( p8k_state::kbd_put ) |
177 | 177 | { |
| 178 | address_space &mem = *m_maincpu->space(AS_PROGRAM); |
178 | 179 | m_term_data = data; |
179 | 180 | // This is a dreadful hack.. |
180 | 181 | // simulate interrupt by saving current pc on |
r18012 | r18013 | |
182 | 183 | UINT16 spreg = m_maincpu->state_int(Z80_SP); |
183 | 184 | UINT16 pcreg = m_maincpu->state_int(Z80_PC); |
184 | 185 | spreg--; |
185 | | space.write_byte(spreg, pcreg >> 8); |
| 186 | mem.write_byte(spreg, pcreg >> 8); |
186 | 187 | spreg--; |
187 | | space.write_byte(spreg, pcreg); |
| 188 | mem.write_byte(spreg, pcreg); |
188 | 189 | m_maincpu->set_state_int(Z80_SP, spreg); |
189 | 190 | m_maincpu->set_state_int(Z80_PC, 0x078A); |
190 | 191 | } |
r18012 | r18013 | |
438 | 439 | |
439 | 440 | WRITE8_MEMBER( p8k_state::kbd_put_16 ) |
440 | 441 | { |
| 442 | address_space &mem = *m_maincpu->space(AS_PROGRAM); |
441 | 443 | // keyboard int handler is at 0x0700 |
442 | 444 | m_term_data = data; |
443 | 445 | // This is another dire hack.. |
444 | | UINT8 offs = space.read_byte(0x43a5); |
| 446 | UINT8 offs = mem.read_byte(0x43a5); |
445 | 447 | 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); |
448 | 450 | } |
449 | 451 | |
450 | 452 | static GENERIC_TERMINAL_INTERFACE( terminal_intf_16 ) |