summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mess/drivers/ace.c42
-rw-r--r--src/mess/drivers/adam.c12
-rw-r--r--src/mess/drivers/amstrad.c10
-rw-r--r--src/mess/drivers/apple2.c30
-rw-r--r--src/mess/drivers/apple2gs.c26
-rw-r--r--src/mess/drivers/bbc.c20
-rw-r--r--src/mess/drivers/bullet.c5
-rw-r--r--src/mess/drivers/bw12.c5
-rw-r--r--src/mess/drivers/cgenie.c2
-rw-r--r--src/mess/drivers/coleco.c12
-rw-r--r--src/mess/drivers/einstein.c32
-rw-r--r--src/mess/drivers/enterp.c46
-rw-r--r--src/mess/drivers/fm7.c26
-rw-r--r--src/mess/drivers/fmtowns.c59
-rw-r--r--src/mess/drivers/huebler.c18
-rw-r--r--src/mess/drivers/kaypro.c4
-rw-r--r--src/mess/drivers/kyocera.c10
-rw-r--r--src/mess/drivers/m5.c10
-rw-r--r--src/mess/drivers/msx.c15
-rw-r--r--src/mess/drivers/mtx.c36
-rw-r--r--src/mess/drivers/nascom1.c4
-rw-r--r--src/mess/drivers/nc.c90
-rw-r--r--src/mess/drivers/nes.c13
-rw-r--r--src/mess/drivers/ob68k1a.c14
-rw-r--r--src/mess/drivers/osi.c8
-rw-r--r--src/mess/drivers/pc.c6
-rw-r--r--src/mess/drivers/pce.c10
-rw-r--r--src/mess/drivers/pcw.c15
-rw-r--r--src/mess/drivers/pcw16.c46
-rw-r--r--src/mess/drivers/pes.c19
-rw-r--r--src/mess/drivers/pet.c4
-rw-r--r--src/mess/drivers/pokemini.c2
-rw-r--r--src/mess/drivers/portfoli.c6
-rw-r--r--src/mess/drivers/ql.c18
-rw-r--r--src/mess/drivers/rmnimbus.c2
-rw-r--r--src/mess/drivers/samcoupe.c20
-rw-r--r--src/mess/drivers/sg1000.c14
-rw-r--r--src/mess/drivers/sms.c16
-rw-r--r--src/mess/drivers/ssystem3.c86
-rw-r--r--src/mess/drivers/super6.c4
-rw-r--r--src/mess/drivers/svi318.c6
-rw-r--r--src/mess/drivers/tandy2k.c8
-rw-r--r--src/mess/drivers/tsispch.c24
-rw-r--r--src/mess/drivers/v1050.c30
-rw-r--r--src/mess/drivers/victor9k.c8
-rw-r--r--src/mess/drivers/x1.c6
-rw-r--r--src/mess/drivers/x68k.c170
-rw-r--r--src/mess/drivers/xerox820.c11
-rw-r--r--src/mess/drivers/xor100.c34
-rw-r--r--src/mess/drivers/z80ne.c4
-rw-r--r--src/mess/includes/a7800.h3
-rw-r--r--src/mess/includes/ac1.h4
-rw-r--r--src/mess/includes/ace.h10
-rw-r--r--src/mess/includes/adam.h1
-rw-r--r--src/mess/includes/amstrad.h30
-rw-r--r--src/mess/includes/apple1.h3
-rw-r--r--src/mess/includes/apple2.h3
-rw-r--r--src/mess/includes/apple2gs.h3
-rw-r--r--src/mess/includes/apple3.h6
-rw-r--r--src/mess/includes/b2m.h10
-rw-r--r--src/mess/includes/bbc.h18
-rw-r--r--src/mess/includes/bebox.h12
-rw-r--r--src/mess/includes/bullet.h1
-rw-r--r--src/mess/includes/bw12.h1
-rw-r--r--src/mess/includes/c64_legacy.h8
-rw-r--r--src/mess/includes/c65.h6
-rw-r--r--src/mess/includes/cgenie.h5
-rw-r--r--src/mess/includes/coleco.h1
-rw-r--r--src/mess/includes/concept.h7
-rw-r--r--src/mess/includes/dgn_beta.h22
-rw-r--r--src/mess/includes/einstein.h4
-rw-r--r--src/mess/includes/enterp.h4
-rw-r--r--src/mess/includes/fm7.h4
-rw-r--r--src/mess/includes/fmtowns.h6
-rw-r--r--src/mess/includes/huebler.h4
-rw-r--r--src/mess/includes/irisha.h1
-rw-r--r--src/mess/includes/kaypro.h6
-rw-r--r--src/mess/includes/kramermc.h3
-rw-r--r--src/mess/includes/kyocera.h2
-rw-r--r--src/mess/includes/lisa.h6
-rw-r--r--src/mess/includes/lviv.h12
-rw-r--r--src/mess/includes/m5.h1
-rw-r--r--src/mess/includes/mac.h19
-rw-r--r--src/mess/includes/macpci.h6
-rw-r--r--src/mess/includes/mc80.h1
-rw-r--r--src/mess/includes/microtan.h20
-rw-r--r--src/mess/includes/msx.h8
-rw-r--r--src/mess/includes/mtx.h16
-rw-r--r--src/mess/includes/mz700.h8
-rw-r--r--src/mess/includes/nascom1.h8
-rw-r--r--src/mess/includes/nc.h8
-rw-r--r--src/mess/includes/nes.h3
-rw-r--r--src/mess/includes/ob68k1a.h2
-rw-r--r--src/mess/includes/oric.h17
-rw-r--r--src/mess/includes/orion.h3
-rw-r--r--src/mess/includes/osi.h1
-rw-r--r--src/mess/includes/partner.h2
-rw-r--r--src/mess/includes/pc.h41
-rw-r--r--src/mess/includes/pce.h1
-rw-r--r--src/mess/includes/pcw.h1
-rw-r--r--src/mess/includes/pcw16.h8
-rw-r--r--src/mess/includes/pecom.h4
-rw-r--r--src/mess/includes/pes.h1
-rw-r--r--src/mess/includes/pet.h15
-rw-r--r--src/mess/includes/pk8020.h8
-rw-r--r--src/mess/includes/pmd85.h27
-rw-r--r--src/mess/includes/pokemini.h6
-rw-r--r--src/mess/includes/poly88.h1
-rw-r--r--src/mess/includes/portfoli.h1
-rw-r--r--src/mess/includes/pp01.h8
-rw-r--r--src/mess/includes/ql.h3
-rw-r--r--src/mess/includes/radio86.h10
-rw-r--r--src/mess/includes/rmnimbus.h12
-rw-r--r--src/mess/includes/samcoupe.h6
-rw-r--r--src/mess/includes/sg1000.h2
-rw-r--r--src/mess/includes/sms.h8
-rw-r--r--src/mess/includes/ssystem3.h4
-rw-r--r--src/mess/includes/super6.h1
-rw-r--r--src/mess/includes/super80.h1
-rw-r--r--src/mess/includes/svi318.h7
-rw-r--r--src/mess/includes/sym1.h13
-rw-r--r--src/mess/includes/tandy2k.h2
-rw-r--r--src/mess/includes/trs80.h1
-rw-r--r--src/mess/includes/tsispch.h4
-rw-r--r--src/mess/includes/v1050.h5
-rw-r--r--src/mess/includes/victor9k.h2
-rw-r--r--src/mess/includes/x1.h1
-rw-r--r--src/mess/includes/x68k.h12
-rw-r--r--src/mess/includes/xerox820.h2
-rw-r--r--src/mess/includes/xor100.h7
-rw-r--r--src/mess/includes/z80ne.h14
-rw-r--r--src/mess/machine/a7800.c21
-rw-r--r--src/mess/machine/ac1.c36
-rw-r--r--src/mess/machine/amstrad.c289
-rw-r--r--src/mess/machine/apple1.c31
-rw-r--r--src/mess/machine/apple3.c36
-rw-r--r--src/mess/machine/b2m.c103
-rw-r--r--src/mess/machine/bbc.c204
-rw-r--r--src/mess/machine/bebox.c71
-rw-r--r--src/mess/machine/c64.c136
-rw-r--r--src/mess/machine/c65.c55
-rw-r--r--src/mess/machine/cgenie.c27
-rw-r--r--src/mess/machine/concept.c41
-rw-r--r--src/mess/machine/dgn_beta.c236
-rw-r--r--src/mess/machine/irisha.c6
-rw-r--r--src/mess/machine/kaypro.c32
-rw-r--r--src/mess/machine/kramermc.c18
-rw-r--r--src/mess/machine/lisa.c62
-rw-r--r--src/mess/machine/lviv.c109
-rw-r--r--src/mess/machine/mac.c320
-rw-r--r--src/mess/machine/macpci.c56
-rw-r--r--src/mess/machine/mc80.c8
-rw-r--r--src/mess/machine/microtan.c64
-rw-r--r--src/mess/machine/msx.c18
-rw-r--r--src/mess/machine/mtx.c13
-rw-r--r--src/mess/machine/mz700.c93
-rw-r--r--src/mess/machine/nascom1.c18
-rw-r--r--src/mess/machine/oric.c174
-rw-r--r--src/mess/machine/orion.c23
-rw-r--r--src/mess/machine/partner.c13
-rw-r--r--src/mess/machine/pc.c354
-rw-r--r--src/mess/machine/pecom.c20
-rw-r--r--src/mess/machine/pet.c167
-rw-r--r--src/mess/machine/pk8020.c93
-rw-r--r--src/mess/machine/pmd85.c212
-rw-r--r--src/mess/machine/pokemini.c476
-rw-r--r--src/mess/machine/poly88.c9
-rw-r--r--src/mess/machine/pp01.c44
-rw-r--r--src/mess/machine/radio86.c130
-rw-r--r--src/mess/machine/rmnimbus.c65
-rw-r--r--src/mess/machine/samcoupe.c15
-rw-r--r--src/mess/machine/sms.c25
-rw-r--r--src/mess/machine/super80.c9
-rw-r--r--src/mess/machine/svi318.c59
-rw-r--r--src/mess/machine/sym1.c112
-rw-r--r--src/mess/machine/trs80.c13
-rw-r--r--src/mess/machine/z80ne.c66
-rw-r--r--src/mess/video/bbc.c7
-rw-r--r--src/mess/video/dgn_beta.c20
-rw-r--r--src/mess/video/pecom.c12
-rw-r--r--src/mess/video/pet.c2
181 files changed, 2952 insertions, 2957 deletions
diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c
index e010463bfff..48c6ff7b82a 100644
--- a/src/mess/drivers/ace.c
+++ b/src/mess/drivers/ace.c
@@ -160,23 +160,27 @@ WRITE8_MEMBER( ace_state::ppi_control_w )
// pio_r -
//-------------------------------------------------
-static READ8_DEVICE_HANDLER( pio_ad_r )
+READ8_MEMBER(ace_state::pio_ad_r)
{
+ device_t *device = machine().device(Z80PIO_TAG);
return dynamic_cast<z80pio_device*>(device)->data_read(0);
}
-static READ8_DEVICE_HANDLER( pio_bd_r )
+READ8_MEMBER(ace_state::pio_bd_r)
{
+ device_t *device = machine().device(Z80PIO_TAG);
return dynamic_cast<z80pio_device*>(device)->data_read(1);
}
-static READ8_DEVICE_HANDLER( pio_ac_r )
+READ8_MEMBER(ace_state::pio_ac_r)
{
+ device_t *device = machine().device(Z80PIO_TAG);
return dynamic_cast<z80pio_device*>(device)->control_read();
}
-static READ8_DEVICE_HANDLER( pio_bc_r )
+READ8_MEMBER(ace_state::pio_bc_r)
{
+ device_t *device = machine().device(Z80PIO_TAG);
return dynamic_cast<z80pio_device*>(device)->control_read();
}
@@ -185,23 +189,27 @@ static READ8_DEVICE_HANDLER( pio_bc_r )
// pio_w -
//-------------------------------------------------
-static WRITE8_DEVICE_HANDLER( pio_ad_w )
+WRITE8_MEMBER(ace_state::pio_ad_w)
{
+ device_t *device = machine().device(Z80PIO_TAG);
dynamic_cast<z80pio_device*>(device)->data_write(0, data);
}
-static WRITE8_DEVICE_HANDLER( pio_bd_w )
+WRITE8_MEMBER(ace_state::pio_bd_w)
{
+ device_t *device = machine().device(Z80PIO_TAG);
dynamic_cast<z80pio_device*>(device)->data_write(1, data);
}
-static WRITE8_DEVICE_HANDLER( pio_ac_w )
+WRITE8_MEMBER(ace_state::pio_ac_w)
{
+ device_t *device = machine().device(Z80PIO_TAG);
dynamic_cast<z80pio_device*>(device)->control_write(0, data);
}
-static WRITE8_DEVICE_HANDLER( pio_bc_w )
+WRITE8_MEMBER(ace_state::pio_bc_w)
{
+ device_t *device = machine().device(Z80PIO_TAG);
dynamic_cast<z80pio_device*>(device)->control_write(1, data);
}
@@ -235,10 +243,10 @@ static ADDRESS_MAP_START( ace_io, AS_IO, 8, ace_state )
AM_RANGE(0x43, 0x43) AM_MIRROR(0xff80) AM_READWRITE(ppi_pb_r, ppi_pb_w)
AM_RANGE(0x45, 0x45) AM_MIRROR(0xff80) AM_READWRITE(ppi_pc_r, ppi_pc_w)
AM_RANGE(0x47, 0x47) AM_MIRROR(0xff80) AM_READWRITE(ppi_control_r, ppi_control_w)
- AM_RANGE(0x81, 0x81) AM_MIRROR(0xff38) AM_DEVREADWRITE_LEGACY(Z80PIO_TAG, pio_ad_r, pio_ad_w)
- AM_RANGE(0x83, 0x83) AM_MIRROR(0xff38) AM_DEVREADWRITE_LEGACY(Z80PIO_TAG, pio_bd_r, pio_bd_w)
- AM_RANGE(0x85, 0x85) AM_MIRROR(0xff38) AM_DEVREADWRITE_LEGACY(Z80PIO_TAG, pio_ac_r, pio_ac_w)
- AM_RANGE(0x87, 0x87) AM_MIRROR(0xff38) AM_DEVREADWRITE_LEGACY(Z80PIO_TAG, pio_bc_r, pio_bc_w)
+ AM_RANGE(0x81, 0x81) AM_MIRROR(0xff38) AM_READWRITE(pio_ad_r, pio_ad_w)
+ AM_RANGE(0x83, 0x83) AM_MIRROR(0xff38) AM_READWRITE(pio_bd_r, pio_bd_w)
+ AM_RANGE(0x85, 0x85) AM_MIRROR(0xff38) AM_READWRITE(pio_ac_r, pio_ac_w)
+ AM_RANGE(0x87, 0x87) AM_MIRROR(0xff38) AM_READWRITE(pio_bc_r, pio_bc_w)
AM_RANGE(0xfd, 0xfd) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(AY8910_TAG, ay8910_address_w)
AM_RANGE(0xff, 0xff) AM_MIRROR(0xff00) AM_DEVREADWRITE_LEGACY(AY8910_TAG, ay8910_r, ay8910_data_w)
ADDRESS_MAP_END
@@ -468,8 +476,9 @@ static const sp0256_interface sp0256_intf =
// I8255A_INTERFACE( ppi_intf )
//-------------------------------------------------
-static READ8_DEVICE_HANDLER( sby_r )
+READ8_MEMBER(ace_state::sby_r)
{
+ device_t *device = machine().device(SP0256AL2_TAG);
/*
bit description
@@ -488,8 +497,9 @@ static READ8_DEVICE_HANDLER( sby_r )
return sp0256_sby_r(device);
}
-static WRITE8_DEVICE_HANDLER( ald_w )
+WRITE8_MEMBER(ace_state::ald_w)
{
+ device_t *device = machine().device(SP0256AL2_TAG);
/*
bit description
@@ -515,8 +525,8 @@ static I8255A_INTERFACE( ppi_intf )
{
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER(SP0256AL2_TAG, sby_r),
- DEVCB_DEVICE_HANDLER(SP0256AL2_TAG, ald_w),
+ DEVCB_DRIVER_MEMBER(ace_state,sby_r),
+ DEVCB_DRIVER_MEMBER(ace_state,ald_w),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/drivers/adam.c b/src/mess/drivers/adam.c
index 6d0b40d7e81..3026f2127e8 100644
--- a/src/mess/drivers/adam.c
+++ b/src/mess/drivers/adam.c
@@ -1497,23 +1497,21 @@ INPUT_PORTS_END
// TMS9928a_interface tms9928a_interface
//-------------------------------------------------
-static WRITE_LINE_DEVICE_HANDLER(adam_vdp_interrupt)
+WRITE_LINE_MEMBER(adam_state::adam_vdp_interrupt)
{
- adam_state *driver_state = device->machine().driver_data<adam_state>();
-
- if (state && !driver_state->m_vdp_nmi)
+ if (state && !m_vdp_nmi)
{
- device->machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
- driver_state->m_vdp_nmi = state;
+ m_vdp_nmi = state;
}
static TMS9928A_INTERFACE(adam_tms9928a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(adam_vdp_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(adam_state,adam_vdp_interrupt)
};
//-------------------------------------------------
diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c
index 28a79a9ec52..8435ad9c214 100644
--- a/src/mess/drivers/amstrad.c
+++ b/src/mess/drivers/amstrad.c
@@ -126,12 +126,12 @@ Some bugs left :
-----------------------------*/
static I8255_INTERFACE( amstrad_ppi8255_interface )
{
- DEVCB_HANDLER(amstrad_ppi_porta_r), /* port A read */
- DEVCB_HANDLER(amstrad_ppi_porta_w), /* port A write */
- DEVCB_HANDLER(amstrad_ppi_portb_r), /* port B read */
+ DEVCB_DRIVER_MEMBER(amstrad_state,amstrad_ppi_porta_r), /* port A read */
+ DEVCB_DRIVER_MEMBER(amstrad_state,amstrad_ppi_porta_w), /* port A write */
+ DEVCB_DRIVER_MEMBER(amstrad_state,amstrad_ppi_portb_r), /* port B read */
DEVCB_NULL, /* port B write */
DEVCB_NULL, /* port C read */
- DEVCB_HANDLER(amstrad_ppi_portc_w) /* port C write */
+ DEVCB_DRIVER_MEMBER(amstrad_state,amstrad_ppi_portc_w) /* port C write */
};
@@ -148,7 +148,7 @@ static const upd765_interface amstrad_upd765_interface =
/* Aleste uses an 8272A, with the interrupt flag visible on PPI port B */
static const upd765_interface aleste_8272_interface =
{
- DEVCB_LINE(aleste_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,aleste_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index ff96f4ada4f..0be7ae17609 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -222,26 +222,20 @@ Apple 3.5 and Apple 5.25 drives - up to three devices
#define PADDLE_SENSITIVITY 10
#define PADDLE_AUTOCENTER 0
-static WRITE8_DEVICE_HANDLER(a2bus_irq_w)
+WRITE8_MEMBER(apple2_state::a2bus_irq_w)
{
- apple2_state *a2 = space.machine().driver_data<apple2_state>();
-
- a2->m_maincpu->set_input_line(M6502_IRQ_LINE, data);
+ m_maincpu->set_input_line(M6502_IRQ_LINE, data);
}
-static WRITE8_DEVICE_HANDLER(a2bus_nmi_w)
+WRITE8_MEMBER(apple2_state::a2bus_nmi_w)
{
- apple2_state *a2 = space.machine().driver_data<apple2_state>();
-
- a2->m_maincpu->set_input_line(INPUT_LINE_NMI, data);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, data);
}
-static WRITE8_DEVICE_HANDLER(a2bus_inh_w)
+WRITE8_MEMBER(apple2_state::a2bus_inh_w)
{
- apple2_state *a2 = space.machine().driver_data<apple2_state>();
-
- a2->m_inh_slot = data;
- apple2_update_memory(space.machine());
+ m_inh_slot = data;
+ apple2_update_memory(machine());
}
/***************************************************************************
@@ -596,16 +590,16 @@ static const cassette_interface apple2_cassette_interface =
static const struct a2bus_interface a2bus_intf =
{
// interrupt lines
- DEVCB_HANDLER(a2bus_irq_w),
- DEVCB_HANDLER(a2bus_nmi_w),
- DEVCB_HANDLER(a2bus_inh_w)
+ DEVCB_DRIVER_MEMBER(apple2_state,a2bus_irq_w),
+ DEVCB_DRIVER_MEMBER(apple2_state,a2bus_nmi_w),
+ DEVCB_DRIVER_MEMBER(apple2_state,a2bus_inh_w)
};
static const struct a2eauxslot_interface a2eauxbus_intf =
{
// interrupt lines
- DEVCB_HANDLER(a2bus_irq_w),
- DEVCB_HANDLER(a2bus_nmi_w)
+ DEVCB_DRIVER_MEMBER(apple2_state,a2bus_irq_w),
+ DEVCB_DRIVER_MEMBER(apple2_state,a2bus_nmi_w)
};
static SLOT_INTERFACE_START(apple2_slot0_cards)
diff --git a/src/mess/drivers/apple2gs.c b/src/mess/drivers/apple2gs.c
index 70fd6b3304d..de9d9e62362 100644
--- a/src/mess/drivers/apple2gs.c
+++ b/src/mess/drivers/apple2gs.c
@@ -182,39 +182,35 @@ static ADDRESS_MAP_START( apple2gs_map, AS_PROGRAM, 8, apple2gs_state )
/* nothing in the address map - everything is added dynamically */
ADDRESS_MAP_END
-static WRITE8_DEVICE_HANDLER(a2bus_irq_w)
+WRITE8_MEMBER(apple2gs_state::a2bus_irq_w)
{
if (data)
{
- apple2gs_add_irq(space.machine(), IRQ_SLOT);
+ apple2gs_add_irq(machine(), IRQ_SLOT);
}
else
{
- apple2gs_remove_irq(space.machine(), IRQ_SLOT);
+ apple2gs_remove_irq(machine(), IRQ_SLOT);
}
}
-static WRITE8_DEVICE_HANDLER(a2bus_nmi_w)
+WRITE8_MEMBER(apple2gs_state::a2bus_nmi_w)
{
- apple2gs_state *a2 = space.machine().driver_data<apple2gs_state>();
-
- a2->m_maincpu->set_input_line(INPUT_LINE_NMI, data);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, data);
}
-static WRITE8_DEVICE_HANDLER(a2bus_inh_w)
+WRITE8_MEMBER(apple2gs_state::a2bus_inh_w)
{
- apple2_state *a2 = space.machine().driver_data<apple2_state>();
-
- a2->m_inh_slot = data;
- apple2_update_memory(space.machine());
+ m_inh_slot = data;
+ apple2_update_memory(machine());
}
static const struct a2bus_interface a2bus_intf =
{
// interrupt lines
- DEVCB_HANDLER(a2bus_irq_w),
- DEVCB_HANDLER(a2bus_nmi_w),
- DEVCB_HANDLER(a2bus_inh_w)
+ DEVCB_DRIVER_MEMBER(apple2gs_state,a2bus_irq_w),
+ DEVCB_DRIVER_MEMBER(apple2gs_state,a2bus_nmi_w),
+ DEVCB_DRIVER_MEMBER(apple2gs_state,a2bus_inh_w)
};
static SLOT_INTERFACE_START(apple2_cards)
diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c
index 084d66a9a2e..c5dc1c16142 100644
--- a/src/mess/drivers/bbc.c
+++ b/src/mess/drivers/bbc.c
@@ -717,25 +717,24 @@ static const cassette_interface bbc_cassette_interface =
};
-static WRITE_LINE_DEVICE_HANDLER(bbcb_ack_w)
+WRITE_LINE_MEMBER(bbc_state::bbcb_ack_w)
{
- via6522_device *via_1 = device->machine().device<via6522_device>("via6522_1");
+ via6522_device *via_1 = machine().device<via6522_device>("via6522_1");
via_1->write_ca1(!state); /* ack seems to be inverted? */
}
static const centronics_interface bbcb_centronics_config =
{
- DEVCB_DEVICE_LINE("via6522_1",bbcb_ack_w),
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbcb_ack_w),
DEVCB_NULL,
DEVCB_NULL
};
-static WRITE_LINE_DEVICE_HANDLER( bbcb_acia6850_irq_w )
+WRITE_LINE_MEMBER(bbc_state::bbcb_acia6850_irq_w)
{
- bbc_state *driver_state = device->machine().driver_data<bbc_state>();
- driver_state->m_acia_irq = state;
+ m_acia_irq = state;
- driver_state->check_interrupts();
+ check_interrupts();
}
static ACIA6850_INTERFACE( bbc_acia6850_interface )
@@ -747,7 +746,7 @@ static ACIA6850_INTERFACE( bbc_acia6850_interface )
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(bbcb_acia6850_irq_w)
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbcb_acia6850_irq_w)
};
static LEGACY_FLOPPY_OPTIONS_START(bbc)
@@ -798,15 +797,16 @@ static const sn76496_config psg_intf =
DEVCB_NULL
};
-static WRITE_LINE_DEVICE_HANDLER( econet_clk_w )
+WRITE_LINE_MEMBER(bbc_state::econet_clk_w)
{
+ device_t *device = machine().device("mc6854");
mc6854_rxc_w(device, state);
mc6854_txc_w(device, state);
}
static ECONET_INTERFACE( econet_intf )
{
- DEVCB_DEVICE_LINE("mc6854", econet_clk_w),
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,econet_clk_w),
DEVCB_NULL
};
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index 783eba784b9..fc0418a2f85 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -683,8 +683,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(bullet_state::ctc_tick)
m_ctc->trg2(0);
}
-static WRITE_LINE_DEVICE_HANDLER( dart_rxtxca_w )
+WRITE_LINE_MEMBER(bullet_state::dart_rxtxca_w)
{
+ device_t *device = machine().device(Z80DART_TAG);
z80dart_txca_w(device, state);
z80dart_rxca_w(device, state);
}
@@ -692,7 +693,7 @@ static WRITE_LINE_DEVICE_HANDLER( dart_rxtxca_w )
static Z80CTC_INTERFACE( ctc_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), // interrupt handler
- DEVCB_DEVICE_LINE(Z80DART_TAG, dart_rxtxca_w), // ZC/TO0 callback
+ DEVCB_DRIVER_LINE_MEMBER(bullet_state,dart_rxtxca_w), // ZC/TO0 callback
DEVCB_DEVICE_LINE(Z80DART_TAG, z80dart_rxtxcb_w), // ZC/TO1 callback
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF, z80ctc_device, trg3) // ZC/TO2 callback
};
diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c
index e0193b8676d..599a2148c47 100644
--- a/src/mess/drivers/bw12.c
+++ b/src/mess/drivers/bw12.c
@@ -541,8 +541,9 @@ static Z80DART_INTERFACE( sio_intf )
/* PIT8253 Interface */
-static WRITE_LINE_DEVICE_HANDLER( pit_out0_w )
+WRITE_LINE_MEMBER(bw12_state::pit_out0_w)
{
+ device_t *device = machine().device("DEVCB_DRIVER_LINE_MEMBER(Z80SIO_TAG, bw12_state,pit_out0_w)");
z80dart_txca_w(device, state);
z80dart_rxca_w(device, state);
}
@@ -558,7 +559,7 @@ static const struct pit8253_config pit_intf =
{
XTAL_1_8432MHz,
DEVCB_NULL,
- DEVCB_DEVICE_LINE(Z80SIO_TAG, pit_out0_w)
+ DEVCB_DRIVER_LINE_MEMBER(bw12_state,pit_out0_w)
},
{
XTAL_1_8432MHz,
diff --git a/src/mess/drivers/cgenie.c b/src/mess/drivers/cgenie.c
index 97ec03a1271..7c6fa274d40 100644
--- a/src/mess/drivers/cgenie.c
+++ b/src/mess/drivers/cgenie.c
@@ -60,7 +60,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START (cgenie_io, AS_IO, 8, cgenie_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xf8, 0xf8) AM_DEVREADWRITE_LEGACY("ay8910", cgenie_sh_control_port_r, cgenie_sh_control_port_w )
+ AM_RANGE(0xf8, 0xf8) AM_READWRITE(cgenie_sh_control_port_r, cgenie_sh_control_port_w )
AM_RANGE(0xf9, 0xf9) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, ay8910_data_w )
AM_RANGE(0xfa, 0xfa) AM_READWRITE_LEGACY(cgenie_index_r, cgenie_index_w )
AM_RANGE(0xfb, 0xfb) AM_READWRITE_LEGACY(cgenie_register_r, cgenie_register_w )
diff --git a/src/mess/drivers/coleco.c b/src/mess/drivers/coleco.c
index 6e9f09f3d0e..b0b9b0fe8d9 100644
--- a/src/mess/drivers/coleco.c
+++ b/src/mess/drivers/coleco.c
@@ -165,15 +165,13 @@ INPUT_PORTS_END
/* Interrupts */
-static WRITE_LINE_DEVICE_HANDLER(coleco_vdp_interrupt)
+WRITE_LINE_MEMBER(coleco_state::coleco_vdp_interrupt)
{
- coleco_state *drvstate = device->machine().driver_data<coleco_state>();
-
// NMI on rising edge
- if (state && !drvstate->m_last_nmi_state)
- drvstate->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ if (state && !m_last_nmi_state)
+ m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
- drvstate->m_last_nmi_state = state;
+ m_last_nmi_state = state;
}
TIMER_CALLBACK_MEMBER(coleco_state::paddle_d7reset_callback)
@@ -240,7 +238,7 @@ static TMS9928A_INTERFACE(coleco_tms9928a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(coleco_vdp_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(coleco_state,coleco_vdp_interrupt)
};
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index 7a4db3294b2..29a098379b3 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -132,10 +132,9 @@ static MC6845_UPDATE_ROW( einstein_6845_update_row )
}
}
-static WRITE_LINE_DEVICE_HANDLER( einstein_6845_de_changed )
+WRITE_LINE_MEMBER(einstein_state::einstein_6845_de_changed)
{
- einstein_state *einstein = device->machine().driver_data<einstein_state>();
- einstein->m_de=state;
+ m_de=state;
}
/* bit 0 - latched display enabled (DE) from 6845
@@ -236,31 +235,30 @@ READ8_MEMBER(einstein_state::einstein_keyboard_data_read)
FLOPPY DRIVES
***************************************************************************/
-static WRITE8_DEVICE_HANDLER( einstein_drsel_w )
+WRITE8_MEMBER(einstein_state::einstein_drsel_w)
{
- einstein_state *einstein = space.machine().driver_data<einstein_state>();
if(VERBOSE_DISK)
- logerror("%s: einstein_drsel_w %02x\n", space.machine().describe_context(), data);
+ logerror("%s: einstein_drsel_w %02x\n", machine().describe_context(), data);
/* bit 0 to 3 select the drive */
static const char *names[] = { "fd0", "fd1", "fd2", "fd3" };
floppy_image_device *floppy = 0;
for(int i=0; i<4; i++) {
if(BIT(data, i)) {
- floppy_connector *con = space.machine().device<floppy_connector>(names[i]);
+ floppy_connector *con = machine().device<floppy_connector>(names[i]);
if(con)
floppy = con->get_device();
}
}
/* double sided drive connected? */
- if (space.machine().root_device().ioport("config")->read() & data)
+ if (machine().root_device().ioport("config")->read() & data)
{
/* bit 4 selects the side then */
//floppy->ss_w(BIT(data, 4));
}
if (floppy) floppy->ss_w(0);
- einstein->m_fdc->set_floppy(floppy);
+ m_fdc->set_floppy(floppy);
}
@@ -283,15 +281,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(einstein_state::einstein_ctc_trigger_callback)
UART
***************************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( einstein_serial_transmit_clock )
+WRITE_LINE_MEMBER(einstein_state::einstein_serial_transmit_clock)
{
- i8251_device *uart = device->machine().device<i8251_device>(IC_I060);
+ i8251_device *uart = machine().device<i8251_device>(IC_I060);
uart->transmit_clock();
}
-static WRITE_LINE_DEVICE_HANDLER( einstein_serial_receive_clock )
+WRITE_LINE_MEMBER(einstein_state::einstein_serial_receive_clock)
{
- i8251_device *uart = device->machine().device<i8251_device>(IC_I060);
+ i8251_device *uart = machine().device<i8251_device>(IC_I060);
uart->receive_clock();
}
@@ -521,7 +519,7 @@ static ADDRESS_MAP_START( einstein_io, AS_IO, 8, einstein_state )
/* block 4, internal controls */
AM_RANGE(0x20, 0x20) AM_MIRROR(0xff00) AM_READWRITE(einstein_kybintmsk_r, einstein_kybintmsk_w)
AM_RANGE(0x21, 0x21) AM_MIRROR(0xff00) AM_WRITE(einstein_adcintmsk_w)
- AM_RANGE(0x23, 0x23) AM_MIRROR(0xff00) AM_DEVWRITE_LEGACY(IC_I042, einstein_drsel_w)
+ AM_RANGE(0x23, 0x23) AM_MIRROR(0xff00) AM_WRITE(einstein_drsel_w)
AM_RANGE(0x24, 0x24) AM_MIRROR(0xff00) AM_WRITE(einstein_rom_w)
AM_RANGE(0x25, 0x25) AM_MIRROR(0xff00) AM_WRITE(einstein_fire_int_w)
/* block 5, z80ctc */
@@ -692,8 +690,8 @@ INPUT_PORTS_END
static Z80CTC_INTERFACE( einstein_ctc_intf )
{
DEVCB_NULL,
- DEVCB_LINE(einstein_serial_transmit_clock),
- DEVCB_LINE(einstein_serial_receive_clock),
+ DEVCB_DRIVER_LINE_MEMBER(einstein_state,einstein_serial_transmit_clock),
+ DEVCB_DRIVER_LINE_MEMBER(einstein_state,einstein_serial_receive_clock),
DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF, z80ctc_device, trg3)
};
@@ -733,7 +731,7 @@ static const mc6845_interface einstein_crtc6845_interface =
NULL,
einstein_6845_update_row,
NULL,
- DEVCB_LINE(einstein_6845_de_changed),
+ DEVCB_DRIVER_LINE_MEMBER(einstein_state,einstein_6845_de_changed),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/enterp.c b/src/mess/drivers/enterp.c
index ad36f8b2ceb..eb1d0a306ec 100644
--- a/src/mess/drivers/enterp.c
+++ b/src/mess/drivers/enterp.c
@@ -98,27 +98,25 @@ static void enterprise_update_memory_page(address_space &space, offs_t page, int
/* EP specific handling of dave register write */
-static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write )
+WRITE8_MEMBER(ep_state::enterprise_dave_reg_write)
{
- ep_state *ep = space.machine().driver_data<ep_state>();
-
switch (offset)
{
case 0x10:
case 0x11:
case 0x12:
case 0x13:
- enterprise_update_memory_page(space.machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
+ enterprise_update_memory_page(machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
break;
case 0x15:
- ep->keyboard_line = data & 15;
+ keyboard_line = data & 15;
break;
}
}
-static READ8_DEVICE_HANDLER( enterprise_dave_reg_read )
+READ8_MEMBER(ep_state::enterprise_dave_reg_read)
{
static const char *const keynames[] =
{
@@ -126,30 +124,28 @@ static READ8_DEVICE_HANDLER( enterprise_dave_reg_read )
"LINE5", "LINE6", "LINE7", "LINE8", "LINE9"
};
- ep_state *ep = space.machine().driver_data<ep_state>();
-
switch (offset)
{
case 0x015:
/* read keyboard line */
- dave_set_reg(device, 0x015, space.machine().root_device().ioport(keynames[ep->keyboard_line])->read());
+ dave_set_reg(machine().device("custom"), 0x015, machine().root_device().ioport(keynames[keyboard_line])->read());
break;
case 0x016:
{
int ExternalJoystickInputs;
- int ExternalJoystickPortInput = space.machine().root_device().ioport("JOY1")->read();
+ int ExternalJoystickPortInput = machine().root_device().ioport("JOY1")->read();
- if (ep->keyboard_line <= 4)
+ if (keyboard_line <= 4)
{
- ExternalJoystickInputs = ExternalJoystickPortInput>>(4-(ep->keyboard_line));
+ ExternalJoystickInputs = ExternalJoystickPortInput>>(4-(keyboard_line));
}
else
{
ExternalJoystickInputs = 1;
}
- dave_set_reg(device, 0x016, (0x0fe | (ExternalJoystickInputs & 0x01)));
+ dave_set_reg(machine().device("custom"), 0x016, (0x0fe | (ExternalJoystickInputs & 0x01)));
}
break;
@@ -164,8 +160,8 @@ to Enterprise. But these functions make it nice and easy to see
whats going on. */
static const dave_interface enterprise_dave_interface =
{
- DEVCB_HANDLER(enterprise_dave_reg_read),
- DEVCB_HANDLER(enterprise_dave_reg_write),
+ DEVCB_DRIVER_MEMBER(ep_state,enterprise_dave_reg_read),
+ DEVCB_DRIVER_MEMBER(ep_state,enterprise_dave_reg_write),
DEVCB_CPU_INPUT_LINE("maincpu", 0)
};
@@ -180,24 +176,20 @@ void ep_state::machine_reset()
FLOPPY/EXDOS
***************************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( enterp_wd1770_intrq_w )
+WRITE_LINE_MEMBER(ep_state::enterp_wd1770_intrq_w)
{
- ep_state *ep = device->machine().driver_data<ep_state>();
-
if (state)
- ep->exdos_card_value |= 0x02;
+ exdos_card_value |= 0x02;
else
- ep->exdos_card_value &= ~0x02;
+ exdos_card_value &= ~0x02;
}
-static WRITE_LINE_DEVICE_HANDLER( enterp_wd1770_drq_w )
+WRITE_LINE_MEMBER(ep_state::enterp_wd1770_drq_w)
{
- ep_state *ep = device->machine().driver_data<ep_state>();
-
if (state)
- ep->exdos_card_value |= 0x80;
+ exdos_card_value |= 0x80;
else
- ep->exdos_card_value &= ~0x80;
+ exdos_card_value &= ~0x80;
}
@@ -417,8 +409,8 @@ INPUT_PORTS_END
static const wd17xx_interface enterp_wd1770_interface =
{
DEVCB_NULL,
- DEVCB_LINE(enterp_wd1770_intrq_w),
- DEVCB_LINE(enterp_wd1770_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(ep_state,enterp_wd1770_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(ep_state,enterp_wd1770_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 05772974e19..e6f13888548 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -396,16 +396,14 @@ WRITE8_MEMBER(fm7_state::fm7_init_en_w)
* Main CPU: I/O ports 0xfd18 - 0xfd1f
* Floppy Disk Controller (MB8877A)
*/
-static WRITE_LINE_DEVICE_HANDLER( fm7_fdc_intrq_w )
+WRITE_LINE_MEMBER(fm7_state::fm7_fdc_intrq_w)
{
- fm7_state *drvstate = device->machine().driver_data<fm7_state>();
- drvstate->m_fdc_irq_flag = state;
+ m_fdc_irq_flag = state;
}
-static WRITE_LINE_DEVICE_HANDLER( fm7_fdc_drq_w )
+WRITE_LINE_MEMBER(fm7_state::fm7_fdc_drq_w)
{
- fm7_state *drvstate = device->machine().driver_data<fm7_state>();
- drvstate->m_fdc_drq_flag = state;
+ m_fdc_drq_flag = state;
}
READ8_MEMBER(fm7_state::fm7_fdc_r)
@@ -940,14 +938,14 @@ READ8_MEMBER(fm7_state::fm7_fmirq_r)
return ret;
}
-static READ8_DEVICE_HANDLER( fm77av_joy_1_r )
+READ8_MEMBER(fm7_state::fm77av_joy_1_r)
{
- return space.machine().root_device().ioport("joy1")->read();
+ return machine().root_device().ioport("joy1")->read();
}
-static READ8_DEVICE_HANDLER( fm77av_joy_2_r )
+READ8_MEMBER(fm7_state::fm77av_joy_2_r)
{
- return space.machine().root_device().ioport("joy2")->read();
+ return machine().root_device().ioport("joy2")->read();
}
READ8_MEMBER(fm7_state::fm7_unknown_r)
@@ -1971,8 +1969,8 @@ void fm7_state::machine_reset()
static const wd17xx_interface fm7_mb8877a_interface =
{
DEVCB_NULL,
- DEVCB_LINE(fm7_fdc_intrq_w),
- DEVCB_LINE(fm7_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(fm7_state,fm7_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(fm7_state,fm7_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
@@ -1991,8 +1989,8 @@ static const ym2203_interface fm7_ym_intf =
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
- DEVCB_HANDLER(fm77av_joy_1_r),
- DEVCB_HANDLER(fm77av_joy_2_r),
+ DEVCB_DRIVER_MEMBER(fm7_state,fm77av_joy_1_r),
+ DEVCB_DRIVER_MEMBER(fm7_state,fm77av_joy_2_r),
DEVCB_NULL, /* portA write */
DEVCB_NULL /* portB write */
},
diff --git a/src/mess/drivers/fmtowns.c b/src/mess/drivers/fmtowns.c
index 8e68e9458f9..eb565dd93f7 100644
--- a/src/mess/drivers/fmtowns.c
+++ b/src/mess/drivers/fmtowns.c
@@ -133,7 +133,7 @@ enum
};
-static WRITE_LINE_DEVICE_HANDLER( towns_pic_irq );
+
INLINE UINT8 byte_to_bcd(UINT8 val)
{
@@ -1892,18 +1892,16 @@ static void towns_scsi_dma_w(running_machine &machine, UINT16 data)
state->m_scsi->fmscsi_data_w(data & 0xff);
}
-static WRITE_LINE_DEVICE_HANDLER( towns_scsi_irq )
+WRITE_LINE_MEMBER(towns_state::towns_scsi_irq)
{
- towns_state* tstate = device->machine().driver_data<towns_state>();
- pic8259_ir0_w(tstate->m_pic_slave, state);
+ pic8259_ir0_w(m_pic_slave, state);
if(IRQ_LOG)
logerror("PIC: IRQ8 (SCSI) set to %i\n",state);
}
-static WRITE_LINE_DEVICE_HANDLER( towns_scsi_drq )
+WRITE_LINE_MEMBER(towns_state::towns_scsi_drq)
{
- towns_state* tstate = device->machine().driver_data<towns_state>();
- upd71071_dmarq(tstate->m_dma_1,state,1); // SCSI HDs use channel 1
+ upd71071_dmarq(m_dma_1,state,1); // SCSI HDs use channel 1
}
@@ -2002,42 +2000,40 @@ static void towns_pcm_irq(device_t* device, int channel)
}
}
-static WRITE_LINE_DEVICE_HANDLER( towns_pic_irq )
+WRITE_LINE_MEMBER(towns_state::towns_pic_irq)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
// logerror("PIC#1: set IRQ line to %i\n",interrupt);
}
-static WRITE_LINE_DEVICE_HANDLER( towns_pit_out0_changed )
+WRITE_LINE_MEMBER(towns_state::towns_pit_out0_changed)
{
- towns_state* tstate = device->machine().driver_data<towns_state>();
- device_t* dev = tstate->m_pic_master;
+ device_t* dev = m_pic_master;
- if(tstate->m_towns_timer_mask & 0x01)
+ if(m_towns_timer_mask & 0x01)
{
- tstate->m_timer0 = state;
+ m_timer0 = state;
if(IRQ_LOG) logerror("PIC: IRQ0 (PIT Timer ch0) set to %i\n",state);
}
else
- tstate->m_timer0 = 0;
+ m_timer0 = 0;
- pic8259_ir0_w(dev, tstate->m_timer0 || tstate->m_timer1);
+ pic8259_ir0_w(dev, m_timer0 || m_timer1);
}
-static WRITE_LINE_DEVICE_HANDLER( towns_pit_out1_changed )
+WRITE_LINE_MEMBER(towns_state::towns_pit_out1_changed)
{
- towns_state* tstate = device->machine().driver_data<towns_state>();
- device_t* dev = tstate->m_pic_master;
+ device_t* dev = m_pic_master;
- if(tstate->m_towns_timer_mask & 0x02)
+ if(m_towns_timer_mask & 0x02)
{
- tstate->m_timer1 = state;
+ m_timer1 = state;
if(IRQ_LOG) logerror("PIC: IRQ0 (PIT Timer ch1) set to %i\n",state);
}
else
- tstate->m_timer1 = 0;
+ m_timer1 = 0;
- pic8259_ir0_w(dev, tstate->m_timer0 || tstate->m_timer1);
+ pic8259_ir0_w(dev, m_timer0 || m_timer1);
}
WRITE_LINE_MEMBER( towns_state::pit_out2_changed )
@@ -2515,12 +2511,12 @@ static const struct pit8253_config towns_pit8253_config =
{
307200,
DEVCB_NULL,
- DEVCB_LINE(towns_pit_out0_changed)
+ DEVCB_DRIVER_LINE_MEMBER(towns_state,towns_pit_out0_changed)
},
{
307200,
DEVCB_NULL,
- DEVCB_LINE(towns_pit_out1_changed)
+ DEVCB_DRIVER_LINE_MEMBER(towns_state,towns_pit_out1_changed)
},
{
307200,
@@ -2551,19 +2547,18 @@ static const struct pit8253_config towns_pit8253_config_2 =
}
};
-static READ8_DEVICE_HANDLER( get_slave_ack )
+READ8_MEMBER(towns_state::get_slave_ack)
{
- towns_state* state = space.machine().driver_data<towns_state>();
if (offset==7) { // IRQ = 7
- return pic8259_acknowledge(state->m_pic_slave);
+ return pic8259_acknowledge(m_pic_slave);
}
return 0x00;
}
static const struct pic8259_interface towns_pic8259_master_config =
{
- DEVCB_LINE(towns_pic_irq),
+ DEVCB_DRIVER_LINE_MEMBER(towns_state,towns_pic_irq),
DEVCB_LINE_VCC,
- DEVCB_HANDLER(get_slave_ack)
+ DEVCB_DRIVER_MEMBER(towns_state,get_slave_ack)
};
@@ -2624,8 +2619,8 @@ static const rf5c68_interface rf5c68_intf =
static const FMSCSIinterface towns_scsi_config =
{
- DEVCB_LINE(towns_scsi_irq),
- DEVCB_LINE(towns_scsi_drq)
+ DEVCB_DRIVER_LINE_MEMBER(towns_state,towns_scsi_irq),
+ DEVCB_DRIVER_LINE_MEMBER(towns_state,towns_scsi_drq)
};
static const gfx_layout fnt_chars_16x16 =
diff --git a/src/mess/drivers/huebler.c b/src/mess/drivers/huebler.c
index 076c2e9a57d..afdf38526e1 100644
--- a/src/mess/drivers/huebler.c
+++ b/src/mess/drivers/huebler.c
@@ -247,11 +247,11 @@ UINT32 amu880_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
/* Z80-CTC Interface */
-static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
+WRITE_LINE_MEMBER(amu880_state::ctc_z0_w)
{
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
+WRITE_LINE_MEMBER(amu880_state::ctc_z2_w)
{
/* cassette transmit/receive clock */
}
@@ -259,9 +259,9 @@ static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
static Z80CTC_INTERFACE( ctc_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), /* interrupt handler */
- DEVCB_LINE(ctc_z0_w), /* ZC/TO0 callback */
+ DEVCB_DRIVER_LINE_MEMBER(amu880_state,ctc_z0_w), /* ZC/TO0 callback */
DEVCB_DEVICE_LINE(Z80SIO_TAG, z80dart_rxtxcb_w), /* ZC/TO1 callback */
- DEVCB_LINE(ctc_z2_w) /* ZC/TO2 callback */
+ DEVCB_DRIVER_LINE_MEMBER(amu880_state,ctc_z2_w) /* ZC/TO2 callback */
};
/* Z80-PIO Interface */
@@ -290,14 +290,16 @@ static Z80PIO_INTERFACE( pio2_intf )
/* Z80-SIO Interface */
-static READ_LINE_DEVICE_HANDLER( cassette_r )
+READ_LINE_MEMBER(amu880_state::cassette_r)
{
+ device_t *device = machine().device(CASSETTE_TAG);
cassette_image_device* dev = dynamic_cast<cassette_image_device*>(device);
return dev->input() < 0.0;
}
-static WRITE_LINE_DEVICE_HANDLER( cassette_w )
+WRITE_LINE_MEMBER(amu880_state::cassette_w)
{
+ device_t *device = machine().device(CASSETTE_TAG);
cassette_image_device* dev = dynamic_cast<cassette_image_device*>(device);
dev->output(state ? -1.0 : +1.0);
}
@@ -306,8 +308,8 @@ static Z80DART_INTERFACE( sio_intf )
{
0, 0, 0, 0,
- DEVCB_DEVICE_LINE(CASSETTE_TAG, cassette_r),
- DEVCB_DEVICE_LINE(CASSETTE_TAG, cassette_w),
+ DEVCB_DRIVER_LINE_MEMBER(amu880_state, cassette_r),
+ DEVCB_DRIVER_LINE_MEMBER(amu880_state, cassette_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c
index 55a538e50cb..a968b6f5d6d 100644
--- a/src/mess/drivers/kaypro.c
+++ b/src/mess/drivers/kaypro.c
@@ -50,7 +50,7 @@ static ADDRESS_MAP_START( kayproii_io, AS_IO, 8, kaypro_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00, 0x03) AM_DEVWRITE("brg", com8116_device, stt_w)
- AM_RANGE(0x04, 0x07) AM_DEVREADWRITE_LEGACY("z80sio", kaypro_sio_r, kaypro_sio_w)
+ AM_RANGE(0x04, 0x07) AM_READWRITE(kaypro_sio_r, kaypro_sio_w)
AM_RANGE(0x08, 0x0b) AM_DEVREADWRITE("z80pio_g", z80pio_device, read_alt, write_alt)
AM_RANGE(0x0c, 0x0f) AM_DEVWRITE("brg", com8116_device, str_w)
AM_RANGE(0x10, 0x13) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_r, wd17xx_w)
@@ -61,7 +61,7 @@ static ADDRESS_MAP_START( kaypro2x_io, AS_IO, 8, kaypro_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00, 0x03) AM_DEVWRITE("brg", com8116_device, str_w)
- AM_RANGE(0x04, 0x07) AM_DEVREADWRITE_LEGACY("z80sio", kaypro_sio_r, kaypro_sio_w)
+ AM_RANGE(0x04, 0x07) AM_READWRITE(kaypro_sio_r, kaypro_sio_w)
AM_RANGE(0x08, 0x0b) AM_DEVWRITE("brg", com8116_device, stt_w)
AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE("z80sio_2x", z80sio_device, read, write)
AM_RANGE(0x10, 0x13) AM_DEVREADWRITE_LEGACY("wd1793", wd17xx_r, wd17xx_w)
diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c
index 371f5d9d4bd..bf7121e4601 100644
--- a/src/mess/drivers/kyocera.c
+++ b/src/mess/drivers/kyocera.c
@@ -1269,13 +1269,15 @@ static const cassette_interface kc85_cassette_interface =
NULL
};
-static WRITE_LINE_DEVICE_HANDLER( kc85_sod_w )
+WRITE_LINE_MEMBER(kc85_state::kc85_sod_w)
{
+ device_t *device = machine().device(CASSETTE_TAG);
dynamic_cast<cassette_image_device *>(device)->output(state ? +1.0 : -1.0);
}
-static READ_LINE_DEVICE_HANDLER( kc85_sid_r )
+READ_LINE_MEMBER(kc85_state::kc85_sid_r)
{
+ device_t *device = machine().device(CASSETTE_TAG);
return dynamic_cast<cassette_image_device *>(device)->input() > 0.0;
}
@@ -1283,8 +1285,8 @@ static I8085_CONFIG( kc85_i8085_config )
{
DEVCB_NULL, /* STATUS changed callback */
DEVCB_NULL, /* INTE changed callback */
- DEVCB_DEVICE_LINE(CASSETTE_TAG, kc85_sid_r), /* SID changed callback (I8085A only) */
- DEVCB_DEVICE_LINE(CASSETTE_TAG, kc85_sod_w) /* SOD changed callback (I8085A only) */
+ DEVCB_DRIVER_LINE_MEMBER(kc85_state,kc85_sid_r), /* SID changed callback (I8085A only) */
+ DEVCB_DRIVER_LINE_MEMBER(kc85_state,kc85_sod_w) /* SOD changed callback (I8085A only) */
};
TIMER_DEVICE_CALLBACK_MEMBER(tandy200_state::tandy200_tp_tick)
diff --git a/src/mess/drivers/m5.c b/src/mess/drivers/m5.c
index df95cb12542..1d78c9c5263 100644
--- a/src/mess/drivers/m5.c
+++ b/src/mess/drivers/m5.c
@@ -432,14 +432,12 @@ static const cassette_interface cassette_intf =
// TMS9928a_interface vdp_intf
//-------------------------------------------------
-static WRITE_LINE_DEVICE_HANDLER(sordm5_video_interrupt_callback)
+WRITE_LINE_MEMBER(m5_state::sordm5_video_interrupt_callback)
{
- m5_state *driver_state = device->machine().driver_data<m5_state>();
-
if (state)
{
- driver_state->m_ctc->trg3(1);
- driver_state->m_ctc->trg3(0);
+ m_ctc->trg3(1);
+ m_ctc->trg3(0);
}
}
@@ -447,7 +445,7 @@ static TMS9928A_INTERFACE(m5_tms9928a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(sordm5_video_interrupt_callback)
+ DEVCB_DRIVER_LINE_MEMBER(m5_state,sordm5_video_interrupt_callback)
};
diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c
index 68aafd7c914..f4c2b6ce976 100644
--- a/src/mess/drivers/msx.c
+++ b/src/mess/drivers/msx.c
@@ -341,8 +341,9 @@ static ADDRESS_MAP_START ( msx_memory_map, AS_PROGRAM, 8, msx_state )
ADDRESS_MAP_END
-static WRITE8_DEVICE_HANDLER( msx_ay8910_w )
+WRITE8_MEMBER(msx_state::msx_ay8910_w)
{
+ device_t *device = machine().device("ay8910");
if ( offset & 1 )
ay8910_data_w( device, space, offset, data );
else
@@ -355,9 +356,9 @@ static ADDRESS_MAP_START ( msx_io_map, AS_IO, 8, msx_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x77, 0x77) AM_WRITE(msx_90in1_w)
AM_RANGE( 0x7c, 0x7d) AM_WRITE(msx_fmpac_w)
- AM_RANGE( 0x90, 0x90) AM_DEVREADWRITE_LEGACY("centronics", msx_printer_status_r, msx_printer_strobe_w)
- AM_RANGE( 0x91, 0x91) AM_DEVWRITE_LEGACY("centronics", msx_printer_data_w)
- AM_RANGE( 0xa0, 0xa7) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, msx_ay8910_w)
+ AM_RANGE( 0x90, 0x90) AM_READWRITE(msx_printer_status_r, msx_printer_strobe_w)
+ AM_RANGE( 0x91, 0x91) AM_WRITE(msx_printer_data_w)
+ AM_RANGE( 0xa0, 0xa7) AM_DEVREAD_LEGACY("ay8910", ay8910_r) AM_WRITE(msx_ay8910_w)
AM_RANGE( 0xa8, 0xab) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
AM_RANGE( 0x98, 0x98) AM_DEVREADWRITE("tms9928a", tms9928a_device, vram_read, vram_write)
AM_RANGE( 0x99, 0x99) AM_DEVREADWRITE("tms9928a", tms9928a_device, register_read, register_write)
@@ -370,9 +371,9 @@ static ADDRESS_MAP_START ( msx2_io_map, AS_IO, 8, msx_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x77, 0x77) AM_WRITE(msx_90in1_w)
AM_RANGE( 0x7c, 0x7d) AM_WRITE(msx_fmpac_w)
- AM_RANGE( 0x90, 0x90) AM_DEVREADWRITE_LEGACY("centronics", msx_printer_status_r, msx_printer_strobe_w)
- AM_RANGE( 0x91, 0x91) AM_DEVWRITE_LEGACY("centronics", msx_printer_data_w)
- AM_RANGE( 0xa0, 0xa7) AM_DEVREADWRITE_LEGACY("ay8910", ay8910_r, msx_ay8910_w)
+ AM_RANGE( 0x90, 0x90) AM_READWRITE(msx_printer_status_r, msx_printer_strobe_w)
+ AM_RANGE( 0x91, 0x91) AM_WRITE(msx_printer_data_w)
+ AM_RANGE( 0xa0, 0xa7) AM_DEVREAD_LEGACY("ay8910", ay8910_r) AM_WRITE(msx_ay8910_w)
AM_RANGE( 0xa8, 0xab) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
AM_RANGE( 0x98, 0x9b) AM_DEVREADWRITE("v9938", v9938_device, read, write)
AM_RANGE( 0xb4, 0xb4) AM_WRITE(msx_rtc_latch_w)
diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c
index 2cbcbcdb06f..fc39b4105c1 100644
--- a/src/mess/drivers/mtx.c
+++ b/src/mess/drivers/mtx.c
@@ -56,11 +56,11 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( mtx_io, AS_IO, 8, mtx_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_strobe_r) AM_WRITE(mtx_bankswitch_w)
+ AM_RANGE(0x00, 0x00) AM_READWRITE(mtx_strobe_r, mtx_bankswitch_w)
AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("tms9929a", tms9929a_device, vram_read, vram_write)
AM_RANGE(0x02, 0x02) AM_DEVREADWRITE("tms9929a", tms9929a_device, register_read, register_write)
- AM_RANGE(0x03, 0x03) AM_READ(mtx_sound_strobe_r) AM_DEVWRITE_LEGACY(CASSETTE_TAG, mtx_cst_w)
- AM_RANGE(0x04, 0x04) AM_DEVREAD_LEGACY(CENTRONICS_TAG, mtx_prt_r)
+ AM_RANGE(0x03, 0x03) AM_READWRITE(mtx_sound_strobe_r, mtx_cst_w)
+ AM_RANGE(0x04, 0x04) AM_READ(mtx_prt_r)
AM_RANGE(0x04, 0x04) AM_DEVWRITE(CENTRONICS_TAG, centronics_device, write)
AM_RANGE(0x05, 0x05) AM_READWRITE(mtx_key_lo_r, mtx_sense_w)
AM_RANGE(0x06, 0x06) AM_READWRITE(mtx_key_hi_r, mtx_sound_latch_w)
@@ -218,24 +218,20 @@ TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::ctc_tick)
m_z80ctc->trg2(0);
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_trg1_w )
+WRITE_LINE_MEMBER(mtx_state::ctc_trg1_w)
{
- mtx_state *driver_state = device->machine().driver_data<mtx_state>();
-
- if (driver_state->m_z80dart != NULL)
+ if (m_z80dart != NULL)
{
- z80dart_rxca_w(driver_state->m_z80dart, state);
- z80dart_txca_w(driver_state->m_z80dart, state);
+ z80dart_rxca_w(m_z80dart, state);
+ z80dart_txca_w(m_z80dart, state);
}
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_trg2_w )
+WRITE_LINE_MEMBER(mtx_state::ctc_trg2_w)
{
- mtx_state *driver_state = device->machine().driver_data<mtx_state>();
-
- if (driver_state->m_z80dart != NULL)
+ if (m_z80dart != NULL)
{
- z80dart_rxtxcb_w(driver_state->m_z80dart, state);
+ z80dart_rxtxcb_w(m_z80dart, state);
}
}
@@ -243,8 +239,8 @@ static Z80CTC_INTERFACE( ctc_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),
DEVCB_NULL,
- DEVCB_LINE(ctc_trg1_w),
- DEVCB_LINE(ctc_trg2_w)
+ DEVCB_DRIVER_LINE_MEMBER(mtx_state,ctc_trg1_w),
+ DEVCB_DRIVER_LINE_MEMBER(mtx_state,ctc_trg2_w)
};
/*-------------------------------------------------
@@ -320,18 +316,16 @@ static const cassette_interface mtx_cassette_interface =
mtx_tms9928a_interface
-------------------------------------------------*/
-static WRITE_LINE_DEVICE_HANDLER(mtx_tms9929a_interrupt)
+WRITE_LINE_MEMBER(mtx_state::mtx_tms9929a_interrupt)
{
- mtx_state *drv_state = device->machine().driver_data<mtx_state>();
-
- drv_state->m_z80ctc->trg0(state ? 0 : 1);
+ m_z80ctc->trg0(state ? 0 : 1);
}
static TMS9928A_INTERFACE(mtx_tms9928a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(mtx_tms9929a_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(mtx_state,mtx_tms9929a_interrupt)
};
/*-------------------------------------------------
diff --git a/src/mess/drivers/nascom1.c b/src/mess/drivers/nascom1.c
index 02c984788cd..2aa5282e326 100644
--- a/src/mess/drivers/nascom1.c
+++ b/src/mess/drivers/nascom1.c
@@ -257,8 +257,8 @@ static const ay31015_config nascom1_ay31015_config =
AY_3_1015,
( XTAL_16MHz / 16 ) / 256,
( XTAL_16MHz / 16 ) / 256,
- DEVCB_HANDLER(nascom1_hd6402_si),
- DEVCB_HANDLER(nascom1_hd6402_so),
+ DEVCB_DRIVER_MEMBER(nascom1_state, nascom1_hd6402_si),
+ DEVCB_DRIVER_MEMBER(nascom1_state, nascom1_hd6402_so),
DEVCB_NULL
};
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 2bcdfb25aca..dd4081e7b34 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -837,50 +837,48 @@ WRITE8_MEMBER(nc_state::nc100_uart_control_w)
}
-static WRITE_LINE_DEVICE_HANDLER(nc100_tc8521_alarm_callback)
+WRITE_LINE_MEMBER(nc_state::nc100_tc8521_alarm_callback)
{
// TODO
}
-static WRITE_LINE_DEVICE_HANDLER( nc100_txrdy_callback )
+WRITE_LINE_MEMBER(nc_state::nc100_txrdy_callback)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
- drvstate->m_irq_latch &= ~(1 << 1);
+ m_irq_latch &= ~(1 << 1);
/* uart on? */
- if ((drvstate->m_uart_control & (1 << 3)) == 0)
+ if ((m_uart_control & (1 << 3)) == 0)
{
if (state)
{
logerror("tx ready\n");
- drvstate->m_irq_latch |= (1 << 1);
+ m_irq_latch |= (1 << 1);
}
}
- nc_update_interrupts(device->machine());
+ nc_update_interrupts(machine());
}
-static WRITE_LINE_DEVICE_HANDLER( nc100_rxrdy_callback )
+WRITE_LINE_MEMBER(nc_state::nc100_rxrdy_callback)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
- drvstate->m_irq_latch &= ~(1<<0);
+ m_irq_latch &= ~(1<<0);
- if ((drvstate->m_uart_control & (1<<3))==0)
+ if ((m_uart_control & (1<<3))==0)
{
if (state)
{
logerror("rx ready\n");
- drvstate->m_irq_latch |= (1<<0);
+ m_irq_latch |= (1<<0);
}
}
- nc_update_interrupts(device->machine());
+ nc_update_interrupts(machine());
}
static RP5C01_INTERFACE( rtc_intf )
{
- DEVCB_LINE(nc100_tc8521_alarm_callback)
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_tc8521_alarm_callback)
};
static const i8251_interface nc100_uart_interface =
@@ -890,28 +888,27 @@ static const i8251_interface nc100_uart_interface =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(nc100_rxrdy_callback),
- DEVCB_LINE(nc100_txrdy_callback),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_rxrdy_callback),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_txrdy_callback),
DEVCB_NULL,
DEVCB_NULL
};
-static WRITE_LINE_DEVICE_HANDLER( nc100_centronics_ack_w )
+WRITE_LINE_MEMBER(nc_state::nc100_centronics_ack_w)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
if (state)
- drvstate->m_irq_status |= 0x04;
+ m_irq_status |= 0x04;
else
- drvstate->m_irq_status &= ~0x04;
+ m_irq_status &= ~0x04;
/* trigger an int if the irq is set */
- nc_update_interrupts(device->machine());
+ nc_update_interrupts(machine());
}
static const centronics_interface nc100_centronics_config =
{
- DEVCB_LINE(nc100_centronics_ack_w),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc100_centronics_ack_w),
DEVCB_NULL,
DEVCB_NULL
};
@@ -1183,21 +1180,20 @@ WRITE8_MEMBER(nc_state::nc200_display_memory_start_w)
#endif
-static WRITE_LINE_DEVICE_HANDLER( nc200_centronics_ack_w )
+WRITE_LINE_MEMBER(nc_state::nc200_centronics_ack_w)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
if (state)
- drvstate->m_irq_status |= 0x01;
+ m_irq_status |= 0x01;
else
- drvstate->m_irq_status &= ~0x01;
+ m_irq_status &= ~0x01;
/* trigger an int if the irq is set */
- nc_update_interrupts(device->machine());
+ nc_update_interrupts(machine());
}
static const centronics_interface nc200_centronics_config =
{
- DEVCB_LINE(nc200_centronics_ack_w),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_centronics_ack_w),
DEVCB_NULL,
DEVCB_NULL
};
@@ -1222,30 +1218,29 @@ static void nc200_refresh_uart_interrupt(running_machine &machine)
nc_update_interrupts(machine);
}
-static WRITE_LINE_DEVICE_HANDLER( nc200_txrdy_callback )
+WRITE_LINE_MEMBER(nc_state::nc200_txrdy_callback)
{
- //nc_state *drvstate = machine.driver_data<nc_state>();
-// drvstate->m_nc200_uart_interrupt_irq &=~(1<<0);
+ //nc_state *drvstate = machine().driver_data<nc_state>();
+// m_nc200_uart_interrupt_irq &=~(1<<0);
//
// if (state)
// {
-// drvstate->m_nc200_uart_interrupt_irq |=(1<<0);
+// m_nc200_uart_interrupt_irq |=(1<<0);
// }
//
-// nc200_refresh_uart_interrupt(device->machine());
+// nc200_refresh_uart_interrupt(machine());
}
-static WRITE_LINE_DEVICE_HANDLER( nc200_rxrdy_callback )
+WRITE_LINE_MEMBER(nc_state::nc200_rxrdy_callback)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
- drvstate->m_nc200_uart_interrupt_irq &=~(1<<1);
+ m_nc200_uart_interrupt_irq &=~(1<<1);
if (state)
{
- drvstate->m_nc200_uart_interrupt_irq |=(1<<1);
+ m_nc200_uart_interrupt_irq |=(1<<1);
}
- nc200_refresh_uart_interrupt(device->machine());
+ nc200_refresh_uart_interrupt(machine());
}
static const i8251_interface nc200_uart_interface=
@@ -1255,37 +1250,36 @@ static const i8251_interface nc200_uart_interface=
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(nc200_rxrdy_callback),
- DEVCB_LINE(nc200_txrdy_callback),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_rxrdy_callback),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_txrdy_callback),
DEVCB_NULL,
DEVCB_NULL
};
-static WRITE_LINE_DEVICE_HANDLER( nc200_fdc_interrupt )
+WRITE_LINE_MEMBER(nc_state::nc200_fdc_interrupt)
{
- nc_state *drvstate = device->machine().driver_data<nc_state>();
#if 0
- drvstate->m_irq_latch &=~(1<<5);
+ m_irq_latch &=~(1<<5);
if (state)
{
- drvstate->m_irq_latch |=(1<<5);
+ m_irq_latch |=(1<<5);
}
#endif
- drvstate->m_irq_status &=~(1<<5);
+ m_irq_status &=~(1<<5);
if (state)
{
- drvstate->m_irq_status |=(1<<5);
+ m_irq_status |=(1<<5);
}
- nc_update_interrupts(device->machine());
+ nc_update_interrupts(machine());
}
static const upd765_interface nc200_upd765_interface=
{
- DEVCB_LINE(nc200_fdc_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(nc_state,nc200_fdc_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index faf67ca1a21..edbec655ce3 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -21,18 +21,21 @@
#include "formats/nes_dsk.h"
-static READ8_DEVICE_HANDLER( psg_4015_r )
+READ8_MEMBER(nes_state::psg_4015_r)
{
+ device_t *device = machine().device("nessound");
return nes_psg_r(device, space, 0x15);
}
-static WRITE8_DEVICE_HANDLER( psg_4015_w )
+WRITE8_MEMBER(nes_state::psg_4015_w)
{
+ device_t *device = machine().device("nessound");
nes_psg_w(device, space, 0x15, data);
}
-static WRITE8_DEVICE_HANDLER( psg_4017_w )
+WRITE8_MEMBER(nes_state::psg_4017_w)
{
+ device_t *device = machine().device("nessound");
nes_psg_w(device, space, 0x17, data);
}
@@ -46,10 +49,10 @@ static ADDRESS_MAP_START( nes_map, AS_PROGRAM, 8, nes_state )
AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE("ppu", ppu2c0x_device, read, write) /* PPU registers */
AM_RANGE(0x4000, 0x4013) AM_DEVREADWRITE_LEGACY("nessound", nes_psg_r, nes_psg_w) /* PSG primary registers */
AM_RANGE(0x4014, 0x4014) AM_WRITE(nes_vh_sprite_dma_w) /* stupid address space hole */
- AM_RANGE(0x4015, 0x4015) AM_DEVREADWRITE_LEGACY("nessound", psg_4015_r, psg_4015_w) /* PSG status / first control register */
+ AM_RANGE(0x4015, 0x4015) AM_READWRITE(psg_4015_r, psg_4015_w) /* PSG status / first control register */
AM_RANGE(0x4016, 0x4016) AM_READWRITE(nes_IN0_r, nes_IN0_w) /* IN0 - input port 1 */
AM_RANGE(0x4017, 0x4017) AM_READ(nes_IN1_r) /* IN1 - input port 2 */
- AM_RANGE(0x4017, 0x4017) AM_DEVWRITE_LEGACY("nessound", psg_4017_w) /* PSG second control register */
+ AM_RANGE(0x4017, 0x4017) AM_WRITE(psg_4017_w) /* PSG second control register */
AM_RANGE(0x4100, 0x5fff) AM_READWRITE(nes_low_mapper_r, nes_low_mapper_w) /* Perform unholy acts on the machine */
ADDRESS_MAP_END
diff --git a/src/mess/drivers/ob68k1a.c b/src/mess/drivers/ob68k1a.c
index 8b85dd1aa6e..55256852b54 100644
--- a/src/mess/drivers/ob68k1a.c
+++ b/src/mess/drivers/ob68k1a.c
@@ -251,8 +251,16 @@ static ACIA6850_INTERFACE( acia1_intf )
// COM8116_INTERFACE( dbrg_intf )
//-------------------------------------------------
-static WRITE_LINE_DEVICE_HANDLER( rx_tx_w )
+WRITE_LINE_MEMBER(ob68k1a_state::rx_tx_0_w)
{
+ device_t *device = machine().device(MC6850_0_TAG);
+ downcast<acia6850_device *>(device)->rx_clock_in();
+ downcast<acia6850_device *>(device)->tx_clock_in();
+}
+
+WRITE_LINE_MEMBER(ob68k1a_state::rx_tx_1_w)
+{
+ device_t *device = machine().device(MC6850_1_TAG);
downcast<acia6850_device *>(device)->rx_clock_in();
downcast<acia6850_device *>(device)->tx_clock_in();
}
@@ -260,8 +268,8 @@ static WRITE_LINE_DEVICE_HANDLER( rx_tx_w )
static COM8116_INTERFACE( dbrg_intf )
{
DEVCB_NULL, /* fX/4 output */
- DEVCB_DEVICE_LINE(MC6850_0_TAG, rx_tx_w),
- DEVCB_DEVICE_LINE(MC6850_1_TAG, rx_tx_w),
+ DEVCB_DRIVER_LINE_MEMBER(ob68k1a_state,rx_tx_0_w),
+ DEVCB_DRIVER_LINE_MEMBER(ob68k1a_state,rx_tx_1_w),
{ 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 }, /* receiver divisor ROM */
{ 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 }, /* transmitter divisor ROM */
};
diff --git a/src/mess/drivers/osi.c b/src/mess/drivers/osi.c
index 7f339d1c97f..95416f790d7 100644
--- a/src/mess/drivers/osi.c
+++ b/src/mess/drivers/osi.c
@@ -362,11 +362,9 @@ WRITE8_MEMBER( c1p_state::osi630_sound_w )
C011 ACIAIO DISK CONTROLLER ACIA I/O PORT
*/
-static WRITE_LINE_DEVICE_HANDLER(osi470_index_callback)
+WRITE_LINE_MEMBER(sb2m600_state::osi470_index_callback)
{
- sb2m600_state *driver_state = device->machine().driver_data<sb2m600_state>();
-
- driver_state->m_fdc_index = state;
+ m_fdc_index = state;
}
READ8_MEMBER( c1pmf_state::osi470_pia_pa_r )
@@ -741,7 +739,7 @@ LEGACY_FLOPPY_OPTIONS_END
static const floppy_interface osi_floppy_interface =
{
- DEVCB_LINE(osi470_index_callback),
+ DEVCB_DRIVER_LINE_MEMBER(sb2m600_state,osi470_index_callback),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/pc.c b/src/mess/drivers/pc.c
index 26a0804bfe3..b1ab0e98761 100644
--- a/src/mess/drivers/pc.c
+++ b/src/mess/drivers/pc.c
@@ -157,9 +157,9 @@ static ADDRESS_MAP_START(mc1502_io, AS_IO, 8, pc_state )
AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE_LEGACY("pit8253", pit8253_r, pit8253_w)
AM_RANGE(0x0060, 0x0063) AM_DEVREADWRITE("ppi8255", i8255_device, read, write)
AM_RANGE(0x0068, 0x006B) AM_DEVREADWRITE("ppi8255n2", i8255_device, read, write) // keyboard poll
- AM_RANGE(0x0100, 0x0100) AM_DEVREADWRITE_LEGACY("vg93", mc1502_wd17xx_aux_r, mc1502_wd17xx_aux_w)
- AM_RANGE(0x0108, 0x0108) AM_DEVREAD_LEGACY("vg93", mc1502_wd17xx_drq_r) // blocking read!
- AM_RANGE(0x010a, 0x010a) AM_DEVREAD_LEGACY("vg93", mc1502_wd17xx_motor_r)
+ AM_RANGE(0x0100, 0x0100) AM_READWRITE(mc1502_wd17xx_aux_r, mc1502_wd17xx_aux_w)
+ AM_RANGE(0x0108, 0x0108) AM_READ(mc1502_wd17xx_drq_r) // blocking read!
+ AM_RANGE(0x010a, 0x010a) AM_READ(mc1502_wd17xx_motor_r)
AM_RANGE(0x010c, 0x010c) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_status_r, wd17xx_command_w)
AM_RANGE(0x010d, 0x010d) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_track_r, wd17xx_track_w)
AM_RANGE(0x010e, 0x010e) AM_DEVREADWRITE_LEGACY("vg93", wd17xx_sector_r, wd17xx_sector_w)
diff --git a/src/mess/drivers/pce.c b/src/mess/drivers/pce.c
index ebef609fd3b..9dc69a01209 100644
--- a/src/mess/drivers/pce.c
+++ b/src/mess/drivers/pce.c
@@ -501,16 +501,16 @@ UINT32 pce_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, con
}
-static WRITE_LINE_DEVICE_HANDLER( pce_irq_changed )
+WRITE_LINE_MEMBER(pce_state::pce_irq_changed)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state);
+ machine().device("maincpu")->execute().set_input_line(0, state);
}
static const huc6270_interface pce_huc6270_config =
{
0x10000,
- DEVCB_LINE(pce_irq_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
};
@@ -527,14 +527,14 @@ static const huc6260_interface pce_huc6260_config =
static const huc6270_interface sgx_huc6270_0_config =
{
0x10000,
- DEVCB_LINE(pce_irq_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
};
static const huc6270_interface sgx_huc6270_1_config =
{
0x10000,
- DEVCB_LINE(pce_irq_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pce_state,pce_irq_changed)
};
diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c
index eda727056c9..1ab88ccf826 100644
--- a/src/mess/drivers/pcw.c
+++ b/src/mess/drivers/pcw.c
@@ -113,7 +113,7 @@
static const UINT8 half_step_table[4] = { 0x01, 0x02, 0x04, 0x08 };
static const UINT8 full_step_table[4] = { 0x03, 0x06, 0x0c, 0x09 };
-static WRITE_LINE_DEVICE_HANDLER( pcw_fdc_interrupt );
+
static void pcw_update_interrupt_counter(pcw_state *state)
{
@@ -129,7 +129,7 @@ static void pcw_update_interrupt_counter(pcw_state *state)
/NMI depending on choice (see system control below) */
static const upd765_interface pcw_upd765_interface =
{
- DEVCB_LINE(pcw_fdc_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(pcw_state,pcw_fdc_interrupt),
DEVCB_NULL,
NULL,
UPD765_RDY_PIN_CONNECTED,
@@ -179,16 +179,15 @@ TIMER_DEVICE_CALLBACK_MEMBER(pcw_state::pcw_timer_interrupt)
}
/* fdc interrupt callback. set/clear fdc int */
-static WRITE_LINE_DEVICE_HANDLER( pcw_fdc_interrupt )
+WRITE_LINE_MEMBER(pcw_state::pcw_fdc_interrupt)
{
- pcw_state *drvstate = device->machine().driver_data<pcw_state>();
if (state == CLEAR_LINE)
- drvstate->m_system_status &= ~(1<<5);
+ m_system_status &= ~(1<<5);
else
{
- drvstate->m_system_status |= (1<<5);
- if(drvstate->m_fdc_interrupt_code == 0) // NMI is held until interrupt type is changed
- drvstate->m_nmi_flag = 1;
+ m_system_status |= (1<<5);
+ if(m_fdc_interrupt_code == 0) // NMI is held until interrupt type is changed
+ m_nmi_flag = 1;
}
}
diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c
index 4e9688cdc3c..8d8b849d4ab 100644
--- a/src/mess/drivers/pcw16.c
+++ b/src/mess/drivers/pcw16.c
@@ -1312,54 +1312,52 @@ static const struct pc_fdc_interface pcw16_fdc_interface=
};
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_interrupt_1 )
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_interrupt_1)
{
- pcw16_state *drvstate = device->machine().driver_data<pcw16_state>();
- drvstate->m_system_status &= ~(1 << 4);
+ m_system_status &= ~(1 << 4);
if ( state ) {
- drvstate->m_system_status |= (1 << 4);
+ m_system_status |= (1 << 4);
}
- drvstate->pcw16_refresh_ints();
+ pcw16_refresh_ints();
}
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_interrupt_2 )
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_interrupt_2)
{
- pcw16_state *drvstate = device->machine().driver_data<pcw16_state>();
- drvstate->m_system_status &= ~(1 << 3);
+ m_system_status &= ~(1 << 3);
if ( state ) {
- drvstate->m_system_status |= (1 << 3);
+ m_system_status |= (1 << 3);
}
- drvstate->pcw16_refresh_ints();
+ pcw16_refresh_ints();
}
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_tx_0 ) { }
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_dtr_0 ) { }
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_rts_0 ) { }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_tx_0){ }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_dtr_0){ }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_rts_0){ }
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_tx_1 ) { }
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_dtr_1 ) { }
-static WRITE_LINE_DEVICE_HANDLER( pcw16_com_rts_1 ) { }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_tx_1){ }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_dtr_1){ }
+WRITE_LINE_MEMBER(pcw16_state::pcw16_com_rts_1){ }
static const ins8250_interface pcw16_com_interface[2]=
{
{
- DEVCB_LINE(pcw16_com_tx_0),
- DEVCB_LINE(pcw16_com_dtr_0),
- DEVCB_LINE(pcw16_com_rts_0),
- DEVCB_LINE(pcw16_com_interrupt_1),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_tx_0),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_dtr_0),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_rts_0),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_interrupt_1),
DEVCB_NULL,
DEVCB_NULL
},
{
- DEVCB_LINE(pcw16_com_tx_1),
- DEVCB_LINE(pcw16_com_dtr_1),
- DEVCB_LINE(pcw16_com_rts_1),
- DEVCB_LINE(pcw16_com_interrupt_2),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_tx_1),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_dtr_1),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_rts_1),
+ DEVCB_DRIVER_LINE_MEMBER(pcw16_state,pcw16_com_interrupt_2),
DEVCB_NULL,
DEVCB_NULL
}
diff --git a/src/mess/drivers/pes.c b/src/mess/drivers/pes.c
index dd6626eb48b..5da1291bcc5 100644
--- a/src/mess/drivers/pes.c
+++ b/src/mess/drivers/pes.c
@@ -65,14 +65,13 @@ Address map:
#include "machine/terminal.h"
/* Devices */
-static WRITE8_DEVICE_HANDLER( pes_kbd_input )
+WRITE8_MEMBER(pes_state::pes_kbd_input)
{
- pes_state *state = space.machine().driver_data<pes_state>();
#ifdef DEBUG_FIFO
fprintf(stderr,"keyboard input: %c, ", data);
#endif
// if fifo is full (head ptr = tail ptr-1), do not increment the head ptr and do not store the data
- if (((state->m_infifo_tail_ptr-1)&0x1F) == state->m_infifo_head_ptr)
+ if (((m_infifo_tail_ptr-1)&0x1F) == m_infifo_head_ptr)
{
logerror("infifo was full, write ignored!\n");
#ifdef DEBUG_FIFO
@@ -80,20 +79,20 @@ static WRITE8_DEVICE_HANDLER( pes_kbd_input )
#endif
return;
}
- state->m_infifo[state->m_infifo_head_ptr] = data;
- state->m_infifo_head_ptr++;
- state->m_infifo_head_ptr&=0x1F;
+ m_infifo[m_infifo_head_ptr] = data;
+ m_infifo_head_ptr++;
+ m_infifo_head_ptr&=0x1F;
#ifdef DEBUG_FIFO
- fprintf(stderr,"kb input fifo fullness: %d\n",(state->m_infifo_head_ptr-state->m_infifo_tail_ptr)&0x1F);
+ fprintf(stderr,"kb input fifo fullness: %d\n",(m_infifo_head_ptr-m_infifo_tail_ptr)&0x1F);
#endif
// todo: following two should be set so clear happens after one cpu cycle
- space.machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE);
- space.machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE);
}
static GENERIC_TERMINAL_INTERFACE( pes_terminal_intf )
{
- DEVCB_HANDLER(pes_kbd_input)
+ DEVCB_DRIVER_MEMBER(pes_state,pes_kbd_input)
};
/* Helper Functions */
diff --git a/src/mess/drivers/pet.c b/src/mess/drivers/pet.c
index 80993169de3..06f962ad31f 100644
--- a/src/mess/drivers/pet.c
+++ b/src/mess/drivers/pet.c
@@ -603,7 +603,7 @@ static const mc6845_interface crtc_pet40 = {
NULL,
pet40_update_row,
NULL,
- DEVCB_LINE(pet_display_enable_changed),
+ DEVCB_DRIVER_LINE_MEMBER(pet_state, pet_display_enable_changed),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
@@ -616,7 +616,7 @@ static const mc6845_interface crtc_pet80 = {
NULL,
pet80_update_row,
NULL,
- DEVCB_LINE(pet_display_enable_changed),
+ DEVCB_DRIVER_LINE_MEMBER(pet_state, pet_display_enable_changed),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/pokemini.c b/src/mess/drivers/pokemini.c
index f95cb29fdad..dc8cee62e13 100644
--- a/src/mess/drivers/pokemini.c
+++ b/src/mess/drivers/pokemini.c
@@ -13,7 +13,7 @@ The LCD is likely to be a SSD1828 LCD.
static ADDRESS_MAP_START( pokemini_mem_map, AS_PROGRAM, 8, pokemini_state )
AM_RANGE( 0x000000, 0x000FFF ) AM_ROM /* bios */
AM_RANGE( 0x001000, 0x001FFF ) AM_RAM AM_SHARE("p_ram") /* VRAM/RAM */
- AM_RANGE( 0x002000, 0x0020FF ) AM_DEVREADWRITE_LEGACY("i2cmem", pokemini_hwreg_r, pokemini_hwreg_w ) /* hardware registers */
+ AM_RANGE( 0x002000, 0x0020FF ) AM_READWRITE(pokemini_hwreg_r, pokemini_hwreg_w ) /* hardware registers */
AM_RANGE( 0x002100, 0x1FFFFF ) AM_ROM /* cartridge area */
ADDRESS_MAP_END
diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c
index 278b42b785f..1a7bc38b5aa 100644
--- a/src/mess/drivers/portfoli.c
+++ b/src/mess/drivers/portfoli.c
@@ -649,10 +649,10 @@ void portfolio_state::palette_init()
// HD61830_INTERFACE( lcdc_intf )
//-------------------------------------------------
-static READ8_DEVICE_HANDLER( hd61830_rd_r )
+READ8_MEMBER(portfolio_state::hd61830_rd_r)
{
UINT16 address = ((offset & 0xff) << 3) | ((offset >> 12) & 0x07);
- UINT8 data = space.machine().root_device().memregion(HD61830_TAG)->base()[address];
+ UINT8 data = machine().root_device().memregion(HD61830_TAG)->base()[address];
return data;
}
@@ -660,7 +660,7 @@ static READ8_DEVICE_HANDLER( hd61830_rd_r )
static HD61830_INTERFACE( lcdc_intf )
{
SCREEN_TAG,
- DEVCB_HANDLER(hd61830_rd_r)
+ DEVCB_DRIVER_MEMBER(portfolio_state,hd61830_rd_r)
};
//-------------------------------------------------
diff --git a/src/mess/drivers/ql.c b/src/mess/drivers/ql.c
index 211542b7d44..6cecf9b48ea 100644
--- a/src/mess/drivers/ql.c
+++ b/src/mess/drivers/ql.c
@@ -364,22 +364,20 @@ void ql_state::sandy_set_control(UINT8 data)
}
}
-static READ_LINE_DEVICE_HANDLER( disk_io_dden_r )
+READ_LINE_MEMBER(ql_state::disk_io_dden_r)
{
- ql_state *state = device->machine().driver_data<ql_state>();
-
- if(state->m_disk_type==DISK_TYPE_SANDY)
- return ((state->m_disk_io_byte & SANDY_DDEN_MASK) >> SANDY_DDEN_SHIFT);
+ if(m_disk_type==DISK_TYPE_SANDY)
+ return ((m_disk_io_byte & SANDY_DDEN_MASK) >> SANDY_DDEN_SHIFT);
else
return 0;
}
-static WRITE_LINE_DEVICE_HANDLER( disk_io_intrq_w )
+WRITE_LINE_MEMBER(ql_state::disk_io_intrq_w)
{
//logerror("DiskIO:intrq = %d\n",state);
}
-static WRITE_LINE_DEVICE_HANDLER( disk_io_drq_w )
+WRITE_LINE_MEMBER(ql_state::disk_io_drq_w)
{
//logerror("DiskIO:drq = %d\n",state);
}
@@ -846,9 +844,9 @@ static const floppy_interface ql_floppy_interface =
wd17xx_interface ql_wd17xx_interface =
{
- DEVCB_LINE(disk_io_dden_r),
- DEVCB_LINE(disk_io_intrq_w),
- DEVCB_LINE(disk_io_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_dden_r),
+ DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(ql_state,disk_io_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c
index e1a58db6b1a..05ff69cf3c4 100644
--- a/src/mess/drivers/rmnimbus.c
+++ b/src/mess/drivers/rmnimbus.c
@@ -90,7 +90,7 @@ static const SCSICB_interface scsibus_config =
static const centronics_interface nimbus_centronics_config =
{
- DEVCB_DEVICE_LINE(VIA_TAG,nimbus_ack_w),
+ DEVCB_DRIVER_LINE_MEMBER(rmnimbus_state, nimbus_ack_w),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index 752e25a4af7..d3c95e80a18 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -265,27 +265,27 @@ READ8_MEMBER(samcoupe_state::samcoupe_attributes_r)
return m_attribute;
}
-static READ8_DEVICE_HANDLER( samcoupe_lpt1_busy_r )
+READ8_MEMBER(samcoupe_state::samcoupe_lpt1_busy_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("lpt1");
+ centronics_device *centronics = machine().device<centronics_device>("lpt1");
return centronics->busy_r();
}
-static WRITE8_DEVICE_HANDLER( samcoupe_lpt1_strobe_w )
+WRITE8_MEMBER(samcoupe_state::samcoupe_lpt1_strobe_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>("lpt1");
+ centronics_device *centronics = machine().device<centronics_device>("lpt1");
centronics->strobe_w(data);
}
-static READ8_DEVICE_HANDLER( samcoupe_lpt2_busy_r )
+READ8_MEMBER(samcoupe_state::samcoupe_lpt2_busy_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("lpt2");
+ centronics_device *centronics = machine().device<centronics_device>("lpt2");
return centronics->busy_r();
}
-static WRITE8_DEVICE_HANDLER( samcoupe_lpt2_strobe_w )
+WRITE8_MEMBER(samcoupe_state::samcoupe_lpt2_strobe_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>("lpt2");
+ centronics_device *centronics = machine().device<centronics_device>("lpt2");
centronics->strobe_w(data);
}
@@ -305,9 +305,9 @@ static ADDRESS_MAP_START( samcoupe_io, AS_IO, 8, samcoupe_state )
AM_RANGE(0x0080, 0x0081) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_WRITE(samcoupe_ext_mem_w)
AM_RANGE(0x00e0, 0x00e7) AM_MIRROR(0xff10) AM_MASK(0xffff) AM_READWRITE(samcoupe_disk_r, samcoupe_disk_w)
AM_RANGE(0x00e8, 0x00e8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt1", centronics_device, write)
- AM_RANGE(0x00e9, 0x00e9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVREADWRITE_LEGACY("lpt1", samcoupe_lpt1_busy_r, samcoupe_lpt1_strobe_w)
+ AM_RANGE(0x00e9, 0x00e9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lpt1_busy_r, samcoupe_lpt1_strobe_w)
AM_RANGE(0x00ea, 0x00ea) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVWRITE("lpt2", centronics_device, write)
- AM_RANGE(0x00eb, 0x00eb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_DEVREADWRITE_LEGACY("lpt2", samcoupe_lpt2_busy_r, samcoupe_lpt2_strobe_w)
+ AM_RANGE(0x00eb, 0x00eb) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lpt2_busy_r, samcoupe_lpt2_strobe_w)
AM_RANGE(0x00f8, 0x00f8) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_pen_r, samcoupe_clut_w)
AM_RANGE(0x00f9, 0x00f9) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_status_r, samcoupe_line_int_w)
AM_RANGE(0x00fa, 0x00fa) AM_MIRROR(0xff00) AM_MASK(0xffff) AM_READWRITE(samcoupe_lmpr_r, samcoupe_lmpr_w)
diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c
index 1a0ccdffacf..30be7887b5d 100644
--- a/src/mess/drivers/sg1000.c
+++ b/src/mess/drivers/sg1000.c
@@ -517,16 +517,16 @@ INPUT_PORTS_END
TMS9928a_interface tms9928a_interface
-------------------------------------------------*/
-static WRITE_LINE_DEVICE_HANDLER(sg1000_vdp_interrupt)
+WRITE_LINE_MEMBER(sg1000_state::sg1000_vdp_interrupt)
{
- device->machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, state);
+ machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, state);
}
static TMS9928A_INTERFACE(sg1000_tms9918a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(sg1000_vdp_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(sg1000_state,sg1000_vdp_interrupt)
};
/*-------------------------------------------------
@@ -984,11 +984,9 @@ LEGACY_FLOPPY_OPTIONS_END
sf7000_fdc_index_callback -
-------------------------------------------------*/
-static WRITE_LINE_DEVICE_HANDLER(sf7000_fdc_index_callback)
+WRITE_LINE_MEMBER(sf7000_state::sf7000_fdc_index_callback)
{
- sf7000_state *driver_state = device->machine().driver_data<sf7000_state>();
-
- driver_state->m_fdc_index = state;
+ m_fdc_index = state;
}
/*-------------------------------------------------
@@ -997,7 +995,7 @@ static WRITE_LINE_DEVICE_HANDLER(sf7000_fdc_index_callback)
static const floppy_interface sf7000_floppy_interface =
{
- DEVCB_LINE(sf7000_fdc_index_callback),
+ DEVCB_DRIVER_LINE_MEMBER(sf7000_state,sf7000_fdc_index_callback),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/sms.c b/src/mess/drivers/sms.c
index 9d2aad4b491..0e6e023349e 100644
--- a/src/mess/drivers/sms.c
+++ b/src/mess/drivers/sms.c
@@ -306,33 +306,33 @@ static INPUT_PORTS_START( gg )
INPUT_PORTS_END
-static WRITE_LINE_DEVICE_HANDLER( sms_int_callback )
+WRITE_LINE_MEMBER(sms_state::sms_int_callback)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state);
+ machine().device("maincpu")->execute().set_input_line(0, state);
}
static const sega315_5124_interface _315_5124_ntsc_intf =
{
false,
"screen",
- DEVCB_LINE(sms_int_callback),
- DEVCB_LINE(sms_pause_callback)
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_int_callback),
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback)
};
static const sega315_5124_interface _315_5124_pal_intf =
{
true,
"screen",
- DEVCB_LINE(sms_int_callback),
- DEVCB_LINE(sms_pause_callback)
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_int_callback),
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback)
};
static const sega315_5124_interface sms_store_intf =
{
false,
"screen",
- DEVCB_LINE(sms_store_int_callback),
- DEVCB_LINE(sms_pause_callback)
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_store_int_callback),
+ DEVCB_DRIVER_LINE_MEMBER(sms_state,sms_pause_callback)
};
diff --git a/src/mess/drivers/ssystem3.c b/src/mess/drivers/ssystem3.c
index b51589b8c75..06c9a3a408c 100644
--- a/src/mess/drivers/ssystem3.c
+++ b/src/mess/drivers/ssystem3.c
@@ -117,51 +117,49 @@ static void ssystem3_playfield_read(running_machine &machine, int *on, int *read
*ready=FALSE;
}
-static WRITE8_DEVICE_HANDLER(ssystem3_via_write_a)
+WRITE8_MEMBER(ssystem3_state::ssystem3_via_write_a)
{
- ssystem3_state *state = space.machine().driver_data<ssystem3_state>();
- state->m_porta=data;
+ m_porta=data;
// logerror("%.4x via port a write %02x\n",(int)activecpu_get_pc(), data);
}
-static READ8_DEVICE_HANDLER(ssystem3_via_read_a)
+READ8_MEMBER(ssystem3_state::ssystem3_via_read_a)
{
- ssystem3_state *state = space.machine().driver_data<ssystem3_state>();
UINT8 data=0xff;
#if 1 // time switch
- if (!(state->m_porta&0x10)) data&=space.machine().root_device().ioport("matrix1")->read()|0xf1;
- if (!(state->m_porta&0x20)) data&=space.machine().root_device().ioport("matrix2")->read()|0xf1;
- if (!(state->m_porta&0x40)) data&=space.machine().root_device().ioport("matrix3")->read()|0xf1;
- if (!(state->m_porta&0x80)) data&=space.machine().root_device().ioport("matrix4")->read()|0xf1;
+ if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf1;
+ if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf1;
+ if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf1;
+ if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf1;
#else
- if (!(state->m_porta&0x10)) data&=space.machine().root_device().ioport("matrix1")->read()|0xf0;
- if (!(state->m_porta&0x20)) data&=space.machine().root_device().ioport("matrix2")->read()|0xf0;
- if (!(state->m_porta&0x40)) data&=space.machine().root_device().ioport("matrix3")->read()|0xf0;
- if (!(state->m_porta&0x80)) data&=space.machine().root_device().ioport("matrix4")->read()|0xf0;
+ if (!(m_porta&0x10)) data&=machine().root_device().ioport("matrix1")->read()|0xf0;
+ if (!(m_porta&0x20)) data&=machine().root_device().ioport("matrix2")->read()|0xf0;
+ if (!(m_porta&0x40)) data&=machine().root_device().ioport("matrix3")->read()|0xf0;
+ if (!(m_porta&0x80)) data&=machine().root_device().ioport("matrix4")->read()|0xf0;
#endif
- if (!(state->m_porta&1)) {
- if (!(space.machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
- if (!(space.machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
- if (!(space.machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
- if (!(state->ioport("matrix4")->read()&1)) data&=~0x80;
+ if (!(m_porta&1)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
+ if (!(ioport("matrix4")->read()&1)) data&=~0x80;
}
- if (!(state->m_porta&2)) {
- if (!(space.machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
- if (!(space.machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
- if (!(space.machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
- if (!(space.machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
+ if (!(m_porta&2)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
}
- if (!(state->m_porta&4)) {
- if (!(space.machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
- if (!(space.machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
- if (!(space.machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
- if (!(space.machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
+ if (!(m_porta&4)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
}
- if (!(state->m_porta&8)) {
- if (!(space.machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
- if (!(space.machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
- if (!(space.machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
- if (!(space.machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
+ if (!(m_porta&8)) {
+ if (!(machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
+ if (!(machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
+ if (!(machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
+ if (!(machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
}
// logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data);
return data;
@@ -189,25 +187,25 @@ static READ8_DEVICE_HANDLER(ssystem3_via_read_a)
bit 5: input low x/$37 4 (else 1)
*/
-static READ8_DEVICE_HANDLER(ssystem3_via_read_b)
+READ8_MEMBER(ssystem3_state::ssystem3_via_read_b)
{
UINT8 data=0xff;
int on, ready;
- ssystem3_playfield_read(space.machine(), &on, &ready);
+ ssystem3_playfield_read(machine(), &on, &ready);
if (!on) data&=~0x20;
if (!ready) data&=~0x10;
return data;
}
-static WRITE8_DEVICE_HANDLER(ssystem3_via_write_b)
+WRITE8_MEMBER(ssystem3_state::ssystem3_via_write_b)
{
- via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
UINT8 d;
- ssystem3_playfield_write(space.machine(), data&1, data&8);
- ssystem3_lcd_write(space.machine(), data&4, data&2);
+ ssystem3_playfield_write(machine(), data&1, data&8);
+ ssystem3_lcd_write(machine(), data&4, data&2);
- d=ssystem3_via_read_b(via_0, space, 0, mem_mask)&~0x40;
+ d=ssystem3_via_read_b(space, 0, mem_mask)&~0x40;
if (data&0x80) d|=0x40;
// d&=~0x8f;
via_0->write_portb(space,0, d );
@@ -215,14 +213,14 @@ static WRITE8_DEVICE_HANDLER(ssystem3_via_write_b)
static const via6522_interface ssystem3_via_config=
{
- DEVCB_HANDLER(ssystem3_via_read_a),//read8_machine_func in_a_func;
- DEVCB_HANDLER(ssystem3_via_read_b),//read8_machine_func in_b_func;
+ DEVCB_DRIVER_MEMBER(ssystem3_state,ssystem3_via_read_a),//read8_machine_func in_a_func;
+ DEVCB_DRIVER_MEMBER(ssystem3_state,ssystem3_via_read_b),//read8_machine_func in_b_func;
DEVCB_NULL,//read8_machine_func in_ca1_func;
DEVCB_NULL,//read8_machine_func in_cb1_func;
DEVCB_NULL,//read8_machine_func in_ca2_func;
DEVCB_NULL,//read8_machine_func in_cb2_func;
- DEVCB_HANDLER(ssystem3_via_write_a),//write8_machine_func out_a_func;
- DEVCB_HANDLER(ssystem3_via_write_b),//write8_machine_func out_b_func;
+ DEVCB_DRIVER_MEMBER(ssystem3_state,ssystem3_via_write_a),//write8_machine_func out_a_func;
+ DEVCB_DRIVER_MEMBER(ssystem3_state,ssystem3_via_write_b),//write8_machine_func out_b_func;
DEVCB_NULL,//write8_machine_func out_ca2_func;
DEVCB_NULL,//write8_machine_func out_cb2_func;
DEVCB_NULL,//void (*irq_func)(int state);
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index b23c591590c..eb2abf3f405 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -509,14 +509,14 @@ static const z80_daisy_config super6_daisy_chain[] =
// GENERIC_TERMINAL_INTERFACE( terminal_intf )
//-------------------------------------------------
-static WRITE8_DEVICE_HANDLER( dummy_w )
+WRITE8_MEMBER(super6_state::dummy_w)
{
// handled in Z80DART_INTERFACE
}
static GENERIC_TERMINAL_INTERFACE( terminal_intf )
{
- DEVCB_HANDLER(dummy_w)
+ DEVCB_DRIVER_MEMBER(super6_state,dummy_w)
};
diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c
index c526e8eb474..881e9a8bc68 100644
--- a/src/mess/drivers/svi318.c
+++ b/src/mess/drivers/svi318.c
@@ -260,16 +260,16 @@ static const ay8910_interface svi318_ay8910_interface =
DEVCB_DRIVER_MEMBER(svi318_state, svi318_psg_port_b_w)
};
-static WRITE_LINE_DEVICE_HANDLER(vdp_interrupt)
+WRITE_LINE_MEMBER(svi318_state::vdp_interrupt)
{
- device->machine().device("maincpu")->execute().set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE));
+ machine().device("maincpu")->execute().set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE));
}
static TMS9928A_INTERFACE(svi318_tms9928a_interface)
{
"screen",
0x4000,
- DEVCB_LINE(vdp_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(svi318_state,vdp_interrupt)
};
static const cassette_interface svi318_cassette_interface =
diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c
index b8d4245e732..7fdde5e0b7a 100644
--- a/src/mess/drivers/tandy2k.c
+++ b/src/mess/drivers/tandy2k.c
@@ -195,16 +195,18 @@ WRITE16_MEMBER( tandy2k_state::vpac_w )
}
}
-static READ8_DEVICE_HANDLER( fldtc_r )
+READ8_MEMBER(tandy2k_state::fldtc_r)
{
+ device_t *device = machine().device("AM_RANGE(0x00004, 0x00005) AM_READWRITE8(I8272A_TAG, fldtc_r, fldtc_w, 0x00ff)");
upd765_tc_w(device, 1);
upd765_tc_w(device, 0);
return 0;
}
-static WRITE8_DEVICE_HANDLER( fldtc_w )
+WRITE8_MEMBER(tandy2k_state::fldtc_w)
{
+ device_t *device = machine().device(I8272A_TAG);
upd765_tc_w(device, 1);
upd765_tc_w(device, 0);
}
@@ -269,7 +271,7 @@ static ADDRESS_MAP_START( tandy2k_io, AS_IO, 16, tandy2k_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000, 0x00001) AM_READWRITE8(enable_r, enable_w, 0x00ff)
AM_RANGE(0x00002, 0x00003) AM_WRITE8(dma_mux_w, 0x00ff)
- AM_RANGE(0x00004, 0x00005) AM_DEVREADWRITE8_LEGACY(I8272A_TAG, fldtc_r, fldtc_w, 0x00ff)
+ AM_RANGE(0x00004, 0x00005) AM_READWRITE8(fldtc_r, fldtc_w, 0x00ff)
AM_RANGE(0x00010, 0x00013) AM_DEVREADWRITE8(I8251A_TAG, i8251_device, data_r, data_w, 0x00ff)
AM_RANGE(0x00030, 0x00031) AM_DEVREAD8_LEGACY(I8272A_TAG, upd765_status_r, 0x00ff)
AM_RANGE(0x00032, 0x00033) AM_DEVREADWRITE8_LEGACY(I8272A_TAG, upd765_data_r, upd765_data_w, 0x00ff)
diff --git a/src/mess/drivers/tsispch.c b/src/mess/drivers/tsispch.c
index 8510638c00e..99236431beb 100644
--- a/src/mess/drivers/tsispch.c
+++ b/src/mess/drivers/tsispch.c
@@ -127,19 +127,19 @@ static NECDSP_INTERFACE( upd7720_config )
/*****************************************************************************
USART 8251 and Terminal stuff
*****************************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( i8251_rxrdy_int )
+WRITE_LINE_MEMBER(tsispch_state::i8251_rxrdy_int)
{
- pic8259_ir1_w(device->machine().device("pic8259"), state);
+ pic8259_ir1_w(machine().device("pic8259"), state);
}
-static WRITE_LINE_DEVICE_HANDLER( i8251_txempty_int )
+WRITE_LINE_MEMBER(tsispch_state::i8251_txempty_int)
{
- pic8259_ir2_w(device->machine().device("pic8259"), state);
+ pic8259_ir2_w(machine().device("pic8259"), state);
}
-static WRITE_LINE_DEVICE_HANDLER( i8251_txrdy_int )
+WRITE_LINE_MEMBER(tsispch_state::i8251_txrdy_int)
{
- pic8259_ir3_w(device->machine().device("pic8259"), state);
+ pic8259_ir3_w(machine().device("pic8259"), state);
}
const i8251_interface i8251_config =
@@ -149,9 +149,9 @@ const i8251_interface i8251_config =
DEVCB_NULL, // in dsr
DEVCB_NULL, // out dtr
DEVCB_NULL, // out rts
- DEVCB_LINE(i8251_rxrdy_int), // out rxrdy
- DEVCB_LINE(i8251_txrdy_int), // out txrdy
- DEVCB_LINE(i8251_txempty_int), // out txempty
+ DEVCB_DRIVER_LINE_MEMBER(tsispch_state,i8251_rxrdy_int), // out rxrdy
+ DEVCB_DRIVER_LINE_MEMBER(tsispch_state,i8251_txrdy_int), // out txrdy
+ DEVCB_DRIVER_LINE_MEMBER(tsispch_state,i8251_txempty_int), // out txempty
DEVCB_NULL // out syndet
};
@@ -168,14 +168,14 @@ static GENERIC_TERMINAL_INTERFACE( tsispch_terminal_intf )
/*****************************************************************************
PIC 8259 stuff
*****************************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( pic8259_set_int_line )
+WRITE_LINE_MEMBER(tsispch_state::pic8259_set_int_line)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface pic8259_config =
{
- DEVCB_LINE(pic8259_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(tsispch_state,pic8259_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c
index c9e3f10019b..42fc836f082 100644
--- a/src/mess/drivers/v1050.c
+++ b/src/mess/drivers/v1050.c
@@ -594,17 +594,17 @@ INPUT_PORTS_END
// 8214 Interface
-static WRITE_LINE_DEVICE_HANDLER( pic_int_w )
+WRITE_LINE_MEMBER(v1050_state::pic_int_w)
{
if (state == ASSERT_LINE)
{
- device->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
+ execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
}
}
static I8214_INTERFACE( pic_intf )
{
- DEVCB_DEVICE_LINE(Z80_TAG, pic_int_w),
+ DEVCB_DRIVER_LINE_MEMBER(v1050_state,pic_int_w),
DEVCB_NULL
};
@@ -617,8 +617,9 @@ static MSM58321_INTERFACE( rtc_intf )
// Display 8255A Interface
-static WRITE8_DEVICE_HANDLER( disp_ppi_pc_w )
+WRITE8_MEMBER(v1050_state::disp_ppi_pc_w)
{
+ device_t *device = machine().device(I8255A_M6502_TAG);
i8255_device *ppi = static_cast<i8255_device*>(device);
ppi->pc2_w(BIT(data, 6));
@@ -632,11 +633,12 @@ static I8255A_INTERFACE( disp_ppi_intf )
DEVCB_NULL, // Port B read
DEVCB_NULL, // Port B write
DEVCB_NULL, // Port C read
- DEVCB_DEVICE_HANDLER(I8255A_M6502_TAG, disp_ppi_pc_w) // Port C write
+ DEVCB_DRIVER_MEMBER(v1050_state,disp_ppi_pc_w) // Port C write
};
-static WRITE8_DEVICE_HANDLER( m6502_ppi_pc_w )
+WRITE8_MEMBER(v1050_state::m6502_ppi_pc_w)
{
+ device_t *device = machine().device(I8255A_DISP_TAG);
i8255_device *ppi = static_cast<i8255_device*>(device);
ppi->pc2_w(BIT(data, 7));
@@ -650,7 +652,7 @@ static I8255A_INTERFACE( m6502_ppi_intf )
DEVCB_NULL, // Port B read
DEVCB_NULL, // Port B write
DEVCB_NULL, // Port C read
- DEVCB_DEVICE_HANDLER(I8255A_DISP_TAG, m6502_ppi_pc_w) // Port C write
+ DEVCB_DRIVER_MEMBER(v1050_state,m6502_ppi_pc_w) // Port C write
};
// Miscellanous 8255A Interface
@@ -693,13 +695,13 @@ WRITE8_MEMBER( v1050_state::misc_ppi_pa_w )
wd17xx_dden_w(m_fdc, BIT(data, 7));
}
-static WRITE8_DEVICE_HANDLER( misc_ppi_pb_w )
+WRITE8_MEMBER(v1050_state::misc_ppi_pb_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
- centronics->write( space.machine().driver_data()->generic_space() , 0, ~data & 0xff);
+ centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics->write( machine().driver_data()->generic_space() , 0, ~data & 0xff);
}
-static READ8_DEVICE_HANDLER( misc_ppi_pc_r )
+READ8_MEMBER(v1050_state::misc_ppi_pc_r)
{
/*
@@ -717,7 +719,7 @@ static READ8_DEVICE_HANDLER( misc_ppi_pc_r )
*/
UINT8 data = 0;
- centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
data |= centronics->not_busy_r() << 4;
data |= centronics->pe_r() << 5;
@@ -779,8 +781,8 @@ static I8255A_INTERFACE( misc_ppi_intf )
DEVCB_NULL, // Port A read
DEVCB_DRIVER_MEMBER(v1050_state, misc_ppi_pa_w), // Port A write
DEVCB_NULL, // Port B read
- DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, misc_ppi_pb_w), // Port B write
- DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, misc_ppi_pc_r), // Port C read
+ DEVCB_DRIVER_MEMBER(v1050_state,misc_ppi_pb_w), // Port B write
+ DEVCB_DRIVER_MEMBER(v1050_state,misc_ppi_pc_r), // Port C read
DEVCB_DRIVER_MEMBER(v1050_state, misc_ppi_pc_w) // Port C write
};
diff --git a/src/mess/drivers/victor9k.c b/src/mess/drivers/victor9k.c
index 6752bc59cbb..55854a18f08 100644
--- a/src/mess/drivers/victor9k.c
+++ b/src/mess/drivers/victor9k.c
@@ -123,11 +123,11 @@ static const mc6845_interface hd46505s_intf =
// Intel 8253 Interface
-static WRITE_LINE_DEVICE_HANDLER( mux_serial_b_w )
+WRITE_LINE_MEMBER(victor9k_state::mux_serial_b_w)
{
}
-static WRITE_LINE_DEVICE_HANDLER( mux_serial_a_w )
+WRITE_LINE_MEMBER(victor9k_state::mux_serial_a_w)
{
}
@@ -137,11 +137,11 @@ static const struct pit8253_config pit_intf =
{
2500000,
DEVCB_LINE_VCC,
- DEVCB_LINE(mux_serial_b_w)
+ DEVCB_DRIVER_LINE_MEMBER(victor9k_state,mux_serial_b_w)
}, {
2500000,
DEVCB_LINE_VCC,
- DEVCB_LINE(mux_serial_a_w)
+ DEVCB_DRIVER_LINE_MEMBER(victor9k_state,mux_serial_a_w)
}, {
100000,
DEVCB_LINE_VCC,
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index b77f9e39cad..fbf23a89665 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -1058,16 +1058,16 @@ static const wd17xx_interface x1_mb8877a_interface =
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
-static WRITE_LINE_DEVICE_HANDLER( fdc_drq_w )
+WRITE_LINE_MEMBER(x1_state::fdc_drq_w)
{
- z80dma_rdy_w(device->machine().device("dma"), state ^ 1);
+ z80dma_rdy_w(machine().device("dma"), state ^ 1);
}
static const wd17xx_interface x1turbo_mb8877a_interface =
{
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("fdc", fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(x1_state,fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index 2039b5bba60..1264e153f25 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -856,56 +856,53 @@ static UINT8 xpd1lr_r(device_t* device, int port)
}
// Judging from the XM6 source code, PPI ports A and B are joystick inputs
-static READ8_DEVICE_HANDLER( ppi_port_a_r )
+READ8_MEMBER(x68k_state::ppi_port_a_r)
{
- x68k_state *state = space.machine().driver_data<x68k_state>();
- int ctrl = space.machine().root_device().ioport("ctrltype")->read() & 0x0f;
+ int ctrl = machine().root_device().ioport("ctrltype")->read() & 0x0f;
switch(ctrl)
{
case 0x00: // standard MSX/FM-Towns joystick
- if(state->m_joy.joy1_enable == 0)
- return state->ioport("joy1")->read();
+ if(m_joy.joy1_enable == 0)
+ return ioport("joy1")->read();
else
return 0xff;
case 0x01: // 3-button Megadrive gamepad
- return md_3button_r(device,1);
+ return md_3button_r(machine().device("ppi8255"),1);
case 0x02: // 6-button Megadrive gamepad
- return md_6button_r(device,1);
+ return md_6button_r(machine().device("ppi8255"),1);
case 0x03: // XPD-1LR
- return xpd1lr_r(device,1);
+ return xpd1lr_r(machine().device("ppi8255"),1);
}
return 0xff;
}
-static READ8_DEVICE_HANDLER( ppi_port_b_r )
+READ8_MEMBER(x68k_state::ppi_port_b_r)
{
- x68k_state *state = space.machine().driver_data<x68k_state>();
- int ctrl = space.machine().root_device().ioport("ctrltype")->read() & 0xf0;
+ int ctrl = machine().root_device().ioport("ctrltype")->read() & 0xf0;
switch(ctrl)
{
case 0x00: // standard MSX/FM-Towns joystick
- if(state->m_joy.joy2_enable == 0)
- return state->ioport("joy2")->read();
+ if(m_joy.joy2_enable == 0)
+ return ioport("joy2")->read();
else
return 0xff;
case 0x10: // 3-button Megadrive gamepad
- return md_3button_r(device,2);
+ return md_3button_r(machine().device("ppi8255"),2);
case 0x20: // 6-button Megadrive gamepad
- return md_6button_r(device,2);
+ return md_6button_r(machine().device("ppi8255"),2);
case 0x30: // XPD-1LR
- return xpd1lr_r(device,2);
+ return xpd1lr_r(machine().device("ppi8255"),2);
}
return 0xff;
}
-static READ8_DEVICE_HANDLER( ppi_port_c_r )
+READ8_MEMBER(x68k_state::ppi_port_c_r)
{
- x68k_state *state = space.machine().driver_data<x68k_state>();
- return state->m_ppi_port[2];
+ return m_ppi_port[2];
}
/* PPI port C (Joystick control, R/W)
@@ -916,41 +913,40 @@ static READ8_DEVICE_HANDLER( ppi_port_c_r )
bits 3,2 - ADPCM Sample rate
bits 1,0 - ADPCM Pan
*/
-static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
+WRITE8_MEMBER(x68k_state::ppi_port_c_w)
{
- x68k_state *state = space.machine().driver_data<x68k_state>();
// ADPCM / Joystick control
- device_t *oki = space.machine().device("okim6258");
+ device_t *oki = machine().device("okim6258");
- state->m_ppi_port[2] = data;
- if((data & 0x0f) != (state->m_ppi_prev & 0x0f))
+ m_ppi_port[2] = data;
+ if((data & 0x0f) != (m_ppi_prev & 0x0f))
{
- state->m_adpcm.pan = data & 0x03;
- state->m_adpcm.rate = data & 0x0c;
- x68k_set_adpcm(space.machine());
+ m_adpcm.pan = data & 0x03;
+ m_adpcm.rate = data & 0x0c;
+ x68k_set_adpcm(machine());
okim6258_set_divider(oki, (data >> 2) & 3);
}
// The joystick enable bits also handle the multiplexer for various controllers
- state->m_joy.joy1_enable = data & 0x10;
- state->m_mdctrl.mux1 = data & 0x10;
- if((state->m_ppi_prev & 0x10) == 0x00 && (data & 0x10) == 0x10)
+ m_joy.joy1_enable = data & 0x10;
+ m_mdctrl.mux1 = data & 0x10;
+ if((m_ppi_prev & 0x10) == 0x00 && (data & 0x10) == 0x10)
{
- state->m_mdctrl.seq1++;
- state->m_mdctrl.io_timeout1->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ m_mdctrl.seq1++;
+ m_mdctrl.io_timeout1->adjust(machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
- state->m_joy.joy2_enable = data & 0x20;
- state->m_mdctrl.mux2 = data & 0x20;
- if((state->m_ppi_prev & 0x20) == 0x00 && (data & 0x20) == 0x20)
+ m_joy.joy2_enable = data & 0x20;
+ m_mdctrl.mux2 = data & 0x20;
+ if((m_ppi_prev & 0x20) == 0x00 && (data & 0x20) == 0x20)
{
- state->m_mdctrl.seq2++;
- state->m_mdctrl.io_timeout2->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ m_mdctrl.seq2++;
+ m_mdctrl.io_timeout2->adjust(machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
- state->m_ppi_prev = data;
+ m_ppi_prev = data;
- state->m_joy.ioc6 = data & 0x40;
- state->m_joy.ioc7 = data & 0x80;
+ m_joy.ioc6 = data & 0x40;
+ m_joy.ioc7 = data & 0x80;
}
@@ -1073,16 +1069,15 @@ static READ16_HANDLER( x68k_fdc_r )
}
}
-static WRITE_LINE_DEVICE_HANDLER( fdc_irq )
+WRITE_LINE_MEMBER(x68k_state::fdc_irq)
{
- x68k_state *drvstate = device->machine().driver_data<x68k_state>();
- if((drvstate->m_ioc.irqstatus & 0x04) && state == ASSERT_LINE)
+ if((m_ioc.irqstatus & 0x04) && state == ASSERT_LINE)
{
- drvstate->m_current_vector[1] = drvstate->m_ioc.fdcvector;
- drvstate->m_ioc.irqstatus |= 0x80;
- drvstate->m_current_irq_line = 1;
+ m_current_vector[1] = m_ioc.fdcvector;
+ m_ioc.irqstatus |= 0x80;
+ m_current_irq_line = 1;
logerror("FDC: IRQ triggered\n");
- device->machine().device("maincpu")->execute().set_input_line_and_vector(1, ASSERT_LINE, drvstate->m_current_vector[1]);
+ machine().device("maincpu")->execute().set_input_line_and_vector(1, ASSERT_LINE, m_current_vector[1]);
}
}
@@ -1104,10 +1099,9 @@ static void x68k_fdc_write_byte(running_machine &machine,int addr, int data)
upd765_dack_w(fdc, machine.driver_data()->generic_space(), 0, data);
}
-static WRITE_LINE_DEVICE_HANDLER ( fdc_drq )
+WRITE_LINE_MEMBER(x68k_state::fdc_drq)
{
- x68k_state *drvstate = device->machine().driver_data<x68k_state>();
- drvstate->m_fdc.drq_state = state;
+ m_fdc.drq_state = state;
}
static WRITE16_HANDLER( x68k_fm_w )
@@ -1129,18 +1123,17 @@ static READ16_HANDLER( x68k_fm_r )
return 0xffff;
}
-static WRITE8_DEVICE_HANDLER( x68k_ct_w )
+WRITE8_MEMBER(x68k_state::x68k_ct_w)
{
- x68k_state *state = space.machine().driver_data<x68k_state>();
- device_t *fdc = space.machine().device("upd72065");
- device_t *okim = space.machine().device("okim6258");
+ device_t *fdc = machine().device("upd72065");
+ device_t *okim = machine().device("okim6258");
// CT1 and CT2 bits from YM2151 port 0x1b
// CT1 - ADPCM clock - 0 = 8MHz, 1 = 4MHz
// CT2 - 1 = Set ready state of FDC
upd765_ready_w(fdc,data & 0x01);
- state->m_adpcm.clock = data & 0x02;
- x68k_set_adpcm(space.machine());
+ m_adpcm.clock = data & 0x02;
+ x68k_set_adpcm(machine());
okim6258_set_clock(okim, data & 0x02 ? 4000000 : 8000000);
}
@@ -1503,16 +1496,14 @@ static WRITE16_HANDLER( x68k_rtc_w )
state->m_rtc->write(space, offset, data);
}
-static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
+WRITE_LINE_MEMBER(x68k_state::x68k_rtc_alarm_irq)
{
- x68k_state *drvstate = device->machine().driver_data<x68k_state>();
-
- if(drvstate->m_mfp.aer & 0x01)
+ if(m_mfp.aer & 0x01)
{
if(state == 1)
{
- drvstate->m_mfp.gpio |= 0x01;
- drvstate->m_mfpdev->i0_w(1);
+ m_mfp.gpio |= 0x01;
+ m_mfpdev->i0_w(1);
//mfp_trigger_irq(MFP_IRQ_GPIP0); // RTC ALARM
}
}
@@ -1520,8 +1511,8 @@ static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
{
if(state == 0)
{
- drvstate->m_mfp.gpio &= ~0x01;
- drvstate->m_mfpdev->i0_w(0);
+ m_mfp.gpio &= ~0x01;
+ m_mfpdev->i0_w(0);
//mfp_trigger_irq(MFP_IRQ_GPIP0); // RTC ALARM
}
}
@@ -1858,8 +1849,9 @@ READ8_MEMBER( x68k_state::mfp_gpio_r )
return data;
}
-static WRITE8_DEVICE_HANDLER( x68030_adpcm_w )
+WRITE8_MEMBER(x68k_state::x68030_adpcm_w)
{
+ device_t *device = machine().device("okim6258");
switch(offset)
{
case 0x00:
@@ -1871,18 +1863,17 @@ static WRITE8_DEVICE_HANDLER( x68030_adpcm_w )
}
}
-static WRITE_LINE_DEVICE_HANDLER( mfp_irq_callback )
+WRITE_LINE_MEMBER(x68k_state::mfp_irq_callback)
{
- x68k_state *drvstate = device->machine().driver_data<x68k_state>();
- if(drvstate->m_mfp_prev == CLEAR_LINE && state == CLEAR_LINE) // eliminate unnecessary calls to set the IRQ line for speed reasons
+ if(m_mfp_prev == CLEAR_LINE && state == CLEAR_LINE) // eliminate unnecessary calls to set the IRQ line for speed reasons
return;
if(state != CLEAR_LINE)
state = HOLD_LINE; // to get around erroneous spurious interrupt
-// if((state->m_ioc.irqstatus & 0xc0) != 0) // if the FDC is busy, then we don't want to miss that IRQ
+// if((m_ioc.irqstatus & 0xc0) != 0) // if the FDC is busy, then we don't want to miss that IRQ
// return;
- device->machine().device("maincpu")->execute().set_input_line(6, state);
- drvstate->m_current_vector[6] = 0;
- drvstate->m_mfp_prev = state;
+ machine().device("maincpu")->execute().set_input_line(6, state);
+ m_current_vector[6] = 0;
+ m_mfp_prev = state;
}
INTERRUPT_GEN_MEMBER(x68k_state::x68k_vsync_irq)
@@ -1933,19 +1924,18 @@ static IRQ_CALLBACK(x68k_int_ack)
return state->m_current_vector[irqline];
}
-static WRITE_LINE_DEVICE_HANDLER( x68k_scsi_irq )
+WRITE_LINE_MEMBER(x68k_state::x68k_scsi_irq)
{
- x68k_state *tstate = device->machine().driver_data<x68k_state>();
// TODO : Internal SCSI IRQ vector 0x6c, External SCSI IRQ vector 0xf6, IRQs go through the IOSC (IRQ line 1)
if(state != 0)
{
- tstate->m_current_vector[1] = 0x6c;
- tstate->m_current_irq_line = 1;
- device->machine().device("maincpu")->execute().set_input_line_and_vector(1,ASSERT_LINE,tstate->m_current_vector[1]);
+ m_current_vector[1] = 0x6c;
+ m_current_irq_line = 1;
+ machine().device("maincpu")->execute().set_input_line_and_vector(1,ASSERT_LINE,m_current_vector[1]);
}
}
-static WRITE_LINE_DEVICE_HANDLER( x68k_scsi_drq )
+WRITE_LINE_MEMBER(x68k_state::x68k_scsi_drq)
{
// TODO
}
@@ -2042,7 +2032,7 @@ static ADDRESS_MAP_START(x68030_map, AS_PROGRAM, 32, x68k_state )
// AM_RANGE(0xe8c000, 0xe8dfff) AM_READWRITE_LEGACY(x68k_printer_r, x68k_printer_w)
AM_RANGE(0xe8e000, 0xe8ffff) AM_READWRITE16_LEGACY(x68k_sysport_r, x68k_sysport_w,0xffffffff)
AM_RANGE(0xe90000, 0xe91fff) AM_READWRITE16_LEGACY(x68k_fm_r, x68k_fm_w,0xffffffff)
- AM_RANGE(0xe92000, 0xe92003) AM_DEVREADWRITE8_LEGACY("okim6258", okim6258_status_r, x68030_adpcm_w, 0x00ff00ff)
+ AM_RANGE(0xe92000, 0xe92003) AM_DEVREAD8_LEGACY("okim6258", okim6258_status_r, 0x00ff00ff) AM_WRITE8(x68030_adpcm_w, 0x00ff00ff)
AM_RANGE(0xe94000, 0xe95fff) AM_READWRITE16_LEGACY(x68k_fdc_r, x68k_fdc_w,0xffffffff)
// AM_RANGE(0xe96000, 0xe9601f) AM_DEVREADWRITE16_LEGACY("x68k_hdc",x68k_hdc_r, x68k_hdc_w,0xffffffff)
AM_RANGE(0xe96020, 0xe9603f) AM_DEVREADWRITE8("scsi:mb89352",mb89352_device,mb89352_r,mb89352_w,0x00ff00ff)
@@ -2074,7 +2064,7 @@ static MC68901_INTERFACE( mfp_interface )
4000000, /* timer clock */
0, /* receive clock */
0, /* transmit clock */
- DEVCB_LINE(mfp_irq_callback), /* interrupt */
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,mfp_irq_callback), /* interrupt */
DEVCB_DRIVER_MEMBER(x68k_state, mfp_gpio_r), /* GPIO read */
DEVCB_NULL, /* GPIO write */
DEVCB_NULL, /* TAO */
@@ -2089,12 +2079,12 @@ static MC68901_INTERFACE( mfp_interface )
static I8255A_INTERFACE( ppi_interface )
{
- DEVCB_HANDLER(ppi_port_a_r),
+ DEVCB_DRIVER_MEMBER(x68k_state,ppi_port_a_r),
DEVCB_NULL,
- DEVCB_HANDLER(ppi_port_b_r),
+ DEVCB_DRIVER_MEMBER(x68k_state,ppi_port_b_r),
DEVCB_NULL,
- DEVCB_HANDLER(ppi_port_c_r),
- DEVCB_HANDLER(ppi_port_c_w)
+ DEVCB_DRIVER_MEMBER(x68k_state,ppi_port_c_r),
+ DEVCB_DRIVER_MEMBER(x68k_state,ppi_port_c_w)
};
static const hd63450_intf dmac_interface =
@@ -2112,8 +2102,8 @@ static const hd63450_intf dmac_interface =
static const upd765_interface fdc_interface =
{
- DEVCB_LINE(fdc_irq),
- DEVCB_LINE(fdc_drq),
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,fdc_irq),
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,fdc_drq),
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0,FLOPPY_1,FLOPPY_2,FLOPPY_3}
@@ -2122,7 +2112,7 @@ static const upd765_interface fdc_interface =
static const ym2151_interface x68k_ym2151_interface =
{
DEVCB_LINE(x68k_fm_irq),
- DEVCB_HANDLER(x68k_ct_w) // CT1, CT2 from YM2151 port 0x1b
+ DEVCB_DRIVER_MEMBER(x68k_state,x68k_ct_w) // CT1, CT2 from YM2151 port 0x1b
};
static const okim6258_interface x68k_okim6258_interface =
@@ -2134,7 +2124,7 @@ static const okim6258_interface x68k_okim6258_interface =
static RP5C15_INTERFACE( rtc_intf )
{
- DEVCB_LINE(x68k_rtc_alarm_irq),
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_rtc_alarm_irq),
DEVCB_NULL
};
@@ -2519,8 +2509,8 @@ static const floppy_interface x68k_floppy_interface =
static const mb89352_interface x68k_scsi_intf =
{
- DEVCB_LINE(x68k_scsi_irq),
- DEVCB_LINE(x68k_scsi_drq)
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_scsi_irq),
+ DEVCB_DRIVER_LINE_MEMBER(x68k_state,x68k_scsi_drq)
};
static X68K_EXPANSION_INTERFACE(x68k_exp_intf)
diff --git a/src/mess/drivers/xerox820.c b/src/mess/drivers/xerox820.c
index fc6adda008b..da7befdc460 100644
--- a/src/mess/drivers/xerox820.c
+++ b/src/mess/drivers/xerox820.c
@@ -557,22 +557,25 @@ TIMER_DEVICE_CALLBACK_MEMBER(xerox820_state::ctc_tick)
m_ctc->trg0(0);
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
+WRITE_LINE_MEMBER(xerox820_state::ctc_z0_w)
{
+// device_t *device = machine().device(Z80CTC_TAG);
// z80ctc_trg1_w(device, state);
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
+WRITE_LINE_MEMBER(xerox820_state::ctc_z2_w)
{
+// device_t *device = machine().device(Z80CTC_TAG);
+
// z80ctc_trg3_w(device, state);
}
static Z80CTC_INTERFACE( ctc_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), /* interrupt handler */
- DEVCB_DEVICE_LINE(Z80CTC_TAG, ctc_z0_w), /* ZC/TO0 callback */
+ DEVCB_DRIVER_LINE_MEMBER(xerox820_state,ctc_z0_w), /* ZC/TO0 callback */
DEVCB_DEVICE_LINE_MEMBER(Z80CTC_TAG, z80ctc_device, trg2), /* ZC/TO1 callback */
- DEVCB_DEVICE_LINE(Z80CTC_TAG, ctc_z2_w) /* ZC/TO2 callback */
+ DEVCB_DRIVER_LINE_MEMBER(xerox820_state,ctc_z2_w) /* ZC/TO2 callback */
};
/* Z80 Daisy Chain */
diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c
index 4705b3cf9a9..79692edfcbb 100644
--- a/src/mess/drivers/xor100.c
+++ b/src/mess/drivers/xor100.c
@@ -360,15 +360,17 @@ INPUT_PORTS_END
/* COM5016 Interface */
-static WRITE_LINE_DEVICE_HANDLER( com5016_fr_w )
+WRITE_LINE_MEMBER(xor100_state::com5016_fr_w)
{
+ device_t *device = machine().device(I8251_A_TAG);
i8251_device* uart = dynamic_cast<i8251_device*>(device);
uart->transmit_clock();
uart->receive_clock();
}
-static WRITE_LINE_DEVICE_HANDLER( com5016_ft_w )
+WRITE_LINE_MEMBER(xor100_state::com5016_ft_w)
{
+ device_t *device = machine().device(I8251_B_TAG);
i8251_device* uart = dynamic_cast<i8251_device*>(device);
uart->transmit_clock();
uart->receive_clock();
@@ -377,8 +379,8 @@ static WRITE_LINE_DEVICE_HANDLER( com5016_ft_w )
static COM8116_INTERFACE( com5016_intf )
{
DEVCB_NULL, /* fX/4 output */
- DEVCB_DEVICE_LINE(I8251_A_TAG, com5016_fr_w), /* fR output */
- DEVCB_DEVICE_LINE(I8251_B_TAG, com5016_ft_w), /* fT output */
+ DEVCB_DRIVER_LINE_MEMBER(xor100_state,com5016_fr_w), /* fR output */
+ DEVCB_DRIVER_LINE_MEMBER(xor100_state,com5016_ft_w), /* fT output */
{ 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 }, // WRONG?
{ 101376, 67584, 46080, 37686, 33792, 16896, 8448, 4224, 2816, 2534, 2112, 1408, 1056, 704, 528, 264 }, // WRONG?
};
@@ -415,9 +417,9 @@ static const i8251_interface terminal_8251_intf =
/* Printer 8255A Interface */
-static READ8_DEVICE_HANDLER( i8255_pc_r )
+READ8_MEMBER(xor100_state::i8255_pc_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
/*
bit description
@@ -450,7 +452,7 @@ static I8255A_INTERFACE( printer_8255_intf )
DEVCB_DEVICE_MEMBER(CENTRONICS_TAG, centronics_device, write),
DEVCB_NULL,
DEVCB_DEVICE_LINE_MEMBER(CENTRONICS_TAG, centronics_device, strobe_w),
- DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, i8255_pc_r),
+ DEVCB_DRIVER_MEMBER(xor100_state,i8255_pc_r),
DEVCB_NULL
};
@@ -463,24 +465,24 @@ static const centronics_interface xor100_centronics_intf =
/* Z80-CTC Interface */
-static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
+WRITE_LINE_MEMBER(xor100_state::ctc_z0_w)
{
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z1_w )
+WRITE_LINE_MEMBER(xor100_state::ctc_z1_w)
{
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
+WRITE_LINE_MEMBER(xor100_state::ctc_z2_w)
{
}
static Z80CTC_INTERFACE( ctc_intf )
{
DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0), /* interrupt handler */
- DEVCB_LINE(ctc_z0_w), /* ZC/TO0 callback */
- DEVCB_LINE(ctc_z1_w), /* ZC/TO1 callback */
- DEVCB_LINE(ctc_z2_w) /* ZC/TO2 callback */
+ DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z0_w), /* ZC/TO0 callback */
+ DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z1_w), /* ZC/TO1 callback */
+ DEVCB_DRIVER_LINE_MEMBER(xor100_state,ctc_z2_w) /* ZC/TO2 callback */
};
/* WD1795-02 Interface */
@@ -518,15 +520,15 @@ static const wd17xx_interface fdc_intf =
/* Terminal Interface */
-static WRITE8_DEVICE_HANDLER( xor100_kbd_put )
+WRITE8_MEMBER(xor100_state::xor100_kbd_put)
{
- i8251_device* uart = dynamic_cast<i8251_device*>(device);
+ i8251_device* uart = dynamic_cast<i8251_device*>(machine().device(I8251_B_TAG));
uart->receive_character(data);
}
static GENERIC_TERMINAL_INTERFACE( xor100_terminal_intf )
{
- DEVCB_DEVICE_HANDLER(I8251_B_TAG, xor100_kbd_put)
+ DEVCB_DRIVER_MEMBER(xor100_state,xor100_kbd_put)
};
/* Machine Initialization */
diff --git a/src/mess/drivers/z80ne.c b/src/mess/drivers/z80ne.c
index 4f58a754c43..953b2ebff73 100644
--- a/src/mess/drivers/z80ne.c
+++ b/src/mess/drivers/z80ne.c
@@ -171,7 +171,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( z80netf_io, AS_IO, 8, z80ne_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xd0, 0xd7) AM_DEVREADWRITE_LEGACY("wd1771", lx390_fdc_r, lx390_fdc_w)
+ AM_RANGE(0xd0, 0xd7) AM_READWRITE(lx390_fdc_r, lx390_fdc_w)
AM_RANGE(0xea, 0xea) AM_READ(lx388_data_r )
AM_RANGE(0xeb, 0xeb) AM_READ(lx388_read_field_sync )
AM_RANGE(0xee, 0xee) AM_READWRITE(lx385_data_r, lx385_data_w )
@@ -455,7 +455,7 @@ static const floppy_interface z80netf_floppy_interface =
static const mc6847_interface z80net_mc6847_intf =
{
"lx388",
- DEVCB_HANDLER(lx388_mc6847_videoram_r),
+ DEVCB_DRIVER_MEMBER(z80ne_state, lx388_mc6847_videoram_r),
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/includes/a7800.h b/src/mess/includes/a7800.h
index 43847f97e20..c5c854d9ddc 100644
--- a/src/mess/includes/a7800.h
+++ b/src/mess/includes/a7800.h
@@ -67,6 +67,9 @@ public:
DECLARE_PALETTE_INIT(a7800p);
UINT32 screen_update_a7800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(a7800_interrupt);
+ DECLARE_READ8_MEMBER(riot_joystick_r);
+ DECLARE_READ8_MEMBER(riot_console_button_r);
+ DECLARE_WRITE8_MEMBER(riot_button_pullup_w);
};
/*----------- defined in machine/a7800.c -----------*/
diff --git a/src/mess/includes/ac1.h b/src/mess/includes/ac1.h
index d95d5134d53..ea327d8ddb7 100644
--- a/src/mess/includes/ac1.h
+++ b/src/mess/includes/ac1.h
@@ -22,6 +22,10 @@ public:
virtual void video_start();
UINT32 screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ8_MEMBER(ac1_port_b_r);
+ DECLARE_READ8_MEMBER(ac1_port_a_r);
+ DECLARE_WRITE8_MEMBER(ac1_port_a_w);
+ DECLARE_WRITE8_MEMBER(ac1_port_b_w);
};
diff --git a/src/mess/includes/ace.h b/src/mess/includes/ace.h
index 963cda20016..631e106ee88 100644
--- a/src/mess/includes/ace.h
+++ b/src/mess/includes/ace.h
@@ -60,6 +60,16 @@ public:
UINT32 screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(set_irq);
TIMER_DEVICE_CALLBACK_MEMBER(clear_irq);
+ DECLARE_READ8_MEMBER(pio_ad_r);
+ DECLARE_READ8_MEMBER(pio_bd_r);
+ DECLARE_READ8_MEMBER(pio_ac_r);
+ DECLARE_READ8_MEMBER(pio_bc_r);
+ DECLARE_WRITE8_MEMBER(pio_ad_w);
+ DECLARE_WRITE8_MEMBER(pio_bd_w);
+ DECLARE_WRITE8_MEMBER(pio_ac_w);
+ DECLARE_WRITE8_MEMBER(pio_bc_w);
+ DECLARE_READ8_MEMBER(sby_r);
+ DECLARE_WRITE8_MEMBER(ald_w);
};
#endif /* ACE_H_ */
diff --git a/src/mess/includes/adam.h b/src/mess/includes/adam.h
index 560d899c0a0..386faee59b7 100644
--- a/src/mess/includes/adam.h
+++ b/src/mess/includes/adam.h
@@ -127,6 +127,7 @@ public:
int m_wr1;
int m_track;
TIMER_DEVICE_CALLBACK_MEMBER(paddle_tick);
+ DECLARE_WRITE_LINE_MEMBER(adam_vdp_interrupt);
};
#endif
diff --git a/src/mess/includes/amstrad.h b/src/mess/includes/amstrad.h
index 2138df11439..5212a48acba 100644
--- a/src/mess/includes/amstrad.h
+++ b/src/mess/includes/amstrad.h
@@ -173,36 +173,28 @@ public:
TIMER_CALLBACK_MEMBER(amstrad_pc2_low);
TIMER_CALLBACK_MEMBER(amstrad_video_update_timer);
TIMER_CALLBACK_MEMBER(cb_set_resolution);
+ DECLARE_WRITE_LINE_MEMBER(aleste_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_hsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_plus_hsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_vsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_plus_vsync_changed);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_de_changed);
+ DECLARE_WRITE_LINE_MEMBER(amstrad_plus_de_changed);
+ DECLARE_READ8_MEMBER(amstrad_ppi_porta_r);
+ DECLARE_WRITE8_MEMBER(amstrad_ppi_porta_w);
+ DECLARE_READ8_MEMBER(amstrad_ppi_portb_r);
+ DECLARE_WRITE8_MEMBER(amstrad_ppi_portc_w);
};
/*----------- defined in machine/amstrad.c -----------*/
-
-DECLARE_READ8_DEVICE_HANDLER( amstrad_ppi_porta_r );
-DECLARE_READ8_DEVICE_HANDLER( amstrad_ppi_portb_r );
-DECLARE_WRITE8_DEVICE_HANDLER( amstrad_ppi_porta_w );
-DECLARE_WRITE8_DEVICE_HANDLER( amstrad_ppi_portc_w );
-
-
-WRITE_LINE_DEVICE_HANDLER( aleste_interrupt );
WRITE_LINE_DEVICE_HANDLER( cpc_irq_w );
WRITE_LINE_DEVICE_HANDLER( cpc_nmi_w );
WRITE_LINE_DEVICE_HANDLER( cpc_romdis );
WRITE_LINE_DEVICE_HANDLER( cpc_romen );
-
-
-
-
-
-
-
-
-
-
-
SNAPSHOT_LOAD( amstrad );
DEVICE_IMAGE_LOAD(amstrad_plus_cartridge);
diff --git a/src/mess/includes/apple1.h b/src/mess/includes/apple1.h
index cf0b78efebb..f6dc90cf63d 100644
--- a/src/mess/includes/apple1.h
+++ b/src/mess/includes/apple1.h
@@ -52,6 +52,9 @@ public:
TIMER_CALLBACK_MEMBER(apple1_kbd_strobe_end);
TIMER_CALLBACK_MEMBER(apple1_dsp_ready_start);
TIMER_CALLBACK_MEMBER(apple1_dsp_ready_end);
+ DECLARE_READ8_MEMBER(apple1_pia0_kbdin);
+ DECLARE_WRITE8_MEMBER(apple1_pia0_dspout);
+ DECLARE_WRITE8_MEMBER(apple1_pia0_dsp_write_signal);
};
diff --git a/src/mess/includes/apple2.h b/src/mess/includes/apple2.h
index f487edfa650..544d4dcfc6f 100644
--- a/src/mess/includes/apple2.h
+++ b/src/mess/includes/apple2.h
@@ -243,6 +243,9 @@ public:
DECLARE_MACHINE_START(space84);
UINT32 screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt);
+ DECLARE_WRITE8_MEMBER(a2bus_irq_w);
+ DECLARE_WRITE8_MEMBER(a2bus_nmi_w);
+ DECLARE_WRITE8_MEMBER(a2bus_inh_w);
};
diff --git a/src/mess/includes/apple2gs.h b/src/mess/includes/apple2gs.h
index e52f640f5e3..059da62fe61 100644
--- a/src/mess/includes/apple2gs.h
+++ b/src/mess/includes/apple2gs.h
@@ -145,6 +145,9 @@ public:
TIMER_CALLBACK_MEMBER(apple2gs_clock_tick);
TIMER_CALLBACK_MEMBER(apple2gs_qsecond_tick);
TIMER_CALLBACK_MEMBER(apple2gs_scanline_tick);
+ DECLARE_WRITE8_MEMBER(a2bus_irq_w);
+ DECLARE_WRITE8_MEMBER(a2bus_nmi_w);
+ DECLARE_WRITE8_MEMBER(a2bus_inh_w);
};
diff --git a/src/mess/includes/apple3.h b/src/mess/includes/apple3.h
index a0ebefd4272..e0e111b55c1 100644
--- a/src/mess/includes/apple3.h
+++ b/src/mess/includes/apple3.h
@@ -61,6 +61,12 @@ public:
DECLARE_VIDEO_START(apple3);
UINT32 screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(apple3_interrupt);
+ DECLARE_READ8_MEMBER(apple3_via_1_in_a);
+ DECLARE_READ8_MEMBER(apple3_via_1_in_b);
+ DECLARE_WRITE8_MEMBER(apple3_via_0_out_a);
+ DECLARE_WRITE8_MEMBER(apple3_via_0_out_b);
+ DECLARE_WRITE8_MEMBER(apple3_via_1_out_a);
+ DECLARE_WRITE8_MEMBER(apple3_via_1_out_b);
};
diff --git a/src/mess/includes/b2m.h b/src/mess/includes/b2m.h
index d5065be982d..9ee44a63d9e 100644
--- a/src/mess/includes/b2m.h
+++ b/src/mess/includes/b2m.h
@@ -50,6 +50,16 @@ public:
virtual void palette_init();
UINT32 screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(b2m_vblank_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(bm2_pit_out1);
+ DECLARE_WRITE8_MEMBER(b2m_8255_porta_w);
+ DECLARE_WRITE8_MEMBER(b2m_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(b2m_8255_portc_w);
+ DECLARE_READ8_MEMBER(b2m_8255_portb_r);
+ DECLARE_WRITE8_MEMBER(b2m_ext_8255_portc_w);
+ DECLARE_READ8_MEMBER(b2m_romdisk_porta_r);
+ DECLARE_WRITE8_MEMBER(b2m_romdisk_portb_w);
+ DECLARE_WRITE8_MEMBER(b2m_romdisk_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(b2m_pic_set_int_line);
};
/*----------- defined in machine/b2m.c -----------*/
diff --git a/src/mess/includes/bbc.h b/src/mess/includes/bbc.h
index 0cbf9d6602b..c19a55ad151 100644
--- a/src/mess/includes/bbc.h
+++ b/src/mess/includes/bbc.h
@@ -286,6 +286,24 @@ public:
INTERRUPT_GEN_MEMBER(bbcb_keyscan);
INTERRUPT_GEN_MEMBER(bbcm_keyscan);
TIMER_CALLBACK_MEMBER(bbc_tape_timer_cb);
+ DECLARE_WRITE_LINE_MEMBER(bbcb_ack_w);
+ DECLARE_WRITE_LINE_MEMBER(bbcb_acia6850_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(econet_clk_w);
+ DECLARE_WRITE8_MEMBER(bbcb_via_system_write_porta);
+ DECLARE_WRITE8_MEMBER(bbcb_via_system_write_portb);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_porta);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_portb);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_ca1);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_cb1);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_ca2);
+ DECLARE_READ8_MEMBER(bbcb_via_system_read_cb2);
+ DECLARE_WRITE_LINE_MEMBER(bbcb_via_system_irq_w);
+ DECLARE_READ8_MEMBER(bbcb_via_user_read_portb);
+ DECLARE_WRITE8_MEMBER(bbcb_via_user_write_portb);
+ DECLARE_WRITE_LINE_MEMBER(bbcb_via_user_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(bbc_wd177x_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(bbc_vsync);
};
diff --git a/src/mess/includes/bebox.h b/src/mess/includes/bebox.h
index bdcb46c5295..152dc1cdbc1 100644
--- a/src/mess/includes/bebox.h
+++ b/src/mess/includes/bebox.h
@@ -42,6 +42,18 @@ public:
virtual void machine_start();
virtual void machine_reset();
TIMER_CALLBACK_MEMBER(bebox_get_devices);
+ DECLARE_WRITE_LINE_MEMBER(bebox_pic8259_master_set_int_line);
+ DECLARE_WRITE_LINE_MEMBER(bebox_pic8259_slave_set_int_line);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE_LINE_MEMBER(bebox_dma_hrq_changed);
+ DECLARE_READ8_MEMBER(bebox_dma8237_fdc_dack_r);
+ DECLARE_WRITE8_MEMBER(bebox_dma8237_fdc_dack_w);
+ DECLARE_WRITE_LINE_MEMBER(bebox_dma8237_out_eop);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack0_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack1_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack2_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack3_w);
+ DECLARE_WRITE_LINE_MEMBER(bebox_timer0_w);
};
diff --git a/src/mess/includes/bullet.h b/src/mess/includes/bullet.h
index d1c164da295..865d5ce4163 100644
--- a/src/mess/includes/bullet.h
+++ b/src/mess/includes/bullet.h
@@ -94,6 +94,7 @@ public:
int m_exrdy1;
int m_exrdy2;
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
+ DECLARE_WRITE_LINE_MEMBER(dart_rxtxca_w);
};
class bulletf_state : public bullet_state
diff --git a/src/mess/includes/bw12.h b/src/mess/includes/bw12.h
index 16b5ee10d25..4c659aed043 100644
--- a/src/mess/includes/bw12.h
+++ b/src/mess/includes/bw12.h
@@ -90,6 +90,7 @@ public:
int m_motor0;
int m_motor1;
TIMER_DEVICE_CALLBACK_MEMBER(floppy_motor_off_tick);
+ DECLARE_WRITE_LINE_MEMBER(pit_out0_w);
};
#endif
diff --git a/src/mess/includes/c64_legacy.h b/src/mess/includes/c64_legacy.h
index 3e92375f149..326af0cea8f 100644
--- a/src/mess/includes/c64_legacy.h
+++ b/src/mess/includes/c64_legacy.h
@@ -91,6 +91,11 @@ public:
DECLARE_DRIVER_INIT( c64gs );
DECLARE_DRIVER_INIT( sx64 );
INTERRUPT_GEN_MEMBER(c64_frame_interrupt);
+ DECLARE_READ8_MEMBER(c64_cia0_port_a_r);
+ DECLARE_READ8_MEMBER(c64_cia0_port_b_r);
+ DECLARE_WRITE8_MEMBER(c64_cia0_port_b_w);
+ DECLARE_READ8_MEMBER(c64_cia1_port_a_r);
+ DECLARE_WRITE8_MEMBER(c64_cia1_port_a_w);
};
@@ -98,9 +103,6 @@ public:
/* private area */
-extern DECLARE_READ8_DEVICE_HANDLER(c64_m6510_port_read);
-extern DECLARE_WRITE8_DEVICE_HANDLER(c64_m6510_port_write);
-
DECLARE_READ8_HANDLER ( c64_colorram_read );
DECLARE_WRITE8_HANDLER ( c64_colorram_write );
diff --git a/src/mess/includes/c65.h b/src/mess/includes/c65.h
index 58a99a0fe96..e9494b4f770 100644
--- a/src/mess/includes/c65.h
+++ b/src/mess/includes/c65.h
@@ -67,6 +67,12 @@ public:
UINT32 screen_update_c65(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vic3_raster_irq);
INTERRUPT_GEN_MEMBER(c65_frame_interrupt);
+ DECLARE_READ8_MEMBER(c65_cia0_port_a_r);
+ DECLARE_READ8_MEMBER(c65_cia0_port_b_r);
+ DECLARE_WRITE8_MEMBER(c65_cia0_port_b_w);
+ DECLARE_READ8_MEMBER(c65_cia1_port_a_r);
+ DECLARE_WRITE8_MEMBER(c65_cia1_port_a_w);
+ DECLARE_WRITE_LINE_MEMBER(c65_cia1_interrupt);
};
diff --git a/src/mess/includes/cgenie.h b/src/mess/includes/cgenie.h
index adb17fad988..54eb98c77bb 100644
--- a/src/mess/includes/cgenie.h
+++ b/src/mess/includes/cgenie.h
@@ -74,13 +74,14 @@ public:
INTERRUPT_GEN_MEMBER(cgenie_timer_interrupt);
INTERRUPT_GEN_MEMBER(cgenie_frame_interrupt);
TIMER_CALLBACK_MEMBER(handle_cassette_input);
+ DECLARE_WRITE_LINE_MEMBER(cgenie_fdc_intrq_w);
+ DECLARE_READ8_MEMBER(cgenie_sh_control_port_r);
+ DECLARE_WRITE8_MEMBER(cgenie_sh_control_port_w);
};
/*----------- defined in machine/cgenie.c -----------*/
-DECLARE_READ8_DEVICE_HANDLER( cgenie_sh_control_port_r );
-DECLARE_WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w );
extern const wd17xx_interface cgenie_wd17xx_interface;
diff --git a/src/mess/includes/coleco.h b/src/mess/includes/coleco.h
index 08b018d2ddb..3bc91ece5a6 100644
--- a/src/mess/includes/coleco.h
+++ b/src/mess/includes/coleco.h
@@ -47,6 +47,7 @@ public:
TIMER_CALLBACK_MEMBER(paddle_irqreset_callback);
TIMER_CALLBACK_MEMBER(paddle_pulse_callback);
TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback);
+ DECLARE_WRITE_LINE_MEMBER(coleco_vdp_interrupt);
};
#endif
diff --git a/src/mess/includes/concept.h b/src/mess/includes/concept.h
index cb94d59d6e6..45ab8205961 100644
--- a/src/mess/includes/concept.h
+++ b/src/mess/includes/concept.h
@@ -69,6 +69,13 @@ public:
DECLARE_READ8_MEMBER(concept_hdc_reg_r);
DECLARE_WRITE8_MEMBER(concept_hdc_reg_w);
DECLARE_READ8_MEMBER(concept_hdc_rom_r);
+ DECLARE_READ8_MEMBER(via_in_a);
+ DECLARE_WRITE8_MEMBER(via_out_a);
+ DECLARE_READ8_MEMBER(via_in_b);
+ DECLARE_WRITE8_MEMBER(via_out_b);
+ DECLARE_WRITE8_MEMBER(via_out_cb2);
+ DECLARE_WRITE_LINE_MEMBER(concept_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(concept_fdc_drq_w);
};
diff --git a/src/mess/includes/dgn_beta.h b/src/mess/includes/dgn_beta.h
index a9cfc7250f0..4f61bf96d65 100644
--- a/src/mess/includes/dgn_beta.h
+++ b/src/mess/includes/dgn_beta.h
@@ -161,6 +161,28 @@ public:
DECLARE_WRITE8_MEMBER(dgnbeta_ram_bE_w);
DECLARE_WRITE8_MEMBER(dgnbeta_ram_bF_w);
DECLARE_WRITE8_MEMBER(dgnbeta_ram_bG_w);
+ DECLARE_READ8_MEMBER(d_pia0_pa_r);
+ DECLARE_WRITE8_MEMBER(d_pia0_pa_w);
+ DECLARE_READ8_MEMBER(d_pia0_pb_r);
+ DECLARE_WRITE8_MEMBER(d_pia0_pb_w);
+ DECLARE_WRITE8_MEMBER(d_pia0_cb2_w);
+ DECLARE_WRITE_LINE_MEMBER(d_pia0_irq_a);
+ DECLARE_WRITE_LINE_MEMBER(d_pia0_irq_b);
+ DECLARE_READ8_MEMBER(d_pia1_pa_r);
+ DECLARE_WRITE8_MEMBER(d_pia1_pa_w);
+ DECLARE_READ8_MEMBER(d_pia1_pb_r);
+ DECLARE_WRITE8_MEMBER(d_pia1_pb_w);
+ DECLARE_WRITE_LINE_MEMBER(d_pia1_irq_a);
+ DECLARE_WRITE_LINE_MEMBER(d_pia1_irq_b);
+ DECLARE_READ8_MEMBER(d_pia2_pa_r);
+ DECLARE_WRITE8_MEMBER(d_pia2_pa_w);
+ DECLARE_READ8_MEMBER(d_pia2_pb_r);
+ DECLARE_WRITE8_MEMBER(d_pia2_pb_w);
+ DECLARE_WRITE_LINE_MEMBER(d_pia2_irq_a);
+ DECLARE_WRITE_LINE_MEMBER(d_pia2_irq_b);
+ DECLARE_WRITE_LINE_MEMBER(dgnbeta_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(dgnbeta_fdc_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(dgnbeta_vsync_changed);
};
diff --git a/src/mess/includes/einstein.h b/src/mess/includes/einstein.h
index 6235140fccd..26b10f9e6f4 100644
--- a/src/mess/includes/einstein.h
+++ b/src/mess/includes/einstein.h
@@ -85,6 +85,10 @@ public:
UINT32 screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(einstein_keyboard_timer_callback);
TIMER_DEVICE_CALLBACK_MEMBER(einstein_ctc_trigger_callback);
+ DECLARE_WRITE_LINE_MEMBER(einstein_6845_de_changed);
+ DECLARE_WRITE8_MEMBER(einstein_drsel_w);
+ DECLARE_WRITE_LINE_MEMBER(einstein_serial_transmit_clock);
+ DECLARE_WRITE_LINE_MEMBER(einstein_serial_receive_clock);
};
diff --git a/src/mess/includes/enterp.h b/src/mess/includes/enterp.h
index 596bf2f7b9c..fd9682a470b 100644
--- a/src/mess/includes/enterp.h
+++ b/src/mess/includes/enterp.h
@@ -32,6 +32,10 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_epnick(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(enterprise_dave_reg_write);
+ DECLARE_READ8_MEMBER(enterprise_dave_reg_read);
+ DECLARE_WRITE_LINE_MEMBER(enterp_wd1770_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(enterp_wd1770_drq_w);
};
diff --git a/src/mess/includes/fm7.h b/src/mess/includes/fm7.h
index ddee2c4247f..02a2f3e9d1a 100644
--- a/src/mess/includes/fm7.h
+++ b/src/mess/includes/fm7.h
@@ -246,6 +246,10 @@ public:
TIMER_CALLBACK_MEMBER(fm7_keyboard_poll);
TIMER_CALLBACK_MEMBER(fm77av_alu_task_end);
TIMER_CALLBACK_MEMBER(fm77av_vsync);
+ DECLARE_WRITE_LINE_MEMBER(fm7_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(fm7_fdc_drq_w);
+ DECLARE_READ8_MEMBER(fm77av_joy_1_r);
+ DECLARE_READ8_MEMBER(fm77av_joy_2_r);
};
#endif /*FM7_H_*/
diff --git a/src/mess/includes/fmtowns.h b/src/mess/includes/fmtowns.h
index b5c52f27126..204fc40dc70 100644
--- a/src/mess/includes/fmtowns.h
+++ b/src/mess/includes/fmtowns.h
@@ -281,6 +281,12 @@ public:
TIMER_CALLBACK_MEMBER(towns_delay_cdda);
TIMER_CALLBACK_MEMBER(towns_sprite_done);
TIMER_CALLBACK_MEMBER(towns_vblank_end);
+ DECLARE_WRITE_LINE_MEMBER(towns_scsi_irq);
+ DECLARE_WRITE_LINE_MEMBER(towns_scsi_drq);
+ DECLARE_WRITE_LINE_MEMBER(towns_pic_irq);
+ DECLARE_WRITE_LINE_MEMBER(towns_pit_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(towns_pit_out1_changed);
+ DECLARE_READ8_MEMBER(get_slave_ack);
};
class marty_state : public towns_state
diff --git a/src/mess/includes/huebler.h b/src/mess/includes/huebler.h
index 31f66408a73..73826cf621f 100644
--- a/src/mess/includes/huebler.h
+++ b/src/mess/includes/huebler.h
@@ -52,6 +52,10 @@ public:
required_shared_ptr<UINT8> m_video_ram;
const UINT8 *m_char_rom;
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z0_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z2_w);
+ DECLARE_READ_LINE_MEMBER(cassette_r);
+ DECLARE_WRITE_LINE_MEMBER(cassette_w);
};
#endif
diff --git a/src/mess/includes/irisha.h b/src/mess/includes/irisha.h
index a42c29e0b56..9d31c0f7a1a 100644
--- a/src/mess/includes/irisha.h
+++ b/src/mess/includes/irisha.h
@@ -48,6 +48,7 @@ public:
virtual void video_start();
UINT32 screen_update_irisha(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(irisha_key);
+ DECLARE_WRITE_LINE_MEMBER(irisha_pic_set_int_line);
};
diff --git a/src/mess/includes/kaypro.h b/src/mess/includes/kaypro.h
index 81086510487..136d22ac16c 100644
--- a/src/mess/includes/kaypro.h
+++ b/src/mess/includes/kaypro.h
@@ -80,6 +80,9 @@ public:
UINT32 screen_update_omni2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(kay_kbd_interrupt);
TIMER_CALLBACK_MEMBER(kaypro_timer_callback);
+ DECLARE_WRITE_LINE_MEMBER(kaypro_interrupt);
+ DECLARE_READ8_MEMBER(kaypro_sio_r);
+ DECLARE_WRITE8_MEMBER(kaypro_sio_w);
};
@@ -100,9 +103,6 @@ extern const z80pio_interface kaypro4_pio_s_intf;
extern const z80sio_interface kaypro_sio_intf;
extern const wd17xx_interface kaypro_wd1793_interface;
-DECLARE_READ8_DEVICE_HANDLER( kaypro_sio_r );
-DECLARE_WRITE8_DEVICE_HANDLER( kaypro_sio_w );
-
QUICKLOAD_LOAD( kayproii );
QUICKLOAD_LOAD( kaypro2x );
diff --git a/src/mess/includes/kramermc.h b/src/mess/includes/kramermc.h
index 723e0819682..3b4aaaccce2 100644
--- a/src/mess/includes/kramermc.h
+++ b/src/mess/includes/kramermc.h
@@ -20,6 +20,9 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_kramermc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ8_MEMBER(kramermc_port_a_r);
+ DECLARE_READ8_MEMBER(kramermc_port_b_r);
+ DECLARE_WRITE8_MEMBER(kramermc_port_a_w);
};
diff --git a/src/mess/includes/kyocera.h b/src/mess/includes/kyocera.h
index 7c81b6c9368..217426413da 100644
--- a/src/mess/includes/kyocera.h
+++ b/src/mess/includes/kyocera.h
@@ -115,6 +115,8 @@ public:
int m_bell; /* bell output */
DECLARE_PALETTE_INIT(kc85);
+ DECLARE_WRITE_LINE_MEMBER(kc85_sod_w);
+ DECLARE_READ_LINE_MEMBER(kc85_sid_r);
};
class trsm100_state : public kc85_state
diff --git a/src/mess/includes/lisa.h b/src/mess/includes/lisa.h
index 4682bde8af4..e53f49dfe20 100644
--- a/src/mess/includes/lisa.h
+++ b/src/mess/includes/lisa.h
@@ -168,6 +168,12 @@ public:
TIMER_CALLBACK_MEMBER(handle_mouse);
TIMER_CALLBACK_MEMBER(read_COPS_command);
TIMER_CALLBACK_MEMBER(set_COPS_ready);
+ DECLARE_WRITE8_MEMBER(COPS_via_out_a);
+ DECLARE_WRITE8_MEMBER(COPS_via_out_ca2);
+ DECLARE_READ8_MEMBER(COPS_via_in_b);
+ DECLARE_WRITE8_MEMBER(COPS_via_out_b);
+ DECLARE_WRITE8_MEMBER(COPS_via_out_cb2);
+ DECLARE_READ8_MEMBER(parallel_via_in_b);
};
diff --git a/src/mess/includes/lviv.h b/src/mess/includes/lviv.h
index 1539856ceab..33f4146f1d3 100644
--- a/src/mess/includes/lviv.h
+++ b/src/mess/includes/lviv.h
@@ -28,6 +28,18 @@ public:
virtual void palette_init();
UINT32 screen_update_lviv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(lviv_reset);
+ DECLARE_READ8_MEMBER(lviv_ppi_0_porta_r);
+ DECLARE_READ8_MEMBER(lviv_ppi_0_portb_r);
+ DECLARE_READ8_MEMBER(lviv_ppi_0_portc_r);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_0_porta_w);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_0_portb_w);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_0_portc_w);
+ DECLARE_READ8_MEMBER(lviv_ppi_1_porta_r);
+ DECLARE_READ8_MEMBER(lviv_ppi_1_portb_r);
+ DECLARE_READ8_MEMBER(lviv_ppi_1_portc_r);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_1_porta_w);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_1_portb_w);
+ DECLARE_WRITE8_MEMBER(lviv_ppi_1_portc_w);
};
diff --git a/src/mess/includes/m5.h b/src/mess/includes/m5.h
index 0982d010208..7459e8d4c75 100644
--- a/src/mess/includes/m5.h
+++ b/src/mess/includes/m5.h
@@ -70,6 +70,7 @@ public:
int m_obfa;
DECLARE_DRIVER_INIT(pal);
DECLARE_DRIVER_INIT(ntsc);
+ DECLARE_WRITE_LINE_MEMBER(sordm5_video_interrupt_callback);
};
#endif
diff --git a/src/mess/includes/mac.h b/src/mess/includes/mac.h
index ce9159101e6..175d83481aa 100644
--- a/src/mess/includes/mac.h
+++ b/src/mess/includes/mac.h
@@ -28,10 +28,10 @@
// model helpers
#define ADB_IS_BITBANG ((mac->m_model == MODEL_MAC_SE || mac->m_model == MODEL_MAC_CLASSIC) || (mac->m_model >= MODEL_MAC_II && mac->m_model <= MODEL_MAC_IICI) || (mac->m_model == MODEL_MAC_SE30) || (mac->m_model == MODEL_MAC_QUADRA_700))
#define ADB_IS_BITBANG_CLASS ((m_model == MODEL_MAC_SE || m_model == MODEL_MAC_CLASSIC) || (m_model >= MODEL_MAC_II && m_model <= MODEL_MAC_IICI) || (m_model == MODEL_MAC_SE30) || (m_model == MODEL_MAC_QUADRA_700))
-#define ADB_IS_EGRET (mac->m_model >= MODEL_MAC_LC && mac->m_model <= MODEL_MAC_CLASSIC_II) || ((mac->m_model >= MODEL_MAC_IISI) && (mac->m_model <= MODEL_MAC_IIVI))
-#define ADB_IS_CUDA ((mac->m_model >= MODEL_MAC_COLOR_CLASSIC && mac->m_model <= MODEL_MAC_LC_580) || ((mac->m_model >= MODEL_MAC_QUADRA_660AV) && (mac->m_model <= MODEL_MAC_QUADRA_630)) || (mac->m_model >= MODEL_MAC_POWERMAC_6100))
-#define ADB_IS_PM_VIA1 (mac->m_model >= MODEL_MAC_PORTABLE && mac->m_model <= MODEL_MAC_PB100)
-#define ADB_IS_PM_VIA2 (mac->m_model >= MODEL_MAC_PB140 && mac->m_model <= MODEL_MAC_PBDUO_270c)
+#define ADB_IS_EGRET (m_model >= MODEL_MAC_LC && m_model <= MODEL_MAC_CLASSIC_II) || ((m_model >= MODEL_MAC_IISI) && (m_model <= MODEL_MAC_IIVI))
+#define ADB_IS_CUDA ((m_model >= MODEL_MAC_COLOR_CLASSIC && m_model <= MODEL_MAC_LC_580) || ((m_model >= MODEL_MAC_QUADRA_660AV) && (m_model <= MODEL_MAC_QUADRA_630)) || (m_model >= MODEL_MAC_POWERMAC_6100))
+#define ADB_IS_PM_VIA1 (m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100)
+#define ADB_IS_PM_VIA2 (m_model >= MODEL_MAC_PB140 && m_model <= MODEL_MAC_PBDUO_270c)
#define ADB_IS_PM_VIA1_CLASS (m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100)
#define ADB_IS_PM_VIA2_CLASS (m_model >= MODEL_MAC_PB140 && m_model <= MODEL_MAC_PBDUO_270c)
#define ADB_IS_PM_CLASS ((m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100) || (m_model >= MODEL_MAC_PB140 && m_model <= MODEL_MAC_PBDUO_270c))
@@ -529,6 +529,17 @@ public:
TIMER_CALLBACK_MEMBER(mac_scanline_tick);
TIMER_CALLBACK_MEMBER(dafb_vbl_tick);
TIMER_CALLBACK_MEMBER(dafb_cursor_tick);
+ DECLARE_WRITE8_MEMBER(mac_via_out_cb2);
+ DECLARE_READ8_MEMBER(mac_adb_via_in_cb2);
+ DECLARE_WRITE8_MEMBER(mac_adb_via_out_cb2);
+ DECLARE_READ8_MEMBER(mac_via_in_a);
+ DECLARE_READ8_MEMBER(mac_via_in_b);
+ DECLARE_WRITE8_MEMBER(mac_via_out_a);
+ DECLARE_WRITE8_MEMBER(mac_via_out_b);
+ DECLARE_READ8_MEMBER(mac_via2_in_a);
+ DECLARE_READ8_MEMBER(mac_via2_in_b);
+ DECLARE_WRITE8_MEMBER(mac_via2_out_a);
+ DECLARE_WRITE8_MEMBER(mac_via2_out_b);
};
#endif /* MAC_H_ */
diff --git a/src/mess/includes/macpci.h b/src/mess/includes/macpci.h
index b1acd5ef89d..17c68d0fd4b 100644
--- a/src/mess/includes/macpci.h
+++ b/src/mess/includes/macpci.h
@@ -159,6 +159,12 @@ public:
emu_timer *m_scanline_timer;
UINT32 screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(mac_6015_tick);
+ DECLARE_READ8_MEMBER(mac_via_in_a);
+ DECLARE_READ8_MEMBER(mac_via_in_b);
+ DECLARE_WRITE8_MEMBER(mac_via_out_a);
+ DECLARE_WRITE8_MEMBER(mac_via_out_b);
+ DECLARE_READ8_MEMBER(mac_adb_via_in_cb2);
+ DECLARE_WRITE8_MEMBER(mac_adb_via_out_cb2);
};
#endif /* PCIMAC_H_ */
diff --git a/src/mess/includes/mc80.h b/src/mess/includes/mc80.h
index 18554be9d1b..c55a5b327ad 100644
--- a/src/mess/includes/mc80.h
+++ b/src/mess/includes/mc80.h
@@ -45,6 +45,7 @@ public:
UINT32 screen_update_mc8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_mc8030(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(mc8020_kbd);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z2_w);
};
diff --git a/src/mess/includes/microtan.h b/src/mess/includes/microtan.h
index 01330509793..e56fc8533e1 100644
--- a/src/mess/includes/microtan.h
+++ b/src/mess/includes/microtan.h
@@ -55,6 +55,26 @@ public:
INTERRUPT_GEN_MEMBER(microtan_interrupt);
TIMER_CALLBACK_MEMBER(microtan_read_cassette);
TIMER_CALLBACK_MEMBER(microtan_pulse_nmi);
+ DECLARE_READ8_MEMBER(via_0_in_a);
+ DECLARE_READ8_MEMBER(via_0_in_b);
+ DECLARE_READ8_MEMBER(via_0_in_ca1);
+ DECLARE_READ8_MEMBER(via_0_in_cb1);
+ DECLARE_READ8_MEMBER(via_0_in_ca2);
+ DECLARE_READ8_MEMBER(via_0_in_cb2);
+ DECLARE_WRITE8_MEMBER(via_0_out_a);
+ DECLARE_WRITE8_MEMBER(via_0_out_b);
+ DECLARE_WRITE8_MEMBER(via_0_out_ca2);
+ DECLARE_WRITE8_MEMBER(via_0_out_cb2);
+ DECLARE_READ8_MEMBER(via_1_in_a);
+ DECLARE_READ8_MEMBER(via_1_in_b);
+ DECLARE_READ8_MEMBER(via_1_in_ca1);
+ DECLARE_READ8_MEMBER(via_1_in_cb1);
+ DECLARE_READ8_MEMBER(via_1_in_ca2);
+ DECLARE_READ8_MEMBER(via_1_in_cb2);
+ DECLARE_WRITE8_MEMBER(via_1_out_a);
+ DECLARE_WRITE8_MEMBER(via_1_out_b);
+ DECLARE_WRITE8_MEMBER(via_1_out_ca2);
+ DECLARE_WRITE8_MEMBER(via_1_out_cb2);
};
diff --git a/src/mess/includes/msx.h b/src/mess/includes/msx.h
index d6f048f2a29..4ddf05fb3ea 100644
--- a/src/mess/includes/msx.h
+++ b/src/mess/includes/msx.h
@@ -126,6 +126,10 @@ public:
DECLARE_MACHINE_RESET(msx2);
INTERRUPT_GEN_MEMBER(msx_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(msx2_interrupt);
+ DECLARE_WRITE8_MEMBER(msx_ay8910_w);
+ DECLARE_WRITE8_MEMBER(msx_printer_strobe_w);
+ DECLARE_WRITE8_MEMBER(msx_printer_data_w);
+ DECLARE_READ8_MEMBER(msx_printer_status_r);
};
@@ -141,9 +145,5 @@ DEVICE_IMAGE_UNLOAD( msx_cart );
void msx_vdp_interrupt(device_t *, v99x8_device &device, int i);
/* I/O functions */
-DECLARE_READ8_DEVICE_HANDLER( msx_printer_status_r );
-DECLARE_WRITE8_DEVICE_HANDLER( msx_printer_strobe_w );
-DECLARE_WRITE8_DEVICE_HANDLER( msx_printer_data_w );
-
#endif /* __MSX_H__ */
diff --git a/src/mess/includes/mtx.h b/src/mess/includes/mtx.h
index dec57af71c7..a39b66a1d2b 100644
--- a/src/mess/includes/mtx.h
+++ b/src/mess/includes/mtx.h
@@ -52,7 +52,6 @@ public:
/* timers */
device_t *m_cassette_timer;
- DECLARE_READ8_MEMBER(mtx_sound_strobe_r);
DECLARE_WRITE8_MEMBER(mtx_bankswitch_w);
DECLARE_WRITE8_MEMBER(mtx_sound_latch_w);
DECLARE_WRITE8_MEMBER(mtx_sense_w);
@@ -67,18 +66,17 @@ public:
DECLARE_MACHINE_RESET(mtx512);
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
TIMER_DEVICE_CALLBACK_MEMBER(cassette_tick);
+ DECLARE_WRITE_LINE_MEMBER(ctc_trg1_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_trg2_w);
+ DECLARE_WRITE_LINE_MEMBER(mtx_tms9929a_interrupt);
+ DECLARE_READ8_MEMBER(mtx_strobe_r);
+ DECLARE_READ8_MEMBER(mtx_sound_strobe_r);
+ DECLARE_WRITE8_MEMBER(mtx_cst_w);
+ DECLARE_READ8_MEMBER(mtx_prt_r);
};
/*----------- defined in machine/mtx.c -----------*/
SNAPSHOT_LOAD( mtx );
-/* Cassette */
-DECLARE_WRITE8_DEVICE_HANDLER( mtx_cst_w );
-
-/* Printer */
-DECLARE_READ8_DEVICE_HANDLER( mtx_strobe_r );
-DECLARE_READ8_DEVICE_HANDLER( mtx_prt_r );
-
-
#endif /* __MTX_H__ */
diff --git a/src/mess/includes/mz700.h b/src/mess/includes/mz700.h
index d155f6aa1b9..7b310d6602a 100644
--- a/src/mess/includes/mz700.h
+++ b/src/mess/includes/mz700.h
@@ -83,6 +83,14 @@ public:
UINT32 screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ne556_cursor_callback);
TIMER_DEVICE_CALLBACK_MEMBER(ne556_other_callback);
+ DECLARE_WRITE_LINE_MEMBER(pit_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(pit_irq_2);
+ DECLARE_READ8_MEMBER(pio_port_b_r);
+ DECLARE_READ8_MEMBER(pio_port_c_r);
+ DECLARE_WRITE8_MEMBER(pio_port_a_w);
+ DECLARE_WRITE8_MEMBER(pio_port_c_w);
+ DECLARE_READ8_MEMBER(mz800_z80pio_port_a_r);
+ DECLARE_WRITE8_MEMBER(mz800_z80pio_port_a_w);
};
diff --git a/src/mess/includes/nascom1.h b/src/mess/includes/nascom1.h
index aef0a2e5652..1ed9f039258 100644
--- a/src/mess/includes/nascom1.h
+++ b/src/mess/includes/nascom1.h
@@ -50,6 +50,10 @@ public:
virtual void machine_reset();
UINT32 screen_update_nascom1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_nascom2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(nascom2_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(nascom2_fdc_drq_w);
+ DECLARE_READ8_MEMBER(nascom1_hd6402_si);
+ DECLARE_WRITE8_MEMBER(nascom1_hd6402_so);
};
@@ -60,8 +64,4 @@ extern const wd17xx_interface nascom2_wd17xx_interface;
DEVICE_IMAGE_LOAD( nascom1_cassette );
DEVICE_IMAGE_UNLOAD( nascom1_cassette );
SNAPSHOT_LOAD( nascom1 );
-
-DECLARE_READ8_DEVICE_HANDLER( nascom1_hd6402_si );
-DECLARE_WRITE8_DEVICE_HANDLER( nascom1_hd6402_so );
-
#endif /* NASCOM1_H_ */
diff --git a/src/mess/includes/nc.h b/src/mess/includes/nc.h
index 31cca7f8614..c8a67767065 100644
--- a/src/mess/includes/nc.h
+++ b/src/mess/includes/nc.h
@@ -83,6 +83,14 @@ public:
TIMER_CALLBACK_MEMBER(nc_keyboard_timer_callback);
TIMER_CALLBACK_MEMBER(nc_serial_timer_callback);
TIMER_DEVICE_CALLBACK_MEMBER(dummy_timer_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc100_tc8521_alarm_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc100_txrdy_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc100_rxrdy_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc100_centronics_ack_w);
+ DECLARE_WRITE_LINE_MEMBER(nc200_centronics_ack_w);
+ DECLARE_WRITE_LINE_MEMBER(nc200_txrdy_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc200_rxrdy_callback);
+ DECLARE_WRITE_LINE_MEMBER(nc200_fdc_interrupt);
};
diff --git a/src/mess/includes/nes.h b/src/mess/includes/nes.h
index d8f742d5428..84428cbd928 100644
--- a/src/mess/includes/nes.h
+++ b/src/mess/includes/nes.h
@@ -126,6 +126,9 @@ public:
UINT32 screen_update_nes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(nes_irq_callback);
TIMER_CALLBACK_MEMBER(lightgun_tick);
+ DECLARE_READ8_MEMBER(psg_4015_r);
+ DECLARE_WRITE8_MEMBER(psg_4015_w);
+ DECLARE_WRITE8_MEMBER(psg_4017_w);
};
/*----------- defined in machine/nes.c -----------*/
diff --git a/src/mess/includes/ob68k1a.h b/src/mess/includes/ob68k1a.h
index 200090b50b1..162aef29aa1 100644
--- a/src/mess/includes/ob68k1a.h
+++ b/src/mess/includes/ob68k1a.h
@@ -41,6 +41,8 @@ public:
DECLARE_WRITE8_MEMBER( com8116_w );
DECLARE_READ8_MEMBER( pia_r );
DECLARE_WRITE8_MEMBER( pia_w );
+ DECLARE_WRITE_LINE_MEMBER(rx_tx_0_w);
+ DECLARE_WRITE_LINE_MEMBER(rx_tx_1_w);
};
#endif
diff --git a/src/mess/includes/oric.h b/src/mess/includes/oric.h
index d8b4243fd7f..f0fd45d1005 100644
--- a/src/mess/includes/oric.h
+++ b/src/mess/includes/oric.h
@@ -110,6 +110,23 @@ public:
UINT32 screen_update_oric(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(oric_refresh_tape);
TIMER_CALLBACK_MEMBER(oric_vh_timer_callback);
+ DECLARE_READ8_MEMBER(oric_via_in_a_func);
+ DECLARE_READ8_MEMBER(oric_via_in_b_func);
+ DECLARE_WRITE8_MEMBER(oric_via_out_a_func);
+ DECLARE_WRITE8_MEMBER(oric_via_out_b_func);
+ DECLARE_READ8_MEMBER(oric_via_in_ca2_func);
+ DECLARE_READ8_MEMBER(oric_via_in_cb2_func);
+ DECLARE_WRITE8_MEMBER(oric_via_out_ca2_func);
+ DECLARE_WRITE8_MEMBER(oric_via_out_cb2_func);
+ DECLARE_WRITE_LINE_MEMBER(oric_jasmin_wd179x_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(oric_microdisc_wd179x_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(oric_microdisc_wd179x_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(oric_wd179x_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(oric_wd179x_drq_w);
+ DECLARE_READ8_MEMBER(telestrat_via2_in_a_func);
+ DECLARE_WRITE8_MEMBER(telestrat_via2_out_a_func);
+ DECLARE_READ8_MEMBER(telestrat_via2_in_b_func);
+ DECLARE_WRITE8_MEMBER(telestrat_via2_out_b_func);
};
/*----------- defined in machine/oric.c -----------*/
diff --git a/src/mess/includes/orion.h b/src/mess/includes/orion.h
index 758736b82f7..bd90f177f7c 100644
--- a/src/mess/includes/orion.h
+++ b/src/mess/includes/orion.h
@@ -64,6 +64,9 @@ public:
DECLARE_MACHINE_RESET(orionpro);
UINT32 screen_update_orion128(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(orionz80_interrupt);
+ DECLARE_READ8_MEMBER(orion_romdisk_porta_r);
+ DECLARE_WRITE8_MEMBER(orion_romdisk_portb_w);
+ DECLARE_WRITE8_MEMBER(orion_romdisk_portc_w);
};
/*----------- defined in machine/orion.c -----------*/
diff --git a/src/mess/includes/osi.h b/src/mess/includes/osi.h
index 4a8395225e1..d2d7734e778 100644
--- a/src/mess/includes/osi.h
+++ b/src/mess/includes/osi.h
@@ -65,6 +65,7 @@ public:
/* floppy state */
int m_fdc_index;
TIMER_CALLBACK_MEMBER(setup_beep);
+ DECLARE_WRITE_LINE_MEMBER(osi470_index_callback);
};
class c1p_state : public sb2m600_state
diff --git a/src/mess/includes/partner.h b/src/mess/includes/partner.h
index 2bf59dec2ce..b9087e8af4d 100644
--- a/src/mess/includes/partner.h
+++ b/src/mess/includes/partner.h
@@ -26,6 +26,8 @@ public:
DECLARE_DRIVER_INIT(partner);
DECLARE_MACHINE_START(partner);
DECLARE_MACHINE_RESET(partner);
+ DECLARE_WRITE_LINE_MEMBER(partner_wd17xx_drq_w);
+ DECLARE_WRITE_LINE_MEMBER(hrq_w);
};
diff --git a/src/mess/includes/pc.h b/src/mess/includes/pc.h
index 014c6daaeee..86d2393514d 100644
--- a/src/mess/includes/pc.h
+++ b/src/mess/includes/pc.h
@@ -91,6 +91,41 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(pc_frame_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(pc_vga_frame_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(pcjr_frame_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(pc_dma_hrq_changed);
+ DECLARE_READ8_MEMBER(pc_dma8237_fdc_dack_r);
+ DECLARE_READ8_MEMBER(pc_dma8237_hdc_dack_r);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_fdc_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_hdc_dack_w);
+ DECLARE_WRITE8_MEMBER(pc_dma8237_0_dack_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dma8237_out_eop);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack0_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack1_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack2_w);
+ DECLARE_WRITE_LINE_MEMBER(pc_dack3_w);
+ DECLARE_WRITE_LINE_MEMBER(pcjr_pic8259_set_int_line);
+ DECLARE_WRITE_LINE_MEMBER(ibm5150_pit8253_out1_changed);
+ DECLARE_WRITE_LINE_MEMBER(ibm5150_pit8253_out2_changed);
+ DECLARE_WRITE_LINE_MEMBER(pc_com_interrupt_1);
+ DECLARE_WRITE_LINE_MEMBER(pc_com_interrupt_2);
+ DECLARE_READ8_MEMBER(ibm5160_ppi_porta_r);
+ DECLARE_READ8_MEMBER(ibm5160_ppi_portc_r);
+ DECLARE_WRITE8_MEMBER(ibm5160_ppi_portb_w);
+ DECLARE_READ8_MEMBER(pc_ppi_porta_r);
+ DECLARE_WRITE8_MEMBER(pc_ppi_portb_w);
+ DECLARE_READ8_MEMBER(mc1502_ppi_porta_r);
+ DECLARE_WRITE8_MEMBER(mc1502_ppi_porta_w);
+ DECLARE_WRITE8_MEMBER(mc1502_ppi_portb_w);
+ DECLARE_READ8_MEMBER(mc1502_ppi_portc_r);
+ DECLARE_READ8_MEMBER(mc1502_kppi_porta_r);
+ DECLARE_WRITE8_MEMBER(mc1502_kppi_portb_w);
+ DECLARE_WRITE8_MEMBER(mc1502_kppi_portc_w);
+ DECLARE_WRITE8_MEMBER(pcjr_ppi_portb_w);
+ DECLARE_READ8_MEMBER(pcjr_ppi_porta_r);
+ DECLARE_READ8_MEMBER(pcjr_ppi_portc_r);
+ DECLARE_READ8_MEMBER(mc1502_wd17xx_aux_r);
+ DECLARE_WRITE8_MEMBER(mc1502_wd17xx_aux_w);
+ DECLARE_READ8_MEMBER(mc1502_wd17xx_drq_r);
+ DECLARE_READ8_MEMBER(mc1502_wd17xx_motor_r);
};
/*----------- defined in machine/pc.c -----------*/
@@ -117,12 +152,6 @@ void pc_speaker_set_input(running_machine &machine, UINT8 data);
void mess_init_pc_common( running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int), void (*set_hdc_int_func)(running_machine &,int,int));
-
-DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r );
-DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r );
-DECLARE_READ8_DEVICE_HANDLER( mc1502_wd17xx_motor_r );
-DECLARE_WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w );
-
DEVICE_IMAGE_LOAD( pcjr_cartridge );
void pc_rtc_init(running_machine &machine);
diff --git a/src/mess/includes/pce.h b/src/mess/includes/pce.h
index 8242b1c490d..ee900155afb 100644
--- a/src/mess/includes/pce.h
+++ b/src/mess/includes/pce.h
@@ -149,6 +149,7 @@ public:
TIMER_CALLBACK_MEMBER(pce_cd_adpcm_fadein_callback);
TIMER_CALLBACK_MEMBER(pce_cd_clear_ack);
TIMER_CALLBACK_MEMBER(pce_cd_adpcm_dma_timer_callback);
+ DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);
};
diff --git a/src/mess/includes/pcw.h b/src/mess/includes/pcw.h
index 64d04ee53c1..45d44b9e3a0 100644
--- a/src/mess/includes/pcw.h
+++ b/src/mess/includes/pcw.h
@@ -106,6 +106,7 @@ public:
TIMER_CALLBACK_MEMBER(pcw_pins_callback);
TIMER_CALLBACK_MEMBER(setup_beep);
TIMER_DEVICE_CALLBACK_MEMBER(pcw_timer_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(pcw_fdc_interrupt);
};
#endif /* PCW_H_ */
diff --git a/src/mess/includes/pcw16.h b/src/mess/includes/pcw16.h
index 578999e2d6e..16950bbe03e 100644
--- a/src/mess/includes/pcw16.h
+++ b/src/mess/includes/pcw16.h
@@ -101,6 +101,14 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(pcw16_timer_callback);
TIMER_DEVICE_CALLBACK_MEMBER(pcw16_keyboard_timer_callback);
TIMER_DEVICE_CALLBACK_MEMBER(rtc_timer_callback);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_interrupt_1);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_interrupt_2);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_tx_0);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_dtr_0);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_rts_0);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_tx_1);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_dtr_1);
+ DECLARE_WRITE_LINE_MEMBER(pcw16_com_rts_1);
};
#endif /* PCW16_H_ */
diff --git a/src/mess/includes/pecom.h b/src/mess/includes/pecom.h
index e5c351c69c0..e5e9f1cbaac 100644
--- a/src/mess/includes/pecom.h
+++ b/src/mess/includes/pecom.h
@@ -41,6 +41,10 @@ public:
DECLARE_VIDEO_START(pecom);
DECLARE_INPUT_CHANGED_MEMBER(ef_w);
TIMER_CALLBACK_MEMBER(reset_tick);
+ DECLARE_READ_LINE_MEMBER(clear_r);
+ DECLARE_READ_LINE_MEMBER(ef2_r);
+ DECLARE_WRITE_LINE_MEMBER(pecom64_q_w);
+ DECLARE_WRITE_LINE_MEMBER(pecom_prd_w);
};
/*----------- defined in machine/pecom.c -----------*/
diff --git a/src/mess/includes/pes.h b/src/mess/includes/pes.h
index 30b5543a395..d40925eb734 100644
--- a/src/mess/includes/pes.h
+++ b/src/mess/includes/pes.h
@@ -39,6 +39,7 @@ public:
DECLARE_READ8_MEMBER(port1_r);
DECLARE_READ8_MEMBER(port3_r);
DECLARE_DRIVER_INIT(pes);
+ DECLARE_WRITE8_MEMBER(pes_kbd_input);
};
diff --git a/src/mess/includes/pet.h b/src/mess/includes/pet.h
index 5bfb40bede5..109dce90551 100644
--- a/src/mess/includes/pet.h
+++ b/src/mess/includes/pet.h
@@ -60,6 +60,20 @@ public:
TIMER_CALLBACK_MEMBER(pet_interrupt);
TIMER_CALLBACK_MEMBER(pet_tape1_timer);
TIMER_CALLBACK_MEMBER(pet_tape2_timer);
+ DECLARE_READ8_MEMBER(pia0_pa_r);
+ DECLARE_WRITE8_MEMBER(pia0_pa_w);
+ DECLARE_READ8_MEMBER(kin_r);
+ DECLARE_READ8_MEMBER(petb_kin_r);
+ DECLARE_READ8_MEMBER(cass1_r);
+ DECLARE_WRITE8_MEMBER(cass1_motor_w);
+ DECLARE_WRITE_LINE_MEMBER(pia0_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(pia1_irq_w);
+ DECLARE_READ8_MEMBER(via_pb_r);
+ DECLARE_READ_LINE_MEMBER(cass2_r);
+ DECLARE_WRITE8_MEMBER(via_pb_w);
+ DECLARE_WRITE_LINE_MEMBER(gb_w);
+ DECLARE_WRITE_LINE_MEMBER(via_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(pet_display_enable_changed);
};
/*----------- defined in video/pet.c -----------*/
@@ -71,7 +85,6 @@ void superpet_vh_init (running_machine &machine);
MC6845_UPDATE_ROW( pet40_update_row );
MC6845_UPDATE_ROW( pet80_update_row );
-WRITE_LINE_DEVICE_HANDLER( pet_display_enable_changed );
/*----------- defined in machine/pet.c -----------*/
diff --git a/src/mess/includes/pk8020.h b/src/mess/includes/pk8020.h
index b9f00b52963..9921942f938 100644
--- a/src/mess/includes/pk8020.h
+++ b/src/mess/includes/pk8020.h
@@ -46,6 +46,14 @@ public:
virtual void palette_init();
UINT32 screen_update_pk8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pk8020_interrupt);
+ DECLARE_READ8_MEMBER(pk8020_porta_r);
+ DECLARE_WRITE8_MEMBER(pk8020_portc_w);
+ DECLARE_WRITE8_MEMBER(pk8020_portb_w);
+ DECLARE_READ8_MEMBER(pk8020_portc_r);
+ DECLARE_WRITE8_MEMBER(pk8020_2_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(pk8020_pit_out0);
+ DECLARE_WRITE_LINE_MEMBER(pk8020_pit_out1);
+ DECLARE_WRITE_LINE_MEMBER(pk8020_pic_set_int_line);
};
diff --git a/src/mess/includes/pmd85.h b/src/mess/includes/pmd85.h
index ab0120e2df8..1f1d5f91203 100644
--- a/src/mess/includes/pmd85.h
+++ b/src/mess/includes/pmd85.h
@@ -43,6 +43,33 @@ public:
TIMER_CALLBACK_MEMBER(pmd85_cassette_timer_callback);
TIMER_CALLBACK_MEMBER(pmd_reset);
TIMER_CALLBACK_MEMBER(setup_machine_state);
+ DECLARE_READ8_MEMBER(pmd85_ppi_0_porta_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_0_portb_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_0_portc_r);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_0_porta_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_0_portb_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_0_portc_w);
+ DECLARE_READ8_MEMBER(mato_ppi_0_portb_r);
+ DECLARE_READ8_MEMBER(mato_ppi_0_portc_r);
+ DECLARE_WRITE8_MEMBER(mato_ppi_0_portc_w);
+ DECLARE_READ8_MEMBER(pmd85_ppi_1_porta_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_1_portb_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_1_portc_r);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_1_porta_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_1_portb_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_1_portc_w);
+ DECLARE_READ8_MEMBER(pmd85_ppi_2_porta_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_2_portb_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_2_portc_r);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_2_porta_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_2_portb_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_2_portc_w);
+ DECLARE_READ8_MEMBER(pmd85_ppi_3_porta_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_3_portb_r);
+ DECLARE_READ8_MEMBER(pmd85_ppi_3_portc_r);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_3_porta_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_3_portb_w);
+ DECLARE_WRITE8_MEMBER(pmd85_ppi_3_portc_w);
};
diff --git a/src/mess/includes/pokemini.h b/src/mess/includes/pokemini.h
index 71202ba6b46..8a1dccfbdbb 100644
--- a/src/mess/includes/pokemini.h
+++ b/src/mess/includes/pokemini.h
@@ -73,14 +73,12 @@ public:
TIMER_CALLBACK_MEMBER(pokemini_timer3_callback);
TIMER_CALLBACK_MEMBER(pokemini_timer3_hi_callback);
TIMER_CALLBACK_MEMBER(pokemini_prc_counter_callback);
+ DECLARE_WRITE8_MEMBER(pokemini_hwreg_w);
+ DECLARE_READ8_MEMBER(pokemini_hwreg_r);
};
/*----------- defined in machine/pokemini.c -----------*/
-
-DECLARE_WRITE8_DEVICE_HANDLER( pokemini_hwreg_w );
-DECLARE_READ8_DEVICE_HANDLER( pokemini_hwreg_r );
-
DEVICE_IMAGE_LOAD( pokemini_cart );
#endif /* POKEMINI_H */
diff --git a/src/mess/includes/poly88.h b/src/mess/includes/poly88.h
index 87822084b78..f668bae14b3 100644
--- a/src/mess/includes/poly88.h
+++ b/src/mess/includes/poly88.h
@@ -39,6 +39,7 @@ public:
TIMER_CALLBACK_MEMBER(keyboard_callback);
TIMER_CALLBACK_MEMBER(poly88_cassette_timer_callback);
TIMER_CALLBACK_MEMBER(setup_machine_state);
+ DECLARE_WRITE_LINE_MEMBER(poly88_usart_rxready);
};
diff --git a/src/mess/includes/portfoli.h b/src/mess/includes/portfoli.h
index ef05b8e1851..ba5655bab65 100644
--- a/src/mess/includes/portfoli.h
+++ b/src/mess/includes/portfoli.h
@@ -88,6 +88,7 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
+ DECLARE_READ8_MEMBER(hd61830_rd_r);
};
#endif
diff --git a/src/mess/includes/pp01.h b/src/mess/includes/pp01.h
index 6345d44fa49..b4a6e9fdc14 100644
--- a/src/mess/includes/pp01.h
+++ b/src/mess/includes/pp01.h
@@ -34,6 +34,14 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(pp01_pit_out0);
+ DECLARE_WRITE_LINE_MEMBER(pp01_pit_out1);
+ DECLARE_READ8_MEMBER(pp01_8255_porta_r);
+ DECLARE_WRITE8_MEMBER(pp01_8255_porta_w);
+ DECLARE_READ8_MEMBER(pp01_8255_portb_r);
+ DECLARE_WRITE8_MEMBER(pp01_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(pp01_8255_portc_w);
+ DECLARE_READ8_MEMBER(pp01_8255_portc_r);
};
diff --git a/src/mess/includes/ql.h b/src/mess/includes/ql.h
index 98b785a351a..9684023d737 100644
--- a/src/mess/includes/ql.h
+++ b/src/mess/includes/ql.h
@@ -133,6 +133,9 @@ public:
int m_disk_io_base;
UINT8 m_disk_io_byte;
UINT8 m_printer_char;
+ DECLARE_READ_LINE_MEMBER(disk_io_dden_r);
+ DECLARE_WRITE_LINE_MEMBER(disk_io_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(disk_io_drq_w);
};
#endif
diff --git a/src/mess/includes/radio86.h b/src/mess/includes/radio86.h
index e4696b3adfd..7dfbc48fed7 100644
--- a/src/mess/includes/radio86.h
+++ b/src/mess/includes/radio86.h
@@ -40,6 +40,16 @@ public:
DECLARE_PALETTE_INIT(radio86);
UINT32 screen_update_radio86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(radio86_reset);
+ DECLARE_READ8_MEMBER(radio86_8255_portb_r2);
+ DECLARE_READ8_MEMBER(radio86_8255_portc_r2);
+ DECLARE_WRITE8_MEMBER(radio86_8255_porta_w2);
+ DECLARE_WRITE8_MEMBER(radio86_8255_portc_w2);
+ DECLARE_READ8_MEMBER(rk7007_8255_portc_r);
+ DECLARE_WRITE_LINE_MEMBER(hrq_w);
+ DECLARE_READ8_MEMBER(radio86_romdisk_porta_r);
+ DECLARE_WRITE8_MEMBER(radio86_romdisk_portb_w);
+ DECLARE_WRITE8_MEMBER(radio86_romdisk_portc_w);
+ DECLARE_WRITE8_MEMBER(mikrosha_8255_font_page_w);
};
diff --git a/src/mess/includes/rmnimbus.h b/src/mess/includes/rmnimbus.h
index a90f54ba636..e55057e0b2f 100644
--- a/src/mess/includes/rmnimbus.h
+++ b/src/mess/includes/rmnimbus.h
@@ -232,6 +232,16 @@ public:
TIMER_CALLBACK_MEMBER(dma_timer_callback);
TIMER_CALLBACK_MEMBER(keyscan_callback);
TIMER_CALLBACK_MEMBER(mouse_callback);
+ DECLARE_WRITE_LINE_MEMBER(sio_interrupt);
+ DECLARE_WRITE8_MEMBER(sio_dtr_w);
+ DECLARE_WRITE16_MEMBER(sio_serial_transmit);
+ DECLARE_READ16_MEMBER(sio_serial_receive);
+ DECLARE_WRITE_LINE_MEMBER(nimbus_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(nimbus_fdc_drq_w);
+ DECLARE_READ8_MEMBER(nimbus_via_read_portb);
+ DECLARE_WRITE8_MEMBER(nimbus_via_write_portb);
+ DECLARE_WRITE_LINE_MEMBER(nimbus_via_irq_w);
+ DECLARE_WRITE_LINE_MEMBER(nimbus_ack_w);
};
@@ -435,8 +445,6 @@ enum
extern const via6522_interface nimbus_via;
-WRITE_LINE_DEVICE_HANDLER(nimbus_ack_w);
-
/*----------- defined in video/rmnimbus.c -----------*/
diff --git a/src/mess/includes/samcoupe.h b/src/mess/includes/samcoupe.h
index 04e66933eae..3fd214317e6 100644
--- a/src/mess/includes/samcoupe.h
+++ b/src/mess/includes/samcoupe.h
@@ -86,6 +86,12 @@ public:
TIMER_CALLBACK_MEMBER(irq_off);
TIMER_CALLBACK_MEMBER(samcoupe_mouse_reset);
TIMER_CALLBACK_MEMBER(sam_video_update_callback);
+ DECLARE_READ8_MEMBER(samcoupe_lpt1_busy_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_lpt1_strobe_w);
+ DECLARE_READ8_MEMBER(samcoupe_lpt2_busy_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_lpt2_strobe_w);
+ DECLARE_READ8_MEMBER(samcoupe_rtc_r);
+ DECLARE_WRITE8_MEMBER(samcoupe_rtc_w);
};
diff --git a/src/mess/includes/sg1000.h b/src/mess/includes/sg1000.h
index bae777db184..fe91d092c5c 100644
--- a/src/mess/includes/sg1000.h
+++ b/src/mess/includes/sg1000.h
@@ -73,6 +73,7 @@ public:
/* TV Draw state */
UINT8 m_tvdraw_data;
TIMER_CALLBACK_MEMBER(lightgun_tick);
+ DECLARE_WRITE_LINE_MEMBER(sg1000_vdp_interrupt);
};
class sc3000_state : public sg1000_state
@@ -114,6 +115,7 @@ public:
DECLARE_READ8_MEMBER( ppi_pa_r );
DECLARE_WRITE8_MEMBER( ppi_pc_w );
DECLARE_WRITE_LINE_MEMBER( fdc_intrq_w );
+ DECLARE_WRITE_LINE_MEMBER(sf7000_fdc_index_callback);
/* floppy state */
int m_fdc_irq;
diff --git a/src/mess/includes/sms.h b/src/mess/includes/sms.h
index 11c280bb845..c4d32f0caf5 100644
--- a/src/mess/includes/sms.h
+++ b/src/mess/includes/sms.h
@@ -190,16 +190,14 @@ public:
TIMER_CALLBACK_MEMBER(lightgun_tick);
TIMER_CALLBACK_MEMBER(lphaser_1_callback);
TIMER_CALLBACK_MEMBER(lphaser_2_callback);
+ DECLARE_WRITE_LINE_MEMBER(sms_int_callback);
+ DECLARE_WRITE_LINE_MEMBER(sms_pause_callback);
+ DECLARE_WRITE_LINE_MEMBER(sms_store_int_callback);
};
/*----------- defined in machine/sms.c -----------*/
-/* Function prototypes */
-
-WRITE_LINE_DEVICE_HANDLER( sms_pause_callback );
-WRITE_LINE_DEVICE_HANDLER( sms_store_int_callback );
-
DEVICE_START( sms_cart );
DEVICE_IMAGE_LOAD( sms_cart );
diff --git a/src/mess/includes/ssystem3.h b/src/mess/includes/ssystem3.h
index 8f33f01c44d..17181e43c4d 100644
--- a/src/mess/includes/ssystem3.h
+++ b/src/mess/includes/ssystem3.h
@@ -48,6 +48,10 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_ssystem3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(ssystem3_via_write_a);
+ DECLARE_READ8_MEMBER(ssystem3_via_read_a);
+ DECLARE_READ8_MEMBER(ssystem3_via_read_b);
+ DECLARE_WRITE8_MEMBER(ssystem3_via_write_b);
};
diff --git a/src/mess/includes/super6.h b/src/mess/includes/super6.h
index 3bd3c81ba79..b2aaf140c0e 100644
--- a/src/mess/includes/super6.h
+++ b/src/mess/includes/super6.h
@@ -78,6 +78,7 @@ public:
UINT8 m_bank0;
UINT8 m_bank1;
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
+ DECLARE_WRITE8_MEMBER(dummy_w);
};
#endif
diff --git a/src/mess/includes/super80.h b/src/mess/includes/super80.h
index ca42d0ab7a1..070628646d8 100644
--- a/src/mess/includes/super80.h
+++ b/src/mess/includes/super80.h
@@ -89,6 +89,7 @@ public:
TIMER_CALLBACK_MEMBER(super80_timer);
TIMER_CALLBACK_MEMBER(super80_reset);
TIMER_CALLBACK_MEMBER(super80_halfspeed);
+ DECLARE_READ8_MEMBER(pio_port_b_r);
};
diff --git a/src/mess/includes/svi318.h b/src/mess/includes/svi318.h
index f9f91e9823f..e9c52191cd8 100644
--- a/src/mess/includes/svi318.h
+++ b/src/mess/includes/svi318.h
@@ -75,6 +75,13 @@ public:
DECLARE_MACHINE_RESET(svi328_806);
DECLARE_VIDEO_START(svi328_806);
DECLARE_MACHINE_START(svi318_ntsc);
+ DECLARE_WRITE_LINE_MEMBER(vdp_interrupt);
+ DECLARE_WRITE_LINE_MEMBER(svi318_ins8250_interrupt);
+ DECLARE_READ8_MEMBER(svi318_ppi_port_a_r);
+ DECLARE_READ8_MEMBER(svi318_ppi_port_b_r);
+ DECLARE_WRITE8_MEMBER(svi318_ppi_port_c_w);
+ DECLARE_WRITE_LINE_MEMBER(svi_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(svi_fdc_drq_w);
};
diff --git a/src/mess/includes/sym1.h b/src/mess/includes/sym1.h
index f4cd88613d7..a9d2f0e3d33 100644
--- a/src/mess/includes/sym1.h
+++ b/src/mess/includes/sym1.h
@@ -42,6 +42,19 @@ public:
DECLARE_DRIVER_INIT(sym1);
virtual void machine_reset();
TIMER_CALLBACK_MEMBER(led_refresh);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_0_w);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_1_w);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_2_w);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_3_w);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_4_w);
+ DECLARE_WRITE_LINE_MEMBER(sym1_74145_output_5_w);
+ DECLARE_READ8_MEMBER(sym1_riot_a_r);
+ DECLARE_READ8_MEMBER(sym1_riot_b_r);
+ DECLARE_WRITE8_MEMBER(sym1_riot_a_w);
+ DECLARE_WRITE8_MEMBER(sym1_riot_b_w);
+ DECLARE_READ8_MEMBER(sym1_via0_b_r);
+ DECLARE_WRITE8_MEMBER(sym1_via0_b_w);
+ DECLARE_WRITE8_MEMBER(sym1_via2_a_w);
};
/*----------- defined in machine/sym1.c -----------*/
diff --git a/src/mess/includes/tandy2k.h b/src/mess/includes/tandy2k.h
index f835590f879..726b6f36beb 100644
--- a/src/mess/includes/tandy2k.h
+++ b/src/mess/includes/tandy2k.h
@@ -136,6 +136,8 @@ public:
/* sound state */
int m_outspkr;
int m_spkrdata;
+ DECLARE_READ8_MEMBER(fldtc_r);
+ DECLARE_WRITE8_MEMBER(fldtc_w);
};
#endif
diff --git a/src/mess/includes/trs80.h b/src/mess/includes/trs80.h
index fab02d71e2c..d711b43168b 100644
--- a/src/mess/includes/trs80.h
+++ b/src/mess/includes/trs80.h
@@ -125,6 +125,7 @@ public:
INTERRUPT_GEN_MEMBER(trs80_rtc_interrupt);
INTERRUPT_GEN_MEMBER(trs80_fdc_interrupt);
TIMER_CALLBACK_MEMBER(cassette_data_callback);
+ DECLARE_WRITE_LINE_MEMBER(trs80_fdc_intrq_w);
};
diff --git a/src/mess/includes/tsispch.h b/src/mess/includes/tsispch.h
index 1437cb2b36e..e135f8a4c9a 100644
--- a/src/mess/includes/tsispch.h
+++ b/src/mess/includes/tsispch.h
@@ -43,6 +43,10 @@ public:
DECLARE_READ16_MEMBER(dsp_status_r);
DECLARE_WRITE16_MEMBER(dsp_status_w);
DECLARE_DRIVER_INIT(prose2k);
+ DECLARE_WRITE_LINE_MEMBER(i8251_rxrdy_int);
+ DECLARE_WRITE_LINE_MEMBER(i8251_txempty_int);
+ DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
+ DECLARE_WRITE_LINE_MEMBER(pic8259_set_int_line);
};
diff --git a/src/mess/includes/v1050.h b/src/mess/includes/v1050.h
index 00057b72588..b9eb4dfe402 100644
--- a/src/mess/includes/v1050.h
+++ b/src/mess/includes/v1050.h
@@ -162,6 +162,11 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(sasi_rst_tick);
TIMER_DEVICE_CALLBACK_MEMBER(kb_8251_tick);
TIMER_DEVICE_CALLBACK_MEMBER(sio_8251_tick);
+ DECLARE_WRITE_LINE_MEMBER(pic_int_w);
+ DECLARE_WRITE8_MEMBER(disp_ppi_pc_w);
+ DECLARE_WRITE8_MEMBER(m6502_ppi_pc_w);
+ DECLARE_WRITE8_MEMBER(misc_ppi_pb_w);
+ DECLARE_READ8_MEMBER(misc_ppi_pc_r);
};
//----------- defined in video/v1050.c -----------
diff --git a/src/mess/includes/victor9k.h b/src/mess/includes/victor9k.h
index 75d85c0c31f..7587ccb8ad5 100644
--- a/src/mess/includes/victor9k.h
+++ b/src/mess/includes/victor9k.h
@@ -125,6 +125,8 @@ public:
int m_se[2]; /* stepper enable */
int m_drive; /* selected drive */
int m_side; /* selected side */
+ DECLARE_WRITE_LINE_MEMBER(mux_serial_b_w);
+ DECLARE_WRITE_LINE_MEMBER(mux_serial_a_w);
};
#endif
diff --git a/src/mess/includes/x1.h b/src/mess/includes/x1.h
index 025b20ad4c9..63152f11fc2 100644
--- a/src/mess/includes/x1.h
+++ b/src/mess/includes/x1.h
@@ -205,6 +205,7 @@ public:
TIMER_CALLBACK_MEMBER(x1_rtc_increment);
TIMER_DEVICE_CALLBACK_MEMBER(x1_cmt_wind_timer);
TIMER_DEVICE_CALLBACK_MEMBER(x1_keyboard_callback);
+ DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
};
/*----------- defined in machine/x1.c -----------*/
diff --git a/src/mess/includes/x68k.h b/src/mess/includes/x68k.h
index d320f2ffd8c..66222e76b36 100644
--- a/src/mess/includes/x68k.h
+++ b/src/mess/includes/x68k.h
@@ -285,6 +285,18 @@ public:
TIMER_CALLBACK_MEMBER(x68k_crtc_raster_end);
TIMER_CALLBACK_MEMBER(x68k_crtc_raster_irq);
TIMER_CALLBACK_MEMBER(x68k_crtc_vblank_irq);
+ DECLARE_READ8_MEMBER(ppi_port_a_r);
+ DECLARE_READ8_MEMBER(ppi_port_b_r);
+ DECLARE_READ8_MEMBER(ppi_port_c_r);
+ DECLARE_WRITE8_MEMBER(ppi_port_c_w);
+ DECLARE_WRITE_LINE_MEMBER(fdc_irq);
+ DECLARE_WRITE_LINE_MEMBER(fdc_drq);
+ DECLARE_WRITE8_MEMBER(x68k_ct_w);
+ DECLARE_WRITE_LINE_MEMBER(x68k_rtc_alarm_irq);
+ DECLARE_WRITE8_MEMBER(x68030_adpcm_w);
+ DECLARE_WRITE_LINE_MEMBER(mfp_irq_callback);
+ DECLARE_WRITE_LINE_MEMBER(x68k_scsi_irq);
+ DECLARE_WRITE_LINE_MEMBER(x68k_scsi_drq);
};
diff --git a/src/mess/includes/xerox820.h b/src/mess/includes/xerox820.h
index 606896eccaf..0bde6c7b9a9 100644
--- a/src/mess/includes/xerox820.h
+++ b/src/mess/includes/xerox820.h
@@ -85,6 +85,8 @@ public:
TIMER_CALLBACK_MEMBER(bigboard_beepoff);
TIMER_DEVICE_CALLBACK_MEMBER(xerox820_keyboard_tick);
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z0_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z2_w);
};
class xerox820ii_state : public xerox820_state
diff --git a/src/mess/includes/xor100.h b/src/mess/includes/xor100.h
index 904aa6e2379..162a2e83424 100644
--- a/src/mess/includes/xor100.h
+++ b/src/mess/includes/xor100.h
@@ -66,6 +66,13 @@ public:
int m_fdc_irq;
int m_fdc_drq;
int m_fdc_dden;
+ DECLARE_WRITE_LINE_MEMBER(com5016_fr_w);
+ DECLARE_WRITE_LINE_MEMBER(com5016_ft_w);
+ DECLARE_READ8_MEMBER(i8255_pc_r);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z0_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z1_w);
+ DECLARE_WRITE_LINE_MEMBER(ctc_z2_w);
+ DECLARE_WRITE8_MEMBER(xor100_kbd_put);
};
#endif
diff --git a/src/mess/includes/z80ne.h b/src/mess/includes/z80ne.h
index 2199b76e346..cead575a8f6 100644
--- a/src/mess/includes/z80ne.h
+++ b/src/mess/includes/z80ne.h
@@ -108,15 +108,11 @@ public:
DECLARE_INPUT_CHANGED_MEMBER(z80ne_nmi);
TIMER_CALLBACK_MEMBER(z80ne_cassette_tc);
TIMER_CALLBACK_MEMBER(z80ne_kbd_scan);
+ DECLARE_READ8_MEMBER(lx388_mc6847_videoram_r);
+ DECLARE_WRITE8_MEMBER(lx390_motor_w);
+ DECLARE_READ8_MEMBER(lx390_reset_bank);
+ DECLARE_READ8_MEMBER(lx390_fdc_r);
+ DECLARE_WRITE8_MEMBER(lx390_fdc_w);
};
-
-/*----------- defined in machine/z80ne.c -----------*/
-
-DECLARE_READ8_DEVICE_HANDLER(lx388_mc6847_videoram_r);
-DECLARE_READ8_DEVICE_HANDLER(lx390_fdc_r);
-DECLARE_WRITE8_DEVICE_HANDLER(lx390_fdc_w);
-DECLARE_READ8_DEVICE_HANDLER(lx390_reset_bank);
-DECLARE_WRITE8_DEVICE_HANDLER(lx390_motor_w);
-
#endif /* Z80NE_H_ */
diff --git a/src/mess/machine/a7800.c b/src/mess/machine/a7800.c
index c5a6c02a710..fac781aba5d 100644
--- a/src/mess/machine/a7800.c
+++ b/src/mess/machine/a7800.c
@@ -38,29 +38,28 @@
6532 RIOT
***************************************************************************/
-static READ8_DEVICE_HANDLER( riot_joystick_r )
+READ8_MEMBER(a7800_state::riot_joystick_r)
{
- return space.machine().root_device().ioport("joysticks")->read();
+ return machine().root_device().ioport("joysticks")->read();
}
-static READ8_DEVICE_HANDLER( riot_console_button_r )
+READ8_MEMBER(a7800_state::riot_console_button_r)
{
- return space.machine().root_device().ioport("console_buttons")->read();
+ return machine().root_device().ioport("console_buttons")->read();
}
-static WRITE8_DEVICE_HANDLER( riot_button_pullup_w )
+WRITE8_MEMBER(a7800_state::riot_button_pullup_w)
{
- a7800_state *state = space.machine().driver_data<a7800_state>();
- state->m_p1_one_button = data & 0x04; // pin 6 of the controller port is held high by the riot chip when reading two-button controllers (from schematic)
- state->m_p2_one_button = data & 0x10;
+ m_p1_one_button = data & 0x04; // pin 6 of the controller port is held high by the riot chip when reading two-button controllers (from schematic)
+ m_p2_one_button = data & 0x10;
}
const riot6532_interface a7800_r6532_interface =
{
- DEVCB_HANDLER(riot_joystick_r),
- DEVCB_HANDLER(riot_console_button_r),
+ DEVCB_DRIVER_MEMBER(a7800_state,riot_joystick_r),
+ DEVCB_DRIVER_MEMBER(a7800_state,riot_console_button_r),
DEVCB_NULL,
- DEVCB_HANDLER(riot_button_pullup_w),
+ DEVCB_DRIVER_MEMBER(a7800_state,riot_button_pullup_w),
DEVCB_NULL
};
diff --git a/src/mess/machine/ac1.c b/src/mess/machine/ac1.c
index 44826d279b1..a831d4b58cc 100644
--- a/src/mess/machine/ac1.c
+++ b/src/mess/machine/ac1.c
@@ -11,12 +11,11 @@
#include "imagedev/cassette.h"
#include "includes/ac1.h"
-static READ8_DEVICE_HANDLER (ac1_port_b_r)
+READ8_MEMBER(ac1_state::ac1_port_b_r)
{
- ac1_state *state = space.machine().driver_data<ac1_state>();
UINT8 data = 0x7f;
- if (state->m_cassette->input() > 0.03)
+ if (m_cassette->input() > 0.03)
data |= 0x80;
return data;
@@ -24,15 +23,15 @@ static READ8_DEVICE_HANDLER (ac1_port_b_r)
#define BNOT(x) ((x) ? 0 : 1)
-static READ8_DEVICE_HANDLER (ac1_port_a_r)
+READ8_MEMBER(ac1_state::ac1_port_a_r)
{
- UINT8 line0 = space.machine().root_device().ioport("LINE0")->read();
- UINT8 line1 = space.machine().root_device().ioport("LINE1")->read();
- UINT8 line2 = space.machine().root_device().ioport("LINE2")->read();
- UINT8 line3 = space.machine().root_device().ioport("LINE3")->read();
- UINT8 line4 = space.machine().root_device().ioport("LINE4")->read();
- UINT8 line5 = space.machine().root_device().ioport("LINE5")->read();
- UINT8 line6 = space.machine().root_device().ioport("LINE6")->read();
+ UINT8 line0 = machine().root_device().ioport("LINE0")->read();
+ UINT8 line1 = machine().root_device().ioport("LINE1")->read();
+ UINT8 line2 = machine().root_device().ioport("LINE2")->read();
+ UINT8 line3 = machine().root_device().ioport("LINE3")->read();
+ UINT8 line4 = machine().root_device().ioport("LINE4")->read();
+ UINT8 line5 = machine().root_device().ioport("LINE5")->read();
+ UINT8 line6 = machine().root_device().ioport("LINE6")->read();
UINT8 SH = BNOT(BIT(line6,0));
UINT8 CTRL = BNOT(BIT(line6,1));
@@ -74,11 +73,11 @@ static READ8_DEVICE_HANDLER (ac1_port_a_r)
return td0 + (td1 << 1) +(td2 << 2) +(td3 << 3) +(td4 << 4) +(td5 << 5) +(td6 << 6) +(tast << 7);
}
-static WRITE8_DEVICE_HANDLER (ac1_port_a_w)
+WRITE8_MEMBER(ac1_state::ac1_port_a_w)
{
}
-static WRITE8_DEVICE_HANDLER (ac1_port_b_w)
+WRITE8_MEMBER(ac1_state::ac1_port_b_w)
{
/*
@@ -94,18 +93,17 @@ static WRITE8_DEVICE_HANDLER (ac1_port_b_w)
7 cassette in
*/
- ac1_state *state = space.machine().driver_data<ac1_state>();
- state->m_cassette->output((data & 0x40) ? -1.0 : +1.0);
+ m_cassette->output((data & 0x40) ? -1.0 : +1.0);
}
Z80PIO_INTERFACE( ac1_z80pio_intf )
{
DEVCB_NULL, /* callback when change interrupt status */
- DEVCB_HANDLER(ac1_port_a_r),
- DEVCB_HANDLER(ac1_port_a_w),
+ DEVCB_DRIVER_MEMBER(ac1_state,ac1_port_a_r),
+ DEVCB_DRIVER_MEMBER(ac1_state,ac1_port_a_w),
DEVCB_NULL,
- DEVCB_HANDLER(ac1_port_b_r),
- DEVCB_HANDLER(ac1_port_b_w),
+ DEVCB_DRIVER_MEMBER(ac1_state,ac1_port_b_r),
+ DEVCB_DRIVER_MEMBER(ac1_state,ac1_port_b_w),
DEVCB_NULL
};
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index f0497f37588..14b9dbfeb2a 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -215,13 +215,12 @@ PALETTE_INIT_MEMBER(amstrad_state,amstrad_cpc_green)
}
-WRITE_LINE_DEVICE_HANDLER( aleste_interrupt )
+WRITE_LINE_MEMBER(amstrad_state::aleste_interrupt)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
if(state == CLEAR_LINE)
- drvstate->m_aleste_fdc_int = 0;
+ m_aleste_fdc_int = 0;
else
- drvstate->m_aleste_fdc_int = 1;
+ m_aleste_fdc_int = 1;
}
@@ -827,237 +826,231 @@ INLINE void amstrad_plus_update_video_sprites( running_machine &machine )
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_hsync_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_hsync_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_update_video(device->machine());
+ amstrad_update_video(machine());
/* The gate array reacts to de-assertion of the hsycnc 6845 line */
- if ( drvstate->m_gate_array.hsync && !state )
+ if ( m_gate_array.hsync && !state )
{
- drvstate->m_gate_array.hsync_counter++;
+ m_gate_array.hsync_counter++;
/* Advance to next drawing line */
- drvstate->m_gate_array.y++;
- drvstate->m_gate_array.line_ticks = 0;
- if ( drvstate->m_gate_array.y >= 0 && drvstate->m_gate_array.y < drvstate->m_gate_array.bitmap->height() )
+ m_gate_array.y++;
+ m_gate_array.line_ticks = 0;
+ if ( m_gate_array.y >= 0 && m_gate_array.y < m_gate_array.bitmap->height() )
{
- drvstate->m_gate_array.draw_p = &drvstate->m_gate_array.bitmap->pix16(drvstate->m_gate_array.y);
+ m_gate_array.draw_p = &m_gate_array.bitmap->pix16(m_gate_array.y);
}
else
{
- drvstate->m_gate_array.draw_p = NULL;
+ m_gate_array.draw_p = NULL;
}
- if ( drvstate->m_gate_array.hsync_after_vsync_counter != 0 ) // counters still operate regardless of PRI state
+ if ( m_gate_array.hsync_after_vsync_counter != 0 ) // counters still operate regardless of PRI state
{
- drvstate->m_gate_array.hsync_after_vsync_counter--;
+ m_gate_array.hsync_after_vsync_counter--;
- if (drvstate->m_gate_array.hsync_after_vsync_counter == 0)
+ if (m_gate_array.hsync_after_vsync_counter == 0)
{
- if (drvstate->m_gate_array.hsync_counter >= 32)
+ if (m_gate_array.hsync_counter >= 32)
{
- device->machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
- drvstate->m_gate_array.hsync_counter = 0;
+ m_gate_array.hsync_counter = 0;
}
}
- if ( drvstate->m_gate_array.hsync_counter >= 52 )
+ if ( m_gate_array.hsync_counter >= 52 )
{
- drvstate->m_gate_array.hsync_counter = 0;
- device->machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ m_gate_array.hsync_counter = 0;
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
}
- drvstate->m_gate_array.hsync = state ? 1 : 0;
+ m_gate_array.hsync = state ? 1 : 0;
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_plus_hsync_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_hsync_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_plus_update_video(device->machine());
+ amstrad_plus_update_video(machine());
- if ( drvstate->m_gate_array.hsync && !state )
+ if ( m_gate_array.hsync && !state )
{
- drvstate->m_gate_array.hsync_counter++;
+ m_gate_array.hsync_counter++;
/* Advance to next drawing line */
- drvstate->m_gate_array.y++;
- drvstate->m_gate_array.line_ticks = 0;
- if ( drvstate->m_gate_array.y >= 0 && drvstate->m_gate_array.y < drvstate->m_gate_array.bitmap->height() )
+ m_gate_array.y++;
+ m_gate_array.line_ticks = 0;
+ if ( m_gate_array.y >= 0 && m_gate_array.y < m_gate_array.bitmap->height() )
{
- drvstate->m_gate_array.draw_p = &drvstate->m_gate_array.bitmap->pix16(drvstate->m_gate_array.y);
+ m_gate_array.draw_p = &m_gate_array.bitmap->pix16(m_gate_array.y);
}
else
{
- drvstate->m_gate_array.draw_p = NULL;
+ m_gate_array.draw_p = NULL;
}
- if ( drvstate->m_gate_array.hsync_after_vsync_counter != 0 ) // counters still operate regardless of PRI state
+ if ( m_gate_array.hsync_after_vsync_counter != 0 ) // counters still operate regardless of PRI state
{
- drvstate->m_gate_array.hsync_after_vsync_counter--;
+ m_gate_array.hsync_after_vsync_counter--;
- if (drvstate->m_gate_array.hsync_after_vsync_counter == 0)
+ if (m_gate_array.hsync_after_vsync_counter == 0)
{
- if (drvstate->m_gate_array.hsync_counter >= 32)
+ if (m_gate_array.hsync_counter >= 32)
{
- if( drvstate->m_asic.pri == 0 || drvstate->m_asic.enabled == 0)
+ if( m_asic.pri == 0 || m_asic.enabled == 0)
{
- device->machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
}
- drvstate->m_gate_array.hsync_counter = 0;
+ m_gate_array.hsync_counter = 0;
}
}
- if ( drvstate->m_gate_array.hsync_counter >= 52 )
+ if ( m_gate_array.hsync_counter >= 52 )
{
- drvstate->m_gate_array.hsync_counter = 0;
- if ( drvstate->m_asic.pri == 0 || drvstate->m_asic.enabled == 0 )
+ m_gate_array.hsync_counter = 0;
+ if ( m_asic.pri == 0 || m_asic.enabled == 0 )
{
- device->machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
}
- if ( drvstate->m_asic.enabled )
+ if ( m_asic.enabled )
{
// CPC+/GX4000 Programmable Raster Interrupt (disabled if &6800 in ASIC RAM is 0)
- if ( drvstate->m_asic.pri != 0 )
+ if ( m_asic.pri != 0 )
{
- if ( drvstate->m_asic.pri == drvstate->m_asic.vpos - 1 )
+ if ( m_asic.pri == m_asic.vpos - 1 )
{
- logerror("PRI: triggered, scanline %d\n",drvstate->m_asic.pri);
- device->machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
- drvstate->m_plus_irq_cause = 0x06; // raster interrupt vector
- drvstate->m_gate_array.hsync_counter &= ~0x20; // ASIC PRI resets the MSB of the raster counter
+ logerror("PRI: triggered, scanline %d\n",m_asic.pri);
+ machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
+ m_plus_irq_cause = 0x06; // raster interrupt vector
+ m_gate_array.hsync_counter &= ~0x20; // ASIC PRI resets the MSB of the raster counter
}
}
// CPC+/GX4000 Split screen registers (disabled if &6801 in ASIC RAM is 0)
- if(drvstate->m_asic.ram[0x2801] != 0)
+ if(m_asic.ram[0x2801] != 0)
{
- if ( drvstate->m_asic.ram[0x2801] == drvstate->m_asic.vpos - 1 ) // split occurs here (hopefully)
+ if ( m_asic.ram[0x2801] == m_asic.vpos - 1 ) // split occurs here (hopefully)
{
- logerror("SSCR: Split screen occurred at scanline %d\n",drvstate->m_asic.ram[0x2801]);
+ logerror("SSCR: Split screen occurred at scanline %d\n",m_asic.ram[0x2801]);
}
}
// CPC+/GX4000 DMA channels
- amstrad_plus_handle_dma(device->machine()); // a DMA command is handled at the leading edge of HSYNC (every 64us)
- if(drvstate->m_asic.de_start != 0)
- drvstate->m_asic.vpos++;
+ amstrad_plus_handle_dma(machine()); // a DMA command is handled at the leading edge of HSYNC (every 64us)
+ if(m_asic.de_start != 0)
+ m_asic.vpos++;
}
}
- drvstate->m_gate_array.hsync = state ? 1 : 0;
+ m_gate_array.hsync = state ? 1 : 0;
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_vsync_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_vsync_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_update_video(device->machine());
+ amstrad_update_video(machine());
- if ( ! drvstate->m_gate_array.vsync && state )
+ if ( ! m_gate_array.vsync && state )
{
/* Reset the amstrad_CRTC_HS_After_VS_Counter */
- drvstate->m_gate_array.hsync_after_vsync_counter = 3;
+ m_gate_array.hsync_after_vsync_counter = 3;
/* Start of new frame */
- drvstate->m_gate_array.y = -1;
- drvstate->m_asic.vpos = 1;
- drvstate->m_asic.de_start = 0;
+ m_gate_array.y = -1;
+ m_asic.vpos = 1;
+ m_asic.de_start = 0;
}
- drvstate->m_gate_array.vsync = state ? 1 : 0;
+ m_gate_array.vsync = state ? 1 : 0;
/* Schedule a write to PC2 */
- device->machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),drvstate));
+ machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),this));
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_plus_vsync_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_vsync_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_plus_update_video(device->machine());
+ amstrad_plus_update_video(machine());
- if ( ! drvstate->m_gate_array.vsync && state )
+ if ( ! m_gate_array.vsync && state )
{
/* Reset the amstrad_CRTC_HS_After_VS_Counter */
- drvstate->m_gate_array.hsync_after_vsync_counter = 3;
+ m_gate_array.hsync_after_vsync_counter = 3;
/* Start of new frame */
- drvstate->m_gate_array.y = -1;
- drvstate->m_asic.vpos = 1;
- drvstate->m_asic.de_start = 0;
+ m_gate_array.y = -1;
+ m_asic.vpos = 1;
+ m_asic.de_start = 0;
}
- drvstate->m_gate_array.vsync = state ? 1 : 0;
+ m_gate_array.vsync = state ? 1 : 0;
/* Schedule a write to PC2 */
- device->machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),drvstate));
+ machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),this));
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_de_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_de_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_update_video(device->machine());
+ amstrad_update_video(machine());
- if ( ! drvstate->m_gate_array.de && state )
+ if ( ! m_gate_array.de && state )
{
/* DE became active, store the starting MA and RA signals */
- mc6845_device *mc6845 = drvstate->m_crtc;
+ mc6845_device *mc6845 = m_crtc;
- drvstate->m_gate_array.ma = mc6845->get_ma();
- drvstate->m_gate_array.ra = mc6845->get_ra();
-logerror("y = %d; ma = %02x; ra = %02x, address = %04x\n", drvstate->m_gate_array.y, drvstate->m_gate_array.ma, drvstate->m_gate_array.ra, ( ( drvstate->m_gate_array.ma & 0x3000 ) << 2 ) | ( ( drvstate->m_gate_array.ra & 0x07 ) << 11 ) | ( ( drvstate->m_gate_array.ma & 0x3ff ) << 1 ) );
- amstrad_gate_array_get_video_data(device->machine());
- drvstate->m_asic.de_start = 1;
+ m_gate_array.ma = mc6845->get_ma();
+ m_gate_array.ra = mc6845->get_ra();
+logerror("y = %d; ma = %02x; ra = %02x, address = %04x\n", m_gate_array.y, m_gate_array.ma, m_gate_array.ra, ( ( m_gate_array.ma & 0x3000 ) << 2 ) | ( ( m_gate_array.ra & 0x07 ) << 11 ) | ( ( m_gate_array.ma & 0x3ff ) << 1 ) );
+ amstrad_gate_array_get_video_data(machine());
+ m_asic.de_start = 1;
}
- drvstate->m_gate_array.de = state ? 1 : 0;
+ m_gate_array.de = state ? 1 : 0;
}
-static WRITE_LINE_DEVICE_HANDLER( amstrad_plus_de_changed )
+WRITE_LINE_MEMBER(amstrad_state::amstrad_plus_de_changed)
{
- amstrad_state *drvstate = device->machine().driver_data<amstrad_state>();
- amstrad_plus_update_video(device->machine());
+ amstrad_plus_update_video(machine());
- if ( ! drvstate->m_gate_array.de && state )
+ if ( ! m_gate_array.de && state )
{
/* DE became active, store the starting MA and RA signals */
- mc6845_device *mc6845 = drvstate->m_crtc;
+ mc6845_device *mc6845 = m_crtc;
- drvstate->m_gate_array.ma = mc6845->get_ma();
- drvstate->m_gate_array.ra = mc6845->get_ra();
- drvstate->m_asic.h_start = drvstate->m_gate_array.line_ticks;
- drvstate->m_asic.de_start = 1;
+ m_gate_array.ma = mc6845->get_ma();
+ m_gate_array.ra = mc6845->get_ra();
+ m_asic.h_start = m_gate_array.line_ticks;
+ m_asic.de_start = 1;
/* Start of screen */
- if ( drvstate->m_asic.vpos == 1 )
+ if ( m_asic.vpos == 1 )
{
- drvstate->m_asic.split_ma_base = 0x0000;
- drvstate->m_asic.split_ma_started = 0x0000;
+ m_asic.split_ma_base = 0x0000;
+ m_asic.split_ma_started = 0x0000;
}
/* Start of split screen section */
- else if ( drvstate->m_asic.enabled && drvstate->m_asic.ram[0x2801] != 0 && drvstate->m_asic.ram[0x2801] == drvstate->m_asic.vpos - 1 )
+ else if ( m_asic.enabled && m_asic.ram[0x2801] != 0 && m_asic.ram[0x2801] == m_asic.vpos - 1 )
{
- drvstate->m_asic.split_ma_started = drvstate->m_gate_array.ma;
- drvstate->m_asic.split_ma_base = ( drvstate->m_asic.ram[0x2802] << 8 ) | drvstate->m_asic.ram[0x2803];
+ m_asic.split_ma_started = m_gate_array.ma;
+ m_asic.split_ma_base = ( m_asic.ram[0x2802] << 8 ) | m_asic.ram[0x2803];
}
- drvstate->m_gate_array.colour = drvstate->m_asic.ram[0x2420] + ( drvstate->m_asic.ram[0x2421] << 8 );
- drvstate->m_asic.hscroll = drvstate->m_asic.ram[0x2804] & 0x0f;
+ m_gate_array.colour = m_asic.ram[0x2420] + ( m_asic.ram[0x2421] << 8 );
+ m_asic.hscroll = m_asic.ram[0x2804] & 0x0f;
- if ( drvstate->m_asic.hscroll == 0 )
- amstrad_plus_gate_array_get_video_data(device->machine());
+ if ( m_asic.hscroll == 0 )
+ amstrad_plus_gate_array_get_video_data(machine());
}
- if ( drvstate->m_gate_array.de && ! state )
+ if ( m_gate_array.de && ! state )
{
- drvstate->m_asic.h_end = drvstate->m_gate_array.line_ticks;
- amstrad_plus_update_video_sprites(device->machine());
+ m_asic.h_end = m_gate_array.line_ticks;
+ amstrad_plus_update_video_sprites(machine());
}
- drvstate->m_gate_array.de = state ? 1 : 0;
+ m_gate_array.de = state ? 1 : 0;
}
@@ -1086,10 +1079,10 @@ const mc6845_interface amstrad_mc6845_intf =
NULL, /* begin_update */
NULL, /* update_row */
NULL, /* end_update */
- DEVCB_LINE(amstrad_de_changed), /* on_de_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_de_changed), /* on_de_changed */
DEVCB_NULL, /* on_cur_changed */
- DEVCB_LINE(amstrad_hsync_changed), /* on_hsync_changed */
- DEVCB_LINE(amstrad_vsync_changed), /* on_vsync_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_hsync_changed), /* on_hsync_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_vsync_changed), /* on_vsync_changed */
NULL
};
@@ -1101,10 +1094,10 @@ const mc6845_interface amstrad_plus_mc6845_intf =
NULL, /* begin_update */
NULL, /* update_row */
NULL, /* end_update */
- DEVCB_LINE(amstrad_plus_de_changed), /* on_de_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_de_changed), /* on_de_changed */
DEVCB_NULL, /* on_cur_changed */
- DEVCB_LINE(amstrad_plus_hsync_changed), /* on_hsync_changed */
- DEVCB_LINE(amstrad_plus_vsync_changed), /* on_vsync_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_hsync_changed), /* on_hsync_changed */
+ DEVCB_DRIVER_LINE_MEMBER(amstrad_state,amstrad_plus_vsync_changed), /* on_vsync_changed */
NULL
};
@@ -2505,19 +2498,17 @@ static void update_psg(running_machine &machine)
/* Read/Write 8255 PPI port A (connected to AY-3-8912 databus) */
-READ8_DEVICE_HANDLER ( amstrad_ppi_porta_r )
+READ8_MEMBER(amstrad_state::amstrad_ppi_porta_r)
{
- amstrad_state *state = space.machine().driver_data<amstrad_state>();
- update_psg(space.machine());
- return state->m_ppi_port_inputs[amstrad_ppi_PortA];
+ update_psg(machine());
+ return m_ppi_port_inputs[amstrad_ppi_PortA];
}
-WRITE8_DEVICE_HANDLER ( amstrad_ppi_porta_w )
+WRITE8_MEMBER(amstrad_state::amstrad_ppi_porta_w)
{
- amstrad_state *state = space.machine().driver_data<amstrad_state>();
- state->m_ppi_port_outputs[amstrad_ppi_PortA] = data;
- update_psg(space.machine());
+ m_ppi_port_outputs[amstrad_ppi_PortA] = data;
+ update_psg(machine());
}
@@ -2547,33 +2538,32 @@ Note:
*/
-READ8_DEVICE_HANDLER (amstrad_ppi_portb_r)
+READ8_MEMBER(amstrad_state::amstrad_ppi_portb_r)
{
- amstrad_state *state = space.machine().driver_data<amstrad_state>();
int data = 0;
/* Set b7 with cassette tape input */
- if(state->m_system_type != SYSTEM_GX4000)
+ if(m_system_type != SYSTEM_GX4000)
{
- if (state->m_cassette->input() > 0.03)
+ if (m_cassette->input() > 0.03)
{
data |= (1<<7);
}
}
/* Set b6 with Parallel/Printer port ready */
- if(state->m_system_type != SYSTEM_GX4000)
+ if(m_system_type != SYSTEM_GX4000)
{
- centronics_device *printer = state->m_centronics;
+ centronics_device *printer = m_centronics;
data |= printer->busy_r() << 6;
}
/* Set b4-b1 50Hz/60Hz state and manufacturer name defined by links on PCB */
- data |= (state->m_ppi_port_inputs[amstrad_ppi_PortB] & 0x1e);
+ data |= (m_ppi_port_inputs[amstrad_ppi_PortB] & 0x1e);
/* Set b0 with VSync state from the CRTC */
- data |= state->m_gate_array.vsync;
+ data |= m_gate_array.vsync;
- if(state->m_aleste_mode & 0x04)
+ if(m_aleste_mode & 0x04)
{
- if(state->m_aleste_fdc_int == 0)
+ if(m_aleste_fdc_int == 0)
data &= ~0x02;
else
data |= 0x02;
@@ -2581,7 +2571,7 @@ READ8_DEVICE_HANDLER (amstrad_ppi_portb_r)
logerror("amstrad_ppi_portb_r\n");
/* Schedule a write to PC2 */
- space.machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),state));
+ machine().scheduler().timer_set( attotime::zero, timer_expired_delegate(FUNC(amstrad_state::amstrad_pc2_low),this));
return data;
}
@@ -2601,41 +2591,40 @@ Bit Description Usage
/* previous_ppi_portc_w value */
-WRITE8_DEVICE_HANDLER ( amstrad_ppi_portc_w )
+WRITE8_MEMBER(amstrad_state::amstrad_ppi_portc_w)
{
- amstrad_state *state = space.machine().driver_data<amstrad_state>();
int changed_data;
- state->m_previous_ppi_portc_w = state->m_ppi_port_outputs[amstrad_ppi_PortC];
+ m_previous_ppi_portc_w = m_ppi_port_outputs[amstrad_ppi_PortC];
/* Write the data to Port C */
- changed_data = state->m_previous_ppi_portc_w^data;
+ changed_data = m_previous_ppi_portc_w^data;
- state->m_ppi_port_outputs[amstrad_ppi_PortC] = data;
+ m_ppi_port_outputs[amstrad_ppi_PortC] = data;
/* get b7 and b6 (PSG Function Selected */
- state->m_Psg_FunctionSelected = ((data & 0xC0)>>6);
+ m_Psg_FunctionSelected = ((data & 0xC0)>>6);
/* MC146818 function */
- state->m_aleste_rtc_function = data & 0x07;
+ m_aleste_rtc_function = data & 0x07;
/* Perform PSG function */
- update_psg(space.machine());
+ update_psg(machine());
/* b5 Cassette Write data */
- if(state->m_system_type != SYSTEM_GX4000)
+ if(m_system_type != SYSTEM_GX4000)
{
if ((changed_data & 0x20) != 0)
{
- state->m_cassette->output(((data & 0x20) ? -1.0 : +1.0));
+ m_cassette->output(((data & 0x20) ? -1.0 : +1.0));
}
}
/* b4 Cassette Motor Control */
- if(state->m_system_type != SYSTEM_GX4000)
+ if(m_system_type != SYSTEM_GX4000)
{
if ((changed_data & 0x10) != 0)
{
- state->m_cassette->change_state(
+ m_cassette->change_state(
((data & 0x10) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED),
CASSETTE_MASK_MOTOR);
}
diff --git a/src/mess/machine/apple1.c b/src/mess/machine/apple1.c
index 65c16c7533f..ac846dde56c 100644
--- a/src/mess/machine/apple1.c
+++ b/src/mess/machine/apple1.c
@@ -51,16 +51,6 @@
#include "imagedev/cassette.h"
#include "machine/ram.h"
-
-
-
-static DECLARE_READ8_DEVICE_HANDLER( apple1_pia0_kbdin );
-static DECLARE_WRITE8_DEVICE_HANDLER( apple1_pia0_dspout );
-static DECLARE_WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal );
-
-
-
-
/*****************************************************************************
** Structures
*****************************************************************************/
@@ -72,16 +62,16 @@ static DECLARE_WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal );
const pia6821_interface apple1_pia0 =
{
- DEVCB_DEVICE_HANDLER("pia", apple1_pia0_kbdin), /* Port A input (keyboard) */
+ DEVCB_DRIVER_MEMBER(apple1_state,apple1_pia0_kbdin), /* Port A input (keyboard) */
DEVCB_NULL, /* Port B input (display status) */
DEVCB_NULL, /* CA1 input (key pressed) */
DEVCB_NULL, /* CB1 input (display ready) */
DEVCB_NULL, /* CA2 not used as input */
DEVCB_NULL, /* CB2 not used as input */
DEVCB_NULL, /* Port A not used as output */
- DEVCB_DEVICE_HANDLER("pia", apple1_pia0_dspout), /* Port B output (display) */
+ DEVCB_DRIVER_MEMBER(apple1_state,apple1_pia0_dspout), /* Port B output (display) */
DEVCB_NULL, /* CA2 not used as output */
- DEVCB_DEVICE_HANDLER("pia", apple1_pia0_dsp_write_signal), /* CB2 output (display write) */
+ DEVCB_DRIVER_MEMBER(apple1_state,apple1_pia0_dsp_write_signal), /* CB2 output (display write) */
DEVCB_NULL, /* IRQA not connected */
DEVCB_NULL /* IRQB not connected */
};
@@ -381,22 +371,22 @@ TIMER_CALLBACK_MEMBER(apple1_state::apple1_kbd_strobe_end)
/*****************************************************************************
** READ/WRITE HANDLERS
*****************************************************************************/
-static READ8_DEVICE_HANDLER( apple1_pia0_kbdin )
+READ8_MEMBER(apple1_state::apple1_pia0_kbdin)
{
- apple1_state *state = space.machine().driver_data<apple1_state>();
/* Bit 7 of the keyboard input is permanently wired high. This is
what the ROM Monitor software expects. */
- return state->m_kbd_data | 0x80;
+ return m_kbd_data | 0x80;
}
-static WRITE8_DEVICE_HANDLER( apple1_pia0_dspout )
+WRITE8_MEMBER(apple1_state::apple1_pia0_dspout)
{
/* Send an ASCII character to the video hardware. */
- apple1_vh_dsp_w(space.machine(), data);
+ apple1_vh_dsp_w(machine(), data);
}
-static WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal )
+WRITE8_MEMBER(apple1_state::apple1_pia0_dsp_write_signal)
{
+ device_t *device = machine().device("pia");
/* PIA output CB2 is inverted to become the DA signal, used to
signal a display write to the video hardware. */
@@ -411,9 +401,8 @@ static WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal )
Only then will it assert \RDA to signal readiness for another
write. Thus the write delay depends on the cursor position and
where the display is in the refresh cycle. */
- apple1_state *state = space.machine().driver_data<apple1_state>();
if (!data)
- space.machine().scheduler().timer_set(apple1_vh_dsp_time_to_ready(space.machine()), timer_expired_delegate(FUNC(apple1_state::apple1_dsp_ready_start),state));
+ machine().scheduler().timer_set(apple1_vh_dsp_time_to_ready(machine()), timer_expired_delegate(FUNC(apple1_state::apple1_dsp_ready_start),this));
}
TIMER_CALLBACK_MEMBER(apple1_state::apple1_dsp_ready_start)
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 8fa022d1640..8df05a380bd 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -467,31 +467,27 @@ static void apple3_via_out(running_machine &machine, UINT8 *var, UINT8 data)
/* these are here to appease the Apple /// confidence tests */
-static READ8_DEVICE_HANDLER(apple3_via_1_in_a) { return ~0; }
-static READ8_DEVICE_HANDLER(apple3_via_1_in_b) { return ~0; }
+READ8_MEMBER(apple3_state::apple3_via_1_in_a){ return ~0; }
+READ8_MEMBER(apple3_state::apple3_via_1_in_b){ return ~0; }
-static WRITE8_DEVICE_HANDLER(apple3_via_0_out_a)
+WRITE8_MEMBER(apple3_state::apple3_via_0_out_a)
{
- apple3_state *state = space.machine().driver_data<apple3_state>();
- apple3_via_out(space.machine(), &state->m_via_0_a, data);
+ apple3_via_out(machine(), &m_via_0_a, data);
}
-static WRITE8_DEVICE_HANDLER(apple3_via_0_out_b)
+WRITE8_MEMBER(apple3_state::apple3_via_0_out_b)
{
- apple3_state *state = space.machine().driver_data<apple3_state>();
- apple3_via_out(space.machine(), &state->m_via_0_b, data);
+ apple3_via_out(machine(), &m_via_0_b, data);
}
-static WRITE8_DEVICE_HANDLER(apple3_via_1_out_a)
+WRITE8_MEMBER(apple3_state::apple3_via_1_out_a)
{
- apple3_state *state = space.machine().driver_data<apple3_state>();
- apple3_via_out(space.machine(), &state->m_via_1_a, data);
+ apple3_via_out(machine(), &m_via_1_a, data);
}
-static WRITE8_DEVICE_HANDLER(apple3_via_1_out_b)
+WRITE8_MEMBER(apple3_state::apple3_via_1_out_b)
{
- apple3_state *state = space.machine().driver_data<apple3_state>();
- apple3_via_out(space.machine(), &state->m_via_1_b, data);
+ apple3_via_out(machine(), &m_via_1_b, data);
}
static void apple2_via_1_irq_func(device_t *device, int state)
@@ -513,8 +509,8 @@ const via6522_interface apple3_via_0_intf =
DEVCB_NULL, /* in_cb1_func */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
- DEVCB_HANDLER(apple3_via_0_out_a), /* out_a_func */
- DEVCB_HANDLER(apple3_via_0_out_b), /* out_b_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_0_out_a), /* out_a_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_0_out_b), /* out_b_func */
DEVCB_NULL, /* out_ca1_func */
DEVCB_NULL, /* out_cb1_func */
DEVCB_NULL, /* out_ca2_func */
@@ -524,14 +520,14 @@ const via6522_interface apple3_via_0_intf =
const via6522_interface apple3_via_1_intf =
{
- DEVCB_HANDLER(apple3_via_1_in_a), /* in_a_func */
- DEVCB_HANDLER(apple3_via_1_in_b), /* in_b_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_1_in_a), /* in_a_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_1_in_b), /* in_b_func */
DEVCB_NULL, /* in_ca1_func */
DEVCB_NULL, /* in_cb1_func */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
- DEVCB_HANDLER(apple3_via_1_out_a), /* out_a_func */
- DEVCB_HANDLER(apple3_via_1_out_b), /* out_b_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_1_out_a), /* out_a_func */
+ DEVCB_DRIVER_MEMBER(apple3_state,apple3_via_1_out_b), /* out_b_func */
DEVCB_NULL, /* out_ca1_func */
DEVCB_NULL, /* out_cb1_func */
DEVCB_NULL, /* out_ca2_func */
diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c
index 8be772535b2..9cffdd90708 100644
--- a/src/mess/machine/b2m.c
+++ b/src/mess/machine/b2m.c
@@ -143,10 +143,9 @@ static void b2m_set_bank(running_machine &machine,int bank)
}
-static WRITE_LINE_DEVICE_HANDLER(bm2_pit_out1)
+WRITE_LINE_MEMBER(b2m_state::bm2_pit_out1)
{
- b2m_state *st = device->machine().driver_data<b2m_state>();
- speaker_level_w(st->m_speaker, state);
+ speaker_level_w(m_speaker, state);
}
const struct pit8253_config b2m_pit8253_intf =
@@ -160,7 +159,7 @@ const struct pit8253_config b2m_pit8253_intf =
{
2000000,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("pit8253", bm2_pit_out1)
+ DEVCB_DRIVER_LINE_MEMBER(b2m_state,bm2_pit_out1)
},
{
2000000,
@@ -170,65 +169,59 @@ const struct pit8253_config b2m_pit8253_intf =
}
};
-static WRITE8_DEVICE_HANDLER (b2m_8255_porta_w )
+WRITE8_MEMBER(b2m_state::b2m_8255_porta_w)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
- state->m_b2m_8255_porta = data;
+ m_b2m_8255_porta = data;
}
-static WRITE8_DEVICE_HANDLER (b2m_8255_portb_w )
+WRITE8_MEMBER(b2m_state::b2m_8255_portb_w)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
- state->m_b2m_video_scroll = data;
+ m_b2m_video_scroll = data;
}
-static WRITE8_DEVICE_HANDLER (b2m_8255_portc_w )
+WRITE8_MEMBER(b2m_state::b2m_8255_portc_w)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
-
- state->m_b2m_8255_portc = data;
- b2m_set_bank(space.machine(), state->m_b2m_8255_portc & 7);
- state->m_b2m_video_page = (state->m_b2m_8255_portc >> 7) & 1;
+ m_b2m_8255_portc = data;
+ b2m_set_bank(machine(), m_b2m_8255_portc & 7);
+ m_b2m_video_page = (m_b2m_8255_portc >> 7) & 1;
}
-static READ8_DEVICE_HANDLER (b2m_8255_portb_r )
+READ8_MEMBER(b2m_state::b2m_8255_portb_r)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
- return state->m_b2m_video_scroll;
+ return m_b2m_video_scroll;
}
I8255A_INTERFACE( b2m_ppi8255_interface_1 )
{
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255_1", b2m_8255_porta_w),
- DEVCB_DEVICE_HANDLER("ppi8255_1", b2m_8255_portb_r),
- DEVCB_DEVICE_HANDLER("ppi8255_1", b2m_8255_portb_w),
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_8255_porta_w),
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_8255_portb_r),
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_8255_portb_w),
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255_1", b2m_8255_portc_w)
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_8255_portc_w)
};
-static WRITE8_DEVICE_HANDLER (b2m_ext_8255_portc_w )
+WRITE8_MEMBER(b2m_state::b2m_ext_8255_portc_w)
{
UINT8 drive = ((data >> 1) & 1) ^ 1;
UINT8 side = (data & 1) ^ 1;
- b2m_state *state = space.machine().driver_data<b2m_state>();
- floppy_mon_w(floppy_get_device(space.machine(), 0), 1);
- floppy_mon_w(floppy_get_device(space.machine(), 1), 1);
-
- if (state->m_b2m_drive!=drive) {
- wd17xx_set_drive(state->m_fdc,drive);
- floppy_mon_w(floppy_get_device(space.machine(), 0), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
- state->m_b2m_drive = drive;
+ floppy_mon_w(floppy_get_device(machine(), 0), 1);
+ floppy_mon_w(floppy_get_device(machine(), 1), 1);
+
+ if (m_b2m_drive!=drive) {
+ wd17xx_set_drive(m_fdc,drive);
+ floppy_mon_w(floppy_get_device(machine(), 0), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
+ m_b2m_drive = drive;
}
- if (state->m_b2m_side!=side) {
- wd17xx_set_side(state->m_fdc,side);
- floppy_mon_w(floppy_get_device(space.machine(), 1), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
- state->m_b2m_side = side;
+ if (m_b2m_side!=side) {
+ wd17xx_set_side(m_fdc,side);
+ floppy_mon_w(floppy_get_device(machine(), 1), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
+ m_b2m_side = side;
}
- wd17xx_dden_w(state->m_fdc, 0);
+ wd17xx_dden_w(m_fdc, 0);
}
I8255A_INTERFACE( b2m_ppi8255_interface_2 )
@@ -238,42 +231,38 @@ I8255A_INTERFACE( b2m_ppi8255_interface_2 )
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255_2", b2m_ext_8255_portc_w)
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_ext_8255_portc_w)
};
-static READ8_DEVICE_HANDLER (b2m_romdisk_porta_r )
+READ8_MEMBER(b2m_state::b2m_romdisk_porta_r)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
-
- UINT8 *romdisk = state->memregion("maincpu")->base() + 0x12000;
- return romdisk[state->m_b2m_romdisk_msb*256+state->m_b2m_romdisk_lsb];
+ UINT8 *romdisk = memregion("maincpu")->base() + 0x12000;
+ return romdisk[m_b2m_romdisk_msb*256+m_b2m_romdisk_lsb];
}
-static WRITE8_DEVICE_HANDLER (b2m_romdisk_portb_w )
+WRITE8_MEMBER(b2m_state::b2m_romdisk_portb_w)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
- state->m_b2m_romdisk_lsb = data;
+ m_b2m_romdisk_lsb = data;
}
-static WRITE8_DEVICE_HANDLER (b2m_romdisk_portc_w )
+WRITE8_MEMBER(b2m_state::b2m_romdisk_portc_w)
{
- b2m_state *state = space.machine().driver_data<b2m_state>();
- state->m_b2m_romdisk_msb = data & 0x7f;
+ m_b2m_romdisk_msb = data & 0x7f;
}
I8255A_INTERFACE( b2m_ppi8255_interface_3 )
{
- DEVCB_DEVICE_HANDLER("ppi8255_3", b2m_romdisk_porta_r),
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_romdisk_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255_3", b2m_romdisk_portb_w),
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_romdisk_portb_w),
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255_3", b2m_romdisk_portc_w)
+ DEVCB_DRIVER_MEMBER(b2m_state,b2m_romdisk_portc_w)
};
-static WRITE_LINE_DEVICE_HANDLER( b2m_pic_set_int_line )
+WRITE_LINE_MEMBER(b2m_state::b2m_pic_set_int_line)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
}
/* Driver initialization */
@@ -352,7 +341,7 @@ static IRQ_CALLBACK(b2m_irq_callback)
const struct pic8259_interface b2m_pic8259_config =
{
- DEVCB_LINE(b2m_pic_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(b2m_state,b2m_pic_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index a913baa2f73..e613225e9db 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -906,29 +906,27 @@ static void MC146818_set(address_space &space)
}
-static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_porta )
+WRITE8_MEMBER(bbc_state::bbcb_via_system_write_porta)
{
- bbc_state *state = space.machine().driver_data<bbc_state>();
//logerror("SYSTEM write porta %d\n",data);
- state->m_via_system_porta = data;
- if (state->m_b0_sound == 0)
+ m_via_system_porta = data;
+ if (m_b0_sound == 0)
{
//logerror("Doing an unsafe write to the sound chip %d \n",data);
- state->m_sn->write(space, 0,state->m_via_system_porta);
+ m_sn->write(space, 0,m_via_system_porta);
}
- if (state->m_b3_keyboard == 0)
+ if (m_b3_keyboard == 0)
{
//logerror("Doing an unsafe write to the keyboard %d \n",data);
- state->m_via_system_porta = bbc_keyboard(space, state->m_via_system_porta);
+ m_via_system_porta = bbc_keyboard(space, m_via_system_porta);
}
- if (state->m_Master) MC146818_set(space);
+ if (m_Master) MC146818_set(space);
}
-static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
+WRITE8_MEMBER(bbc_state::bbcb_via_system_write_portb)
{
- bbc_state *state = space.machine().driver_data<bbc_state>();
int bit, value;
bit = data & 0x07;
value = (data >> 3) & 0x01;
@@ -941,78 +939,78 @@ static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
switch (bit)
{
case 0:
- if (state->m_b0_sound == 0)
+ if (m_b0_sound == 0)
{
- state->m_b0_sound = 1;
+ m_b0_sound = 1;
}
break;
case 1:
- if (state->m_Master)
+ if (m_Master)
{
- if (state->m_MC146818_WR == 0)
+ if (m_MC146818_WR == 0)
{
/* BBC MASTER has NV RAM Here */
- state->m_MC146818_WR = 1;
+ m_MC146818_WR = 1;
MC146818_set(space);
}
}
else
{
- if (state->m_b1_speech_read == 0)
+ if (m_b1_speech_read == 0)
{
/* VSP TMS 5220 */
- state->m_b1_speech_read = 1;
+ m_b1_speech_read = 1;
}
}
break;
case 2:
- if (state->m_Master)
+ if (m_Master)
{
- if (state->m_MC146818_DS == 0)
+ if (m_MC146818_DS == 0)
{
/* BBC MASTER has NV RAM Here */
- state->m_MC146818_DS = 1;
+ m_MC146818_DS = 1;
MC146818_set(space);
}
}
else
{
- if (state->m_b2_speech_write == 0)
+ if (m_b2_speech_write == 0)
{
/* VSP TMS 5220 */
- state->m_b2_speech_write = 1;
+ m_b2_speech_write = 1;
}
}
break;
case 3:
- if (state->m_b3_keyboard == 0)
+ if (m_b3_keyboard == 0)
{
- state->m_b3_keyboard = 1;
+ m_b3_keyboard = 1;
}
break;
case 4:
- if (state->m_b4_video0 == 0)
+ if (m_b4_video0 == 0)
{
- state->m_b4_video0 = 1;
+ m_b4_video0 = 1;
}
break;
case 5:
- if (state->m_b5_video1 == 0)
+ if (m_b5_video1 == 0)
{
- state->m_b5_video1 = 1;
+ m_b5_video1 = 1;
}
break;
case 6:
- if (state->m_b6_caps_lock_led == 0)
+ if (m_b6_caps_lock_led == 0)
{
- state->m_b6_caps_lock_led = 1;
+ m_b6_caps_lock_led = 1;
/* call caps lock led update */
}
break;
case 7:
- if (state->m_b7_shift_lock_led == 0)
+ if (m_b7_shift_lock_led == 0)
{
- state->m_b7_shift_lock_led = 1;
+ m_b7_shift_lock_led = 1;
/* call shift lock led update */
}
break;
@@ -1023,81 +1021,81 @@ static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
switch (bit)
{
case 0:
- if (state->m_b0_sound == 1)
+ if (m_b0_sound == 1)
{
- state->m_b0_sound = 0;
- state->m_sn->write(space, 0, state->m_via_system_porta);
+ m_b0_sound = 0;
+ m_sn->write(space, 0, m_via_system_porta);
}
break;
case 1:
- if (state->m_Master)
+ if (m_Master)
{
- if (state->m_MC146818_WR == 1)
+ if (m_MC146818_WR == 1)
{
/* BBC MASTER has NV RAM Here */
- state->m_MC146818_WR = 0;
+ m_MC146818_WR = 0;
MC146818_set(space);
}
}
else
{
- if (state->m_b1_speech_read == 1)
+ if (m_b1_speech_read == 1)
{
/* VSP TMS 5220 */
- state->m_b1_speech_read = 0;
+ m_b1_speech_read = 0;
}
}
break;
case 2:
- if (state->m_Master)
+ if (m_Master)
{
- if (state->m_MC146818_DS == 1)
+ if (m_MC146818_DS == 1)
{
/* BBC MASTER has NV RAM Here */
- state->m_MC146818_DS = 0;
+ m_MC146818_DS = 0;
MC146818_set(space);
}
}
else
{
- if (state->m_b2_speech_write == 1)
+ if (m_b2_speech_write == 1)
{
/* VSP TMS 5220 */
- state->m_b2_speech_write = 0;
+ m_b2_speech_write = 0;
}
}
break;
case 3:
- if (state->m_b3_keyboard == 1)
+ if (m_b3_keyboard == 1)
{
- state->m_b3_keyboard = 0;
+ m_b3_keyboard = 0;
/* *** call keyboard enabled *** */
- state->m_via_system_porta=bbc_keyboard(space, state->m_via_system_porta);
+ m_via_system_porta=bbc_keyboard(space, m_via_system_porta);
}
break;
case 4:
- if (state->m_b4_video0 == 1)
+ if (m_b4_video0 == 1)
{
- state->m_b4_video0 = 0;
+ m_b4_video0 = 0;
}
break;
case 5:
- if (state->m_b5_video1 == 1)
+ if (m_b5_video1 == 1)
{
- state->m_b5_video1 = 0;
+ m_b5_video1 = 0;
}
break;
case 6:
- if (state->m_b6_caps_lock_led == 1)
+ if (m_b6_caps_lock_led == 1)
{
- state->m_b6_caps_lock_led = 0;
+ m_b6_caps_lock_led = 0;
/* call caps lock led update */
}
break;
case 7:
- if (state->m_b7_shift_lock_led == 1)
+ if (m_b7_shift_lock_led == 1)
{
- state->m_b7_shift_lock_led = 0;
+ m_b7_shift_lock_led = 0;
/* call shift lock led update */
}
break;
@@ -1106,30 +1104,29 @@ static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
- if (state->m_Master)
+ if (m_Master)
{
//set the Address Select
- if (state->m_MC146818_AS != ((data>>7)&1))
+ if (m_MC146818_AS != ((data>>7)&1))
{
- state->m_MC146818_AS=(data>>7)&1;
+ m_MC146818_AS=(data>>7)&1;
MC146818_set(space);
}
//if CE changes
- if (state->m_MC146818_CE != ((data>>6)&1))
+ if (m_MC146818_CE != ((data>>6)&1))
{
- state->m_MC146818_CE=(data>>6)&1;
+ m_MC146818_CE=(data>>6)&1;
MC146818_set(space);
}
}
}
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_porta )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_porta)
{
- bbc_state *state = space.machine().driver_data<bbc_state>();
- //logerror("SYSTEM read porta %d\n",state->m_via_system_porta);
- return state->m_via_system_porta;
+ //logerror("SYSTEM read porta %d\n",m_via_system_porta);
+ return m_via_system_porta;
}
// D4 of portb is joystick fire button 1
@@ -1151,68 +1148,67 @@ void bbc_TMSint(int status)
#endif
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_portb )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_portb)
{
//TMSint=(!tms5220_int_r())&1;
//TMSrdy=(!tms5220_readyq_r())&1;
//logerror("SYSTEM read portb %d\n",0xf | input_port(machine, "IN0")|(TMSint<<6)|(TMSrdy<<7));
- return (0xf | space.machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7));
+ return (0xf | machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7));
}
/* vertical sync pulse from video circuit */
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_ca1 )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_ca1)
{
return 0x01;
}
/* joystick EOC */
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb1 )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_cb1)
{
- return uPD7002_EOC_r(space.machine().device("upd7002"),space,0);
+ return uPD7002_EOC_r(machine().device("upd7002"),space,0);
}
/* keyboard pressed detect */
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_ca2 )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_ca2)
{
return 0x01;
}
/* light pen strobe detect (not emulated) */
-static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb2 )
+READ8_MEMBER(bbc_state::bbcb_via_system_read_cb2)
{
return 0x01;
}
-static WRITE_LINE_DEVICE_HANDLER( bbcb_via_system_irq_w )
+WRITE_LINE_MEMBER(bbc_state::bbcb_via_system_irq_w)
{
- bbc_state *driver_state = device->machine().driver_data<bbc_state>();
- driver_state->m_via_system_irq = state;
+ m_via_system_irq = state;
- driver_state->check_interrupts();
+ check_interrupts();
}
const via6522_interface bbcb_system_via =
{
- DEVCB_HANDLER(bbcb_via_system_read_porta),
- DEVCB_HANDLER(bbcb_via_system_read_portb),
- DEVCB_HANDLER(bbcb_via_system_read_ca1),
- DEVCB_HANDLER(bbcb_via_system_read_cb1),
- DEVCB_HANDLER(bbcb_via_system_read_ca2),
- DEVCB_HANDLER(bbcb_via_system_read_cb2),
- DEVCB_HANDLER(bbcb_via_system_write_porta),
- DEVCB_HANDLER(bbcb_via_system_write_portb),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_porta),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_portb),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_ca1),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_cb1),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_ca2),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_read_cb2),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_write_porta),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_system_write_portb),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(bbcb_via_system_irq_w)
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbcb_via_system_irq_w)
};
@@ -1226,40 +1222,38 @@ collector output only. It usially acts as the printer strobe line.
***********************************************************************/
/* USER VIA 6522 port B is connected to the BBC user port */
-static READ8_DEVICE_HANDLER( bbcb_via_user_read_portb )
+READ8_MEMBER(bbc_state::bbcb_via_user_read_portb)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( bbcb_via_user_write_portb )
+WRITE8_MEMBER(bbc_state::bbcb_via_user_write_portb)
{
- bbc_state *state = space.machine().driver_data<bbc_state>();
- state->m_userport = data;
+ m_userport = data;
}
-static WRITE_LINE_DEVICE_HANDLER( bbcb_via_user_irq_w )
+WRITE_LINE_MEMBER(bbc_state::bbcb_via_user_irq_w)
{
- bbc_state *driver_state = device->machine().driver_data<bbc_state>();
- driver_state->m_via_user_irq = state;
+ m_via_user_irq = state;
- driver_state->check_interrupts();
+ check_interrupts();
}
const via6522_interface bbcb_user_via =
{
DEVCB_NULL, //via_user_read_porta,
- DEVCB_HANDLER(bbcb_via_user_read_portb),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_user_read_portb),
DEVCB_NULL, //via_user_read_ca1,
DEVCB_NULL, //via_user_read_cb1,
DEVCB_NULL, //via_user_read_ca2,
DEVCB_NULL, //via_user_read_cb2,
DEVCB_DEVICE_MEMBER("centronics", centronics_device, write),
- DEVCB_HANDLER(bbcb_via_user_write_portb),
+ DEVCB_DRIVER_MEMBER(bbc_state,bbcb_via_user_write_portb),
DEVCB_NULL, //via_user_write_ca1
DEVCB_NULL, //via_user_write_cb1
DEVCB_DEVICE_LINE_MEMBER("centronics", centronics_device, strobe_w),
DEVCB_NULL, //via_user_write_cb2,
- DEVCB_LINE(bbcb_via_user_irq_w)
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbcb_via_user_irq_w)
};
@@ -1562,25 +1556,23 @@ static void bbc_update_fdq_int(running_machine &machine, int state)
drvstate->m_previous_wd177x_int_state = bbc_state;
}
-static WRITE_LINE_DEVICE_HANDLER( bbc_wd177x_intrq_w )
+WRITE_LINE_MEMBER(bbc_state::bbc_wd177x_intrq_w)
{
- bbc_state *drvstate = device->machine().driver_data<bbc_state>();
- drvstate->m_wd177x_irq_state = state;
- bbc_update_fdq_int(device->machine(), state);
+ m_wd177x_irq_state = state;
+ bbc_update_fdq_int(machine(), state);
}
-static WRITE_LINE_DEVICE_HANDLER( bbc_wd177x_drq_w )
+WRITE_LINE_MEMBER(bbc_state::bbc_wd177x_drq_w)
{
- bbc_state *drvstate = device->machine().driver_data<bbc_state>();
- drvstate->m_wd177x_drq_state = state;
- bbc_update_fdq_int(device->machine(), state);
+ m_wd177x_drq_state = state;
+ bbc_update_fdq_int(machine(), state);
}
const wd17xx_interface bbc_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(bbc_wd177x_intrq_w),
- DEVCB_LINE(bbc_wd177x_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_wd177x_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_wd177x_drq_w),
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
diff --git a/src/mess/machine/bebox.c b/src/mess/machine/bebox.c
index 42546b5c237..36e2dbd7219 100644
--- a/src/mess/machine/bebox.c
+++ b/src/mess/machine/bebox.c
@@ -521,37 +521,35 @@ READ64_HANDLER( bebox_interrupt_ack_r )
*
*************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( bebox_pic8259_master_set_int_line )
+WRITE_LINE_MEMBER(bebox_state::bebox_pic8259_master_set_int_line)
{
- bebox_set_irq_bit(device->machine(), 5, state);
+ bebox_set_irq_bit(machine(), 5, state);
}
-static WRITE_LINE_DEVICE_HANDLER( bebox_pic8259_slave_set_int_line )
+WRITE_LINE_MEMBER(bebox_state::bebox_pic8259_slave_set_int_line)
{
- bebox_state *drvstate = device->machine().driver_data<bebox_state>();
- if (drvstate->m_devices.pic8259_master)
- pic8259_ir2_w(drvstate->m_devices.pic8259_master, state);
+ if (m_devices.pic8259_master)
+ pic8259_ir2_w(m_devices.pic8259_master, state);
}
-static READ8_DEVICE_HANDLER( get_slave_ack )
+READ8_MEMBER(bebox_state::get_slave_ack)
{
- bebox_state *state = space.machine().driver_data<bebox_state>();
if (offset==2) { // IRQ = 2
- return pic8259_acknowledge(state->m_devices.pic8259_slave);
+ return pic8259_acknowledge(m_devices.pic8259_slave);
}
return 0x00;
}
const struct pic8259_interface bebox_pic8259_master_config =
{
- DEVCB_LINE(bebox_pic8259_master_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_pic8259_master_set_int_line),
DEVCB_LINE_VCC,
- DEVCB_HANDLER(get_slave_ack)
+ DEVCB_DRIVER_MEMBER(bebox_state,get_slave_ack)
};
const struct pic8259_interface bebox_pic8259_slave_config =
{
- DEVCB_LINE(bebox_pic8259_slave_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_pic8259_slave_set_int_line),
DEVCB_LINE_GND,
DEVCB_NULL
};
@@ -753,12 +751,12 @@ READ8_HANDLER(bebox_80000480_r)
}
-static WRITE_LINE_DEVICE_HANDLER( bebox_dma_hrq_changed )
+WRITE_LINE_MEMBER(bebox_state::bebox_dma_hrq_changed)
{
- device->machine().device("ppc1")->execute().set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ machine().device("ppc1")->execute().set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
- i8237_hlda_w( device, state );
+ i8237_hlda_w( machine().device("dma8237_1"), state );
}
@@ -780,41 +778,41 @@ static WRITE8_HANDLER( bebox_dma_write_byte )
}
-static READ8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_r ) {
- return pc_fdc_dack_r(space.machine(),space);
+READ8_MEMBER(bebox_state::bebox_dma8237_fdc_dack_r){
+ return pc_fdc_dack_r(machine(),space);
}
-static WRITE8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_w ) {
- pc_fdc_dack_w( space.machine(), space, data );
+WRITE8_MEMBER(bebox_state::bebox_dma8237_fdc_dack_w){
+ pc_fdc_dack_w( machine(), space, data );
}
-static WRITE_LINE_DEVICE_HANDLER( bebox_dma8237_out_eop ) {
- pc_fdc_set_tc_state( device->machine(), state );
+WRITE_LINE_MEMBER(bebox_state::bebox_dma8237_out_eop){
+ pc_fdc_set_tc_state( machine(), state );
}
-static void set_dma_channel(device_t *device, int channel, int state)
+static void set_dma_channel(running_machine &machine, int channel, int state)
{
- bebox_state *drvstate = device->machine().driver_data<bebox_state>();
+ bebox_state *drvstate = machine.driver_data<bebox_state>();
if (!state) drvstate->m_dma_channel = channel;
}
-static WRITE_LINE_DEVICE_HANDLER( pc_dack0_w ) { set_dma_channel(device, 0, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack1_w ) { set_dma_channel(device, 1, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack2_w ) { set_dma_channel(device, 2, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack3_w ) { set_dma_channel(device, 3, state); }
+WRITE_LINE_MEMBER(bebox_state::pc_dack0_w){ set_dma_channel(machine(), 0, state); }
+WRITE_LINE_MEMBER(bebox_state::pc_dack1_w){ set_dma_channel(machine(), 1, state); }
+WRITE_LINE_MEMBER(bebox_state::pc_dack2_w){ set_dma_channel(machine(), 2, state); }
+WRITE_LINE_MEMBER(bebox_state::pc_dack3_w){ set_dma_channel(machine(), 3, state); }
I8237_INTERFACE( bebox_dma8237_1_config )
{
- DEVCB_LINE(bebox_dma_hrq_changed),
- DEVCB_LINE(bebox_dma8237_out_eop),
+ DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_dma_hrq_changed),
+ DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_dma8237_out_eop),
DEVCB_MEMORY_HANDLER("ppc1", PROGRAM, bebox_dma_read_byte),
DEVCB_MEMORY_HANDLER("ppc1", PROGRAM, bebox_dma_write_byte),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(bebox_dma8237_fdc_dack_r), DEVCB_NULL },
- { DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(bebox_dma8237_fdc_dack_w), DEVCB_NULL },
- { DEVCB_LINE(pc_dack0_w), DEVCB_LINE(pc_dack1_w), DEVCB_LINE(pc_dack2_w), DEVCB_LINE(pc_dack3_w) }
+ { DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(bebox_state,bebox_dma8237_fdc_dack_r), DEVCB_NULL },
+ { DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(bebox_state,bebox_dma8237_fdc_dack_w), DEVCB_NULL },
+ { DEVCB_DRIVER_LINE_MEMBER(bebox_state,pc_dack0_w), DEVCB_DRIVER_LINE_MEMBER(bebox_state,pc_dack1_w), DEVCB_DRIVER_LINE_MEMBER(bebox_state,pc_dack2_w), DEVCB_DRIVER_LINE_MEMBER(bebox_state,pc_dack3_w) }
};
@@ -836,11 +834,10 @@ I8237_INTERFACE( bebox_dma8237_2_config )
*
*************************************/
-static WRITE_LINE_DEVICE_HANDLER( bebox_timer0_w )
+WRITE_LINE_MEMBER(bebox_state::bebox_timer0_w)
{
- bebox_state *drvstate = device->machine().driver_data<bebox_state>();
- if (drvstate->m_devices.pic8259_master)
- pic8259_ir0_w(drvstate->m_devices.pic8259_master, state);
+ if (m_devices.pic8259_master)
+ pic8259_ir0_w(m_devices.pic8259_master, state);
}
@@ -850,7 +847,7 @@ const struct pit8253_config bebox_pit8254_config =
{
4772720/4, /* heartbeat IRQ */
DEVCB_NULL,
- DEVCB_LINE(bebox_timer0_w)
+ DEVCB_DRIVER_LINE_MEMBER(bebox_state,bebox_timer0_w)
},
{
4772720/4, /* dram refresh */
diff --git a/src/mess/machine/c64.c b/src/mess/machine/c64.c
index f6f61639cb6..27a15b4a183 100644
--- a/src/mess/machine/c64.c
+++ b/src/mess/machine/c64.c
@@ -78,23 +78,23 @@ static void c64_nmi( running_machine &machine )
* see machine/cbm.c
*/
-static READ8_DEVICE_HANDLER( c64_cia0_port_a_r )
+READ8_MEMBER(legacy_c64_state::c64_cia0_port_a_r)
{
- UINT8 cia0portb = mos6526_pb_r(space.machine().device("cia_0"), space, 0);
+ UINT8 cia0portb = mos6526_pb_r(machine().device("cia_0"), space, 0);
- return cbm_common_cia0_port_a_r(device, cia0portb);
+ return cbm_common_cia0_port_a_r(machine().device("cia_0"), cia0portb);
}
-static READ8_DEVICE_HANDLER( c64_cia0_port_b_r )
+READ8_MEMBER(legacy_c64_state::c64_cia0_port_b_r)
{
- UINT8 cia0porta = mos6526_pa_r(space.machine().device("cia_0"), space, 0);
+ UINT8 cia0porta = mos6526_pa_r(machine().device("cia_0"), space, 0);
- return cbm_common_cia0_port_b_r(device, cia0porta);
+ return cbm_common_cia0_port_b_r(machine().device("cia_0"), cia0porta);
}
-static WRITE8_DEVICE_HANDLER( c64_cia0_port_b_w )
+WRITE8_MEMBER(legacy_c64_state::c64_cia0_port_b_w)
{
- device_t *vic2 = space.machine().device("vic2");
+ device_t *vic2 = machine().device("vic2");
vic2_lightpen_write(vic2, data & 0x10);
}
@@ -133,10 +133,10 @@ const mos6526_interface c64_ntsc_cia0 =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia0_port_a_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_a_r),
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia0_port_b_r),
- DEVCB_HANDLER(c64_cia0_port_b_w)
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_b_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_b_w)
};
const mos6526_interface c64_pal_cia0 =
@@ -145,10 +145,10 @@ const mos6526_interface c64_pal_cia0 =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia0_port_a_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_a_r),
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia0_port_b_r),
- DEVCB_HANDLER(c64_cia0_port_b_w)
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_b_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia0_port_b_w)
};
@@ -175,30 +175,27 @@ const mos6526_interface c64_pal_cia0 =
* flag restore key or rs232 received data input
* irq to nmi connected ?
*/
-static READ8_DEVICE_HANDLER( c64_cia1_port_a_r )
+READ8_MEMBER(legacy_c64_state::c64_cia1_port_a_r)
{
- legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
-
UINT8 value = 0xff;
- if (!state->m_iec->clk_r())
+ if (!m_iec->clk_r())
value &= ~0x40;
- if (!state->m_iec->data_r())
+ if (!m_iec->data_r())
value &= ~0x80;
return value;
}
-static WRITE8_DEVICE_HANDLER( c64_cia1_port_a_w )
+WRITE8_MEMBER(legacy_c64_state::c64_cia1_port_a_w)
{
- legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
- state->m_iec->clk_w(!(data & 0x10));
- state->m_iec->data_w(!(data & 0x20));
- state->m_iec->atn_w(!(data & 0x08));
- state->m_vicaddr = state->m_memory + helper[data & 0x03];
+ m_iec->clk_w(!(data & 0x10));
+ m_iec->data_w(!(data & 0x20));
+ m_iec->atn_w(!(data & 0x08));
+ m_vicaddr = m_memory + helper[data & 0x03];
}
static void c64_cia1_interrupt( device_t *device, int level )
@@ -212,8 +209,8 @@ const mos6526_interface c64_ntsc_cia1 =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia1_port_a_r),
- DEVCB_HANDLER(c64_cia1_port_a_w),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia1_port_a_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia1_port_a_w),
DEVCB_NULL,
DEVCB_NULL
};
@@ -224,8 +221,8 @@ const mos6526_interface c64_pal_cia1 =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c64_cia1_port_a_r),
- DEVCB_HANDLER(c64_cia1_port_a_w),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia1_port_a_r),
+ DEVCB_DRIVER_MEMBER(legacy_c64_state,c64_cia1_port_a_w),
DEVCB_NULL,
DEVCB_NULL
};
@@ -530,87 +527,6 @@ static void c64_bankswitch( running_machine &machine, int reset )
state->m_old_data = data;
}
-/**
- ddr bit 1 port line is output
- port bit 1 port line is high
-
- p0 output loram
- p1 output hiram
- p2 output charen
- p3 output cassette data
- p4 input cassette switch
- p5 output cassette motor
- p6,7 not available on M6510
- */
-
-WRITE8_DEVICE_HANDLER(c64_m6510_port_write)
-{
- legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
-
- UINT8 direction = offset; // HACK ALERT!
-
- /* if line is marked as input then keep current value */
- data = (state->m_port_data & ~direction) | (data & direction);
-
- /* resistors make P0,P1,P2 go high when respective line is changed to input */
- if (!(direction & 0x04))
- data |= 0x04;
-
- if (!(direction & 0x02))
- data |= 0x02;
-
- if (!(direction & 0x01))
- data |= 0x01;
-
- state->m_port_data = data;
-
- if (state->m_tape_on)
- {
- if (direction & 0x08)
- {
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
- }
-
- if (direction & 0x20)
- {
- if(!(data & 0x20))
- {
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
- state->m_datasette_timer->adjust(attotime::zero, 0, attotime::from_hz(44100));
- }
- else
- {
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
- state->m_datasette_timer->reset();
- }
- }
- }
-
- if (!state->m_ultimax)
- c64_bankswitch(space.machine(), 0);
-
- state->m_memory[0x000] = device->memory().space(AS_PROGRAM).read_byte(0);
- state->m_memory[0x001] = device->memory().space(AS_PROGRAM).read_byte(1);
-
-}
-
-READ8_DEVICE_HANDLER(c64_m6510_port_read)
-{
- legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
- UINT8 data = state->m_port_data;
-
- if (state->m_tape_on)
- {
- if ((space.machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
- data &= ~0x10;
- else
- data |= 0x10;
- }
-
- return data;
-}
-
-
int c64_paddle_read( device_t *device, address_space &space, int which )
{
running_machine &machine = device->machine();
diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c
index 78c1d29a41e..86570a28dea 100644
--- a/src/mess/machine/c65.c
+++ b/src/mess/machine/c65.c
@@ -70,31 +70,30 @@ static void c65_nmi( running_machine &machine )
* see machine/cbm.c
*/
-static READ8_DEVICE_HANDLER( c65_cia0_port_a_r )
+READ8_MEMBER(c65_state::c65_cia0_port_a_r)
{
- UINT8 cia0portb = mos6526_pb_r(space.machine().device("cia_0"), space, 0);
+ UINT8 cia0portb = mos6526_pb_r(machine().device("cia_0"), space, 0);
- return cbm_common_cia0_port_a_r(device, cia0portb);
+ return cbm_common_cia0_port_a_r(machine().device("cia_0"), cia0portb);
}
-static READ8_DEVICE_HANDLER( c65_cia0_port_b_r )
+READ8_MEMBER(c65_state::c65_cia0_port_b_r)
{
- c65_state *state = space.machine().driver_data<c65_state>();
UINT8 value = 0xff;
- UINT8 cia0porta = mos6526_pa_r(space.machine().device("cia_0"), space, 0);
+ UINT8 cia0porta = mos6526_pa_r(machine().device("cia_0"), space, 0);
- value &= cbm_common_cia0_port_b_r(device, cia0porta);
+ value &= cbm_common_cia0_port_b_r(machine().device("cia_0"), cia0porta);
- if (!(state->m_6511_port & 0x02))
- value &= state->m_keyline;
+ if (!(m_6511_port & 0x02))
+ value &= m_keyline;
return value;
}
-static WRITE8_DEVICE_HANDLER( c65_cia0_port_b_w )
+WRITE8_MEMBER(c65_state::c65_cia0_port_b_w)
{
// was there lightpen support in c65 video chip?
-// device_t *vic3 = space.machine().device("vic3");
+// device_t *vic3 = machine().device("vic3");
// vic3_lightpen_write(vic3, data & 0x10);
}
@@ -136,10 +135,10 @@ const mos6526_interface c65_cia0 =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c65_cia0_port_a_r),
+ DEVCB_DRIVER_MEMBER(c65_state,c65_cia0_port_a_r),
DEVCB_NULL,
- DEVCB_HANDLER(c65_cia0_port_b_r),
- DEVCB_HANDLER(c65_cia0_port_b_w)
+ DEVCB_DRIVER_MEMBER(c65_state,c65_cia0_port_b_r),
+ DEVCB_DRIVER_MEMBER(c65_state,c65_cia0_port_b_w)
};
/*
@@ -165,45 +164,43 @@ const mos6526_interface c65_cia0 =
* flag restore key or rs232 received data input
* irq to nmi connected ?
*/
-static READ8_DEVICE_HANDLER( c65_cia1_port_a_r )
+READ8_MEMBER(c65_state::c65_cia1_port_a_r)
{
- c65_state *state = space.machine().driver_data<c65_state>();
UINT8 value = 0xff;
- if (!state->m_iec->clk_r())
+ if (!m_iec->clk_r())
value &= ~0x40;
- if (!state->m_iec->data_r())
+ if (!m_iec->data_r())
value &= ~0x80;
return value;
}
-static WRITE8_DEVICE_HANDLER( c65_cia1_port_a_w )
+WRITE8_MEMBER(c65_state::c65_cia1_port_a_w)
{
- c65_state *state = space.machine().driver_data<c65_state>();
static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
- state->m_iec->atn_w(!BIT(data, 3));
- state->m_iec->clk_w(!BIT(data, 4));
- state->m_iec->data_w(!BIT(data, 5));
+ m_iec->atn_w(!BIT(data, 3));
+ m_iec->clk_w(!BIT(data, 4));
+ m_iec->data_w(!BIT(data, 5));
- state->m_vicaddr = state->m_memory + helper[data & 0x03];
+ m_vicaddr = m_memory + helper[data & 0x03];
}
-static WRITE_LINE_DEVICE_HANDLER( c65_cia1_interrupt )
+WRITE_LINE_MEMBER(c65_state::c65_cia1_interrupt)
{
- c65_nmi(device->machine());
+ c65_nmi(machine());
}
const mos6526_interface c65_cia1 =
{
- DEVCB_LINE(c65_cia1_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(c65_state,c65_cia1_interrupt),
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(c65_cia1_port_a_r),
- DEVCB_HANDLER(c65_cia1_port_a_w),
+ DEVCB_DRIVER_MEMBER(c65_state,c65_cia1_port_a_r),
+ DEVCB_DRIVER_MEMBER(c65_state,c65_cia1_port_a_w),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c
index 6356d72fa38..c84c4514702 100644
--- a/src/mess/machine/cgenie.c
+++ b/src/mess/machine/cgenie.c
@@ -419,31 +419,30 @@ INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_timer_interrupt)
}
}
-static WRITE_LINE_DEVICE_HANDLER( cgenie_fdc_intrq_w )
+WRITE_LINE_MEMBER(cgenie_state::cgenie_fdc_intrq_w)
{
- cgenie_state *drvstate = device->machine().driver_data<cgenie_state>();
/* if disc hardware is not enabled, do not cause an int */
- if (!( drvstate->ioport("DSW0")->read() & 0x80 ))
+ if (!( ioport("DSW0")->read() & 0x80 ))
return;
if (state)
{
- if( (drvstate->m_irq_status & IRQ_FDC) == 0 )
+ if( (m_irq_status & IRQ_FDC) == 0 )
{
- drvstate->m_irq_status |= IRQ_FDC;
- device->machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
+ m_irq_status |= IRQ_FDC;
+ machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
}
}
else
{
- drvstate->m_irq_status &= ~IRQ_FDC;
+ m_irq_status &= ~IRQ_FDC;
}
}
const wd17xx_interface cgenie_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(cgenie_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(cgenie_state,cgenie_fdc_intrq_w),
DEVCB_NULL,
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
@@ -601,15 +600,13 @@ INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_frame_interrupt)
}
-READ8_DEVICE_HANDLER( cgenie_sh_control_port_r )
+READ8_MEMBER(cgenie_state::cgenie_sh_control_port_r)
{
- cgenie_state *state = space.machine().driver_data<cgenie_state>();
- return state->m_control_port;
+ return m_control_port;
}
-WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w )
+WRITE8_MEMBER(cgenie_state::cgenie_sh_control_port_w)
{
- cgenie_state *state = space.machine().driver_data<cgenie_state>();
- state->m_control_port = data;
- ay8910_address_w(device, space, offset, data);
+ m_control_port = data;
+ ay8910_address_w(machine().device("ay8910"), space, offset, data);
}
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index b81d2db1f4f..379b18cf746 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -39,22 +39,17 @@ enum
/*static int ready;*/ /* ready line from monochip, role unknown */
/* Via */
-static DECLARE_READ8_DEVICE_HANDLER(via_in_a);
-static DECLARE_WRITE8_DEVICE_HANDLER(via_out_a);
-static DECLARE_READ8_DEVICE_HANDLER(via_in_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(via_out_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(via_out_cb2);
static void via_irq_func(device_t *device, int state);
const via6522_interface concept_via6522_intf =
{ /* main via */
- DEVCB_HANDLER(via_in_a), DEVCB_HANDLER(via_in_b),
+ DEVCB_DRIVER_MEMBER(concept_state,via_in_a), DEVCB_DRIVER_MEMBER(concept_state,via_in_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(via_out_a), DEVCB_HANDLER(via_out_b),
+ DEVCB_DRIVER_MEMBER(concept_state,via_out_a), DEVCB_DRIVER_MEMBER(concept_state,via_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(via_out_cb2),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(concept_state,via_out_cb2),
DEVCB_LINE(via_irq_func)
};
@@ -195,13 +190,13 @@ INTERRUPT_GEN_MEMBER(concept_state::concept_interrupt)
6: DCD1 (I)
7: IOX (O)
*/
-static READ8_DEVICE_HANDLER(via_in_a)
+READ8_MEMBER(concept_state::via_in_a)
{
LOG(("via_in_a: VIA port A (Omninet and COMM port status) read\n"));
return 1; /* omninet ready always 1 */
}
-static WRITE8_DEVICE_HANDLER(via_out_a)
+WRITE8_MEMBER(concept_state::via_out_a)
{
LOG(("via_out_a: VIA port A status written: data=0x%2.2x\n", data));
/*iox = (data & 0x80) != 0;*/
@@ -219,16 +214,16 @@ static WRITE8_DEVICE_HANDLER(via_out_a)
6: boot switch 0 (I)
7: boot switch 1 (I)
*/
-static READ8_DEVICE_HANDLER(via_in_b)
+READ8_MEMBER(concept_state::via_in_b)
{
UINT8 status;
- status = ((space.machine().root_device().ioport("DSW0")->read() & 0x80) >> 1) | ((space.machine().root_device().ioport("DSW0")->read() & 0x40) << 1);
+ status = ((machine().root_device().ioport("DSW0")->read() & 0x80) >> 1) | ((machine().root_device().ioport("DSW0")->read() & 0x40) << 1);
LOG(("via_in_b: VIA port B (DIP switches, Video, Comm Rate) - status: 0x%2.2x\n", status));
return status;
}
-static WRITE8_DEVICE_HANDLER(via_out_b)
+WRITE8_MEMBER(concept_state::via_out_b)
{
VLOG(("via_out_b: VIA port B (Video Control and COMM rate select) written: data=0x%2.2x\n", data));
}
@@ -236,7 +231,7 @@ static WRITE8_DEVICE_HANDLER(via_out_b)
/*
VIA CB2: used as sound output
*/
-static WRITE8_DEVICE_HANDLER(via_out_cb2)
+WRITE8_MEMBER(concept_state::via_out_cb2)
{
LOG(("via_out_cb2: Sound control written: data=0x%2.2x\n", data));
}
@@ -551,29 +546,27 @@ void concept_state::concept_fdc_init(int slot)
install_expansion_slot(slot, read8_delegate(FUNC(concept_state::concept_fdc_reg_r),this), write8_delegate(FUNC(concept_state::concept_fdc_reg_w),this), read8_delegate(FUNC(concept_state::concept_fdc_rom_r),this), write8_delegate());
}
-static WRITE_LINE_DEVICE_HANDLER( concept_fdc_intrq_w )
+WRITE_LINE_MEMBER(concept_state::concept_fdc_intrq_w)
{
- concept_state *drvstate = device->machine().driver_data<concept_state>();
if (state)
- drvstate->m_fdc_local_status |= LS_INT_mask;
+ m_fdc_local_status |= LS_INT_mask;
else
- drvstate->m_fdc_local_status &= ~LS_INT_mask;
+ m_fdc_local_status &= ~LS_INT_mask;
}
-static WRITE_LINE_DEVICE_HANDLER( concept_fdc_drq_w )
+WRITE_LINE_MEMBER(concept_state::concept_fdc_drq_w)
{
- concept_state *drvstate = device->machine().driver_data<concept_state>();
if (state)
- drvstate->m_fdc_local_status |= LS_DRQ_mask;
+ m_fdc_local_status |= LS_DRQ_mask;
else
- drvstate->m_fdc_local_status &= ~LS_DRQ_mask;
+ m_fdc_local_status &= ~LS_DRQ_mask;
}
const wd17xx_interface concept_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(concept_fdc_intrq_w),
- DEVCB_LINE(concept_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(concept_state,concept_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(concept_state,concept_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c
index 3acd6ddb564..b184c3be3b0 100644
--- a/src/mess/machine/dgn_beta.c
+++ b/src/mess/machine/dgn_beta.c
@@ -92,25 +92,7 @@ static void execute_beta_key_dump(running_machine &machine, int ref, int params,
/* Debugging variables */
-static DECLARE_READ8_DEVICE_HANDLER(d_pia0_pa_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_pa_w);
-static DECLARE_READ8_DEVICE_HANDLER(d_pia0_pb_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_pb_w);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia0_cb2_w);
-static WRITE_LINE_DEVICE_HANDLER(d_pia0_irq_a);
-static WRITE_LINE_DEVICE_HANDLER(d_pia0_irq_b);
-static DECLARE_READ8_DEVICE_HANDLER(d_pia1_pa_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia1_pa_w);
-static DECLARE_READ8_DEVICE_HANDLER(d_pia1_pb_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia1_pb_w);
-static WRITE_LINE_DEVICE_HANDLER(d_pia1_irq_a);
-static WRITE_LINE_DEVICE_HANDLER(d_pia1_irq_b);
-static DECLARE_READ8_DEVICE_HANDLER(d_pia2_pa_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia2_pa_w);
-static DECLARE_READ8_DEVICE_HANDLER(d_pia2_pb_r);
-static DECLARE_WRITE8_DEVICE_HANDLER(d_pia2_pb_w);
-static WRITE_LINE_DEVICE_HANDLER(d_pia2_irq_a);
-static WRITE_LINE_DEVICE_HANDLER(d_pia2_irq_b);
+
static void cpu0_recalc_irq(running_machine &machine, int state);
static void cpu0_recalc_firq(running_machine &machine, int state);
@@ -128,39 +110,39 @@ const pia6821_interface dgnbeta_pia_intf[] =
/* PIA 0 at $FC20-$FC23 I46 */
{
/*inputs : A/B,CA/B1,CA/B2 */
- DEVCB_HANDLER(d_pia0_pa_r),
- DEVCB_HANDLER(d_pia0_pb_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia0_pa_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia0_pb_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
/*outputs: A/B,CA/B2 */
- DEVCB_HANDLER(d_pia0_pa_w),
- DEVCB_HANDLER(d_pia0_pb_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia0_pa_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia0_pb_w),
DEVCB_NULL,
- DEVCB_HANDLER(d_pia0_cb2_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia0_cb2_w),
/*irqs : A/B */
- DEVCB_LINE(d_pia0_irq_a),
- DEVCB_LINE(d_pia0_irq_b)
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia0_irq_a),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia0_irq_b)
},
/* PIA 1 at $FC24-$FC27 I63 */
{
/*inputs : A/B,CA/B1,CA/B2 */
- DEVCB_HANDLER(d_pia1_pa_r),
- DEVCB_HANDLER(d_pia1_pb_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia1_pa_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia1_pb_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
/*outputs: A/B,CA/B2 */
- DEVCB_HANDLER(d_pia1_pa_w),
- DEVCB_HANDLER(d_pia1_pb_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia1_pa_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia1_pb_w),
DEVCB_NULL,
DEVCB_NULL,
/*irqs : A/B */
- DEVCB_LINE(d_pia1_irq_a),
- DEVCB_LINE(d_pia1_irq_b)
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia1_irq_a),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia1_irq_b)
},
/* PIA 2 at FCC0-FCC3 I28 */
@@ -168,20 +150,20 @@ const pia6821_interface dgnbeta_pia_intf[] =
/* from the WD2797 */
{
/*inputs : A/B,CA/B1,CA/B2 */
- DEVCB_HANDLER(d_pia2_pa_r),
- DEVCB_HANDLER(d_pia2_pb_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia2_pa_r),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia2_pb_r),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
/*outputs: A/B,CA/B2 */
- DEVCB_HANDLER(d_pia2_pa_w),
- DEVCB_HANDLER(d_pia2_pb_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia2_pa_w),
+ DEVCB_DRIVER_MEMBER(dgn_beta_state,d_pia2_pb_w),
DEVCB_NULL,
DEVCB_NULL,
/*irqs : A/B */
- DEVCB_LINE(d_pia2_irq_a),
- DEVCB_LINE(d_pia2_irq_b)
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia2_irq_a),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,d_pia2_irq_b)
}
};
@@ -534,18 +516,17 @@ static int GetKeyRow(dgn_beta_state *state, int RowNo)
CB1 I36/39/6845(Horz Sync)
CB2 Keyboard (out) Low loads input shift reg
*/
-static READ8_DEVICE_HANDLER(d_pia0_pa_r)
+READ8_MEMBER(dgn_beta_state::d_pia0_pa_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER(d_pia0_pa_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia0_pa_w)
{
}
-static READ8_DEVICE_HANDLER(d_pia0_pb_r)
+READ8_MEMBER(dgn_beta_state::d_pia0_pb_r)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int RetVal;
int Idx;
int Selected;
@@ -556,38 +537,37 @@ static READ8_DEVICE_HANDLER(d_pia0_pb_r)
LOG_KEYBOARD(("PB Read\n"));
- state->m_KAny_next = 0;
+ m_KAny_next = 0;
- Selected = SelectedKeyrow(state, state->m_RowShifter);
+ Selected = SelectedKeyrow(this, m_RowShifter);
/* Scan the whole keyboard, if output shifter is all low */
/* This actually scans in the keyboard */
- if(state->m_RowShifter == 0x00)
+ if(m_RowShifter == 0x00)
{
for(Idx=0; Idx<NoKeyrows; Idx++)
{
- state->m_Keyboard[Idx] = space.machine().root_device().ioport(keynames[Idx])->read();
+ m_Keyboard[Idx] = machine().root_device().ioport(keynames[Idx])->read();
- if(state->m_Keyboard[Idx] != 0x7F)
- state->m_KAny_next = 1;
+ if(m_Keyboard[Idx] != 0x7F)
+ m_KAny_next = 1;
}
}
else /* Just scan current row, from previously read values */
{
- if(GetKeyRow(state, Selected) != NO_KEY_PRESSED)
- state->m_KAny_next = 1;
+ if(GetKeyRow(this, Selected) != NO_KEY_PRESSED)
+ m_KAny_next = 1;
}
- RetVal = (state->m_KInDat_next<<5) | (state->m_KAny_next<<2);
+ RetVal = (m_KInDat_next<<5) | (m_KAny_next<<2);
- LOG_KEYBOARD(("FC22=$%02X KAny=%d\n", RetVal, state->m_KAny_next));
+ LOG_KEYBOARD(("FC22=$%02X KAny=%d\n", RetVal, m_KAny_next));
return RetVal;
}
-static WRITE8_DEVICE_HANDLER(d_pia0_pb_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia0_pb_w)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int InClkState;
//int OutClkState;
@@ -596,55 +576,54 @@ static WRITE8_DEVICE_HANDLER(d_pia0_pb_w)
InClkState = data & KInClk;
//OutClkState = data & KOutClk;
- LOG_KEYBOARD(("InClkState=$%02X OldInClkState=$%02X Keyrow=$%02X ",InClkState,(state->m_d_pia0_pb_last & KInClk),state->m_Keyrow));
+ LOG_KEYBOARD(("InClkState=$%02X OldInClkState=$%02X Keyrow=$%02X ",InClkState,(m_d_pia0_pb_last & KInClk),m_Keyrow));
/* Input clock bit has changed state */
- if ((InClkState) != (state->m_d_pia0_pb_last & KInClk))
+ if ((InClkState) != (m_d_pia0_pb_last & KInClk))
{
/* Clock in bit */
if(InClkState)
{
- state->m_KInDat_next=(~state->m_Keyrow & 0x40)>>6;
- state->m_Keyrow = ((state->m_Keyrow<<1) | 0x01) & 0x7F ;
- LOG_KEYBOARD(("Keyrow=$%02X KInDat_next=%X\n",state->m_Keyrow,state->m_KInDat_next));
+ m_KInDat_next=(~m_Keyrow & 0x40)>>6;
+ m_Keyrow = ((m_Keyrow<<1) | 0x01) & 0x7F ;
+ LOG_KEYBOARD(("Keyrow=$%02X KInDat_next=%X\n",m_Keyrow,m_KInDat_next));
}
}
- state->m_d_pia0_pb_last=data;
+ m_d_pia0_pb_last=data;
}
-static WRITE8_DEVICE_HANDLER(d_pia0_cb2_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia0_cb2_w)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int RowNo;
LOG_KEYBOARD(("\nCB2 Write\n"));
/* load keyrow on rising edge of CB2 */
- if((data==1) && (state->m_d_pia0_cb2_last==0))
+ if((data==1) && (m_d_pia0_cb2_last==0))
{
- RowNo=SelectedKeyrow(state, state->m_RowShifter);
- state->m_Keyrow=GetKeyRow(state, RowNo);
+ RowNo=SelectedKeyrow(this, m_RowShifter);
+ m_Keyrow=GetKeyRow(this, RowNo);
/* Output clock rising edge, clock CB2 value into rowshifterlow to high transition */
/* In the beta the shift registers are a cmos 4015, and a cmos 4013 in series */
- state->m_RowShifter = (state->m_RowShifter<<1) | ((state->m_d_pia0_pb_last & KOutDat)>>4);
- state->m_RowShifter &= 0x3FF;
- LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",state->m_RowShifter,state->m_Keyrow));
- if (VERBOSE) debug_console_printf(space.machine(), "rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",state->m_RowShifter,RowNo,state->m_Keyrow);
+ m_RowShifter = (m_RowShifter<<1) | ((m_d_pia0_pb_last & KOutDat)>>4);
+ m_RowShifter &= 0x3FF;
+ LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",m_RowShifter,m_Keyrow));
+ if (VERBOSE) debug_console_printf(machine(), "rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",m_RowShifter,RowNo,m_Keyrow);
}
- state->m_d_pia0_cb2_last=data;
+ m_d_pia0_cb2_last=data;
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_a )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia0_irq_a)
{
- cpu0_recalc_irq(device->machine(), state);
+ cpu0_recalc_irq(machine(), state);
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_b )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia0_irq_b)
{
- cpu0_recalc_firq(device->machine(), state);
+ cpu0_recalc_firq(machine(), state);
}
/* PIA #1 at $FC24-$FC27 I63
@@ -657,19 +636,18 @@ static WRITE_LINE_DEVICE_HANDLER( d_pia0_irq_b )
Baud rate PB1..PB5 ????
*/
-static READ8_DEVICE_HANDLER(d_pia1_pa_r)
+READ8_MEMBER(dgn_beta_state::d_pia1_pa_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER(d_pia1_pa_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia1_pa_w)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int HALT_DMA;
- device_t *fdc = space.machine().device(FDC_TAG);
+ device_t *fdc = machine().device(FDC_TAG);
/* Only play with halt line if halt bit changed since last write */
- if((data & 0x80) != state->m_d_pia1_pa_last)
+ if((data & 0x80) != m_d_pia1_pa_last)
{
/* Bit 7 of $FF24, seems to control HALT on second CPU (through an inverter) */
if(data & 0x80)
@@ -678,13 +656,13 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pa_w)
HALT_DMA = CLEAR_LINE;
LOG_HALT(("DMA_CPU HALT=%d\n", HALT_DMA));
- space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_DMA);
+ machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_DMA);
/* CPU un-halted let it run ! */
if (HALT_DMA == CLEAR_LINE)
- space.machine().device(MAINCPU_TAG)->execute().yield();
+ machine().device(MAINCPU_TAG)->execute().yield();
- state->m_d_pia1_pa_last = data & 0x80;
+ m_d_pia1_pa_last = data & 0x80;
}
/* Drive selects are binary encoded on PA0 & PA1 */
@@ -695,18 +673,17 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pa_w)
LOG_DISK(("Set density %s\n", BIT(data, 6) ? "low" : "high"));
}
-static READ8_DEVICE_HANDLER(d_pia1_pb_r)
+READ8_MEMBER(dgn_beta_state::d_pia1_pb_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER(d_pia1_pb_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia1_pb_w)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int HALT_CPU;
/* Only play with halt line if halt bit changed since last write */
- if((data & 0x02) != state->m_d_pia1_pb_last)
+ if((data & 0x02) != m_d_pia1_pb_last)
{
/* Bit 1 of $FF26, seems to control HALT on primary CPU */
if(data & 0x02)
@@ -715,24 +692,24 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pb_w)
HALT_CPU = ASSERT_LINE;
LOG_HALT(("MAIN_CPU HALT=%d\n", HALT_CPU));
- space.machine().device(MAINCPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_CPU);
+ machine().device(MAINCPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_CPU);
- state->m_d_pia1_pb_last = data & 0x02;
+ m_d_pia1_pb_last = data & 0x02;
/* CPU un-halted let it run ! */
if (HALT_CPU == CLEAR_LINE)
- space.machine().device(DMACPU_TAG)->execute().yield();
+ machine().device(DMACPU_TAG)->execute().yield();
}
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia1_irq_a )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia1_irq_a)
{
- cpu0_recalc_irq(device->machine(), state);
+ cpu0_recalc_irq(machine(), state);
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia1_irq_b )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia1_irq_b)
{
- cpu0_recalc_irq(device->machine(), state);
+ cpu0_recalc_irq(machine(), state);
}
/* PIA #2 at FCC0-FCC3 I28
@@ -744,14 +721,13 @@ static WRITE_LINE_DEVICE_HANDLER( d_pia1_irq_b )
Graphics control PB0..PB7 ???
VSYNC intutrupt CB2
*/
-static READ8_DEVICE_HANDLER(d_pia2_pa_r)
+READ8_MEMBER(dgn_beta_state::d_pia2_pa_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia2_pa_w)
{
- dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int OldTask;
int OldEnableMap;
int NMI;
@@ -762,78 +738,78 @@ static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
NMI=(data & 0x80);
/* only take action if NMI changed */
- if(NMI != state->m_DMA_NMI_LAST)
+ if(NMI != m_DMA_NMI_LAST)
{
LOG_INTS(("cpu1 NMI : %d\n", NMI));
if(!NMI)
{
- space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
logerror("device_yield()\n");
- space.machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */
+ machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */
}
else
{
- space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
- state->m_DMA_NMI_LAST = NMI; /* Save it for next time */
+ m_DMA_NMI_LAST = NMI; /* Save it for next time */
}
- OldEnableMap = state->m_EnableMapRegs;
+ OldEnableMap = m_EnableMapRegs;
/* Bit 6 seems to enable memory paging */
if(data & 0x40)
- state->m_EnableMapRegs = 0;
+ m_EnableMapRegs = 0;
else
- state->m_EnableMapRegs = 1;
+ m_EnableMapRegs = 1;
/* Bits 0..3 seem to control which task register is selected */
- OldTask = state->m_PIATaskReg;
- state->m_PIATaskReg = data & 0x0F;
+ OldTask = m_PIATaskReg;
+ m_PIATaskReg = data & 0x0F;
- LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n", OldTask, state->m_EnableMapRegs, OldEnableMap));
+ LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n", OldTask, m_EnableMapRegs, OldEnableMap));
// Maping was enabled or disabled, select apropreate task reg
// and map it in
- if (state->m_EnableMapRegs != OldEnableMap)
+ if (m_EnableMapRegs != OldEnableMap)
{
- if(state->m_EnableMapRegs)
- state->m_TaskReg = state->m_PIATaskReg;
+ if(m_EnableMapRegs)
+ m_TaskReg = m_PIATaskReg;
else
- state->m_TaskReg = NoPagingTask;
+ m_TaskReg = NoPagingTask;
- UpdateBanks(space.machine(), 0, IOPage + 1);
+ UpdateBanks(machine(), 0, IOPage + 1);
}
else
{
// Update ram banks only if task reg changed and mapping enabled
- if ((state->m_PIATaskReg != OldTask) && (state->m_EnableMapRegs))
+ if ((m_PIATaskReg != OldTask) && (m_EnableMapRegs))
{
- state->m_TaskReg = state->m_PIATaskReg;
- UpdateBanks(space.machine(), 0, IOPage + 1);
+ m_TaskReg = m_PIATaskReg;
+ UpdateBanks(machine(), 0, IOPage + 1);
}
}
- LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n", state->m_TaskReg, state->m_PIATaskReg));
+ LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n", m_TaskReg, m_PIATaskReg));
}
-static READ8_DEVICE_HANDLER(d_pia2_pb_r)
+READ8_MEMBER(dgn_beta_state::d_pia2_pb_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER(d_pia2_pb_w)
+WRITE8_MEMBER(dgn_beta_state::d_pia2_pb_w)
{
/* Update top video address lines */
- dgnbeta_vid_set_gctrl(space.machine(), data);
+ dgnbeta_vid_set_gctrl(machine(), data);
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia2_irq_a )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia2_irq_a)
{
- cpu0_recalc_irq(device->machine(), state);
+ cpu0_recalc_irq(machine(), state);
}
-static WRITE_LINE_DEVICE_HANDLER( d_pia2_irq_b )
+WRITE_LINE_MEMBER(dgn_beta_state::d_pia2_irq_b)
{
- cpu0_recalc_irq(device->machine(), state);
+ cpu0_recalc_irq(machine(), state);
}
/************************************ Recalculate CPU inturrupts ****************************/
@@ -888,26 +864,26 @@ static void cpu1_recalc_firq(running_machine &machine, int state)
/********************************************************************************************/
/* The INTRQ line goes through pia2 ca1, in exactly the same way as DRQ from DragonDos does */
-static WRITE_LINE_DEVICE_HANDLER( dgnbeta_fdc_intrq_w )
+WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_intrq_w)
{
- dgn_beta_state *drvstate = device->machine().driver_data<dgn_beta_state>();
+ device_t *device = machine().device(PIA_2_TAG);
LOG_DISK(("dgnbeta_fdc_intrq_w(%d)\n", state));
- if(drvstate->m_wd2797_written)
+ if(m_wd2797_written)
downcast<pia6821_device *>(device)->ca1_w(state);
}
/* DRQ is routed through various logic to the FIRQ inturrupt line on *BOTH* CPUs */
-static WRITE_LINE_DEVICE_HANDLER( dgnbeta_fdc_drq_w )
+WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_fdc_drq_w)
{
LOG_DISK(("dgnbeta_fdc_drq_w(%d)\n", state));
- cpu1_recalc_firq(device->machine(), state);
+ cpu1_recalc_firq(machine(), state);
}
const wd17xx_interface dgnbeta_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_DEVICE_LINE(PIA_2_TAG, dgnbeta_fdc_intrq_w),
- DEVCB_LINE(dgnbeta_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/machine/irisha.c b/src/mess/machine/irisha.c
index c1ad27efdf0..626c4940397 100644
--- a/src/mess/machine/irisha.c
+++ b/src/mess/machine/irisha.c
@@ -117,14 +117,14 @@ I8255A_INTERFACE( irisha_ppi8255_interface )
DEVCB_DRIVER_MEMBER(irisha_state, irisha_8255_portc_w),
};
-static WRITE_LINE_DEVICE_HANDLER( irisha_pic_set_int_line )
+WRITE_LINE_MEMBER(irisha_state::irisha_pic_set_int_line)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
}
const struct pic8259_interface irisha_pic8259_config =
{
- DEVCB_LINE(irisha_pic_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(irisha_state,irisha_pic_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
diff --git a/src/mess/machine/kaypro.c b/src/mess/machine/kaypro.c
index 4f75ec0ec8b..23334e8b696 100644
--- a/src/mess/machine/kaypro.c
+++ b/src/mess/machine/kaypro.c
@@ -13,9 +13,9 @@
************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( kaypro_interrupt )
+WRITE_LINE_MEMBER(kaypro_state::kaypro_interrupt)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state);
+ machine().device("maincpu")->execute().set_input_line(0, state);
}
READ8_MEMBER( kaypro_state::pio_system_r )
@@ -227,7 +227,7 @@ WRITE8_MEMBER( kaypro_state::kaypro2x_system_port_w )
const z80sio_interface kaypro_sio_intf =
{
- DEVCB_LINE(kaypro_interrupt), /* interrupt handler */
+ DEVCB_DRIVER_LINE_MEMBER(kaypro_state,kaypro_interrupt), /* interrupt handler */
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
@@ -235,35 +235,35 @@ const z80sio_interface kaypro_sio_intf =
DEVCB_NULL /* receive handler - which channel is this for? */
};
-READ8_DEVICE_HANDLER( kaypro_sio_r )
+READ8_MEMBER(kaypro_state::kaypro_sio_r)
{
if (!offset)
- return dynamic_cast<z80sio_device*>(device)->data_read(0);
+ return dynamic_cast<z80sio_device*>(machine().device("z80sio"))->data_read(0);
else
if (offset == 1)
-// return z80sio_d_r(device, 1);
- return kay_kbd_d_r(space.machine());
+// return z80sio_d_r(machine().device("z80sio"), 1);
+ return kay_kbd_d_r(machine());
else
if (offset == 2)
- return dynamic_cast<z80sio_device*>(device)->control_read(0);
+ return dynamic_cast<z80sio_device*>(machine().device("z80sio"))->control_read(0);
else
-// return z80sio_c_r(device, 1);
- return kay_kbd_c_r(space.machine());
+// return z80sio_c_r(machine().device("z80sio"), 1);
+ return kay_kbd_c_r(machine());
}
-WRITE8_DEVICE_HANDLER( kaypro_sio_w )
+WRITE8_MEMBER(kaypro_state::kaypro_sio_w)
{
if (!offset)
- dynamic_cast<z80sio_device*>(device)->data_write(0, data);
+ dynamic_cast<z80sio_device*>(machine().device("z80sio"))->data_write(0, data);
else
if (offset == 1)
-// z80sio_d_w(device, 1, data);
- kay_kbd_d_w(space.machine(), data);
+// z80sio_d_w(machine().device("z80sio"), 1, data);
+ kay_kbd_d_w(machine(), data);
else
if (offset == 2)
- dynamic_cast<z80sio_device*>(device)->control_write(0, data);
+ dynamic_cast<z80sio_device*>(machine().device("z80sio"))->control_write(0, data);
else
- dynamic_cast<z80sio_device*>(device)->control_write(1, data);
+ dynamic_cast<z80sio_device*>(machine().device("z80sio"))->control_write(1, data);
}
diff --git a/src/mess/machine/kramermc.c b/src/mess/machine/kramermc.c
index 396d9018d38..dc05afec34b 100644
--- a/src/mess/machine/kramermc.c
+++ b/src/mess/machine/kramermc.c
@@ -12,32 +12,30 @@
#include "includes/kramermc.h"
-static READ8_DEVICE_HANDLER (kramermc_port_a_r)
+READ8_MEMBER(kramermc_state::kramermc_port_a_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER (kramermc_port_b_r)
+READ8_MEMBER(kramermc_state::kramermc_port_b_r)
{
- kramermc_state *state = space.machine().driver_data<kramermc_state>();
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
- return space.machine().root_device().ioport(keynames[state->m_key_row])->read();
+ return machine().root_device().ioport(keynames[m_key_row])->read();
}
-static WRITE8_DEVICE_HANDLER (kramermc_port_a_w)
+WRITE8_MEMBER(kramermc_state::kramermc_port_a_w)
{
- kramermc_state *state = space.machine().driver_data<kramermc_state>();
- state->m_key_row = ((data >> 1) & 0x07);
+ m_key_row = ((data >> 1) & 0x07);
}
Z80PIO_INTERFACE( kramermc_z80pio_intf )
{
DEVCB_NULL, /* callback when change interrupt status */
- DEVCB_HANDLER(kramermc_port_a_r),
- DEVCB_HANDLER(kramermc_port_a_w),
+ DEVCB_DRIVER_MEMBER(kramermc_state,kramermc_port_a_r),
+ DEVCB_DRIVER_MEMBER(kramermc_state,kramermc_port_a_w),
DEVCB_NULL,
- DEVCB_HANDLER(kramermc_port_b_r),
+ DEVCB_DRIVER_MEMBER(kramermc_state,kramermc_port_b_r),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index 02187e9c095..165376c2956 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -91,23 +91,17 @@ the drive type (TWIGGY or 3.5'')) */
a hard disk
*/
-static DECLARE_READ8_DEVICE_HANDLER(COPS_via_in_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_a);
-static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_ca2);
-static DECLARE_WRITE8_DEVICE_HANDLER(COPS_via_out_cb2);
static void COPS_via_irq_func(device_t *device, int val);
-static DECLARE_READ8_DEVICE_HANDLER(parallel_via_in_b);
const via6522_interface lisa_via6522_0_intf =
{
/* COPS via */
- DEVCB_NULL, DEVCB_HANDLER(COPS_via_in_b),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(lisa_state,COPS_via_in_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(COPS_via_out_a), DEVCB_HANDLER(COPS_via_out_b),
- DEVCB_HANDLER(COPS_via_out_ca2), DEVCB_HANDLER(COPS_via_out_cb2),
+ DEVCB_DRIVER_MEMBER(lisa_state,COPS_via_out_a), DEVCB_DRIVER_MEMBER(lisa_state,COPS_via_out_b),
+ DEVCB_DRIVER_MEMBER(lisa_state,COPS_via_out_ca2), DEVCB_DRIVER_MEMBER(lisa_state,COPS_via_out_cb2),
DEVCB_NULL, DEVCB_NULL,
DEVCB_LINE(COPS_via_irq_func),
};
@@ -115,7 +109,7 @@ const via6522_interface lisa_via6522_0_intf =
const via6522_interface lisa_via6522_1_intf =
{
/* parallel interface via - incomplete */
- DEVCB_NULL, DEVCB_HANDLER(parallel_via_in_b),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(lisa_state,parallel_via_in_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
@@ -676,22 +670,20 @@ static void init_COPS(running_machine &machine)
CA1 (I) : COPS sending valid data
CA2 (O) : VIA -> COPS handshake
*/
-static WRITE8_DEVICE_HANDLER(COPS_via_out_a)
+WRITE8_MEMBER(lisa_state::COPS_via_out_a)
{
- lisa_state *state = space.machine().driver_data<lisa_state>();
// printf("VIA A = %02x\n", data);
- state->m_COPS_command = data;
+ m_COPS_command = data;
}
-static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2)
+WRITE8_MEMBER(lisa_state::COPS_via_out_ca2)
{
- lisa_state *state = space.machine().driver_data<lisa_state>();
- state->m_hold_COPS_data = data;
+ m_hold_COPS_data = data;
/*logerror("COPS CA2 line state : %d\n", val);*/
/*logerror("COPS_via_out_ca2 : trying to send data to VIA\n");*/
- COPS_send_data_if_possible(space.machine());
+ COPS_send_data_if_possible(machine());
}
/*
@@ -708,50 +700,48 @@ static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2)
CB1 : not used
CB2 (O) : sound output
*/
-static READ8_DEVICE_HANDLER(COPS_via_in_b)
+READ8_MEMBER(lisa_state::COPS_via_in_b)
{
- lisa_state *state = space.machine().driver_data<lisa_state>();
int val = 0;
- if (state->m_COPS_Ready)
+ if (m_COPS_Ready)
val |= 0x40;
- if (state->m_FDIR)
+ if (m_FDIR)
val |= 0x10;
return val;
}
-static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
+WRITE8_MEMBER(lisa_state::COPS_via_out_b)
{
- lisa_state *state = space.machine().driver_data<lisa_state>();
- via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
/* pull-up */
data |= (~ via_0->read(space,VIA_DDRA)) & 0x01;
if (data & 0x01)
{
- if (state->m_COPS_force_unplug)
+ if (m_COPS_force_unplug)
{
- state->m_COPS_force_unplug = 0;
- plug_keyboard(space.machine());
+ m_COPS_force_unplug = 0;
+ plug_keyboard(machine());
}
}
else
{
- if (! state->m_COPS_force_unplug)
+ if (! m_COPS_force_unplug)
{
- state->m_COPS_force_unplug = 1;
- unplug_keyboard(space.machine());
+ m_COPS_force_unplug = 1;
+ unplug_keyboard(machine());
//reset_COPS(state);
}
}
}
-static WRITE8_DEVICE_HANDLER(COPS_via_out_cb2)
+WRITE8_MEMBER(lisa_state::COPS_via_out_cb2)
{
- device_t *speaker = space.machine().device(SPEAKER_TAG);
+ device_t *speaker = machine().device(SPEAKER_TAG);
speaker_level_w(speaker, data);
}
@@ -785,12 +775,11 @@ static void COPS_via_irq_func(device_t *device, int val)
CB1 : not used
CB2 (I) : current parity latch value
*/
-static READ8_DEVICE_HANDLER(parallel_via_in_b)
+READ8_MEMBER(lisa_state::parallel_via_in_b)
{
- lisa_state *state = space.machine().driver_data<lisa_state>();
int val = 0;
- if (state->m_DISK_DIAG)
+ if (m_DISK_DIAG)
val |= 0x40;
/* tell there is no hard disk : */
@@ -1067,8 +1056,7 @@ void lisa_state::machine_reset()
init_COPS(machine());
{
- via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
- COPS_via_out_ca2(via_0, generic_space(), 0, 0); /* VIA core forgets to do so */
+ COPS_via_out_ca2(generic_space(), 0, 0); /* VIA core forgets to do so */
}
/* initialize floppy */
diff --git a/src/mess/machine/lviv.c b/src/mess/machine/lviv.c
index e0131555e78..67ecfe53cb9 100644
--- a/src/mess/machine/lviv.c
+++ b/src/mess/machine/lviv.c
@@ -53,94 +53,85 @@ DIRECT_UPDATE_MEMBER(lviv_state::lviv_directoverride)
return address;
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_0_porta_r )
+READ8_MEMBER(lviv_state::lviv_ppi_0_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_0_portb_r )
+READ8_MEMBER(lviv_state::lviv_ppi_0_portb_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_0_portc_r )
+READ8_MEMBER(lviv_state::lviv_ppi_0_portc_r)
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- UINT8 data = state->m_ppi_port_outputs[0][2] & 0x0f;
- if (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input() > 0.038)
+ UINT8 data = m_ppi_port_outputs[0][2] & 0x0f;
+ if (machine().device<cassette_image_device>(CASSETTE_TAG)->input() > 0.038)
data |= 0x10;
- if (state->m_ppi_port_outputs[0][0] & state->ioport("JOY")->read())
+ if (m_ppi_port_outputs[0][0] & ioport("JOY")->read())
data |= 0x80;
return data;
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_porta_w )
+WRITE8_MEMBER(lviv_state::lviv_ppi_0_porta_w)
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- state->m_ppi_port_outputs[0][0] = data;
+ m_ppi_port_outputs[0][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portb_w )
+WRITE8_MEMBER(lviv_state::lviv_ppi_0_portb_w)
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- state->m_ppi_port_outputs[0][1] = data;
- lviv_update_palette(space.machine(), data&0x7f);
+ m_ppi_port_outputs[0][1] = data;
+ lviv_update_palette(machine(), data&0x7f);
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portc_w ) /* tape in/out, video memory on/off */
+WRITE8_MEMBER(lviv_state::lviv_ppi_0_portc_w)/* tape in/out, video memory on/off */
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- device_t *speaker = space.machine().device(SPEAKER_TAG);
- state->m_ppi_port_outputs[0][2] = data;
- if (state->m_ppi_port_outputs[0][1]&0x80)
+ device_t *speaker = machine().device(SPEAKER_TAG);
+ m_ppi_port_outputs[0][2] = data;
+ if (m_ppi_port_outputs[0][1]&0x80)
speaker_level_w(speaker, data&0x01);
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x01) ? -1.0 : 1.0);
- lviv_update_memory(space.machine());
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x01) ? -1.0 : 1.0);
+ lviv_update_memory(machine());
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_1_porta_r )
+READ8_MEMBER(lviv_state::lviv_ppi_1_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_1_portb_r ) /* keyboard reading */
+READ8_MEMBER(lviv_state::lviv_ppi_1_portb_r)/* keyboard reading */
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- return ((state->m_ppi_port_outputs[1][0] & 0x01) ? 0xff : space.machine().root_device().ioport("KEY0")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x02) ? 0xff : space.machine().root_device().ioport("KEY1")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x04) ? 0xff : space.machine().root_device().ioport("KEY2")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x08) ? 0xff : space.machine().root_device().ioport("KEY3")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x10) ? 0xff : space.machine().root_device().ioport("KEY4")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x20) ? 0xff : space.machine().root_device().ioport("KEY5")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x40) ? 0xff : space.machine().root_device().ioport("KEY6")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x80) ? 0xff : state->ioport("KEY7")->read());
+ return ((m_ppi_port_outputs[1][0] & 0x01) ? 0xff : machine().root_device().ioport("KEY0")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x02) ? 0xff : machine().root_device().ioport("KEY1")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x04) ? 0xff : machine().root_device().ioport("KEY2")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x08) ? 0xff : machine().root_device().ioport("KEY3")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x10) ? 0xff : machine().root_device().ioport("KEY4")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x20) ? 0xff : machine().root_device().ioport("KEY5")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x40) ? 0xff : machine().root_device().ioport("KEY6")->read()) &
+ ((m_ppi_port_outputs[1][0] & 0x80) ? 0xff : ioport("KEY7")->read());
}
-static READ8_DEVICE_HANDLER ( lviv_ppi_1_portc_r ) /* keyboard reading */
+READ8_MEMBER(lviv_state::lviv_ppi_1_portc_r)/* keyboard reading */
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- return ((state->m_ppi_port_outputs[1][2] & 0x01) ? 0xff : space.machine().root_device().ioport("KEY8")->read()) &
- ((state->m_ppi_port_outputs[1][2] & 0x02) ? 0xff : space.machine().root_device().ioport("KEY9" )->read()) &
- ((state->m_ppi_port_outputs[1][2] & 0x04) ? 0xff : space.machine().root_device().ioport("KEY10")->read()) &
- ((state->m_ppi_port_outputs[1][2] & 0x08) ? 0xff : state->ioport("KEY11")->read());
+ return ((m_ppi_port_outputs[1][2] & 0x01) ? 0xff : machine().root_device().ioport("KEY8")->read()) &
+ ((m_ppi_port_outputs[1][2] & 0x02) ? 0xff : machine().root_device().ioport("KEY9" )->read()) &
+ ((m_ppi_port_outputs[1][2] & 0x04) ? 0xff : machine().root_device().ioport("KEY10")->read()) &
+ ((m_ppi_port_outputs[1][2] & 0x08) ? 0xff : ioport("KEY11")->read());
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_porta_w ) /* kayboard scaning */
+WRITE8_MEMBER(lviv_state::lviv_ppi_1_porta_w)/* kayboard scaning */
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- state->m_ppi_port_outputs[1][0] = data;
+ m_ppi_port_outputs[1][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portb_w )
+WRITE8_MEMBER(lviv_state::lviv_ppi_1_portb_w)
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- state->m_ppi_port_outputs[1][1] = data;
+ m_ppi_port_outputs[1][1] = data;
}
-static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portc_w ) /* kayboard scaning */
+WRITE8_MEMBER(lviv_state::lviv_ppi_1_portc_w)/* kayboard scaning */
{
- lviv_state *state = space.machine().driver_data<lviv_state>();
- state->m_ppi_port_outputs[1][2] = data;
+ m_ppi_port_outputs[1][2] = data;
}
@@ -212,22 +203,22 @@ WRITE8_MEMBER(lviv_state::lviv_io_w)
I8255A_INTERFACE( lviv_ppi8255_interface_0 )
{
- DEVCB_HANDLER(lviv_ppi_0_porta_r),
- DEVCB_HANDLER(lviv_ppi_0_porta_w),
- DEVCB_HANDLER(lviv_ppi_0_portb_r),
- DEVCB_HANDLER(lviv_ppi_0_portb_w),
- DEVCB_HANDLER(lviv_ppi_0_portc_r),
- DEVCB_HANDLER(lviv_ppi_0_portc_w)
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_porta_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_porta_w),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_portb_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_portb_w),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_portc_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_0_portc_w)
};
I8255A_INTERFACE( lviv_ppi8255_interface_1 )
{
- DEVCB_HANDLER(lviv_ppi_1_porta_r),
- DEVCB_HANDLER(lviv_ppi_1_porta_w),
- DEVCB_HANDLER(lviv_ppi_1_portb_r),
- DEVCB_HANDLER(lviv_ppi_1_portb_w),
- DEVCB_HANDLER(lviv_ppi_1_portc_r),
- DEVCB_HANDLER(lviv_ppi_1_portc_w)
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_porta_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_porta_w),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_portb_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_portb_w),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_portc_r),
+ DEVCB_DRIVER_MEMBER(lviv_state,lviv_ppi_1_portc_w)
};
void lviv_state::machine_reset()
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index 10d918af75b..daa8fb2e21b 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -104,7 +104,7 @@
#include "machine/ram.h"
#include "debugger.h"
-#define AUDIO_IS_CLASSIC (mac->m_model <= MODEL_MAC_CLASSIC)
+#define AUDIO_IS_CLASSIC (m_model <= MODEL_MAC_CLASSIC)
#define MAC_HAS_VIA2 ((m_model >= MODEL_MAC_II) && (m_model != MODEL_MAC_IIFX))
#define ASC_INTS_RBV ((mac->m_model >= MODEL_MAC_IICI) && (mac->m_model <= MODEL_MAC_IIVI)) || ((mac->m_model >= MODEL_MAC_LC) && (mac->m_model <= MODEL_MAC_COLOR_CLASSIC))
@@ -132,49 +132,39 @@ extern TIMER_CALLBACK(mac_pmu_tick); // macadb.c
static int scan_keyboard(running_machine &machine);
static void keyboard_receive(running_machine &machine, int val);
-static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_a);
-static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_b);
-static DECLARE_READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_a);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_cb2);
-static DECLARE_READ8_DEVICE_HANDLER(mac_via2_in_a);
-static DECLARE_READ8_DEVICE_HANDLER(mac_via2_in_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via2_out_a);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via2_out_b);
+
static void mac_via_irq(device_t *device, int state);
static void mac_via2_irq(device_t *device, int state);
static offs_t mac_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
const via6522_interface mac_via6522_intf =
{
- DEVCB_HANDLER(mac_via_in_a), DEVCB_HANDLER(mac_via_in_b),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via_in_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via_in_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(mac_via_out_a), DEVCB_HANDLER(mac_via_out_b),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via_out_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(mac_via_out_cb2),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(mac_state,mac_via_out_cb2),
DEVCB_LINE(mac_via_irq)
};
const via6522_interface mac_via6522_adb_intf =
{
- DEVCB_HANDLER(mac_via_in_a), DEVCB_HANDLER(mac_via_in_b),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via_in_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via_in_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(mac_adb_via_in_cb2),
- DEVCB_HANDLER(mac_via_out_a), DEVCB_HANDLER(mac_via_out_b),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(mac_state,mac_adb_via_in_cb2),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via_out_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(mac_adb_via_out_cb2),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(mac_state,mac_adb_via_out_cb2),
DEVCB_LINE(mac_via_irq)
};
const via6522_interface mac_via6522_2_intf =
{
- DEVCB_HANDLER(mac_via2_in_a), DEVCB_HANDLER(mac_via2_in_b),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via2_in_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via2_in_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(mac_via2_out_a), DEVCB_HANDLER(mac_via2_out_b),
+ DEVCB_DRIVER_MEMBER(mac_state,mac_via2_out_a), DEVCB_DRIVER_MEMBER(mac_state,mac_via2_out_b),
DEVCB_NULL, DEVCB_NULL,
DEVCB_NULL, DEVCB_NULL,
DEVCB_LINE(mac_via2_irq)
@@ -735,21 +725,19 @@ static void kbd_shift_out(running_machine &machine, int data)
}
}
-static WRITE8_DEVICE_HANDLER(mac_via_out_cb2)
+WRITE8_MEMBER(mac_state::mac_via_out_cb2)
{
- mac_state *mac = space.machine().driver_data<mac_state>();
-
- if (mac->m_kbd_comm == FALSE && data == 0)
+ if (m_kbd_comm == FALSE && data == 0)
{
/* Mac pulls CB2 down to initiate communication */
- mac->m_kbd_comm = TRUE;
- mac->m_kbd_receive = TRUE;
- space.machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(mac_state::kbd_clock),mac));
+ m_kbd_comm = TRUE;
+ m_kbd_receive = TRUE;
+ machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(mac_state::kbd_clock),this));
}
- if (mac->m_kbd_comm == TRUE && mac->m_kbd_receive == TRUE)
+ if (m_kbd_comm == TRUE && m_kbd_receive == TRUE)
{
/* Shift in what mac is sending */
- mac->m_kbd_shift_reg = (mac->m_kbd_shift_reg & ~1) | data;
+ m_kbd_shift_reg = (m_kbd_shift_reg & ~1) | data;
}
}
@@ -1175,29 +1163,27 @@ WRITE16_MEMBER ( mac_state::mac_iwm_w )
applefdc_w(fdc, space, (offset >> 8), data>>8);
}
-static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
+READ8_MEMBER(mac_state::mac_adb_via_in_cb2)
{
UINT8 ret;
- mac_state *mac = space.machine().driver_data<mac_state>();
-
if (ADB_IS_EGRET)
{
- ret = mac->m_egret->get_via_data();
+ ret = m_egret->get_via_data();
#if LOG_ADB
printf("68K: Read VIA_DATA %x\n", ret);
#endif
}
else if (ADB_IS_CUDA)
{
- ret = mac->m_cuda->get_via_data();
+ ret = m_cuda->get_via_data();
#if LOG_ADB
printf("68K: Read VIA_DATA %x\n", ret);
#endif
}
else
{
- ret = (mac->m_adb_send & 0x80)>>7;
- mac->m_adb_send <<= 1;
+ ret = (m_adb_send & 0x80)>>7;
+ m_adb_send <<= 1;
}
// printf("VIA IN CB2 = %x\n", ret);
@@ -1205,23 +1191,21 @@ static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
return ret;
}
-static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
+WRITE8_MEMBER(mac_state::mac_adb_via_out_cb2)
{
- mac_state *mac = space.machine().driver_data<mac_state>();
-
// printf("VIA OUT CB2 = %x\n", data);
if (ADB_IS_EGRET)
{
- mac->m_egret->set_via_data(data & 1);
+ m_egret->set_via_data(data & 1);
}
else if (ADB_IS_CUDA)
{
- mac->m_cuda->set_via_data(data & 1);
+ m_cuda->set_via_data(data & 1);
}
else
{
- mac->m_adb_command <<= 1;
- mac->m_adb_command |= data & 1;
+ m_adb_command <<= 1;
+ m_adb_command |= data & 1;
}
}
@@ -1261,20 +1245,18 @@ static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
#define PA2 0x04
#define PA1 0x02
-static READ8_DEVICE_HANDLER(mac_via_in_a)
+READ8_MEMBER(mac_state::mac_via_in_a)
{
- mac_state *mac = space.machine().driver_data<mac_state>();
+// printf("VIA1 IN_A (PC %x)\n", machine().device("maincpu")->safe_pc());
-// printf("VIA1 IN_A (PC %x)\n", space.machine().device("maincpu")->safe_pc());
-
- switch (mac->m_model)
+ switch (m_model)
{
case MODEL_MAC_PORTABLE:
case MODEL_MAC_PB100:
#if LOG_ADB
-// printf("Read PM data %x\n", mac->m_pm_data_recv);
+// printf("Read PM data %x\n", m_pm_data_recv);
#endif
- return mac->m_pm_data_recv;
+ return m_pm_data_recv;
case MODEL_MAC_CLASSIC:
case MODEL_MAC_II:
@@ -1328,89 +1310,85 @@ static READ8_DEVICE_HANDLER(mac_via_in_a)
return 0x80;
}
-static READ8_DEVICE_HANDLER(mac_via_in_b)
+READ8_MEMBER(mac_state::mac_via_in_b)
{
int val = 0;
- mac_state *mac = space.machine().driver_data<mac_state>();
-
// portable/PB100 is pretty different
- if (mac->m_model >= MODEL_MAC_PORTABLE && mac->m_model <= MODEL_MAC_PB100)
+ if (m_model >= MODEL_MAC_PORTABLE && m_model <= MODEL_MAC_PB100)
{
-// printf("Read VIA B: PM_ACK %x\n", mac->m_pm_ack);
- val = 0x80 | 0x04 | mac->m_pm_ack; // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail)
+// printf("Read VIA B: PM_ACK %x\n", m_pm_ack);
+ val = 0x80 | 0x04 | m_pm_ack; // SCC wait/request (bit 2 must be set at 900c1a or startup tests always fail)
}
else
{
/* video beam in display (! VBLANK && ! HBLANK basically) */
- if (space.machine().primary_screen->vpos() >= MAC_V_VIS)
+ if (machine().primary_screen->vpos() >= MAC_V_VIS)
val |= 0x40;
- if (ADB_IS_BITBANG)
+ if (ADB_IS_BITBANG_CLASS)
{
- val |= mac->m_adb_state<<4;
+ val |= m_adb_state<<4;
- if (!mac->m_adb_irq_pending)
+ if (!m_adb_irq_pending)
{
val |= 0x08;
}
}
else if (ADB_IS_EGRET)
{
- val |= mac->m_egret->get_xcvr_session()<<3;
+ val |= m_egret->get_xcvr_session()<<3;
}
else if (ADB_IS_CUDA)
{
- val |= mac->m_cuda->get_treq()<<3;
+ val |= m_cuda->get_treq()<<3;
}
else
{
- if (mac->m_mouse_bit_y) /* Mouse Y2 */
+ if (m_mouse_bit_y) /* Mouse Y2 */
val |= 0x20;
- if (mac->m_mouse_bit_x) /* Mouse X2 */
+ if (m_mouse_bit_x) /* Mouse X2 */
val |= 0x10;
- if ((space.machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
+ if ((machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
val |= 0x08;
}
- if (mac->m_rtc_data_out)
+ if (m_rtc_data_out)
val |= 1;
}
-// printf("VIA1 IN_B = %02x (PC %x)\n", val, space.machine().device("maincpu")->safe_pc());
+// printf("VIA1 IN_B = %02x (PC %x)\n", val, machine().device("maincpu")->safe_pc());
return val;
}
-static WRITE8_DEVICE_HANDLER(mac_via_out_a)
+WRITE8_MEMBER(mac_state::mac_via_out_a)
{
- device_t *sound = space.machine().device("custom");
- device_t *fdc = space.machine().device("fdc");
- mac_state *mac = space.machine().driver_data<mac_state>();
-
-// printf("VIA1 OUT A: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
+ device_t *sound = machine().device("custom");
+ device_t *fdc = machine().device("fdc");
+// printf("VIA1 OUT A: %02x (PC %x)\n", data, machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA1)
{
#if LOG_ADB
// printf("%02x to PM\n", data);
#endif
- mac->m_pm_data_send = data;
+ m_pm_data_send = data;
return;
}
set_scc_waitrequest((data & 0x80) >> 7);
- mac->m_screen_buffer = (data & 0x40) >> 6;
+ m_screen_buffer = (data & 0x40) >> 6;
sony_set_sel_line(fdc,(data & 0x20) >> 5);
- if (mac->m_model == MODEL_MAC_SE) // on SE this selects which floppy drive (0 = upper, 1 = lower)
+ if (m_model == MODEL_MAC_SE) // on SE this selects which floppy drive (0 = upper, 1 = lower)
{
- mac->m_drive_select = ((data & 0x10) >> 4);
+ m_drive_select = ((data & 0x10) >> 4);
}
- if (mac->m_model < MODEL_MAC_SE) // SE no longer has dual buffers
+ if (m_model < MODEL_MAC_SE) // SE no longer has dual buffers
{
mac_set_sound_buffer(sound, (data & 0x08) >> 3);
}
- if (mac->m_model < MODEL_MAC_II)
+ if (m_model < MODEL_MAC_II)
{
mac_set_volume(sound, data & 0x07);
}
@@ -1418,81 +1396,79 @@ static WRITE8_DEVICE_HANDLER(mac_via_out_a)
/* Early Mac models had VIA A4 control overlaying. In the Mac SE (and
* possibly later models), overlay was set on reset, but cleared on the
* first access to the ROM. */
- if (mac->m_model < MODEL_MAC_SE)
+ if (m_model < MODEL_MAC_SE)
{
- mac->set_memory_overlay((data & 0x10) >> 4);
+ set_memory_overlay((data & 0x10) >> 4);
}
}
-static WRITE8_DEVICE_HANDLER(mac_via_out_b)
+WRITE8_MEMBER(mac_state::mac_via_out_b)
{
- device_t *sound = space.machine().device("custom");
+ device_t *sound = machine().device("custom");
int new_rtc_rTCClk;
- mac_state *mac = space.machine().driver_data<mac_state>();
-
-// printf("VIA1 OUT B: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
+// printf("VIA1 OUT B: %02x (PC %x)\n", data, machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA1)
{
- device_t *fdc = space.machine().device("fdc");
+ device_t *fdc = machine().device("fdc");
sony_set_sel_line(fdc,(data & 0x20) >> 5);
- mac->m_drive_select = ((data & 0x10) >> 4);
+ m_drive_select = ((data & 0x10) >> 4);
- if ((data & 1) && !(mac->m_pm_req & 1))
+ if ((data & 1) && !(m_pm_req & 1))
{
#if LOG_ADB
printf("PM: 68k dropping /REQ\n");
#endif
- if (mac->m_pm_state == 0) // do this in receive state only
+ if (m_pm_state == 0) // do this in receive state only
{
- mac->m_pm_data_recv = 0xff;
- mac->m_pm_ack |= 2;
+ m_pm_data_recv = 0xff;
+ m_pm_ack |= 2;
// check if length byte matches
- if ((mac->m_pm_dptr >= 2) && (mac->m_pm_cmd[1] == (mac->m_pm_dptr-2)))
+ if ((m_pm_dptr >= 2) && (m_pm_cmd[1] == (m_pm_dptr-2)))
{
- mac->pmu_exec();
+ pmu_exec();
#if LOG_ADB
- printf("PMU exec: command %02x length %d\n", mac->m_pm_cmd[0], mac->m_pm_cmd[1]);
+ printf("PMU exec: command %02x length %d\n", m_pm_cmd[0], m_pm_cmd[1]);
#endif
}
}
}
- else if (!(data & 1) && (mac->m_pm_req & 1))
+ else if (!(data & 1) && (m_pm_req & 1))
{
- if (mac->m_pm_state == 0)
+ if (m_pm_state == 0)
{
#if LOG_ADB
- printf("PM: 68k asserting /REQ, clocking in byte [%d] = %02x\n", mac->m_pm_dptr, mac->m_pm_data_send);
+ printf("PM: 68k asserting /REQ, clocking in byte [%d] = %02x\n", m_pm_dptr, m_pm_data_send);
#endif
- mac->m_pm_ack &= ~2; // clear, we're waiting for more bytes
- mac->m_pm_cmd[mac->m_pm_dptr++] = mac->m_pm_data_send;
+ m_pm_ack &= ~2; // clear, we're waiting for more bytes
+ m_pm_cmd[m_pm_dptr++] = m_pm_data_send;
}
else // receiving, so this is different
{
- mac->m_pm_data_recv = mac->m_pm_out[mac->m_pm_sptr++];
- mac->m_pm_slen--;
- mac->m_pm_ack |= 2; // raise ACK to indicate available byte
+ m_pm_data_recv = m_pm_out[m_pm_sptr++];
+ m_pm_slen--;
+ m_pm_ack |= 2; // raise ACK to indicate available byte
#if LOG_ADB
- printf("PM: 68k asserted /REQ, sending byte %02x\n", mac->m_pm_data_recv);
+ printf("PM: 68k asserted /REQ, sending byte %02x\n", m_pm_data_recv);
#endif
// another byte to send?
- if (mac->m_pm_slen)
+ if (m_pm_slen)
{
- mac->m_pmu_send_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
+ m_pmu_send_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
else
{
- mac->m_pm_state = 0; // back to receive state
- mac->m_pmu_send_timer->adjust(attotime::never);
+ m_pm_state = 0; // back to receive state
+ m_pmu_send_timer->adjust(attotime::never);
}
}
}
- mac->m_pm_req = data & 1;
+ m_pm_req = data & 1;
return;
}
@@ -1502,49 +1478,49 @@ static WRITE8_DEVICE_HANDLER(mac_via_out_b)
}
// SE and Classic have SCSI enable/disable here
- if ((mac->m_model == MODEL_MAC_SE) || (mac->m_model == MODEL_MAC_CLASSIC))
+ if ((m_model == MODEL_MAC_SE) || (m_model == MODEL_MAC_CLASSIC))
{
- mac->m_scsiirq_enable = (data & 0x40) ? 0 : 1;
-// printf("VIAB & 0x40 = %02x, IRQ enable %d\n", data & 0x40, mac->m_scsiirq_enable);
+ m_scsiirq_enable = (data & 0x40) ? 0 : 1;
+// printf("VIAB & 0x40 = %02x, IRQ enable %d\n", data & 0x40, m_scsiirq_enable);
}
- if (mac->m_model == MODEL_MAC_SE30)
+ if (m_model == MODEL_MAC_SE30)
{
// 0x40 = 0 means enable vblank on SE/30
- mac->m_se30_vbl_enable = (data & 0x40) ? 0 : 1;
+ m_se30_vbl_enable = (data & 0x40) ? 0 : 1;
// clear the interrupt if we disabled it
- if (!mac->m_se30_vbl_enable)
+ if (!m_se30_vbl_enable)
{
- mac->nubus_slot_interrupt(0xe, 0);
+ nubus_slot_interrupt(0xe, 0);
}
}
- mac->rtc_write_rTCEnb(data & 0x04);
+ rtc_write_rTCEnb(data & 0x04);
new_rtc_rTCClk = (data >> 1) & 0x01;
- if ((! new_rtc_rTCClk) && (mac->m_rtc_rTCClk))
- mac->rtc_shift_data(data & 0x01);
- mac->m_rtc_rTCClk = new_rtc_rTCClk;
+ if ((! new_rtc_rTCClk) && (m_rtc_rTCClk))
+ rtc_shift_data(data & 0x01);
+ m_rtc_rTCClk = new_rtc_rTCClk;
- if (ADB_IS_BITBANG)
+ if (ADB_IS_BITBANG_CLASS)
{
- mac->mac_adb_newaction((data & 0x30) >> 4);
+ mac_adb_newaction((data & 0x30) >> 4);
}
else if (ADB_IS_EGRET)
{
#if LOG_ADB
- printf("68K: New Egret state: SS %d VF %d (PC %x)\n", (data>>5)&1, (data>>4)&1, mac->m_maincpu->pc());
+ printf("68K: New Egret state: SS %d VF %d (PC %x)\n", (data>>5)&1, (data>>4)&1, m_maincpu->pc());
#endif
- mac->m_egret->set_via_full((data&0x10) ? 1 : 0);
- mac->m_egret->set_sys_session((data&0x20) ? 1 : 0);
+ m_egret->set_via_full((data&0x10) ? 1 : 0);
+ m_egret->set_sys_session((data&0x20) ? 1 : 0);
}
else if (ADB_IS_CUDA)
{
#if LOG_ADB
- printf("68K: New Cuda state: TIP %d BYTEACK %d (PC %x)\n", (data>>5)&1, (data>>4)&1, mac->m_maincpu->pc());
+ printf("68K: New Cuda state: TIP %d BYTEACK %d (PC %x)\n", (data>>5)&1, (data>>4)&1, m_maincpu->pc());
#endif
- mac->m_cuda->set_byteack((data&0x10) ? 1 : 0);
- mac->m_cuda->set_tip((data&0x20) ? 1 : 0);
+ m_cuda->set_byteack((data&0x10) ? 1 : 0);
+ m_cuda->set_tip((data&0x20) ? 1 : 0);
}
}
@@ -1628,36 +1604,32 @@ WRITE16_MEMBER ( mac_state::mac_via2_w )
}
-static READ8_DEVICE_HANDLER(mac_via2_in_a)
+READ8_MEMBER(mac_state::mac_via2_in_a)
{
UINT8 result;
- mac_state *mac = space.machine().driver_data<mac_state>();
-
if (ADB_IS_PM_VIA2)
{
- result = mac->m_pm_data_recv;
+ result = m_pm_data_recv;
}
- else if ((mac->m_model == MODEL_MAC_QUADRA_700) || (mac->m_model == MODEL_MAC_QUADRA_900) || (mac->m_model == MODEL_MAC_QUADRA_950))
+ else if ((m_model == MODEL_MAC_QUADRA_700) || (m_model == MODEL_MAC_QUADRA_900) || (m_model == MODEL_MAC_QUADRA_950))
{
- result = 0x80 | mac->m_nubus_irq_state;
+ result = 0x80 | m_nubus_irq_state;
}
else
{
- result = 0xc0 | mac->m_nubus_irq_state;
+ result = 0xc0 | m_nubus_irq_state;
}
return result;
}
-static READ8_DEVICE_HANDLER(mac_via2_in_b)
+READ8_MEMBER(mac_state::mac_via2_in_b)
{
- mac_state *mac =space.machine().driver_data<mac_state>();
-
-// logerror("VIA2 IN B (PC %x)\n", space.machine().device("maincpu")->safe_pc());
+// logerror("VIA2 IN B (PC %x)\n", machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
- if (mac->m_pm_ack == 2)
+ if (m_pm_ack == 2)
{
return 0xcf;
}
@@ -1667,12 +1639,12 @@ static READ8_DEVICE_HANDLER(mac_via2_in_b)
}
}
- if ((mac->m_model == MODEL_MAC_LC) || (mac->m_model == MODEL_MAC_LC_II) || (mac->m_model == MODEL_MAC_CLASSIC_II))
+ if ((m_model == MODEL_MAC_LC) || (m_model == MODEL_MAC_LC_II) || (m_model == MODEL_MAC_CLASSIC_II))
{
return 0x4f;
}
- if ((mac->m_model == MODEL_MAC_SE30) || (mac->m_model == MODEL_MAC_IIX))
+ if ((m_model == MODEL_MAC_SE30) || (m_model == MODEL_MAC_IIX))
{
return 0x87; // bits 3 and 6 are tied low on SE/30
}
@@ -1680,91 +1652,87 @@ static READ8_DEVICE_HANDLER(mac_via2_in_b)
return 0xcf; // indicate no NuBus transaction error
}
-static WRITE8_DEVICE_HANDLER(mac_via2_out_a)
+WRITE8_MEMBER(mac_state::mac_via2_out_a)
{
- mac_state *mac = space.machine().driver_data<mac_state>();
-
-// logerror("VIA2 OUT A: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
+// logerror("VIA2 OUT A: %02x (PC %x)\n", data, machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
- mac->m_pm_data_send = data;
+ m_pm_data_send = data;
return;
}
}
-static WRITE8_DEVICE_HANDLER(mac_via2_out_b)
+WRITE8_MEMBER(mac_state::mac_via2_out_b)
{
- mac_state *mac = space.machine().driver_data<mac_state>();
-
-// logerror("VIA2 OUT B: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
+// logerror("VIA2 OUT B: %02x (PC %x)\n", data, machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
- if ((data & 4) && !(mac->m_pm_req & 4))
+ if ((data & 4) && !(m_pm_req & 4))
{
#if LOG_ADB
printf("PM: 68k dropping /REQ\n");
#endif
- if (mac->m_pm_state == 0) // do this in receive state only
+ if (m_pm_state == 0) // do this in receive state only
{
- mac->m_pm_data_recv = 0xff;
- mac->m_pm_ack |= 2;
+ m_pm_data_recv = 0xff;
+ m_pm_ack |= 2;
// check if length byte matches
- if ((mac->m_pm_dptr >= 2) && (mac->m_pm_cmd[1] == (mac->m_pm_dptr-2)))
+ if ((m_pm_dptr >= 2) && (m_pm_cmd[1] == (m_pm_dptr-2)))
{
- mac->pmu_exec();
+ pmu_exec();
#if LOG_ADB
- printf("PMU exec: command %02x length %d\n", mac->m_pm_cmd[0], mac->m_pm_cmd[1]);
+ printf("PMU exec: command %02x length %d\n", m_pm_cmd[0], m_pm_cmd[1]);
#endif
}
}
}
- else if (!(data & 4) && (mac->m_pm_req & 4))
+ else if (!(data & 4) && (m_pm_req & 4))
{
- if (mac->m_pm_state == 0)
+ if (m_pm_state == 0)
{
#if LOG_ADB
- printf("PM: 68k asserting /REQ, clocking in byte [%d] = %02x\n", mac->m_pm_dptr, mac->m_pm_data_send);
+ printf("PM: 68k asserting /REQ, clocking in byte [%d] = %02x\n", m_pm_dptr, m_pm_data_send);
#endif
- mac->m_pm_ack &= ~2; // clear, we're waiting for more bytes
- mac->m_pm_cmd[mac->m_pm_dptr++] = mac->m_pm_data_send;
+ m_pm_ack &= ~2; // clear, we're waiting for more bytes
+ m_pm_cmd[m_pm_dptr++] = m_pm_data_send;
}
else // receiving, so this is different
{
- mac->m_pm_data_recv = mac->m_pm_out[mac->m_pm_sptr++];
- mac->m_pm_slen--;
- mac->m_pm_ack |= 2; // raise ACK to indicate available byte
+ m_pm_data_recv = m_pm_out[m_pm_sptr++];
+ m_pm_slen--;
+ m_pm_ack |= 2; // raise ACK to indicate available byte
#if LOG_ADB
- printf("PM: 68k asserted /REQ, sending byte %02x\n", mac->m_pm_data_recv);
+ printf("PM: 68k asserted /REQ, sending byte %02x\n", m_pm_data_recv);
#endif
// another byte to send?
- if (mac->m_pm_slen)
+ if (m_pm_slen)
{
- mac->m_pmu_send_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
+ m_pmu_send_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
}
else
{
- mac->m_pm_state = 0; // back to receive state
- mac->m_pmu_send_timer->adjust(attotime::never);
+ m_pm_state = 0; // back to receive state
+ m_pmu_send_timer->adjust(attotime::never);
}
}
}
- mac->m_pm_req = data & 4;
+ m_pm_req = data & 4;
return;
}
else
{
// chain 60.15 Hz to VIA1
- mac->m_via1->write_ca1(data>>7);
+ m_via1->write_ca1(data>>7);
}
- if (mac->m_model == MODEL_MAC_II)
+ if (m_model == MODEL_MAC_II)
{
- m68k_set_hmmu_enable(mac->m_maincpu, (data & 0x8) ? M68K_HMMU_DISABLE : M68K_HMMU_ENABLE_II);
+ m68k_set_hmmu_enable(m_maincpu, (data & 0x8) ? M68K_HMMU_DISABLE : M68K_HMMU_ENABLE_II);
}
}
diff --git a/src/mess/machine/macpci.c b/src/mess/machine/macpci.c
index ab9073b8c24..c728045169b 100644
--- a/src/mess/machine/macpci.c
+++ b/src/mess/machine/macpci.c
@@ -26,22 +26,16 @@
/* VIA1 Handlers */
-static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_a);
-static DECLARE_READ8_DEVICE_HANDLER(mac_via_in_b);
-static DECLARE_READ8_DEVICE_HANDLER(mac_adb_via_in_cb2);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_a);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_via_out_b);
-static DECLARE_WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2);
static void mac_via_irq(device_t *device, int state);
const via6522_interface pcimac_via6522_intf =
{
- DEVCB_HANDLER(mac_via_in_a), DEVCB_HANDLER(mac_via_in_b),
+ DEVCB_DRIVER_MEMBER(macpci_state,mac_via_in_a), DEVCB_DRIVER_MEMBER(macpci_state,mac_via_in_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(mac_adb_via_in_cb2),
- DEVCB_HANDLER(mac_via_out_a), DEVCB_HANDLER(mac_via_out_b),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(macpci_state,mac_adb_via_in_cb2),
+ DEVCB_DRIVER_MEMBER(macpci_state,mac_via_out_a), DEVCB_DRIVER_MEMBER(macpci_state,mac_via_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_NULL, DEVCB_HANDLER(mac_adb_via_out_cb2),
+ DEVCB_NULL, DEVCB_DRIVER_MEMBER(macpci_state,mac_adb_via_out_cb2),
DEVCB_LINE(mac_via_irq)
};
@@ -49,45 +43,37 @@ static void mac_via_irq(device_t *device, int state)
{
}
-static READ8_DEVICE_HANDLER(mac_via_in_a)
+READ8_MEMBER(macpci_state::mac_via_in_a)
{
-// macpci_state *mac = space.machine().driver_data<macpci_state>();
-
// printf("VIA1 IN_A (PC %x)\n", mac->m_maincpu->pc());
return 0x80;
}
-static READ8_DEVICE_HANDLER(mac_via_in_b)
+READ8_MEMBER(macpci_state::mac_via_in_b)
{
int val = 0;
- macpci_state *mac = space.machine().driver_data<macpci_state>();
-
- val |= mac->m_cuda->get_treq()<<3;
+ val |= m_cuda->get_treq()<<3;
-// printf("VIA1 IN B = %02x (PC %x)\n", val, mac->m_maincpu->pc());
+// printf("VIA1 IN B = %02x (PC %x)\n", val, m_maincpu->pc());
return val;
}
-static WRITE8_DEVICE_HANDLER(mac_via_out_a)
+WRITE8_MEMBER(macpci_state::mac_via_out_a)
{
-// macpci_state *mac = space.machine().driver_data<macpci_state>();
-
-// printf("VIA1 OUT A: %02x (PC %x)\n", data, mac->m_maincpu->pc());
+// printf("VIA1 OUT A: %02x (PC %x)\n", data, m_maincpu->pc());
}
-static WRITE8_DEVICE_HANDLER(mac_via_out_b)
+WRITE8_MEMBER(macpci_state::mac_via_out_b)
{
- macpci_state *mac = space.machine().driver_data<macpci_state>();
-
-// printf("VIA1 OUT B: %02x (PC %x)\n", data, mac->m_maincpu->pc());
+// printf("VIA1 OUT B: %02x (PC %x)\n", data, m_maincpu->pc());
#if LOG_ADB
- printf("PPC: New Cuda state: TIP %d BYTEACK %d (PC %x)\n", (data>>5)&1, (data>>4)&1, mac->m_maincpu->pc());
+ printf("PPC: New Cuda state: TIP %d BYTEACK %d (PC %x)\n", (data>>5)&1, (data>>4)&1, m_maincpu->pc());
#endif
- mac->m_cuda->set_byteack((data&0x10) ? 1 : 0);
- mac->m_cuda->set_tip((data&0x20) ? 1 : 0);
+ m_cuda->set_byteack((data&0x10) ? 1 : 0);
+ m_cuda->set_tip((data&0x20) ? 1 : 0);
}
READ16_MEMBER ( macpci_state::mac_via_r )
@@ -122,12 +108,10 @@ WRITE16_MEMBER ( macpci_state::mac_via_w )
m_maincpu->adjust_icount(m_via_cycles);
}
-static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
+READ8_MEMBER(macpci_state::mac_adb_via_in_cb2)
{
UINT8 ret;
- macpci_state *mac = space.machine().driver_data<macpci_state>();
-
- ret = mac->m_cuda->get_via_data();
+ ret = m_cuda->get_via_data();
#if LOG_ADB
printf("PPC: Read VIA_DATA %x\n", ret);
#endif
@@ -135,11 +119,9 @@ static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
return ret;
}
-static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
+WRITE8_MEMBER(macpci_state::mac_adb_via_out_cb2)
{
- macpci_state *mac = space.machine().driver_data<macpci_state>();
-
- mac->m_cuda->set_via_data(data & 1);
+ m_cuda->set_via_data(data & 1);
}
void macpci_state::machine_start()
diff --git a/src/mess/machine/mc80.c b/src/mess/machine/mc80.c
index 536ed28df7a..7f50d736d9a 100644
--- a/src/mess/machine/mc80.c
+++ b/src/mess/machine/mc80.c
@@ -31,10 +31,10 @@ WRITE_LINE_MEMBER( mc80_state::ctc_z1_w )
{
}
-static WRITE_LINE_DEVICE_HANDLER( ctc_z2_w )
+WRITE_LINE_MEMBER(mc80_state::ctc_z2_w)
{
- downcast<z80ctc_device *>(device)->trg0(state);
- downcast<z80ctc_device *>(device)->trg1(state);
+ downcast<z80ctc_device *>(machine().device("z80ctc"))->trg0(state);
+ downcast<z80ctc_device *>(machine().device("z80ctc"))->trg1(state);
}
Z80CTC_INTERFACE( mc8020_ctc_intf )
@@ -42,7 +42,7 @@ Z80CTC_INTERFACE( mc8020_ctc_intf )
DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_IRQ0),
DEVCB_DRIVER_LINE_MEMBER(mc80_state, ctc_z0_w),
DEVCB_DRIVER_LINE_MEMBER(mc80_state, ctc_z1_w),
- DEVCB_LINE(ctc_z2_w)
+ DEVCB_DRIVER_LINE_MEMBER(mc80_state,ctc_z2_w)
};
diff --git a/src/mess/machine/microtan.c b/src/mess/machine/microtan.c
index c0326543380..c5f4bd9431b 100644
--- a/src/mess/machine/microtan.c
+++ b/src/mess/machine/microtan.c
@@ -161,66 +161,66 @@ static cassette_image_device *cassette_device_image(running_machine &machine)
/**************************************************************
* VIA callback functions for VIA #0
**************************************************************/
-static READ8_DEVICE_HANDLER (via_0_in_a )
+READ8_MEMBER(microtan_state::via_0_in_a)
{
- int data = space.machine().root_device().ioport("JOY")->read();
+ int data = machine().root_device().ioport("JOY")->read();
LOG(("microtan_via_0_in_a %02X\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_0_in_b )
+READ8_MEMBER(microtan_state::via_0_in_b)
{
int data = 0xff;
LOG(("microtan_via_0_in_b %02X\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_0_in_ca1 )
+READ8_MEMBER(microtan_state::via_0_in_ca1)
{
int data = 1;
LOG(("microtan_via_0_in_ca1 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_0_in_cb1 )
+READ8_MEMBER(microtan_state::via_0_in_cb1)
{
int data = 1;
LOG(("microtan_via_0_in_cb1 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_0_in_ca2 )
+READ8_MEMBER(microtan_state::via_0_in_ca2)
{
int data = 1;
LOG(("microtan_via_0_in_ca2 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_0_in_cb2 )
+READ8_MEMBER(microtan_state::via_0_in_cb2)
{
int data = 1;
LOG(("microtan_via_0_in_cb2 %d\n", data));
return data;
}
-static WRITE8_DEVICE_HANDLER ( via_0_out_a )
+WRITE8_MEMBER(microtan_state::via_0_out_a)
{
LOG(("microtan_via_0_out_a %02X\n", data));
}
-static WRITE8_DEVICE_HANDLER (via_0_out_b )
+WRITE8_MEMBER(microtan_state::via_0_out_b)
{
LOG(("microtan_via_0_out_b %02X\n", data));
/* bit #7 is the cassette output signal */
- cassette_device_image(space.machine())->output(data & 0x80 ? +1.0 : -1.0);
+ cassette_device_image(machine())->output(data & 0x80 ? +1.0 : -1.0);
}
-static WRITE8_DEVICE_HANDLER ( via_0_out_ca2 )
+WRITE8_MEMBER(microtan_state::via_0_out_ca2)
{
LOG(("microtan_via_0_out_ca2 %d\n", data));
}
-static WRITE8_DEVICE_HANDLER (via_0_out_cb2 )
+WRITE8_MEMBER(microtan_state::via_0_out_cb2)
{
LOG(("microtan_via_0_out_cb2 %d\n", data));
}
@@ -236,64 +236,64 @@ static void via_0_irq(device_t *device, int state)
/**************************************************************
* VIA callback functions for VIA #1
**************************************************************/
-static READ8_DEVICE_HANDLER ( via_1_in_a )
+READ8_MEMBER(microtan_state::via_1_in_a)
{
int data = 0xff;
LOG(("microtan_via_1_in_a %02X\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_1_in_b )
+READ8_MEMBER(microtan_state::via_1_in_b)
{
int data = 0xff;
LOG(("microtan_via_1_in_b %02X\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_1_in_ca1 )
+READ8_MEMBER(microtan_state::via_1_in_ca1)
{
int data = 1;
LOG(("microtan_via_1_in_ca1 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_1_in_cb1 )
+READ8_MEMBER(microtan_state::via_1_in_cb1)
{
int data = 1;
LOG(("microtan_via_1_in_cb1 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_1_in_ca2 )
+READ8_MEMBER(microtan_state::via_1_in_ca2)
{
int data = 1;
LOG(("microtan_via_1_in_ca2 %d\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( via_1_in_cb2 )
+READ8_MEMBER(microtan_state::via_1_in_cb2)
{
int data = 1;
LOG(("microtan_via_1_in_cb2 %d\n", data));
return data;
}
-static WRITE8_DEVICE_HANDLER ( via_1_out_a )
+WRITE8_MEMBER(microtan_state::via_1_out_a)
{
LOG(("microtan_via_1_out_a %02X\n", data));
}
-static WRITE8_DEVICE_HANDLER ( via_1_out_b )
+WRITE8_MEMBER(microtan_state::via_1_out_b)
{
LOG(("microtan_via_1_out_b %02X\n", data));
}
-static WRITE8_DEVICE_HANDLER (via_1_out_ca2 )
+WRITE8_MEMBER(microtan_state::via_1_out_ca2)
{
LOG(("microtan_via_1_out_ca2 %d\n", data));
}
-static WRITE8_DEVICE_HANDLER ( via_1_out_cb2 )
+WRITE8_MEMBER(microtan_state::via_1_out_cb2)
{
LOG(("microtan_via_1_out_cb2 %d\n", data));
}
@@ -312,24 +312,24 @@ static void via_1_irq(device_t *device, int state)
const via6522_interface microtan_via6522_0 =
{
/* VIA#1 at bfc0-bfcf*/
- DEVCB_HANDLER(via_0_in_a), DEVCB_HANDLER(via_0_in_b),
- DEVCB_HANDLER(via_0_in_ca1), DEVCB_HANDLER(via_0_in_cb1),
- DEVCB_HANDLER(via_0_in_ca2), DEVCB_HANDLER(via_0_in_cb2),
- DEVCB_HANDLER(via_0_out_a), DEVCB_HANDLER(via_0_out_b),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_a), DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_b),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_ca1), DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_cb1),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_ca2), DEVCB_DRIVER_MEMBER(microtan_state,via_0_in_cb2),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_0_out_a), DEVCB_DRIVER_MEMBER(microtan_state,via_0_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(via_0_out_ca2),DEVCB_HANDLER(via_0_out_cb2),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_0_out_ca2),DEVCB_DRIVER_MEMBER(microtan_state,via_0_out_cb2),
DEVCB_LINE(via_0_irq)
};
const via6522_interface microtan_via6522_1 =
{
/* VIA#1 at bfe0-bfef*/
- DEVCB_HANDLER(via_1_in_a), DEVCB_HANDLER(via_1_in_b),
- DEVCB_HANDLER(via_1_in_ca1), DEVCB_HANDLER(via_1_in_cb1),
- DEVCB_HANDLER(via_1_in_ca2), DEVCB_HANDLER(via_1_in_cb2),
- DEVCB_HANDLER(via_1_out_a), DEVCB_HANDLER(via_1_out_b),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_a), DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_b),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_ca1), DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_cb1),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_ca2), DEVCB_DRIVER_MEMBER(microtan_state,via_1_in_cb2),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_1_out_a), DEVCB_DRIVER_MEMBER(microtan_state,via_1_out_b),
DEVCB_NULL, DEVCB_NULL,
- DEVCB_HANDLER(via_1_out_ca2),DEVCB_HANDLER(via_1_out_cb2),
+ DEVCB_DRIVER_MEMBER(microtan_state,via_1_out_ca2),DEVCB_DRIVER_MEMBER(microtan_state,via_1_out_cb2),
DEVCB_LINE(via_1_irq)
};
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index 0398255b791..c8d7e092cee 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -620,28 +620,28 @@ WRITE8_MEMBER(msx_state::msx_psg_port_b_w)
m_psg_b = data;
}
-WRITE8_DEVICE_HANDLER( msx_printer_strobe_w )
+WRITE8_MEMBER(msx_state::msx_printer_strobe_w)
{
- space.machine().device<centronics_device>("centronics")->strobe_w(BIT(data, 1));
+ machine().device<centronics_device>("centronics")->strobe_w(BIT(data, 1));
}
-WRITE8_DEVICE_HANDLER( msx_printer_data_w )
+WRITE8_MEMBER(msx_state::msx_printer_data_w)
{
- if (space.machine().root_device().ioport("DSW")->read() & 0x80)
+ if (machine().root_device().ioport("DSW")->read() & 0x80)
/* SIMPL emulation */
- space.machine().device<dac_device>("dac")->write_signed8(data);
+ machine().device<dac_device>("dac")->write_signed8(data);
else
- space.machine().device<centronics_device>("centronics")->write(space.machine().driver_data()->generic_space(), 0, data);
+ machine().device<centronics_device>("centronics")->write(machine().driver_data()->generic_space(), 0, data);
}
-READ8_DEVICE_HANDLER( msx_printer_status_r )
+READ8_MEMBER(msx_state::msx_printer_status_r)
{
UINT8 result = 0xfd;
- if (space.machine().root_device().ioport("DSW")->read() & 0x80)
+ if (machine().root_device().ioport("DSW")->read() & 0x80)
return 0xff;
- result |= space.machine().device<centronics_device>("centronics")->busy_r() << 1;
+ result |= machine().device<centronics_device>("centronics")->busy_r() << 1;
return result;
}
diff --git a/src/mess/machine/mtx.c b/src/mess/machine/mtx.c
index 8777abf2808..29df29b52df 100644
--- a/src/mess/machine/mtx.c
+++ b/src/mess/machine/mtx.c
@@ -27,9 +27,9 @@
mtx_strobe_r - centronics strobe
-------------------------------------------------*/
-READ8_DEVICE_HANDLER( mtx_strobe_r )
+READ8_MEMBER(mtx_state::mtx_strobe_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
/* set STROBE low */
centronics->strobe_w(FALSE);
@@ -117,7 +117,6 @@ WRITE8_MEMBER(mtx_state::mtx_bankswitch_w)
READ8_MEMBER(mtx_state::mtx_sound_strobe_r)
{
m_sn->write(space, 0, m_sound_latch);
-
return 0xff;
}
@@ -134,18 +133,18 @@ WRITE8_MEMBER(mtx_state::mtx_sound_latch_w)
mtx_cst_w - cassette write
-------------------------------------------------*/
-WRITE8_DEVICE_HANDLER( mtx_cst_w )
+WRITE8_MEMBER(mtx_state::mtx_cst_w)
{
- dynamic_cast<cassette_image_device *>(device)->output( BIT(data, 0) ? -1 : 1);
+ dynamic_cast<cassette_image_device *>(machine().device(CASSETTE_TAG))->output( BIT(data, 0) ? -1 : 1);
}
/*-------------------------------------------------
mtx_prt_r - centronics status
-------------------------------------------------*/
-READ8_DEVICE_HANDLER( mtx_prt_r )
+READ8_MEMBER(mtx_state::mtx_prt_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics_device *centronics = machine().device<centronics_device>(CENTRONICS_TAG);
/*
diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c
index fbec8946062..95efe76364a 100644
--- a/src/mess/machine/mz700.c
+++ b/src/mess/machine/mz700.c
@@ -36,32 +36,27 @@
} while (0)
-static DECLARE_READ8_DEVICE_HANDLER ( pio_port_b_r );
-static DECLARE_READ8_DEVICE_HANDLER ( pio_port_c_r );
-static DECLARE_WRITE8_DEVICE_HANDLER ( pio_port_a_w );
-static DECLARE_WRITE8_DEVICE_HANDLER ( pio_port_c_w );
-
I8255_INTERFACE( mz700_ppi8255_interface )
{
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ls145", pio_port_a_w),
- DEVCB_DEVICE_HANDLER("ls145", pio_port_b_r),
+ DEVCB_DRIVER_MEMBER(mz_state,pio_port_a_w),
+ DEVCB_DRIVER_MEMBER(mz_state,pio_port_b_r),
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("ppi8255", pio_port_c_r),
- DEVCB_DEVICE_HANDLER("ppi8255", pio_port_c_w)
+ DEVCB_DRIVER_MEMBER(mz_state,pio_port_c_r),
+ DEVCB_DRIVER_MEMBER(mz_state,pio_port_c_w)
};
-static WRITE_LINE_DEVICE_HANDLER( pit_out0_changed );
-static WRITE_LINE_DEVICE_HANDLER( pit_irq_2 );
+
+
const struct pit8253_config mz700_pit8253_config =
{
{
/* clockin gate callback */
- { XTAL_17_73447MHz/20, DEVCB_NULL, DEVCB_DEVICE_LINE("pit8253", pit_out0_changed) },
+ { XTAL_17_73447MHz/20, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(mz_state,pit_out0_changed) },
{ 15611.0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE("pit8253", pit8253_clk2_w) },
- { 0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE("pit8253", pit_irq_2) },
+ { 0, DEVCB_LINE_VCC, DEVCB_DRIVER_LINE_MEMBER(mz_state,pit_irq_2) },
}
};
@@ -69,9 +64,9 @@ const struct pit8253_config mz800_pit8253_config =
{
{
/* clockin gate callback */
- { XTAL_17_73447MHz/16, DEVCB_NULL, DEVCB_DEVICE_LINE("pit8253", pit_out0_changed) },
+ { XTAL_17_73447MHz/16, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(mz_state,pit_out0_changed) },
{ 15611.0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE("pit8253", pit8253_clk2_w) },
- { 0, DEVCB_LINE_VCC, DEVCB_DEVICE_LINE("pit8253", pit_irq_2) },
+ { 0, DEVCB_LINE_VCC, DEVCB_DRIVER_LINE_MEMBER(mz_state,pit_irq_2) },
}
};
@@ -407,24 +402,21 @@ WRITE8_MEMBER(mz_state::mz700_bank_6_w)
/* Timer 0 is the clock for the speaker output */
-static WRITE_LINE_DEVICE_HANDLER( pit_out0_changed )
+WRITE_LINE_MEMBER(mz_state::pit_out0_changed)
{
- mz_state *drvstate = device->machine().driver_data<mz_state>();
- device_t *speaker = device->machine().device(SPEAKER_TAG);
- if((drvstate->m_prev_state==0) && (state==1)) {
- drvstate->m_speaker_level ^= 1;
+ device_t *speaker = machine().device(SPEAKER_TAG);
+ if((m_prev_state==0) && (state==1)) {
+ m_speaker_level ^= 1;
}
- drvstate->m_prev_state = state;
- speaker_level_w( speaker, drvstate->m_speaker_level);
+ m_prev_state = state;
+ speaker_level_w( speaker, m_speaker_level);
}
/* timer 2 is the AM/PM (12 hour) interrupt */
-static WRITE_LINE_DEVICE_HANDLER( pit_irq_2 )
+WRITE_LINE_MEMBER(mz_state::pit_irq_2)
{
- mz_state *mz = device->machine().driver_data<mz_state>();
-
- if (!mz->m_intmsk)
- device->machine().device("maincpu")->execute().set_input_line(0, state);
+ if (!m_intmsk)
+ machine().device("maincpu")->execute().set_input_line(0, state);
}
@@ -432,8 +424,9 @@ static WRITE_LINE_DEVICE_HANDLER( pit_irq_2 )
8255 PPI
***************************************************************************/
-static READ8_DEVICE_HANDLER( pio_port_b_r )
+READ8_MEMBER(mz_state::pio_port_b_r)
{
+ device_t *device = machine().device("ls145");
int key_line = dynamic_cast<ttl74145_device *>(device)->read();
const char *const keynames[10] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8", "ROW9" };
int i;
@@ -442,7 +435,7 @@ static READ8_DEVICE_HANDLER( pio_port_b_r )
for(i=0;i<10;i++)
{
if(key_line & (1 << i))
- res |= space.machine().root_device().ioport(keynames[i])->read();
+ res |= machine().root_device().ioport(keynames[i])->read();
}
return res;
@@ -454,10 +447,9 @@ static READ8_DEVICE_HANDLER( pio_port_b_r )
* bit 5 in tape data (RDATA)
* bit 4 in motor (1 = on)
*/
-static READ8_DEVICE_HANDLER( pio_port_c_r )
+READ8_MEMBER(mz_state::pio_port_c_r)
{
- cassette_image_device *cas = space.machine().device<cassette_image_device>(CASSETTE_TAG);
- mz_state *mz = space.machine().driver_data<mz_state>();
+ cassette_image_device *cas = machine().device<cassette_image_device>(CASSETTE_TAG);
UINT8 data = 0;
/* note: this is actually connected to Q output of the motor-control flip-flop (see below) */
@@ -467,20 +459,21 @@ static READ8_DEVICE_HANDLER( pio_port_c_r )
if ((cas)->input() > 0.0038)
data |= 0x20; /* set the RDATA status */
- data |= mz->m_cursor_timer << 6;
- data |= space.machine().primary_screen->vblank() << 7;
+ data |= m_cursor_timer << 6;
+ data |= machine().primary_screen->vblank() << 7;
- LOG(2,"mz700_pio_port_c_r",("%02X\n", data),space.machine());
+ LOG(2,"mz700_pio_port_c_r",("%02X\n", data),machine());
return data;
}
-static WRITE8_DEVICE_HANDLER( pio_port_a_w )
+WRITE8_MEMBER(mz_state::pio_port_a_w)
{
- timer_device *timer = space.machine().device<timer_device>("cursor");
+ device_t *device = machine().device("ls145");
+ timer_device *timer = machine().device<timer_device>("cursor");
- LOG(2,"mz700_pio_port_a_w",("%02X\n", data),space.machine());
+ LOG(2,"mz700_pio_port_a_w",("%02X\n", data),machine());
/* the ls145 is connected to PA0-PA3 */
dynamic_cast<ttl74145_device *>(device)->write(data & 0x07);
@@ -490,7 +483,7 @@ static WRITE8_DEVICE_HANDLER( pio_port_a_w )
}
-static WRITE8_DEVICE_HANDLER( pio_port_c_w )
+WRITE8_MEMBER(mz_state::pio_port_c_w)
{
/*
* bit 3 out motor control (0 = on)
@@ -499,7 +492,7 @@ static WRITE8_DEVICE_HANDLER( pio_port_c_w )
* bit 0 out unused
*/
-// UINT8 state = cassette_get_state(space.machine().device<cassette_image_device>(CASSETTE_TAG));
+// UINT8 state = cassette_get_state(machine().device<cassette_image_device>(CASSETTE_TAG));
// UINT8 action = ((~pio_port_c_output & 8) & (data & 8)); /* detect low-to-high transition */
/* The motor control circuit consists of a resistor, capacitor, invertor, nand-gate, and D flip-flop.
@@ -512,15 +505,15 @@ static WRITE8_DEVICE_HANDLER( pio_port_c_w )
If you load from the command-line or the software-picker, type in L <enter> immediately. */
#if 0
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
((data & 0x08) && mz700_motor_on) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MOTOR_DISABLED);
#endif
- LOG(2,"mz700_pio_port_c_w",("%02X\n", data),space.machine());
+ LOG(2,"mz700_pio_port_c_w",("%02X\n", data),machine());
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x02) ? +1.0 : -1.0);
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x02) ? +1.0 : -1.0);
}
@@ -543,21 +536,21 @@ static void mz800_z80pio_irq(device_t *device, int which)
device->machine().device("maincpu")->execute().set_input_line(0, which);
}
-static READ8_DEVICE_HANDLER( mz800_z80pio_port_a_r )
+READ8_MEMBER(mz_state::mz800_z80pio_port_a_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
UINT8 result = 0;
result |= centronics->busy_r();
result |= centronics->pe_r() << 1;
- result |= space.machine().primary_screen->hblank() << 5;
+ result |= machine().primary_screen->hblank() << 5;
return result;
}
-static WRITE8_DEVICE_HANDLER( mz800_z80pio_port_a_w )
+WRITE8_MEMBER(mz_state::mz800_z80pio_port_a_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
centronics->init_prime_w(BIT(data, 6));
centronics->strobe_w(BIT(data, 7));
@@ -566,8 +559,8 @@ static WRITE8_DEVICE_HANDLER( mz800_z80pio_port_a_w )
const z80pio_interface mz800_z80pio_config =
{
DEVCB_DEVICE_LINE("z80pio", mz800_z80pio_irq),
- DEVCB_DEVICE_HANDLER("z80pio", mz800_z80pio_port_a_r),
- DEVCB_DEVICE_HANDLER("z80pio", mz800_z80pio_port_a_w),
+ DEVCB_DRIVER_MEMBER(mz_state,mz800_z80pio_port_a_r),
+ DEVCB_DRIVER_MEMBER(mz_state,mz800_z80pio_port_a_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_DEVICE_MEMBER("centronics", centronics_device, write),
diff --git a/src/mess/machine/nascom1.c b/src/mess/machine/nascom1.c
index 80189051eff..7551d7a6507 100644
--- a/src/mess/machine/nascom1.c
+++ b/src/mess/machine/nascom1.c
@@ -39,23 +39,21 @@
*
*************************************/
-static WRITE_LINE_DEVICE_HANDLER( nascom2_fdc_intrq_w )
+WRITE_LINE_MEMBER(nascom1_state::nascom2_fdc_intrq_w)
{
- nascom1_state *drvstate = device->machine().driver_data<nascom1_state>();
- drvstate->m_nascom2_fdc.irq = state;
+ m_nascom2_fdc.irq = state;
}
-static WRITE_LINE_DEVICE_HANDLER( nascom2_fdc_drq_w )
+WRITE_LINE_MEMBER(nascom1_state::nascom2_fdc_drq_w)
{
- nascom1_state *drvstate = device->machine().driver_data<nascom1_state>();
- drvstate->m_nascom2_fdc.drq = state;
+ m_nascom2_fdc.drq = state;
}
const wd17xx_interface nascom2_wd17xx_interface =
{
DEVCB_LINE_VCC,
- DEVCB_LINE(nascom2_fdc_intrq_w),
- DEVCB_LINE(nascom2_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(nascom1_state,nascom2_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(nascom1_state,nascom2_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
@@ -170,13 +168,13 @@ READ8_MEMBER(nascom1_state::nascom1_port_02_r)
}
-READ8_DEVICE_HANDLER( nascom1_hd6402_si )
+READ8_MEMBER(nascom1_state::nascom1_hd6402_si)
{
return 1;
}
-WRITE8_DEVICE_HANDLER( nascom1_hd6402_so )
+WRITE8_MEMBER(nascom1_state::nascom1_hd6402_so)
{
}
diff --git a/src/mess/machine/oric.c b/src/mess/machine/oric.c
index f694af217c9..69a4b6f2ad0 100644
--- a/src/mess/machine/oric.c
+++ b/src/mess/machine/oric.c
@@ -134,36 +134,33 @@ WRITE8_MEMBER(oric_state::oric_psg_porta_write)
/* bit 0 = BC1 state */
/* this port is also used to read printer data */
-static READ8_DEVICE_HANDLER ( oric_via_in_a_func )
+READ8_MEMBER(oric_state::oric_via_in_a_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
-
/*logerror("port a read\r\n"); */
/* access psg? */
- if (state->m_psg_control!=0)
+ if (m_psg_control!=0)
{
/* if psg is in read register state return reg data */
- if (state->m_psg_control==0x01)
- return ay8910_r(space.machine().device("ay8912"), space, 0);
+ if (m_psg_control==0x01)
+ return ay8910_r(machine().device("ay8912"), space, 0);
/* return high-impedance */
return 0x0ff;
}
/* correct?? */
- return state->m_via_port_a_data;
+ return m_via_port_a_data;
}
-static READ8_DEVICE_HANDLER ( oric_via_in_b_func )
+READ8_MEMBER(oric_state::oric_via_in_b_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
int data;
- oric_keyboard_sense_refresh(space.machine());
+ oric_keyboard_sense_refresh(machine());
- data = state->m_key_sense_bit;
- data |= state->m_keyboard_line & 0x07;
+ data = m_key_sense_bit;
+ data |= m_keyboard_line & 0x07;
return data;
}
@@ -209,19 +206,18 @@ static void oric_psg_connection_refresh(address_space &space)
}
}
-static WRITE8_DEVICE_HANDLER ( oric_via_out_a_func )
+WRITE8_MEMBER(oric_state::oric_via_out_a_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- state->m_via_port_a_data = data;
+ m_via_port_a_data = data;
oric_psg_connection_refresh(space);
- if (state->m_psg_control==0)
+ if (m_psg_control==0)
{
/* if psg not selected, write to printer */
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
- centronics->write(space.machine().driver_data()->generic_space(), 0, data);
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
+ centronics->write(machine().driver_data()->generic_space(), 0, data);
}
}
@@ -281,61 +277,56 @@ TIMER_CALLBACK_MEMBER(oric_state::oric_refresh_tape)
via_0->write_cb1(data);
}
-static WRITE8_DEVICE_HANDLER ( oric_via_out_b_func )
+WRITE8_MEMBER(oric_state::oric_via_out_b_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
/* KEYBOARD */
- state->m_keyboard_line = data & 0x07;
+ m_keyboard_line = data & 0x07;
/* CASSETTE */
/* cassette motor control */
- cassette_device_image(space.machine())->change_state(
+ cassette_device_image(machine())->change_state(
(data & 0x40) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MOTOR_DISABLED);
/* cassette data out */
- cassette_device_image(space.machine())->output((data & (1<<7)) ? -1.0 : +1.0);
+ cassette_device_image(machine())->output((data & (1<<7)) ? -1.0 : +1.0);
/* centronics STROBE is connected to PB4 */
centronics->strobe_w(BIT(data, 4));
oric_psg_connection_refresh(space);
- state->m_previous_portb_data = data;
+ m_previous_portb_data = data;
}
-static READ8_DEVICE_HANDLER ( oric_via_in_ca2_func )
+READ8_MEMBER(oric_state::oric_via_in_ca2_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- return state->m_psg_control & 1;
+ return m_psg_control & 1;
}
-static READ8_DEVICE_HANDLER ( oric_via_in_cb2_func )
+READ8_MEMBER(oric_state::oric_via_in_cb2_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- return (state->m_psg_control>>1) & 1;
+ return (m_psg_control>>1) & 1;
}
-static WRITE8_DEVICE_HANDLER ( oric_via_out_ca2_func )
+WRITE8_MEMBER(oric_state::oric_via_out_ca2_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- state->m_psg_control &=~1;
+ m_psg_control &=~1;
if (data)
- state->m_psg_control |=1;
+ m_psg_control |=1;
oric_psg_connection_refresh(space);
}
-static WRITE8_DEVICE_HANDLER ( oric_via_out_cb2_func )
+WRITE8_MEMBER(oric_state::oric_via_out_cb2_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- state->m_psg_control &=~2;
+ m_psg_control &=~2;
if (data)
- state->m_psg_control |=2;
+ m_psg_control |=2;
oric_psg_connection_refresh(space);
}
@@ -394,18 +385,18 @@ CB2
const via6522_interface oric_6522_interface=
{
- DEVCB_HANDLER(oric_via_in_a_func),
- DEVCB_HANDLER(oric_via_in_b_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_in_a_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_in_b_func),
DEVCB_NULL, /* printer acknowledge - handled by callback*/
DEVCB_NULL, /* tape input - handled by timer */
- DEVCB_HANDLER(oric_via_in_ca2_func),
- DEVCB_HANDLER(oric_via_in_cb2_func),
- DEVCB_HANDLER(oric_via_out_a_func),
- DEVCB_HANDLER(oric_via_out_b_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_in_ca2_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_in_cb2_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_out_a_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_out_b_func),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(oric_via_out_ca2_func),
- DEVCB_HANDLER(oric_via_out_cb2_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_out_ca2_func),
+ DEVCB_DRIVER_MEMBER(oric_state,oric_via_out_cb2_func),
DEVCB_LINE(oric_via_irq_func),
};
@@ -658,15 +649,14 @@ static void oric_jasmin_set_mem_0x0c000(running_machine &machine)
}
/* DRQ is connected to interrupt */
-static WRITE_LINE_DEVICE_HANDLER( oric_jasmin_wd179x_drq_w )
+WRITE_LINE_MEMBER(oric_state::oric_jasmin_wd179x_drq_w)
{
- oric_state *drvstate = device->machine().driver_data<oric_state>();
if (state)
- drvstate->m_irqs |= (1<<1);
+ m_irqs |= (1<<1);
else
- drvstate->m_irqs &=~(1<<1);
+ m_irqs &=~(1<<1);
- oric_refresh_ints(device->machine());
+ oric_refresh_ints(machine());
}
READ8_MEMBER(oric_state::oric_jasmin_r)
@@ -795,26 +785,24 @@ static void oric_microdisc_refresh_wd179x_ints(running_machine &machine)
oric_refresh_ints(machine);
}
-static WRITE_LINE_DEVICE_HANDLER( oric_microdisc_wd179x_intrq_w )
+WRITE_LINE_MEMBER(oric_state::oric_microdisc_wd179x_intrq_w)
{
- oric_state *drvstate = device->machine().driver_data<oric_state>();
- drvstate->m_wd179x_int_state = state;
+ m_wd179x_int_state = state;
if (state)
- drvstate->m_port_314_r &= ~(1<<7);
+ m_port_314_r &= ~(1<<7);
else
- drvstate->m_port_314_r |=(1<<7);
+ m_port_314_r |=(1<<7);
- oric_microdisc_refresh_wd179x_ints(device->machine());
+ oric_microdisc_refresh_wd179x_ints(machine());
}
-static WRITE_LINE_DEVICE_HANDLER( oric_microdisc_wd179x_drq_w )
+WRITE_LINE_MEMBER(oric_state::oric_microdisc_wd179x_drq_w)
{
- oric_state *drvstate = device->machine().driver_data<oric_state>();
if (state)
- drvstate->m_port_318_r &=~(1<<7);
+ m_port_318_r &=~(1<<7);
else
- drvstate->m_port_318_r |= (1<<7);
+ m_port_318_r |= (1<<7);
}
static void oric_microdisc_set_mem_0x0c000(running_machine &machine)
@@ -999,25 +987,25 @@ static void oric_install_microdisc_interface(running_machine &machine)
/*********************************************************/
-static WRITE_LINE_DEVICE_HANDLER( oric_wd179x_intrq_w )
+WRITE_LINE_MEMBER(oric_state::oric_wd179x_intrq_w)
{
- if ((device->machine().root_device().ioport("FLOPPY")->read() & 0x07) == ORIC_FLOPPY_INTERFACE_MICRODISC)
- oric_microdisc_wd179x_intrq_w(device, state);
+ if ((machine().root_device().ioport("FLOPPY")->read() & 0x07) == ORIC_FLOPPY_INTERFACE_MICRODISC)
+ oric_microdisc_wd179x_intrq_w(state);
}
-static WRITE_LINE_DEVICE_HANDLER( oric_wd179x_drq_w )
+WRITE_LINE_MEMBER(oric_state::oric_wd179x_drq_w)
{
- switch (device->machine().root_device().ioport("FLOPPY")->read() & 0x07)
+ switch (machine().root_device().ioport("FLOPPY")->read() & 0x07)
{
default:
case ORIC_FLOPPY_INTERFACE_NONE:
case ORIC_FLOPPY_INTERFACE_APPLE2:
return;
case ORIC_FLOPPY_INTERFACE_MICRODISC:
- oric_microdisc_wd179x_drq_w(device, state);
+ oric_microdisc_wd179x_drq_w(state);
return;
case ORIC_FLOPPY_INTERFACE_JASMIN:
- oric_jasmin_wd179x_drq_w(device, state);
+ oric_jasmin_wd179x_drq_w(state);
return;
}
}
@@ -1025,8 +1013,8 @@ static WRITE_LINE_DEVICE_HANDLER( oric_wd179x_drq_w )
const wd17xx_interface oric_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(oric_wd179x_intrq_w),
- DEVCB_LINE(oric_wd179x_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(oric_state,oric_wd179x_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(oric_state,oric_wd179x_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
@@ -1278,55 +1266,51 @@ static void telestrat_refresh_mem(running_machine &machine)
}
}
-static READ8_DEVICE_HANDLER(telestrat_via2_in_a_func)
+READ8_MEMBER(oric_state::telestrat_via2_in_a_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- //logerror("via 2 - port a %02x\n",state->m_telestrat_via2_port_a_data);
- return state->m_telestrat_via2_port_a_data;
+ //logerror("via 2 - port a %02x\n",m_telestrat_via2_port_a_data);
+ return m_telestrat_via2_port_a_data;
}
-static WRITE8_DEVICE_HANDLER(telestrat_via2_out_a_func)
+WRITE8_MEMBER(oric_state::telestrat_via2_out_a_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
//logerror("via 2 - port a w: %02x\n",data);
- state->m_telestrat_via2_port_a_data = data;
+ m_telestrat_via2_port_a_data = data;
- if (((data^state->m_telestrat_bank_selection) & 0x07)!=0)
+ if (((data^m_telestrat_bank_selection) & 0x07)!=0)
{
- state->m_telestrat_bank_selection = data & 0x07;
+ m_telestrat_bank_selection = data & 0x07;
- telestrat_refresh_mem(space.machine());
+ telestrat_refresh_mem(machine());
}
}
-static READ8_DEVICE_HANDLER(telestrat_via2_in_b_func)
+READ8_MEMBER(oric_state::telestrat_via2_in_b_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
unsigned char data = 0x01f;
/* left joystick selected? */
- if (state->m_telestrat_via2_port_b_data & (1<<6))
+ if (m_telestrat_via2_port_b_data & (1<<6))
{
- data &= state->ioport("JOY0")->read();
+ data &= ioport("JOY0")->read();
}
/* right joystick selected? */
- if (state->m_telestrat_via2_port_b_data & (1<<7))
+ if (m_telestrat_via2_port_b_data & (1<<7))
{
- data &= space.machine().root_device().ioport("JOY1")->read();
+ data &= machine().root_device().ioport("JOY1")->read();
}
- data |= state->m_telestrat_via2_port_b_data & ((1<<7) | (1<<6) | (1<<5));
+ data |= m_telestrat_via2_port_b_data & ((1<<7) | (1<<6) | (1<<5));
return data;
}
-static WRITE8_DEVICE_HANDLER(telestrat_via2_out_b_func)
+WRITE8_MEMBER(oric_state::telestrat_via2_out_b_func)
{
- oric_state *state = space.machine().driver_data<oric_state>();
- state->m_telestrat_via2_port_b_data = data;
+ m_telestrat_via2_port_b_data = data;
}
@@ -1347,14 +1331,14 @@ static void telestrat_via2_irq_func(device_t *device, int state)
const via6522_interface telestrat_via2_interface=
{
- DEVCB_HANDLER(telestrat_via2_in_a_func),
- DEVCB_HANDLER(telestrat_via2_in_b_func),
+ DEVCB_DRIVER_MEMBER(oric_state,telestrat_via2_in_a_func),
+ DEVCB_DRIVER_MEMBER(oric_state,telestrat_via2_in_b_func),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(telestrat_via2_out_a_func),
- DEVCB_HANDLER(telestrat_via2_out_b_func),
+ DEVCB_DRIVER_MEMBER(oric_state,telestrat_via2_out_a_func),
+ DEVCB_DRIVER_MEMBER(oric_state,telestrat_via2_out_b_func),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index 4181252c13e..3405c0fd298 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -27,33 +27,30 @@
-static READ8_DEVICE_HANDLER (orion_romdisk_porta_r )
+READ8_MEMBER(orion_state::orion_romdisk_porta_r)
{
- orion_state *state = space.machine().driver_data<orion_state>();
- UINT8 *romdisk = state->memregion("maincpu")->base() + 0x10000;
- return romdisk[state->m_romdisk_msb*256+state->m_romdisk_lsb];
+ UINT8 *romdisk = memregion("maincpu")->base() + 0x10000;
+ return romdisk[m_romdisk_msb*256+m_romdisk_lsb];
}
-static WRITE8_DEVICE_HANDLER (orion_romdisk_portb_w )
+WRITE8_MEMBER(orion_state::orion_romdisk_portb_w)
{
- orion_state *state = space.machine().driver_data<orion_state>();
- state->m_romdisk_lsb = data;
+ m_romdisk_lsb = data;
}
-static WRITE8_DEVICE_HANDLER (orion_romdisk_portc_w )
+WRITE8_MEMBER(orion_state::orion_romdisk_portc_w)
{
- orion_state *state = space.machine().driver_data<orion_state>();
- state->m_romdisk_msb = data;
+ m_romdisk_msb = data;
}
I8255A_INTERFACE( orion128_ppi8255_interface_1)
{
- DEVCB_HANDLER(orion_romdisk_porta_r),
+ DEVCB_DRIVER_MEMBER(orion_state,orion_romdisk_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(orion_romdisk_portb_w),
+ DEVCB_DRIVER_MEMBER(orion_state,orion_romdisk_portb_w),
DEVCB_NULL,
- DEVCB_HANDLER(orion_romdisk_portc_w)
+ DEVCB_DRIVER_MEMBER(orion_state,orion_romdisk_portc_w)
};
diff --git a/src/mess/machine/partner.c b/src/mess/machine/partner.c
index 1e23e064c2c..52444d99b33 100644
--- a/src/mess/machine/partner.c
+++ b/src/mess/machine/partner.c
@@ -26,8 +26,9 @@ DRIVER_INIT_MEMBER(partner_state,partner)
m_tape_value = 0x80;
}
-static WRITE_LINE_DEVICE_HANDLER( partner_wd17xx_drq_w )
+WRITE_LINE_MEMBER(partner_state::partner_wd17xx_drq_w)
{
+ device_t *device = machine().device("dma8257");
if (state)
i8257_drq0_w(device, 1);
}
@@ -36,7 +37,7 @@ const wd17xx_interface partner_wd17xx_interface =
{
DEVCB_LINE_GND,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("dma8257", partner_wd17xx_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(partner_state,partner_wd17xx_drq_w),
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
@@ -357,13 +358,13 @@ WRITE8_MEMBER(partner_state::partner_mem_page_w)
partner_bank_switch(machine());
}
-static WRITE_LINE_DEVICE_HANDLER( hrq_w )
+WRITE_LINE_MEMBER(partner_state::hrq_w)
{
/* HACK - this should be connected to the BUSREQ line of Z80 */
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, state);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, state);
/* HACK - this should be connected to the BUSACK line of Z80 */
- i8257_hlda_w(device, state);
+ i8257_hlda_w(machine().device("dma8257"), state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
@@ -371,7 +372,7 @@ static void memory_write_byte(address_space &space, offs_t address, UINT8 data,
I8257_INTERFACE( partner_dma )
{
- DEVCB_LINE(hrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(partner_state,hrq_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c
index b55f8a431a7..a7623a5566d 100644
--- a/src/mess/machine/pc.c
+++ b/src/mess/machine/pc.c
@@ -53,7 +53,7 @@
if(VERBOSE_PIO>=N) \
{ \
if( M ) \
- logerror("%11.6f: %-24s",machine.time().as_double(),(char*)M ); \
+ logerror("%11.6f: %-24s",machine().time().as_double(),(char*)M ); \
logerror A; \
} \
} while (0)
@@ -168,10 +168,10 @@ WRITE8_MEMBER(pc_state::pc_page_w)
}
-static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
+WRITE_LINE_MEMBER(pc_state::pc_dma_hrq_changed)
{
- pc_state *st = device->machine().driver_data<pc_state>();
- st->m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ device_t *device = machine().device("dma8237");
+ m_maincpu->set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -200,63 +200,62 @@ WRITE8_MEMBER(pc_state::pc_dma_write_byte)
}
-static READ8_DEVICE_HANDLER( pc_dma8237_fdc_dack_r )
+READ8_MEMBER(pc_state::pc_dma8237_fdc_dack_r)
{
- return pc_fdc_dack_r(space.machine(), space);
+ return pc_fdc_dack_r(machine(), space);
}
-static READ8_DEVICE_HANDLER( pc_dma8237_hdc_dack_r )
+READ8_MEMBER(pc_state::pc_dma8237_hdc_dack_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( pc_dma8237_fdc_dack_w )
+WRITE8_MEMBER(pc_state::pc_dma8237_fdc_dack_w)
{
- pc_fdc_dack_w( space.machine(), space, data );
+ pc_fdc_dack_w( machine(), space, data );
}
-static WRITE8_DEVICE_HANDLER( pc_dma8237_hdc_dack_w )
+WRITE8_MEMBER(pc_state::pc_dma8237_hdc_dack_w)
{
}
-static WRITE8_DEVICE_HANDLER( pc_dma8237_0_dack_w )
+WRITE8_MEMBER(pc_state::pc_dma8237_0_dack_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
- st->m_u73_q2 = 0;
- i8237_dreq0_w( st->m_dma8237, st->m_u73_q2 );
+ m_u73_q2 = 0;
+ i8237_dreq0_w( m_dma8237, m_u73_q2 );
}
-static WRITE_LINE_DEVICE_HANDLER( pc_dma8237_out_eop )
+WRITE_LINE_MEMBER(pc_state::pc_dma8237_out_eop)
{
- pc_fdc_set_tc_state( device->machine(), state == ASSERT_LINE ? 0 : 1 );
+ pc_fdc_set_tc_state( machine(), state == ASSERT_LINE ? 0 : 1 );
}
-static void set_dma_channel(device_t *device, int channel, int state)
+static void set_dma_channel(running_machine &machine, int channel, int state)
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = machine.driver_data<pc_state>();
if (!state) st->m_dma_channel = channel;
}
-static WRITE_LINE_DEVICE_HANDLER( pc_dack0_w ) { set_dma_channel(device, 0, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack1_w ) { set_dma_channel(device, 1, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack2_w ) { set_dma_channel(device, 2, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack3_w ) { set_dma_channel(device, 3, state); }
+WRITE_LINE_MEMBER(pc_state::pc_dack0_w){ set_dma_channel(machine(), 0, state); }
+WRITE_LINE_MEMBER(pc_state::pc_dack1_w){ set_dma_channel(machine(), 1, state); }
+WRITE_LINE_MEMBER(pc_state::pc_dack2_w){ set_dma_channel(machine(), 2, state); }
+WRITE_LINE_MEMBER(pc_state::pc_dack3_w){ set_dma_channel(machine(), 3, state); }
I8237_INTERFACE( ibm5150_dma8237_config )
{
- DEVCB_DEVICE_LINE("dma8237", pc_dma_hrq_changed),
- DEVCB_DEVICE_LINE("dma8237", pc_dma8237_out_eop),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_dma_hrq_changed),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_dma8237_out_eop),
DEVCB_DRIVER_MEMBER(pc_state, pc_dma_read_byte),
DEVCB_DRIVER_MEMBER(pc_state, pc_dma_write_byte),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_HANDLER("dma8237", pc_dma8237_fdc_dack_r), DEVCB_DEVICE_HANDLER("dma8237", pc_dma8237_hdc_dack_r) },
- { DEVCB_DEVICE_HANDLER("dma8237", pc_dma8237_0_dack_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("dma8237", pc_dma8237_fdc_dack_w), DEVCB_DEVICE_HANDLER("dma8237", pc_dma8237_hdc_dack_w) },
- { DEVCB_DEVICE_LINE("dma8237", pc_dack0_w), DEVCB_DEVICE_LINE("dma8237", pc_dack1_w), DEVCB_DEVICE_LINE("dma8237", pc_dack2_w), DEVCB_DEVICE_LINE("dma8237", pc_dack3_w) }
+ { DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(pc_state,pc_dma8237_fdc_dack_r), DEVCB_DRIVER_MEMBER(pc_state, pc_dma8237_hdc_dack_r) },
+ { DEVCB_DRIVER_MEMBER(pc_state, pc_dma8237_0_dack_w), DEVCB_NULL, DEVCB_DRIVER_MEMBER(pc_state,pc_dma8237_fdc_dack_w), DEVCB_DRIVER_MEMBER(pc_state, pc_dma8237_hdc_dack_w) },
+ { DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_dack0_w), DEVCB_DRIVER_LINE_MEMBER(pc_state, pc_dack1_w), DEVCB_DRIVER_LINE_MEMBER(pc_state, pc_dack2_w), DEVCB_DRIVER_LINE_MEMBER(pc_state, pc_dack3_w) }
};
@@ -296,21 +295,21 @@ TIMER_CALLBACK_MEMBER(pc_state::pcjr_delayed_pic8259_irq)
machine().firstcpu->set_input_line(0, param ? ASSERT_LINE : CLEAR_LINE);
}
-static WRITE_LINE_DEVICE_HANDLER( pcjr_pic8259_set_int_line )
+WRITE_LINE_MEMBER(pc_state::pcjr_pic8259_set_int_line)
{
- if ( device->machine().firstcpu->pc() == 0xF0454 )
+ if ( machine().firstcpu->pc() == 0xF0454 )
{
- pc_int_delay_timer->adjust( device->machine().firstcpu->cycles_to_attotime(1), state );
+ pc_int_delay_timer->adjust( machine().firstcpu->cycles_to_attotime(1), state );
}
else
{
- device->machine().firstcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
+ machine().firstcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
}
const struct pic8259_interface pcjr_pic8259_config =
{
- DEVCB_LINE(pcjr_pic8259_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pcjr_pic8259_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
@@ -352,22 +351,21 @@ void pc_speaker_set_input(running_machine &machine, UINT8 data)
*
*************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( ibm5150_pit8253_out1_changed )
+WRITE_LINE_MEMBER(pc_state::ibm5150_pit8253_out1_changed)
{
- pc_state *st = device->machine().driver_data<pc_state>();
/* Trigger DMA channel #0 */
- if ( st->m_out1 == 0 && state == 1 && st->m_u73_q2 == 0 )
+ if ( m_out1 == 0 && state == 1 && m_u73_q2 == 0 )
{
- st->m_u73_q2 = 1;
- i8237_dreq0_w( st->m_dma8237, st->m_u73_q2 );
+ m_u73_q2 = 1;
+ i8237_dreq0_w( m_dma8237, m_u73_q2 );
}
- st->m_out1 = state;
+ m_out1 = state;
}
-static WRITE_LINE_DEVICE_HANDLER( ibm5150_pit8253_out2_changed )
+WRITE_LINE_MEMBER(pc_state::ibm5150_pit8253_out2_changed)
{
- pc_speaker_set_input( device->machine(), state );
+ pc_speaker_set_input( machine(), state );
}
@@ -381,11 +379,11 @@ const struct pit8253_config ibm5150_pit8253_config =
}, {
XTAL_14_31818MHz/12, /* dram refresh */
DEVCB_NULL,
- DEVCB_LINE(ibm5150_pit8253_out1_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,ibm5150_pit8253_out1_changed)
}, {
XTAL_14_31818MHz/12, /* pio port c pin 4, and speaker polling enough */
DEVCB_NULL,
- DEVCB_LINE(ibm5150_pit8253_out2_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,ibm5150_pit8253_out2_changed)
}
}
};
@@ -411,7 +409,7 @@ const struct pit8253_config pcjr_pit8253_config =
}, {
XTAL_14_31818MHz/12, /* pio port c pin 4, and speaker polling enough */
DEVCB_NULL,
- DEVCB_LINE(ibm5150_pit8253_out2_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,ibm5150_pit8253_out2_changed)
}
}
};
@@ -432,7 +430,7 @@ const struct pit8253_config mc1502_pit8253_config =
}, {
XTAL_16MHz/12, /* pio port c pin 4, and speaker polling enough */
DEVCB_NULL,
- DEVCB_LINE(ibm5150_pit8253_out2_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,ibm5150_pit8253_out2_changed)
}
}
};
@@ -444,16 +442,14 @@ const struct pit8253_config mc1502_pit8253_config =
**********************************************************/
/* called when a interrupt is set/cleared from com hardware */
-static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_1 )
+WRITE_LINE_MEMBER(pc_state::pc_com_interrupt_1)
{
- pc_state *st = device->machine().driver_data<pc_state>();
- pic8259_ir4_w(st->m_pic8259, state);
+ pic8259_ir4_w(m_pic8259, state);
}
-static WRITE_LINE_DEVICE_HANDLER( pc_com_interrupt_2 )
+WRITE_LINE_MEMBER(pc_state::pc_com_interrupt_2)
{
- pc_state *st = device->machine().driver_data<pc_state>();
- pic8259_ir3_w(st->m_pic8259, state);
+ pic8259_ir3_w(m_pic8259, state);
}
const ins8250_interface ibm5150_com_interface[4]=
@@ -462,7 +458,7 @@ const ins8250_interface ibm5150_com_interface[4]=
DEVCB_DEVICE_LINE_MEMBER("serport0", serial_port_device, tx),
DEVCB_DEVICE_LINE_MEMBER("serport0", rs232_port_device, dtr_w),
DEVCB_DEVICE_LINE_MEMBER("serport0", rs232_port_device, rts_w),
- DEVCB_LINE(pc_com_interrupt_1),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_com_interrupt_1),
DEVCB_NULL,
DEVCB_NULL
},
@@ -470,7 +466,7 @@ const ins8250_interface ibm5150_com_interface[4]=
DEVCB_DEVICE_LINE_MEMBER("serport1", serial_port_device, tx),
DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, dtr_w),
DEVCB_DEVICE_LINE_MEMBER("serport1", rs232_port_device, rts_w),
- DEVCB_LINE(pc_com_interrupt_2),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_com_interrupt_2),
DEVCB_NULL,
DEVCB_NULL
},
@@ -478,7 +474,7 @@ const ins8250_interface ibm5150_com_interface[4]=
DEVCB_DEVICE_LINE_MEMBER("serport2", serial_port_device, tx),
DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, dtr_w),
DEVCB_DEVICE_LINE_MEMBER("serport2", rs232_port_device, rts_w),
- DEVCB_LINE(pc_com_interrupt_1),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_com_interrupt_1),
DEVCB_NULL,
DEVCB_NULL
},
@@ -486,7 +482,7 @@ const ins8250_interface ibm5150_com_interface[4]=
DEVCB_DEVICE_LINE_MEMBER("serport3", serial_port_device, tx),
DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, dtr_w),
DEVCB_DEVICE_LINE_MEMBER("serport3", rs232_port_device, rts_w),
- DEVCB_LINE(pc_com_interrupt_2),
+ DEVCB_DRIVER_LINE_MEMBER(pc_state,pc_com_interrupt_2),
DEVCB_NULL,
DEVCB_NULL
}
@@ -756,14 +752,11 @@ WRITE_LINE_MEMBER( pc_state::keyboard_data_w )
}
-static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
+READ8_MEMBER(pc_state::ibm5160_ppi_porta_r)
{
int data = 0xFF;
- running_machine &machine = space.machine();
- pc_state *st = space.machine().driver_data<pc_state>();
-
/* KB port A */
- if (st->m_ppi_keyboard_clear)
+ if (m_ppi_keyboard_clear)
{
/* 0 0 - no floppy drives
* 1 Not used
@@ -774,42 +767,40 @@ static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
* 01 - color 40x25
* 6-7 The number of floppy disk drives
*/
- data = space.machine().root_device().ioport("DSW0")->read();
+ data = machine().root_device().ioport("DSW0")->read();
}
else
{
- data = st->m_ppi_shift_register;
+ data = m_ppi_shift_register;
}
PIO_LOG(1,"PIO_A_r",("$%02x\n", data));
return data;
}
-static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
+READ8_MEMBER(pc_state::ibm5160_ppi_portc_r)
{
- pc_state *st = space.machine().driver_data<pc_state>();
- int timer2_output = pit8253_get_output( st->m_pit8253, 2 );
+ int timer2_output = pit8253_get_output( m_pit8253, 2 );
int data=0xff;
- running_machine &machine = space.machine();
data&=~0x80; // no parity error
data&=~0x40; // no error on expansion board
/* KB port C: equipment flags */
// if (pc_port[0x61] & 0x08)
- if (st->m_ppi_portc_switch_high)
+ if (m_ppi_portc_switch_high)
{
/* read hi nibble of S2 */
- data = (data & 0xf0) | ((space.machine().root_device().ioport("DSW0")->read() >> 4) & 0x0f);
+ data = (data & 0xf0) | ((machine().root_device().ioport("DSW0")->read() >> 4) & 0x0f);
PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
}
else
{
/* read lo nibble of S2 */
- data = (data & 0xf0) | (space.machine().root_device().ioport("DSW0")->read() & 0x0f);
+ data = (data & 0xf0) | (machine().root_device().ioport("DSW0")->read() & 0x0f);
PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
}
- if ( st->m_ppi_portb & 0x01 )
+ if ( m_ppi_portb & 0x01 )
{
data = ( data & ~0x10 ) | ( timer2_output ? 0x10 : 0x00 );
}
@@ -819,50 +810,46 @@ static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
}
-static WRITE8_DEVICE_HANDLER( ibm5160_ppi_portb_w )
+WRITE8_MEMBER(pc_state::ibm5160_ppi_portb_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
-
/* PPI controller port B*/
- st->m_ppi_portb = data;
- st->m_ppi_portc_switch_high = data & 0x08;
- st->m_ppi_keyboard_clear = data & 0x80;
- st->m_ppi_keyb_clock = data & 0x40;
- pit8253_gate2_w(st->m_pit8253, BIT(data, 0));
- pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
+ m_ppi_portb = data;
+ m_ppi_portc_switch_high = data & 0x08;
+ m_ppi_keyboard_clear = data & 0x80;
+ m_ppi_keyb_clock = data & 0x40;
+ pit8253_gate2_w(m_pit8253, BIT(data, 0));
+ pc_speaker_set_spkrdata( machine(), data & 0x02 );
- st->m_ppi_clock_signal = ( st->m_ppi_keyb_clock ) ? 1 : 0;
- st->m_pc_kbdc->clock_write_from_mb(st->m_ppi_clock_signal);
+ m_ppi_clock_signal = ( m_ppi_keyb_clock ) ? 1 : 0;
+ m_pc_kbdc->clock_write_from_mb(m_ppi_clock_signal);
/* If PB7 is set clear the shift register and reset the IRQ line */
- if ( st->m_ppi_keyboard_clear )
+ if ( m_ppi_keyboard_clear )
{
- pic8259_ir1_w(st->m_pic8259, 0);
- st->m_ppi_shift_register = 0;
- st->m_ppi_shift_enable = 1;
+ pic8259_ir1_w(m_pic8259, 0);
+ m_ppi_shift_register = 0;
+ m_ppi_shift_enable = 1;
}
}
I8255_INTERFACE( ibm5160_ppi8255_interface )
{
- DEVCB_HANDLER(ibm5160_ppi_porta_r),
+ DEVCB_DRIVER_MEMBER(pc_state,ibm5160_ppi_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(ibm5160_ppi_portb_w),
- DEVCB_HANDLER(ibm5160_ppi_portc_r),
+ DEVCB_DRIVER_MEMBER(pc_state,ibm5160_ppi_portb_w),
+ DEVCB_DRIVER_MEMBER(pc_state,ibm5160_ppi_portc_r),
DEVCB_NULL
};
-static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
+READ8_MEMBER(pc_state::pc_ppi_porta_r)
{
int data = 0xFF;
- running_machine &machine = space.machine();
- pc_state *st = space.machine().driver_data<pc_state>();
/* KB port A */
- if (st->m_ppi_keyboard_clear)
+ if (m_ppi_keyboard_clear)
{
/* 0 0 - no floppy drives
* 1 Not used
@@ -873,7 +860,7 @@ static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
* 01 - color 40x25
* 6-7 The number of floppy disk drives
*/
- data = space.machine().root_device().ioport("DSW0")->read();
+ data = machine().root_device().ioport("DSW0")->read();
}
else
{
@@ -884,30 +871,29 @@ static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
}
-static WRITE8_DEVICE_HANDLER( pc_ppi_portb_w )
+WRITE8_MEMBER(pc_state::pc_ppi_portb_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
/* PPI controller port B*/
- st->m_ppi_portb = data;
- st->m_ppi_portc_switch_high = data & 0x08;
- st->m_ppi_keyboard_clear = data & 0x80;
- st->m_ppi_keyb_clock = data & 0x40;
- pit8253_gate2_w(st->m_pit8253, BIT(data, 0));
- pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
- pc_keyb_set_clock( st->m_ppi_keyb_clock );
-
- if ( st->m_ppi_keyboard_clear )
+ m_ppi_portb = data;
+ m_ppi_portc_switch_high = data & 0x08;
+ m_ppi_keyboard_clear = data & 0x80;
+ m_ppi_keyb_clock = data & 0x40;
+ pit8253_gate2_w(m_pit8253, BIT(data, 0));
+ pc_speaker_set_spkrdata( machine(), data & 0x02 );
+ pc_keyb_set_clock( m_ppi_keyb_clock );
+
+ if ( m_ppi_keyboard_clear )
pc_keyb_clear();
}
I8255_INTERFACE( pc_ppi8255_interface )
{
- DEVCB_HANDLER(pc_ppi_porta_r),
+ DEVCB_DRIVER_MEMBER(pc_state,pc_ppi_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pc_ppi_portb_w),
- DEVCB_HANDLER(ibm5160_ppi_portc_r),
+ DEVCB_DRIVER_MEMBER(pc_state,pc_ppi_portb_w),
+ DEVCB_DRIVER_MEMBER(pc_state,ibm5160_ppi_portc_r),
DEVCB_NULL
};
@@ -958,123 +944,106 @@ TIMER_CALLBACK_MEMBER(pc_state::mc1502_keyb_signal_callback)
}
}
-static READ8_DEVICE_HANDLER ( mc1502_ppi_porta_r )
+READ8_MEMBER(pc_state::mc1502_ppi_porta_r)
{
- running_machine &machine = space.machine();
-
- DBG_LOG(1,"mc1502_ppi_porta_r",("= %02X\n", mc1502_keyb.latch));
+// DBG_LOG(1,"mc1502_ppi_porta_r",("= %02X\n", mc1502_keyb.latch));
return mc1502_keyb.latch;
}
-static WRITE8_DEVICE_HANDLER ( mc1502_ppi_porta_w )
+WRITE8_MEMBER(pc_state::mc1502_ppi_porta_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
- running_machine &machine = space.machine();
-
- DBG_LOG(1,"mc1502_ppi_porta_w",("( %02X )\n", data));
+// DBG_LOG(1,"mc1502_ppi_porta_w",("( %02X )\n", data));
mc1502_keyb.latch = data;
if (mc1502_keyb.pulsing)
mc1502_keyb.pulsing--;
- pic8259_ir1_w(st->m_pic8259, 0);
+ pic8259_ir1_w(m_pic8259, 0);
}
-static WRITE8_DEVICE_HANDLER ( mc1502_ppi_portb_w )
+WRITE8_MEMBER(pc_state::mc1502_ppi_portb_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
- running_machine &machine = space.machine();
-
- DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
- st->m_ppi_portb = data;
- pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
+// DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
+ m_ppi_portb = data;
+ pit8253_gate2_w(machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( machine(), data & 0x02 );
}
-static READ8_DEVICE_HANDLER ( mc1502_ppi_portc_r )
+READ8_MEMBER(pc_state::mc1502_ppi_portc_r)
{
- running_machine &machine = space.machine();
- pc_state *st = space.machine().driver_data<pc_state>();
- int timer2_output = pit8253_get_output( space.machine().device("pit8253"), 2 );
+ int timer2_output = pit8253_get_output( machine().device("pit8253"), 2 );
int data = 0xff;
- double tap_val = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ double tap_val = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
// 0x80 -- serial RxD
// 0x40 -- CASS IN, also loops back T2OUT (gated by CASWR)
- data = ( data & ~0x40 ) | ( tap_val < 0 ? 0x40 : 0x00 ) | ( (BIT(st->m_ppi_portb, 7) && timer2_output) ? 0x40 : 0x00 );
+ data = ( data & ~0x40 ) | ( tap_val < 0 ? 0x40 : 0x00 ) | ( (BIT(m_ppi_portb, 7) && timer2_output) ? 0x40 : 0x00 );
// 0x20 -- T2OUT
data = ( data & ~0x20 ) | ( timer2_output ? 0x20 : 0x00 );
// 0x10 -- SNDOUT
- data = ( data & ~0x10 ) | ( (BIT(st->m_ppi_portb, 1) && timer2_output) ? 0x10 : 0x00 );
+ data = ( data & ~0x10 ) | ( (BIT(m_ppi_portb, 1) && timer2_output) ? 0x10 : 0x00 );
- DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
- data, tap_val, timer2_output, machine.describe_context()));
+// DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
+// data, tap_val, timer2_output, machine().describe_context()));
return data;
}
-static READ8_DEVICE_HANDLER ( mc1502_kppi_porta_r )
+READ8_MEMBER(pc_state::mc1502_kppi_porta_r)
{
- running_machine &machine = space.machine();
UINT8 key = 0;
- if (mc1502_keyb.mask & 0x0001) { key |= machine.root_device().ioport("Y1")->read(); }
- if (mc1502_keyb.mask & 0x0002) { key |= machine.root_device().ioport("Y2")->read(); }
- if (mc1502_keyb.mask & 0x0004) { key |= machine.root_device().ioport("Y3")->read(); }
- if (mc1502_keyb.mask & 0x0008) { key |= machine.root_device().ioport("Y4")->read(); }
- if (mc1502_keyb.mask & 0x0010) { key |= machine.root_device().ioport("Y5")->read(); }
- if (mc1502_keyb.mask & 0x0020) { key |= machine.root_device().ioport("Y6")->read(); }
- if (mc1502_keyb.mask & 0x0040) { key |= machine.root_device().ioport("Y7")->read(); }
- if (mc1502_keyb.mask & 0x0080) { key |= machine.root_device().ioport("Y8")->read(); }
- if (mc1502_keyb.mask & 0x0100) { key |= machine.root_device().ioport("Y9")->read(); }
- if (mc1502_keyb.mask & 0x0200) { key |= machine.root_device().ioport("Y10")->read(); }
- if (mc1502_keyb.mask & 0x0400) { key |= machine.root_device().ioport("Y11")->read(); }
- if (mc1502_keyb.mask & 0x0800) { key |= machine.root_device().ioport("Y12")->read(); }
+ if (mc1502_keyb.mask & 0x0001) { key |= machine().root_device().ioport("Y1")->read(); }
+ if (mc1502_keyb.mask & 0x0002) { key |= machine().root_device().ioport("Y2")->read(); }
+ if (mc1502_keyb.mask & 0x0004) { key |= machine().root_device().ioport("Y3")->read(); }
+ if (mc1502_keyb.mask & 0x0008) { key |= machine().root_device().ioport("Y4")->read(); }
+ if (mc1502_keyb.mask & 0x0010) { key |= machine().root_device().ioport("Y5")->read(); }
+ if (mc1502_keyb.mask & 0x0020) { key |= machine().root_device().ioport("Y6")->read(); }
+ if (mc1502_keyb.mask & 0x0040) { key |= machine().root_device().ioport("Y7")->read(); }
+ if (mc1502_keyb.mask & 0x0080) { key |= machine().root_device().ioport("Y8")->read(); }
+ if (mc1502_keyb.mask & 0x0100) { key |= machine().root_device().ioport("Y9")->read(); }
+ if (mc1502_keyb.mask & 0x0200) { key |= machine().root_device().ioport("Y10")->read(); }
+ if (mc1502_keyb.mask & 0x0400) { key |= machine().root_device().ioport("Y11")->read(); }
+ if (mc1502_keyb.mask & 0x0800) { key |= machine().root_device().ioport("Y12")->read(); }
key ^= 0xff;
- DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
+// DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
return key;
}
-static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portb_w )
+WRITE8_MEMBER(pc_state::mc1502_kppi_portb_w)
{
- running_machine &machine = space.machine();
-
mc1502_keyb.mask &= ~255;
mc1502_keyb.mask |= data ^ 255;
if (!BIT(data, 0))
mc1502_keyb.mask |= 1 << 11;
else
mc1502_keyb.mask &= ~(1 << 11);
- DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
+// DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
}
-static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portc_w )
+WRITE8_MEMBER(pc_state::mc1502_kppi_portc_w)
{
- running_machine &machine = space.machine();
-
mc1502_keyb.mask &= ~(7 << 8);
mc1502_keyb.mask |= ((data ^ 7) & 7) << 8;
- DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
+// DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, mc1502_keyb.mask));
}
-static WRITE8_DEVICE_HANDLER ( pcjr_ppi_portb_w )
+WRITE8_MEMBER(pc_state::pcjr_ppi_portb_w)
{
- pc_state *st = space.machine().driver_data<pc_state>();
/* KB controller port B */
- st->m_ppi_portb = data;
- st->m_ppi_portc_switch_high = data & 0x08;
- pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
+ m_ppi_portb = data;
+ m_ppi_portc_switch_high = data & 0x08;
+ pit8253_gate2_w(machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( machine(), data & 0x02 );
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
}
/*
* On a PCJR none of the port A bits are connected.
*/
-static READ8_DEVICE_HANDLER (pcjr_ppi_porta_r )
+READ8_MEMBER(pc_state::pcjr_ppi_porta_r)
{
int data;
- running_machine &machine = space.machine();
data = 0xff;
PIO_LOG(1,"PIO_A_r",("$%02x\n", data));
@@ -1093,20 +1062,19 @@ static READ8_DEVICE_HANDLER (pcjr_ppi_porta_r )
* PC6 - KYBD IN
* PC7 - (keyboard) CABLE CONNECTED
*/
-static READ8_DEVICE_HANDLER ( pcjr_ppi_portc_r )
+READ8_MEMBER(pc_state::pcjr_ppi_portc_r)
{
- pc_state *st = space.machine().driver_data<pc_state>();
- int timer2_output = pit8253_get_output( space.machine().device("pit8253"), 2 );
+ int timer2_output = pit8253_get_output( machine().device("pit8253"), 2 );
int data=0xff;
data&=~0x80;
data &= ~0x04; /* floppy drive installed */
- if ( space.machine().device<ram_device>(RAM_TAG)->size() > 64 * 1024 ) /* more than 64KB ram installed */
+ if ( machine().device<ram_device>(RAM_TAG)->size() > 64 * 1024 ) /* more than 64KB ram installed */
data &= ~0x08;
data = ( data & ~0x01 ) | ( pcjr_keyb.latch ? 0x01: 0x00 );
- if ( ! ( st->m_ppi_portb & 0x08 ) )
+ if ( ! ( m_ppi_portb & 0x08 ) )
{
- double tap_val = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ double tap_val = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
if ( tap_val < 0 )
{
@@ -1119,7 +1087,7 @@ static READ8_DEVICE_HANDLER ( pcjr_ppi_portc_r )
}
else
{
- if ( st->m_ppi_portb & 0x01 )
+ if ( m_ppi_portb & 0x01 )
{
data = ( data & ~0x10 ) | ( timer2_output ? 0x10 : 0x00 );
}
@@ -1133,32 +1101,32 @@ static READ8_DEVICE_HANDLER ( pcjr_ppi_portc_r )
I8255_INTERFACE( pcjr_ppi8255_interface )
{
- DEVCB_HANDLER(pcjr_ppi_porta_r),
+ DEVCB_DRIVER_MEMBER(pc_state,pcjr_ppi_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pcjr_ppi_portb_w),
- DEVCB_HANDLER(pcjr_ppi_portc_r),
+ DEVCB_DRIVER_MEMBER(pc_state,pcjr_ppi_portb_w),
+ DEVCB_DRIVER_MEMBER(pc_state,pcjr_ppi_portc_r),
DEVCB_NULL
};
I8255_INTERFACE( mc1502_ppi8255_interface )
{
- DEVCB_HANDLER(mc1502_ppi_porta_r),
- DEVCB_HANDLER(mc1502_ppi_porta_w),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_ppi_porta_r),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_ppi_porta_w),
DEVCB_NULL,
- DEVCB_HANDLER(mc1502_ppi_portb_w),
- DEVCB_HANDLER(mc1502_ppi_portc_r),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_ppi_portb_w),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_ppi_portc_r),
DEVCB_NULL
};
I8255_INTERFACE( mc1502_ppi8255_interface_2 )
{
- DEVCB_HANDLER(mc1502_kppi_porta_r),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_kppi_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(mc1502_kppi_portb_w),
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_kppi_portb_w),
DEVCB_NULL,
- DEVCB_HANDLER(mc1502_kppi_portc_w)
+ DEVCB_DRIVER_MEMBER(pc_state,mc1502_kppi_portc_w)
};
@@ -1232,7 +1200,7 @@ static void pc_set_keyb_int(running_machine &machine, int state)
* MC1502 uses a FD1793 clone instead of uPD765
*/
-READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r )
+READ8_MEMBER(pc_state::mc1502_wd17xx_aux_r)
{
UINT8 data;
@@ -1241,39 +1209,39 @@ READ8_DEVICE_HANDLER( mc1502_wd17xx_aux_r )
return data;
}
-WRITE8_DEVICE_HANDLER( mc1502_wd17xx_aux_w )
+WRITE8_MEMBER(pc_state::mc1502_wd17xx_aux_w)
{
// master reset
- wd17xx_mr_w(device, BIT(data, 0));
+ wd17xx_mr_w(machine().device("vg93"), BIT(data, 0));
// SIDE ONE
- wd17xx_set_side(device, BIT(data, 1));
+ wd17xx_set_side(machine().device("vg93"), BIT(data, 1));
// bits 2, 3 -- motor on (drive 0, 1)
// DRIVE SEL
- wd17xx_set_drive(device, BIT(data, 4));
+ wd17xx_set_drive(machine().device("vg93"), BIT(data, 4));
}
/*
* Accesses to this port block (halt the CPU until DRQ, INTRQ or MOTOR ON)
*/
-READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r )
+READ8_MEMBER(pc_state::mc1502_wd17xx_drq_r)
{
UINT8 data;
UINT64 newpc;
- data = wd17xx_drq_r(device);
- if (!data && !wd17xx_intrq_r(device)) {
+ data = wd17xx_drq_r(machine().device("vg93"));
+ if (!data && !wd17xx_intrq_r(machine().device("vg93"))) {
/* fake cpu halt by resetting PC one insn back */
- newpc = space.machine().firstcpu->pc();
- space.machine().firstcpu->set_pc( newpc - 1 );
+ newpc = machine().firstcpu->pc();
+ machine().firstcpu->set_pc( newpc - 1 );
}
return data;
}
-READ8_DEVICE_HANDLER( mc1502_wd17xx_motor_r )
+READ8_MEMBER(pc_state::mc1502_wd17xx_motor_r)
{
UINT8 data;
diff --git a/src/mess/machine/pecom.c b/src/mess/machine/pecom.c
index 7bc636af9e7..d435037a6e2 100644
--- a/src/mess/machine/pecom.c
+++ b/src/mess/machine/pecom.c
@@ -111,16 +111,15 @@ READ8_MEMBER(pecom_state::pecom_keyboard_r)
/* CDP1802 Interface */
-static READ_LINE_DEVICE_HANDLER( clear_r )
+READ_LINE_MEMBER(pecom_state::clear_r)
{
- pecom_state *state = device->machine().driver_data<pecom_state>();
-
- return state->m_reset;
+ return m_reset;
}
-static READ_LINE_DEVICE_HANDLER( ef2_r )
+READ_LINE_MEMBER(pecom_state::ef2_r)
{
- int shift = BIT(device->machine().root_device().ioport("CNT")->read(), 1);
+ device_t *device = machine().device(CASSETTE_TAG);
+ int shift = BIT(machine().root_device().ioport("CNT")->read(), 1);
double cas = dynamic_cast<cassette_image_device *>(device)->input();
return (cas > 0.0) | shift;
@@ -148,8 +147,9 @@ static COSMAC_EF_READ( pecom64_ef_r )
return flags;
}
*/
-static WRITE_LINE_DEVICE_HANDLER( pecom64_q_w )
+WRITE_LINE_MEMBER(pecom_state::pecom64_q_w)
{
+ device_t *device = machine().device(CASSETTE_TAG);
dynamic_cast<cassette_image_device *>(device)->output(state ? -1.0 : +1.0);
}
@@ -176,12 +176,12 @@ static COSMAC_SC_WRITE( pecom64_sc_w )
COSMAC_INTERFACE( pecom64_cdp1802_config )
{
DEVCB_LINE_VCC,
- DEVCB_LINE(clear_r),
+ DEVCB_DRIVER_LINE_MEMBER(pecom_state,clear_r),
DEVCB_NULL,
- DEVCB_DEVICE_LINE(CASSETTE_TAG, ef2_r),
+ DEVCB_DRIVER_LINE_MEMBER(pecom_state,ef2_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_LINE(CASSETTE_TAG, pecom64_q_w),
+ DEVCB_DRIVER_LINE_MEMBER(pecom_state,pecom64_q_w),
DEVCB_NULL,
DEVCB_NULL,
pecom64_sc_w,
diff --git a/src/mess/machine/pet.c b/src/mess/machine/pet.c
index e263e555b49..c5b9f4aa0ff 100644
--- a/src/mess/machine/pet.c
+++ b/src/mess/machine/pet.c
@@ -45,9 +45,8 @@
cb1 video sync in
cb2 cassette 1 motor out
*/
-static READ8_DEVICE_HANDLER( pia0_pa_r )
+READ8_MEMBER(pet_state::pia0_pa_r)
{
- pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -66,16 +65,16 @@ static READ8_DEVICE_HANDLER( pia0_pa_r )
UINT8 data = 0;
/* key */
- data |= state->m_keyline_select;
+ data |= m_keyline_select;
/* #1 cassette switch */
- data |= ((space.machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4;
+ data |= ((machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4;
/* #2 cassette switch */
- data |= ((space.machine().device<cassette_image_device>(CASSETTE2_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 5;
+ data |= ((machine().device<cassette_image_device>(CASSETTE2_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 5;
/* end or identify in */
- data |= state->m_ieee->eoi_r() << 6;
+ data |= m_ieee->eoi_r() << 6;
/* diagnostic jumper */
data |= 0x80;
@@ -83,9 +82,8 @@ static READ8_DEVICE_HANDLER( pia0_pa_r )
return data;
}
-static WRITE8_DEVICE_HANDLER( pia0_pa_w )
+WRITE8_MEMBER(pet_state::pia0_pa_w)
{
- pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -102,13 +100,12 @@ static WRITE8_DEVICE_HANDLER( pia0_pa_w )
*/
/* key */
- state->m_keyline_select = data & 0x0f;
+ m_keyline_select = data & 0x0f;
}
/* Keyboard reading/handling for regular keyboard */
-static READ8_DEVICE_HANDLER( kin_r )
+READ8_MEMBER(pet_state::kin_r)
{
- pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -130,107 +127,103 @@ static READ8_DEVICE_HANDLER( kin_r )
"ROW5", "ROW6", "ROW7", "ROW8", "ROW9"
};
- if (state->m_keyline_select < 10)
+ if (m_keyline_select < 10)
{
- data = space.machine().root_device().ioport(keynames[state->m_keyline_select])->read();
+ data = machine().root_device().ioport(keynames[m_keyline_select])->read();
/* Check for left-shift lock */
- if ((state->m_keyline_select == 8) && (space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((m_keyline_select == 8) && (machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
return data;
}
/* Keyboard handling for business keyboard */
-static READ8_DEVICE_HANDLER( petb_kin_r )
+READ8_MEMBER(pet_state::petb_kin_r)
{
UINT8 data = 0xff;
- pet_state *state = space.machine().driver_data<pet_state>();
static const char *const keynames[] = {
"ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
"ROW5", "ROW6", "ROW7", "ROW8", "ROW9"
};
- if (state->m_keyline_select < 10)
+ if (m_keyline_select < 10)
{
- data = space.machine().root_device().ioport(keynames[state->m_keyline_select])->read();
+ data = machine().root_device().ioport(keynames[m_keyline_select])->read();
/* Check for left-shift lock */
/* 2008-05 FP: For some reason, superpet read it in the opposite way!! */
/* While waiting for confirmation from docs, we add a workaround here. */
- if (state->m_superpet)
+ if (m_superpet)
{
- if ((state->m_keyline_select == 6) && !(space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((m_keyline_select == 6) && !(machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
else
{
- if ((state->m_keyline_select == 6) && (space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((m_keyline_select == 6) && (machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
}
return data;
}
-static READ8_DEVICE_HANDLER( cass1_r )
+READ8_MEMBER(pet_state::cass1_r)
{
// cassette 1 read
- return (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input() > +0.0) ? 1 : 0;
+ return (machine().device<cassette_image_device>(CASSETTE_TAG)->input() > +0.0) ? 1 : 0;
}
-static WRITE8_DEVICE_HANDLER( cass1_motor_w )
+WRITE8_MEMBER(pet_state::cass1_motor_w)
{
- pet_state *state = space.machine().driver_data<pet_state>();
if (!data)
{
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
- state->m_datasette1_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ m_datasette1_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
}
else
{
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED ,CASSETTE_MASK_MOTOR);
- state->m_datasette1_timer->reset();
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED ,CASSETTE_MASK_MOTOR);
+ m_datasette1_timer->reset();
}
}
-static WRITE_LINE_DEVICE_HANDLER( pia0_irq_w )
+WRITE_LINE_MEMBER(pet_state::pia0_irq_w)
{
- pet_state *driver_state = device->machine().driver_data<pet_state>();
-
- driver_state->m_pia0_irq = state;
- int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
+ m_pia0_irq = state;
+ int level = (m_pia0_irq | m_pia1_irq | m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
- device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
+ machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
}
const pia6821_interface pet_pia0 =
{
- DEVCB_HANDLER(pia0_pa_r), /* in_a_func */
- DEVCB_HANDLER(kin_r), /* in_b_func */
- DEVCB_HANDLER(cass1_r), /* in_ca1_func */
+ DEVCB_DRIVER_MEMBER(pet_state,pia0_pa_r), /* in_a_func */
+ DEVCB_DRIVER_MEMBER(pet_state,kin_r), /* in_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,cass1_r), /* in_ca1_func */
DEVCB_NULL, /* in_cb1_func */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
- DEVCB_HANDLER(pia0_pa_w), /* out_a_func */
+ DEVCB_DRIVER_MEMBER(pet_state,pia0_pa_w), /* out_a_func */
DEVCB_NULL, /* out_b_func */
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, eoi_w), /* out_ca2_func */
- DEVCB_HANDLER(cass1_motor_w), /* out_cb2_func */
- DEVCB_LINE(pia0_irq_w), /* irq_a_func */
- DEVCB_LINE(pia0_irq_w) /* irq_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,cass1_motor_w), /* out_cb2_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia0_irq_w), /* irq_a_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia0_irq_w) /* irq_b_func */
};
const pia6821_interface petb_pia0 =
{
- DEVCB_HANDLER(pia0_pa_r), /* in_a_func */
- DEVCB_HANDLER(petb_kin_r), /* in_b_func */
- DEVCB_HANDLER(cass1_r), /* in_ca1_func */
+ DEVCB_DRIVER_MEMBER(pet_state,pia0_pa_r), /* in_a_func */
+ DEVCB_DRIVER_MEMBER(pet_state,petb_kin_r), /* in_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,cass1_r), /* in_ca1_func */
DEVCB_NULL, /* in_cb1_func */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
- DEVCB_HANDLER(pia0_pa_w), /* out_a_func */
+ DEVCB_DRIVER_MEMBER(pet_state,pia0_pa_w), /* out_a_func */
DEVCB_NULL, /* out_b_func */
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, eoi_w), /* out_ca2_func */
- DEVCB_HANDLER(cass1_motor_w), /* out_cb2_func */
- DEVCB_LINE(pia0_irq_w), /* irq_a_func */
- DEVCB_LINE(pia0_irq_w) /* irq_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,cass1_motor_w), /* out_cb2_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia0_irq_w), /* irq_a_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia0_irq_w) /* irq_b_func */
};
/* pia at 0xe820 (ieee488)
@@ -242,14 +235,12 @@ const pia6821_interface petb_pia0 =
cb2 dav out
*/
-static WRITE_LINE_DEVICE_HANDLER( pia1_irq_w )
+WRITE_LINE_MEMBER(pet_state::pia1_irq_w)
{
- pet_state *driver_state = device->machine().driver_data<pet_state>();
+ m_pia1_irq = state;
+ int level = (m_pia0_irq | m_pia1_irq | m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
- driver_state->m_pia1_irq = state;
- int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
-
- device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
+ machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
}
const pia6821_interface pet_pia1 =
@@ -264,8 +255,8 @@ const pia6821_interface pet_pia1 =
DEVCB_DEVICE_MEMBER(IEEE488_TAG, ieee488_device, dio_w), /* out_b_func */
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, ndac_w), /* out_ca2_func */
DEVCB_DEVICE_LINE_MEMBER(IEEE488_TAG, ieee488_device, dav_w), /* out_cb2_func */
- DEVCB_LINE(pia1_irq_w), /* irq_a_func */
- DEVCB_LINE(pia1_irq_w) /* irq_b_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia1_irq_w), /* irq_a_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,pia1_irq_w) /* irq_b_func */
};
/* userport, cassettes, rest ieee488
@@ -285,7 +276,7 @@ const pia6821_interface pet_pia1 =
cb1 cassettes
cb2 user port
*/
-static READ8_DEVICE_HANDLER( via_pb_r )
+READ8_MEMBER(pet_state::via_pb_r)
{
/*
@@ -302,30 +293,29 @@ static READ8_DEVICE_HANDLER( via_pb_r )
*/
- pet_state *state = space.machine().driver_data<pet_state>();
UINT8 data = 0;
/* not data accepted in */
- data |= state->m_ieee->ndac_r();
+ data |= m_ieee->ndac_r();
/* sync in */
/* not ready for data in */
- data |= state->m_ieee->nrfd_r() << 6;
+ data |= m_ieee->nrfd_r() << 6;
/* data valid in */
- data |= state->m_ieee->dav_r() << 7;
+ data |= m_ieee->dav_r() << 7;
return data;
}
-static READ_LINE_DEVICE_HANDLER( cass2_r )
+READ_LINE_MEMBER(pet_state::cass2_r)
{
// cassette 2 read
- return (device->machine().device<cassette_image_device>(CASSETTE2_TAG)->input() > +0.0) ? 1 : 0;
+ return (machine().device<cassette_image_device>(CASSETTE2_TAG)->input() > +0.0) ? 1 : 0;
}
-static WRITE8_DEVICE_HANDLER( via_pb_w )
+WRITE8_MEMBER(pet_state::via_pb_w)
{
/*
@@ -342,64 +332,59 @@ static WRITE8_DEVICE_HANDLER( via_pb_w )
*/
- pet_state *state = space.machine().driver_data<pet_state>();
-
/* not ready for data out */
- state->m_ieee->nrfd_w(BIT(data, 1));
+ m_ieee->nrfd_w(BIT(data, 1));
/* attention out */
- state->m_ieee->atn_w(BIT(data, 2));
+ m_ieee->atn_w(BIT(data, 2));
/* cassette write */
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
- space.machine().device<cassette_image_device>(CASSETTE2_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
+ machine().device<cassette_image_device>(CASSETTE2_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
/* #2 cassette motor */
if (BIT(data, 4))
{
- space.machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
- state->m_datasette2_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
+ machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
+ m_datasette2_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
}
else
{
- space.machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
- state->m_datasette2_timer->reset();
+ machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
+ m_datasette2_timer->reset();
}
}
-static WRITE_LINE_DEVICE_HANDLER( gb_w )
+WRITE_LINE_MEMBER(pet_state::gb_w)
{
- pet_state *drvstate = device->machine().driver_data<pet_state>();
- DBG_LOG(device->machine(), 1, "address line", ("%d\n", state));
- if (state) drvstate->m_font |= 1;
- else drvstate->m_font &= ~1;
+ DBG_LOG(machine(), 1, "address line", ("%d\n", state));
+ if (state) m_font |= 1;
+ else m_font &= ~1;
}
-static WRITE_LINE_DEVICE_HANDLER( via_irq_w )
+WRITE_LINE_MEMBER(pet_state::via_irq_w)
{
- pet_state *driver_state = device->machine().driver_data<pet_state>();
-
- driver_state->m_via_irq = state;
- int level = (driver_state->m_pia0_irq | driver_state->m_pia1_irq | driver_state->m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
+ m_via_irq = state;
+ int level = (m_pia0_irq | m_pia1_irq | m_via_irq) ? ASSERT_LINE : CLEAR_LINE;
- device->machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
+ machine().firstcpu->set_input_line(INPUT_LINE_IRQ0, level);
}
const via6522_interface pet_via =
{
DEVCB_NULL, /* in_a_func */
- DEVCB_HANDLER(via_pb_r), /* in_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,via_pb_r), /* in_b_func */
DEVCB_NULL, /* in_ca1_func */
- DEVCB_LINE(cass2_r), /* in_cb1_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,cass2_r), /* in_cb1_func */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
DEVCB_NULL, /* out_a_func */
- DEVCB_HANDLER(via_pb_w), /* out_b_func */
+ DEVCB_DRIVER_MEMBER(pet_state,via_pb_w), /* out_b_func */
DEVCB_NULL, /* out_ca1_func */
- DEVCB_LINE(gb_w), /* out_ca2_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,gb_w), /* out_ca2_func */
DEVCB_NULL, /* out_ca2_func */
DEVCB_NULL, /* out_cb2_func */
- DEVCB_LINE(via_irq_w) /* out_irq_func */
+ DEVCB_DRIVER_LINE_MEMBER(pet_state,via_irq_w) /* out_irq_func */
};
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 5361cf59d1f..d53a6851f5c 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -846,78 +846,74 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
}
}
-static READ8_DEVICE_HANDLER(pk8020_porta_r)
+READ8_MEMBER(pk8020_state::pk8020_porta_r)
{
- pk8020_state *state = space.machine().driver_data<pk8020_state>();
- return 0xf0 | (state->m_takt <<1) | (state->m_text_attr)<<3;
+ return 0xf0 | (m_takt <<1) | (m_text_attr)<<3;
}
-static WRITE8_DEVICE_HANDLER(pk8020_portc_w)
+WRITE8_MEMBER(pk8020_state::pk8020_portc_w)
{
- pk8020_state *state = space.machine().driver_data<pk8020_state>();
- state->m_video_page_access =(data>>6) & 3;
- state->m_attr = (data >> 4) & 3;
- state->m_wide = (data >> 3) & 1;
- state->m_font = (data >> 2) & 1;
- state->m_video_page = (data & 3);
+ m_video_page_access =(data>>6) & 3;
+ m_attr = (data >> 4) & 3;
+ m_wide = (data >> 3) & 1;
+ m_font = (data >> 2) & 1;
+ m_video_page = (data & 3);
- state->m_portc_data = data;
+ m_portc_data = data;
}
-static WRITE8_DEVICE_HANDLER(pk8020_portb_w)
+WRITE8_MEMBER(pk8020_state::pk8020_portb_w)
{
- device_t *fdc = space.machine().device("wd1793");
+ device_t *fdc = machine().device("wd1793");
// Turn all motors off
- floppy_mon_w(floppy_get_device(space.machine(), 0), 1);
- floppy_mon_w(floppy_get_device(space.machine(), 1), 1);
- floppy_mon_w(floppy_get_device(space.machine(), 2), 1);
- floppy_mon_w(floppy_get_device(space.machine(), 3), 1);
+ floppy_mon_w(floppy_get_device(machine(), 0), 1);
+ floppy_mon_w(floppy_get_device(machine(), 1), 1);
+ floppy_mon_w(floppy_get_device(machine(), 2), 1);
+ floppy_mon_w(floppy_get_device(machine(), 3), 1);
wd17xx_set_side(fdc,BIT(data,4));
if (BIT(data,0)) {
wd17xx_set_drive(fdc,0);
- floppy_mon_w(floppy_get_device(space.machine(), 0), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
+ floppy_mon_w(floppy_get_device(machine(), 0), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 0), 1, 1);
} else if (BIT(data,1)) {
wd17xx_set_drive(fdc,1);
- floppy_mon_w(floppy_get_device(space.machine(), 1), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
+ floppy_mon_w(floppy_get_device(machine(), 1), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 1), 1, 1);
} else if (BIT(data,2)) {
wd17xx_set_drive(fdc,2);
- floppy_mon_w(floppy_get_device(space.machine(), 2), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 2), 1, 1);
+ floppy_mon_w(floppy_get_device(machine(), 2), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 2), 1, 1);
} else if (BIT(data,3)) {
wd17xx_set_drive(fdc,3);
- floppy_mon_w(floppy_get_device(space.machine(), 3), 0);
- floppy_drive_set_ready_state(floppy_get_device(space.machine(), 3), 1, 1);
+ floppy_mon_w(floppy_get_device(machine(), 3), 0);
+ floppy_drive_set_ready_state(floppy_get_device(machine(), 3), 1, 1);
}
}
-static READ8_DEVICE_HANDLER(pk8020_portc_r)
+READ8_MEMBER(pk8020_state::pk8020_portc_r)
{
- pk8020_state *state = space.machine().driver_data<pk8020_state>();
- return state->m_portc_data;
+ return m_portc_data;
}
I8255A_INTERFACE( pk8020_ppi8255_interface_1 )
{
- DEVCB_HANDLER(pk8020_porta_r),
+ DEVCB_DRIVER_MEMBER(pk8020_state,pk8020_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pk8020_portb_w),
- DEVCB_HANDLER(pk8020_portc_r),
- DEVCB_HANDLER(pk8020_portc_w)
+ DEVCB_DRIVER_MEMBER(pk8020_state,pk8020_portb_w),
+ DEVCB_DRIVER_MEMBER(pk8020_state,pk8020_portc_r),
+ DEVCB_DRIVER_MEMBER(pk8020_state,pk8020_portc_w)
};
-static WRITE8_DEVICE_HANDLER(pk8020_2_portc_w)
+WRITE8_MEMBER(pk8020_state::pk8020_2_portc_w)
{
- pk8020_state *state = space.machine().driver_data<pk8020_state>();
- device_t *speaker = space.machine().device(SPEAKER_TAG);
+ device_t *speaker = machine().device(SPEAKER_TAG);
- state->m_sound_gate = BIT(data,3);
+ m_sound_gate = BIT(data,3);
- speaker_level_w(speaker, state->m_sound_gate ? state->m_sound_level : 0);
+ speaker_level_w(speaker, m_sound_gate ? m_sound_level : 0);
}
I8255A_INTERFACE( pk8020_ppi8255_interface_2 )
@@ -927,7 +923,7 @@ I8255A_INTERFACE( pk8020_ppi8255_interface_2 )
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pk8020_2_portc_w)
+ DEVCB_DRIVER_MEMBER(pk8020_state,pk8020_2_portc_w)
};
I8255A_INTERFACE( pk8020_ppi8255_interface_3 )
@@ -940,18 +936,17 @@ I8255A_INTERFACE( pk8020_ppi8255_interface_3 )
DEVCB_NULL
};
-static WRITE_LINE_DEVICE_HANDLER( pk8020_pit_out0 )
+WRITE_LINE_MEMBER(pk8020_state::pk8020_pit_out0)
{
- pk8020_state *drvstate = device->machine().driver_data<pk8020_state>();
- device_t *speaker = device->machine().device(SPEAKER_TAG);
+ device_t *speaker = machine().device(SPEAKER_TAG);
- drvstate->m_sound_level = state;
+ m_sound_level = state;
- speaker_level_w(speaker, drvstate->m_sound_gate ? drvstate->m_sound_level : 0);
+ speaker_level_w(speaker, m_sound_gate ? m_sound_level : 0);
}
-static WRITE_LINE_DEVICE_HANDLER(pk8020_pit_out1)
+WRITE_LINE_MEMBER(pk8020_state::pk8020_pit_out1)
{
}
@@ -962,12 +957,12 @@ const struct pit8253_config pk8020_pit8253_intf =
{
XTAL_20MHz / 10,
DEVCB_NULL,
- DEVCB_LINE(pk8020_pit_out0)
+ DEVCB_DRIVER_LINE_MEMBER(pk8020_state,pk8020_pit_out0)
},
{
XTAL_20MHz / 10,
DEVCB_NULL,
- DEVCB_LINE(pk8020_pit_out1)
+ DEVCB_DRIVER_LINE_MEMBER(pk8020_state,pk8020_pit_out1)
},
{
(XTAL_20MHz / 8) / 164,
@@ -977,14 +972,14 @@ const struct pit8253_config pk8020_pit8253_intf =
}
};
-static WRITE_LINE_DEVICE_HANDLER( pk8020_pic_set_int_line )
+WRITE_LINE_MEMBER(pk8020_state::pk8020_pic_set_int_line)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? HOLD_LINE : CLEAR_LINE);
}
const struct pic8259_interface pk8020_pic8259_config =
{
- DEVCB_LINE(pk8020_pic_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(pk8020_state,pk8020_pic_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
diff --git a/src/mess/machine/pmd85.c b/src/mess/machine/pmd85.c
index dc85dacc954..ee1d489abee 100644
--- a/src/mess/machine/pmd85.c
+++ b/src/mess/machine/pmd85.c
@@ -238,45 +238,41 @@ static void c2717_update_memory(running_machine &machine)
*******************************************************************************/
-static READ8_DEVICE_HANDLER ( pmd85_ppi_0_porta_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_0_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_0_portb_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_0_portb_r)
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
static const char *const keynames[] = {
"KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7",
"KEY8", "KEY9", "KEY10", "KEY11", "KEY12", "KEY13", "KEY14", "KEY15"
};
- return device->machine().root_device().ioport(keynames[(state->m_ppi_port_outputs[0][0] & 0x0f)])->read() & device->machine().root_device().ioport("KEY15")->read();
+ return machine().root_device().ioport(keynames[(m_ppi_port_outputs[0][0] & 0x0f)])->read() & machine().root_device().ioport("KEY15")->read();
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_0_portc_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_0_portc_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_porta_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_0_porta_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[0][0] = data;
+ m_ppi_port_outputs[0][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portb_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_0_portb_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[0][1] = data;
+ m_ppi_port_outputs[0][1] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portc_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_0_portc_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[0][2] = data;
- set_led_status(space.machine(), PMD85_LED_2, (data & 0x08) ? 1 : 0);
- set_led_status(space.machine(), PMD85_LED_3, (data & 0x04) ? 1 : 0);
+ m_ppi_port_outputs[0][2] = data;
+ set_led_status(machine(), PMD85_LED_2, (data & 0x08) ? 1 : 0);
+ set_led_status(machine(), PMD85_LED_3, (data & 0x04) ? 1 : 0);
}
/*******************************************************************************
@@ -287,32 +283,30 @@ static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portc_w )
*******************************************************************************/
-static READ8_DEVICE_HANDLER ( mato_ppi_0_portb_r )
+READ8_MEMBER(pmd85_state::mato_ppi_0_portb_r)
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
int i;
UINT8 data = 0xff;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7" };
for (i = 0; i < 8; i++)
{
- if (!BIT(state->m_ppi_port_outputs[0][0], i))
- data &= device->machine().root_device().ioport(keynames[i])->read();
+ if (!BIT(m_ppi_port_outputs[0][0], i))
+ data &= machine().root_device().ioport(keynames[i])->read();
}
return data;
}
-static READ8_DEVICE_HANDLER ( mato_ppi_0_portc_r )
+READ8_MEMBER(pmd85_state::mato_ppi_0_portc_r)
{
- return device->machine().root_device().ioport("KEY8")->read() | 0x8f;
+ return machine().root_device().ioport("KEY8")->read() | 0x8f;
}
-static WRITE8_DEVICE_HANDLER ( mato_ppi_0_portc_w )
+WRITE8_MEMBER(pmd85_state::mato_ppi_0_portc_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[0][2] = data;
- set_led_status(space.machine(), PMD85_LED_2, BIT(data, 3));
- set_led_status(space.machine(), PMD85_LED_3, BIT(data, 2));
+ m_ppi_port_outputs[0][2] = data;
+ set_led_status(machine(), PMD85_LED_2, BIT(data, 3));
+ set_led_status(machine(), PMD85_LED_3, BIT(data, 2));
}
/*******************************************************************************
@@ -323,37 +317,34 @@ static WRITE8_DEVICE_HANDLER ( mato_ppi_0_portc_w )
*******************************************************************************/
-static READ8_DEVICE_HANDLER ( pmd85_ppi_1_porta_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_1_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_1_portb_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_1_portb_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_1_portc_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_1_portc_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_porta_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_1_porta_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[1][0] = data;
+ m_ppi_port_outputs[1][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portb_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_1_portb_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[1][1] = data;
+ m_ppi_port_outputs[1][1] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portc_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_1_portc_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[1][2] = data;
+ m_ppi_port_outputs[1][2] = data;
}
/*******************************************************************************
@@ -368,37 +359,34 @@ static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portc_w )
*******************************************************************************/
-static READ8_DEVICE_HANDLER ( pmd85_ppi_2_porta_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_2_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_2_portb_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_2_portb_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_2_portc_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_2_portc_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_porta_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_2_porta_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[2][0] = data;
+ m_ppi_port_outputs[2][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portb_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_2_portb_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[2][1] = data;
+ m_ppi_port_outputs[2][1] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portc_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_2_portc_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[2][2] = data;
+ m_ppi_port_outputs[2][2] = data;
}
/*******************************************************************************
@@ -456,41 +444,37 @@ const struct pit8253_config pmd85_pit8253_interface =
*******************************************************************************/
-static READ8_DEVICE_HANDLER ( pmd85_ppi_3_porta_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_3_porta_r)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- if (state->memregion("user1")->base() != NULL)
- return state->memregion("user1")->base()[state->m_ppi_port_outputs[3][1] | (state->m_ppi_port_outputs[3][2] << 8)];
+ if (memregion("user1")->base() != NULL)
+ return memregion("user1")->base()[m_ppi_port_outputs[3][1] | (m_ppi_port_outputs[3][2] << 8)];
else
return 0;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_3_portb_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_3_portb_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER ( pmd85_ppi_3_portc_r )
+READ8_MEMBER(pmd85_state::pmd85_ppi_3_portc_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_porta_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_3_porta_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[3][0] = data;
+ m_ppi_port_outputs[3][0] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portb_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_3_portb_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[3][1] = data;
+ m_ppi_port_outputs[3][1] = data;
}
-static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portc_w )
+WRITE8_MEMBER(pmd85_state::pmd85_ppi_3_portc_w)
{
- pmd85_state *state = space.machine().driver_data<pmd85_state>();
- state->m_ppi_port_outputs[3][2] = data;
+ m_ppi_port_outputs[3][2] = data;
}
/*******************************************************************************
@@ -715,75 +699,75 @@ WRITE8_MEMBER(pmd85_state::mato_io_w)
const i8255_interface pmd85_ppi8255_interface[4] =
{
{
- DEVCB_HANDLER(pmd85_ppi_0_porta_r),
- DEVCB_HANDLER(pmd85_ppi_0_porta_w),
- DEVCB_HANDLER(pmd85_ppi_0_portb_r),
- DEVCB_HANDLER(pmd85_ppi_0_portb_w),
- DEVCB_HANDLER(pmd85_ppi_0_portc_r),
- DEVCB_HANDLER(pmd85_ppi_0_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portc_w)
},
{
- DEVCB_HANDLER(pmd85_ppi_1_porta_r),
- DEVCB_HANDLER(pmd85_ppi_1_porta_w),
- DEVCB_HANDLER(pmd85_ppi_1_portb_r),
- DEVCB_HANDLER(pmd85_ppi_1_portb_w),
- DEVCB_HANDLER(pmd85_ppi_1_portc_r),
- DEVCB_HANDLER(pmd85_ppi_1_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portc_w)
},
{
- DEVCB_HANDLER(pmd85_ppi_2_porta_r),
- DEVCB_HANDLER(pmd85_ppi_2_porta_w),
- DEVCB_HANDLER(pmd85_ppi_2_portb_r),
- DEVCB_HANDLER(pmd85_ppi_2_portb_w),
- DEVCB_HANDLER(pmd85_ppi_2_portc_r),
- DEVCB_HANDLER(pmd85_ppi_2_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portc_w)
},
{
- DEVCB_HANDLER(pmd85_ppi_3_porta_r),
- DEVCB_HANDLER(pmd85_ppi_3_porta_w),
- DEVCB_HANDLER(pmd85_ppi_3_portb_r),
- DEVCB_HANDLER(pmd85_ppi_3_portb_w),
- DEVCB_HANDLER(pmd85_ppi_3_portc_r),
- DEVCB_HANDLER(pmd85_ppi_3_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_3_portc_w)
}
};
const i8255_interface alfa_ppi8255_interface[3] =
{
{
- DEVCB_HANDLER(pmd85_ppi_0_porta_r),
- DEVCB_HANDLER(pmd85_ppi_0_porta_w),
- DEVCB_HANDLER(pmd85_ppi_0_portb_r),
- DEVCB_HANDLER(pmd85_ppi_0_portb_w),
- DEVCB_HANDLER(pmd85_ppi_0_portc_r),
- DEVCB_HANDLER(pmd85_ppi_0_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portc_w)
},
{
- DEVCB_HANDLER(pmd85_ppi_1_porta_r),
- DEVCB_HANDLER(pmd85_ppi_1_porta_w),
- DEVCB_HANDLER(pmd85_ppi_1_portb_r),
- DEVCB_HANDLER(pmd85_ppi_1_portb_w),
- DEVCB_HANDLER(pmd85_ppi_1_portc_r),
- DEVCB_HANDLER(pmd85_ppi_1_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_1_portc_w)
},
{
- DEVCB_HANDLER(pmd85_ppi_2_porta_r),
- DEVCB_HANDLER(pmd85_ppi_2_porta_w),
- DEVCB_HANDLER(pmd85_ppi_2_portb_r),
- DEVCB_HANDLER(pmd85_ppi_2_portb_w),
- DEVCB_HANDLER(pmd85_ppi_2_portc_r),
- DEVCB_HANDLER(pmd85_ppi_2_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_2_portc_w)
}
};
I8255_INTERFACE( mato_ppi8255_interface )
{
- DEVCB_HANDLER(pmd85_ppi_0_porta_r),
- DEVCB_HANDLER(pmd85_ppi_0_porta_w),
- DEVCB_HANDLER(mato_ppi_0_portb_r),
- DEVCB_HANDLER(pmd85_ppi_0_portb_w),
- DEVCB_HANDLER(mato_ppi_0_portc_r),
- DEVCB_HANDLER(mato_ppi_0_portc_w)
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_porta_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,mato_ppi_0_portb_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,pmd85_ppi_0_portb_w),
+ DEVCB_DRIVER_MEMBER(pmd85_state,mato_ppi_0_portc_r),
+ DEVCB_DRIVER_MEMBER(pmd85_state,mato_ppi_0_portc_w)
};
diff --git a/src/mess/machine/pokemini.c b/src/mess/machine/pokemini.c
index e83aadae405..2e77bf78f25 100644
--- a/src/mess/machine/pokemini.c
+++ b/src/mess/machine/pokemini.c
@@ -381,9 +381,8 @@ TIMER_CALLBACK_MEMBER(pokemini_state::pokemini_timer3_hi_callback)
}
-WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
+WRITE8_MEMBER(pokemini_state::pokemini_hwreg_w)
{
- pokemini_state *state = space.machine().driver_data<pokemini_state>();
static const int timer_to_cycles_fast[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
static const int timer_to_cycles_slow[8] = { 128, 256, 512, 1024, 2048, 4096, 8192, 16384 };
@@ -401,7 +400,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
case 0x02: /* CPU related?
Bit 0-7 R/W Unknown
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
case 0x08: /* Seconds-timer control
Bit 0 R/W Timer enable
@@ -410,9 +409,9 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x09] = 0x00;
- state->m_pm_reg[0x0A] = 0x00;
- state->m_pm_reg[0x0B] = 0x00;
+ m_pm_reg[0x09] = 0x00;
+ m_pm_reg[0x0A] = 0x00;
+ m_pm_reg[0x0B] = 0x00;
data &= ~0x02;
}
break;
@@ -433,7 +432,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 5 R Battery status: 0 - battery OK, 1 - battery low
Bit 6-7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
case 0x18: /* Timer 1 pre-scale + enable
Bit 0-2 R/W low timer 1 prescaler select
@@ -450,45 +449,45 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W Enable high counting
*/
/* Check for prescaler change for the low counter */
- if ( ( data & 0x07 ) != ( state->m_pm_reg[0x18] & 0x07 ) )
+ if ( ( data & 0x07 ) != ( m_pm_reg[0x18] & 0x07 ) )
{
int index = data & 0x07;
- int cycles = ( state->m_pm_reg[0x19] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x19] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer1->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
- if ( ( data & 0x70 ) != ( state->m_pm_reg[0x18] & 0x70 ) )
+ if ( ( data & 0x70 ) != ( m_pm_reg[0x18] & 0x70 ) )
{
int index = ( data >> 4 ) & 0x07;
- int cycles = ( state->m_pm_reg[0x19] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x19] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer1_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer1 low should be enabled */
- if ( ( data & 0x08 ) && ( state->m_pm_reg[0x30] & 0x04 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x19] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x19] & 0x01 ) ) ) )
+ if ( ( data & 0x08 ) && ( m_pm_reg[0x30] & 0x04 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x19] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x19] & 0x01 ) ) ) )
{
- state->m_timers.timer1->enable( 1 );
+ m_timers.timer1->enable( 1 );
}
else
{
- state->m_timers.timer1->enable( 0 );
+ m_timers.timer1->enable( 0 );
}
/* Check if timer1 high should be enabled */
- if ( ( data & 0x80 ) && ( state->m_pm_reg[0x31] & 0x04 ) && ! ( state->m_pm_reg[0x30] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x19] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x19] & 0x02 ) ) ) )
+ if ( ( data & 0x80 ) && ( m_pm_reg[0x31] & 0x04 ) && ! ( m_pm_reg[0x30] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x19] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x19] & 0x02 ) ) ) )
{
- state->m_timers.timer1_hi->enable( 1 );
+ m_timers.timer1_hi->enable( 1 );
}
else
{
- state->m_timers.timer1_hi->enable( 0 );
+ m_timers.timer1_hi->enable( 0 );
}
break;
case 0x19: /* Timers 1 speed
@@ -500,21 +499,21 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6-7 Unused
*/
/* Check for prescaler change for the high counter */
- if ( ( data & 0x01 ) != ( state->m_pm_reg[0x19] & 0x01 ) )
+ if ( ( data & 0x01 ) != ( m_pm_reg[0x19] & 0x01 ) )
{
- int index = state->m_pm_reg[0x18] & 0x07;
+ int index = m_pm_reg[0x18] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer1->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the low counter */
- if ( ( data & 0x02 ) != ( state->m_pm_reg[0x19] & 0x02 ) )
+ if ( ( data & 0x02 ) != ( m_pm_reg[0x19] & 0x02 ) )
{
- int index = ( state->m_pm_reg[0x18] >> 4 ) & 0x07;
+ int index = ( m_pm_reg[0x18] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer1_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
{
@@ -525,43 +524,43 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
/* Check which fast timers should be enabled */
if ( data & 0x20 )
{
- if ( ( state->m_pm_reg[0x18] & 0x08 ) && ( state->m_pm_reg[0x30] & 0x04 ) && ! ( data & 0x01 ) )
+ if ( ( m_pm_reg[0x18] & 0x08 ) && ( m_pm_reg[0x30] & 0x04 ) && ! ( data & 0x01 ) )
timer1_enable = 1;
- if ( ( state->m_pm_reg[0x18] & 0x80 ) && ( state->m_pm_reg[0x31] & 0x04 ) && ! ( state->m_pm_reg[0x30] & 0x80 ) && ! ( data & 0x02 ) )
+ if ( ( m_pm_reg[0x18] & 0x80 ) && ( m_pm_reg[0x31] & 0x04 ) && ! ( m_pm_reg[0x30] & 0x80 ) && ! ( data & 0x02 ) )
timer1_hi_enable = 1;
- if ( ( state->m_pm_reg[0x1A] & 0x08 ) && ( state->m_pm_reg[0x38] & 0x04 ) && ! ( state->m_pm_reg[0x1B] & 0x01 ) )
+ if ( ( m_pm_reg[0x1A] & 0x08 ) && ( m_pm_reg[0x38] & 0x04 ) && ! ( m_pm_reg[0x1B] & 0x01 ) )
timer2_enable = 1;
- if ( ( state->m_pm_reg[0x1A] & 0x80 ) && ( state->m_pm_reg[0x39] & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) && ! ( state->m_pm_reg[0x1B] & 0x02 ) )
+ if ( ( m_pm_reg[0x1A] & 0x80 ) && ( m_pm_reg[0x39] & 0x04 ) && ! ( m_pm_reg[0x38] & 0x80 ) && ! ( m_pm_reg[0x1B] & 0x02 ) )
timer2_hi_enable = 1;
- if ( ( state->m_pm_reg[0x1C] & 0x08 ) && ( state->m_pm_reg[0x48] & 0x04 ) && ! ( state->m_pm_reg[0x1D] & 0x01 ) )
+ if ( ( m_pm_reg[0x1C] & 0x08 ) && ( m_pm_reg[0x48] & 0x04 ) && ! ( m_pm_reg[0x1D] & 0x01 ) )
timer3_enable = 1;
- if ( ( state->m_pm_reg[0x1C] & 0x80 ) && ( state->m_pm_reg[0x49] & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) && ! ( state->m_pm_reg[0x1D] & 0x02 ) )
+ if ( ( m_pm_reg[0x1C] & 0x80 ) && ( m_pm_reg[0x49] & 0x04 ) && ! ( m_pm_reg[0x48] & 0x80 ) && ! ( m_pm_reg[0x1D] & 0x02 ) )
timer3_hi_enable = 1;
}
/* Check which slow timers should be enabled */
if ( data & 0x10 )
{
- if ( ( state->m_pm_reg[0x18] & 0x08 ) && ( data & 0x01 ) )
+ if ( ( m_pm_reg[0x18] & 0x08 ) && ( data & 0x01 ) )
timer1_enable = 1;
- if ( ( state->m_pm_reg[0x1A] & 0x08 ) && ( state->m_pm_reg[0x1B] & 0x01 ) )
+ if ( ( m_pm_reg[0x1A] & 0x08 ) && ( m_pm_reg[0x1B] & 0x01 ) )
timer2_enable = 1;
- if ( ( state->m_pm_reg[0x1C] & 0x08 ) && ( state->m_pm_reg[0x1D] & 0x01 ) )
+ if ( ( m_pm_reg[0x1C] & 0x08 ) && ( m_pm_reg[0x1D] & 0x01 ) )
timer3_enable = 1;
}
- state->m_timers.timer1->enable( timer1_enable );
- state->m_timers.timer1_hi->enable( timer1_hi_enable );
- state->m_timers.timer2->enable( timer2_enable );
- state->m_timers.timer2_hi->enable( timer2_hi_enable );
- state->m_timers.timer3->enable( timer3_enable );
- state->m_timers.timer3_hi->enable( timer3_hi_enable );
+ m_timers.timer1->enable( timer1_enable );
+ m_timers.timer1_hi->enable( timer1_hi_enable );
+ m_timers.timer2->enable( timer2_enable );
+ m_timers.timer2_hi->enable( timer2_hi_enable );
+ m_timers.timer3->enable( timer3_enable );
+ m_timers.timer3_hi->enable( timer3_hi_enable );
}
break;
case 0x1A: /* Timer 2 pre-scale + enable
@@ -579,45 +578,45 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W Enable high counting
*/
/* Check for prescaler change for the low counter */
- if ( ( data & 0x07 ) != ( state->m_pm_reg[0x1A] & 0x07 ) )
+ if ( ( data & 0x07 ) != ( m_pm_reg[0x1A] & 0x07 ) )
{
int index = data & 0x07;
- int cycles = ( state->m_pm_reg[0x1B] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x1B] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer2->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
- if ( ( data & 0x70 ) != ( state->m_pm_reg[0x1A] & 0x70 ) )
+ if ( ( data & 0x70 ) != ( m_pm_reg[0x1A] & 0x70 ) )
{
int index = ( data >> 4 ) & 0x07;
- int cycles = ( state->m_pm_reg[0x1B] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x1B] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer2_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
- if ( ( data & 0x08 ) && ( state->m_pm_reg[0x38] & 0x04 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1B] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1B] & 0x01 ) ) ) )
+ if ( ( data & 0x08 ) && ( m_pm_reg[0x38] & 0x04 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1B] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1B] & 0x01 ) ) ) )
{
- state->m_timers.timer2->enable( 1 );
+ m_timers.timer2->enable( 1 );
}
else
{
- state->m_timers.timer2->enable( 0 );
+ m_timers.timer2->enable( 0 );
}
/* Check if timer2 high should be enabled */
- if ( ( data & 0x80 ) && ( state->m_pm_reg[0x39] & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1B] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1B] & 0x02 ) ) ) )
+ if ( ( data & 0x80 ) && ( m_pm_reg[0x39] & 0x04 ) && ! ( m_pm_reg[0x38] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1B] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1B] & 0x02 ) ) ) )
{
- state->m_timers.timer2_hi->enable( 1 );
+ m_timers.timer2_hi->enable( 1 );
}
else
{
- state->m_timers.timer2_hi->enable( 0 );
+ m_timers.timer2_hi->enable( 0 );
}
break;
case 0x1B: /* Timer 2 speeds
@@ -625,42 +624,42 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 1 R/W Select slow timer for timer 2 hi
*/
/* Check for prescaler change for the high counter */
- if ( ( data & 0x01 ) != ( state->m_pm_reg[0x1B] & 0x01 ) )
+ if ( ( data & 0x01 ) != ( m_pm_reg[0x1B] & 0x01 ) )
{
- int index = state->m_pm_reg[0x1A] & 0x07;
+ int index = m_pm_reg[0x1A] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer2->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
- if ( ( state->m_pm_reg[0x1A] & 0x08 ) && ( state->m_pm_reg[0x38] & 0x04 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x01 ) ) ) )
+ if ( ( m_pm_reg[0x1A] & 0x08 ) && ( m_pm_reg[0x38] & 0x04 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x01 ) ) ) )
{
- state->m_timers.timer2->enable( 1 );
+ m_timers.timer2->enable( 1 );
}
else
{
- state->m_timers.timer2->enable( 0 );
+ m_timers.timer2->enable( 0 );
}
}
/* Check for prescaler change for the low counter */
- if ( ( data & 0x02 ) != ( state->m_pm_reg[0x1B] & 0x02 ) )
+ if ( ( data & 0x02 ) != ( m_pm_reg[0x1B] & 0x02 ) )
{
- int index = ( state->m_pm_reg[0x1A] >> 4 ) & 0x07;
+ int index = ( m_pm_reg[0x1A] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer2_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
- if ( ( state->m_pm_reg[0x1A] & 0x80 ) && ( state->m_pm_reg[0x39] & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x02 ) ) ) )
+ if ( ( m_pm_reg[0x1A] & 0x80 ) && ( m_pm_reg[0x39] & 0x04 ) && ! ( m_pm_reg[0x38] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x02 ) ) ) )
{
- state->m_timers.timer2_hi->enable( 1 );
+ m_timers.timer2_hi->enable( 1 );
}
else
{
- state->m_timers.timer2_hi->enable( 0 );
+ m_timers.timer2_hi->enable( 0 );
}
}
break;
@@ -679,45 +678,45 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W Enable high counting
*/
/* Check for prescaler change for the low counter */
- if ( ( data & 0x07 ) != ( state->m_pm_reg[0x1C] & 0x07 ) )
+ if ( ( data & 0x07 ) != ( m_pm_reg[0x1C] & 0x07 ) )
{
int index = data & 0x07;
- int cycles = ( state->m_pm_reg[0x1D] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x1D] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer3->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
- if ( ( data & 0x70 ) != ( state->m_pm_reg[0x1C] & 0x70 ) )
+ if ( ( data & 0x70 ) != ( m_pm_reg[0x1C] & 0x70 ) )
{
int index = ( data >> 4 ) & 0x07;
- int cycles = ( state->m_pm_reg[0x1D] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
+ int cycles = ( m_pm_reg[0x1D] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer3_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
- if ( ( data & 0x08 ) && ( state->m_pm_reg[0x48] & 0x04 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1D] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1D] & 0x01 ) ) ) )
+ if ( ( data & 0x08 ) && ( m_pm_reg[0x48] & 0x04 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1D] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1D] & 0x01 ) ) ) )
{
- state->m_timers.timer3->enable( 1 );
+ m_timers.timer3->enable( 1 );
}
else
{
- state->m_timers.timer3->enable( 0 );
+ m_timers.timer3->enable( 0 );
}
/* Check if timer2 high should be enabled */
- if ( ( data & 0x80 ) && ( state->m_pm_reg[0x49] & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1D] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1D] & 0x02 ) ) ) )
+ if ( ( data & 0x80 ) && ( m_pm_reg[0x49] & 0x04 ) && ! ( m_pm_reg[0x48] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1D] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1D] & 0x02 ) ) ) )
{
- state->m_timers.timer3_hi->enable( 1 );
+ m_timers.timer3_hi->enable( 1 );
}
else
{
- state->m_timers.timer3_hi->enable( 0 );
+ m_timers.timer3_hi->enable( 0 );
}
break;
case 0x1D: /* Timer 3 speeds
@@ -725,42 +724,42 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 1 R/W Select slow timer for timer 3 hi
*/
/* Check for prescaler change for the high counter */
- if ( ( data & 0x01 ) != ( state->m_pm_reg[0x1D] & 0x01 ) )
+ if ( ( data & 0x01 ) != ( m_pm_reg[0x1D] & 0x01 ) )
{
- int index = state->m_pm_reg[0x1C] & 0x07;
+ int index = m_pm_reg[0x1C] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer3->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
- if ( ( state->m_pm_reg[0x1C] & 0x08 ) && ( state->m_pm_reg[0x48] & 0x04 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x01 ) ) ) )
+ if ( ( m_pm_reg[0x1C] & 0x08 ) && ( m_pm_reg[0x48] & 0x04 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x01 ) ) ) )
{
- state->m_timers.timer3->enable( 1 );
+ m_timers.timer3->enable( 1 );
}
else
{
- state->m_timers.timer3->enable( 0 );
+ m_timers.timer3->enable( 0 );
}
}
/* Check for prescaler change for the low counter */
- if ( ( data & 0x02 ) != ( state->m_pm_reg[0x1D] & 0x02 ) )
+ if ( ( data & 0x02 ) != ( m_pm_reg[0x1D] & 0x02 ) )
{
- int index = ( state->m_pm_reg[0x1C] >> 4 ) & 0x07;
+ int index = ( m_pm_reg[0x1C] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ m_timers.timer3_hi->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
- if ( ( state->m_pm_reg[0x1C] & 0x80 ) && ( state->m_pm_reg[0x49] & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x02 ) ) ) )
+ if ( ( m_pm_reg[0x1C] & 0x80 ) && ( m_pm_reg[0x49] & 0x04 ) && ! ( m_pm_reg[0x48] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x20 ) && ! ( data & 0x02 ) ) ) )
{
- state->m_timers.timer3_hi->enable( 1 );
+ m_timers.timer3_hi->enable( 1 );
}
else
{
- state->m_timers.timer3_hi->enable( 0 );
+ m_timers.timer3_hi->enable( 0 );
}
}
break;
@@ -770,23 +769,23 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 4-5 R/W Timer 2 overflow Interrupt #3-#4
Bit 6-7 R/W VDraw/VBlank trigger Interrupt #1-#2
*/
- state->m_pm_reg[0x20] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x20] = data;
+ pokemini_check_irqs(machine());
break;
case 0x21: /* Event #15-#22 priority
Bit 0-1 R/W Unknown
Bit 2-3 R/W All keypad interrupts - Interrupt #15-#22
Bit 4-7 R/W Unknown
*/
- state->m_pm_reg[0x21] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x21] = data;
+ pokemini_check_irqs(machine());
break;
case 0x22: /* Event #9-#14 priority
Bit 0-1 R/W All #9 - #14 events - Interrupt #9-#14
Bit 2-7 Unused
*/
- state->m_pm_reg[0x22] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x22] = data;
+ pokemini_check_irqs(machine());
break;
case 0x23: /* Event #1-#8 enable
Bit 0 R/W Timer 3 overflow (mirror) - Enable Interrupt #8
@@ -798,15 +797,15 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 R/W V-Draw trigger - Enable Interrupt #2
Bit 7 R/W V-Blank trigger - Enable Interrupt #1
*/
- state->m_pm_reg[0x23] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x23] = data;
+ pokemini_check_irqs(machine());
break;
case 0x24: /* Event #9-#12 enable
Bit 0-5 R/W Unknown
Bit 6-7 Unused
*/
- state->m_pm_reg[0x24] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x24] = data;
+ pokemini_check_irqs(machine());
break;
case 0x25: /* Event #15-#22 enable
Bit 0 R/W Press key "A" event - Enable interrupt #22
@@ -818,8 +817,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 R/W Press D-pad right key event - Enable interrupt #16
Bit 7 R/W Press power button event - Enable interrupt #15
*/
- state->m_pm_reg[0x25] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x25] = data;
+ pokemini_check_irqs(machine());
break;
case 0x26: /* Event #13-#14 enable
Bit 0-2 R/W Unknown
@@ -828,8 +827,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 R/W Shock detector trigger - Enable interrupt #14
Bit 7 R/W IR receiver - low to high trigger - Enable interrupt #13
*/
- state->m_pm_reg[0x26] = data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x26] = data;
+ pokemini_check_irqs(machine());
break;
case 0x27: /* Interrupt active flag #1-#8
Bit 0 Timer 3 overflow (mirror) / Clear interrupt #8
@@ -841,8 +840,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 VDraw trigger / Clear interrupt #2
Bit 7 VBlank trigger / Clear interrupt #1
*/
- state->m_pm_reg[0x27] &= ~data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x27] &= ~data;
+ pokemini_check_irqs(machine());
return;
case 0x28: /* Interrupt active flag #9-#12
Bit 0-1 Unknown
@@ -852,8 +851,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 5 Unknown / Clear interrupt #9
Bit 6-7 Unknown
*/
- state->m_pm_reg[0x28] &= ~data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x28] &= ~data;
+ pokemini_check_irqs(machine());
return;
case 0x29: /* Interrupt active flag #15-#22
Bit 0 Press key "A" event / Clear interrupt #22
@@ -865,16 +864,16 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 Press D-pad right key event / Clear interrupt #16
Bit 7 Press power button event / Clear interrupt #15
*/
- state->m_pm_reg[0x29] &= ~data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x29] &= ~data;
+ pokemini_check_irqs(machine());
return;
case 0x2A: /* Interrupt active flag #13-#14
Bit 0-5 Unknown
Bit 6 Shock detector trigger / Clear interrupt #14
Bit 7 Unknown / Clear interrupt #13
*/
- state->m_pm_reg[0x2A] &= ~data;
- pokemini_check_irqs(space.machine());
+ m_pm_reg[0x2A] &= ~data;
+ pokemini_check_irqs(machine());
return;
case 0x30: /* Timer 1 control 1
Bit 0 R/W Unknown
@@ -886,30 +885,30 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x36] = state->m_pm_reg[0x32];
+ m_pm_reg[0x36] = m_pm_reg[0x32];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ( state->m_pm_reg[0x18] & 0x08 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x19] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x19] & 0x01 ) ) ) )
+ if ( ( data & 0x04 ) && ( m_pm_reg[0x18] & 0x08 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x19] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x19] & 0x01 ) ) ) )
{
- state->m_timers.timer1->enable( 1 );
+ m_timers.timer1->enable( 1 );
}
else
{
- state->m_timers.timer1->enable( 0 );
+ m_timers.timer1->enable( 0 );
}
- if ( ( state->m_pm_reg[0x31] & 0x04 ) && ! ( data & 0x80 ) && ( state->m_pm_reg[0x18] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x19] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x19] & 0x02 ) ) ) )
+ if ( ( m_pm_reg[0x31] & 0x04 ) && ! ( data & 0x80 ) && ( m_pm_reg[0x18] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x19] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x19] & 0x02 ) ) ) )
{
- state->m_timers.timer1_hi->enable( 1 );
+ m_timers.timer1_hi->enable( 1 );
}
else
{
- state->m_timers.timer1_hi->enable( 0 );
+ m_timers.timer1_hi->enable( 0 );
}
break;
case 0x31: /* Timer 1 control 2
@@ -921,19 +920,19 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x37] = state->m_pm_reg[0x33];
+ m_pm_reg[0x37] = m_pm_reg[0x33];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ! ( state->m_pm_reg[0x30] & 0x80 ) && ( state->m_pm_reg[0x18] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x19] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x19] & 0x02 ) ) ) )
+ if ( ( data & 0x04 ) && ! ( m_pm_reg[0x30] & 0x80 ) && ( m_pm_reg[0x18] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x19] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x19] & 0x02 ) ) ) )
{
- state->m_timers.timer1_hi->enable( 1 );
+ m_timers.timer1_hi->enable( 1 );
}
else
{
- state->m_timers.timer1_hi->enable( 0 );
+ m_timers.timer1_hi->enable( 0 );
}
break;
case 0x32: /* Timer 1 preset value (low)
@@ -948,7 +947,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x35: /* Timer 1 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
case 0x36: /* Timer 1 counter (low), read only
*/
@@ -966,29 +965,29 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x3E] = state->m_pm_reg[0x3A];
+ m_pm_reg[0x3E] = m_pm_reg[0x3A];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ( state->m_pm_reg[0x1A] & 0x08 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1A] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1A] & 0x01 ) ) ) )
+ if ( ( data & 0x04 ) && ( m_pm_reg[0x1A] & 0x08 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1A] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1A] & 0x01 ) ) ) )
{
- state->m_timers.timer2->enable( 1 );
+ m_timers.timer2->enable( 1 );
}
else
{
- state->m_timers.timer2->enable( 0 );
+ m_timers.timer2->enable( 0 );
}
- if ( ( state->m_pm_reg[0x39] & 0x04 ) && ! ( data & 0x80 ) && ( state->m_pm_reg[0x1A] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1B] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1B] & 0x02 ) ) ) )
+ if ( ( m_pm_reg[0x39] & 0x04 ) && ! ( data & 0x80 ) && ( m_pm_reg[0x1A] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1B] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1B] & 0x02 ) ) ) )
{
- state->m_timers.timer2_hi->enable( 1 );
+ m_timers.timer2_hi->enable( 1 );
}
else
{
- state->m_timers.timer2_hi->enable( 0 );
+ m_timers.timer2_hi->enable( 0 );
}
break;
case 0x39: /* Timer 2 control 2
@@ -1000,19 +999,19 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x3F] = state->m_pm_reg[0x3A];
+ m_pm_reg[0x3F] = m_pm_reg[0x3A];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) && ( state->m_pm_reg[0x1A] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1B] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1B] & 0x02 ) ) ) )
+ if ( ( data & 0x04 ) && ! ( m_pm_reg[0x38] & 0x80 ) && ( m_pm_reg[0x1A] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1B] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1B] & 0x02 ) ) ) )
{
- state->m_timers.timer2_hi->enable( 1 );
+ m_timers.timer2_hi->enable( 1 );
}
else
{
- state->m_timers.timer2_hi->enable( 0 );
+ m_timers.timer2_hi->enable( 0 );
}
break;
case 0x3A: /* Timer 2 preset value (low)
@@ -1027,7 +1026,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x3D: /* Timer 2 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
case 0x3E: /* Timer 2 counter (low), read only
Bit 0-7 R/W Timer 2 counter value bit 0-7
@@ -1044,7 +1043,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x41] = 0;
+ m_pm_reg[0x41] = 0;
data &= ~0x02;
}
break;
@@ -1062,32 +1061,32 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x4E] = state->m_pm_reg[0x4A];
+ m_pm_reg[0x4E] = m_pm_reg[0x4A];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ( state->m_pm_reg[0x1C] & 0x08 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1D] & 0x01 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1D] & 0x01 ) ) ) )
+ if ( ( data & 0x04 ) && ( m_pm_reg[0x1C] & 0x08 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1D] & 0x01 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1D] & 0x01 ) ) ) )
{
- state->m_timers.timer3->enable( 1 );
+ m_timers.timer3->enable( 1 );
}
else
{
- state->m_timers.timer3->enable( 0 );
+ m_timers.timer3->enable( 0 );
}
- if ( ( state->m_pm_reg[0x49] & 0x04 ) && ! ( data & 0x80 ) && ( state->m_pm_reg[0x1C] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1D] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1D] & 0x02 ) ) ) )
+ if ( ( m_pm_reg[0x49] & 0x04 ) && ! ( data & 0x80 ) && ( m_pm_reg[0x1C] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1D] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1D] & 0x02 ) ) ) )
{
- state->m_timers.timer3_hi->enable( 1 );
+ m_timers.timer3_hi->enable( 1 );
}
else
{
- state->m_timers.timer3_hi->enable( 0 );
+ m_timers.timer3_hi->enable( 0 );
}
- state->m_pm_reg[0x48] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x48] = data;
+ pokemini_update_sound(machine());
break;
case 0x49: /* Timer 3 control 2
Bit 0 R/W Unknown
@@ -1098,40 +1097,40 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
if ( data & 0x02 )
{
- state->m_pm_reg[0x4F] = state->m_pm_reg[0x4B];
+ m_pm_reg[0x4F] = m_pm_reg[0x4B];
data &= ~0x02;
}
- if ( ( data & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) && ( state->m_pm_reg[0x1C] & 0x80 ) &&
- ( ( ( state->m_pm_reg[0x19] & 0x20 ) && ! ( state->m_pm_reg[0x1D] & 0x02 ) ) ||
- ( ( state->m_pm_reg[0x19] & 0x10 ) && ( state->m_pm_reg[0x1D] & 0x02 ) ) ) )
+ if ( ( data & 0x04 ) && ! ( m_pm_reg[0x48] & 0x80 ) && ( m_pm_reg[0x1C] & 0x80 ) &&
+ ( ( ( m_pm_reg[0x19] & 0x20 ) && ! ( m_pm_reg[0x1D] & 0x02 ) ) ||
+ ( ( m_pm_reg[0x19] & 0x10 ) && ( m_pm_reg[0x1D] & 0x02 ) ) ) )
{
- state->m_timers.timer3_hi->enable( 1 );
+ m_timers.timer3_hi->enable( 1 );
}
else
{
- state->m_timers.timer3_hi->enable( 0 );
+ m_timers.timer3_hi->enable( 0 );
}
- state->m_pm_reg[0x49] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x49] = data;
+ pokemini_update_sound(machine());
break;
case 0x4A: /* Timer 3 preset value (low)
Bit 0-7 R/W Timer 3 preset value bit 0-7
*/
- state->m_pm_reg[0x4A] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x4A] = data;
+ pokemini_update_sound(machine());
break;
case 0x4B: /* Timer 3 preset value (high)
Bit 0-7 R/W Timer 3 preset value bit 8-15
*/
- state->m_pm_reg[0x4B] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x4B] = data;
+ pokemini_update_sound(machine());
break;
case 0x4C: /* Timer 3 sound-pivot (low)
Bit 0-7 R/W Timer 3 sound-pivot value bit 0-7
*/
- state->m_pm_reg[0x4C] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x4C] = data;
+ pokemini_update_sound(machine());
break;
case 0x4D: /* Timer 3 sound-pivot (high)
Bit 0-7 R/W Timer 3 sound-pivot value bit 8-15
@@ -1141,8 +1140,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Pulse-Width of 50% = Half of preset-value
Pulse-Width of 100% = Same as preset-value
*/
- state->m_pm_reg[0x4D] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x4D] = data;
+ pokemini_update_sound(machine());
break;
case 0x4E: /* Timer 3 counter (low), read only
Bit 0-7 R/W Timer 3 counter value bit 0-7
@@ -1184,15 +1183,15 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6 Always 1
Bit 7 R/W IR received bit (mirror, if device not selected: 0)
*/
- if ( state->m_pm_reg[0x60] & 0x04 )
- i2cmem_sda_write(device, ( data & 0x04 ) ? 1 : 0 );
+ if ( m_pm_reg[0x60] & 0x04 )
+ i2cmem_sda_write(machine().device("i2cmem"), ( data & 0x04 ) ? 1 : 0 );
- if ( state->m_pm_reg[0x60] & 0x08 )
- i2cmem_scl_write(device, ( data & 0x08 ) ? 1 : 0 );
+ if ( m_pm_reg[0x60] & 0x08 )
+ i2cmem_scl_write(machine().device("i2cmem"), ( data & 0x08 ) ? 1 : 0 );
break;
case 0x70: /* Sound related */
- state->m_pm_reg[0x70] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x70] = data;
+ pokemini_update_sound(machine());
break;
case 0x71: /* Sound volume
Bit 0-1 R/W Sound volume
@@ -1203,8 +1202,8 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 2 R/W Always set to 0
Bit 3-7 Unused
*/
- state->m_pm_reg[0x71] = data;
- pokemini_update_sound(space.machine());
+ m_pm_reg[0x71] = data;
+ pokemini_update_sound(machine());
break;
case 0x80: /* LCD control
Bit 0 R/W Invert colors; 0 - normal, 1 - inverted
@@ -1218,20 +1217,20 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
11 - 24x8 (prohibited code)
Bit 6-7 Unused
*/
- state->m_prc.colors_inverted = ( data & 0x01 ) ? 1 : 0;
- state->m_prc.background_enabled = ( data & 0x02 ) ? 1 : 0;
- state->m_prc.sprites_enabled = ( data & 0x04 ) ? 1 : 0;
- state->m_prc.copy_enabled = ( data & 0x08 ) ? 1 : 0;
- state->m_prc.map_size = ( data >> 4 ) & 0x03;
- switch( state->m_prc.map_size )
+ m_prc.colors_inverted = ( data & 0x01 ) ? 1 : 0;
+ m_prc.background_enabled = ( data & 0x02 ) ? 1 : 0;
+ m_prc.sprites_enabled = ( data & 0x04 ) ? 1 : 0;
+ m_prc.copy_enabled = ( data & 0x08 ) ? 1 : 0;
+ m_prc.map_size = ( data >> 4 ) & 0x03;
+ switch( m_prc.map_size )
{
case 0:
- state->m_prc.map_size_x = 12; break;
+ m_prc.map_size_x = 12; break;
case 1:
- state->m_prc.map_size_x = 16; break;
+ m_prc.map_size_x = 16; break;
case 2:
case 3:
- state->m_prc.map_size_x = 24; break;
+ m_prc.map_size_x = 24; break;
}
break;
case 0x81: /* LCD render refresh rate
@@ -1249,14 +1248,14 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
switch ( data & 0x0E )
{
- case 0x00: state->m_prc.max_frame_count = 3; break;
- case 0x02: state->m_prc.max_frame_count = 6; break;
- case 0x04: state->m_prc.max_frame_count = 9; break;
- case 0x06: state->m_prc.max_frame_count = 12; break;
- case 0x08: state->m_prc.max_frame_count = 2; break;
- case 0x0A: state->m_prc.max_frame_count = 4; break;
- case 0x0C: state->m_prc.max_frame_count = 6; break;
- case 0x0E: state->m_prc.max_frame_count = 8; break;
+ case 0x00: m_prc.max_frame_count = 3; break;
+ case 0x02: m_prc.max_frame_count = 6; break;
+ case 0x04: m_prc.max_frame_count = 9; break;
+ case 0x06: m_prc.max_frame_count = 12; break;
+ case 0x08: m_prc.max_frame_count = 2; break;
+ case 0x0A: m_prc.max_frame_count = 4; break;
+ case 0x0C: m_prc.max_frame_count = 6; break;
+ case 0x0E: m_prc.max_frame_count = 8; break;
}
break;
case 0x82: /* BG tile data memory offset (low)
@@ -1264,19 +1263,19 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 3-7 R/W BG tile data memory offset bit 3-7
*/
data &= 0xF8;
- state->m_prc.bg_tiles = ( state->m_prc.bg_tiles & 0xFFFF00 ) | data;
+ m_prc.bg_tiles = ( m_prc.bg_tiles & 0xFFFF00 ) | data;
break;
case 0x83: /* BG tile data memory offset (mid)
Bit 0-7 R/W BG tile data memory offset bit 8-15
*/
- state->m_prc.bg_tiles = ( state->m_prc.bg_tiles & 0xFF00FF ) | ( data << 8 );
+ m_prc.bg_tiles = ( m_prc.bg_tiles & 0xFF00FF ) | ( data << 8 );
break;
case 0x84: /* BG tile data memory offset (high)
Bit 0-4 R/W BG tile data memory offset bit 16-20
Bit 5-7 Unused
*/
data &= 0x1F;
- state->m_prc.bg_tiles = ( state->m_prc.bg_tiles & 0x00FFFF ) | ( data << 16 );
+ m_prc.bg_tiles = ( m_prc.bg_tiles & 0x00FFFF ) | ( data << 16 );
break;
case 0x85: /* BG vertical move
Bit 0-6 R/W Move the background up, move range:
@@ -1292,26 +1291,26 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Map size 2: 0x00 to 0x60
Bit 7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
case 0x87: /* Sprite tile data memory offset (low)
Bit 0-5 Always "0"
Bit 6-7 R/W Sprite tile data memory offset bit 6-7
*/
data &= 0xC0;
- state->m_prc.spr_tiles = ( state->m_prc.spr_tiles & 0xFFFF00 ) | data;
+ m_prc.spr_tiles = ( m_prc.spr_tiles & 0xFFFF00 ) | data;
break;
case 0x88: /* Sprite tile data memory offset (med)
Bit 0-7 R/W Sprite tile data memory offset bit 8-15
*/
- state->m_prc.spr_tiles = ( state->m_prc.spr_tiles & 0xFF00FF ) | ( data << 8 );
+ m_prc.spr_tiles = ( m_prc.spr_tiles & 0xFF00FF ) | ( data << 8 );
break;
case 0x89: /* Sprite tile data memory offset (high)
Bit 0-4 R/W Sprite tile data memory offset bit 16-20
Bit 5-7 Unused
*/
data &= 0x1F;
- state->m_prc.spr_tiles = ( state->m_prc.spr_tiles & 0x00FFFF ) | ( data << 16 );
+ m_prc.spr_tiles = ( m_prc.spr_tiles & 0x00FFFF ) | ( data << 16 );
break;
case 0x8A: /* LCD status
Bit 0 R Unknown
@@ -1333,33 +1332,32 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
// lcd_data_w( data );
break;
default:
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", machine().firstcpu->pc( ), offset, data );
break;
}
- state->m_pm_reg[offset] = data;
+ m_pm_reg[offset] = data;
}
-READ8_DEVICE_HANDLER( pokemini_hwreg_r )
+READ8_MEMBER(pokemini_state::pokemini_hwreg_r)
{
- pokemini_state *state = space.machine().driver_data<pokemini_state>();
- UINT8 data = state->m_pm_reg[offset];
+ UINT8 data = m_pm_reg[offset];
switch( offset )
{
- case 0x52: return state->ioport("INPUTS")->read();
+ case 0x52: return ioport("INPUTS")->read();
case 0x61:
- if ( ! ( state->m_pm_reg[0x60] & 0x04 ) )
+ if ( ! ( m_pm_reg[0x60] & 0x04 ) )
{
- data = ( data & ~ 0x04 ) | ( i2cmem_sda_read( device) ? 0x04 : 0x00 );
+ data = ( data & ~ 0x04 ) | ( i2cmem_sda_read( machine().device("i2cmem")) ? 0x04 : 0x00 );
}
- if ( ! ( state->m_pm_reg[0x60] & 0x08 ) )
+ if ( ! ( m_pm_reg[0x60] & 0x08 ) )
{
data &= ~0x08;
}
break;
- case 0x81: return ( state->m_pm_reg[offset] & 0x0F ) | ( state->m_prc.frame_count << 4 );
- case 0x8A: return state->m_prc.count;
+ case 0x81: return ( m_pm_reg[offset] & 0x0F ) | ( m_prc.frame_count << 4 );
+ case 0x8A: return m_prc.count;
}
return data;
}
diff --git a/src/mess/machine/poly88.c b/src/mess/machine/poly88.c
index 251fddb70b3..69dfaae32fc 100644
--- a/src/mess/machine/poly88.c
+++ b/src/mess/machine/poly88.c
@@ -218,11 +218,10 @@ INTERRUPT_GEN_MEMBER(poly88_state::poly88_interrupt)
device.execute().set_input_line(0, HOLD_LINE);
}
-static WRITE_LINE_DEVICE_HANDLER( poly88_usart_rxready )
+WRITE_LINE_MEMBER(poly88_state::poly88_usart_rxready)
{
- //poly88_state *drvstate = device->machine().driver_data<poly88_state>();
- //drvstate->m_int_vector = 0xe7;
- //device->execute().set_input_line(0, HOLD_LINE);
+ //drvm_int_vector = 0xe7;
+ //execute().set_input_line(0, HOLD_LINE);
}
const i8251_interface poly88_usart_interface=
@@ -232,7 +231,7 @@ const i8251_interface poly88_usart_interface=
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(poly88_usart_rxready),
+ DEVCB_DRIVER_LINE_MEMBER(poly88_state,poly88_usart_rxready),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL
diff --git a/src/mess/machine/pp01.c b/src/mess/machine/pp01.c
index db40b0c5c1b..6ad4f5639ff 100644
--- a/src/mess/machine/pp01.c
+++ b/src/mess/machine/pp01.c
@@ -156,11 +156,11 @@ void pp01_state::machine_start()
}
-static WRITE_LINE_DEVICE_HANDLER( pp01_pit_out0 )
+WRITE_LINE_MEMBER(pp01_state::pp01_pit_out0)
{
}
-static WRITE_LINE_DEVICE_HANDLER( pp01_pit_out1 )
+WRITE_LINE_MEMBER(pp01_state::pp01_pit_out1)
{
}
@@ -170,12 +170,12 @@ const struct pit8253_config pp01_pit8253_intf =
{
0,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("pit8253", pp01_pit_out0)
+ DEVCB_DRIVER_LINE_MEMBER(pp01_state,pp01_pit_out0)
},
{
2000000,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("pit8253", pp01_pit_out1)
+ DEVCB_DRIVER_LINE_MEMBER(pp01_state,pp01_pit_out1)
},
{
2000000,
@@ -185,40 +185,36 @@ const struct pit8253_config pp01_pit8253_intf =
}
};
-static READ8_DEVICE_HANDLER (pp01_8255_porta_r )
+READ8_MEMBER(pp01_state::pp01_8255_porta_r)
{
- pp01_state *state = space.machine().driver_data<pp01_state>();
- return state->m_video_scroll;
+ return m_video_scroll;
}
-static WRITE8_DEVICE_HANDLER (pp01_8255_porta_w )
+WRITE8_MEMBER(pp01_state::pp01_8255_porta_w)
{
- pp01_state *state = space.machine().driver_data<pp01_state>();
- state->m_video_scroll = data;
+ m_video_scroll = data;
}
-static READ8_DEVICE_HANDLER (pp01_8255_portb_r )
+READ8_MEMBER(pp01_state::pp01_8255_portb_r)
{
- pp01_state *state = space.machine().driver_data<pp01_state>();
static const char *const keynames[] = {
"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
"LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF"
};
- return (space.machine().root_device().ioport(keynames[state->m_key_line])->read() & 0x3F) | (space.machine().root_device().ioport("LINEALL")->read() & 0xC0);
+ return (machine().root_device().ioport(keynames[m_key_line])->read() & 0x3F) | (machine().root_device().ioport("LINEALL")->read() & 0xC0);
}
-static WRITE8_DEVICE_HANDLER (pp01_8255_portb_w )
+WRITE8_MEMBER(pp01_state::pp01_8255_portb_w)
{
//logerror("pp01_8255_portb_w %02x\n",data);
}
-static WRITE8_DEVICE_HANDLER (pp01_8255_portc_w )
+WRITE8_MEMBER(pp01_state::pp01_8255_portc_w)
{
- pp01_state *state = space.machine().driver_data<pp01_state>();
- state->m_key_line = data & 0x0f;
+ m_key_line = data & 0x0f;
}
-static READ8_DEVICE_HANDLER (pp01_8255_portc_r )
+READ8_MEMBER(pp01_state::pp01_8255_portc_r)
{
return 0xff;
}
@@ -227,11 +223,11 @@ static READ8_DEVICE_HANDLER (pp01_8255_portc_r )
I8255A_INTERFACE( pp01_ppi8255_interface )
{
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_porta_r),
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_porta_w),
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_portb_r),
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_portb_w),
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_portc_r),
- DEVCB_DEVICE_HANDLER("ppi8255", pp01_8255_portc_w)
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_porta_r),
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_porta_w),
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_portb_r),
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_portb_w),
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_portc_r),
+ DEVCB_DRIVER_MEMBER(pp01_state,pp01_8255_portc_w)
};
diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c
index 3fdcb6b5fdc..dedf8d7a3ae 100644
--- a/src/mess/machine/radio86.c
+++ b/src/mess/machine/radio86.c
@@ -41,82 +41,78 @@ DRIVER_INIT_MEMBER(radio86_state,radioram)
m_radio_ram_disk = auto_alloc_array(machine(), UINT8, 0x20000);
memset(m_radio_ram_disk,0,0x20000);
}
-static READ8_DEVICE_HANDLER (radio86_8255_portb_r2 )
+READ8_MEMBER(radio86_state::radio86_8255_portb_r2)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
UINT8 key = 0xff;
- if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("LINE0")->read(); }
- if ((state->m_keyboard_mask & 0x02)!=0) { key &= space.machine().root_device().ioport("LINE1")->read(); }
- if ((state->m_keyboard_mask & 0x04)!=0) { key &= space.machine().root_device().ioport("LINE2")->read(); }
- if ((state->m_keyboard_mask & 0x08)!=0) { key &= space.machine().root_device().ioport("LINE3")->read(); }
- if ((state->m_keyboard_mask & 0x10)!=0) { key &= space.machine().root_device().ioport("LINE4")->read(); }
- if ((state->m_keyboard_mask & 0x20)!=0) { key &= space.machine().root_device().ioport("LINE5")->read(); }
- if ((state->m_keyboard_mask & 0x40)!=0) { key &= space.machine().root_device().ioport("LINE6")->read(); }
- if ((state->m_keyboard_mask & 0x80)!=0) { key &= space.machine().root_device().ioport("LINE7")->read(); }
+ if ((m_keyboard_mask & 0x01)!=0) { key &= ioport("LINE0")->read(); }
+ if ((m_keyboard_mask & 0x02)!=0) { key &= machine().root_device().ioport("LINE1")->read(); }
+ if ((m_keyboard_mask & 0x04)!=0) { key &= machine().root_device().ioport("LINE2")->read(); }
+ if ((m_keyboard_mask & 0x08)!=0) { key &= machine().root_device().ioport("LINE3")->read(); }
+ if ((m_keyboard_mask & 0x10)!=0) { key &= machine().root_device().ioport("LINE4")->read(); }
+ if ((m_keyboard_mask & 0x20)!=0) { key &= machine().root_device().ioport("LINE5")->read(); }
+ if ((m_keyboard_mask & 0x40)!=0) { key &= machine().root_device().ioport("LINE6")->read(); }
+ if ((m_keyboard_mask & 0x80)!=0) { key &= machine().root_device().ioport("LINE7")->read(); }
return key;
}
-static READ8_DEVICE_HANDLER (radio86_8255_portc_r2 )
+READ8_MEMBER(radio86_state::radio86_8255_portc_r2)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- double level = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
- UINT8 dat = state->ioport("LINE8")->read();
+ double level = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ UINT8 dat = ioport("LINE8")->read();
if (level < 0) {
- dat ^= state->m_tape_value;
+ dat ^= m_tape_value;
}
return dat;
}
-static WRITE8_DEVICE_HANDLER (radio86_8255_porta_w2 )
+WRITE8_MEMBER(radio86_state::radio86_8255_porta_w2)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- state->m_keyboard_mask = data ^ 0xff;
+ m_keyboard_mask = data ^ 0xff;
}
-static WRITE8_DEVICE_HANDLER (radio86_8255_portc_w2 )
+WRITE8_MEMBER(radio86_state::radio86_8255_portc_w2)
{
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? 1 : -1);
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? 1 : -1);
}
I8255A_INTERFACE( radio86_ppi8255_interface_1 )
{
DEVCB_NULL,
- DEVCB_HANDLER(radio86_8255_porta_w2),
- DEVCB_HANDLER(radio86_8255_portb_r2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_porta_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portb_r2),
DEVCB_NULL,
- DEVCB_HANDLER(radio86_8255_portc_r2),
- DEVCB_HANDLER(radio86_8255_portc_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portc_r2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portc_w2),
};
I8255A_INTERFACE( mikrosha_ppi8255_interface_1 )
{
- DEVCB_HANDLER(radio86_8255_portb_r2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portb_r2),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(radio86_8255_porta_w2),
- DEVCB_HANDLER(radio86_8255_portc_r2),
- DEVCB_HANDLER(radio86_8255_portc_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_porta_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portc_r2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portc_w2),
};
-static READ8_DEVICE_HANDLER (rk7007_8255_portc_r )
+READ8_MEMBER(radio86_state::rk7007_8255_portc_r)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- double level = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ double level = (machine().device<cassette_image_device>(CASSETTE_TAG)->input());
UINT8 key = 0xff;
- if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("CLINE0")->read(); }
- if ((state->m_keyboard_mask & 0x02)!=0) { key &= space.machine().root_device().ioport("CLINE1")->read(); }
- if ((state->m_keyboard_mask & 0x04)!=0) { key &= space.machine().root_device().ioport("CLINE2")->read(); }
- if ((state->m_keyboard_mask & 0x08)!=0) { key &= space.machine().root_device().ioport("CLINE3")->read(); }
- if ((state->m_keyboard_mask & 0x10)!=0) { key &= space.machine().root_device().ioport("CLINE4")->read(); }
- if ((state->m_keyboard_mask & 0x20)!=0) { key &= space.machine().root_device().ioport("CLINE5")->read(); }
- if ((state->m_keyboard_mask & 0x40)!=0) { key &= space.machine().root_device().ioport("CLINE6")->read(); }
- if ((state->m_keyboard_mask & 0x80)!=0) { key &= space.machine().root_device().ioport("CLINE7")->read(); }
+ if ((m_keyboard_mask & 0x01)!=0) { key &= ioport("CLINE0")->read(); }
+ if ((m_keyboard_mask & 0x02)!=0) { key &= machine().root_device().ioport("CLINE1")->read(); }
+ if ((m_keyboard_mask & 0x04)!=0) { key &= machine().root_device().ioport("CLINE2")->read(); }
+ if ((m_keyboard_mask & 0x08)!=0) { key &= machine().root_device().ioport("CLINE3")->read(); }
+ if ((m_keyboard_mask & 0x10)!=0) { key &= machine().root_device().ioport("CLINE4")->read(); }
+ if ((m_keyboard_mask & 0x20)!=0) { key &= machine().root_device().ioport("CLINE5")->read(); }
+ if ((m_keyboard_mask & 0x40)!=0) { key &= machine().root_device().ioport("CLINE6")->read(); }
+ if ((m_keyboard_mask & 0x80)!=0) { key &= machine().root_device().ioport("CLINE7")->read(); }
key &= 0xe0;
if (level < 0) {
- key ^= state->m_tape_value;
+ key ^= m_tape_value;
}
return key;
}
@@ -124,20 +120,20 @@ static READ8_DEVICE_HANDLER (rk7007_8255_portc_r )
I8255A_INTERFACE( rk7007_ppi8255_interface )
{
DEVCB_NULL,
- DEVCB_HANDLER(radio86_8255_porta_w2),
- DEVCB_HANDLER(radio86_8255_portb_r2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_porta_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portb_r2),
DEVCB_NULL,
- DEVCB_HANDLER(rk7007_8255_portc_r),
- DEVCB_HANDLER(radio86_8255_portc_w2),
+ DEVCB_DRIVER_MEMBER(radio86_state,rk7007_8255_portc_r),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_8255_portc_w2),
};
-static WRITE_LINE_DEVICE_HANDLER( hrq_w )
+WRITE_LINE_MEMBER(radio86_state::hrq_w)
{
/* HACK - this should be connected to the BUSREQ line of Z80 */
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, state);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, state);
/* HACK - this should be connected to the BUSACK line of Z80 */
- i8257_hlda_w(device, state);
+ i8257_hlda_w(machine().device("dma8257"), state);
}
static UINT8 memory_read_byte(address_space &space, offs_t address, UINT8 mem_mask) { return space.read_byte(address); }
@@ -145,7 +141,7 @@ static void memory_write_byte(address_space &space, offs_t address, UINT8 data,
I8257_INTERFACE( radio86_dma )
{
- DEVCB_LINE(hrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(radio86_state,hrq_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
@@ -190,47 +186,43 @@ WRITE8_MEMBER(radio86_state::radio86_pagesel)
m_disk_sel = data;
}
-static READ8_DEVICE_HANDLER (radio86_romdisk_porta_r )
+READ8_MEMBER(radio86_state::radio86_romdisk_porta_r)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- UINT8 *romdisk = state->memregion("maincpu")->base() + 0x10000;
- if ((state->m_disk_sel & 0x0f) ==0) {
- return romdisk[state->m_romdisk_msb*256+state->m_romdisk_lsb];
+ UINT8 *romdisk = memregion("maincpu")->base() + 0x10000;
+ if ((m_disk_sel & 0x0f) ==0) {
+ return romdisk[m_romdisk_msb*256+m_romdisk_lsb];
} else {
- if (state->m_disk_sel==0xdf) {
- return state->m_radio_ram_disk[state->m_romdisk_msb*256+state->m_romdisk_lsb + 0x10000];
+ if (m_disk_sel==0xdf) {
+ return m_radio_ram_disk[m_romdisk_msb*256+m_romdisk_lsb + 0x10000];
} else {
- return state->m_radio_ram_disk[state->m_romdisk_msb*256+state->m_romdisk_lsb];
+ return m_radio_ram_disk[m_romdisk_msb*256+m_romdisk_lsb];
}
}
}
-static WRITE8_DEVICE_HANDLER (radio86_romdisk_portb_w )
+WRITE8_MEMBER(radio86_state::radio86_romdisk_portb_w)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- state->m_romdisk_lsb = data;
+ m_romdisk_lsb = data;
}
-static WRITE8_DEVICE_HANDLER (radio86_romdisk_portc_w )
+WRITE8_MEMBER(radio86_state::radio86_romdisk_portc_w)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- state->m_romdisk_msb = data;
+ m_romdisk_msb = data;
}
I8255A_INTERFACE( radio86_ppi8255_interface_2 )
{
- DEVCB_HANDLER(radio86_romdisk_porta_r),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_romdisk_porta_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(radio86_romdisk_portb_w),
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_romdisk_portb_w),
DEVCB_NULL,
- DEVCB_HANDLER(radio86_romdisk_portc_w)
+ DEVCB_DRIVER_MEMBER(radio86_state,radio86_romdisk_portc_w)
};
-static WRITE8_DEVICE_HANDLER (mikrosha_8255_font_page_w )
+WRITE8_MEMBER(radio86_state::mikrosha_8255_font_page_w)
{
- radio86_state *state = space.machine().driver_data<radio86_state>();
- state->m_mikrosha_font_page = (data > 7) & 1;
+ m_mikrosha_font_page = (data > 7) & 1;
}
I8255A_INTERFACE( mikrosha_ppi8255_interface_2 )
@@ -238,7 +230,7 @@ I8255A_INTERFACE( mikrosha_ppi8255_interface_2 )
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(mikrosha_8255_font_page_w),
+ DEVCB_DRIVER_MEMBER(radio86_state,mikrosha_8255_font_page_w),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c
index 7121b415a28..3a9895be59a 100644
--- a/src/mess/machine/rmnimbus.c
+++ b/src/mess/machine/rmnimbus.c
@@ -67,10 +67,6 @@ even if you have to use unusual geometry to do so !
#include "includes/rmnimbus.h"
-static WRITE_LINE_DEVICE_HANDLER( sio_interrupt );
-//static DECLARE_WRITE8_DEVICE_HANDLER( sio_dtr_w );
-static DECLARE_WRITE16_DEVICE_HANDLER( sio_serial_transmit );
-static DECLARE_READ16_DEVICE_HANDLER( sio_serial_receive );
/*-------------------------------------------------------------------------*/
@@ -113,24 +109,24 @@ static DECLARE_READ16_DEVICE_HANDLER( sio_serial_receive );
const z80sio_interface nimbus_sio_intf =
{
- DEVCB_LINE(sio_interrupt), /* interrupt handler */
+ DEVCB_DRIVER_LINE_MEMBER(rmnimbus_state,sio_interrupt), /* interrupt handler */
DEVCB_NULL, //sio_dtr_w, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
- DEVCB_HANDLER(sio_serial_transmit), /* transmit handler */
- DEVCB_HANDLER(sio_serial_receive) /* receive handler */
+ DEVCB_DRIVER_MEMBER16(rmnimbus_state,sio_serial_transmit), /* transmit handler */
+ DEVCB_DRIVER_MEMBER16(rmnimbus_state,sio_serial_receive) /* receive handler */
};
/* Floppy drives WD2793 */
-static WRITE_LINE_DEVICE_HANDLER( nimbus_fdc_intrq_w );
-static WRITE_LINE_DEVICE_HANDLER( nimbus_fdc_drq_w );
+
+
const wd17xx_interface nimbus_wd17xx_interface =
{
DEVCB_LINE_GND,
- DEVCB_LINE(nimbus_fdc_intrq_w),
- DEVCB_LINE(nimbus_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(rmnimbus_state,nimbus_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(rmnimbus_state,nimbus_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
@@ -2182,24 +2178,23 @@ Z80SIO, used for the keyboard interface
/* Z80 SIO/2 */
-static WRITE_LINE_DEVICE_HANDLER( sio_interrupt )
+WRITE_LINE_MEMBER(rmnimbus_state::sio_interrupt)
{
- rmnimbus_state *drvstate = device->machine().driver_data<rmnimbus_state>();
if(LOG_SIO)
logerror("SIO Interrupt state=%02X\n",state);
// Don't re-trigger if already active !
- if(state!=drvstate->m_sio_int_state)
+ if(state!=m_sio_int_state)
{
- drvstate->m_sio_int_state=state;
+ m_sio_int_state=state;
if(state)
- external_int(device->machine(),0,EXTERNAL_INT_Z80SIO);
+ external_int(machine(),0,EXTERNAL_INT_Z80SIO);
}
}
#ifdef UNUSED_FUNCTION
-WRITE8_DEVICE_HANDLER( sio_dtr_w )
+WRITE8_MEMBER(rmnimbus_state::sio_dtr_w)
{
if (offset == 1)
{
@@ -2207,15 +2202,15 @@ WRITE8_DEVICE_HANDLER( sio_dtr_w )
}
#endif
-static WRITE16_DEVICE_HANDLER( sio_serial_transmit )
+WRITE16_MEMBER(rmnimbus_state::sio_serial_transmit)
{
}
-static READ16_DEVICE_HANDLER( sio_serial_receive )
+READ16_MEMBER(rmnimbus_state::sio_serial_receive)
{
if(offset==0)
{
- return keyboard_queue_read(space.machine());
+ return keyboard_queue_read(machine());
}
else
return -1;
@@ -2250,20 +2245,18 @@ static void set_disk_int(running_machine &machine, int state)
}
}
-static WRITE_LINE_DEVICE_HANDLER( nimbus_fdc_intrq_w )
+WRITE_LINE_MEMBER(rmnimbus_state::nimbus_fdc_intrq_w)
{
- set_disk_int(device->machine(),state);
+ set_disk_int(machine(),state);
}
-static WRITE_LINE_DEVICE_HANDLER( nimbus_fdc_drq_w )
+WRITE_LINE_MEMBER(rmnimbus_state::nimbus_fdc_drq_w)
{
- rmnimbus_state *drvstate = device->machine().driver_data<rmnimbus_state>();
-
if(LOG_DISK)
logerror("nimbus_drives_drq_w(%d)\n", state);
- if(state && FDC_DRQ_ENABLED(drvstate))
- drq_callback(device->machine(),1);
+ if(state && FDC_DRQ_ENABLED(this))
+ drq_callback(machine(),1);
}
static UINT8 fdc_driveno(UINT8 drivesel)
@@ -3017,41 +3010,41 @@ collector output only. It usially acts as the printer strobe line.
***********************************************************************/
/* USER VIA 6522 port B is connected to the BBC user port */
-static READ8_DEVICE_HANDLER( nimbus_via_read_portb )
+READ8_MEMBER(rmnimbus_state::nimbus_via_read_portb)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( nimbus_via_write_portb )
+WRITE8_MEMBER(rmnimbus_state::nimbus_via_write_portb)
{
}
-static WRITE_LINE_DEVICE_HANDLER( nimbus_via_irq_w )
+WRITE_LINE_MEMBER(rmnimbus_state::nimbus_via_irq_w)
{
if(state)
- external_int(device->machine(),VIA_INT,0x00);
+ external_int(machine(),VIA_INT,0x00);
}
const via6522_interface nimbus_via =
{
DEVCB_NULL, //via_user_read_porta,
- DEVCB_HANDLER(nimbus_via_read_portb),
+ DEVCB_DRIVER_MEMBER(rmnimbus_state,nimbus_via_read_portb),
DEVCB_NULL, //via_user_read_ca1,
DEVCB_NULL, //via_user_read_cb1,
DEVCB_NULL, //via_user_read_ca2,
DEVCB_NULL, //via_user_read_cb2,
DEVCB_DEVICE_MEMBER(CENTRONICS_TAG, centronics_device, write),
- DEVCB_HANDLER(nimbus_via_write_portb),
+ DEVCB_DRIVER_MEMBER(rmnimbus_state,nimbus_via_write_portb),
DEVCB_NULL, //via_user_write_ca1
DEVCB_NULL, //via_user_write_cb1
DEVCB_DEVICE_LINE_MEMBER(CENTRONICS_TAG, centronics_device, strobe_w),
DEVCB_NULL, //via_user_write_cb2,
- DEVCB_LINE(nimbus_via_irq_w)
+ DEVCB_DRIVER_LINE_MEMBER(rmnimbus_state,nimbus_via_irq_w)
};
-WRITE_LINE_DEVICE_HANDLER(nimbus_ack_w)
+WRITE_LINE_MEMBER(rmnimbus_state::nimbus_ack_w)
{
- via6522_device *via_1 = device->machine().device<via6522_device>(VIA_TAG);
+ via6522_device *via_1 = machine().device<via6522_device>(VIA_TAG);
via_1->write_ca1(!state); /* ack seems to be inverted? */
}
diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c
index 19ecabf6a09..d878cee0739 100644
--- a/src/mess/machine/samcoupe.c
+++ b/src/mess/machine/samcoupe.c
@@ -158,18 +158,18 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
REAL TIME CLOCK
***************************************************************************/
-static READ8_DEVICE_HANDLER( samcoupe_rtc_r )
+READ8_MEMBER(samcoupe_state::samcoupe_rtc_r)
{
- address_space &spaceio = space.machine().device("maincpu")->memory().space(AS_IO);
- msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
+ address_space &spaceio = machine().device("maincpu")->memory().space(AS_IO);
+ msm6242_device *rtc = dynamic_cast<msm6242_device*>(machine().device("sambus_clock"));
return rtc->read(spaceio,offset >> 12);
}
-static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w )
+WRITE8_MEMBER(samcoupe_state::samcoupe_rtc_w)
{
- address_space &spaceio = space.machine().device("maincpu")->memory().space(AS_IO);
- msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
+ address_space &spaceio = machine().device("maincpu")->memory().space(AS_IO);
+ msm6242_device *rtc = dynamic_cast<msm6242_device*>(machine().device("sambus_clock"));
rtc->write(spaceio,offset >> 12, data);
}
@@ -261,8 +261,7 @@ void samcoupe_state::machine_reset()
if (machine().root_device().ioport("config")->read() & 0x01)
{
/* install RTC */
- device_t *rtc = machine().device("sambus_clock");
- spaceio.install_legacy_readwrite_handler(*rtc, 0xef, 0xef, 0xffff, 0xff00, FUNC(samcoupe_rtc_r), FUNC(samcoupe_rtc_w));
+ spaceio.install_readwrite_handler(0xef, 0xef, 0xffff, 0xff00, read8_delegate(FUNC(samcoupe_state::samcoupe_rtc_r),this), write8_delegate(FUNC(samcoupe_state::samcoupe_rtc_w),this));
}
else
{
diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c
index 7c8f40aed6e..5d00c97222a 100644
--- a/src/mess/machine/sms.c
+++ b/src/mess/machine/sms.c
@@ -770,29 +770,27 @@ READ8_MEMBER(sms_state::sms_count_r)
Check if the pause button is pressed.
If the gamegear is in sms mode, check if the start button is pressed.
*/
-WRITE_LINE_DEVICE_HANDLER( sms_pause_callback )
+WRITE_LINE_MEMBER(sms_state::sms_pause_callback)
{
- sms_state *driver_state = device->machine().driver_data<sms_state>();
-
- if (driver_state->m_is_gamegear && !(driver_state->m_cartridge[driver_state->m_current_cartridge].features & CF_GG_SMS_MODE))
+ if (m_is_gamegear && !(m_cartridge[m_current_cartridge].features & CF_GG_SMS_MODE))
return;
- if (!(driver_state->ioport(driver_state->m_is_gamegear ? "START" : "PAUSE")->read() & 0x80))
+ if (!(ioport(m_is_gamegear ? "START" : "PAUSE")->read() & 0x80))
{
- if (!driver_state->m_paused)
+ if (!m_paused)
{
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
}
- driver_state->m_paused = 1;
+ m_paused = 1;
}
else
{
- driver_state->m_paused = 0;
+ m_paused = 0;
}
/* clear Light Phaser latch flags for next frame */
- driver_state->m_lphaser_1_latch = 0;
- driver_state->m_lphaser_2_latch = 0;
+ m_lphaser_1_latch = 0;
+ m_lphaser_2_latch = 0;
}
READ8_MEMBER(sms_state::sms_input_port_0_r)
@@ -2095,10 +2093,9 @@ WRITE8_MEMBER(sms_state::sms_store_control_w)
m_store_control = data;
}
-WRITE_LINE_DEVICE_HANDLER( sms_store_int_callback )
+WRITE_LINE_MEMBER(sms_state::sms_store_int_callback)
{
- sms_state *driver_state = device->machine().driver_data<sms_state>();
- (driver_state->m_store_control & 0x01 ? driver_state->m_control_cpu : driver_state->m_main_cpu)->execute().set_input_line(0, state);
+ (m_store_control & 0x01 ? m_control_cpu : m_main_cpu)->execute().set_input_line(0, state);
}
diff --git a/src/mess/machine/super80.c b/src/mess/machine/super80.c
index 15b6a41284f..92021bd4d43 100644
--- a/src/mess/machine/super80.c
+++ b/src/mess/machine/super80.c
@@ -12,9 +12,8 @@ WRITE8_MEMBER( super80_state::pio_port_a_w )
m_keylatch = data;
};
-static READ8_DEVICE_HANDLER( pio_port_b_r ) // cannot be modernised yet as super80 hangs at start
+READ8_MEMBER(super80_state::pio_port_b_r)// cannot be modernised yet as super80 hangs at start
{
- super80_state *state = space.machine().driver_data<super80_state>();
char kbdrow[6];
UINT8 i;
UINT8 data = 0xff;
@@ -22,7 +21,7 @@ static READ8_DEVICE_HANDLER( pio_port_b_r ) // cannot be modernised yet as super
for (i = 0; i < 8; i++)
{
sprintf(kbdrow,"X%d",i);
- if (!BIT(state->m_keylatch, i)) data &= state->ioport(kbdrow)->read();
+ if (!BIT(m_keylatch, i)) data &= ioport(kbdrow)->read();
}
return data;
@@ -34,7 +33,7 @@ Z80PIO_INTERFACE( super80_pio_intf )
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(super80_state, pio_port_a_w),
DEVCB_NULL, /* portA ready active callback (not used in super80) */
- DEVCB_HANDLER(pio_port_b_r),
+ DEVCB_DRIVER_MEMBER(super80_state,pio_port_b_r),
DEVCB_NULL,
DEVCB_NULL /* portB ready active callback (not used in super80) */
};
@@ -93,7 +92,7 @@ TIMER_CALLBACK_MEMBER(super80_state::super80_timer)
m_cass_data[1] = 0;
}
- m_pio->port_b_write(pio_port_b_r(m_pio,generic_space(),0,0xff));
+ m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
}
/* after the first 4 bytes have been read from ROM, switch the ram back in */
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index 6c65add489e..f4669e0ea36 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -34,12 +34,11 @@ static void svi318_set_banks(running_machine &machine);
/* Serial ports */
-static WRITE_LINE_DEVICE_HANDLER( svi318_ins8250_interrupt )
+WRITE_LINE_MEMBER(svi318_state::svi318_ins8250_interrupt)
{
- svi318_state *drvstate = device->machine().driver_data<svi318_state>();
- if (drvstate->m_svi.bankLow != SVI_CART)
+ if (m_svi.bankLow != SVI_CART)
{
- device->machine().device("maincpu")->execute().set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE));
+ machine().device("maincpu")->execute().set_input_line(0, (state ? HOLD_LINE : CLEAR_LINE));
}
}
#if 0
@@ -55,7 +54,7 @@ const ins8250_interface svi318_ins8250_interface[2]=
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(svi318_ins8250_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi318_ins8250_interrupt),
DEVCB_NULL,
DEVCB_NULL
},
@@ -63,7 +62,7 @@ const ins8250_interface svi318_ins8250_interface[2]=
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(svi318_ins8250_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi318_ins8250_interrupt),
DEVCB_NULL,
DEVCB_NULL
}
@@ -144,15 +143,15 @@ DEVICE_IMAGE_UNLOAD( svi318_cart )
8 CASR Cassette, Read data
*/
-static READ8_DEVICE_HANDLER ( svi318_ppi_port_a_r )
+READ8_MEMBER(svi318_state::svi318_ppi_port_a_r)
{
int data = 0x0f;
- if ((space.machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.0038)
+ if ((machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.0038)
data |= 0x80;
- if (!svi318_cassette_present(space.machine(), 0))
+ if (!svi318_cassette_present(machine(), 0))
data |= 0x40;
- data |= space.machine().root_device().ioport("BUTTONS")->read() & 0x30;
+ data |= machine().root_device().ioport("BUTTONS")->read() & 0x30;
return data;
}
@@ -170,18 +169,17 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_a_r )
8 IN7 Keyboard, Column status of selected line
*/
-static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
+READ8_MEMBER(svi318_state::svi318_ppi_port_b_r)
{
- svi318_state *state = space.machine().driver_data<svi318_state>();
int row;
static const char *const keynames[] = {
"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5",
"LINE6", "LINE7", "LINE8", "LINE9", "LINE10"
};
- row = state->m_svi.keyboard_row;
+ row = m_svi.keyboard_row;
if (row <= 10)
- return space.machine().root_device().ioport(keynames[row])->read();
+ return machine().root_device().ioport(keynames[row])->read();
return 0xff;
}
@@ -199,39 +197,38 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
8 SOUND Keyboard, Click sound bit (pulse)
*/
-static WRITE8_DEVICE_HANDLER ( svi318_ppi_port_c_w )
+WRITE8_MEMBER(svi318_state::svi318_ppi_port_c_w)
{
- svi318_state *state = space.machine().driver_data<svi318_state>();
int val;
/* key click */
val = (data & 0x80) ? 0x3e : 0;
val += (data & 0x40) ? 0x3e : 0;
- space.machine().device<dac_device>("dac")->write_signed8(val);
+ machine().device<dac_device>("dac")->write_signed8(val);
/* cassette motor on/off */
- if (svi318_cassette_present(space.machine(), 0))
+ if (svi318_cassette_present(machine(), 0))
{
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
(data & 0x10) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,
CASSETTE_MOTOR_DISABLED);
}
/* cassette signal write */
- space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x20) ? -1.0 : +1.0);
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x20) ? -1.0 : +1.0);
- state->m_svi.keyboard_row = data & 0x0F;
+ m_svi.keyboard_row = data & 0x0F;
}
I8255_INTERFACE( svi318_ppi8255_interface )
{
- DEVCB_HANDLER(svi318_ppi_port_a_r),
+ DEVCB_DRIVER_MEMBER(svi318_state,svi318_ppi_port_a_r),
DEVCB_NULL,
- DEVCB_HANDLER(svi318_ppi_port_b_r),
+ DEVCB_DRIVER_MEMBER(svi318_state,svi318_ppi_port_b_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(svi318_ppi_port_c_w)
+ DEVCB_DRIVER_MEMBER(svi318_state,svi318_ppi_port_c_w)
};
WRITE8_MEMBER(svi318_state::svi318_ppi_w)
@@ -288,23 +285,21 @@ WRITE8_MEMBER(svi318_state::svi318_psg_port_b_w)
/* Disk drives */
-static WRITE_LINE_DEVICE_HANDLER( svi_fdc_intrq_w )
+WRITE_LINE_MEMBER(svi318_state::svi_fdc_intrq_w)
{
- svi318_state *drvstate = device->machine().driver_data<svi318_state>();
- drvstate->m_fdc.irq = state;
+ m_fdc.irq = state;
}
-static WRITE_LINE_DEVICE_HANDLER( svi_fdc_drq_w )
+WRITE_LINE_MEMBER(svi318_state::svi_fdc_drq_w)
{
- svi318_state *drvstate = device->machine().driver_data<svi318_state>();
- drvstate->m_fdc.drq = state;
+ m_fdc.drq = state;
}
const wd17xx_interface svi_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(svi_fdc_intrq_w),
- DEVCB_LINE(svi_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(svi318_state,svi_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
diff --git a/src/mess/machine/sym1.c b/src/mess/machine/sym1.c
index ea5b1fae1d2..04df3062e2a 100644
--- a/src/mess/machine/sym1.c
+++ b/src/mess/machine/sym1.c
@@ -31,45 +31,39 @@
******************************************************************************/
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_0_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_0_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY);
}
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_1_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_1_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY, 1);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY, 1);
}
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_2_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_2_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY, 2);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY, 2);
}
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_3_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_3_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY, 3);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY, 3);
}
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_4_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_4_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY, 4);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY, 4);
}
-static WRITE_LINE_DEVICE_HANDLER( sym1_74145_output_5_w )
+WRITE_LINE_MEMBER(sym1_state::sym1_74145_output_5_w)
{
- sym1_state *drvstate = device->machine().driver_data<sym1_state>();
- if (state) drvstate->m_led_update->adjust(LED_REFRESH_DELAY, 5);
+ if (state) m_led_update->adjust(LED_REFRESH_DELAY, 5);
}
@@ -79,38 +73,36 @@ TIMER_CALLBACK_MEMBER(sym1_state::led_refresh)
}
-static READ8_DEVICE_HANDLER(sym1_riot_a_r)
+READ8_MEMBER(sym1_state::sym1_riot_a_r)
{
- sym1_state *state = space.machine().driver_data<sym1_state>();
int data = 0x7f;
/* scan keypad rows */
- if (!(state->m_riot_port_a & 0x80)) data &= space.machine().root_device().ioport("ROW-0")->read();
- if (!(state->m_riot_port_b & 0x01)) data &= space.machine().root_device().ioport("ROW-1")->read();
- if (!(state->m_riot_port_b & 0x02)) data &= space.machine().root_device().ioport("ROW-2")->read();
- if (!(state->m_riot_port_b & 0x04)) data &= space.machine().root_device().ioport("ROW-3")->read();
+ if (!(m_riot_port_a & 0x80)) data &= machine().root_device().ioport("ROW-0")->read();
+ if (!(m_riot_port_b & 0x01)) data &= machine().root_device().ioport("ROW-1")->read();
+ if (!(m_riot_port_b & 0x02)) data &= machine().root_device().ioport("ROW-2")->read();
+ if (!(m_riot_port_b & 0x04)) data &= machine().root_device().ioport("ROW-3")->read();
/* determine column */
- if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-0")->read() ^ 0xff)) & 0x7f )
+ if ( ((m_riot_port_a ^ 0xff) & (ioport("ROW-0")->read() ^ 0xff)) & 0x7f )
data &= ~0x80;
return data;
}
-static READ8_DEVICE_HANDLER(sym1_riot_b_r)
+READ8_MEMBER(sym1_state::sym1_riot_b_r)
{
- sym1_state *state = space.machine().driver_data<sym1_state>();
int data = 0xff;
/* determine column */
- if ( ((state->m_riot_port_a ^ 0xff) & (space.machine().root_device().ioport("ROW-1")->read() ^ 0xff)) & 0x7f )
+ if ( ((m_riot_port_a ^ 0xff) & (machine().root_device().ioport("ROW-1")->read() ^ 0xff)) & 0x7f )
data &= ~0x01;
- if ( ((state->m_riot_port_a ^ 0xff) & (space.machine().root_device().ioport("ROW-2")->read() ^ 0xff)) & 0x3f )
+ if ( ((m_riot_port_a ^ 0xff) & (machine().root_device().ioport("ROW-2")->read() ^ 0xff)) & 0x3f )
data &= ~0x02;
- if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-3")->read() ^ 0xff)) & 0x1f )
+ if ( ((m_riot_port_a ^ 0xff) & (ioport("ROW-3")->read() ^ 0xff)) & 0x1f )
data &= ~0x04;
data &= ~0x80; // else hangs 8b02
@@ -119,46 +111,44 @@ static READ8_DEVICE_HANDLER(sym1_riot_b_r)
}
-static WRITE8_DEVICE_HANDLER(sym1_riot_a_w)
+WRITE8_MEMBER(sym1_state::sym1_riot_a_w)
{
- sym1_state *state = space.machine().driver_data<sym1_state>();
- logerror("%x: riot_a_w 0x%02x\n", space.machine().device("maincpu") ->safe_pc( ), data);
+ logerror("%x: riot_a_w 0x%02x\n", machine().device("maincpu") ->safe_pc( ), data);
/* save for later use */
- state->m_riot_port_a = data;
+ m_riot_port_a = data;
}
-static WRITE8_DEVICE_HANDLER(sym1_riot_b_w)
+WRITE8_MEMBER(sym1_state::sym1_riot_b_w)
{
- sym1_state *state = space.machine().driver_data<sym1_state>();
- logerror("%x: riot_b_w 0x%02x\n", space.machine().device("maincpu") ->safe_pc( ), data);
+ logerror("%x: riot_b_w 0x%02x\n", machine().device("maincpu") ->safe_pc( ), data);
/* save for later use */
- state->m_riot_port_b = data;
+ m_riot_port_b = data;
/* first 4 pins are connected to the 74145 */
- space.machine().device<ttl74145_device>("ttl74145")->write(data & 0x0f);
+ machine().device<ttl74145_device>("ttl74145")->write(data & 0x0f);
}
const riot6532_interface sym1_r6532_interface =
{
- DEVCB_HANDLER(sym1_riot_a_r),
- DEVCB_HANDLER(sym1_riot_b_r),
- DEVCB_HANDLER(sym1_riot_a_w),
- DEVCB_HANDLER(sym1_riot_b_w)
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_riot_a_r),
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_riot_b_r),
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_riot_a_w),
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_riot_b_w)
};
const ttl74145_interface sym1_ttl74145_intf =
{
- DEVCB_LINE(sym1_74145_output_0_w), /* connected to DS0 */
- DEVCB_LINE(sym1_74145_output_1_w), /* connected to DS1 */
- DEVCB_LINE(sym1_74145_output_2_w), /* connected to DS2 */
- DEVCB_LINE(sym1_74145_output_3_w), /* connected to DS3 */
- DEVCB_LINE(sym1_74145_output_4_w), /* connected to DS4 */
- DEVCB_LINE(sym1_74145_output_5_w), /* connected to DS5 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_0_w), /* connected to DS0 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_1_w), /* connected to DS1 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_2_w), /* connected to DS2 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_3_w), /* connected to DS3 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_4_w), /* connected to DS4 */
+ DEVCB_DRIVER_LINE_MEMBER(sym1_state,sym1_74145_output_5_w), /* connected to DS5 */
DEVCB_DEVICE_LINE(SPEAKER_TAG, speaker_level_w),
DEVCB_NULL, /* not connected */
DEVCB_NULL, /* not connected */
@@ -177,15 +167,15 @@ static void sym1_irq(device_t *device, int level)
}
-static READ8_DEVICE_HANDLER( sym1_via0_b_r )
+READ8_MEMBER(sym1_state::sym1_via0_b_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( sym1_via0_b_w )
+WRITE8_MEMBER(sym1_state::sym1_via0_b_w)
{
- logerror("%s: via0_b_w 0x%02x\n", space.machine().describe_context(), data);
+ logerror("%s: via0_b_w 0x%02x\n", machine().describe_context(), data);
}
@@ -194,28 +184,28 @@ static WRITE8_DEVICE_HANDLER( sym1_via0_b_w )
* PA2: Write protect RAM 0x800-0xbff
* PA3: Write protect RAM 0xc00-0xfff
*/
-static WRITE8_DEVICE_HANDLER( sym1_via2_a_w )
+WRITE8_MEMBER(sym1_state::sym1_via2_a_w)
{
- address_space &cpu0space = space.machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &cpu0space = machine().device( "maincpu")->memory().space( AS_PROGRAM );
logerror("SYM1 VIA2 W 0x%02x\n", data);
- if ((space.machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) {
+ if ((machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) {
cpu0space.nop_write(0xa600, 0xa67f);
} else {
cpu0space.install_write_bank(0xa600, 0xa67f, "bank5");
}
- if ((space.machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) {
+ if ((machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) {
cpu0space.nop_write(0x0400, 0x07ff);
} else {
cpu0space.install_write_bank(0x0400, 0x07ff, "bank2");
}
- if ((space.machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) {
+ if ((machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) {
cpu0space.nop_write(0x0800, 0x0bff);
} else {
cpu0space.install_write_bank(0x0800, 0x0bff, "bank3");
}
- if ((space.machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) {
+ if ((machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) {
cpu0space.nop_write(0x0c00, 0x0fff);
} else {
cpu0space.install_write_bank(0x0c00, 0x0fff, "bank4");
@@ -226,13 +216,13 @@ static WRITE8_DEVICE_HANDLER( sym1_via2_a_w )
const via6522_interface sym1_via0 =
{
DEVCB_NULL, /* VIA Port A Input */
- DEVCB_HANDLER(sym1_via0_b_r), /* VIA Port B Input */
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_via0_b_r), /* VIA Port B Input */
DEVCB_NULL, /* VIA Port CA1 Input */
DEVCB_NULL, /* VIA Port CB1 Input */
DEVCB_NULL, /* VIA Port CA2 Input */
DEVCB_NULL, /* VIA Port CB2 Input */
DEVCB_NULL, /* VIA Port A Output */
- DEVCB_HANDLER(sym1_via0_b_w), /* VIA Port B Output */
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_via0_b_w), /* VIA Port B Output */
DEVCB_NULL, /* VIA Port CA1 Output */
DEVCB_NULL, /* VIA Port CB1 Output */
DEVCB_NULL, /* VIA Port CA2 Output */
@@ -267,7 +257,7 @@ const via6522_interface sym1_via2 =
DEVCB_NULL, /* VIA Port CB1 Input */
DEVCB_NULL, /* VIA Port CA2 Input */
DEVCB_NULL, /* VIA Port CB2 Input */
- DEVCB_HANDLER(sym1_via2_a_w), /* VIA Port A Output */
+ DEVCB_DRIVER_MEMBER(sym1_state,sym1_via2_a_w), /* VIA Port A Output */
DEVCB_NULL, /* VIA Port B Output */
DEVCB_NULL, /* VIA Port CA1 Output */
DEVCB_NULL, /* VIA Port CB1 Output */
diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c
index cf8cba92e0a..81849762b32 100644
--- a/src/mess/machine/trs80.c
+++ b/src/mess/machine/trs80.c
@@ -667,26 +667,25 @@ INTERRUPT_GEN_MEMBER(trs80_state::trs80_fdc_interrupt)/* not used - should it be
trs80_fdc_interrupt_internal(machine());
}
-static WRITE_LINE_DEVICE_HANDLER( trs80_fdc_intrq_w )
+WRITE_LINE_MEMBER(trs80_state::trs80_fdc_intrq_w)
{
- trs80_state *drvstate = device->machine().driver_data<trs80_state>();
if (state)
{
- trs80_fdc_interrupt_internal(device->machine());
+ trs80_fdc_interrupt_internal(machine());
}
else
{
- if (drvstate->m_model4)
- drvstate->m_nmi_data = 0;
+ if (m_model4)
+ m_nmi_data = 0;
else
- drvstate->m_irq &= ~IRQ_M1_FDC;
+ m_irq &= ~IRQ_M1_FDC;
}
}
const wd17xx_interface trs80_wd17xx_interface =
{
DEVCB_NULL,
- DEVCB_LINE(trs80_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(trs80_state,trs80_fdc_intrq_w),
DEVCB_NULL,
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
};
diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c
index ae52d4d2089..faa9a763e28 100644
--- a/src/mess/machine/z80ne.c
+++ b/src/mess/machine/z80ne.c
@@ -609,18 +609,17 @@ WRITE8_MEMBER(z80ne_state::lx385_ctrl_w)
}
}
-READ8_DEVICE_HANDLER( lx388_mc6847_videoram_r )
+READ8_MEMBER(z80ne_state::lx388_mc6847_videoram_r)
{
- z80ne_state *state = space.machine().driver_data<z80ne_state>();
if (offset == ~0) return 0xff;
- UINT8 *videoram = state->m_videoram;
+ UINT8 *videoram = m_videoram;
int d6 = BIT(videoram[offset], 6);
int d7 = BIT(videoram[offset], 7);
- state->m_vdg->inv_w(d6 && d7);
- state->m_vdg->as_w(!d6 && d7);
- state->m_vdg->intext_w(!d6 && d7);
+ m_vdg->inv_w(d6 && d7);
+ m_vdg->as_w(!d6 && d7);
+ m_vdg->intext_w(!d6 && d7);
return videoram[offset];
}
@@ -648,9 +647,8 @@ READ8_MEMBER(z80ne_state::lx388_read_field_sync)
*
*/
-WRITE8_DEVICE_HANDLER(lx390_motor_w)
+WRITE8_MEMBER(z80ne_state::lx390_motor_w)
{
- z80ne_state *state = space.machine().driver_data<z80ne_state>();
/* Selection of drive and parameters
A write also causes the selected drive motor to turn on for about 3 seconds.
When the motor turns off, the drive is deselected.
@@ -677,11 +675,11 @@ WRITE8_DEVICE_HANDLER(lx390_motor_w)
if (data & 8)
drive = 3;
- state->m_wd17xx_state.head = (data & 32) ? 1 : 0;
- state->m_wd17xx_state.drive = data & 0x0F;
+ m_wd17xx_state.head = (data & 32) ? 1 : 0;
+ m_wd17xx_state.drive = data & 0x0F;
/* no drive selected, turn off all leds */
- if (!state->m_wd17xx_state.drive)
+ if (!m_wd17xx_state.drive)
{
output_set_value("drv0", 0);
output_set_value("drv1", 0);
@@ -690,23 +688,22 @@ WRITE8_DEVICE_HANDLER(lx390_motor_w)
if (drive < 4)
{
LOG(("lx390_motor_w, set drive %1d\n", drive));
- wd17xx_set_drive(device,drive);
- LOG(("lx390_motor_w, set side %1d\n", state->m_wd17xx_state.head));
- wd17xx_set_side(device, state->m_wd17xx_state.head);
+ wd17xx_set_drive(machine().device("wd1771"),drive);
+ LOG(("lx390_motor_w, set side %1d\n", m_wd17xx_state.head));
+ wd17xx_set_side(machine().device("wd1771"), m_wd17xx_state.head);
}
}
-READ8_DEVICE_HANDLER(lx390_reset_bank)
+READ8_MEMBER(z80ne_state::lx390_reset_bank)
{
- z80ne_state *state = space.machine().driver_data<z80ne_state>();
offs_t pc;
/* if PC is not in range, we are under integrated debugger control, DON'T SWAP */
- pc = space.machine().device("z80ne")->safe_pc();
+ pc = machine().device("z80ne")->safe_pc();
if((pc >= 0xf000) && (pc <=0xffff))
{
LOG(("lx390_reset_bank, reset memory bank 1\n"));
- state->membank("bank1")->set_entry(0); /* RAM at 0x0000 (bank 1) */
+ membank("bank1")->set_entry(0); /* RAM at 0x0000 (bank 1) */
}
else
{
@@ -715,34 +712,34 @@ READ8_DEVICE_HANDLER(lx390_reset_bank)
return 0xff;
}
-READ8_DEVICE_HANDLER(lx390_fdc_r)
+READ8_MEMBER(z80ne_state::lx390_fdc_r)
{
UINT8 d;
switch(offset)
{
case 0:
- d = wd17xx_status_r(device, space, 0) ^ 0xff;
+ d = wd17xx_status_r(machine().device("wd1771"), space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx status: %02x\n", d));
break;
case 1:
- d = wd17xx_track_r(device, space, 0) ^ 0xff;
+ d = wd17xx_track_r(machine().device("wd1771"), space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx track: %02x\n", d));
break;
case 2:
- d = wd17xx_sector_r(device, space, 0) ^ 0xff;
+ d = wd17xx_sector_r(machine().device("wd1771"), space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx sector: %02x\n", d));
break;
case 3:
- d = wd17xx_data_r(device, space, 0) ^ 0xff;
+ d = wd17xx_data_r(machine().device("wd1771"), space, 0) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx data3: %02x\n", d));
break;
case 6:
d = 0xff;
- lx390_reset_bank(device, space, 0);
+ lx390_reset_bank(space, 0);
break;
case 7:
- d = wd17xx_data_r(device, space, 3) ^ 0xff;
+ d = wd17xx_data_r(machine().device("wd1771"), space, 3) ^ 0xff;
LOG(("lx390_fdc_r, WD17xx data7, force: %02x\n", d));
break;
default:
@@ -751,9 +748,8 @@ READ8_DEVICE_HANDLER(lx390_fdc_r)
return d;
}
-WRITE8_DEVICE_HANDLER(lx390_fdc_w)
+WRITE8_MEMBER(z80ne_state::lx390_fdc_w)
{
- z80ne_state *state = space.machine().driver_data<z80ne_state>();
UINT8 d;
d = data;
@@ -761,31 +757,31 @@ WRITE8_DEVICE_HANDLER(lx390_fdc_w)
{
case 0:
LOG(("lx390_fdc_w, WD17xx command: %02x\n", d));
- wd17xx_command_w(device, space, offset, d ^ 0xff);
- if (state->m_wd17xx_state.drive & 1)
+ wd17xx_command_w(machine().device("wd1771"), space, offset, d ^ 0xff);
+ if (m_wd17xx_state.drive & 1)
output_set_value("drv0", 2);
- else if (state->m_wd17xx_state.drive & 2)
+ else if (m_wd17xx_state.drive & 2)
output_set_value("drv1", 2);
break;
case 1:
LOG(("lx390_fdc_w, WD17xx track: %02x\n", d));
- wd17xx_track_w(device, space, offset, d ^ 0xff);
+ wd17xx_track_w(machine().device("wd1771"), space, offset, d ^ 0xff);
break;
case 2:
LOG(("lx390_fdc_w, WD17xx sector: %02x\n", d));
- wd17xx_sector_w(device, space, offset, d ^ 0xff);
+ wd17xx_sector_w(machine().device("wd1771"), space, offset, d ^ 0xff);
break;
case 3:
- wd17xx_data_w(device, space, 0, d ^ 0xff);
+ wd17xx_data_w(machine().device("wd1771"), space, 0, d ^ 0xff);
LOG(("lx390_fdc_w, WD17xx data3: %02x\n", d));
break;
case 6:
LOG(("lx390_fdc_w, motor_w: %02x\n", d));
- lx390_motor_w(device, space, 0, d);
+ lx390_motor_w(space, 0, d);
break;
case 7:
LOG(("lx390_fdc_w, WD17xx data7, force: %02x\n", d));
- wd17xx_data_w(device, space, 3, d ^ 0xff);
+ wd17xx_data_w(machine().device("wd1771"), space, 3, d ^ 0xff);
break;
}
}
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index 18688fc56b1..b420703cfb5 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -276,10 +276,9 @@ static MC6845_UPDATE_ROW( vid_update_row )
}
}
-static WRITE_LINE_DEVICE_HANDLER( bbc_vsync )
+WRITE_LINE_MEMBER(bbc_state::bbc_vsync)
{
- bbc_state *bstate = device->machine().driver_data<bbc_state>();
- bstate->m_trom->dew_w(state);
+ m_trom->dew_w(state);
}
@@ -293,7 +292,7 @@ const mc6845_interface bbc_mc6845_intf =
DEVCB_NULL, /* on_de_changed */
DEVCB_NULL, /* on_cur_changed */
DEVCB_NULL, /* on_hsync_changed */
- DEVCB_LINE(bbc_vsync), /* on_vsync_changed */
+ DEVCB_DRIVER_LINE_MEMBER(bbc_state,bbc_vsync), /* on_vsync_changed */
NULL
};
diff --git a/src/mess/video/dgn_beta.c b/src/mess/video/dgn_beta.c
index 747f6cacb94..6980c9fec66 100644
--- a/src/mess/video/dgn_beta.c
+++ b/src/mess/video/dgn_beta.c
@@ -240,22 +240,20 @@ static MC6845_UPDATE_ROW( dgnbeta_update_row )
}
-static WRITE_LINE_DEVICE_HANDLER( dgnbeta_vsync_changed )
+WRITE_LINE_MEMBER(dgn_beta_state::dgnbeta_vsync_changed)
{
- dgn_beta_state *st = device->machine().driver_data<dgn_beta_state>();
-
- st->m_beta_VSync=state;
- if (!st->m_beta_VSync)
+ m_beta_VSync=state;
+ if (!m_beta_VSync)
{
- st->m_FlashCount++;
- if(st->m_FlashCount==10)
+ m_FlashCount++;
+ if(m_FlashCount==10)
{
- st->m_FlashCount=0; // Reset counter
- st->m_FlashBit=(!st->m_FlashBit) & 0x01; // Invert flash bit.
+ m_FlashCount=0; // Reset counter
+ m_FlashBit=(!m_FlashBit) & 0x01; // Invert flash bit.
}
}
- dgn_beta_frame_interrupt(device->machine(), state);
+ dgn_beta_frame_interrupt(machine(), state);
}
const mc6845_interface dgnbeta_crtc6845_interface =
@@ -268,7 +266,7 @@ const mc6845_interface dgnbeta_crtc6845_interface =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(dgnbeta_vsync_changed),
+ DEVCB_DRIVER_LINE_MEMBER(dgn_beta_state,dgnbeta_vsync_changed),
NULL
};
diff --git a/src/mess/video/pecom.c b/src/mess/video/pecom.c
index 811ce07bf5a..9dd8cf58d1a 100644
--- a/src/mess/video/pecom.c
+++ b/src/mess/video/pecom.c
@@ -70,17 +70,15 @@ static CDP1869_PCB_READ( pecom_pcb_r )
return BIT(pmd, 7);
}
-static WRITE_LINE_DEVICE_HANDLER( pecom_prd_w )
+WRITE_LINE_MEMBER(pecom_state::pecom_prd_w)
{
- pecom_state *driver_state = device->machine().driver_data<pecom_state>();
-
// every other PRD triggers a DMAOUT request
- if (driver_state->m_dma)
+ if (m_dma)
{
- device->machine().device(CDP1802_TAG)->execute().set_input_line(COSMAC_INPUT_LINE_DMAOUT, HOLD_LINE);
+ machine().device(CDP1802_TAG)->execute().set_input_line(COSMAC_INPUT_LINE_DMAOUT, HOLD_LINE);
}
- driver_state->m_dma = !driver_state->m_dma;
+ m_dma = !m_dma;
}
static CDP1869_INTERFACE( pecom_cdp1869_intf )
@@ -91,7 +89,7 @@ static CDP1869_INTERFACE( pecom_cdp1869_intf )
pecom_pcb_r,
pecom_char_ram_r,
pecom_char_ram_w,
- DEVCB_LINE(pecom_prd_w)
+ DEVCB_DRIVER_LINE_MEMBER(pecom_state,pecom_prd_w)
};
VIDEO_START_MEMBER(pecom_state,pecom)
diff --git a/src/mess/video/pet.c b/src/mess/video/pet.c
index 5472b1cd7d8..3c76976d689 100644
--- a/src/mess/video/pet.c
+++ b/src/mess/video/pet.c
@@ -106,7 +106,7 @@ MC6845_UPDATE_ROW( pet80_update_row )
}
}
-WRITE_LINE_DEVICE_HANDLER( pet_display_enable_changed )
+WRITE_LINE_MEMBER(pet_state::pet_display_enable_changed)
{
}