summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/gp_1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/gp_1.cpp')
-rw-r--r--src/mame/drivers/gp_1.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mame/drivers/gp_1.cpp b/src/mame/drivers/gp_1.cpp
index a2c3a71cfcc..44ce1385b17 100644
--- a/src/mame/drivers/gp_1.cpp
+++ b/src/mame/drivers/gp_1.cpp
@@ -38,6 +38,7 @@ public:
gp_1_state(const machine_config &mconfig, device_type type, const char *tag)
: genpin_class(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
+ , m_ppi(*this, "ppi")
, m_ctc(*this, "ctc")
, m_sn(*this, "snsnd")
, m_io_dsw0(*this, "DSW0")
@@ -72,6 +73,7 @@ private:
virtual void machine_reset() override;
virtual void machine_start() override { m_digits.resolve(); }
required_device<z80_device> m_maincpu;
+ required_device<i8255_device> m_ppi;
required_device<z80ctc_device> m_ctc;
optional_device<sn76477_device> m_sn;
required_ioport m_io_dsw0;
@@ -96,7 +98,7 @@ void gp_1_state::gp_1_map(address_map &map)
void gp_1_state::gp_1_io(address_map &map)
{
map.global_mask(0x0f);
- map(0x04, 0x07).rw("ppi", FUNC(i8255_device::read), FUNC(i8255_device::write));
+ map(0x04, 0x07).rw(m_ppi, FUNC(i8255_device::read), FUNC(i8255_device::write));
map(0x08, 0x0b).rw(m_ctc, FUNC(z80ctc_device::read), FUNC(z80ctc_device::write));
}
@@ -449,10 +451,10 @@ MACHINE_CONFIG_START(gp_1_state::gp_1)
genpin_audio(config);
/* Devices */
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, gp_1_state, porta_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, gp_1_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gp_1_state, portc_w))
+ I8255A(config, m_ppi);
+ m_ppi->out_pa_callback().set(FUNC(gp_1_state::porta_w));
+ m_ppi->in_pb_callback().set(FUNC(gp_1_state::portb_r));
+ m_ppi->out_pc_callback().set(FUNC(gp_1_state::portc_w));
Z80CTC(config, m_ctc, 2457600);
m_ctc->intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); // Todo: absence of ints will cause a watchdog reset
@@ -478,11 +480,7 @@ MACHINE_CONFIG_START(gp_1_state::gp_1s)
MCFG_SN76477_ENABLE(1) // enable
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
- MCFG_DEVICE_REMOVE("ppi")
- MCFG_DEVICE_ADD("ppi", I8255A, 0 )
- MCFG_I8255_OUT_PORTA_CB(WRITE8(*this, gp_1_state, portas_w))
- MCFG_I8255_IN_PORTB_CB(READ8(*this, gp_1_state, portb_r))
- MCFG_I8255_OUT_PORTC_CB(WRITE8(*this, gp_1_state, portc_w))
+ m_ppi->out_pa_callback().set(FUNC(gp_1_state::portas_w));
MACHINE_CONFIG_END