Merge pull request #4335 from hp9k/gpib_dma_enable

hp9k_3xx: add DMA enable to control register
This commit is contained in:
ajrhacker 2018-11-25 12:33:49 -05:00 committed by GitHub
commit 45143caaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View File

@ -125,12 +125,14 @@ void human_interface_device::device_start()
save_item(NAME(m_hil_read));
save_item(NAME(m_kbd_nmi));
save_item(NAME(m_gpib_irq_line));
save_item(NAME(m_gpib_dma_line));
save_item(NAME(m_old_latch_enable));
save_item(NAME(m_hil_data));
save_item(NAME(m_latch_data));
save_item(NAME(m_rtc_data));
save_item(NAME(m_ppoll_mask));
save_item(NAME(m_ppoll_sc));
save_item(NAME(m_gpib_dma_enable));
}
void human_interface_device::device_reset()
@ -164,9 +166,15 @@ WRITE_LINE_MEMBER(human_interface_device::gpib_irq)
update_gpib_irq();
}
void human_interface_device::update_gpib_dma()
{
dmar0_out(m_gpib_dma_enable && m_gpib_dma_line);
}
WRITE_LINE_MEMBER(human_interface_device::gpib_dreq)
{
dmar0_out(state);
m_gpib_dma_line = state;
update_gpib_dma();
}
WRITE8_MEMBER(human_interface_device::ieee488_dio_w)
@ -194,6 +202,10 @@ WRITE8_MEMBER(human_interface_device::gpib_w)
reset();
break;
case 1:
m_gpib_dma_enable = data & 0x01;
update_gpib_dma();
break;
case 3:
m_ppoll_sc = data & PPOLL_IE;
@ -231,7 +243,7 @@ READ8_MEMBER(human_interface_device::gpib_r)
break;
case 1:
/* Int control */
data = 0x80 | (m_gpib_irq_line ? 0x40 : 0);
data = 0x80 | (m_gpib_irq_line ? 0x40 : 0) | (m_gpib_dma_enable ? 0x01 : 0);
break;
case 2:
/* Address */
@ -352,7 +364,7 @@ void human_interface_device::dmack_w_in(int channel, uint8_t data)
uint8_t human_interface_device::dmack_r_in(int channel)
{
if (channel)
if (channel || !m_gpib_dma_enable)
return 0xff;
return m_tms9914->reg8_r(machine().dummy_space(), 7);
}

View File

@ -59,6 +59,7 @@ private:
void dmack_w_in(int channel, uint8_t data) override;
uint8_t dmack_r_in(int channel) override;
void update_gpib_irq();
void update_gpib_dma();
required_device<i8042_device> m_iocpu;
required_device<hp_hil_mlc_device> m_mlc;
@ -83,7 +84,10 @@ private:
bool m_kbd_nmi;
bool m_gpib_irq_line;
bool m_gpib_dma_line;
bool m_old_latch_enable;
bool m_gpib_dma_enable;
uint8_t m_hil_data;
uint8_t m_latch_data;