k056230: clear network interrupt properly (fixes screen flashing in zr107)

This commit is contained in:
Ville Linde 2021-07-01 19:09:04 +03:00
parent 55132aae2f
commit aeb04395dd
3 changed files with 12 additions and 26 deletions

View File

@ -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);
}
// else
// m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE);
if ((data & 1) == 0)
{
if (m_cpu)
m_cpu->set_input_line(INPUT_LINE_IRQ2, CLEAR_LINE);
}
break;
}
case 2: // Sub ID register

View File

@ -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<cpu_device> m_cpu;
uint32_t m_ram[0x2000];
};

View File

@ -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, &gticlub_state::gn680_memmap);
}