From aeb04395dd9421a6dcd9d442fd55d783a6c9f10d Mon Sep 17 00:00:00 2001 From: Ville Linde Date: Thu, 1 Jul 2021 19:09:04 +0300 Subject: k056230: clear network interrupt properly (fixes screen flashing in zr107) --- src/devices/machine/k056230.cpp | 30 ++++++++++++------------------ src/devices/machine/k056230.h | 6 ------ src/mame/drivers/gticlub.cpp | 2 -- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/src/devices/machine/k056230.cpp b/src/devices/machine/k056230.cpp index 55d0e22177d..8c0ad5d628c 100644 --- a/src/devices/machine/k056230.cpp +++ b/src/devices/machine/k056230.cpp @@ -33,7 +33,6 @@ DEFINE_DEVICE_TYPE(K056230, k056230_device, "k056230", "K056230 LANC") k056230_device::k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, K056230, tag, owner, clock) - , m_is_thunderh(0) , m_cpu(*this, finder_base::DUMMY_TAG) { } @@ -57,6 +56,10 @@ uint8_t k056230_device::read(offs_t offset) { return 0x08; } + case 1: // CRC Error register + { + return 0x00; + } } // logerror("k056230_r: %d %s\n", offset, machine().describe_context()); @@ -64,13 +67,6 @@ uint8_t k056230_device::read(offs_t offset) return 0; } -TIMER_CALLBACK_MEMBER(k056230_device::network_irq_clear) -{ - if (m_cpu) - m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE); -} - - void k056230_device::write(offs_t offset, uint8_t data) { switch(offset) @@ -83,17 +79,15 @@ void k056230_device::write(offs_t offset, uint8_t data) { if(data & 0x20) { - // Thunder Hurricane breaks otherwise... - if (!m_is_thunderh) - { - if (m_cpu) - m_cpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE); - - machine().scheduler().timer_set(attotime::from_usec(10), timer_expired_delegate(FUNC(k056230_device::network_irq_clear), this)); - } + if (m_cpu) + m_cpu->set_input_line(INPUT_LINE_IRQ2, ASSERT_LINE); + } + if ((data & 1) == 0) + { + if (m_cpu) + m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE); } -// else -// m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE); + break; } case 2: // Sub ID register diff --git a/src/devices/machine/k056230.h b/src/devices/machine/k056230.h index bfedc22d475..55643632b38 100644 --- a/src/devices/machine/k056230.h +++ b/src/devices/machine/k056230.h @@ -24,24 +24,18 @@ public: k056230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_thunderh_hack(bool thunderh) { m_is_thunderh = thunderh; } - uint32_t lanc_ram_r(offs_t offset, uint32_t mem_mask = ~0); void lanc_ram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); - TIMER_CALLBACK_MEMBER(network_irq_clear); - protected: // device-level overrides virtual void device_start() override; private: - bool m_is_thunderh; - required_device m_cpu; uint32_t m_ram[0x2000]; }; diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index 1fe88a639ec..d24e9cc54f7 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -913,8 +913,6 @@ void gticlub_state::thunderh(machine_config &config) // Todo: K056230 from the I m_adc1038->set_gti_club_hack(false); - m_k056230->set_thunderh_hack(true); - M68000(config, m_gn680, XTAL(32'000'000) / 2); // 16MHz m_gn680->set_addrmap(AS_PROGRAM, >iclub_state::gn680_memmap); } -- cgit v1.2.3