pic8259: NEC V5x ICU is always in x86 mode (nw)

This commit is contained in:
Patrick Mackinlay 2018-10-31 17:57:41 +07:00
parent 23910629f0
commit 71bf6a65d9
2 changed files with 29 additions and 4 deletions

View File

@ -110,7 +110,7 @@ uint32_t pic8259_device::acknowledge()
}
else
{
if (m_is_x86)
if (is_x86())
{
/* For x86 mode*/
return irq + m_base;
@ -124,7 +124,7 @@ uint32_t pic8259_device::acknowledge()
}
}
logerror("Spurious IRQ\n");
if (m_is_x86)
if (is_x86())
return m_base + 7;
else
return 0xcd0000 + (m_vector_addr_high << 8) + m_vector_addr_low + (7 << (3-m_vector_size));
@ -409,9 +409,10 @@ void pic8259_device::device_reset()
}
DEFINE_DEVICE_TYPE(PIC8259, pic8259_device, "pic8259", "Intel 8259 PIC")
DEFINE_DEVICE_TYPE(V5X_ICU, v5x_icu_device, "v5x_icu", "NEC V5X ICU")
pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, PIC8259, tag, owner, clock)
pic8259_device::pic8259_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, type, tag, owner, clock)
, m_out_int_func(*this)
, m_in_sp_func(*this)
, m_read_slave_ack_func(*this)
@ -420,3 +421,13 @@ pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, d
, m_level_trig_mode(0)
{
}
pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pic8259_device(mconfig, PIC8259, tag, owner, clock)
{
}
v5x_icu_device::v5x_icu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pic8259_device(mconfig, V5X_ICU, tag, owner, clock)
{
}

View File

@ -73,12 +73,16 @@ public:
IRQ_CALLBACK_MEMBER(inta_cb);
protected:
pic8259_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual void device_resolve_objects() override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual bool is_x86() const { return m_is_x86; }
private:
static constexpr device_timer_id TIMER_CHECK_IRQ = 0;
@ -131,6 +135,16 @@ private:
uint8_t m_is_x86;
};
class v5x_icu_device : public pic8259_device
{
public:
v5x_icu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
virtual bool is_x86() const override { return true; }
};
DECLARE_DEVICE_TYPE(PIC8259, pic8259_device)
DECLARE_DEVICE_TYPE(V5X_ICU, v5x_icu_device)
#endif // MAME_MACHINE_PIC8259_H