From 4ea3cd0bc1f54e47a0d38a47afac38101549e9ee Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 6 May 2018 00:40:40 +1000 Subject: 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 --- src/mame/drivers/esh.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mame/drivers/esh.cpp') diff --git a/src/mame/drivers/esh.cpp b/src/mame/drivers/esh.cpp index 61b683e1824..12fda67a8b8 100644 --- a/src/mame/drivers/esh.cpp +++ b/src/mame/drivers/esh.cpp @@ -357,15 +357,15 @@ void esh_state::machine_start() /* DRIVER */ MACHINE_CONFIG_START(esh_state::esh) /* main cpu */ - MCFG_CPU_ADD("maincpu", Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */ - MCFG_CPU_PROGRAM_MAP(z80_0_mem) - MCFG_CPU_IO_MAP(z80_0_io) - MCFG_CPU_VBLANK_INT_DRIVER("screen", esh_state, vblank_callback_esh) + MCFG_DEVICE_ADD("maincpu", Z80, PCB_CLOCK/6) /* The denominator is a Daphne guess based on PacMan's hardware */ + MCFG_DEVICE_PROGRAM_MAP(z80_0_mem) + MCFG_DEVICE_IO_MAP(z80_0_io) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", esh_state, vblank_callback_esh) MCFG_NVRAM_ADD_0FILL("nvram") MCFG_LASERDISC_LDV1000_ADD("laserdisc") - MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(esh_state, ld_command_strobe_cb)) + MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(WRITELINE(*this, esh_state, ld_command_strobe_cb)) MCFG_LASERDISC_OVERLAY_DRIVER(256, 256, esh_state, screen_update_esh) MCFG_LASERDISC_OVERLAY_PALETTE("palette") @@ -380,11 +380,11 @@ MACHINE_CONFIG_START(esh_state::esh) /* sound hardware */ MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_MODIFY("laserdisc") + MCFG_DEVICE_MODIFY("laserdisc") MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("beeper", BEEP, 2000) + MCFG_DEVICE_ADD("beeper", BEEP, 2000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) MACHINE_CONFIG_END -- cgit v1.2.3