diff options
author | 2018-05-06 00:40:40 +1000 | |
---|---|---|
committer | 2018-05-06 00:51:27 +1000 | |
commit | 4ea3cd0bc1f54e47a0d38a47afac38101549e9ee (patch) | |
tree | bbadc20010b6bad48cf321b1c864655587e4b8ad /src/mame/drivers/einstein.cpp | |
parent | bba5127d7a73ca44fdc0dcab7286846c81206771 (diff) |
Streamline machine configuration macros - everyone's a device edition.
Start replacing special device macros with additional constructors,
starting with ISA, INTELLEC 4 and RS-232 buses.
Allow an object finder to take on the target of another object finder.
(For a combination of the previous two things in action, see either the
INTELLEC 4 driver, or the Apple 2 PC Exporter card. Also check out
looping over a device finder array to instantiate devices in some
places. Lots of things no longer need to pass tags around.)
Start supplying default clocks for things that have a standard clock or
have all clocks internal.
Eliminate the separate DEV versions of the DEVCB_ macros. Previously,
the plain versions were a shortcut for DEVICE_SELF as the target. You
can now supply a string tag (relative to current device being
configured), an object finder (takes on the base and relative tag), or
a reference to a device/interface (only do this if you know the device
won't be replaced out from under it, but that's a safe assumption for
your subdevices). In almost all cases, you can get the effect you want
by supplying *this as the target.
Eliminate sound and CPU versions of macros. They serve no useful
purpose, provide no extra checks, make error messages longer, add
indirection, and mislead newbies into thinking there's a difference.
Remove a lot of now-unnecessary ":" prefixes binding things relative to
machine root.
Clean up some miscellaneous rot.
Examples of new functionality in use in (some more subtle than others):
* src/mame/drivers/intellec4.cpp
* src/mame/drivers/tranz330.cpp
* src/mame/drivers/osboren1.cpp
* src/mame/drivers/zorba.cpp
* src/mame/devices/smioc.cpp
* src/devices/bus/a2bus/pc_xporter.cpp
* src/devices/bus/isa/isa.h
* src/devices/bus/isa/isa.h
* src/devices/bus/intellec4/intellec4.h
Diffstat (limited to 'src/mame/drivers/einstein.cpp')
-rw-r--r-- | src/mame/drivers/einstein.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/mame/drivers/einstein.cpp b/src/mame/drivers/einstein.cpp index 72a6ad4af53..0d6d33d0035 100644 --- a/src/mame/drivers/einstein.cpp +++ b/src/mame/drivers/einstein.cpp @@ -577,9 +577,9 @@ static void einstein_floppies(device_slot_interface &device) MACHINE_CONFIG_START(einstein_state::einstein) /* basic machine hardware */ - MCFG_CPU_ADD(IC_I001, Z80, XTAL_X002 / 2) - MCFG_CPU_PROGRAM_MAP(einstein_mem) - MCFG_CPU_IO_MAP(einstein_io) + MCFG_DEVICE_ADD(IC_I001, Z80, XTAL_X002 / 2) + MCFG_DEVICE_PROGRAM_MAP(einstein_mem) + MCFG_DEVICE_IO_MAP(einstein_io) MCFG_Z80_DAISY_CHAIN(einstein_daisy_chain) /* this is actually clocked at the system clock 4 MHz, but this would be too fast for our @@ -587,31 +587,31 @@ MACHINE_CONFIG_START(einstein_state::einstein) MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", einstein_state, keyboard_timer_callback, attotime::from_hz(50)) MCFG_DEVICE_ADD(IC_I063, Z80PIO, XTAL_X002 / 2) - MCFG_Z80PIO_OUT_INT_CB(WRITELINE(einstein_state, int_w<0>)) - MCFG_Z80PIO_OUT_PA_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) - MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(einstein_state, ardy_w)) - MCFG_Z80PIO_IN_PB_CB(DEVREAD8("user", einstein_userport_device, read)) - MCFG_Z80PIO_OUT_PB_CB(DEVWRITE8("user", einstein_userport_device, write)) - MCFG_Z80PIO_OUT_BRDY_CB(DEVWRITELINE("user", einstein_userport_device, brdy_w)) + MCFG_Z80PIO_OUT_INT_CB(WRITELINE(*this, einstein_state, int_w<0>)) + MCFG_Z80PIO_OUT_PA_CB(WRITE8("cent_data_out", output_latch_device, write)) + MCFG_Z80PIO_OUT_ARDY_CB(WRITELINE(*this, einstein_state, ardy_w)) + MCFG_Z80PIO_IN_PB_CB(READ8("user", einstein_userport_device, read)) + MCFG_Z80PIO_OUT_PB_CB(WRITE8("user", einstein_userport_device, write)) + MCFG_Z80PIO_OUT_BRDY_CB(WRITELINE("user", einstein_userport_device, brdy_w)) MCFG_DEVICE_ADD(IC_I058, Z80CTC, XTAL_X002 / 2) - MCFG_Z80CTC_INTR_CB(WRITELINE(einstein_state, int_w<1>)) - MCFG_Z80CTC_ZC0_CB(DEVWRITELINE(IC_I060, i8251_device, write_txc)) - MCFG_Z80CTC_ZC1_CB(DEVWRITELINE(IC_I060, i8251_device, write_rxc)) - MCFG_Z80CTC_ZC2_CB(DEVWRITELINE(IC_I058, z80ctc_device, trg3)) + MCFG_Z80CTC_INTR_CB(WRITELINE(*this, einstein_state, int_w<1>)) + MCFG_Z80CTC_ZC0_CB(WRITELINE(IC_I060, i8251_device, write_txc)) + MCFG_Z80CTC_ZC1_CB(WRITELINE(IC_I060, i8251_device, write_rxc)) + MCFG_Z80CTC_ZC2_CB(WRITELINE(IC_I058, z80ctc_device, trg3)) MCFG_CLOCK_ADD("ctc_trigger", XTAL_X002 / 4) - MCFG_CLOCK_SIGNAL_HANDLER(DEVWRITELINE(IC_I058, z80ctc_device, trg0)) - MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(IC_I058, z80ctc_device, trg1)) - MCFG_DEVCB_CHAIN_OUTPUT(DEVWRITELINE(IC_I058, z80ctc_device, trg2)) + MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(IC_I058, z80ctc_device, trg0)) + MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(IC_I058, z80ctc_device, trg1)) + MCFG_DEVCB_CHAIN_OUTPUT(WRITELINE(IC_I058, z80ctc_device, trg2)) /* Einstein daisy chain support for non-Z80 devices */ MCFG_Z80DAISY_GENERIC_ADD("keyboard_daisy", 0xf7) - MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(einstein_state, int_w<2>)) + MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(*this, einstein_state, int_w<2>)) MCFG_Z80DAISY_GENERIC_ADD("adc_daisy", 0xfb) - MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(einstein_state, int_w<3>)) + MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(*this, einstein_state, int_w<3>)) MCFG_Z80DAISY_GENERIC_ADD("fire_daisy", 0xfd) - MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(einstein_state, int_w<4>)) + MCFG_Z80DAISY_GENERIC_INT_CB(WRITELINE(*this, einstein_state, int_w<4>)) /* video hardware */ MCFG_DEVICE_ADD("vdp", TMS9129, XTAL(10'738'635) / 2) @@ -622,13 +622,13 @@ MACHINE_CONFIG_START(einstein_state::einstein) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD(IC_I030, AY8910, XTAL_X002 / 4) - MCFG_AY8910_PORT_B_READ_CB(READ8(einstein_state, keyboard_data_read)) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(einstein_state, keyboard_line_write)) + MCFG_DEVICE_ADD(IC_I030, AY8910, XTAL_X002 / 4) + MCFG_AY8910_PORT_B_READ_CB(READ8(*this, einstein_state, keyboard_data_read)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, einstein_state, keyboard_line_write)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) MCFG_ADC0844_ADD("adc") - MCFG_ADC0844_INTR_CB(DEVWRITELINE("adc_daisy", z80daisy_generic_device, int_w)) + MCFG_ADC0844_INTR_CB(WRITELINE("adc_daisy", z80daisy_generic_device, int_w)) MCFG_ADC0844_CH1_CB(IOPORT("analogue_1_x")) MCFG_ADC0844_CH2_CB(IOPORT("analogue_1_y")) MCFG_ADC0844_CH3_CB(IOPORT("analogue_2_x")) @@ -636,10 +636,10 @@ MACHINE_CONFIG_START(einstein_state::einstein) /* printer */ MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer") - MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(IC_I063, z80pio_device, strobe_a)) - MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(einstein_state, write_centronics_busy)) - MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(einstein_state, write_centronics_perror)) - MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(einstein_state, write_centronics_fault)) + MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(IC_I063, z80pio_device, strobe_a)) + MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(*this, einstein_state, write_centronics_busy)) + MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(*this, einstein_state, write_centronics_perror)) + MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(*this, einstein_state, write_centronics_fault)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -647,15 +647,15 @@ MACHINE_CONFIG_START(einstein_state::einstein) // uart MCFG_DEVICE_ADD(IC_I060, I8251, XTAL_X002 / 4) - MCFG_I8251_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) + MCFG_I8251_TXD_HANDLER(WRITELINE("rs232", rs232_port_device, write_txd)) + MCFG_I8251_RTS_HANDLER(WRITELINE("rs232", rs232_port_device, write_rts)) + MCFG_I8251_DTR_HANDLER(WRITELINE("rs232", rs232_port_device, write_dtr)) // rs232 port - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, nullptr) - MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IC_I060, i8251_device, write_rxd)) - MCFG_RS232_DSR_HANDLER(DEVWRITELINE(IC_I060, i8251_device, write_dsr)) - MCFG_RS232_CTS_HANDLER(DEVWRITELINE(IC_I060, i8251_device, write_cts)) + MCFG_DEVICE_ADD("rs232", RS232_PORT, default_rs232_devices, nullptr) + MCFG_RS232_RXD_HANDLER(WRITELINE(IC_I060, i8251_device, write_rxd)) + MCFG_RS232_DSR_HANDLER(WRITELINE(IC_I060, i8251_device, write_dsr)) + MCFG_RS232_CTS_HANDLER(WRITELINE(IC_I060, i8251_device, write_cts)) // floppy MCFG_WD1770_ADD(IC_I042, XTAL_X002) @@ -679,7 +679,7 @@ MACHINE_CONFIG_START(einstein_state::einstein) // user port MCFG_EINSTEIN_USERPORT_ADD("user") - MCFG_EINSTEIN_USERPORT_BSTB_HANDLER(DEVWRITELINE(IC_I063, z80pio_device, strobe_b)) + MCFG_EINSTEIN_USERPORT_BSTB_HANDLER(WRITELINE(IC_I063, z80pio_device, strobe_b)) MACHINE_CONFIG_END |