mirror of
https://github.com/holub/mame
synced 2025-04-24 09:20:02 +03:00
bml3bus: Remove firstcpu usage (nw)
This commit is contained in:
parent
7472812bf4
commit
107ebac287
@ -97,7 +97,7 @@ DEFINE_DEVICE_TYPE(BML3BUS, bml3bus_device, "bml3bus", "Hitachi MB-6890 Bus")
|
||||
void bml3bus_device::static_set_cputag(device_t &device, const char *tag)
|
||||
{
|
||||
bml3bus_device &bml3bus = downcast<bml3bus_device &>(device);
|
||||
bml3bus.m_cputag = tag;
|
||||
bml3bus.m_maincpu.set_tag(tag);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
@ -115,7 +115,7 @@ bml3bus_device::bml3bus_device(const machine_config &mconfig, const char *tag, d
|
||||
|
||||
bml3bus_device::bml3bus_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_maincpu(nullptr),
|
||||
m_maincpu(*this, finder_base::DUMMY_TAG),
|
||||
m_out_nmi_cb(*this),
|
||||
m_out_irq_cb(*this),
|
||||
m_out_firq_cb(*this),
|
||||
@ -128,8 +128,6 @@ bml3bus_device::bml3bus_device(const machine_config &mconfig, device_type type,
|
||||
|
||||
void bml3bus_device::device_start()
|
||||
{
|
||||
m_maincpu = machine().device<cpu_device>(m_cputag);
|
||||
|
||||
// resolve callbacks
|
||||
m_out_nmi_cb.resolve_safe();
|
||||
m_out_irq_cb.resolve_safe();
|
||||
|
@ -21,7 +21,7 @@
|
||||
//**************************************************************************
|
||||
|
||||
#define MCFG_BML3BUS_CPU(_cputag) \
|
||||
bml3bus_device::static_set_cputag(*device, _cputag);
|
||||
bml3bus_device::static_set_cputag(*device, "^" _cputag);
|
||||
|
||||
#define MCFG_BML3BUS_OUT_NMI_CB(_devcb) \
|
||||
devcb = &bml3bus_device::set_out_nmi_callback(*device, DEVCB_##_devcb);
|
||||
@ -99,6 +99,8 @@ public:
|
||||
DECLARE_WRITE_LINE_MEMBER( irq_w );
|
||||
DECLARE_WRITE_LINE_MEMBER( firq_w );
|
||||
|
||||
address_space &space() const { return m_maincpu->space(AS_PROGRAM); }
|
||||
|
||||
protected:
|
||||
bml3bus_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
@ -107,7 +109,7 @@ protected:
|
||||
virtual void device_reset() override;
|
||||
|
||||
// internal state
|
||||
cpu_device *m_maincpu;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
|
||||
devcb_write_line m_out_nmi_cb;
|
||||
devcb_write_line m_out_irq_cb;
|
||||
|
@ -78,7 +78,7 @@ void bml3bus_kanji_device::device_start()
|
||||
m_rom = memregion(KANJI_ROM_REGION)->base();
|
||||
|
||||
// install into memory
|
||||
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
|
||||
address_space &space_prg = m_bml3bus->space();
|
||||
space_prg.install_readwrite_handler(0xff75, 0xff76, read8_delegate( FUNC(bml3bus_kanji_device::bml3_kanji_r), this), write8_delegate(FUNC(bml3bus_kanji_device::bml3_kanji_w), this) );
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ void bml3bus_mp1802_device::device_start()
|
||||
m_rom = memregion(MP1802_ROM_REGION)->base();
|
||||
|
||||
// install into memory
|
||||
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
|
||||
address_space &space_prg = m_bml3bus->space();
|
||||
space_prg.install_readwrite_handler(0xff00, 0xff03, read8_delegate(FUNC(mb8866_device::read),(mb8866_device*)m_fdc), write8_delegate(FUNC(mb8866_device::write),(mb8866_device*)m_fdc));
|
||||
space_prg.install_readwrite_handler(0xff04, 0xff04, read8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_r), this), write8_delegate(FUNC(bml3bus_mp1802_device::bml3_mp1802_w), this));
|
||||
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
|
||||
|
@ -152,7 +152,7 @@ void bml3bus_mp1805_device::device_start()
|
||||
m_rom = memregion(MP1805_ROM_REGION)->base();
|
||||
|
||||
// install into memory
|
||||
address_space &space_prg = machine().firstcpu->space(AS_PROGRAM);
|
||||
address_space &space_prg = m_bml3bus->space();
|
||||
space_prg.install_readwrite_handler(0xff18, 0xff1f, read8_delegate( FUNC(mc6843_device::read), (mc6843_device*)m_mc6843), write8_delegate(FUNC(mc6843_device::write), (mc6843_device*)m_mc6843) );
|
||||
space_prg.install_readwrite_handler(0xff20, 0xff20, read8_delegate( FUNC(bml3bus_mp1805_device::bml3_mp1805_r), this), write8_delegate(FUNC(bml3bus_mp1805_device::bml3_mp1805_w), this) );
|
||||
// overwriting the main ROM (rather than using e.g. install_rom) should mean that bank switches for RAM expansion still work...
|
||||
|
Loading…
Reference in New Issue
Block a user