mirror of
https://github.com/holub/mame
synced 2025-04-20 15:32:45 +03:00
pic8259: Treat slave IRQs as level-triggered even when LTIM = 0
This commit is contained in:
parent
71be387509
commit
ad5ae83d7a
@ -63,18 +63,15 @@ void pic8259_device::set_irq_line(int irq, int state)
|
||||
{
|
||||
uint8_t mask = (1 << irq);
|
||||
|
||||
if (state)
|
||||
if (state && !(m_irq_lines & mask))
|
||||
{
|
||||
/* setting IRQ line */
|
||||
LOG("set_irq_line(): PIC set IR%d line\n", irq);
|
||||
|
||||
if(m_level_trig_mode || (!m_level_trig_mode && !(m_irq_lines & mask)))
|
||||
{
|
||||
m_irr |= mask;
|
||||
}
|
||||
m_irr |= mask;
|
||||
m_irq_lines |= mask;
|
||||
}
|
||||
else
|
||||
else if (!state && (m_irq_lines & mask))
|
||||
{
|
||||
/* clearing IRQ line */
|
||||
LOG("set_irq_line(): PIC cleared IR%d line\n", irq);
|
||||
@ -99,7 +96,7 @@ uint8_t pic8259_device::acknowledge()
|
||||
if (!machine().side_effects_disabled())
|
||||
{
|
||||
LOG("pic8259_acknowledge(): PIC acknowledge IR%d\n", m_current_level);
|
||||
if (!m_level_trig_mode)
|
||||
if (!m_level_trig_mode && (!m_master || !(m_slave & mask)))
|
||||
m_irr &= ~mask;
|
||||
|
||||
if (!m_auto_eoi)
|
||||
@ -138,7 +135,7 @@ uint8_t pic8259_device::acknowledge()
|
||||
LOG("pic8259_acknowledge(): PIC acknowledge IR%d\n", m_current_level);
|
||||
|
||||
uint8_t mask = 1 << m_current_level;
|
||||
if (!m_level_trig_mode)
|
||||
if (!m_level_trig_mode && (!m_master || !(m_slave & mask)))
|
||||
m_irr &= ~mask;
|
||||
m_isr |= mask;
|
||||
}
|
||||
@ -199,7 +196,7 @@ uint8_t pic8259_device::read(offs_t offset)
|
||||
{
|
||||
data = 0x80 | m_current_level;
|
||||
|
||||
if (!m_level_trig_mode)
|
||||
if (!m_level_trig_mode && (!m_master || !BIT(m_slave, m_current_level)))
|
||||
m_irr &= ~(1 << m_current_level);
|
||||
|
||||
if (!m_auto_eoi)
|
||||
@ -246,6 +243,7 @@ void pic8259_device::write(offs_t offset, uint8_t data)
|
||||
m_imr = 0x00;
|
||||
m_isr = 0x00;
|
||||
m_irr = 0x00;
|
||||
m_slave = 0x00;
|
||||
m_level_trig_mode = (data & 0x08) ? 1 : 0;
|
||||
m_vector_size = (data & 0x04) ? 1 : 0;
|
||||
m_cascade = (data & 0x02) ? 0 : 1;
|
||||
@ -263,6 +261,7 @@ void pic8259_device::write(offs_t offset, uint8_t data)
|
||||
/* write OCW3 */
|
||||
LOGOCW("pic8259_device::write(): OCW3; data=0x%02X\n", data);
|
||||
|
||||
// TODO: special mask mode
|
||||
m_ocw3 = data;
|
||||
}
|
||||
else if ((data & 0x18) == 0x00)
|
||||
|
@ -1114,20 +1114,6 @@ void pc88va_state::machine_reset()
|
||||
m_sound_irq_pending = false;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(pc88va_state::slave_irq7)
|
||||
{
|
||||
// If we don't follow this dispatch like the other irqs it will mismatch
|
||||
// between sound and FDC, causing an hang or a disk failure during intros
|
||||
// in rtype, olteus, shinraba, 88va2d.
|
||||
// TODO: how pc88va even acknowledge any irq?
|
||||
if (state)
|
||||
{
|
||||
m_maincpu->set_input_line(INPUT_LINE_IRQ7, CLEAR_LINE);
|
||||
m_maincpu->set_input_line(INPUT_LINE_IRQ7, ASSERT_LINE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void pc88va_state::pc88va(machine_config &config)
|
||||
{
|
||||
V50(config, m_maincpu, MASTER_CLOCK); // μPD9002, aka V50 + μPD70008AC (for PC8801 compatibility mode) in place of 8080
|
||||
@ -1168,8 +1154,7 @@ void pc88va_state::pc88va(machine_config &config)
|
||||
|
||||
// external PIC
|
||||
PIC8259(config, m_pic2, 0);
|
||||
// m_pic2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ7);
|
||||
m_pic2->out_int_callback().set(FUNC(pc88va_state::slave_irq7));
|
||||
m_pic2->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ7);
|
||||
m_pic2->in_sp_callback().set_constant(0);
|
||||
|
||||
UPD765A(config, m_fdc, 4000000, true, true);
|
||||
|
@ -156,8 +156,6 @@ private:
|
||||
uint8_t kanji_ram_r(offs_t offset);
|
||||
void kanji_ram_w(offs_t offset, uint8_t data);
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER(slave_irq7);
|
||||
|
||||
uint8_t hdd_status_r();
|
||||
|
||||
uint16_t sysop_r();
|
||||
|
Loading…
Reference in New Issue
Block a user