diff options
author | 2018-10-31 17:57:41 +0700 | |
---|---|---|
committer | 2018-10-31 17:57:41 +0700 | |
commit | 71bf6a65d9541f8fece0704191b27794e45d4664 (patch) | |
tree | 0761bb1d4a2b1f9d54393799266ea1fa4ade5d51 | |
parent | 23910629f0314790c23bfc39b8cdbf832d5582e1 (diff) |
pic8259: NEC V5x ICU is always in x86 mode (nw)
-rw-r--r-- | src/devices/machine/pic8259.cpp | 19 | ||||
-rw-r--r-- | src/devices/machine/pic8259.h | 14 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/devices/machine/pic8259.cpp b/src/devices/machine/pic8259.cpp index 22cc5e4862a..c3871e98278 100644 --- a/src/devices/machine/pic8259.cpp +++ b/src/devices/machine/pic8259.cpp @@ -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) +{ +} diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h index 24e5b1f6e59..7921f454617 100644 --- a/src/devices/machine/pic8259.h +++ b/src/devices/machine/pic8259.h @@ -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 |