From b76ff4cf64cd66ac362d0f8b3b9a089a6beb9b77 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 4 May 2022 15:25:31 -0400 Subject: i8214: Back out previous changes to device emulation in e38360692285e7fa0e0574b8b00585536b696949 except as a system-specific hack --- src/devices/machine/i8214.cpp | 16 +++++++++------- src/devices/machine/i8214.h | 4 ++++ src/mame/drivers/pc8801.cpp | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/devices/machine/i8214.cpp b/src/devices/machine/i8214.cpp index 9cf6f33f7f0..b5a8c4140be 100644 --- a/src/devices/machine/i8214.cpp +++ b/src/devices/machine/i8214.cpp @@ -8,10 +8,8 @@ #include "emu.h" #include "i8214.h" -#include //#define VERBOSE 1 -//#define LOG_OUTPUT_STREAM std::cout #include "logmacro.h" @@ -42,8 +40,8 @@ void i8214_device::trigger_interrupt(int level) // set interrupt line m_write_int(ASSERT_LINE); - - //m_write_int(CLEAR_LINE); + if (!m_int_dis_hack) + m_write_int(CLEAR_LINE); // TODO: wait one clock cycle to clear } @@ -56,7 +54,7 @@ void i8214_device::check_interrupt() if (m_int_dis) { LOG("not checking interrupts because m_int_dis (%02x)\n", m_r); - if (m_r == 0xff) + if (m_int_dis_hack && m_r == 0xff) { m_int_dis = 0; m_write_int(CLEAR_LINE); @@ -98,8 +96,11 @@ void i8214_device::check_interrupt() } } - m_int_dis = 0; - m_write_int(CLEAR_LINE); + if (m_int_dis_hack) + { + m_int_dis = 0; + m_write_int(CLEAR_LINE); + } } @@ -116,6 +117,7 @@ i8214_device::i8214_device(const machine_config &mconfig, const char *tag, devic : device_t(mconfig, I8214, tag, owner, clock) , m_write_int(*this) , m_write_enlg(*this) + , m_int_dis_hack(false) , m_inte(0) , m_int_dis(0) , m_a(0) diff --git a/src/devices/machine/i8214.h b/src/devices/machine/i8214.h index 9b567660990..d8514e400ef 100644 --- a/src/devices/machine/i8214.h +++ b/src/devices/machine/i8214.h @@ -32,6 +32,8 @@ public: // construction/destruction i8214_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void set_int_dis_hack(bool hack) { m_int_dis_hack = hack; } + auto int_wr_callback() { return m_write_int.bind(); } auto enlg_wr_callback() { return m_write_enlg.bind(); } @@ -58,6 +60,8 @@ private: devcb_write_line m_write_int; devcb_write_line m_write_enlg; + bool m_int_dis_hack; + int m_inte; // interrupt enable int m_int_dis; // interrupt (latch) disable flip-flop int m_a; // request level diff --git a/src/mame/drivers/pc8801.cpp b/src/mame/drivers/pc8801.cpp index 81456fa022c..d00eea1b2e8 100644 --- a/src/mame/drivers/pc8801.cpp +++ b/src/mame/drivers/pc8801.cpp @@ -1710,7 +1710,6 @@ void pc8801_state::pc8801(machine_config &config) Z80(config, m_maincpu, MASTER_CLOCK); // ~4 MHz, selectable to ~8 MHz on late models m_maincpu->set_addrmap(AS_PROGRAM, &pc8801_state::main_map); m_maincpu->set_addrmap(AS_IO, &pc8801_state::main_io); -// m_maincpu->set_vblank_int("screen", FUNC(pc8801_state::vrtc_irq_w)); m_maincpu->set_irq_acknowledge_callback(FUNC(pc8801_state::int_ack_cb)); PC80S31(config, m_pc80s31, MASTER_CLOCK); @@ -1721,6 +1720,7 @@ void pc8801_state::pc8801(machine_config &config) I8214(config, m_pic, MASTER_CLOCK); m_pic->int_wr_callback().set(FUNC(pc8801_state::irq_w)); + m_pic->set_int_dis_hack(true); UPD1990A(config, m_rtc); //CENTRONICS(config, "centronics", centronics_devices, "printer"); -- cgit v1.2.3