diff --git a/src/devices/cpu/m68000/m68000.h b/src/devices/cpu/m68000/m68000.h index 8138b2a1450..ddb9644a07b 100644 --- a/src/devices/cpu/m68000/m68000.h +++ b/src/devices/cpu/m68000/m68000.h @@ -103,6 +103,7 @@ public: // construction/destruction m68000_base_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + static constexpr uint8_t autovector(int level) { return 0x18 + level; } void autovectors_map(address_map &map); protected: @@ -394,11 +395,11 @@ public: virtual void device_start() override; }; -class m68008plcc_device : public m68000_base_device +class m68008fn_device : public m68000_base_device { public: // construction/destruction - m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + m68008fn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual std::unique_ptr create_disassembler() override; @@ -634,7 +635,7 @@ public: DECLARE_DEVICE_TYPE(M68000, m68000_device) DECLARE_DEVICE_TYPE(M68008, m68008_device) -DECLARE_DEVICE_TYPE(M68008PLCC, m68008plcc_device) +DECLARE_DEVICE_TYPE(M68008FN, m68008fn_device) DECLARE_DEVICE_TYPE(M68010, m68010_device) DECLARE_DEVICE_TYPE(M68EC020, m68ec020_device) DECLARE_DEVICE_TYPE(M68020, m68020_device) diff --git a/src/devices/cpu/m68000/m68kcpu.cpp b/src/devices/cpu/m68000/m68kcpu.cpp index 73323d18ee2..5e10749478d 100644 --- a/src/devices/cpu/m68000/m68kcpu.cpp +++ b/src/devices/cpu/m68000/m68kcpu.cpp @@ -2027,7 +2027,7 @@ std::unique_ptr m68008_device::create_disassembler() return std::make_unique(m68k_disassembler::TYPE_68008); } -std::unique_ptr m68008plcc_device::create_disassembler() +std::unique_ptr m68008fn_device::create_disassembler() { return std::make_unique(m68k_disassembler::TYPE_68008); } @@ -2319,14 +2319,14 @@ void m68000_base_device::clear_all() void m68000_base_device::autovectors_map(address_map &map) { // Eventually add the sync to E due to vpa - // 8-bit handlers are used here to be 68008-compatible - map(0x3, 0x3).lr8("avec1", []() -> u8 { return 0x19; }); - map(0x5, 0x5).lr8("avec2", []() -> u8 { return 0x1a; }); - map(0x7, 0x7).lr8("avec3", []() -> u8 { return 0x1b; }); - map(0x9, 0x9).lr8("avec4", []() -> u8 { return 0x1c; }); - map(0xb, 0xb).lr8("avec5", []() -> u8 { return 0x1d; }); - map(0xd, 0xd).lr8("avec6", []() -> u8 { return 0x1e; }); - map(0xf, 0xf).lr8("avec7", []() -> u8 { return 0x1f; }); + // 8-bit handlers are used here to be compatible with all bus widths + map(0x3, 0x3).lr8("avec1", []() -> u8 { return autovector(1); }); + map(0x5, 0x5).lr8("avec2", []() -> u8 { return autovector(2); }); + map(0x7, 0x7).lr8("avec3", []() -> u8 { return autovector(3); }); + map(0x9, 0x9).lr8("avec4", []() -> u8 { return autovector(4); }); + map(0xb, 0xb).lr8("avec5", []() -> u8 { return autovector(5); }); + map(0xd, 0xd).lr8("avec6", []() -> u8 { return autovector(6); }); + map(0xf, 0xf).lr8("avec7", []() -> u8 { return autovector(7); }); } void m68000_base_device::default_autovectors_map(address_map &map) @@ -2404,8 +2404,8 @@ device_memory_interface::space_config_vector m68000_base_device::memory_space_co DEFINE_DEVICE_TYPE(M68000, m68000_device, "m68000", "Motorola MC68000") -DEFINE_DEVICE_TYPE(M68008, m68008_device, "m68008", "Motorola MC68008") -DEFINE_DEVICE_TYPE(M68008PLCC, m68008plcc_device, "m68008plcc", "Motorola MC68008PLCC") +DEFINE_DEVICE_TYPE(M68008, m68008_device, "m68008", "Motorola MC68008") // 48-pin plastic or ceramic DIP +DEFINE_DEVICE_TYPE(M68008FN, m68008fn_device, "m68008fn", "Motorola MC68008FN") // 52-pin PLCC DEFINE_DEVICE_TYPE(M68010, m68010_device, "m68010", "Motorola MC68010") DEFINE_DEVICE_TYPE(M68EC020, m68ec020_device, "m68ec020", "Motorola MC68EC020") DEFINE_DEVICE_TYPE(M68020, m68020_device, "m68020", "Motorola MC68020") @@ -2460,12 +2460,12 @@ void m68008_device::device_start() } -m68008plcc_device::m68008plcc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : m68000_base_device(mconfig, tag, owner, clock, M68008PLCC, 8,22) +m68008fn_device::m68008fn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : m68000_base_device(mconfig, tag, owner, clock, M68008FN, 8,22) { } -void m68008plcc_device::device_start() +void m68008fn_device::device_start() { init_cpu_m68008(); } diff --git a/src/mame/drivers/abc1600.cpp b/src/mame/drivers/abc1600.cpp index cc221e48ebf..5aad63f1cef 100644 --- a/src/mame/drivers/abc1600.cpp +++ b/src/mame/drivers/abc1600.cpp @@ -809,7 +809,7 @@ void abc1600_state::cpu_space_map(address_map &map) map(0xffff0, 0xfffff).m(m_maincpu, FUNC(m68008_device::autovectors_map)); map(0xffff5, 0xffff5).lr8("cio int", [this]() -> u8 { return m_cio->intack_r(); }); map(0xffffb, 0xffffb).lr8("dart int", [this]() -> u8 { return m_dart->m1_r(); }); - map(0xfffff, 0xfffff).lr8("nmi int", [this]() -> u8 { m_maincpu->set_input_line(M68K_IRQ_7, CLEAR_LINE); return 0x18+7; }); + map(0xfffff, 0xfffff).lr8("nmi int", [this]() -> u8 { m_maincpu->set_input_line(M68K_IRQ_7, CLEAR_LINE); return m68008_device::autovector(7); }); } void abc1600_state::machine_start() diff --git a/src/mame/drivers/apollo.cpp b/src/mame/drivers/apollo.cpp index 274e31feb2c..425711d4c62 100644 --- a/src/mame/drivers/apollo.cpp +++ b/src/mame/drivers/apollo.cpp @@ -282,7 +282,7 @@ u16 apollo_state::apollo_irq_acknowledge(offs_t offset) if (offset+1 == 6) return apollo_pic_get_vector(); else - return 0x19 + offset; + return m68000_base_device::autovector(offset+1); } /*************************************************************************** diff --git a/src/mame/drivers/cat.cpp b/src/mame/drivers/cat.cpp index 389779d6f54..745a4649ea6 100644 --- a/src/mame/drivers/cat.cpp +++ b/src/mame/drivers/cat.cpp @@ -919,7 +919,7 @@ TIMER_CALLBACK_MEMBER(cat_state::counter_6ms_callback) void cat_state::cpu_space_map(address_map &map) { map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); - map(0xfffff2, 0xfffff3).lr16("interrupt 1", [this]() -> u16 { m_maincpu->set_input_line(1, CLEAR_LINE); return 0x19; }); + map(0xfffff3, 0xfffff3).lr16("interrupt 1", [this]() { m_maincpu->set_input_line(1, CLEAR_LINE); return m68000_device::autovector(1); }); } MACHINE_START_MEMBER(cat_state,cat) diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index c694bc1438f..5c4cbb1d3fe 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -357,7 +357,7 @@ void cps_state::cpu_space_map(address_map &map) // clear the IPL1 and IPL2 flip-flops m_maincpu->set_input_line(2, CLEAR_LINE); m_maincpu->set_input_line(4, CLEAR_LINE); - return 0x19+offset; }); + return m68000_device::autovector(offset+1); }); } diff --git a/src/mame/drivers/toaplan2.cpp b/src/mame/drivers/toaplan2.cpp index a2ba3642c54..983ac15a06e 100644 --- a/src/mame/drivers/toaplan2.cpp +++ b/src/mame/drivers/toaplan2.cpp @@ -525,13 +525,13 @@ void toaplan2_state::init_enmadaio() void toaplan2_state::cpu_space_fixeightbl_map(address_map &map) { map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); - map(0xfffff4, 0xfffff5).lr16("irq 2", [this]() -> u16 { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); return 0x18+2; }); + map(0xfffff5, 0xfffff5).lr8("irq 2", [this]() { m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); return m68000_device::autovector(2); }); } void toaplan2_state::cpu_space_pipibibsbl_map(address_map &map) { map(0xfffff0, 0xffffff).m(m_maincpu, FUNC(m68000_base_device::autovectors_map)); - map(0xfffff8, 0xfffff9).lr16("irq 4", [this]() -> u16 { m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); return 0x18+4; }); + map(0xfffff9, 0xfffff9).lr8("irq 4", [this]() { m_maincpu->set_input_line(M68K_IRQ_4, CLEAR_LINE); return m68000_device::autovector(4); }); } diff --git a/src/mame/drivers/wildpkr.cpp b/src/mame/drivers/wildpkr.cpp index 7d7b9ebc872..020face7887 100644 --- a/src/mame/drivers/wildpkr.cpp +++ b/src/mame/drivers/wildpkr.cpp @@ -464,7 +464,7 @@ u16 wildpkr_state::tabpkr_irq_ack(offs_t offset) if (offset+1 == 2) return m_duart->get_irq_vector(); else - return 0x19 + offset; + return m68000_device::autovector(offset+1); } diff --git a/src/mame/machine/cdi070.cpp b/src/mame/machine/cdi070.cpp index b2368a5d8bc..1135577c0f2 100644 --- a/src/mame/machine/cdi070.cpp +++ b/src/mame/machine/cdi070.cpp @@ -80,10 +80,10 @@ cdi68070_device::cdi68070_device(const machine_config &mconfig, const char *tag, void cdi68070_device::device_resolve_objects() { - m_iack2_callback.resolve_safe(0x1a); // Level 2 external autovector - m_iack4_callback.resolve_safe(0x1c); // Level 4 external autovector - m_iack5_callback.resolve_safe(0x1d); // Level 5 external autovector - m_iack7_callback.resolve_safe(0x1f); // Level 7 external autovector + m_iack2_callback.resolve_safe(scc68070_device::autovector(2)); + m_iack4_callback.resolve_safe(scc68070_device::autovector(4)); + m_iack5_callback.resolve_safe(scc68070_device::autovector(5)); + m_iack7_callback.resolve_safe(scc68070_device::autovector(7)); } //-------------------------------------------------