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/docastle.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/docastle.cpp')
-rw-r--r-- | src/mame/drivers/docastle.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/mame/drivers/docastle.cpp b/src/mame/drivers/docastle.cpp index 927eaa7fbe2..a8a90e1f12d 100644 --- a/src/mame/drivers/docastle.cpp +++ b/src/mame/drivers/docastle.cpp @@ -599,15 +599,15 @@ void docastle_state::machine_start() MACHINE_CONFIG_START(docastle_state::docastle) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", Z80, XTAL(4'000'000)) - MCFG_CPU_PROGRAM_MAP(docastle_map) - MCFG_CPU_IO_MAP(docastle_io_map) + MCFG_DEVICE_ADD("maincpu", Z80, XTAL(4'000'000)) + MCFG_DEVICE_PROGRAM_MAP(docastle_map) + MCFG_DEVICE_IO_MAP(docastle_io_map) - MCFG_CPU_ADD("slave", Z80, XTAL(4'000'000)) - MCFG_CPU_PROGRAM_MAP(docastle_map2) + MCFG_DEVICE_ADD("slave", Z80, XTAL(4'000'000)) + MCFG_DEVICE_PROGRAM_MAP(docastle_map2) - MCFG_CPU_ADD("cpu3", Z80, XTAL(4'000'000)) - MCFG_CPU_PROGRAM_MAP(docastle_map3) + MCFG_DEVICE_ADD("cpu3", Z80, XTAL(4'000'000)) + MCFG_DEVICE_PROGRAM_MAP(docastle_map3) MCFG_DEVICE_ADD("inp1", TMS1025, 0) MCFG_TMS1025_READ_PORT_CB(PORT1, IOPORT("DSW2")) @@ -636,9 +636,9 @@ MACHINE_CONFIG_START(docastle_state::docastle) MCFG_MC6845_SHOW_BORDER_AREA(false) MCFG_MC6845_VISAREA_ADJUST(8,-8,0,0) MCFG_MC6845_CHAR_WIDTH(8) - MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(docastle_state, docastle_tint)) - MCFG_MC6845_OUT_CUR_CB(WRITELINE(docastle_state, stx_on_w)) - MCFG_MC6845_OUT_DE_CB(WRITELINE(docastle_state, stx_off_w)) + MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(*this, docastle_state, docastle_tint)) + MCFG_MC6845_OUT_CUR_CB(WRITELINE(*this, docastle_state, stx_on_w)) + MCFG_MC6845_OUT_DE_CB(WRITELINE(*this, docastle_state, stx_off_w)) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_RAW_PARAMS(XTAL(9'828'000)/2, 0x138, 8, 0x100-8, 0x108, 0, 0xc0) // from crtc @@ -652,16 +652,16 @@ MACHINE_CONFIG_START(docastle_state::docastle) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("sn1", SN76489A, XTAL(4'000'000)) + MCFG_DEVICE_ADD("sn1", SN76489A, XTAL(4'000'000)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("sn2", SN76489A, XTAL(4'000'000)) + MCFG_DEVICE_ADD("sn2", SN76489A, XTAL(4'000'000)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("sn3", SN76489A, XTAL(4'000'000)) + MCFG_DEVICE_ADD("sn3", SN76489A, XTAL(4'000'000)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_SOUND_ADD("sn4", SN76489A, XTAL(4'000'000)) + MCFG_DEVICE_ADD("sn4", SN76489A, XTAL(4'000'000)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END @@ -669,11 +669,11 @@ MACHINE_CONFIG_START(docastle_state::dorunrun) docastle(config); /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(dorunrun_map) + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_PROGRAM_MAP(dorunrun_map) - MCFG_CPU_MODIFY("slave") - MCFG_CPU_PROGRAM_MAP(dorunrun_map2) + MCFG_DEVICE_MODIFY("slave") + MCFG_DEVICE_PROGRAM_MAP(dorunrun_map2) /* video hardware */ MCFG_VIDEO_START_OVERRIDE(docastle_state,dorunrun) @@ -683,8 +683,8 @@ MACHINE_CONFIG_START(docastle_state::idsoccer) docastle(config); /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(idsoccer_map) + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_PROGRAM_MAP(idsoccer_map) MCFG_DEVICE_MODIFY("inp1") MCFG_TMS1025_READ_PORT_CB(PORT4, IOPORT("JOYS_RIGHT")) @@ -696,8 +696,8 @@ MACHINE_CONFIG_START(docastle_state::idsoccer) MCFG_VIDEO_START_OVERRIDE(docastle_state,dorunrun) /* sound hardware */ - MCFG_SOUND_ADD("msm", MSM5205, XTAL(384'000)) /* Crystal verified on American Soccer board. */ - MCFG_MSM5205_VCLK_CB(WRITELINE(docastle_state, idsoccer_adpcm_int)) // interrupt function + MCFG_DEVICE_ADD("msm", MSM5205, XTAL(384'000)) /* Crystal verified on American Soccer board. */ + MCFG_MSM5205_VCLK_CB(WRITELINE(*this, docastle_state, idsoccer_adpcm_int)) // interrupt function MCFG_MSM5205_PRESCALER_SELECTOR(S64_4B) // 6 kHz ??? MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) MACHINE_CONFIG_END |