summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/binbug.cpp
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2018-05-06 00:40:40 +1000
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2018-05-06 00:51:27 +1000
commit4ea3cd0bc1f54e47a0d38a47afac38101549e9ee (patch) (github)
treebbadc20010b6bad48cf321b1c864655587e4b8ad /src/mame/drivers/binbug.cpp
parentbba5127d7a73ca44fdc0dcab7286846c81206771 (diff)
downloadmame-4ea3cd0bc1f54e47a0d38a47afac38101549e9ee.tar.bz2
mame-4ea3cd0bc1f54e47a0d38a47afac38101549e9ee.zip
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/binbug.cpp')
-rw-r--r--src/mame/drivers/binbug.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mame/drivers/binbug.cpp b/src/mame/drivers/binbug.cpp
index d5d2871ce2a..84115a651df 100644
--- a/src/mame/drivers/binbug.cpp
+++ b/src/mame/drivers/binbug.cpp
@@ -300,11 +300,11 @@ DEVICE_INPUT_DEFAULTS_END
MACHINE_CONFIG_START(binbug_state::binbug)
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu",S2650, XTAL(1'000'000))
- MCFG_CPU_PROGRAM_MAP(binbug_mem)
- MCFG_CPU_DATA_MAP(binbug_data)
- MCFG_S2650_SENSE_INPUT(READLINE(binbug_state, binbug_serial_r))
- MCFG_S2650_FLAG_OUTPUT(WRITELINE(binbug_state, binbug_serial_w))
+ MCFG_DEVICE_ADD("maincpu",S2650, XTAL(1'000'000))
+ MCFG_DEVICE_PROGRAM_MAP(binbug_mem)
+ MCFG_DEVICE_DATA_MAP(binbug_data)
+ MCFG_S2650_SENSE_INPUT(READLINE(*this, binbug_state, binbug_serial_r))
+ MCFG_S2650_FLAG_OUTPUT(WRITELINE(*this, binbug_state, binbug_serial_w))
/* video hardware */
MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::amber())
@@ -319,7 +319,7 @@ MACHINE_CONFIG_START(binbug_state::binbug)
MCFG_PALETTE_ADD_MONOCHROME("palette")
/* Keyboard */
- MCFG_RS232_PORT_ADD("keyboard", default_rs232_devices, "keyboard")
+ MCFG_DEVICE_ADD("keyboard", RS232_PORT, default_rs232_devices, "keyboard")
MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("keyboard", keyboard)
/* Cassette */
@@ -537,9 +537,9 @@ TIMER_DEVICE_CALLBACK_MEMBER(dg680_state::uart_tick)
MACHINE_CONFIG_START(dg680_state::dg680)
/* basic machine hardware */
- MCFG_CPU_ADD("maincpu",Z80, XTAL(8'000'000) / 4)
- MCFG_CPU_PROGRAM_MAP(dg680_mem)
- MCFG_CPU_IO_MAP(dg680_io)
+ MCFG_DEVICE_ADD("maincpu",Z80, XTAL(8'000'000) / 4)
+ MCFG_DEVICE_PROGRAM_MAP(dg680_mem)
+ MCFG_DEVICE_IO_MAP(dg680_io)
MCFG_Z80_DAISY_CHAIN(dg680_daisy_chain)
/* video hardware */
@@ -567,14 +567,14 @@ MACHINE_CONFIG_START(dg680_state::dg680)
/* Devices */
MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL(8'000'000) / 4)
MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("z80ctc", z80ctc_device, trg1))
+ MCFG_Z80CTC_ZC0_CB(WRITELINE("z80ctc", z80ctc_device, trg1))
MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL(8'000'000) / 4)
MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0))
- MCFG_Z80PIO_IN_PA_CB(READ8(dg680_state, porta_r))
+ MCFG_Z80PIO_IN_PA_CB(READ8(*this, dg680_state, porta_r))
// OUT_ARDY - this activates to ask for kbd data but not known if actually used
- MCFG_Z80PIO_IN_PB_CB(READ8(dg680_state, portb_r))
- MCFG_Z80PIO_OUT_PB_CB(WRITE8(dg680_state, portb_w))
+ MCFG_Z80PIO_IN_PB_CB(READ8(*this, dg680_state, portb_r))
+ MCFG_Z80PIO_OUT_PB_CB(WRITE8(*this, dg680_state, portb_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc0", dg680_state, time_tick, attotime::from_hz(200))
MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc3", dg680_state, uart_tick, attotime::from_hz(4800))