diff options
| author | 2014-07-20 14:27:28 +0000 | |
|---|---|---|
| committer | 2014-07-20 14:27:28 +0000 | |
| commit | 65ccadde164907eb36ff360c1559cc1486eef195 (patch) | |
| tree | 6f2d044f590f424b43a436ae3b1fed6145df21e3 /src | |
| parent | 3de928399713a3020e5fc3016a53ac6725ddcbd8 (diff) | |
fix irqline problem
Diffstat (limited to 'src')
| -rw-r--r-- | src/emu/cpu/tms7000/tms7000.c | 43 | ||||
| -rw-r--r-- | src/emu/cpu/tms7000/tms7000.h | 8 |
2 files changed, 27 insertions, 24 deletions
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index 30266fa6f9d..68b85a6efd3 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -318,51 +318,53 @@ void tms7000_device::device_reset() // interrupts //------------------------------------------------- -void tms7000_device::execute_set_input(int irqline, int state) +void tms7000_device::execute_set_input(int extline, int state) { - assert(irqline == TMS7000_INT1_LINE || irqline == TMS7000_INT3_LINE); + if (extline != TMS7000_INT1_LINE && extline != TMS7000_INT3_LINE) + return; + bool irqstate = (state == CLEAR_LINE) ? false : true; // reverse polarity (70cx2-only) - if (m_io_control[2] & (0x01 << (4 * irqline))) + if (m_io_control[2] & (0x01 << (4 * extline))) irqstate = !irqstate; - if (m_irq_state[irqline] != irqstate) + if (m_irq_state[extline] != irqstate) { - m_irq_state[irqline] = irqstate; + m_irq_state[extline] = irqstate; // set/clear internal irq flag - flag_ext_interrupt(irqline); + flag_ext_interrupt(extline); - if (m_irq_state[irqline]) + if (m_irq_state[extline]) { // latch timer 1 on INT3 - if (irqline == TMS7000_INT3_LINE) + if (extline == TMS7000_INT3_LINE) m_timer_capture_latch[0] = m_timer_decrementer[0]; // on 70cx2, latch timer 2 on INT1 - if (irqline == TMS7000_INT1_LINE && chip_is_family_70cx2()) + if (extline == TMS7000_INT1_LINE && chip_is_family_70cx2()) m_timer_capture_latch[1] = m_timer_decrementer[1]; // clear external if it's edge-triggered (70cx2-only) - if (m_io_control[2] & (0x02 << (4 * irqline))) - m_irq_state[irqline] = false; + if (m_io_control[2] & (0x02 << (4 * extline))) + m_irq_state[extline] = false; check_interrupts(); } } } -void tms7000_device::flag_ext_interrupt(int irqline) +void tms7000_device::flag_ext_interrupt(int extline) { - if (irqline != TMS7000_INT1_LINE && irqline != TMS7000_INT3_LINE) + if (extline != TMS7000_INT1_LINE && extline != TMS7000_INT3_LINE) return; // set/clear for pending external interrupt - if (m_irq_state[irqline]) - m_io_control[0] |= (0x02 << (4 * irqline)); + if (m_irq_state[extline]) + m_io_control[0] |= (0x02 << (4 * extline)); else - m_io_control[0] &= ~(0x02 << (4 * irqline)); + m_io_control[0] &= ~(0x02 << (4 * extline)); } void tms7000_device::check_interrupts() @@ -381,8 +383,9 @@ void tms7000_device::check_interrupts() { // ack m_io_control[irqline > 2] &= ~(0x02 << shift); - - flag_ext_interrupt(irqline); + if (irqline == 0 || irqline == 2) + flag_ext_interrupt(irqline / 2); + do_interrupt(irqline); return; } @@ -509,7 +512,7 @@ READ8_MEMBER(tms7000_device::tms7000_pf_r) return m_port_ddr[offset / 2 - 2]; default: - logerror("%s: tms7000_pf_r @ $%04x\n", tag(), offset); + logerror("'%s' (%04X): tms7000_pf_r @ $%04x\n", tag(), m_pc, offset); break; } @@ -593,7 +596,7 @@ WRITE8_MEMBER(tms7000_device::tms7000_pf_w) break; default: - logerror("%s: tms7000_pf_w @ $%04x = $%02x\n", tag(), offset, data); + logerror("'%s' (%04X): tms7000_pf_w @ $%04x = $%02x\n", tag(), m_pc, offset, data); break; } } diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h index 1f0cb89da5a..f74a2af7bab 100644 --- a/src/emu/cpu/tms7000/tms7000.h +++ b/src/emu/cpu/tms7000/tms7000.h @@ -57,8 +57,8 @@ public: tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal, UINT32 info_flags, const char *shortname, const char *source); - DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { logerror("%s: unmapped_rf_r @ $%04x\n", tag(), offset + 0x80); return 0; }; - DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("%s: unmapped_rf_w @ $%04x = $%02x\n", tag(), offset + 0x80, data); }; + DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; }; + DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); }; DECLARE_READ8_MEMBER(tms7000_pf_r); DECLARE_WRITE8_MEMBER(tms7000_pf_w); @@ -83,7 +83,7 @@ protected: virtual UINT32 execute_max_cycles() const { return 49; } virtual UINT32 execute_input_lines() const { return 2; } virtual void execute_run(); - virtual void execute_set_input(int irqline, int state); + virtual void execute_set_input(int extline, int state); // device_memory_interface overrides virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const { return (spacenum == AS_PROGRAM) ? &m_program_config : ( (spacenum == AS_IO) ? &m_io_config : NULL ); } @@ -128,7 +128,7 @@ protected: UINT8 m_port_latch[4]; UINT8 m_port_ddr[4]; - void flag_ext_interrupt(int irqline); + void flag_ext_interrupt(int extline); void check_interrupts(); void do_interrupt(int irqline); |
