m68000: Make the autovector abstraction a bit less leaky (nw)

m68008plcc: Rename device for future use (nw)
This commit is contained in:
AJR 2019-04-14 10:31:45 -04:00
parent be70fd7ada
commit 40421dbe1b
9 changed files with 29 additions and 28 deletions

View File

@ -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<util::disasm_interface> 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)

View File

@ -2027,7 +2027,7 @@ std::unique_ptr<util::disasm_interface> m68008_device::create_disassembler()
return std::make_unique<m68k_disassembler>(m68k_disassembler::TYPE_68008);
}
std::unique_ptr<util::disasm_interface> m68008plcc_device::create_disassembler()
std::unique_ptr<util::disasm_interface> m68008fn_device::create_disassembler()
{
return std::make_unique<m68k_disassembler>(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();
}

View File

@ -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()

View File

@ -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);
}
/***************************************************************************

View File

@ -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)

View File

@ -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); });
}

View File

@ -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); });
}

View File

@ -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);
}

View File

@ -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));
}
//-------------------------------------------------