summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-26 13:24:58 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-26 13:24:58 +0000
commit23a3e24dcb154914b0aa5f4abb452486c8a307f9 (patch) (github)
tree85dbf826cc06dbaf040c063c030d2410bbc4c7d6
parent378cf38b3e8ffdabb44f3485139e1e72d8054255 (diff)
downloadmame-23a3e24dcb154914b0aa5f4abb452486c8a307f9.tar.bz2
mame-23a3e24dcb154914b0aa5f4abb452486c8a307f9.zip
Replace some *_DEVICE_HANDLER with _MEMBER calls (no whatsnew)
-rw-r--r--src/mame/drivers/chihiro.c29
-rw-r--r--src/mame/drivers/dlair.c25
-rw-r--r--src/mame/drivers/mpu4dealem.c7
-rw-r--r--src/mame/drivers/mpu4vid.c163
-rw-r--r--src/mame/drivers/nss.c10
-rw-r--r--src/mame/drivers/nyny.c8
-rw-r--r--src/mame/drivers/proconn.c15
-rw-r--r--src/mame/drivers/r2dtank.c10
-rw-r--r--src/mame/drivers/sfcbox.c10
-rw-r--r--src/mame/drivers/snesb.c8
-rw-r--r--src/mame/drivers/taitotz.c24
-rw-r--r--src/mess/drivers/a2600.c57
-rw-r--r--src/mess/drivers/ami1200.c34
-rw-r--r--src/mess/drivers/apexc.c14
-rw-r--r--src/mess/drivers/apricot.c8
-rw-r--r--src/mess/drivers/atari400.c21
-rw-r--r--src/mess/drivers/bbcbc.c7
-rw-r--r--src/mess/drivers/bigbord2.c7
-rw-r--r--src/mess/drivers/bml3.c16
-rw-r--r--src/mess/drivers/dectalk.c7
-rw-r--r--src/mess/drivers/digel804.c8
-rw-r--r--src/mess/drivers/elwro800.c14
-rw-r--r--src/mess/drivers/h19.c7
-rw-r--r--src/mess/drivers/jr100.c35
-rw-r--r--src/mess/drivers/m20.c24
-rw-r--r--src/mess/drivers/mikrosha.c5
-rw-r--r--src/mess/drivers/mirage.c47
-rw-r--r--src/mess/drivers/ms0515.c8
-rw-r--r--src/mess/drivers/mycom.c16
-rw-r--r--src/mess/drivers/mz2000.c135
-rw-r--r--src/mess/drivers/mz2500.c143
-rw-r--r--src/mess/drivers/nanos.c38
-rw-r--r--src/mess/drivers/osbexec.c79
-rw-r--r--src/mess/drivers/palm.c45
-rw-r--r--src/mess/drivers/pasogo.c7
-rw-r--r--src/mess/drivers/pc6001.c30
-rw-r--r--src/mess/drivers/pc8801.c77
-rw-r--r--src/mess/drivers/pc88va.c107
-rw-r--r--src/mess/drivers/pc9801.c140
-rw-r--r--src/mess/drivers/pk8000.c46
-rw-r--r--src/mess/drivers/px4.c33
-rw-r--r--src/mess/drivers/qx10.c6
-rw-r--r--src/mess/drivers/rvoice.c5
-rw-r--r--src/mess/drivers/sgi_ip2.c7
-rw-r--r--src/mess/drivers/smc777.c16
-rw-r--r--src/mess/drivers/spc1000.c48
-rw-r--r--src/mess/drivers/vk100.c34
-rw-r--r--src/mess/drivers/vtech1.c30
48 files changed, 904 insertions, 766 deletions
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 9813995cef5..696caab82be 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -416,6 +416,10 @@ public:
nv2a_renderer *nvidia_nv2a;
virtual void machine_start();
+ DECLARE_WRITE_LINE_MEMBER(chihiro_pic8259_1_set_int_line);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE_LINE_MEMBER(chihiro_pit8254_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(chihiro_pit8254_out2_changed);
};
/*
@@ -1552,25 +1556,24 @@ int ide_baseboard_device::write_sector(UINT32 lba, const void *buffer)
* PIC & PIT
*/
-static WRITE_LINE_DEVICE_HANDLER( chihiro_pic8259_1_set_int_line )
+WRITE_LINE_MEMBER(chihiro_state::chihiro_pic8259_1_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 READ8_DEVICE_HANDLER( get_slave_ack )
+READ8_MEMBER(chihiro_state::get_slave_ack)
{
- chihiro_state *chst=space.machine().driver_data<chihiro_state>();
if (offset==2) { // IRQ = 2
- return pic8259_acknowledge(chst->chihiro_devs.pic8259_2);
+ return pic8259_acknowledge(chihiro_devs.pic8259_2);
}
return 0x00;
}
static const struct pic8259_interface chihiro_pic8259_1_config =
{
- DEVCB_LINE(chihiro_pic8259_1_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(chihiro_state, chihiro_pic8259_1_set_int_line),
DEVCB_LINE_VCC,
- DEVCB_HANDLER(get_slave_ack)
+ DEVCB_DRIVER_MEMBER(chihiro_state,get_slave_ack)
};
static const struct pic8259_interface chihiro_pic8259_2_config =
@@ -1592,15 +1595,15 @@ static IRQ_CALLBACK(irq_callback)
return r;
}
-static WRITE_LINE_DEVICE_HANDLER( chihiro_pit8254_out0_changed )
+WRITE_LINE_MEMBER(chihiro_state::chihiro_pit8254_out0_changed)
{
- if ( device->machine().device("pic8259_1") )
+ if ( machine().device("pic8259_1") )
{
- pic8259_ir0_w(device->machine().device("pic8259_1"), state);
+ pic8259_ir0_w(machine().device("pic8259_1"), state);
}
}
-static WRITE_LINE_DEVICE_HANDLER( chihiro_pit8254_out2_changed )
+WRITE_LINE_MEMBER(chihiro_state::chihiro_pit8254_out2_changed)
{
//chihiro_speaker_set_input( state ? 1 : 0 );
}
@@ -1611,7 +1614,7 @@ static const struct pit8253_config chihiro_pit8254_config =
{
1125000, /* heartbeat IRQ */
DEVCB_NULL,
- DEVCB_LINE(chihiro_pit8254_out0_changed)
+ DEVCB_DRIVER_LINE_MEMBER(chihiro_state, chihiro_pit8254_out0_changed)
}, {
1125000, /* (unused) dram refresh */
DEVCB_NULL,
@@ -1619,7 +1622,7 @@ static const struct pit8253_config chihiro_pit8254_config =
}, {
1125000, /* (unused) pio port c pin 4, and speaker polling enough */
DEVCB_NULL,
- DEVCB_LINE(chihiro_pit8254_out2_changed)
+ DEVCB_DRIVER_LINE_MEMBER(chihiro_state, chihiro_pit8254_out2_changed)
}
}
};
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 342068dc9e0..0f0ed9e0432 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -115,6 +115,9 @@ public:
DECLARE_PALETTE_INIT(dleuro);
UINT32 screen_update_dleuro(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(vblank_callback);
+ DECLARE_WRITE_LINE_MEMBER(dleuro_interrupt);
+ DECLARE_WRITE16_MEMBER(serial_transmit);
+ DECLARE_READ16_MEMBER(serial_receive);
};
@@ -150,25 +153,23 @@ static const UINT8 led_map[16] =
*
*************************************/
-static WRITE_LINE_DEVICE_HANDLER( dleuro_interrupt )
+WRITE_LINE_MEMBER(dlair_state::dleuro_interrupt)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state);
+ machine().device("maincpu")->execute().set_input_line(0, state);
}
-static WRITE16_DEVICE_HANDLER( serial_transmit )
+WRITE16_MEMBER(dlair_state::serial_transmit)
{
- dlair_state *state = space.machine().driver_data<dlair_state>();
- state->laserdisc_data_w(data);
+ laserdisc_data_w(data);
}
-static READ16_DEVICE_HANDLER( serial_receive )
+READ16_MEMBER(dlair_state::serial_receive)
{
- dlair_state *state = space.machine().driver_data<dlair_state>();
/* if we still have data to send, do it now */
- if (offset == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
- return state->laserdisc_data_r();
+ if (offset == 0 && laserdisc_data_available_r() == ASSERT_LINE)
+ return laserdisc_data_r();
return -1;
}
@@ -185,12 +186,12 @@ static Z80CTC_INTERFACE( ctc_intf )
static const z80sio_interface sio_intf =
{
- DEVCB_LINE(dleuro_interrupt), /* interrupt handler */
+ DEVCB_DRIVER_LINE_MEMBER(dlair_state, dleuro_interrupt), /* interrupt handler */
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
- DEVCB_HANDLER(serial_transmit), /* transmit handler */
- DEVCB_HANDLER(serial_receive) /* receive handler */
+ DEVCB_DRIVER_MEMBER16(dlair_state,serial_transmit), /* transmit handler */
+ DEVCB_DRIVER_MEMBER16(dlair_state,serial_receive) /* receive handler */
};
diff --git a/src/mame/drivers/mpu4dealem.c b/src/mame/drivers/mpu4dealem.c
index 3121a6d13a0..9ca8a477144 100644
--- a/src/mame/drivers/mpu4dealem.c
+++ b/src/mame/drivers/mpu4dealem.c
@@ -31,6 +31,7 @@ public:
DECLARE_MACHINE_RESET(dealem_vid);
DECLARE_PALETTE_INIT(dealem);
UINT32 screen_update_dealem(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(dealem_vsync_changed);
};
@@ -132,9 +133,9 @@ UINT32 mpu4dealem_state::screen_update_dealem(screen_device &screen, bitmap_ind1
}
-static WRITE_LINE_DEVICE_HANDLER( dealem_vsync_changed )
+WRITE_LINE_MEMBER(mpu4dealem_state::dealem_vsync_changed)
{
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, state);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, state);
}
@@ -154,7 +155,7 @@ static const mc6845_interface hd6845_intf =
DEVCB_NULL, /* callback for display state changes */
DEVCB_NULL, /* callback for cursor state changes */
DEVCB_NULL, /* HSYNC callback */
- DEVCB_LINE(dealem_vsync_changed), /* VSYNC callback */
+ DEVCB_DRIVER_LINE_MEMBER(mpu4dealem_state, dealem_vsync_changed), /* VSYNC callback */
NULL /* update address callback */
};
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index 248930939c9..ffd60f18b83 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -270,6 +270,23 @@ public:
DECLARE_VIDEO_START(mpu4_vid);
UINT32 screen_update_mpu4_vid(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_timer_callback);
+ DECLARE_READ_LINE_MEMBER(m6809_acia_rx_r);
+ DECLARE_WRITE_LINE_MEMBER(m6809_acia_tx_w);
+ DECLARE_READ_LINE_MEMBER(m6809_acia_cts_r);
+ DECLARE_WRITE_LINE_MEMBER(m6809_acia_rts_w);
+ DECLARE_READ_LINE_MEMBER(m6809_acia_dcd_r);
+ DECLARE_WRITE_LINE_MEMBER(m6809_acia_irq);
+ DECLARE_READ_LINE_MEMBER(m68k_acia_rx_r);
+ DECLARE_WRITE_LINE_MEMBER(m68k_acia_tx_w);
+ DECLARE_READ_LINE_MEMBER(m68k_acia_cts_r);
+ DECLARE_WRITE_LINE_MEMBER(m68k_acia_rts_w);
+ DECLARE_READ_LINE_MEMBER(m68k_acia_dcd_r);
+ DECLARE_WRITE_LINE_MEMBER(m68k_acia_irq);
+ DECLARE_WRITE_LINE_MEMBER(cpu1_ptm_irq);
+ DECLARE_WRITE8_MEMBER(vid_o1_callback);
+ DECLARE_WRITE8_MEMBER(vid_o2_callback);
+ DECLARE_WRITE8_MEMBER(vid_o3_callback);
+ DECLARE_READ8_MEMBER(pia_ic5_porta_track_r);
};
@@ -312,122 +329,109 @@ static void update_mpu68_interrupts(running_machine &machine)
/* Communications with 6809 board */
-static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r )
+READ_LINE_MEMBER(mpu4vid_state::m6809_acia_rx_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m68k_m6809_line;
+ return m_m68k_m6809_line;
}
-static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w )
+WRITE_LINE_MEMBER(mpu4vid_state::m6809_acia_tx_w)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m6809_m68k_line = state;
+ m_m6809_m68k_line = state;
}
-static READ_LINE_DEVICE_HANDLER( m6809_acia_cts_r )
+READ_LINE_MEMBER(mpu4vid_state::m6809_acia_cts_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m6809_acia_cts;
+ return m_m6809_acia_cts;
}
-static WRITE_LINE_DEVICE_HANDLER( m6809_acia_rts_w )
+WRITE_LINE_MEMBER(mpu4vid_state::m6809_acia_rts_w)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m6809_acia_rts = state;
+ m_m6809_acia_rts = state;
}
-static READ_LINE_DEVICE_HANDLER( m6809_acia_dcd_r )
+READ_LINE_MEMBER(mpu4vid_state::m6809_acia_dcd_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m6809_acia_dcd;
+ return m_m6809_acia_dcd;
}
-static WRITE_LINE_DEVICE_HANDLER( m6809_acia_irq )
+WRITE_LINE_MEMBER(mpu4vid_state::m6809_acia_irq)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m68k_acia_cts = !state;
- device->machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
+ m_m68k_acia_cts = !state;
+ machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
}
static ACIA6850_INTERFACE( m6809_acia_if )
{
0,
0,
- DEVCB_LINE(m6809_acia_rx_r),
- DEVCB_LINE(m6809_acia_tx_w),
- DEVCB_LINE(m6809_acia_cts_r),
- DEVCB_LINE(m6809_acia_rts_w),
- DEVCB_LINE(m6809_acia_dcd_r),
- DEVCB_LINE(m6809_acia_irq)
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_rx_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_tx_w),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_cts_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_rts_w),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_dcd_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m6809_acia_irq)
};
-static READ_LINE_DEVICE_HANDLER( m68k_acia_rx_r )
+READ_LINE_MEMBER(mpu4vid_state::m68k_acia_rx_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m6809_m68k_line;
+ return m_m6809_m68k_line;
}
-static WRITE_LINE_DEVICE_HANDLER( m68k_acia_tx_w )
+WRITE_LINE_MEMBER(mpu4vid_state::m68k_acia_tx_w)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m68k_m6809_line = state;
+ m_m68k_m6809_line = state;
}
-static READ_LINE_DEVICE_HANDLER( m68k_acia_cts_r )
+READ_LINE_MEMBER(mpu4vid_state::m68k_acia_cts_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m68k_acia_cts;
+ return m_m68k_acia_cts;
}
-static WRITE_LINE_DEVICE_HANDLER( m68k_acia_rts_w )
+WRITE_LINE_MEMBER(mpu4vid_state::m68k_acia_rts_w)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m6809_acia_dcd = state;
+ m_m6809_acia_dcd = state;
}
-static READ_LINE_DEVICE_HANDLER( m68k_acia_dcd_r )
+READ_LINE_MEMBER(mpu4vid_state::m68k_acia_dcd_r)
{
- mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
- return state->m_m6809_acia_rts;
+ return m_m6809_acia_rts;
}
-static WRITE_LINE_DEVICE_HANDLER( m68k_acia_irq )
+WRITE_LINE_MEMBER(mpu4vid_state::m68k_acia_irq)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m6809_acia_cts = !state;
- drvstate->m_m6850_irq_state = state;
- update_mpu68_interrupts(device->machine());
+ m_m6809_acia_cts = !state;
+ m_m6850_irq_state = state;
+ update_mpu68_interrupts(machine());
}
static ACIA6850_INTERFACE( m68k_acia_if )
{
0,
0,
- DEVCB_LINE(m68k_acia_rx_r),
- DEVCB_LINE(m68k_acia_tx_w),
- DEVCB_LINE(m68k_acia_cts_r),
- DEVCB_LINE(m68k_acia_rts_w),
- DEVCB_LINE(m68k_acia_dcd_r),
- DEVCB_LINE(m68k_acia_irq)
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_rx_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_tx_w),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_cts_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_rts_w),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_dcd_r),
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, m68k_acia_irq)
};
-static WRITE_LINE_DEVICE_HANDLER( cpu1_ptm_irq )
+WRITE_LINE_MEMBER(mpu4vid_state::cpu1_ptm_irq)
{
- mpu4vid_state *drvstate = device->machine().driver_data<mpu4vid_state>();
- drvstate->m_m6840_irq_state = state;
- update_mpu68_interrupts(device->machine());
+ m_m6840_irq_state = state;
+ update_mpu68_interrupts(machine());
}
-static WRITE8_DEVICE_HANDLER( vid_o1_callback )
+WRITE8_MEMBER(mpu4vid_state::vid_o1_callback)
{
- downcast<ptm6840_device *>(device)->set_c2(data); /* this output is the clock for timer2 */
+ downcast<ptm6840_device *>(machine().device("6840ptm_68k"))->set_c2(data); /* this output is the clock for timer2 */
if (data)
{
- acia6850_device *acia_0 = space.machine().device<acia6850_device>("acia6850_0");
- acia6850_device *acia_1 = space.machine().device<acia6850_device>("acia6850_1");
+ acia6850_device *acia_0 = machine().device<acia6850_device>("acia6850_0");
+ acia6850_device *acia_1 = machine().device<acia6850_device>("acia6850_1");
acia_0->tx_clock_in();
acia_0->rx_clock_in();
acia_1->tx_clock_in();
@@ -436,15 +440,15 @@ static WRITE8_DEVICE_HANDLER( vid_o1_callback )
}
-static WRITE8_DEVICE_HANDLER( vid_o2_callback )
+WRITE8_MEMBER(mpu4vid_state::vid_o2_callback)
{
- downcast<ptm6840_device *>(device)->set_c3(data); /* this output is the clock for timer3 */
+ downcast<ptm6840_device *>(machine().device("6840ptm_68k"))->set_c3(data); /* this output is the clock for timer3 */
}
-static WRITE8_DEVICE_HANDLER( vid_o3_callback )
+WRITE8_MEMBER(mpu4vid_state::vid_o3_callback)
{
- downcast<ptm6840_device *>(device)->set_c1(data); /* this output is the clock for timer1 */
+ downcast<ptm6840_device *>(machine().device("6840ptm_68k"))->set_c1(data); /* this output is the clock for timer1 */
}
@@ -452,10 +456,10 @@ static const ptm6840_interface ptm_vid_intf =
{
VIDEO_MASTER_CLOCK / 10, /* 68k E clock */
{ 0, 0, 0 },
- { DEVCB_HANDLER(vid_o1_callback),
- DEVCB_HANDLER(vid_o2_callback),
- DEVCB_HANDLER(vid_o3_callback) },
- DEVCB_LINE(cpu1_ptm_irq)
+ { DEVCB_DRIVER_MEMBER(mpu4vid_state,vid_o1_callback),
+ DEVCB_DRIVER_MEMBER(mpu4vid_state,vid_o2_callback),
+ DEVCB_DRIVER_MEMBER(mpu4vid_state,vid_o3_callback) },
+ DEVCB_DRIVER_LINE_MEMBER(mpu4vid_state, cpu1_ptm_irq)
};
@@ -719,9 +723,8 @@ READ16_HANDLER( bt471_r )
*
*************************************/
-static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
+READ8_MEMBER(mpu4vid_state::pia_ic5_porta_track_r)
{
- mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
/* The SWP trackball interface connects a standard trackball to the AUX1 port on the MPU4
mainboard. As per usual, they've taken the cheap route here, reading and processing the
raw quadrature signal from the encoder wheels for a 4 bit interface, rather than use any
@@ -730,24 +733,24 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
We invert the X and Y data at source due to the use of Schmitt triggers in the interface, which
clean up the pulses and flip the active phase.*/
- LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",space.machine().describe_context()));
+ LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context()));
- UINT8 data = state->ioport("AUX1")->read();
+ UINT8 data = ioport("AUX1")->read();
- INT8 dx = state->ioport("TRACKX")->read();
- INT8 dy = state->ioport("TRACKY")->read();
+ INT8 dx = ioport("TRACKX")->read();
+ INT8 dy = ioport("TRACKY")->read();
- state->m_cur[0] = dy + dx;
- state->m_cur[1] = dy - dx;
+ m_cur[0] = dy + dx;
+ m_cur[1] = dy - dx;
UINT8 xa, xb, ya, yb;
/* generate pulses for the input port (A and B are 1 unit out of phase for direction sensing)*/
- xa = ((state->m_cur[0] + 1) & 3) <= 1;
- xb = (state->m_cur[0] & 3) <= 1;
- ya = ((state->m_cur[1] + 1) & 3) <= 1;
- yb = (state->m_cur[1] & 3) <= 1;
+ xa = ((m_cur[0] + 1) & 3) <= 1;
+ xb = (m_cur[0] & 3) <= 1;
+ ya = ((m_cur[1] + 1) & 3) <= 1;
+ yb = (m_cur[1] & 3) <= 1;
data |= (xa << 4); // XA
data |= (ya << 5); // YA
@@ -759,7 +762,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
static const pia6821_interface pia_ic5t_intf =
{
- DEVCB_HANDLER(pia_ic5_porta_track_r), /* port A in */
+ DEVCB_DRIVER_MEMBER(mpu4vid_state,pia_ic5_porta_track_r), /* port A in */
DEVCB_DRIVER_MEMBER(mpu4_state, pia_ic5_portb_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c
index aeeaca7dce3..bd29b5d017c 100644
--- a/src/mame/drivers/nss.c
+++ b/src/mame/drivers/nss.c
@@ -330,6 +330,8 @@ public:
virtual void machine_start();
virtual void machine_reset();
INTERRUPT_GEN_MEMBER(nss_vblank_irq);
+ DECLARE_READ8_MEMBER(spc_ram_100_r);
+ DECLARE_WRITE8_MEMBER(spc_ram_100_w);
};
@@ -353,20 +355,22 @@ static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, nss_state )
AM_RANGE(0xc00000, 0xffffff) AM_READWRITE_LEGACY(snes_r_bank7, snes_w_bank7) /* Mirror and ROM */
ADDRESS_MAP_END
-static READ8_DEVICE_HANDLER( spc_ram_100_r )
+READ8_MEMBER(nss_state::spc_ram_100_r)
{
+ device_t *device = machine().device("spc700");
return spc_ram_r(device, space, offset + 0x100);
}
-static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
+WRITE8_MEMBER(nss_state::spc_ram_100_w)
{
+ device_t *device = machine().device("spc700");
spc_ram_w(device, space, offset + 0x100, data);
}
static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, nss_state )
AM_RANGE(0x0000, 0x00ef) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_r, spc_ram_w) /* lower 32k ram */
AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE_LEGACY("spc700", spc_io_r, spc_io_w) /* spc io */
- AM_RANGE(0x0100, 0xffff) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_100_r, spc_ram_100_w)
+ AM_RANGE(0x0100, 0xffff) AM_READWRITE(spc_ram_100_r, spc_ram_100_w)
ADDRESS_MAP_END
/* NSS specific */
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index 5c0ed682a31..1626389a095 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -130,6 +130,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
INTERRUPT_GEN_MEMBER(update_pia_1);
+ DECLARE_WRITE8_MEMBER(ic48_1_74123_output_changed);
};
@@ -262,10 +263,9 @@ static const pia6821_interface pia_2_intf =
*
*************************************/
-static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed )
+WRITE8_MEMBER(nyny_state::ic48_1_74123_output_changed)
{
- nyny_state *state = space.machine().driver_data<nyny_state>();
- state->m_pia2->ca1_w(data);
+ m_pia2->ca1_w(data);
}
@@ -277,7 +277,7 @@ static const ttl74123_interface ic48_1_config =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
- DEVCB_HANDLER(ic48_1_74123_output_changed)
+ DEVCB_DRIVER_MEMBER(nyny_state,ic48_1_74123_output_changed)
};
diff --git a/src/mame/drivers/proconn.c b/src/mame/drivers/proconn.c
index b3828f11069..948d1980008 100644
--- a/src/mame/drivers/proconn.c
+++ b/src/mame/drivers/proconn.c
@@ -173,6 +173,8 @@ protected:
public:
DECLARE_DRIVER_INIT(proconn);
virtual void machine_reset();
+ DECLARE_WRITE16_MEMBER(serial_transmit);
+ DECLARE_READ16_MEMBER(serial_receive);
};
static ADDRESS_MAP_START( proconn_map, AS_PROGRAM, 8, proconn_state )
@@ -309,24 +311,23 @@ static Z80CTC_INTERFACE( ctc_intf )
DEVCB_NULL // ZC/TO2 callback
};
-static WRITE16_DEVICE_HANDLER( serial_transmit )
+WRITE16_MEMBER(proconn_state::serial_transmit)
{
- proconn_state *state = space.machine().driver_data<proconn_state>();
//Don't like the look of this, should be a clock somewhere
// if (offset == 0)
-// state->m_vfd->write_char( data );
+// m_vfd->write_char( data );
// should probably be in the pios above
for (int i=0; i<8;i++)
{
- state->m_vfd->shift_data( (data & (1<<i))?0:1 );
+ m_vfd->shift_data( (data & (1<<i))?0:1 );
}
}
-static READ16_DEVICE_HANDLER( serial_receive )
+READ16_MEMBER(proconn_state::serial_receive)
{
return -1;
}
@@ -338,8 +339,8 @@ static const z80sio_interface sio_intf =
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
- DEVCB_HANDLER(serial_transmit), /* transmit handler */
- DEVCB_HANDLER(serial_receive) /* receive handler */
+ DEVCB_DRIVER_MEMBER16(proconn_state,serial_transmit), /* transmit handler */
+ DEVCB_DRIVER_MEMBER16(proconn_state,serial_receive) /* receive handler */
};
static const ay8910_interface ay8910_config =
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index de0934f5145..987859f074e 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -76,6 +76,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(display_enable_changed);
DECLARE_WRITE8_MEMBER(pia_comp_w);
virtual void machine_start();
+ DECLARE_WRITE8_MEMBER(ttl74123_output_changed);
};
@@ -229,12 +230,11 @@ static const ay8910_interface ay8910_2_interface =
*
*************************************/
-static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
+WRITE8_MEMBER(r2dtank_state::ttl74123_output_changed)
{
- r2dtank_state *state = space.machine().driver_data<r2dtank_state>();
- pia6821_device *pia = space.machine().device<pia6821_device>("pia_main");
+ pia6821_device *pia = machine().device<pia6821_device>("pia_main");
pia->ca1_w(data);
- state->m_ttl74123_output = data;
+ m_ttl74123_output = data;
}
@@ -252,7 +252,7 @@ static const ttl74123_interface ttl74123_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
- DEVCB_HANDLER(ttl74123_output_changed)
+ DEVCB_DRIVER_MEMBER(r2dtank_state,ttl74123_output_changed)
};
diff --git a/src/mame/drivers/sfcbox.c b/src/mame/drivers/sfcbox.c
index 00def6d38ba..931040560ef 100644
--- a/src/mame/drivers/sfcbox.c
+++ b/src/mame/drivers/sfcbox.c
@@ -150,6 +150,8 @@ public:
DECLARE_WRITE8_MEMBER( snes_map_1_w );
DECLARE_MACHINE_START(sfcbox);
DECLARE_MACHINE_RESET(sfcbox);
+ DECLARE_READ8_MEMBER(spc_ram_100_r);
+ DECLARE_WRITE8_MEMBER(spc_ram_100_w);
};
UINT32 sfcbox_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
@@ -169,20 +171,22 @@ static ADDRESS_MAP_START( snes_map, AS_PROGRAM, 8, sfcbox_state )
AM_RANGE(0xc00000, 0xffffff) AM_READWRITE_LEGACY(snes_r_bank7, snes_w_bank7) /* Mirror and ROM */
ADDRESS_MAP_END
-static READ8_DEVICE_HANDLER( spc_ram_100_r )
+READ8_MEMBER(sfcbox_state::spc_ram_100_r)
{
+ device_t *device = machine().device("spc700");
return spc_ram_r(device, space, offset + 0x100);
}
-static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
+WRITE8_MEMBER(sfcbox_state::spc_ram_100_w)
{
+ device_t *device = machine().device("spc700");
spc_ram_w(device, space, offset + 0x100, data);
}
static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, sfcbox_state )
AM_RANGE(0x0000, 0x00ef) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_r, spc_ram_w) /* lower 32k ram */
AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE_LEGACY("spc700", spc_io_r, spc_io_w) /* spc io */
- AM_RANGE(0x0100, 0xffff) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_100_r, spc_ram_100_w)
+ AM_RANGE(0x0100, 0xffff) AM_READWRITE(spc_ram_100_r, spc_ram_100_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( sfcbox_map, AS_PROGRAM, 8, sfcbox_state )
diff --git a/src/mame/drivers/snesb.c b/src/mame/drivers/snesb.c
index 682bf065e30..6dde02e4c3d 100644
--- a/src/mame/drivers/snesb.c
+++ b/src/mame/drivers/snesb.c
@@ -245,20 +245,22 @@ static ADDRESS_MAP_START( snesb_map, AS_PROGRAM, 8, snesb_state )
AM_RANGE(0xc00000, 0xffffff) AM_READWRITE_LEGACY(snes_r_bank7, snes_w_bank7) /* Mirror and ROM */
ADDRESS_MAP_END
-static READ8_DEVICE_HANDLER( spc_ram_100_r )
+READ8_MEMBER(snesb_state::spc_ram_100_r)
{
+ device_t *device = machine().device("spc700");
return spc_ram_r(device, space, offset + 0x100);
}
-static WRITE8_DEVICE_HANDLER( spc_ram_100_w )
+WRITE8_MEMBER(snesb_state::spc_ram_100_w)
{
+ device_t *device = machine().device("spc700");
spc_ram_w(device, space, offset + 0x100, data);
}
static ADDRESS_MAP_START( spc_mem, AS_PROGRAM, 8, snesb_state )
AM_RANGE(0x0000, 0x00ef) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_r, spc_ram_w) /* lower 32k ram */
AM_RANGE(0x00f0, 0x00ff) AM_DEVREADWRITE_LEGACY("spc700", spc_io_r, spc_io_w) /* spc io */
- AM_RANGE(0x0100, 0xffff) AM_DEVREADWRITE_LEGACY("spc700", spc_ram_100_r, spc_ram_100_w)
+ AM_RANGE(0x0100, 0xffff) AM_READWRITE(spc_ram_100_r, spc_ram_100_w)
ADDRESS_MAP_END
static INPUT_PORTS_START( snes_common )
diff --git a/src/mame/drivers/taitotz.c b/src/mame/drivers/taitotz.c
index 33bcd8d5862..7d866f85f47 100644
--- a/src/mame/drivers/taitotz.c
+++ b/src/mame/drivers/taitotz.c
@@ -526,6 +526,10 @@ public:
virtual void video_start();
UINT32 screen_update_taitotz(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(taitotz_vbi);
+ DECLARE_READ8_MEMBER(tlcs_ide0_r);
+ DECLARE_WRITE8_MEMBER(tlcs_ide0_w);
+ DECLARE_READ8_MEMBER(tlcs_ide1_r);
+ DECLARE_WRITE8_MEMBER(tlcs_ide1_w);
};
@@ -1994,8 +1998,9 @@ WRITE8_MEMBER(taitotz_state::tlcs_rtc_w)
}
}
-static READ8_DEVICE_HANDLER(tlcs_ide0_r)
+READ8_MEMBER(taitotz_state::tlcs_ide0_r)
{
+ device_t *device = machine().device("ide");
static UINT16 ide_reg_latch;
int reg = offset >> 1;
@@ -2024,8 +2029,9 @@ static READ8_DEVICE_HANDLER(tlcs_ide0_r)
}
}
-static WRITE8_DEVICE_HANDLER(tlcs_ide0_w)
+WRITE8_MEMBER(taitotz_state::tlcs_ide0_w)
{
+ device_t *device = machine().device("ide");
static UINT16 ide_reg_latch;
int reg = offset >> 1;
@@ -2051,8 +2057,9 @@ static WRITE8_DEVICE_HANDLER(tlcs_ide0_w)
}
}
-static READ8_DEVICE_HANDLER(tlcs_ide1_r)
+READ8_MEMBER(taitotz_state::tlcs_ide1_r)
{
+ device_t *device = machine().device("ide");
//static UINT16 ide_reg_latch;
int reg = offset >> 1;
@@ -2075,8 +2082,9 @@ static READ8_DEVICE_HANDLER(tlcs_ide1_r)
}
}
-static WRITE8_DEVICE_HANDLER(tlcs_ide1_w)
+WRITE8_MEMBER(taitotz_state::tlcs_ide1_w)
{
+ device_t *device = machine().device("ide");
static UINT16 ide_reg_latch;
int reg = offset >> 1;
@@ -2178,8 +2186,8 @@ static ADDRESS_MAP_START( tlcs900h_mem, AS_PROGRAM, 8, taitotz_state)
AM_RANGE(0x044000, 0x04400f) AM_READWRITE(tlcs_rtc_r, tlcs_rtc_w)
AM_RANGE(0x060000, 0x061fff) AM_READWRITE(tlcs_common_r, tlcs_common_w)
AM_RANGE(0x064000, 0x064fff) AM_RAM AM_SHARE("mbox_ram") // MBox
- AM_RANGE(0x068000, 0x06800f) AM_DEVREADWRITE_LEGACY("ide", tlcs_ide0_r, tlcs_ide0_w)
- AM_RANGE(0x06c000, 0x06c00f) AM_DEVREADWRITE_LEGACY("ide", tlcs_ide1_r, tlcs_ide1_w)
+ AM_RANGE(0x068000, 0x06800f) AM_READWRITE(tlcs_ide0_r, tlcs_ide0_w)
+ AM_RANGE(0x06c000, 0x06c00f) AM_READWRITE(tlcs_ide1_r, tlcs_ide1_w)
AM_RANGE(0xfc0000, 0xffffff) AM_ROM AM_REGION("io_cpu", 0)
ADDRESS_MAP_END
@@ -2189,8 +2197,8 @@ static ADDRESS_MAP_START( landhigh_tlcs900h_mem, AS_PROGRAM, 8, taitotz_state)
AM_RANGE(0x404000, 0x40400f) AM_READWRITE(tlcs_rtc_r, tlcs_rtc_w)
AM_RANGE(0x900000, 0x901fff) AM_READWRITE(tlcs_common_r, tlcs_common_w)
AM_RANGE(0x910000, 0x910fff) AM_RAM AM_SHARE("mbox_ram") // MBox
- AM_RANGE(0x908000, 0x90800f) AM_DEVREADWRITE_LEGACY("ide", tlcs_ide0_r, tlcs_ide0_w)
- AM_RANGE(0x918000, 0x91800f) AM_DEVREADWRITE_LEGACY("ide", tlcs_ide1_r, tlcs_ide1_w)
+ AM_RANGE(0x908000, 0x90800f) AM_READWRITE(tlcs_ide0_r, tlcs_ide0_w)
+ AM_RANGE(0x918000, 0x91800f) AM_READWRITE(tlcs_ide1_r, tlcs_ide1_w)
AM_RANGE(0xfc0000, 0xffffff) AM_ROM AM_REGION("io_cpu", 0)
ADDRESS_MAP_END
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index 19b73a3de75..010ae2fd338 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -115,6 +115,11 @@ public:
DECLARE_MACHINE_START(a2600);
DECLARE_MACHINE_START(a2600p);
TIMER_CALLBACK_MEMBER(modeDPC_timer_callback);
+ DECLARE_WRITE8_MEMBER(switch_A_w);
+ DECLARE_READ8_MEMBER(switch_A_r);
+ DECLARE_WRITE8_MEMBER(switch_B_w);
+ DECLARE_WRITE_LINE_MEMBER(irq_callback);
+ DECLARE_READ8_MEMBER(riot_input_port_8_r);
};
@@ -1175,48 +1180,44 @@ static ADDRESS_MAP_START(a2600_mem, AS_PROGRAM, 8, a2600_state )
AM_RANGE(0x1000, 0x1FFF) AM_ROMBANK("bank1")
ADDRESS_MAP_END
-static WRITE8_DEVICE_HANDLER(switch_A_w)
+WRITE8_MEMBER(a2600_state::switch_A_w)
{
- a2600_state *state = space.machine().driver_data<a2600_state>();
- running_machine &machine = space.machine();
-
/* Left controller port */
- if ( machine.root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT == 0x03 )
+ if ( machine().root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT == 0x03 )
{
- state->m_keypad_left_column = data / 16;
+ m_keypad_left_column = data / 16;
}
/* Right controller port */
- switch( machine.root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
+ switch( machine().root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
{
case 0x03: /* Keypad */
- state->m_keypad_right_column = data & 0x0F;
+ m_keypad_right_column = data & 0x0F;
break;
case 0x0a: /* KidVid voice module */
- machine.device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x02 ) ? (cassette_state)CASSETTE_MOTOR_DISABLED : (cassette_state)(CASSETTE_MOTOR_ENABLED | CASSETTE_PLAY), (cassette_state)CASSETTE_MOTOR_DISABLED );
+ machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x02 ) ? (cassette_state)CASSETTE_MOTOR_DISABLED : (cassette_state)(CASSETTE_MOTOR_ENABLED | CASSETTE_PLAY), (cassette_state)CASSETTE_MOTOR_DISABLED );
break;
}
}
-static READ8_DEVICE_HANDLER( switch_A_r )
+READ8_MEMBER(a2600_state::switch_A_r)
{
static const UINT8 driving_lookup[4] = { 0x00, 0x02, 0x03, 0x01 };
- running_machine &machine = space.machine();
UINT8 val = 0;
/* Left controller port PINs 1-4 ( 4321 ) */
- switch( machine.root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
+ switch( machine().root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT )
{
case 0x00: /* Joystick */
case 0x05: /* Joystick w/Boostergrip */
- val |= machine.root_device().ioport("SWA_JOY")->read() & 0xF0;
+ val |= machine().root_device().ioport("SWA_JOY")->read() & 0xF0;
break;
case 0x01: /* Paddle */
- val |= machine.root_device().ioport("SWA_PAD")->read() & 0xF0;
+ val |= machine().root_device().ioport("SWA_PAD")->read() & 0xF0;
break;
case 0x02: /* Driving */
val |= 0xC0;
- val |= ( driving_lookup[ ( machine.root_device().ioport("WHEEL_L")->read() & 0x18 ) >> 3 ] << 4 );
+ val |= ( driving_lookup[ ( machine().root_device().ioport("WHEEL_L")->read() & 0x18 ) >> 3 ] << 4 );
break;
case 0x06: /* Trakball CX-22 */
case 0x07: /* Trakball CX-80 / ST mouse */
@@ -1227,18 +1228,18 @@ static READ8_DEVICE_HANDLER( switch_A_r )
}
/* Right controller port PINs 1-4 ( 4321 ) */
- switch( machine.root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
+ switch( machine().root_device().ioport("CONTROLLERS")->read() % CATEGORY_SELECT )
{
case 0x00: /* Joystick */
case 0x05: /* Joystick w/Boostergrip */
- val |= machine.root_device().ioport("SWA_JOY")->read() & 0x0F;
+ val |= machine().root_device().ioport("SWA_JOY")->read() & 0x0F;
break;
case 0x01: /* Paddle */
- val |= machine.root_device().ioport("SWA_PAD")->read() & 0x0F;
+ val |= machine().root_device().ioport("SWA_PAD")->read() & 0x0F;
break;
case 0x02: /* Driving */
val |= 0x0C;
- val |= ( driving_lookup[ ( machine.root_device().ioport("WHEEL_R")->read() & 0x18 ) >> 3 ] );
+ val |= ( driving_lookup[ ( machine().root_device().ioport("WHEEL_R")->read() & 0x18 ) >> 3 ] );
break;
case 0x06: /* Trakball CX-22 */
case 0x07: /* Trakball CX-80 / ST mouse */
@@ -1251,26 +1252,26 @@ static READ8_DEVICE_HANDLER( switch_A_r )
return val;
}
-static WRITE8_DEVICE_HANDLER(switch_B_w )
+WRITE8_MEMBER(a2600_state::switch_B_w)
{
}
-static WRITE_LINE_DEVICE_HANDLER( irq_callback )
+WRITE_LINE_MEMBER(a2600_state::irq_callback)
{
}
-static READ8_DEVICE_HANDLER( riot_input_port_8_r )
+READ8_MEMBER(a2600_state::riot_input_port_8_r)
{
- return space.machine().root_device().ioport("SWB")->read();
+ return machine().root_device().ioport("SWB")->read();
}
static const riot6532_interface r6532_interface =
{
- DEVCB_HANDLER(switch_A_r),
- DEVCB_HANDLER(riot_input_port_8_r),
- DEVCB_HANDLER(switch_A_w),
- DEVCB_HANDLER(switch_B_w),
- DEVCB_LINE(irq_callback)
+ DEVCB_DRIVER_MEMBER(a2600_state,switch_A_r),
+ DEVCB_DRIVER_MEMBER(a2600_state,riot_input_port_8_r),
+ DEVCB_DRIVER_MEMBER(a2600_state,switch_A_w),
+ DEVCB_DRIVER_MEMBER(a2600_state,switch_B_w),
+ DEVCB_DRIVER_LINE_MEMBER(a2600_state, irq_callback)
};
diff --git a/src/mess/drivers/ami1200.c b/src/mess/drivers/ami1200.c
index 3435cd5ed41..9661c1e1e4b 100644
--- a/src/mess/drivers/ami1200.c
+++ b/src/mess/drivers/ami1200.c
@@ -38,6 +38,10 @@ public:
int m_oldstate[2];
DECLARE_WRITE32_MEMBER(aga_overlay_w);
DECLARE_DRIVER_INIT(a1200);
+ DECLARE_WRITE8_MEMBER(ami1200_cia_0_porta_w);
+ DECLARE_READ8_MEMBER(ami1200_cia_0_portb_r);
+ DECLARE_WRITE8_MEMBER(ami1200_cia_0_portb_w);
+ DECLARE_READ8_MEMBER(a1200_cia_0_portA_r);
};
@@ -83,14 +87,14 @@ WRITE32_MEMBER(ami1200_state::aga_overlay_w)
*
*************************************/
-static WRITE8_DEVICE_HANDLER( ami1200_cia_0_porta_w )
+WRITE8_MEMBER(ami1200_state::ami1200_cia_0_porta_w)
{
- ami1200_state *state = space.machine().driver_data<ami1200_state>();
+ device_t *device = machine().device("cia_0");
/* bit 2 = Power Led on Amiga */
- set_led_status(space.machine(), 0, !BIT(data, 1));
+ set_led_status(machine(), 0, !BIT(data, 1));
- handle_cd32_joystick_cia(state, data, mos6526_r(device, space, 2));
+ handle_cd32_joystick_cia(this, data, mos6526_r(device, space, 2));
}
/*************************************
@@ -108,17 +112,17 @@ static WRITE8_DEVICE_HANDLER( ami1200_cia_0_porta_w )
*
*************************************/
-static READ8_DEVICE_HANDLER( ami1200_cia_0_portb_r )
+READ8_MEMBER(ami1200_state::ami1200_cia_0_portb_r)
{
/* parallel port */
- logerror("%s:CIA0_portb_r\n", space.machine().describe_context());
+ logerror("%s:CIA0_portb_r\n", machine().describe_context());
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( ami1200_cia_0_portb_w )
+WRITE8_MEMBER(ami1200_state::ami1200_cia_0_portb_w)
{
/* parallel port */
- logerror("%s:CIA0_portb_w(%02x)\n", space.machine().describe_context(), data);
+ logerror("%s:CIA0_portb_w(%02x)\n", machine().describe_context(), data);
}
static ADDRESS_MAP_START( a1200_map, AS_PROGRAM, 32, ami1200_state )
@@ -244,10 +248,10 @@ INPUT_PORTS_END
*
*************************************/
-static READ8_DEVICE_HANDLER( a1200_cia_0_portA_r )
+READ8_MEMBER(ami1200_state::a1200_cia_0_portA_r)
{
- UINT8 ret = space.machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
- ret |= space.machine().device<amiga_fdc>("fdc")->ciaapra_r();
+ UINT8 ret = machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
+ ret |= machine().device<amiga_fdc>("fdc")->ciaapra_r();
return ret;
}
@@ -258,10 +262,10 @@ static const mos6526_interface a1200_cia_0_intf =
DEVCB_NULL, /* pc_func */
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER("cia_0", a1200_cia_0_portA_r),
- DEVCB_DEVICE_HANDLER("cia_0", ami1200_cia_0_porta_w), /* port A */
- DEVCB_DEVICE_HANDLER("cia_0", ami1200_cia_0_portb_r),
- DEVCB_DEVICE_HANDLER("cia_0", ami1200_cia_0_portb_w) /* port B */
+ DEVCB_DRIVER_MEMBER(ami1200_state,a1200_cia_0_portA_r),
+ DEVCB_DRIVER_MEMBER(ami1200_state,ami1200_cia_0_porta_w), /* port A */
+ DEVCB_DRIVER_MEMBER(ami1200_state,ami1200_cia_0_portb_r),
+ DEVCB_DRIVER_MEMBER(ami1200_state,ami1200_cia_0_portb_w) /* port B */
};
static const mos6526_interface a1200_cia_1_intf =
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index 09f5003f975..a165444a0c5 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -33,6 +33,8 @@ public:
virtual void palette_init();
UINT32 screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(apexc_interrupt);
+ DECLARE_READ8_MEMBER(tape_read);
+ DECLARE_WRITE8_MEMBER(tape_write);
};
@@ -264,8 +266,9 @@ apexc_tape_reader_image_device::apexc_tape_reader_image_device(const machine_con
Open a tape image
*/
-static READ8_DEVICE_HANDLER(tape_read)
+READ8_MEMBER(apexc_state::tape_read)
{
+ device_t *device = machine().device("tape_reader");
UINT8 reply;
device_image_interface *image = dynamic_cast<device_image_interface *>(device);
@@ -275,15 +278,16 @@ static READ8_DEVICE_HANDLER(tape_read)
return 0; /* unit not ready - I don't know what we should do */
}
-static WRITE8_DEVICE_HANDLER(tape_write)
+WRITE8_MEMBER(apexc_state::tape_write)
{
+ device_t *device = machine().device("tape_puncher");
UINT8 data5 = (data & 0x1f);
device_image_interface *image = dynamic_cast<device_image_interface *>(device);
if (image->exists())
image->fwrite(& data5, 1);
- apexc_teletyper_putchar(space.machine(), data & 0x1f); /* display on screen */
+ apexc_teletyper_putchar(machine(), data & 0x1f); /* display on screen */
}
/*
@@ -855,8 +859,8 @@ static ADDRESS_MAP_START(apexc_mem_map, AS_PROGRAM, 32, apexc_state )
ADDRESS_MAP_END
static ADDRESS_MAP_START(apexc_io_map, AS_IO, 8, apexc_state )
- AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY("tape_reader",tape_read)
- AM_RANGE(0x00, 0x00) AM_DEVWRITE_LEGACY("tape_puncher",tape_write)
+ AM_RANGE(0x00, 0x00) AM_READ(tape_read)
+ AM_RANGE(0x00, 0x00) AM_WRITE(tape_write)
ADDRESS_MAP_END
diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c
index bebf64836e6..9fff87304c0 100644
--- a/src/mess/drivers/apricot.c
+++ b/src/mess/drivers/apricot.c
@@ -65,6 +65,7 @@ public:
DECLARE_DRIVER_INIT(apricot);
virtual void palette_init();
UINT32 screen_update_apricot(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(apricot_sio_irq_w);
};
@@ -121,15 +122,14 @@ static const struct pit8253_config apricot_pit8253_intf =
}
};
-static WRITE_LINE_DEVICE_HANDLER( apricot_sio_irq_w )
+WRITE_LINE_MEMBER(apricot_state::apricot_sio_irq_w)
{
- apricot_state *astate = device->machine().driver_data<apricot_state>();
- pic8259_ir5_w(astate->m_pic, state);
+ pic8259_ir5_w(m_pic, state);
}
static const z80sio_interface apricot_z80sio_intf =
{
- DEVCB_LINE(apricot_sio_irq_w),
+ DEVCB_DRIVER_LINE_MEMBER(apricot_state, apricot_sio_irq_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c
index aea208dac36..79884cb401b 100644
--- a/src/mess/drivers/atari400.c
+++ b/src/mess/drivers/atari400.c
@@ -239,6 +239,9 @@ public:
DECLARE_DRIVER_INIT(a800xl);
DECLARE_DRIVER_INIT(a600xl);
virtual void palette_init();
+ DECLARE_WRITE8_MEMBER(a1200xl_pia_pb_w);
+ DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w);
+ DECLARE_WRITE8_MEMBER(xegs_pia_pb_w);
};
/**************************************************************
@@ -905,17 +908,19 @@ static void xegs_mmu(running_machine &machine, UINT8 new_mmu)
*
**************************************************************/
-static WRITE8_DEVICE_HANDLER(a1200xl_pia_pb_w) { a1200xl_mmu(device->machine(), data); }
-static WRITE8_DEVICE_HANDLER(a800xl_pia_pb_w)
+WRITE8_MEMBER(a400_state::a1200xl_pia_pb_w){ device_t *device = machine().device("pia"); a1200xl_mmu(device->machine(), data); }
+WRITE8_MEMBER(a400_state::a800xl_pia_pb_w)
{
+ device_t *device = machine().device("pia");
if (downcast<pia6821_device *>(device)->port_b_z_mask() != 0xff)
- a800xl_mmu(space.machine(), data);
+ a800xl_mmu(machine(), data);
}
-static WRITE8_DEVICE_HANDLER(xegs_pia_pb_w)
+WRITE8_MEMBER(a400_state::xegs_pia_pb_w)
{
+ device_t *device = machine().device("pia");
if (downcast<pia6821_device *>(device)->port_b_z_mask() != 0xff)
- xegs_mmu(space.machine(), data);
+ xegs_mmu(machine(), data);
}
static const pokey_interface atari_pokey_interface =
@@ -977,7 +982,7 @@ static const pia6821_interface a1200xl_pia_interface =
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
- DEVCB_DEVICE_HANDLER("pia", a1200xl_pia_pb_w), /* port B out */
+ DEVCB_DRIVER_MEMBER(a400_state, a1200xl_pia_pb_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_DEVICE_LINE("fdc",atarifdc_pia_cb2_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
@@ -993,7 +998,7 @@ static const pia6821_interface a800xl_pia_interface =
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
- DEVCB_DEVICE_HANDLER("pia", a800xl_pia_pb_w), /* port B out */
+ DEVCB_DRIVER_MEMBER(a400_state,a800xl_pia_pb_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_DEVICE_LINE("fdc",atarifdc_pia_cb2_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
@@ -1009,7 +1014,7 @@ static const pia6821_interface xegs_pia_interface =
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
- DEVCB_DEVICE_HANDLER("pia", xegs_pia_pb_w), /* port B out */
+ DEVCB_DRIVER_MEMBER(a400_state,xegs_pia_pb_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_DEVICE_LINE("fdc",atarifdc_pia_cb2_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
diff --git a/src/mess/drivers/bbcbc.c b/src/mess/drivers/bbcbc.c
index 191b19f890c..431d48e5337 100644
--- a/src/mess/drivers/bbcbc.c
+++ b/src/mess/drivers/bbcbc.c
@@ -28,6 +28,7 @@ public:
required_device<cpu_device> m_maincpu;
virtual void machine_start();
virtual void machine_reset();
+ DECLARE_WRITE_LINE_MEMBER(tms_interrupt);
};
@@ -98,16 +99,16 @@ static INPUT_PORTS_START( bbcbc )
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Play, No") PORT_CODE(KEYCODE_B) PORT_IMPULSE(1)
INPUT_PORTS_END
-static WRITE_LINE_DEVICE_HANDLER(tms_interrupt)
+WRITE_LINE_MEMBER(bbcbc_state::tms_interrupt)
{
- device->machine().device("maincpu")->execute().set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
+ machine().device("maincpu")->execute().set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE);
}
static TMS9928A_INTERFACE(tms9129_interface)
{
"screen",
0x4000,
- DEVCB_LINE(tms_interrupt)
+ DEVCB_DRIVER_LINE_MEMBER(bbcbc_state, tms_interrupt)
};
/* TODO */
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index 0866e9b08f2..8460c87b160 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -146,6 +146,7 @@ public:
required_device<device_t> m_beeper;
DECLARE_DRIVER_INIT(bigbord2);
TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
+ DECLARE_WRITE_LINE_MEMBER(bigbord2_interrupt);
};
/* Status port
@@ -388,14 +389,14 @@ INPUT_PORTS_END
/* Z80 SIO */
-static WRITE_LINE_DEVICE_HANDLER( bigbord2_interrupt )
+WRITE_LINE_MEMBER(bigbord2_state::bigbord2_interrupt)
{
- device->machine().device(Z80_TAG)->execute().set_input_line(0, state);
+ machine().device(Z80_TAG)->execute().set_input_line(0, state);
}
const z80sio_interface sio_intf =
{
- DEVCB_LINE(bigbord2_interrupt), /* interrupt handler */
+ DEVCB_DRIVER_LINE_MEMBER(bigbord2_state, bigbord2_interrupt), /* interrupt handler */
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c
index 904cf257316..3b9ec952e1c 100644
--- a/src/mess/drivers/bml3.c
+++ b/src/mess/drivers/bml3.c
@@ -116,6 +116,8 @@ public:
INTERRUPT_GEN_MEMBER(bml3_irq);
INTERRUPT_GEN_MEMBER(bml3_timer_firq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
+ DECLARE_READ8_MEMBER(bml3_ym2203_r);
+ DECLARE_WRITE8_MEMBER(bml3_ym2203_w);
};
#define mc6845_h_char_total (m_crtc_vreg[0])
@@ -329,18 +331,18 @@ WRITE8_MEMBER( bml3_state::bml3_psg_latch_w)
m_psg_latch = data;
}
-static READ8_DEVICE_HANDLER( bml3_ym2203_r )
+READ8_MEMBER(bml3_state::bml3_ym2203_r)
{
- bml3_state *state = space.machine().driver_data<bml3_state>();
- UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
+ device_t *device = machine().device("ym2203");
+ UINT8 dev_offs = ((m_psg_latch & 3) != 3);
return ym2203_r(device,space, dev_offs);
}
-static WRITE8_DEVICE_HANDLER( bml3_ym2203_w )
+WRITE8_MEMBER(bml3_state::bml3_ym2203_w)
{
- bml3_state *state = space.machine().driver_data<bml3_state>();
- UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
+ device_t *device = machine().device("ym2203");
+ UINT8 dev_offs = ((m_psg_latch & 3) != 3);
ym2203_w(device,space, dev_offs,data);
}
@@ -404,7 +406,7 @@ static ADDRESS_MAP_START(bml3_mem, AS_PROGRAM, 8, bml3_state)
AM_RANGE(0x0000, 0x03ff) AM_RAM
AM_RANGE(0x0400, 0x43ff) AM_READWRITE(bml3_vram_r,bml3_vram_w)
AM_RANGE(0x4400, 0x9fff) AM_RAM
- AM_RANGE(0xff00, 0xff00) AM_DEVREADWRITE_LEGACY("ym2203",bml3_ym2203_r,bml3_ym2203_w)
+ AM_RANGE(0xff00, 0xff00) AM_READWRITE(bml3_ym2203_r,bml3_ym2203_w)
AM_RANGE(0xff02, 0xff02) AM_READWRITE(bml3_psg_latch_r,bml3_psg_latch_w) // PSG address/data select
AM_RANGE(0xff18, 0xff1f) AM_DEVREADWRITE_LEGACY("mc6843",mc6843_r,mc6843_w)
AM_RANGE(0xff20, 0xff20) AM_READWRITE(bml3_fdd_r,bml3_fdd_w) // FDD drive select
diff --git a/src/mess/drivers/dectalk.c b/src/mess/drivers/dectalk.c
index 826135d3278..82083ecdde4 100644
--- a/src/mess/drivers/dectalk.c
+++ b/src/mess/drivers/dectalk.c
@@ -195,6 +195,7 @@ public:
DECLARE_DRIVER_INIT(dectalk);
virtual void machine_reset();
TIMER_CALLBACK_MEMBER(outfifo_read_cb);
+ DECLARE_WRITE8_MEMBER(dectalk_kbd_put);
};
@@ -718,14 +719,14 @@ DRIVER_INIT_MEMBER(dectalk_state,dectalk)
machine().scheduler().timer_set(attotime::from_hz(10000), timer_expired_delegate(FUNC(dectalk_state::outfifo_read_cb),this));
}
-static WRITE8_DEVICE_HANDLER( dectalk_kbd_put )
+WRITE8_MEMBER(dectalk_state::dectalk_kbd_put)
{
- duart68681_rx_data(space.machine().device("duart68681"), 1, data);
+ duart68681_rx_data(machine().device("duart68681"), 1, data);
}
static GENERIC_TERMINAL_INTERFACE( dectalk_terminal_intf )
{
- DEVCB_HANDLER(dectalk_kbd_put)
+ DEVCB_DRIVER_MEMBER(dectalk_state,dectalk_kbd_put)
};
static MACHINE_CONFIG_START( dectalk, dectalk_state )
diff --git a/src/mess/drivers/digel804.c b/src/mess/drivers/digel804.c
index 47d5fe0b086..e9a6731db83 100644
--- a/src/mess/drivers/digel804.c
+++ b/src/mess/drivers/digel804.c
@@ -132,6 +132,7 @@ public:
UINT8 m_chipinsert_state;
UINT8 m_keyen_state;
UINT8 m_op41;
+ DECLARE_WRITE8_MEMBER(digel804_serial_put);
};
@@ -558,15 +559,14 @@ INPUT_PORTS_END
/******************************************************************************
Machine Drivers
******************************************************************************/
-static WRITE8_DEVICE_HANDLER( digel804_serial_put )
+WRITE8_MEMBER(digel804_state::digel804_serial_put)
{
- digel804_state *state = space.machine().driver_data<digel804_state>();
- state->m_acia->receive_character(data);
+ m_acia->receive_character(data);
}
static GENERIC_TERMINAL_INTERFACE( digel804_terminal_intf )
{
- DEVCB_HANDLER(digel804_serial_put)
+ DEVCB_DRIVER_MEMBER(digel804_state,digel804_serial_put)
};
WRITE_LINE_MEMBER( digel804_state::da_w )
diff --git a/src/mess/drivers/elwro800.c b/src/mess/drivers/elwro800.c
index 428d9d2201e..756fa18bbe5 100644
--- a/src/mess/drivers/elwro800.c
+++ b/src/mess/drivers/elwro800.c
@@ -51,6 +51,8 @@ public:
DECLARE_WRITE8_MEMBER(elwro800jr_io_w);
DECLARE_MACHINE_RESET(elwro800);
INTERRUPT_GEN_MEMBER(elwro800jr_interrupt);
+ DECLARE_READ8_MEMBER(i8255_port_c_r);
+ DECLARE_WRITE8_MEMBER(i8255_port_c_w);
};
@@ -174,15 +176,15 @@ static void elwro800jr_mmu_w(running_machine &machine, UINT8 data)
*
*************************************/
-static READ8_DEVICE_HANDLER(i8255_port_c_r)
+READ8_MEMBER(elwro800_state::i8255_port_c_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
return (centronics->ack_r() << 2);
}
-static WRITE8_DEVICE_HANDLER(i8255_port_c_w)
+WRITE8_MEMBER(elwro800_state::i8255_port_c_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
centronics->strobe_w((data >> 7) & 0x01);
}
@@ -192,8 +194,8 @@ static I8255_INTERFACE(elwro800jr_ppi8255_interface)
DEVCB_NULL,
DEVCB_DEVICE_MEMBER("centronics", centronics_device, read),
DEVCB_DEVICE_MEMBER("centronics", centronics_device, write),
- DEVCB_HANDLER(i8255_port_c_r),
- DEVCB_HANDLER(i8255_port_c_w)
+ DEVCB_DRIVER_MEMBER(elwro800_state,i8255_port_c_r),
+ DEVCB_DRIVER_MEMBER(elwro800_state,i8255_port_c_w)
};
static const centronics_interface elwro800jr_centronics_interface =
diff --git a/src/mess/drivers/h19.c b/src/mess/drivers/h19.c
index 3e8c8af8315..cee5e6759af 100644
--- a/src/mess/drivers/h19.c
+++ b/src/mess/drivers/h19.c
@@ -67,6 +67,7 @@ public:
virtual void machine_reset();
virtual void video_start();
TIMER_CALLBACK_MEMBER(h19_beepoff);
+ DECLARE_WRITE_LINE_MEMBER(h19_ace_irq);
};
@@ -334,9 +335,9 @@ static MC6845_UPDATE_ROW( h19_update_row )
}
}
-static WRITE_LINE_DEVICE_HANDLER(h19_ace_irq)
+WRITE_LINE_MEMBER(h19_state::h19_ace_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));
}
static const ins8250_interface h19_ace_interface =
@@ -344,7 +345,7 @@ static const ins8250_interface h19_ace_interface =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(h19_ace_irq), // interrupt
+ DEVCB_DRIVER_LINE_MEMBER(h19_state, h19_ace_irq), // interrupt
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/drivers/jr100.c b/src/mess/drivers/jr100.c
index 241b6ef87cb..064253b44bd 100644
--- a/src/mess/drivers/jr100.c
+++ b/src/mess/drivers/jr100.c
@@ -44,6 +44,10 @@ public:
virtual void video_start();
UINT32 screen_update_jr100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(sound_tick);
+ DECLARE_READ8_MEMBER(jr100_via_read_b);
+ DECLARE_WRITE8_MEMBER(jr100_via_write_a);
+ DECLARE_WRITE8_MEMBER(jr100_via_write_b);
+ DECLARE_WRITE_LINE_MEMBER(jr100_via_write_cb2);
};
@@ -228,47 +232,44 @@ static const char *const keynames[] = {
};
-static READ8_DEVICE_HANDLER(jr100_via_read_b)
+READ8_MEMBER(jr100_state::jr100_via_read_b)
{
- jr100_state *state = space.machine().driver_data<jr100_state>();
UINT8 val = 0x1f;
- if (keynames[state->m_keyboard_line]) {
- val = state->ioport(keynames[state->m_keyboard_line])->read();
+ if (keynames[m_keyboard_line]) {
+ val = ioport(keynames[m_keyboard_line])->read();
}
return val;
}
-static WRITE8_DEVICE_HANDLER(jr100_via_write_a )
+WRITE8_MEMBER(jr100_state::jr100_via_write_a)
{
- jr100_state *state = space.machine().driver_data<jr100_state>();
- state->m_keyboard_line = data & 0x0f;
+ m_keyboard_line = data & 0x0f;
}
-static WRITE8_DEVICE_HANDLER(jr100_via_write_b )
+WRITE8_MEMBER(jr100_state::jr100_via_write_b)
{
- jr100_state *state = space.machine().driver_data<jr100_state>();
- state->m_use_pcg = (data & 0x20) ? TRUE : FALSE;
- state->m_speaker = data>>7;
+ m_use_pcg = (data & 0x20) ? TRUE : FALSE;
+ m_speaker = data>>7;
}
-static WRITE_LINE_DEVICE_HANDLER(jr100_via_write_cb2)
+WRITE_LINE_MEMBER(jr100_state::jr100_via_write_cb2)
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output(state ? -1.0 : +1.0);
+ machine().device<cassette_image_device>(CASSETTE_TAG)->output(state ? -1.0 : +1.0);
}
static const via6522_interface jr100_via_intf =
{
DEVCB_NULL, /* in_a_func */
- DEVCB_HANDLER(jr100_via_read_b), /* in_b_func */
+ DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_read_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(jr100_via_write_a), /* out_a_func */
- DEVCB_HANDLER(jr100_via_write_b), /* out_b_func */
+ DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_write_a), /* out_a_func */
+ DEVCB_DRIVER_MEMBER(jr100_state,jr100_via_write_b), /* out_b_func */
DEVCB_NULL, /* out_ca1_func */
DEVCB_NULL, /* out_cb1_func */
DEVCB_NULL, /* out_ca2_func */
- DEVCB_LINE(jr100_via_write_cb2), /* out_cb2_func */
+ DEVCB_DRIVER_LINE_MEMBER(jr100_state, jr100_via_write_cb2), /* out_cb2_func */
DEVCB_NULL /* irq_func */
};
static const cassette_interface jr100_cassette_interface =
diff --git a/src/mess/drivers/m20.c b/src/mess/drivers/m20.c
index 8d05a6c1da1..c1e7ca2993e 100644
--- a/src/mess/drivers/m20.c
+++ b/src/mess/drivers/m20.c
@@ -95,6 +95,9 @@ public:
DECLARE_DRIVER_INIT(m20);
virtual void video_start();
UINT32 screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE_LINE_MEMBER(kbd_rxrdy_int);
+ DECLARE_READ_LINE_MEMBER(wd177x_dden_r);
+ DECLARE_WRITE_LINE_MEMBER(wd177x_intrq_w);
};
@@ -410,23 +413,22 @@ static I8255A_INTERFACE( ppi_interface )
DEVCB_NULL // port C write
};
-static WRITE_LINE_DEVICE_HANDLER(kbd_rxrdy_int)
+WRITE_LINE_MEMBER(m20_state::kbd_rxrdy_int)
{
- pic8259_ir4_w(device->machine().device("i8259"), state);
+ pic8259_ir4_w(machine().device("i8259"), state);
}
#if 0
-static READ_LINE_DEVICE_HANDLER( wd177x_dden_r )
+READ_LINE_MEMBER(m20_state::wd177x_dden_r)
{
- m20_state *state = device->machine().driver_data<m20_state>();
- printf ("wd177x_dden_r called, returning %d\n", !state->m_port21_sd);
- return !state->m_port21_sd;
+ printf ("wd177x_dden_r called, returning %d\n", !m_port21_sd);
+ return !m_port21_sd;
}
#endif
-static WRITE_LINE_DEVICE_HANDLER( wd177x_intrq_w )
+WRITE_LINE_MEMBER(m20_state::wd177x_intrq_w)
{
- pic8259_ir0_w(device->machine().device("i8259"), state);
+ pic8259_ir0_w(machine().device("i8259"), state);
}
static const i8251_interface kbd_i8251_intf =
@@ -436,7 +438,7 @@ static const i8251_interface kbd_i8251_intf =
DEVCB_NULL, // dsr
DEVCB_NULL, // dtr
DEVCB_NULL, // rts
- DEVCB_LINE(kbd_rxrdy_int), // rx ready
+ DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_rxrdy_int), // rx ready
DEVCB_NULL, // tx ready
DEVCB_NULL, // tx empty
DEVCB_NULL // syndet
@@ -457,8 +459,8 @@ static const i8251_interface tty_i8251_intf =
const wd17xx_interface m20_wd17xx_interface =
{
- DEVCB_NULL, //DEVCB_LINE(wd177x_dden_r),
- DEVCB_LINE(wd177x_intrq_w),
+ DEVCB_NULL, //DEVCB_DRIVER_LINE_MEMBER(m20_state, wd177x_dden_r),
+ DEVCB_DRIVER_LINE_MEMBER(m20_state, wd177x_intrq_w),
DEVCB_NULL,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
diff --git a/src/mess/drivers/mikrosha.c b/src/mess/drivers/mikrosha.c
index 145ed3ac09c..99c20c731c3 100644
--- a/src/mess/drivers/mikrosha.c
+++ b/src/mess/drivers/mikrosha.c
@@ -24,6 +24,7 @@ class mikrosha_state : public radio86_state
public:
mikrosha_state(const machine_config &mconfig, device_type type, const char *tag)
: radio86_state(mconfig, type, tag) { }
+ DECLARE_WRITE_LINE_MEMBER(mikrosha_pit_out2);
};
@@ -150,7 +151,7 @@ static const cassette_interface mikrosha_cassette_interface =
};
-static WRITE_LINE_DEVICE_HANDLER(mikrosha_pit_out2)
+WRITE_LINE_MEMBER(mikrosha_state::mikrosha_pit_out2)
{
}
@@ -171,7 +172,7 @@ static const struct pit8253_config mikrosha_pit8253_intf =
{
2000000,
DEVCB_NULL,
- DEVCB_LINE(mikrosha_pit_out2)
+ DEVCB_DRIVER_LINE_MEMBER(mikrosha_state, mikrosha_pit_out2)
}
}
};
diff --git a/src/mess/drivers/mirage.c b/src/mess/drivers/mirage.c
index 7e2d739ff57..b937d57ee84 100644
--- a/src/mess/drivers/mirage.c
+++ b/src/mess/drivers/mirage.c
@@ -96,6 +96,14 @@ public:
DECLARE_DRIVER_INIT(mirage);
virtual void video_start();
UINT32 screen_update_mirage(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(mirage_via_write_porta);
+ DECLARE_WRITE8_MEMBER(mirage_via_write_portb);
+ DECLARE_READ8_MEMBER(mirage_via_read_porta);
+ DECLARE_READ8_MEMBER(mirage_via_read_portb);
+ DECLARE_READ8_MEMBER(mirage_via_read_ca1);
+ DECLARE_READ8_MEMBER(mirage_via_read_cb1);
+ DECLARE_READ8_MEMBER(mirage_via_read_ca2);
+ DECLARE_READ8_MEMBER(mirage_via_read_cb2);
};
const floppy_format_type mirage_state::floppy_formats[] = {
@@ -149,7 +157,7 @@ static ADDRESS_MAP_START( mirage_map, AS_PROGRAM, 8, mirage_state )
ADDRESS_MAP_END
// port A: front panel
-static WRITE8_DEVICE_HANDLER( mirage_via_write_porta )
+WRITE8_MEMBER(mirage_state::mirage_via_write_porta)
{
// printf("PORT A: %02x\n", data);
}
@@ -162,23 +170,22 @@ static WRITE8_DEVICE_HANDLER( mirage_via_write_porta )
// bit 1: OUT upper/lower bank (64k halves)
// bit 0: OUT bank 0/bank 1 (32k halves)
-static WRITE8_DEVICE_HANDLER( mirage_via_write_portb )
+WRITE8_MEMBER(mirage_state::mirage_via_write_portb)
{
int bank = 0;
- mirage_state *state = space.machine().driver_data<mirage_state>();
// handle sound RAM bank switching
bank = (data & 2) ? (64*1024) : 0;
bank += (data & 1) ? (32*1024) : 0;
- if (bank != state->last_sndram_bank)
+ if (bank != last_sndram_bank)
{
- state->last_sndram_bank = bank;
- state->membank("sndbank")->set_base(state->memregion("es5503")->base() + bank);
+ last_sndram_bank = bank;
+ membank("sndbank")->set_base(memregion("es5503")->base() + bank);
}
}
// port A: front panel
-static READ8_DEVICE_HANDLER( mirage_via_read_porta )
+READ8_MEMBER(mirage_state::mirage_via_read_porta)
{
return 0;
}
@@ -186,46 +193,46 @@ static READ8_DEVICE_HANDLER( mirage_via_read_porta )
// port B:
// bit 6: IN FDC disk loaded
// bit 5: IN 5503 sync (?)
-static READ8_DEVICE_HANDLER( mirage_via_read_portb )
+READ8_MEMBER(mirage_state::mirage_via_read_portb)
{
return 0x60;
}
// external sync pulse
-static READ8_DEVICE_HANDLER( mirage_via_read_ca1 )
+READ8_MEMBER(mirage_state::mirage_via_read_ca1)
{
return 0;
}
// keyscan
-static READ8_DEVICE_HANDLER( mirage_via_read_cb1 )
+READ8_MEMBER(mirage_state::mirage_via_read_cb1)
{
return 0;
}
// keyscan
-static READ8_DEVICE_HANDLER( mirage_via_read_ca2 )
+READ8_MEMBER(mirage_state::mirage_via_read_ca2)
{
return 0;
}
// keyscan
-static READ8_DEVICE_HANDLER( mirage_via_read_cb2 )
+READ8_MEMBER(mirage_state::mirage_via_read_cb2)
{
return 0;
}
const via6522_interface mirage_via =
{
- DEVCB_HANDLER(mirage_via_read_porta),
- DEVCB_HANDLER(mirage_via_read_portb),
- DEVCB_HANDLER(mirage_via_read_ca1),
- DEVCB_HANDLER(mirage_via_read_cb1),
- DEVCB_HANDLER(mirage_via_read_ca2),
- DEVCB_HANDLER(mirage_via_read_cb2),
- DEVCB_HANDLER(mirage_via_write_porta),
- DEVCB_HANDLER(mirage_via_write_portb),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_porta),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_portb),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_ca1),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_cb1),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_ca2),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_read_cb2),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_write_porta),
+ DEVCB_DRIVER_MEMBER(mirage_state,mirage_via_write_portb),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c
index 4ef5924f249..d776a1cbf16 100644
--- a/src/mess/drivers/ms0515.c
+++ b/src/mess/drivers/ms0515.c
@@ -34,6 +34,7 @@ public:
int m_blink;
virtual void palette_init();
UINT32 screen_update_ms0515(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_WRITE8_MEMBER(ms0515_portc_w);
};
static ADDRESS_MAP_START(ms0515_mem, AS_PROGRAM, 16, ms0515_state)
@@ -234,10 +235,9 @@ void ms0515_state::palette_init()
palette_set_color(machine(), 15, MAKE_RGB(255, 255, 255));
}
-static WRITE8_DEVICE_HANDLER(ms0515_portc_w)
+WRITE8_MEMBER(ms0515_state::ms0515_portc_w)
{
- ms0515_state *state = space.machine().driver_data<ms0515_state>();
- state->m_sysreg = data;
+ m_sysreg = data;
}
I8255A_INTERFACE( ms0515_ppi8255_interface_1 )
{
@@ -246,7 +246,7 @@ I8255A_INTERFACE( ms0515_ppi8255_interface_1 )
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(ms0515_portc_w)
+ DEVCB_DRIVER_MEMBER(ms0515_state,ms0515_portc_w)
};
static MACHINE_CONFIG_START( ms0515, ms0515_state )
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index 50c97686a0e..c8ff58bd6ad 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -111,6 +111,7 @@ public:
virtual void video_start();
DECLARE_DRIVER_INIT(mycom);
TIMER_DEVICE_CALLBACK_MEMBER(mycom_kbd);
+ DECLARE_WRITE8_MEMBER(mycom_rtc_w);
};
@@ -419,16 +420,15 @@ WRITE8_MEMBER( mycom_state::mycom_0a_w )
m_audio->write(space, 0, m_sn_we);
}
-static WRITE8_DEVICE_HANDLER( mycom_rtc_w )
+WRITE8_MEMBER(mycom_state::mycom_rtc_w)
{
- mycom_state *state = space.machine().driver_data<mycom_state>();
- state->m_rtc->address_w(data & 0x0f);
+ m_rtc->address_w(data & 0x0f);
- state->m_rtc->hold_w(BIT(data, 4));
- state->m_rtc->read_w(BIT(data, 5));
- state->m_rtc->write_w(BIT(data, 6));
- state->m_rtc->cs_w(BIT(data, 7));
+ m_rtc->hold_w(BIT(data, 4));
+ m_rtc->read_w(BIT(data, 5));
+ m_rtc->write_w(BIT(data, 6));
+ m_rtc->cs_w(BIT(data, 7));
}
static I8255_INTERFACE( ppi8255_intf_0 )
@@ -458,7 +458,7 @@ static I8255_INTERFACE( ppi8255_intf_2 )
DEVCB_DEVICE_MEMBER(MSM5832RS_TAG, msm5832_device, data_r), /* Port B read */
DEVCB_DEVICE_MEMBER(MSM5832RS_TAG, msm5832_device, data_w), /* Port B write */
DEVCB_NULL, /* Port C read */
- DEVCB_HANDLER(mycom_rtc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(mycom_state,mycom_rtc_w) /* Port C write */
};
static const UINT8 mycom_keyval[] = { 0,
diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c
index 313856b3763..fe4db7d063c 100644
--- a/src/mess/drivers/mz2000.c
+++ b/src/mess/drivers/mz2000.c
@@ -79,6 +79,17 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_mz2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ DECLARE_READ8_MEMBER(mz2000_wd17xx_r);
+ DECLARE_WRITE8_MEMBER(mz2000_wd17xx_w);
+ DECLARE_READ8_MEMBER(mz2000_porta_r);
+ DECLARE_READ8_MEMBER(mz2000_portb_r);
+ DECLARE_READ8_MEMBER(mz2000_portc_r);
+ DECLARE_WRITE8_MEMBER(mz2000_porta_w);
+ DECLARE_WRITE8_MEMBER(mz2000_portb_w);
+ DECLARE_WRITE8_MEMBER(mz2000_portc_w);
+ DECLARE_WRITE8_MEMBER(mz2000_pio1_porta_w);
+ DECLARE_READ8_MEMBER(mz2000_pio1_portb_r);
+ DECLARE_READ8_MEMBER(mz2000_pio1_porta_r);
};
void mz2000_state::video_start()
@@ -288,21 +299,21 @@ WRITE8_MEMBER(mz2000_state::mz2000_gvram_bank_w)
m_gvram_bank = data & 3;
}
-static READ8_DEVICE_HANDLER( mz2000_wd17xx_r )
+READ8_MEMBER(mz2000_state::mz2000_wd17xx_r)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
+ device_t *device = machine().device("mb8877a");
- if(state->m_has_fdc)
+ if(m_has_fdc)
return wd17xx_r(device, space, offset) ^ 0xff;
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( mz2000_wd17xx_w )
+WRITE8_MEMBER(mz2000_state::mz2000_wd17xx_w)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
+ device_t *device = machine().device("mb8877a");
- if(state->m_has_fdc)
+ if(m_has_fdc)
wd17xx_w(device, space, offset, data ^ 0xff);
}
@@ -353,7 +364,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START(mz2000_io, AS_IO, 8, mz2000_state )
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0xd8, 0xdb) AM_DEVREADWRITE_LEGACY("mb8877a", mz2000_wd17xx_r, mz2000_wd17xx_w)
+ AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2000_wd17xx_r, mz2000_wd17xx_w)
AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2000_fdc_w)
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write)
AM_RANGE(0xe4, 0xe7) AM_DEVREADWRITE_LEGACY("pit", pit8253_r, pit8253_w)
@@ -565,15 +576,14 @@ static GFXDECODE_START( mz2000 )
GFXDECODE_ENTRY( "chargen", 0x0800, mz2000_charlayout_16, 0, 1 )
GFXDECODE_END
-static READ8_DEVICE_HANDLER( mz2000_porta_r )
+READ8_MEMBER(mz2000_state::mz2000_porta_r)
{
printf("A R\n");
return 0xff;
}
-static READ8_DEVICE_HANDLER( mz2000_portb_r )
+READ8_MEMBER(mz2000_state::mz2000_portb_r)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
/*
x--- ---- break key
-x-- ---- read tape data
@@ -584,27 +594,27 @@ static READ8_DEVICE_HANDLER( mz2000_portb_r )
*/
UINT8 res = 0x80;
- if(state->m_cass->get_image() != NULL)
+ if(m_cass->get_image() != NULL)
{
- res |= (state->m_cass->input() > 0.0038) ? 0x40 : 0x00;
- res |= ((state->m_cass->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) ? 0x00 : 0x20;
- res |= (state->m_cass->get_position() >= state->m_cass->get_length()) ? 0x08 : 0x00;
+ res |= (m_cass->input() > 0.0038) ? 0x40 : 0x00;
+ res |= ((m_cass->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_PLAY) ? 0x00 : 0x20;
+ res |= (m_cass->get_position() >= m_cass->get_length()) ? 0x08 : 0x00;
}
else
res |= 0x20;
- res |= (space.machine().primary_screen->vblank()) ? 0x00 : 0x01;
+ res |= (machine().primary_screen->vblank()) ? 0x00 : 0x01;
return res;
}
-static READ8_DEVICE_HANDLER( mz2000_portc_r )
+READ8_MEMBER(mz2000_state::mz2000_portc_r)
{
printf("C R\n");
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( mz2000_porta_w )
+WRITE8_MEMBER(mz2000_state::mz2000_porta_w)
{
/*
These are enabled thru a 0->1 transition
@@ -617,63 +627,61 @@ static WRITE8_DEVICE_HANDLER( mz2000_porta_w )
---- --x- tape ff
---- ---x tape rewind
*/
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
- if((state->m_tape_ctrl & 0x80) == 0 && data & 0x80)
+ if((m_tape_ctrl & 0x80) == 0 && data & 0x80)
{
//printf("Tape APSS control\n");
}
- if((state->m_tape_ctrl & 0x40) == 0 && data & 0x40)
+ if((m_tape_ctrl & 0x40) == 0 && data & 0x40)
{
//printf("Tape APLAY control\n");
}
- if((state->m_tape_ctrl & 0x20) == 0 && data & 0x20)
+ if((m_tape_ctrl & 0x20) == 0 && data & 0x20)
{
//printf("Tape AREW control\n");
}
- if((state->m_tape_ctrl & 0x10) == 0 && data & 0x10)
+ if((m_tape_ctrl & 0x10) == 0 && data & 0x10)
{
//printf("reverse video control\n");
}
- if((state->m_tape_ctrl & 0x08) == 0 && data & 0x08) // stop
+ if((m_tape_ctrl & 0x08) == 0 && data & 0x08) // stop
{
- state->m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
- state->m_cass->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE);
+ m_cass->change_state(CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
+ m_cass->change_state(CASSETTE_STOPPED,CASSETTE_MASK_UISTATE);
}
- if((state->m_tape_ctrl & 0x04) == 0 && data & 0x04) // play
+ if((m_tape_ctrl & 0x04) == 0 && data & 0x04) // play
{
- state->m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
- state->m_cass->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE);
+ m_cass->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ m_cass->change_state(CASSETTE_PLAY,CASSETTE_MASK_UISTATE);
}
- if((state->m_tape_ctrl & 0x02) == 0 && data & 0x02)
+ if((m_tape_ctrl & 0x02) == 0 && data & 0x02)
{
//printf("Tape FF control\n");
}
- if((state->m_tape_ctrl & 0x01) == 0 && data & 0x01)
+ if((m_tape_ctrl & 0x01) == 0 && data & 0x01)
{
//printf("Tape Rewind control\n");
}
- state->m_tape_ctrl = data;
+ m_tape_ctrl = data;
}
-static WRITE8_DEVICE_HANDLER( mz2000_portb_w )
+WRITE8_MEMBER(mz2000_state::mz2000_portb_w)
{
//printf("B W %02x\n",data);
// ...
}
-static WRITE8_DEVICE_HANDLER( mz2000_portc_w )
+WRITE8_MEMBER(mz2000_state::mz2000_portc_w)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
/*
x--- ---- tape data write
-x-- ---- tape rec
@@ -685,78 +693,75 @@ static WRITE8_DEVICE_HANDLER( mz2000_portc_w )
*/
//printf("C W %02x\n",data);
- if(((state->m_old_portc & 8) == 0) && data & 8)
- state->m_ipl_enable = 1;
+ if(((m_old_portc & 8) == 0) && data & 8)
+ m_ipl_enable = 1;
- if(((state->m_old_portc & 2) == 0) && data & 2)
+ if(((m_old_portc & 2) == 0) && data & 2)
{
- state->m_ipl_enable = 0;
+ m_ipl_enable = 0;
/* correct? */
- space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
- beep_set_state(space.machine().device(BEEPER_TAG),data & 0x04);
+ beep_set_state(machine().device(BEEPER_TAG),data & 0x04);
- state->m_old_portc = data;
+ m_old_portc = data;
}
static I8255_INTERFACE( ppi8255_intf )
{
- DEVCB_HANDLER(mz2000_porta_r), /* Port A read */
- DEVCB_HANDLER(mz2000_porta_w), /* Port A write */
- DEVCB_HANDLER(mz2000_portb_r), /* Port B read */
- DEVCB_HANDLER(mz2000_portb_w), /* Port B write */
- DEVCB_HANDLER(mz2000_portc_r), /* Port C read */
- DEVCB_HANDLER(mz2000_portc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_porta_r), /* Port A read */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_porta_w), /* Port A write */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_portb_w), /* Port B write */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_portc_r), /* Port C read */
+ DEVCB_DRIVER_MEMBER(mz2000_state,mz2000_portc_w) /* Port C write */
};
-static WRITE8_DEVICE_HANDLER( mz2000_pio1_porta_w )
+WRITE8_MEMBER(mz2000_state::mz2000_pio1_porta_w)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
- state->m_tvram_enable = ((data & 0xc0) == 0xc0);
- state->m_gvram_enable = ((data & 0xc0) == 0x80);
- state->m_width80 = ((data & 0x20) >> 5);
- state->m_key_mux = data & 0x1f;
+ m_tvram_enable = ((data & 0xc0) == 0xc0);
+ m_gvram_enable = ((data & 0xc0) == 0x80);
+ m_width80 = ((data & 0x20) >> 5);
+ m_key_mux = data & 0x1f;
- state->m_porta_latch = data;
+ m_porta_latch = data;
}
-static READ8_DEVICE_HANDLER( mz2000_pio1_portb_r )
+READ8_MEMBER(mz2000_state::mz2000_pio1_portb_r)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3",
"KEY4", "KEY5", "KEY6", "KEY7",
"KEY8", "KEY9", "KEYA", "KEYB",
"KEYC", "KEYD", "UNUSED", "UNUSED" };
- if(((state->m_key_mux & 0x10) == 0x00) || ((state->m_key_mux & 0x0f) == 0x0f)) //status read
+ if(((m_key_mux & 0x10) == 0x00) || ((m_key_mux & 0x0f) == 0x0f)) //status read
{
int res,i;
res = 0xff;
for(i=0;i<0xe;i++)
- res &= space.machine().root_device().ioport(keynames[i])->read();
+ res &= machine().root_device().ioport(keynames[i])->read();
return res;
}
- return space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
+ return machine().root_device().ioport(keynames[m_key_mux & 0xf])->read();
}
-static READ8_DEVICE_HANDLER( mz2000_pio1_porta_r )
+READ8_MEMBER(mz2000_state::mz2000_pio1_porta_r)
{
- mz2000_state *state = space.machine().driver_data<mz2000_state>();
- return state->m_porta_latch;
+ return m_porta_latch;
}
static Z80PIO_INTERFACE( mz2000_pio1_intf )
{
DEVCB_NULL,
- DEVCB_HANDLER( mz2000_pio1_porta_r ),
- DEVCB_HANDLER( mz2000_pio1_porta_w ),
+ DEVCB_DRIVER_MEMBER(mz2000_state, mz2000_pio1_porta_r ),
+ DEVCB_DRIVER_MEMBER(mz2000_state, mz2000_pio1_porta_w ),
DEVCB_NULL,
- DEVCB_HANDLER( mz2000_pio1_portb_r ),
+ DEVCB_DRIVER_MEMBER(mz2000_state, mz2000_pio1_portb_r ),
DEVCB_NULL,
DEVCB_NULL
};
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index 9f945293e2d..fe634ab8cae 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -165,6 +165,21 @@ public:
virtual void palette_init();
UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(mz2500_vbl);
+ DECLARE_READ8_MEMBER(mz2500_wd17xx_r);
+ DECLARE_WRITE8_MEMBER(mz2500_wd17xx_w);
+ DECLARE_READ8_MEMBER(mz2500_porta_r);
+ DECLARE_READ8_MEMBER(mz2500_portb_r);
+ DECLARE_READ8_MEMBER(mz2500_portc_r);
+ DECLARE_WRITE8_MEMBER(mz2500_porta_w);
+ DECLARE_WRITE8_MEMBER(mz2500_portb_w);
+ DECLARE_WRITE8_MEMBER(mz2500_portc_w);
+ DECLARE_WRITE8_MEMBER(mz2500_pio1_porta_w);
+ DECLARE_READ8_MEMBER(mz2500_pio1_porta_r);
+ DECLARE_READ8_MEMBER(mz2500_pio1_portb_r);
+ DECLARE_READ8_MEMBER(opn_porta_r);
+ DECLARE_WRITE8_MEMBER(opn_porta_w);
+ DECLARE_WRITE_LINE_MEMBER(pit8253_clk0_irq);
+ DECLARE_WRITE_LINE_MEMBER(mz2500_rtc_alarm_irq);
};
@@ -1251,16 +1266,16 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w)
palette_set_color_rgb(machine(), pal_entry+0x10, pal4bit(m_pal[pal_entry].r), pal4bit(m_pal[pal_entry].g), pal4bit(m_pal[pal_entry].b));
}
-static READ8_DEVICE_HANDLER( mz2500_wd17xx_r )
+READ8_MEMBER(mz2500_state::mz2500_wd17xx_r)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
- return wd17xx_r(device, space, offset) ^ state->m_fdc_reverse;
+ device_t *device = machine().device("mb8877a");
+ return wd17xx_r(device, space, offset) ^ m_fdc_reverse;
}
-static WRITE8_DEVICE_HANDLER( mz2500_wd17xx_w )
+WRITE8_MEMBER(mz2500_state::mz2500_wd17xx_w)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
- wd17xx_w(device, space, offset, data ^ state->m_fdc_reverse);
+ device_t *device = machine().device("mb8877a");
+ wd17xx_w(device, space, offset, data ^ m_fdc_reverse);
}
READ8_MEMBER(mz2500_state::mz2500_bplane_latch_r)
@@ -1522,7 +1537,7 @@ static ADDRESS_MAP_START(mz2500_io, AS_IO, 8, mz2500_state )
AM_RANGE(0xcc, 0xcc) AM_READWRITE(rp5c15_8_r, rp5c15_8_w)
AM_RANGE(0xce, 0xce) AM_WRITE(mz2500_dictionary_bank_w)
AM_RANGE(0xcf, 0xcf) AM_WRITE(mz2500_kanji_bank_w)
- AM_RANGE(0xd8, 0xdb) AM_DEVREADWRITE_LEGACY("mb8877a", mz2500_wd17xx_r, mz2500_wd17xx_w)
+ AM_RANGE(0xd8, 0xdb) AM_READWRITE(mz2500_wd17xx_r, mz2500_wd17xx_w)
AM_RANGE(0xdc, 0xdd) AM_WRITE(mz2500_fdc_w)
AM_RANGE(0xde, 0xde) AM_WRITENOP
AM_RANGE(0xe0, 0xe3) AM_DEVREADWRITE("i8255_0", i8255_device, read, write)
@@ -1830,42 +1845,41 @@ INTERRUPT_GEN_MEMBER(mz2500_state::mz2500_vbl)
m_cg_clear_flag = 0;
}
-static READ8_DEVICE_HANDLER( mz2500_porta_r )
+READ8_MEMBER(mz2500_state::mz2500_porta_r)
{
logerror("PPI PORTA R\n");
return 0xff;
}
-static READ8_DEVICE_HANDLER( mz2500_portb_r )
+READ8_MEMBER(mz2500_state::mz2500_portb_r)
{
UINT8 vblank_bit;
- vblank_bit = space.machine().primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
+ vblank_bit = machine().primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
return 0xfe | vblank_bit;
}
-static READ8_DEVICE_HANDLER( mz2500_portc_r )
+READ8_MEMBER(mz2500_state::mz2500_portc_r)
{
logerror("PPI PORTC R\n");
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( mz2500_porta_w )
+WRITE8_MEMBER(mz2500_state::mz2500_porta_w)
{
logerror("PPI PORTA W %02x\n",data);
}
-static WRITE8_DEVICE_HANDLER( mz2500_portb_w )
+WRITE8_MEMBER(mz2500_state::mz2500_portb_w)
{
logerror("PPI PORTB W %02x\n",data);
}
-static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
+WRITE8_MEMBER(mz2500_state::mz2500_portc_w)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
/*
---- x--- 0->1 transition = IPL reset
---- -x-- beeper state
@@ -1873,22 +1887,22 @@ static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
*/
/* work RAM reset */
- if((state->m_old_portc & 0x02) == 0x00 && (data & 0x02))
+ if((m_old_portc & 0x02) == 0x00 && (data & 0x02))
{
- mz2500_reset(state, WRAM_RESET);
+ mz2500_reset(this, WRAM_RESET);
/* correct? */
- space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
/* bit 2 is speaker */
/* IPL reset */
- if((state->m_old_portc & 0x08) == 0x00 && (data & 0x08))
- mz2500_reset(state, IPL_RESET);
+ if((m_old_portc & 0x08) == 0x00 && (data & 0x08))
+ mz2500_reset(this, IPL_RESET);
- state->m_old_portc = data;
+ m_old_portc = data;
- beep_set_state(space.machine().device(BEEPER_TAG),data & 0x04);
+ beep_set_state(machine().device(BEEPER_TAG),data & 0x04);
if(data & ~0x0e)
logerror("PPI PORTC W %02x\n",data & ~0x0e);
@@ -1896,94 +1910,89 @@ static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
static I8255_INTERFACE( ppi8255_intf )
{
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_porta_r), /* Port A read */
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_porta_w), /* Port A write */
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_portb_r), /* Port B read */
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_portb_w), /* Port B write */
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_portc_r), /* Port C read */
- DEVCB_DEVICE_HANDLER("i8255_0", mz2500_portc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_porta_r), /* Port A read */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_porta_w), /* Port A write */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_portb_w), /* Port B write */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_portc_r), /* Port C read */
+ DEVCB_DRIVER_MEMBER(mz2500_state,mz2500_portc_w) /* Port C write */
};
-static WRITE8_DEVICE_HANDLER( mz2500_pio1_porta_w )
+WRITE8_MEMBER(mz2500_state::mz2500_pio1_porta_w)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
// printf("%02x\n",data);
- if(state->m_prev_col_val != ((data & 0x20) >> 5))
+ if(m_prev_col_val != ((data & 0x20) >> 5))
{
- state->m_text_col_size = ((data & 0x20) >> 5);
- state->m_prev_col_val = state->m_text_col_size;
- mz2500_reconfigure_screen(space.machine());
+ m_text_col_size = ((data & 0x20) >> 5);
+ m_prev_col_val = m_text_col_size;
+ mz2500_reconfigure_screen(machine());
}
- state->m_key_mux = data & 0x1f;
+ m_key_mux = data & 0x1f;
}
-static READ8_DEVICE_HANDLER( mz2500_pio1_porta_r )
+READ8_MEMBER(mz2500_state::mz2500_pio1_porta_r)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3",
"KEY4", "KEY5", "KEY6", "KEY7",
"KEY8", "KEY9", "KEYA", "KEYB",
"KEYC", "KEYD", "UNUSED", "UNUSED" };
- if(((state->m_key_mux & 0x10) == 0x00) || ((state->m_key_mux & 0x0f) == 0x0f)) //status read
+ if(((m_key_mux & 0x10) == 0x00) || ((m_key_mux & 0x0f) == 0x0f)) //status read
{
int res,i;
res = 0xff;
for(i=0;i<0xe;i++)
- res &= space.machine().root_device().ioport(keynames[i])->read();
+ res &= machine().root_device().ioport(keynames[i])->read();
- state->m_pio_latchb = res;
+ m_pio_latchb = res;
return res;
}
- state->m_pio_latchb = space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
+ m_pio_latchb = machine().root_device().ioport(keynames[m_key_mux & 0xf])->read();
- return space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
+ return machine().root_device().ioport(keynames[m_key_mux & 0xf])->read();
}
#if 0
-static READ8_DEVICE_HANDLER( mz2500_pio1_portb_r )
+READ8_MEMBER(mz2500_state::mz2500_pio1_portb_r)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
- return state->m_pio_latchb;
+ return m_pio_latchb;
}
#endif
static Z80PIO_INTERFACE( mz2500_pio1_intf )
{
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER( "z80pio_1", mz2500_pio1_porta_r ),
- DEVCB_DEVICE_HANDLER( "z80pio_1", mz2500_pio1_porta_w ),
+ DEVCB_DRIVER_MEMBER( mz2500_state,mz2500_pio1_porta_r ),
+ DEVCB_DRIVER_MEMBER( mz2500_state,mz2500_pio1_porta_w ),
DEVCB_NULL,
- DEVCB_DEVICE_HANDLER( "z80pio_1", mz2500_pio1_porta_r ),
+ DEVCB_DRIVER_MEMBER( mz2500_state,mz2500_pio1_porta_r ),
DEVCB_NULL,
DEVCB_NULL
};
-static READ8_DEVICE_HANDLER( opn_porta_r )
+READ8_MEMBER(mz2500_state::opn_porta_r)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
- return state->m_ym_porta;
+ return m_ym_porta;
}
-static WRITE8_DEVICE_HANDLER( opn_porta_w )
+WRITE8_MEMBER(mz2500_state::opn_porta_w)
{
- mz2500_state *state = space.machine().driver_data<mz2500_state>();
/*
---- x--- mouse select
---- -x-- palette bit (16/4096 colors)
---- --x- floppy reverse bit (controls wd17xx bits in command registers)
*/
- state->m_fdc_reverse = (data & 2) ? 0x00 : 0xff;
- state->m_pal_select = (data & 4) ? 1 : 0;
+ m_fdc_reverse = (data & 2) ? 0x00 : 0xff;
+ m_pal_select = (data & 4) ? 1 : 0;
- state->m_ym_porta = data;
+ m_ym_porta = data;
}
static const ym2203_interface ym2203_interface_1 =
@@ -1991,9 +2000,9 @@ static const ym2203_interface ym2203_interface_1 =
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
- DEVCB_DEVICE_HANDLER("ym", opn_porta_r), // read A
+ DEVCB_DRIVER_MEMBER(mz2500_state,opn_porta_r), // read A
DEVCB_INPUT_PORT("DSW1"), // read B
- DEVCB_DEVICE_HANDLER("ym", opn_porta_w), // write A
+ DEVCB_DRIVER_MEMBER(mz2500_state,opn_porta_w), // write A
DEVCB_NULL // write B
},
DEVCB_NULL
@@ -2040,11 +2049,10 @@ void mz2500_state::palette_init()
/* PIT8253 Interface */
-static WRITE_LINE_DEVICE_HANDLER( pit8253_clk0_irq )
+WRITE_LINE_MEMBER(mz2500_state::pit8253_clk0_irq)
{
- mz2500_state *drvstate = device->machine().driver_data<mz2500_state>();
- if(drvstate->m_irq_mask[1]/* && state & 1*/)
- device->machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,drvstate->m_irq_vector[1]);
+ if(m_irq_mask[1]/* && state & 1*/)
+ machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,m_irq_vector[1]);
}
static const struct pit8253_config mz2500_pit8253_intf =
@@ -2053,7 +2061,7 @@ static const struct pit8253_config mz2500_pit8253_intf =
{
31250,
DEVCB_NULL,
- DEVCB_DEVICE_LINE("pit", pit8253_clk0_irq)
+ DEVCB_DRIVER_LINE_MEMBER(mz2500_state,pit8253_clk0_irq)
},
{
0,
@@ -2068,17 +2076,16 @@ static const struct pit8253_config mz2500_pit8253_intf =
}
};
-static WRITE_LINE_DEVICE_HANDLER( mz2500_rtc_alarm_irq )
+WRITE_LINE_MEMBER(mz2500_state::mz2500_rtc_alarm_irq)
{
- //mz2500_state *drvstate = device->machine().driver_data<mz2500_state>();
/* TODO: doesn't work yet */
-// if(drvstate->m_irq_mask[3] && state & 1)
-// device.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,drvstate->m_irq_vector[3]);
+// if(m_irq_mask[3] && state & 1)
+// device.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,drvm_irq_vector[3]);
}
static RP5C15_INTERFACE( rtc_intf )
{
- DEVCB_DEVICE_LINE(RP5C15_TAG, mz2500_rtc_alarm_irq),
+ DEVCB_DRIVER_LINE_MEMBER(mz2500_state,mz2500_rtc_alarm_irq),
DEVCB_NULL
};
diff --git a/src/mess/drivers/nanos.c b/src/mess/drivers/nanos.c
index 269dccd7e8e..d88ec99bab7 100644
--- a/src/mess/drivers/nanos.c
+++ b/src/mess/drivers/nanos.c
@@ -58,6 +58,10 @@ public:
virtual void video_start();
UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
+ DECLARE_WRITE_LINE_MEMBER(z80daisy_interrupt);
+ DECLARE_READ8_MEMBER(nanos_port_a_r);
+ DECLARE_READ8_MEMBER(nanos_port_b_r);
+ DECLARE_WRITE8_MEMBER(nanos_port_b_w);
};
@@ -121,14 +125,14 @@ static Z80PIO_INTERFACE( pio2_intf )
/* Z80-SIO Interface */
-static WRITE_LINE_DEVICE_HANDLER( z80daisy_interrupt )
+WRITE_LINE_MEMBER(nanos_state::z80daisy_interrupt)
{
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, state);
+ machine().device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, state);
}
static const z80sio_interface sio_intf =
{
- DEVCB_LINE(z80daisy_interrupt), /* interrupt handler */
+ DEVCB_DRIVER_LINE_MEMBER(nanos_state, z80daisy_interrupt), /* interrupt handler */
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_NULL, /* BREAK changed handler */
@@ -307,33 +311,31 @@ UINT32 nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
return 0;
}
-static READ8_DEVICE_HANDLER (nanos_port_a_r)
+READ8_MEMBER(nanos_state::nanos_port_a_r)
{
- nanos_state *state = space.machine().driver_data<nanos_state>();
UINT8 retVal;
- if (state->m_key_command==0) {
- return state->m_key_pressed;
+ if (m_key_command==0) {
+ return m_key_pressed;
} else {
- retVal = state->m_last_code;
- state->m_last_code = 0;
+ retVal = m_last_code;
+ m_last_code = 0;
return retVal;
}
}
-static READ8_DEVICE_HANDLER (nanos_port_b_r)
+READ8_MEMBER(nanos_state::nanos_port_b_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER (nanos_port_b_w)
+WRITE8_MEMBER(nanos_state::nanos_port_b_w)
{
- nanos_state *state = space.machine().driver_data<nanos_state>();
- state->m_key_command = BIT(data,1);
+ m_key_command = BIT(data,1);
if (BIT(data,7)) {
- state->membank("bank1")->set_base(state->memregion("maincpu")->base());
+ membank("bank1")->set_base(memregion("maincpu")->base());
} else {
- state->membank("bank1")->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer());
+ membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
}
}
@@ -455,11 +457,11 @@ void nanos_state::machine_reset()
static Z80PIO_INTERFACE( nanos_z80pio_intf )
{
DEVCB_NULL, /* callback when change interrupt status */
- DEVCB_HANDLER(nanos_port_a_r),
+ DEVCB_DRIVER_MEMBER(nanos_state,nanos_port_a_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(nanos_port_b_r),
- DEVCB_HANDLER(nanos_port_b_w),
+ DEVCB_DRIVER_MEMBER(nanos_state,nanos_port_b_r),
+ DEVCB_DRIVER_MEMBER(nanos_state,nanos_port_b_w),
DEVCB_NULL
};
diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c
index 0390a576a42..ae7034989ce 100644
--- a/src/mess/drivers/osbexec.c
+++ b/src/mess/drivers/osbexec.c
@@ -111,6 +111,14 @@ public:
virtual void machine_reset();
virtual void palette_init();
TIMER_CALLBACK_MEMBER(osbexec_video_callback);
+ DECLARE_READ8_MEMBER(osbexec_pia0_a_r);
+ DECLARE_WRITE8_MEMBER(osbexec_pia0_a_w);
+ DECLARE_READ8_MEMBER(osbexec_pia0_b_r);
+ DECLARE_WRITE8_MEMBER(osbexec_pia0_b_w);
+ DECLARE_WRITE_LINE_MEMBER(osbexec_pia0_ca2_w);
+ DECLARE_WRITE_LINE_MEMBER(osbexec_pia0_cb2_w);
+ DECLARE_WRITE_LINE_MEMBER(osbexec_pia0_irq);
+ DECLARE_WRITE_LINE_MEMBER(osbexec_pia1_irq);
};
@@ -348,102 +356,95 @@ UINT32 osbexec_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
CB2 - 60/50 (?)
*/
-static READ8_DEVICE_HANDLER( osbexec_pia0_a_r )
+READ8_MEMBER(osbexec_state::osbexec_pia0_a_r)
{
- osbexec_state *state = space.machine().driver_data<osbexec_state>();
- return state->m_pia0_porta;
+ return m_pia0_porta;
}
-static WRITE8_DEVICE_HANDLER( osbexec_pia0_a_w )
+WRITE8_MEMBER(osbexec_state::osbexec_pia0_a_w)
{
- osbexec_state *state = space.machine().driver_data<osbexec_state>();
logerror("osbexec_pia0_a_w: %02x\n", data );
- state->m_pia0_porta = data;
+ m_pia0_porta = data;
- state->set_banks(space.machine());
+ set_banks(machine());
}
-static READ8_DEVICE_HANDLER( osbexec_pia0_b_r )
+READ8_MEMBER(osbexec_state::osbexec_pia0_b_r)
{
- osbexec_state *state = space.machine().driver_data<osbexec_state>();
- return state->m_pia0_portb;
+ return m_pia0_portb;
}
-static WRITE8_DEVICE_HANDLER( osbexec_pia0_b_w )
+WRITE8_MEMBER(osbexec_state::osbexec_pia0_b_w)
{
- osbexec_state *state = space.machine().driver_data<osbexec_state>();
- state->m_pia0_portb = data;
+ m_pia0_portb = data;
- speaker_level_w( state->m_speaker, ( data & 0x08 ) ? 0 : 1 );
+ speaker_level_w( m_speaker, ( data & 0x08 ) ? 0 : 1 );
switch ( data & 0x06 )
{
case 0x02:
- wd17xx_set_drive( state->m_mb8877, 1 );
+ wd17xx_set_drive( m_mb8877, 1 );
break;
case 0x04:
- wd17xx_set_drive( state->m_mb8877, 0 );
+ wd17xx_set_drive( m_mb8877, 0 );
break;
}
- wd17xx_dden_w( state->m_mb8877, ( data & 0x01 ) ? 1 : 0 );
+ wd17xx_dden_w( m_mb8877, ( data & 0x01 ) ? 1 : 0 );
}
-static WRITE_LINE_DEVICE_HANDLER( osbexec_pia0_ca2_w )
+WRITE_LINE_MEMBER(osbexec_state::osbexec_pia0_ca2_w)
{
logerror("osbexec_pia0_ca2_w: state = %d\n", state);
}
-static WRITE_LINE_DEVICE_HANDLER( osbexec_pia0_cb2_w )
+WRITE_LINE_MEMBER(osbexec_state::osbexec_pia0_cb2_w)
{
- osbexec_state *st = device->machine().driver_data<osbexec_state>();
- st->m_pia0_cb2 = state;
+ m_pia0_cb2 = state;
}
-static WRITE_LINE_DEVICE_HANDLER( osbexec_pia0_irq )
+WRITE_LINE_MEMBER(osbexec_state::osbexec_pia0_irq)
{
- osbexec_state *st = device->machine().driver_data<osbexec_state>();
- st->m_pia0_irq_state = state;
- st->update_irq_state(device->machine());
+ m_pia0_irq_state = state;
+ update_irq_state(machine());
}
static const pia6821_interface osbexec_pia0_config =
{
- DEVCB_HANDLER( osbexec_pia0_a_r ), /* in_a_func */ /* port A - banking */
- DEVCB_HANDLER( osbexec_pia0_b_r), /* in_b_func */ /* modem / speaker */
+ DEVCB_DRIVER_MEMBER(osbexec_state, osbexec_pia0_a_r ), /* in_a_func */ /* port A - banking */
+ DEVCB_DRIVER_MEMBER(osbexec_state, osbexec_pia0_b_r), /* in_b_func */ /* modem / speaker */
DEVCB_NULL, /* in_ca1_func */ /* DMA IRQ */
DEVCB_NULL, /* in_cb1_func */ /* Vblank (rtc irq) */
DEVCB_NULL, /* in_ca2_func */
DEVCB_NULL, /* in_cb2_func */
- DEVCB_HANDLER( osbexec_pia0_a_w ), /* out_a_func */ /* port A - banking */
- DEVCB_HANDLER( osbexec_pia0_b_w ), /* out_b_func */ /* modem / speaker */
- DEVCB_LINE( osbexec_pia0_ca2_w ), /* out_ca2_func */ /* Keyboard strobe */
- DEVCB_LINE( osbexec_pia0_cb2_w ), /* out_cb2_func */ /* 60/50 */
- DEVCB_LINE( osbexec_pia0_irq ), /* irq_a_func */ /* IRQ */
- DEVCB_LINE( osbexec_pia0_irq ) /* irq_b_func */ /* IRQ */
+ DEVCB_DRIVER_MEMBER(osbexec_state, osbexec_pia0_a_w ), /* out_a_func */ /* port A - banking */
+ DEVCB_DRIVER_MEMBER(osbexec_state, osbexec_pia0_b_w ), /* out_b_func */ /* modem / speaker */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia0_ca2_w ), /* out_ca2_func */ /* Keyboard strobe */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia0_cb2_w ), /* out_cb2_func */ /* 60/50 */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia0_irq ), /* irq_a_func */ /* IRQ */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia0_irq ) /* irq_b_func */ /* IRQ */
};
-static WRITE_LINE_DEVICE_HANDLER( osbexec_pia1_irq )
+WRITE_LINE_MEMBER(osbexec_state::osbexec_pia1_irq)
{
- osbexec_state *st = device->machine().driver_data<osbexec_state>();
- st->m_pia1_irq_state = state;
- st->update_irq_state(device->machine());
+ m_pia1_irq_state = state;
+ update_irq_state(machine());
}
@@ -459,8 +460,8 @@ static const pia6821_interface osbexec_pia1_config =
DEVCB_NULL, /* out_b_func */
DEVCB_NULL, /* out_ca2_func */
DEVCB_NULL, /* out_cb2_func */
- DEVCB_LINE( osbexec_pia1_irq ), /* irq_a_func */
- DEVCB_LINE( osbexec_pia1_irq ) /* irq_b_func */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia1_irq ), /* irq_a_func */
+ DEVCB_DRIVER_LINE_MEMBER(osbexec_state, osbexec_pia1_irq ) /* irq_b_func */
};
diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c
index 10e144e841f..06e9c4ceb46 100644
--- a/src/mess/drivers/palm.c
+++ b/src/mess/drivers/palm.c
@@ -45,6 +45,12 @@ public:
virtual void machine_reset();
DECLARE_INPUT_CHANGED_MEMBER(pen_check);
DECLARE_INPUT_CHANGED_MEMBER(button_check);
+ DECLARE_WRITE8_MEMBER(palm_port_f_out);
+ DECLARE_READ8_MEMBER(palm_port_c_in);
+ DECLARE_READ8_MEMBER(palm_port_f_in);
+ DECLARE_WRITE16_MEMBER(palm_spim_out);
+ DECLARE_READ16_MEMBER(palm_spim_in);
+ DECLARE_WRITE8_MEMBER(palm_dac_transition);
};
static offs_t palm_dasm_override(device_t &device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
@@ -71,33 +77,29 @@ INPUT_CHANGED_MEMBER(palm_state::button_check)
mc68328_set_port_d_lines(m_lsi, button_state, (int)(FPTR)param);
}
-static WRITE8_DEVICE_HANDLER( palm_port_f_out )
+WRITE8_MEMBER(palm_state::palm_port_f_out)
{
- palm_state *state = space.machine().driver_data<palm_state>();
- state->m_port_f_latch = data;
+ m_port_f_latch = data;
}
-static READ8_DEVICE_HANDLER( palm_port_c_in )
+READ8_MEMBER(palm_state::palm_port_c_in)
{
return 0x10;
}
-static READ8_DEVICE_HANDLER( palm_port_f_in )
+READ8_MEMBER(palm_state::palm_port_f_in)
{
- palm_state *state = space.machine().driver_data<palm_state>();
- return state->m_port_f_latch;
+ return m_port_f_latch;
}
-static WRITE16_DEVICE_HANDLER( palm_spim_out )
+WRITE16_MEMBER(palm_state::palm_spim_out)
{
- palm_state *state = space.machine().driver_data<palm_state>();
- state->m_spim_data = data;
+ m_spim_data = data;
}
-static READ16_DEVICE_HANDLER( palm_spim_in )
+READ16_MEMBER(palm_state::palm_spim_in)
{
- palm_state *state = space.machine().driver_data<palm_state>();
- return state->m_spim_data;
+ return m_spim_data;
}
static void palm_spim_exchange( device_t *device )
@@ -157,10 +159,9 @@ ADDRESS_MAP_END
AUDIO HARDWARE
***************************************************************************/
-static WRITE8_DEVICE_HANDLER( palm_dac_transition )
+WRITE8_MEMBER(palm_state::palm_dac_transition)
{
- palm_state *state = space.machine().driver_data<palm_state>();
- state->m_dac->write_unsigned8(0x7f * data );
+ m_dac->write_unsigned8(0x7f * data );
}
@@ -176,7 +177,7 @@ static MC68328_INTERFACE(palm_dragonball_iface)
DEVCB_NULL, // Port C Output
DEVCB_NULL, // Port D Output
DEVCB_NULL, // Port E Output
- DEVCB_HANDLER(palm_port_f_out),// Port F Output
+ DEVCB_DRIVER_MEMBER(palm_state,palm_port_f_out),// Port F Output
DEVCB_NULL, // Port G Output
DEVCB_NULL, // Port J Output
DEVCB_NULL, // Port K Output
@@ -184,19 +185,19 @@ static MC68328_INTERFACE(palm_dragonball_iface)
DEVCB_NULL, // Port A Input
DEVCB_NULL, // Port B Input
- DEVCB_HANDLER(palm_port_c_in),// Port C Input
+ DEVCB_DRIVER_MEMBER(palm_state,palm_port_c_in),// Port C Input
DEVCB_NULL, // Port D Input
DEVCB_NULL, // Port E Input
- DEVCB_HANDLER(palm_port_f_in),// Port F Input
+ DEVCB_DRIVER_MEMBER(palm_state,palm_port_f_in),// Port F Input
DEVCB_NULL, // Port G Input
DEVCB_NULL, // Port J Input
DEVCB_NULL, // Port K Input
DEVCB_NULL, // Port M Input
- DEVCB_HANDLER(palm_dac_transition),
+ DEVCB_DRIVER_MEMBER(palm_state,palm_dac_transition),
- DEVCB_HANDLER(palm_spim_out),
- DEVCB_HANDLER(palm_spim_in),
+ DEVCB_DRIVER_MEMBER16(palm_state,palm_spim_out),
+ DEVCB_DRIVER_MEMBER16(palm_state,palm_spim_in),
palm_spim_exchange
};
diff --git a/src/mess/drivers/pasogo.c b/src/mess/drivers/pasogo.c
index 0551e43fed9..43f191ead53 100644
--- a/src/mess/drivers/pasogo.c
+++ b/src/mess/drivers/pasogo.c
@@ -72,6 +72,7 @@ public:
UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pasogo_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(vg230_timer);
+ DECLARE_WRITE_LINE_MEMBER(pasogo_pic8259_set_int_line);
};
@@ -487,14 +488,14 @@ static const pit8253_config pc_pit8254_config =
};
-static WRITE_LINE_DEVICE_HANDLER( pasogo_pic8259_set_int_line )
+WRITE_LINE_MEMBER(pasogo_state::pasogo_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 pic8259_interface pasogo_pic8259_config =
{
- DEVCB_LINE(pasogo_pic8259_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(pasogo_state, pasogo_pic8259_set_int_line),
DEVCB_LINE_VCC,
DEVCB_NULL
};
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index 66ed6dfd179..055a6166a56 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -238,6 +238,12 @@ public:
TIMER_CALLBACK_MEMBER(audio_callback);
TIMER_DEVICE_CALLBACK_MEMBER(cassette_callback);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
+ DECLARE_READ8_MEMBER(pc6001_8255_porta_r);
+ DECLARE_WRITE8_MEMBER(pc6001_8255_porta_w);
+ DECLARE_READ8_MEMBER(pc6001_8255_portb_r);
+ DECLARE_WRITE8_MEMBER(pc6001_8255_portb_w);
+ DECLARE_WRITE8_MEMBER(pc6001_8255_portc_w);
+ DECLARE_READ8_MEMBER(pc6001_8255_portc_r);
};
@@ -1875,33 +1881,33 @@ static IRQ_CALLBACK ( pc6001_irq_callback )
return state->m_irq_vector;
}
-static READ8_DEVICE_HANDLER (pc6001_8255_porta_r )
+READ8_MEMBER(pc6001_state::pc6001_8255_porta_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER (pc6001_8255_porta_w )
+WRITE8_MEMBER(pc6001_state::pc6001_8255_porta_w)
{
// if(data != 0x06)
// printf("pc6001_8255_porta_w %02x\n",data);
}
-static READ8_DEVICE_HANDLER (pc6001_8255_portb_r )
+READ8_MEMBER(pc6001_state::pc6001_8255_portb_r)
{
return 0;
}
-static WRITE8_DEVICE_HANDLER (pc6001_8255_portb_w )
+WRITE8_MEMBER(pc6001_state::pc6001_8255_portb_w)
{
//printf("pc6001_8255_portb_w %02x\n",data);
}
-static WRITE8_DEVICE_HANDLER (pc6001_8255_portc_w )
+WRITE8_MEMBER(pc6001_state::pc6001_8255_portc_w)
{
//printf("pc6001_8255_portc_w %02x\n",data);
}
-static READ8_DEVICE_HANDLER (pc6001_8255_portc_r )
+READ8_MEMBER(pc6001_state::pc6001_8255_portc_r)
{
return 0x88;
}
@@ -1910,12 +1916,12 @@ static READ8_DEVICE_HANDLER (pc6001_8255_portc_r )
static I8255_INTERFACE( pc6001_ppi8255_interface )
{
- DEVCB_HANDLER(pc6001_8255_porta_r),
- DEVCB_HANDLER(pc6001_8255_porta_w),
- DEVCB_HANDLER(pc6001_8255_portb_r),
- DEVCB_HANDLER(pc6001_8255_portb_w),
- DEVCB_HANDLER(pc6001_8255_portc_r),
- DEVCB_HANDLER(pc6001_8255_portc_w)
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_porta_r),
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_porta_w),
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_portb_r),
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_portb_w),
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_portc_r),
+ DEVCB_DRIVER_MEMBER(pc6001_state,pc6001_8255_portc_w)
};
static const i8251_interface pc6001_usart_interface=
diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c
index 5f093b59bad..ae7eb484756 100644
--- a/src/mess/drivers/pc8801.c
+++ b/src/mess/drivers/pc8801.c
@@ -454,6 +454,14 @@ public:
INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq);
TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero);
TIMER_DEVICE_CALLBACK_MEMBER(pc8801_rtc_irq);
+ DECLARE_READ8_MEMBER(cpu_8255_c_r);
+ DECLARE_WRITE8_MEMBER(cpu_8255_c_w);
+ DECLARE_READ8_MEMBER(fdc_8255_c_r);
+ DECLARE_WRITE8_MEMBER(fdc_8255_c_w);
+ DECLARE_WRITE_LINE_MEMBER(pic_int_w);
+ DECLARE_WRITE_LINE_MEMBER(pic_enlg_w);
+ DECLARE_READ8_MEMBER(opn_porta_r);
+ DECLARE_READ8_MEMBER(opn_portb_r);
};
@@ -1820,20 +1828,18 @@ static ADDRESS_MAP_START( pc8801_io, AS_IO, 8, pc8801_state )
AM_RANGE(0xfc, 0xff) AM_DEVREADWRITE("d8255_master", i8255_device, read, write)
ADDRESS_MAP_END
-static READ8_DEVICE_HANDLER( cpu_8255_c_r )
+READ8_MEMBER(pc8801_state::cpu_8255_c_r)
{
- pc8801_state *state = space.machine().driver_data<pc8801_state>();
-// space.machine().scheduler().synchronize(); // force resync
+// machine().scheduler().synchronize(); // force resync
- return state->m_i8255_1_pc >> 4;
+ return m_i8255_1_pc >> 4;
}
-static WRITE8_DEVICE_HANDLER( cpu_8255_c_w )
+WRITE8_MEMBER(pc8801_state::cpu_8255_c_w)
{
- pc8801_state *state = space.machine().driver_data<pc8801_state>();
-// space.machine().scheduler().synchronize(); // force resync
+// machine().scheduler().synchronize(); // force resync
- state->m_i8255_0_pc = data;
+ m_i8255_0_pc = data;
}
@@ -1843,24 +1849,22 @@ static I8255A_INTERFACE( master_fdd_intf )
DEVCB_NULL, // Port A write
DEVCB_DEVICE_MEMBER("d8255_slave", i8255_device, pa_r), // Port B read
DEVCB_NULL, // Port B write
- DEVCB_HANDLER(cpu_8255_c_r), // Port C read
- DEVCB_HANDLER(cpu_8255_c_w) // Port C write
+ DEVCB_DRIVER_MEMBER(pc8801_state,cpu_8255_c_r), // Port C read
+ DEVCB_DRIVER_MEMBER(pc8801_state,cpu_8255_c_w) // Port C write
};
-static READ8_DEVICE_HANDLER( fdc_8255_c_r )
+READ8_MEMBER(pc8801_state::fdc_8255_c_r)
{
- pc8801_state *state = space.machine().driver_data<pc8801_state>();
-// space.machine().scheduler().synchronize(); // force resync
+// machine().scheduler().synchronize(); // force resync
- return state->m_i8255_0_pc >> 4;
+ return m_i8255_0_pc >> 4;
}
-static WRITE8_DEVICE_HANDLER( fdc_8255_c_w )
+WRITE8_MEMBER(pc8801_state::fdc_8255_c_w)
{
- pc8801_state *state = space.machine().driver_data<pc8801_state>();
-// space.machine().scheduler().synchronize(); // force resync
+// machine().scheduler().synchronize(); // force resync
- state->m_i8255_1_pc = data;
+ m_i8255_1_pc = data;
}
static I8255A_INTERFACE( slave_fdd_intf )
@@ -1869,8 +1873,8 @@ static I8255A_INTERFACE( slave_fdd_intf )
DEVCB_NULL, // Port A write
DEVCB_DEVICE_MEMBER("d8255_master", i8255_device, pa_r), // Port B read
DEVCB_NULL, // Port B write
- DEVCB_HANDLER(fdc_8255_c_r), // Port C read
- DEVCB_HANDLER(fdc_8255_c_w) // Port C write
+ DEVCB_DRIVER_MEMBER(pc8801_state,fdc_8255_c_r), // Port C read
+ DEVCB_DRIVER_MEMBER(pc8801_state,fdc_8255_c_w) // Port C write
};
@@ -2301,15 +2305,17 @@ void pc8801_raise_irq(running_machine &machine,UINT8 irq,UINT8 state)
}
}
-static WRITE_LINE_DEVICE_HANDLER( pic_int_w )
+WRITE_LINE_MEMBER(pc8801_state::pic_int_w)
{
+ device_t *device = machine().device("maincpu");
// if (state == ASSERT_LINE)
// {
// }
}
-static WRITE_LINE_DEVICE_HANDLER( pic_enlg_w )
+WRITE_LINE_MEMBER(pc8801_state::pic_enlg_w)
{
+ device_t *device = machine().device("maincpu");
//if (state == CLEAR_LINE)
//{
//}
@@ -2317,8 +2323,8 @@ static WRITE_LINE_DEVICE_HANDLER( pic_enlg_w )
static I8214_INTERFACE( pic_intf )
{
- DEVCB_DEVICE_LINE("maincpu", pic_int_w),
- DEVCB_DEVICE_LINE("maincpu", pic_enlg_w)
+ DEVCB_DRIVER_LINE_MEMBER(pc8801_state,pic_int_w),
+ DEVCB_DRIVER_LINE_MEMBER(pc8801_state,pic_enlg_w)
};
static IRQ_CALLBACK( pc8801_irq_callback )
@@ -2568,33 +2574,32 @@ static const struct upd765_interface pc8801_upd765_interface =
/* YM2203 Interface */
-static READ8_DEVICE_HANDLER( opn_porta_r )
+READ8_MEMBER(pc8801_state::opn_porta_r)
{
- pc8801_state *state = space.machine().driver_data<pc8801_state>();
- if(space.machine().root_device().ioport("BOARD_CONFIG")->read() & 2)
+ if(machine().root_device().ioport("BOARD_CONFIG")->read() & 2)
{
UINT8 shift,res;
- shift = (state->m_mouse.phase & 1) ? 0 : 4;
- res = (state->m_mouse.phase & 2) ? state->m_mouse.y : state->m_mouse.x;
+ shift = (m_mouse.phase & 1) ? 0 : 4;
+ res = (m_mouse.phase & 2) ? m_mouse.y : m_mouse.x;
-// printf("%d\n",state->m_mouse.phase);
+// printf("%d\n",m_mouse.phase);
return ((res >> shift) & 0x0f) | 0xf0;
}
- return space.machine().root_device().ioport("OPN_PA")->read();
+ return machine().root_device().ioport("OPN_PA")->read();
}
-static READ8_DEVICE_HANDLER( opn_portb_r ) { return device->machine().root_device().ioport("OPN_PB")->read(); }
+READ8_MEMBER(pc8801_state::opn_portb_r){ return machine().root_device().ioport("OPN_PB")->read(); }
static const ym2203_interface pc88_ym2203_intf =
{
{
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
- DEVCB_HANDLER(opn_porta_r),
- DEVCB_HANDLER(opn_portb_r),
+ DEVCB_DRIVER_MEMBER(pc8801_state,opn_porta_r),
+ DEVCB_DRIVER_MEMBER(pc8801_state,opn_portb_r),
DEVCB_NULL,
DEVCB_NULL
},
@@ -2606,8 +2611,8 @@ static const ym2608_interface pc88_ym2608_intf =
{
AY8910_LEGACY_OUTPUT | AY8910_SINGLE_OUTPUT,
AY8910_DEFAULT_LOADS,
- DEVCB_HANDLER(opn_porta_r),
- DEVCB_HANDLER(opn_portb_r),
+ DEVCB_DRIVER_MEMBER(pc8801_state,opn_porta_r),
+ DEVCB_DRIVER_MEMBER(pc8801_state,opn_portb_r),
DEVCB_NULL,
DEVCB_NULL
},
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index 8ccd9ce4e13..ae64928af1b 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -105,6 +105,20 @@ public:
INTERRUPT_GEN_MEMBER(pc88va_vrtc_irq);
TIMER_CALLBACK_MEMBER(pc8801fd_upd765_tc_to_zero);
TIMER_CALLBACK_MEMBER(t3_mouse_callback);
+ DECLARE_READ8_MEMBER(cpu_8255_c_r);
+ DECLARE_WRITE8_MEMBER(cpu_8255_c_w);
+ DECLARE_READ8_MEMBER(fdc_8255_c_r);
+ DECLARE_WRITE8_MEMBER(fdc_8255_c_w);
+ DECLARE_READ8_MEMBER(r232_ctrl_porta_r);
+ DECLARE_READ8_MEMBER(r232_ctrl_portb_r);
+ DECLARE_READ8_MEMBER(r232_ctrl_portc_r);
+ DECLARE_WRITE8_MEMBER(r232_ctrl_porta_w);
+ DECLARE_WRITE8_MEMBER(r232_ctrl_portb_w);
+ DECLARE_WRITE8_MEMBER(r232_ctrl_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(pc88va_pic_irq);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE_LINE_MEMBER(pc88va_pit_out0_changed);
+ DECLARE_WRITE_LINE_MEMBER(pc88va_upd765_interrupt);
};
@@ -1396,18 +1410,16 @@ static GFXDECODE_START( pc88va )
GFXDECODE_ENTRY( "kanji", 0x00000, pc88va_chars_16x16, 0, 1 )
GFXDECODE_END
-static READ8_DEVICE_HANDLER( cpu_8255_c_r )
+READ8_MEMBER(pc88va_state::cpu_8255_c_r)
{
- pc88va_state *state = space.machine().driver_data<pc88va_state>();
- return state->m_i8255_1_pc >> 4;
+ return m_i8255_1_pc >> 4;
}
-static WRITE8_DEVICE_HANDLER( cpu_8255_c_w )
+WRITE8_MEMBER(pc88va_state::cpu_8255_c_w)
{
- pc88va_state *state = space.machine().driver_data<pc88va_state>();
- state->m_i8255_0_pc = data;
+ m_i8255_0_pc = data;
}
static I8255A_INTERFACE( master_fdd_intf )
@@ -1416,22 +1428,20 @@ static I8255A_INTERFACE( master_fdd_intf )
DEVCB_NULL, // Port A write
DEVCB_DEVICE_MEMBER("d8255_2s", i8255_device, pa_r), // Port B read
DEVCB_NULL, // Port B write
- DEVCB_HANDLER(cpu_8255_c_r), // Port C read
- DEVCB_HANDLER(cpu_8255_c_w) // Port C write
+ DEVCB_DRIVER_MEMBER(pc88va_state,cpu_8255_c_r), // Port C read
+ DEVCB_DRIVER_MEMBER(pc88va_state,cpu_8255_c_w) // Port C write
};
-static READ8_DEVICE_HANDLER( fdc_8255_c_r )
+READ8_MEMBER(pc88va_state::fdc_8255_c_r)
{
- pc88va_state *state = space.machine().driver_data<pc88va_state>();
- return state->m_i8255_0_pc >> 4;
+ return m_i8255_0_pc >> 4;
}
-static WRITE8_DEVICE_HANDLER( fdc_8255_c_w )
+WRITE8_MEMBER(pc88va_state::fdc_8255_c_w)
{
- pc88va_state *state = space.machine().driver_data<pc88va_state>();
- state->m_i8255_1_pc = data;
+ m_i8255_1_pc = data;
}
static I8255A_INTERFACE( slave_fdd_intf )
@@ -1440,60 +1450,60 @@ static I8255A_INTERFACE( slave_fdd_intf )
DEVCB_NULL, // Port A write
DEVCB_DEVICE_MEMBER("d8255_2", i8255_device, pa_r), // Port B read
DEVCB_NULL, // Port B write
- DEVCB_HANDLER(fdc_8255_c_r), // Port C read
- DEVCB_HANDLER(fdc_8255_c_w) // Port C write
+ DEVCB_DRIVER_MEMBER(pc88va_state,fdc_8255_c_r), // Port C read
+ DEVCB_DRIVER_MEMBER(pc88va_state,fdc_8255_c_w) // Port C write
};
-static READ8_DEVICE_HANDLER( r232_ctrl_porta_r )
+READ8_MEMBER(pc88va_state::r232_ctrl_porta_r)
{
UINT8 sw5, sw4, sw3, sw2,speed_sw;
- speed_sw = (space.machine().root_device().ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00;
- sw5 = (space.machine().root_device().ioport("DSW")->read() & 0x10);
- sw4 = (space.machine().root_device().ioport("DSW")->read() & 0x08);
- sw3 = (space.machine().root_device().ioport("DSW")->read() & 0x04);
- sw2 = (space.machine().root_device().ioport("DSW")->read() & 0x02);
+ speed_sw = (machine().root_device().ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00;
+ sw5 = (machine().root_device().ioport("DSW")->read() & 0x10);
+ sw4 = (machine().root_device().ioport("DSW")->read() & 0x08);
+ sw3 = (machine().root_device().ioport("DSW")->read() & 0x04);
+ sw2 = (machine().root_device().ioport("DSW")->read() & 0x02);
return 0xc1 | sw5 | sw4 | sw3 | sw2 | speed_sw;
}
-static READ8_DEVICE_HANDLER( r232_ctrl_portb_r )
+READ8_MEMBER(pc88va_state::r232_ctrl_portb_r)
{
UINT8 xsw1;
- xsw1 = (space.machine().root_device().ioport("DSW")->read() & 1) ? 0 : 8;
+ xsw1 = (machine().root_device().ioport("DSW")->read() & 1) ? 0 : 8;
return 0xf7 | xsw1;
}
-static READ8_DEVICE_HANDLER( r232_ctrl_portc_r )
+READ8_MEMBER(pc88va_state::r232_ctrl_portc_r)
{
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( r232_ctrl_porta_w )
+WRITE8_MEMBER(pc88va_state::r232_ctrl_porta_w)
{
// ...
}
-static WRITE8_DEVICE_HANDLER( r232_ctrl_portb_w )
+WRITE8_MEMBER(pc88va_state::r232_ctrl_portb_w)
{
// ...
}
-static WRITE8_DEVICE_HANDLER( r232_ctrl_portc_w )
+WRITE8_MEMBER(pc88va_state::r232_ctrl_portc_w)
{
// ...
}
static I8255_INTERFACE( r232c_ctrl_intf )
{
- DEVCB_HANDLER(r232_ctrl_porta_r), /* Port A read */
- DEVCB_HANDLER(r232_ctrl_porta_w), /* Port A write */
- DEVCB_HANDLER(r232_ctrl_portb_r), /* Port B read */
- DEVCB_HANDLER(r232_ctrl_portb_w), /* Port B write */
- DEVCB_HANDLER(r232_ctrl_portc_r), /* Port C read */
- DEVCB_HANDLER(r232_ctrl_portc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_porta_r), /* Port A read */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_porta_w), /* Port A write */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portb_w), /* Port B write */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portc_r), /* Port C read */
+ DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portc_w) /* Port C write */
};
static IRQ_CALLBACK(pc88va_irq_callback)
@@ -1501,25 +1511,25 @@ static IRQ_CALLBACK(pc88va_irq_callback)
return pic8259_acknowledge( device->machine().device( "pic8259_master" ) );
}
-static WRITE_LINE_DEVICE_HANDLER( pc88va_pic_irq )
+WRITE_LINE_MEMBER(pc88va_state::pc88va_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 READ8_DEVICE_HANDLER( get_slave_ack )
+READ8_MEMBER(pc88va_state::get_slave_ack)
{
if (offset==7) { // IRQ = 7
- return pic8259_acknowledge(space.machine().device( "pic8259_slave"));
+ return pic8259_acknowledge(machine().device( "pic8259_slave"));
}
return 0x00;
}
static const struct pic8259_interface pc88va_pic8259_master_config =
{
- DEVCB_LINE(pc88va_pic_irq),
+ DEVCB_DRIVER_LINE_MEMBER(pc88va_state, pc88va_pic_irq),
DEVCB_LINE_VCC,
- DEVCB_HANDLER(get_slave_ack)
+ DEVCB_DRIVER_MEMBER(pc88va_state,get_slave_ack)
};
static const struct pic8259_interface pc88va_pic8259_slave_config =
@@ -1592,9 +1602,9 @@ static const floppy_interface pc88va_floppy_interface =
};
-static WRITE_LINE_DEVICE_HANDLER( pc88va_pit_out0_changed )
+WRITE_LINE_MEMBER(pc88va_state::pc88va_pit_out0_changed)
{
- pic8259_ir0_w(device->machine().device("pic8259_master"), 1);
+ pic8259_ir0_w(machine().device("pic8259_master"), 1);
}
static const struct pit8253_config pc88va_pit8253_config =
@@ -1604,7 +1614,7 @@ static const struct pit8253_config pc88va_pit8253_config =
/* general purpose timer 1 */
8000000,
DEVCB_NULL,
- DEVCB_LINE(pc88va_pit_out0_changed)
+ DEVCB_DRIVER_LINE_MEMBER(pc88va_state, pc88va_pit_out0_changed)
},
{
/* BEEP frequency setting */
@@ -1622,18 +1632,17 @@ static const struct pit8253_config pc88va_pit8253_config =
};
-static WRITE_LINE_DEVICE_HANDLER(pc88va_upd765_interrupt)
+WRITE_LINE_MEMBER(pc88va_state::pc88va_upd765_interrupt)
{
- pc88va_state *drvstate = device->machine().driver_data<pc88va_state>();
- if(drvstate->m_fdc_mode)
- pic8259_ir3_w(device->machine().device( "pic8259_slave"), state);
+ if(m_fdc_mode)
+ pic8259_ir3_w(machine().device( "pic8259_slave"), state);
else
- device->machine().device("fdccpu")->execute().set_input_line(0, HOLD_LINE);
+ machine().device("fdccpu")->execute().set_input_line(0, HOLD_LINE);
};
static const struct upd765_interface pc88va_upd765_interface =
{
- DEVCB_LINE(pc88va_upd765_interrupt),
+ DEVCB_DRIVER_LINE_MEMBER(pc88va_state, pc88va_upd765_interrupt),
DEVCB_NULL, //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index 7f70ce08eab..f6a49d5eb13 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -418,6 +418,28 @@ public:
INTERRUPT_GEN_MEMBER(pc9801_vrtc_irq);
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
DECLARE_INPUT_CHANGED_MEMBER(shift_stroke);
+ DECLARE_WRITE_LINE_MEMBER(pc9801_master_set_int_line);
+ DECLARE_READ8_MEMBER(get_slave_ack);
+ DECLARE_WRITE_LINE_MEMBER(pc_dma_hrq_changed);
+ 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_READ8_MEMBER(test_r);
+ DECLARE_WRITE8_MEMBER(test_w);
+ DECLARE_READ8_MEMBER(ppi_sys_porta_r);
+ DECLARE_READ8_MEMBER(ppi_sys_portb_r);
+ DECLARE_READ8_MEMBER(ppi_prn_portb_r);
+ DECLARE_WRITE8_MEMBER(ppi_sys_portc_w);
+ DECLARE_READ8_MEMBER(ppi_fdd_porta_r);
+ DECLARE_READ8_MEMBER(ppi_fdd_portb_r);
+ DECLARE_READ8_MEMBER(ppi_fdd_portc_r);
+ DECLARE_WRITE8_MEMBER(ppi_fdd_portc_w);
+ DECLARE_WRITE_LINE_MEMBER(fdc_2hd_irq);
+ DECLARE_WRITE_LINE_MEMBER(fdc_2hd_drq);
+ DECLARE_WRITE_LINE_MEMBER(fdc_2dd_irq);
+ DECLARE_WRITE_LINE_MEMBER(fdc_2dd_drq);
+ DECLARE_WRITE_LINE_MEMBER(pc9801rs_fdc_irq);
};
@@ -2198,25 +2220,25 @@ ir7
*/
-static WRITE_LINE_DEVICE_HANDLER( pc9801_master_set_int_line )
+WRITE_LINE_MEMBER(pc9801_state::pc9801_master_set_int_line)
{
//printf("%02x\n",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 READ8_DEVICE_HANDLER( get_slave_ack )
+READ8_MEMBER(pc9801_state::get_slave_ack)
{
if (offset==7) { // IRQ = 7
- return pic8259_acknowledge( space.machine().device( "pic8259_slave" ));
+ return pic8259_acknowledge( machine().device( "pic8259_slave" ));
}
return 0x00;
}
static const struct pic8259_interface pic8259_master_config =
{
- DEVCB_LINE(pc9801_master_set_int_line),
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc9801_master_set_int_line),
DEVCB_LINE_VCC,
- DEVCB_HANDLER(get_slave_ack)
+ DEVCB_DRIVER_MEMBER(pc9801_state,get_slave_ack)
};
static const struct pic8259_interface pic8259_slave_config =
@@ -2276,12 +2298,12 @@ static const struct pit8253_config pc9801rs_pit8253_config =
*
****************************************/
-static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
+WRITE_LINE_MEMBER(pc9801_state::pc_dma_hrq_changed)
{
- device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ machine().device("maincpu")->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"), state );
}
@@ -2302,38 +2324,38 @@ WRITE8_MEMBER(pc9801_state::pc_dma_write_byte)
space.write_byte(page_offset + offset, data);
}
-static void set_dma_channel(device_t *device, int channel, int state)
+static void set_dma_channel(running_machine &machine, int channel, int state)
{
- pc9801_state *drvstate = device->machine().driver_data<pc9801_state>();
+ pc9801_state *drvstate = machine.driver_data<pc9801_state>();
if (!state) drvstate->m_dma_channel = channel;
}
-static WRITE_LINE_DEVICE_HANDLER( pc_dack0_w ) { /*printf("%02x 0\n",state);*/ set_dma_channel(device, 0, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack1_w ) { /*printf("%02x 1\n",state);*/ set_dma_channel(device, 1, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack2_w ) { /*printf("%02x 2\n",state);*/ set_dma_channel(device, 2, state); }
-static WRITE_LINE_DEVICE_HANDLER( pc_dack3_w ) { /*printf("%02x 3\n",state);*/ set_dma_channel(device, 3, state); }
+WRITE_LINE_MEMBER(pc9801_state::pc_dack0_w){ /*printf("%02x 0\n",state);*/ set_dma_channel(machine(), 0, state); }
+WRITE_LINE_MEMBER(pc9801_state::pc_dack1_w){ /*printf("%02x 1\n",state);*/ set_dma_channel(machine(), 1, state); }
+WRITE_LINE_MEMBER(pc9801_state::pc_dack2_w){ /*printf("%02x 2\n",state);*/ set_dma_channel(machine(), 2, state); }
+WRITE_LINE_MEMBER(pc9801_state::pc_dack3_w){ /*printf("%02x 3\n",state);*/ set_dma_channel(machine(), 3, state); }
-static READ8_DEVICE_HANDLER( test_r )
+READ8_MEMBER(pc9801_state::test_r)
{
printf("2dd DACK R\n");
return 0xff;
}
-static WRITE8_DEVICE_HANDLER( test_w )
+WRITE8_MEMBER(pc9801_state::test_w)
{
printf("2dd DACK W\n");
}
static I8237_INTERFACE( dma8237_config )
{
- DEVCB_LINE(pc_dma_hrq_changed),
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc_dma_hrq_changed),
DEVCB_NULL,
DEVCB_DRIVER_MEMBER(pc9801_state, pc_dma_read_byte),
DEVCB_DRIVER_MEMBER(pc9801_state, pc_dma_write_byte),
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(test_r) },
- { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(test_w) },
- { 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_NULL, DEVCB_DRIVER_MEMBER(pc9801_state,test_r) },
+ { DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(pc9801_state,test_w) },
+ { DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc_dack0_w), DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc_dack1_w), DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc_dack2_w), DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc_dack3_w) }
};
/****************************************
@@ -2342,63 +2364,63 @@ static I8237_INTERFACE( dma8237_config )
*
****************************************/
-static READ8_DEVICE_HANDLER( ppi_sys_porta_r ) { return device->machine().root_device().ioport("DSW2")->read(); }
-static READ8_DEVICE_HANDLER( ppi_sys_portb_r ) { return device->machine().root_device().ioport("DSW1")->read() & 0xff; }
-static READ8_DEVICE_HANDLER( ppi_prn_portb_r ) { return device->machine().root_device().ioport("DSW1")->read() >> 8; }
+READ8_MEMBER(pc9801_state::ppi_sys_porta_r){ return machine().root_device().ioport("DSW2")->read(); }
+READ8_MEMBER(pc9801_state::ppi_sys_portb_r){ return machine().root_device().ioport("DSW1")->read() & 0xff; }
+READ8_MEMBER(pc9801_state::ppi_prn_portb_r){ return machine().root_device().ioport("DSW1")->read() >> 8; }
-static WRITE8_DEVICE_HANDLER( ppi_sys_portc_w )
+WRITE8_MEMBER(pc9801_state::ppi_sys_portc_w)
{
- beep_set_state(space.machine().device(BEEPER_TAG),!(data & 0x08));
+ beep_set_state(machine().device(BEEPER_TAG),!(data & 0x08));
}
static I8255A_INTERFACE( ppi_system_intf )
{
- DEVCB_HANDLER(ppi_sys_porta_r), /* Port A read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_sys_porta_r), /* Port A read */
DEVCB_NULL, /* Port A write */
- DEVCB_HANDLER(ppi_sys_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_sys_portb_r), /* Port B read */
DEVCB_NULL, /* Port B write */
DEVCB_NULL, /* Port C read */
- DEVCB_HANDLER(ppi_sys_portc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_sys_portc_w) /* Port C write */
};
static I8255A_INTERFACE( ppi_printer_intf )
{
DEVCB_NULL, /* Port A read */
DEVCB_NULL, /* Port A write */
- DEVCB_HANDLER(ppi_prn_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_prn_portb_r), /* Port B read */
DEVCB_NULL, /* Port B write */
DEVCB_NULL, /* Port C read */
DEVCB_NULL /* Port C write */
};
-static READ8_DEVICE_HANDLER( ppi_fdd_porta_r )
+READ8_MEMBER(pc9801_state::ppi_fdd_porta_r)
{
return 0xff;
}
-static READ8_DEVICE_HANDLER( ppi_fdd_portb_r )
+READ8_MEMBER(pc9801_state::ppi_fdd_portb_r)
{
- return 0xff; //upd765_status_r(space.machine().device("upd765_2dd"),space, 0);
+ return 0xff; //upd765_status_r(machine().device("upd765_2dd"),space, 0);
}
-static READ8_DEVICE_HANDLER( ppi_fdd_portc_r )
+READ8_MEMBER(pc9801_state::ppi_fdd_portc_r)
{
- return 0xff; //upd765_data_r(space.machine().device("upd765_2dd"),space, 0);
+ return 0xff; //upd765_data_r(machine().device("upd765_2dd"),space, 0);
}
-static WRITE8_DEVICE_HANDLER( ppi_fdd_portc_w )
+WRITE8_MEMBER(pc9801_state::ppi_fdd_portc_w)
{
- //upd765_data_w(space.machine().device("upd765_2dd"),space, 0,data);
+ //upd765_data_w(machine().device("upd765_2dd"),space, 0,data);
}
static I8255A_INTERFACE( ppi_fdd_intf )
{
- DEVCB_HANDLER(ppi_fdd_porta_r), /* Port A read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_fdd_porta_r), /* Port A read */
DEVCB_NULL, /* Port A write */
- DEVCB_HANDLER(ppi_fdd_portb_r), /* Port B read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_fdd_portb_r), /* Port B read */
DEVCB_NULL, /* Port B write */
- DEVCB_HANDLER(ppi_fdd_portc_r), /* Port C read */
- DEVCB_HANDLER(ppi_fdd_portc_w) /* Port C write */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_fdd_portc_r), /* Port C read */
+ DEVCB_DRIVER_MEMBER(pc9801_state,ppi_fdd_portc_w) /* Port C write */
};
/****************************************
@@ -2407,39 +2429,38 @@ static I8255A_INTERFACE( ppi_fdd_intf )
*
****************************************/
-static WRITE_LINE_DEVICE_HANDLER( fdc_2hd_irq )
+WRITE_LINE_MEMBER(pc9801_state::fdc_2hd_irq)
{
printf("IRQ %d\n",state);
//if(state)
- // pic8259_ir3_w(device->machine().device("pic8259_slave"), state);
+ // pic8259_ir3_w(machine().device("pic8259_slave"), state);
}
-static WRITE_LINE_DEVICE_HANDLER( fdc_2hd_drq )
+WRITE_LINE_MEMBER(pc9801_state::fdc_2hd_drq)
{
printf("%02x DRQ\n",state);
}
-static WRITE_LINE_DEVICE_HANDLER( fdc_2dd_irq )
+WRITE_LINE_MEMBER(pc9801_state::fdc_2dd_irq)
{
- pc9801_state *drvstate = device->machine().driver_data<pc9801_state>();
printf("IRQ %d\n",state);
- if(drvstate->m_fdc_2dd_ctrl & 8)
+ if(m_fdc_2dd_ctrl & 8)
{
- pic8259_ir2_w(device->machine().device("pic8259_slave"), state);
+ pic8259_ir2_w(machine().device("pic8259_slave"), state);
}
}
-static WRITE_LINE_DEVICE_HANDLER( fdc_2dd_drq )
+WRITE_LINE_MEMBER(pc9801_state::fdc_2dd_drq)
{
printf("%02x DRQ\n",state);
}
static const struct upd765_interface upd765_2hd_intf =
{
- DEVCB_LINE(fdc_2hd_irq),
- DEVCB_LINE(fdc_2hd_drq), //DRQ, TODO
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2hd_irq),
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2hd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, NULL, NULL}
@@ -2447,29 +2468,28 @@ static const struct upd765_interface upd765_2hd_intf =
static const struct upd765_interface upd765_2dd_intf =
{
- DEVCB_LINE(fdc_2dd_irq),
- DEVCB_LINE(fdc_2dd_drq), //DRQ, TODO
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_irq),
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{NULL, NULL, NULL, NULL}
};
-static WRITE_LINE_DEVICE_HANDLER( pc9801rs_fdc_irq )
+WRITE_LINE_MEMBER(pc9801_state::pc9801rs_fdc_irq)
{
- pc9801_state *drvstate = device->machine().driver_data<pc9801_state>();
/* 0xffaf8 */
- if(drvstate->m_fdc_ctrl & 1)
- pic8259_ir3_w(device->machine().device("pic8259_slave"), state);
+ if(m_fdc_ctrl & 1)
+ pic8259_ir3_w(machine().device("pic8259_slave"), state);
else
- pic8259_ir2_w(device->machine().device("pic8259_slave"), state);
+ pic8259_ir2_w(machine().device("pic8259_slave"), state);
}
static const struct upd765_interface pc9801rs_upd765_intf =
{
- DEVCB_LINE(pc9801rs_fdc_irq),
- DEVCB_LINE(fdc_2dd_drq), //DRQ, TODO
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, pc9801rs_fdc_irq),
+ DEVCB_DRIVER_LINE_MEMBER(pc9801_state, fdc_2dd_drq), //DRQ, TODO
NULL,
UPD765_RDY_PIN_CONNECTED,
{FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3}
diff --git a/src/mess/drivers/pk8000.c b/src/mess/drivers/pk8000.c
index d0ff985aacc..6122e21e1a2 100644
--- a/src/mess/drivers/pk8000.c
+++ b/src/mess/drivers/pk8000.c
@@ -31,6 +31,12 @@ public:
virtual void video_start();
UINT32 screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(pk8000_interrupt);
+ DECLARE_WRITE8_MEMBER(pk8000_80_porta_w);
+ DECLARE_READ8_MEMBER(pk8000_80_portb_r);
+ DECLARE_WRITE8_MEMBER(pk8000_80_portc_w);
+ DECLARE_READ8_MEMBER(pk8000_84_porta_r);
+ DECLARE_WRITE8_MEMBER(pk8000_84_porta_w);
+ DECLARE_WRITE8_MEMBER(pk8000_84_portc_w);
};
@@ -100,66 +106,64 @@ static void pk8000_set_bank(running_machine &machine,UINT8 data)
break;
}
}
-static WRITE8_DEVICE_HANDLER(pk8000_80_porta_w)
+WRITE8_MEMBER(pk8000_state::pk8000_80_porta_w)
{
- pk8000_set_bank(space.machine(),data);
+ pk8000_set_bank(machine(),data);
}
-static READ8_DEVICE_HANDLER(pk8000_80_portb_r)
+READ8_MEMBER(pk8000_state::pk8000_80_portb_r)
{
- pk8000_state *state = space.machine().driver_data<pk8000_state>();
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
- if(state->m_keyboard_line>9) {
+ if(m_keyboard_line>9) {
return 0xff;
}
- return space.machine().root_device().ioport(keynames[state->m_keyboard_line])->read();
+ return machine().root_device().ioport(keynames[m_keyboard_line])->read();
}
-static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w)
+WRITE8_MEMBER(pk8000_state::pk8000_80_portc_w)
{
- pk8000_state *state = space.machine().driver_data<pk8000_state>();
- state->m_keyboard_line = data & 0x0f;
+ m_keyboard_line = data & 0x0f;
- speaker_level_w(space.machine().device(SPEAKER_TAG), BIT(data,7));
+ speaker_level_w(machine().device(SPEAKER_TAG), BIT(data,7));
- cassette_device_image(space.machine())->change_state(
+ cassette_device_image(machine())->change_state(
(BIT(data,4)) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MASK_MOTOR);
- cassette_device_image(space.machine())->output((BIT(data,6)) ? +1.0 : 0.0);
+ cassette_device_image(machine())->output((BIT(data,6)) ? +1.0 : 0.0);
}
static I8255_INTERFACE( pk8000_ppi8255_interface_1 )
{
DEVCB_NULL,
- DEVCB_HANDLER(pk8000_80_porta_w),
- DEVCB_HANDLER(pk8000_80_portb_r),
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_80_porta_w),
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_80_portb_r),
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pk8000_80_portc_w)
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_80_portc_w)
};
-static READ8_DEVICE_HANDLER(pk8000_84_porta_r)
+READ8_MEMBER(pk8000_state::pk8000_84_porta_r)
{
return pk8000_video_mode;
}
-static WRITE8_DEVICE_HANDLER(pk8000_84_porta_w)
+WRITE8_MEMBER(pk8000_state::pk8000_84_porta_w)
{
pk8000_video_mode = data;
}
-static WRITE8_DEVICE_HANDLER(pk8000_84_portc_w)
+WRITE8_MEMBER(pk8000_state::pk8000_84_portc_w)
{
pk8000_video_enable = BIT(data,4);
}
static I8255_INTERFACE( pk8000_ppi8255_interface_2 )
{
- DEVCB_HANDLER(pk8000_84_porta_r),
- DEVCB_HANDLER(pk8000_84_porta_w),
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_84_porta_r),
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_84_porta_w),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_HANDLER(pk8000_84_portc_w)
+ DEVCB_DRIVER_MEMBER(pk8000_state,pk8000_84_portc_w)
};
READ8_MEMBER(pk8000_state::pk8000_joy_1_r)
diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c
index 58c49dc3753..6e44e8bd366 100644
--- a/src/mess/drivers/px4.c
+++ b/src/mess/drivers/px4.c
@@ -172,6 +172,17 @@ public:
TIMER_CALLBACK_MEMBER(receive_data);
TIMER_DEVICE_CALLBACK_MEMBER(frc_tick);
TIMER_DEVICE_CALLBACK_MEMBER(upd7508_1sec_callback);
+ void px4_sio_txd(device_t *device,int state);
+ int px4_sio_rxd(device_t *device);
+ int px4_sio_pin(device_t *device);
+ void px4_sio_pout(device_t *device,int state);
+ void px4_rs232c_txd(device_t *device,int state);
+ int px4_rs232c_rxd(device_t *device);
+ void px4_rs232c_rts(device_t *device,int state);
+ int px4_rs232c_cts(device_t *device);
+ int px4_rs232c_dsr(device_t *device);
+ void px4_rs232c_dtr(device_t *device,int state);
+ int px4_rs232c_dcd(device_t *device);
};
@@ -181,7 +192,7 @@ public:
/* The floppy is connected to this port */
-static WRITE_LINE_DEVICE_HANDLER( px4_sio_txd )
+void px4_state::px4_sio_txd(device_t *device,int state)
{
if (VERBOSE)
logerror("px4_sio_txd: %d\n", state);
@@ -190,7 +201,7 @@ static WRITE_LINE_DEVICE_HANDLER( px4_sio_txd )
tf20_txs_w(device, state);
}
-static READ_LINE_DEVICE_HANDLER( px4_sio_rxd )
+int px4_state::px4_sio_rxd(device_t *device)
{
if (VERBOSE)
logerror("px4_sio_rxd\n");
@@ -201,7 +212,7 @@ static READ_LINE_DEVICE_HANDLER( px4_sio_rxd )
return ASSERT_LINE;
}
-static READ_LINE_DEVICE_HANDLER( px4_sio_pin )
+int px4_state::px4_sio_pin(device_t *device)
{
if (VERBOSE)
logerror("px4_sio_pin\n");
@@ -212,7 +223,7 @@ static READ_LINE_DEVICE_HANDLER( px4_sio_pin )
return ASSERT_LINE;
}
-static WRITE_LINE_DEVICE_HANDLER( px4_sio_pout )
+void px4_state::px4_sio_pout(device_t *device,int state)
{
if (VERBOSE)
logerror("px4_sio_pout: %d\n", state);
@@ -228,14 +239,14 @@ static WRITE_LINE_DEVICE_HANDLER( px4_sio_pout )
/* Currently nothing is connected to this port */
-static WRITE_LINE_DEVICE_HANDLER( px4_rs232c_txd )
+void px4_state::px4_rs232c_txd(device_t *device,int state)
{
if (VERBOSE)
logerror("px4_rs232c_txd: %d\n", state);
}
#ifdef UNUSED_FUNCTION
-static READ_LINE_DEVICE_HANDLER( px4_rs232c_rxd )
+int px4_state::px4_rs232c_rxd(device_t *device)
{
if (VERBOSE)
logerror("px4_rs232c_rxd\n");
@@ -243,13 +254,13 @@ static READ_LINE_DEVICE_HANDLER( px4_rs232c_rxd )
}
#endif
-static WRITE_LINE_DEVICE_HANDLER( px4_rs232c_rts )
+void px4_state::px4_rs232c_rts(device_t *device,int state)
{
if (VERBOSE)
logerror("px4_rs232c_rts: %d\n", state);
}
-static READ_LINE_DEVICE_HANDLER( px4_rs232c_cts )
+int px4_state::px4_rs232c_cts(device_t *device)
{
if (VERBOSE)
logerror("px4_rs232c_cts\n");
@@ -257,7 +268,7 @@ static READ_LINE_DEVICE_HANDLER( px4_rs232c_cts )
return ASSERT_LINE;
}
-static READ_LINE_DEVICE_HANDLER( px4_rs232c_dsr )
+int px4_state::px4_rs232c_dsr(device_t *device)
{
if (VERBOSE)
logerror("px4_rs232c_dsr\n");
@@ -265,13 +276,13 @@ static READ_LINE_DEVICE_HANDLER( px4_rs232c_dsr )
return ASSERT_LINE;
}
-static WRITE_LINE_DEVICE_HANDLER( px4_rs232c_dtr )
+void px4_state::px4_rs232c_dtr(device_t *device,int state)
{
if (VERBOSE)
logerror("px4_rs232c_dtr: %d\n", state);
}
-static READ_LINE_DEVICE_HANDLER( px4_rs232c_dcd )
+int px4_state::px4_rs232c_dcd(device_t *device)
{
if (VERBOSE)
logerror("px4_rs232c_dcd\n");
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index 01c1d87dd82..f47e75b4c15 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -140,6 +140,7 @@ public:
virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
+ DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
};
static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
@@ -349,8 +350,9 @@ READ8_MEMBER( qx10_state::qx10_30_r )
/*
DMA8237
*/
-WRITE_LINE_DEVICE_HANDLER( dma_hrq_changed )
+WRITE_LINE_MEMBER(qx10_state::dma_hrq_changed)
{
+ device_t *device = machine().device("8237dma_1");
/* Assert HLDA */
i8237_hlda_w(device, state);
}
@@ -383,7 +385,7 @@ static void memory_write_byte(address_space &space, offs_t address, UINT8 data,
static I8237_INTERFACE( qx10_dma8237_1_interface )
{
- DEVCB_DEVICE_LINE("8237dma_1", dma_hrq_changed),
+ DEVCB_DRIVER_LINE_MEMBER(qx10_state,dma_hrq_changed),
DEVCB_DRIVER_LINE_MEMBER(qx10_state, tc_w),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_read_byte),
DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, memory_write_byte),
diff --git a/src/mess/drivers/rvoice.c b/src/mess/drivers/rvoice.c
index cf165b32f1c..66f1a036e31 100644
--- a/src/mess/drivers/rvoice.c
+++ b/src/mess/drivers/rvoice.c
@@ -81,6 +81,7 @@ public:
DECLARE_WRITE8_MEMBER(main_hd63701_internal_registers_w);
DECLARE_DRIVER_INIT(rvoicepc);
virtual void machine_reset();
+ DECLARE_WRITE8_MEMBER(null_kbd_put);
};
@@ -347,13 +348,13 @@ INPUT_PORTS_END
/******************************************************************************
Machine Drivers
******************************************************************************/
-static WRITE8_DEVICE_HANDLER( null_kbd_put )
+WRITE8_MEMBER(rvoice_state::null_kbd_put)
{
}
static GENERIC_TERMINAL_INTERFACE( dectalk_terminal_intf )
{
- DEVCB_HANDLER(null_kbd_put)
+ DEVCB_DRIVER_MEMBER(rvoice_state,null_kbd_put)
};
static MACHINE_CONFIG_START( rvoicepc, rvoice_state )
diff --git a/src/mess/drivers/sgi_ip2.c b/src/mess/drivers/sgi_ip2.c
index 4d41927bc90..5bfd414368f 100644
--- a/src/mess/drivers/sgi_ip2.c
+++ b/src/mess/drivers/sgi_ip2.c
@@ -103,6 +103,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
INTERRUPT_GEN_MEMBER(sgi_ip2_vbl);
+ DECLARE_WRITE8_MEMBER(sgi_kbd_put);
};
@@ -357,14 +358,14 @@ WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_stklmt_w)
COMBINE_DATA(&m_stklmt);
}
-static WRITE8_DEVICE_HANDLER( sgi_kbd_put )
+WRITE8_MEMBER(sgi_ip2_state::sgi_kbd_put)
{
- duart68681_rx_data(space.machine().device("duart68681a"), 1, data);
+ duart68681_rx_data(machine().device("duart68681a"), 1, data);
}
static GENERIC_TERMINAL_INTERFACE( sgi_terminal_intf )
{
- DEVCB_HANDLER(sgi_kbd_put)
+ DEVCB_DRIVER_MEMBER(sgi_ip2_state,sgi_kbd_put)
};
diff --git a/src/mess/drivers/smc777.c b/src/mess/drivers/smc777.c
index ba08b0c281b..dd682ee1779 100644
--- a/src/mess/drivers/smc777.c
+++ b/src/mess/drivers/smc777.c
@@ -89,6 +89,8 @@ public:
UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
TIMER_DEVICE_CALLBACK_MEMBER(keyboard_callback);
+ DECLARE_WRITE_LINE_MEMBER(smc777_fdc_intrq_w);
+ DECLARE_WRITE_LINE_MEMBER(smc777_fdc_drq_w);
};
@@ -414,16 +416,14 @@ WRITE8_MEMBER(smc777_state::smc777_fdc1_w)
}
}
-static WRITE_LINE_DEVICE_HANDLER( smc777_fdc_intrq_w )
+WRITE_LINE_MEMBER(smc777_state::smc777_fdc_intrq_w)
{
- smc777_state *drvstate = device->machine().driver_data<smc777_state>();
- drvstate->m_fdc_irq_flag = state;
+ m_fdc_irq_flag = state;
}
-static WRITE_LINE_DEVICE_HANDLER( smc777_fdc_drq_w )
+WRITE_LINE_MEMBER(smc777_state::smc777_fdc_drq_w)
{
- smc777_state *drvstate = device->machine().driver_data<smc777_state>();
- drvstate->m_fdc_drq_flag = state;
+ m_fdc_drq_flag = state;
}
READ8_MEMBER(smc777_state::key_r)
@@ -1020,8 +1020,8 @@ void smc777_state::palette_init()
static const wd17xx_interface smc777_mb8876_interface =
{
DEVCB_NULL,
- DEVCB_LINE(smc777_fdc_intrq_w),
- DEVCB_LINE(smc777_fdc_drq_w),
+ DEVCB_DRIVER_LINE_MEMBER(smc777_state, smc777_fdc_intrq_w),
+ DEVCB_DRIVER_LINE_MEMBER(smc777_state, smc777_fdc_drq_w),
{FLOPPY_0, FLOPPY_1, NULL, NULL}
};
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index a90725db65d..f831bd9ce62 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -39,6 +39,9 @@ public:
DECLARE_READ8_MEMBER(spc1000_video_ram_r);
DECLARE_READ8_MEMBER(spc1000_keyboard_r);
virtual void machine_reset();
+ DECLARE_WRITE8_MEMBER(spc1000_gmode_w);
+ DECLARE_READ8_MEMBER(spc1000_gmode_r);
+ DECLARE_READ8_MEMBER(spc1000_mc6847_videoram_r);
};
@@ -98,29 +101,27 @@ READ8_MEMBER(spc1000_state::spc1000_keyboard_r){
return ioport(keynames[offset])->read();
}
-static WRITE8_DEVICE_HANDLER(spc1000_gmode_w)
+WRITE8_MEMBER(spc1000_state::spc1000_gmode_w)
{
- spc1000_state *state = space.machine().driver_data<spc1000_state>();
- state->m_GMODE = data;
+ m_GMODE = data;
- // state->m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
+ // m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
// [PS2,PS1] is used to set screen 0/1 pages
- state->m_vdg->gm1_w(BIT(data, 1));
- state->m_vdg->gm0_w(BIT(data, 2));
- state->m_vdg->ag_w(BIT(data, 3));
- state->m_vdg->css_w(BIT(data, 7));
+ m_vdg->gm1_w(BIT(data, 1));
+ m_vdg->gm0_w(BIT(data, 2));
+ m_vdg->ag_w(BIT(data, 3));
+ m_vdg->css_w(BIT(data, 7));
}
-static READ8_DEVICE_HANDLER(spc1000_gmode_r)
+READ8_MEMBER(spc1000_state::spc1000_gmode_r)
{
- spc1000_state *state = space.machine().driver_data<spc1000_state>();
- return state->m_GMODE;
+ return m_GMODE;
}
static ADDRESS_MAP_START( spc1000_io , AS_IO, 8, spc1000_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x0000, 0x1fff) AM_READWRITE(spc1000_video_ram_r, spc1000_video_ram_w)
- AM_RANGE(0x2000, 0x3fff) AM_DEVREADWRITE_LEGACY("mc6847", spc1000_gmode_r, spc1000_gmode_w)
+ AM_RANGE(0x2000, 0x3fff) AM_READWRITE(spc1000_gmode_r, spc1000_gmode_w)
AM_RANGE(0x8000, 0x8009) AM_READ(spc1000_keyboard_r)
AM_RANGE(0xA000, 0xA000) AM_READWRITE(spc1000_iplk_r, spc1000_iplk_w)
AM_RANGE(0x4000, 0x4000) AM_DEVWRITE_LEGACY("ay8910", ay8910_address_w)
@@ -242,22 +243,21 @@ void spc1000_state::machine_reset()
m_IPLK = 1;
}
-static READ8_DEVICE_HANDLER( spc1000_mc6847_videoram_r )
+READ8_MEMBER(spc1000_state::spc1000_mc6847_videoram_r)
{
- spc1000_state *state = space.machine().driver_data<spc1000_state>();
if (offset == ~0) return 0xff;
- // state->m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
+ // m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
// [PS2,PS1] is used to set screen 0/1 pages
- if ( !BIT(state->m_GMODE, 3) ) { // text mode (~A/G set to A)
- unsigned int page = (BIT(state->m_GMODE, 5) << 1) | BIT(state->m_GMODE, 4);
- state->m_vdg->inv_w(BIT(state->m_video_ram[offset+page*0x200+0x800], 0));
- state->m_vdg->css_w(BIT(state->m_video_ram[offset+page*0x200+0x800], 1));
- state->m_vdg->as_w(BIT(state->m_video_ram[offset+page*0x200+0x800], 2));
- state->m_vdg->intext_w(BIT(state->m_video_ram[offset+page*0x200+0x800], 3));
- return state->m_video_ram[offset+page*0x200];
+ if ( !BIT(m_GMODE, 3) ) { // text mode (~A/G set to A)
+ unsigned int page = (BIT(m_GMODE, 5) << 1) | BIT(m_GMODE, 4);
+ m_vdg->inv_w(BIT(m_video_ram[offset+page*0x200+0x800], 0));
+ m_vdg->css_w(BIT(m_video_ram[offset+page*0x200+0x800], 1));
+ m_vdg->as_w(BIT(m_video_ram[offset+page*0x200+0x800], 2));
+ m_vdg->intext_w(BIT(m_video_ram[offset+page*0x200+0x800], 3));
+ return m_video_ram[offset+page*0x200];
} else { // graphics mode: uses full 6KB of VRAM
- return state->m_video_ram[offset];
+ return m_video_ram[offset];
}
}
@@ -280,7 +280,7 @@ static const cassette_interface spc1000_cassette_interface =
static const mc6847_interface spc1000_mc6847_intf =
{
"screen",
- DEVCB_HANDLER(spc1000_mc6847_videoram_r), // data fetch
+ DEVCB_DRIVER_MEMBER(spc1000_state,spc1000_mc6847_videoram_r), // data fetch
DEVCB_NULL,
DEVCB_NULL,
diff --git a/src/mess/drivers/vk100.c b/src/mess/drivers/vk100.c
index 2cf4858f462..277907f7301 100644
--- a/src/mess/drivers/vk100.c
+++ b/src/mess/drivers/vk100.c
@@ -193,6 +193,10 @@ public:
virtual void machine_reset();
virtual void video_start();
TIMER_CALLBACK_MEMBER(execute_vg);
+ DECLARE_WRITE_LINE_MEMBER(crtc_vsync);
+ DECLARE_WRITE_LINE_MEMBER(i8251_rxrdy_int);
+ DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
+ DECLARE_WRITE_LINE_MEMBER(i8251_rts);
};
// vram access functions:
@@ -873,31 +877,27 @@ void vk100_state::machine_reset()
m_TXDivisor = 6336;
}
-static WRITE_LINE_DEVICE_HANDLER(crtc_vsync)
+WRITE_LINE_MEMBER(vk100_state::crtc_vsync)
{
- vk100_state *m_state = device->machine().driver_data<vk100_state>();
- m_state->m_maincpu->set_input_line(I8085_RST75_LINE, state? ASSERT_LINE : CLEAR_LINE);
- m_state->m_vsync = state;
+ m_maincpu->set_input_line(I8085_RST75_LINE, state? ASSERT_LINE : CLEAR_LINE);
+ m_vsync = state;
}
-static WRITE_LINE_DEVICE_HANDLER(i8251_rxrdy_int)
+WRITE_LINE_MEMBER(vk100_state::i8251_rxrdy_int)
{
- vk100_state *m_state = device->machine().driver_data<vk100_state>();
- m_state->m_maincpu->set_input_line(I8085_RST65_LINE, state?ASSERT_LINE:CLEAR_LINE);
+ m_maincpu->set_input_line(I8085_RST65_LINE, state?ASSERT_LINE:CLEAR_LINE);
}
-static WRITE_LINE_DEVICE_HANDLER(i8251_txrdy_int)
+WRITE_LINE_MEMBER(vk100_state::i8251_txrdy_int)
{
- vk100_state *m_state = device->machine().driver_data<vk100_state>();
- m_state->m_maincpu->set_input_line(I8085_RST55_LINE, state?ASSERT_LINE:CLEAR_LINE);
+ m_maincpu->set_input_line(I8085_RST55_LINE, state?ASSERT_LINE:CLEAR_LINE);
}
-static WRITE_LINE_DEVICE_HANDLER(i8251_rts)
+WRITE_LINE_MEMBER(vk100_state::i8251_rts)
{
- vk100_state *m_state = device->machine().driver_data<vk100_state>();
logerror("callback: RTS state changed to %d\n", state);
// TODO: only change this during loopback mode!
- m_state->m_ACTS = state;
+ m_ACTS = state;
}
DRIVER_INIT_MEMBER(vk100_state,vk100)
@@ -957,7 +957,7 @@ static const mc6845_interface mc6845_intf =
DEVCB_NULL,
DEVCB_NULL,
DEVCB_NULL,
- DEVCB_LINE(crtc_vsync),
+ DEVCB_DRIVER_LINE_MEMBER(vk100_state, crtc_vsync),
NULL
};
@@ -969,9 +969,9 @@ static const i8251_interface i8251_intf =
//TODO: DEVCB_DRIVER_LINE_MEMBER(vk100_state, i8251_tx), // out_txd_cb
DEVCB_NULL, // in_dsr_cb
DEVCB_NULL, // out_dtr_cb
- DEVCB_LINE(i8251_rts), // out_rts_cb
- DEVCB_LINE(i8251_rxrdy_int), // out_rxrdy_cb
- DEVCB_LINE(i8251_txrdy_int), // out_txrdy_cb
+ DEVCB_DRIVER_LINE_MEMBER(vk100_state, i8251_rts), // out_rts_cb
+ DEVCB_DRIVER_LINE_MEMBER(vk100_state, i8251_rxrdy_int), // out_rxrdy_cb
+ DEVCB_DRIVER_LINE_MEMBER(vk100_state, i8251_txrdy_int), // out_txrdy_cb
DEVCB_NULL, // out_txempty_cb
DEVCB_NULL // out_syndet_cb
};
diff --git a/src/mess/drivers/vtech1.c b/src/mess/drivers/vtech1.c
index a42fed806b7..58b01455c42 100644
--- a/src/mess/drivers/vtech1.c
+++ b/src/mess/drivers/vtech1.c
@@ -199,6 +199,9 @@ public:
DECLARE_WRITE8_MEMBER(vtech1_video_bank_w);
DECLARE_DRIVER_INIT(vtech1h);
DECLARE_DRIVER_INIT(vtech1);
+ DECLARE_READ8_MEMBER(vtech1_printer_r);
+ DECLARE_WRITE8_MEMBER(vtech1_strobe_w);
+ DECLARE_READ8_MEMBER(vtech1_mc6847_videoram_r);
};
@@ -480,16 +483,16 @@ static const floppy_interface vtech1_floppy_interface =
PRINTER
***************************************************************************/
-static READ8_DEVICE_HANDLER( vtech1_printer_r )
+READ8_MEMBER(vtech1_state::vtech1_printer_r)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
return 0xfe | centronics->busy_r();
}
/* TODO: figure out how this really works */
-static WRITE8_DEVICE_HANDLER( vtech1_strobe_w )
+WRITE8_MEMBER(vtech1_state::vtech1_strobe_w)
{
- centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics_device *centronics = machine().device<centronics_device>("centronics");
centronics->strobe_w(TRUE);
centronics->strobe_w(FALSE);
}
@@ -611,14 +614,13 @@ WRITE8_MEMBER(vtech1_state::vtech1_video_bank_w)
VIDEO EMULATION
***************************************************************************/
-static READ8_DEVICE_HANDLER( vtech1_mc6847_videoram_r )
+READ8_MEMBER(vtech1_state::vtech1_mc6847_videoram_r)
{
- vtech1_state *vtech1 = space.machine().driver_data<vtech1_state>();
if (offset == ~0) return 0xff;
- vtech1->m_mc6847->inv_w(BIT(vtech1->m_videoram[offset], 6));
- vtech1->m_mc6847->as_w(BIT(vtech1->m_videoram[offset], 7));
+ m_mc6847->inv_w(BIT(m_videoram[offset], 6));
+ m_mc6847->as_w(BIT(m_videoram[offset], 7));
- return vtech1->m_videoram[offset];
+ return m_videoram[offset];
}
@@ -733,8 +735,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( vtech1_io, AS_IO, 8, vtech1_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
- AM_RANGE(0x00, 0x00) AM_DEVREAD_LEGACY("centronics", vtech1_printer_r)
- AM_RANGE(0x0d, 0x0d) AM_DEVWRITE_LEGACY("centronics", vtech1_strobe_w)
+ AM_RANGE(0x00, 0x00) AM_READ(vtech1_printer_r)
+ AM_RANGE(0x0d, 0x0d) AM_WRITE(vtech1_strobe_w)
AM_RANGE(0x0e, 0x0e) AM_DEVWRITE("centronics", centronics_device, write)
AM_RANGE(0x10, 0x1f) AM_READWRITE(vtech1_fdc_r, vtech1_fdc_w)
AM_RANGE(0x20, 0x2f) AM_READ(vtech1_joystick_r)
@@ -912,7 +914,7 @@ static const cassette_interface laser_cassette_interface =
static const mc6847_interface vtech1_mc6847_bw_intf =
{
"screen",
- DEVCB_HANDLER(vtech1_mc6847_videoram_r),
+ DEVCB_DRIVER_MEMBER(vtech1_state,vtech1_mc6847_videoram_r),
DEVCB_NULL, /* horz sync */
DEVCB_CPU_INPUT_LINE("maincpu", 0), /* field sync */
@@ -932,7 +934,7 @@ static const mc6847_interface vtech1_mc6847_bw_intf =
static const mc6847_interface vtech1_mc6847_intf =
{
"screen",
- DEVCB_HANDLER(vtech1_mc6847_videoram_r),
+ DEVCB_DRIVER_MEMBER(vtech1_state,vtech1_mc6847_videoram_r),
DEVCB_NULL, /* horz sync */
DEVCB_CPU_INPUT_LINE("maincpu", 0), /* field sync */
@@ -952,7 +954,7 @@ static const mc6847_interface vtech1_mc6847_intf =
static const mc6847_interface vtech1_shrg_mc6847_intf =
{
"screen",
- DEVCB_HANDLER(vtech1_mc6847_videoram_r),
+ DEVCB_DRIVER_MEMBER(vtech1_state,vtech1_mc6847_videoram_r),
DEVCB_NULL, /* horz sync */
DEVCB_CPU_INPUT_LINE("maincpu", 0), /* field sync */