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/tmnt.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/tmnt.cpp')
-rw-r--r-- | src/mame/drivers/tmnt.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index da40ffb32c2..85d3e4e7e42 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -1913,9 +1913,9 @@ MACHINE_RESET_MEMBER(tmnt_state,common) MACHINE_CONFIG_START(tmnt_state::cuebrick) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 MHz */ - MCFG_CPU_PROGRAM_MAP(cuebrick_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, 8000000) /* 8 MHz */ + MCFG_DEVICE_PROGRAM_MAP(cuebrick_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -1965,12 +1965,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::mia) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(24'000'000)/3) - MCFG_CPU_PROGRAM_MAP(mia_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/3) + MCFG_DEVICE_PROGRAM_MAP(mia_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(mia_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(mia_audio_map) MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2013,8 +2013,8 @@ MACHINE_CONFIG_START(tmnt_state::mia) MCFG_SOUND_ROUTE(0, "mono", 1.0) MCFG_SOUND_ROUTE(1, "mono", 1.0) - MCFG_SOUND_ADD("k007232", K007232, XTAL(3'579'545)) - MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(tmnt_state, volume_callback)) + MCFG_DEVICE_ADD("k007232", K007232, XTAL(3'579'545)) + MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, tmnt_state, volume_callback)) MCFG_SOUND_ROUTE(0, "mono", 0.20) MCFG_SOUND_ROUTE(1, "mono", 0.20) MACHINE_CONFIG_END @@ -2030,12 +2030,12 @@ MACHINE_RESET_MEMBER(tmnt_state,tmnt) MACHINE_CONFIG_START(tmnt_state::tmnt) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(24'000'000)/3) - MCFG_CPU_PROGRAM_MAP(tmnt_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/3) + MCFG_DEVICE_PROGRAM_MAP(tmnt_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(tmnt_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(tmnt_audio_map) MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,tmnt) @@ -2079,15 +2079,15 @@ MACHINE_CONFIG_START(tmnt_state::tmnt) MCFG_SOUND_ROUTE(0, "mono", 1.0) MCFG_SOUND_ROUTE(1, "mono", 1.0) - MCFG_SOUND_ADD("k007232", K007232, XTAL(3'579'545)) - MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(tmnt_state, volume_callback)) + MCFG_DEVICE_ADD("k007232", K007232, XTAL(3'579'545)) + MCFG_K007232_PORT_WRITE_HANDLER(WRITE8(*this, tmnt_state, volume_callback)) MCFG_SOUND_ROUTE(0, "mono", 0.33) MCFG_SOUND_ROUTE(1, "mono", 0.33) - MCFG_SOUND_ADD("upd", UPD7759, XTAL(640'000)) + MCFG_DEVICE_ADD("upd", UPD7759, XTAL(640'000)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) - MCFG_SOUND_ADD("samples", SAMPLES, 0) + MCFG_DEVICE_ADD("samples", SAMPLES) MCFG_SAMPLES_CHANNELS(1) /* 1 channel for the title music */ MCFG_SAMPLES_START_CB(tmnt_state, tmnt_decode_sample) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) @@ -2097,12 +2097,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::punkshot) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(24'000'000)/2) - MCFG_CPU_PROGRAM_MAP(punkshot_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/2) + MCFG_DEVICE_PROGRAM_MAP(punkshot_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(punkshot_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(punkshot_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) @@ -2151,12 +2151,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::lgtnfght) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(24'000'000)/2) - MCFG_CPU_PROGRAM_MAP(lgtnfght_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(24'000'000)/2) + MCFG_DEVICE_PROGRAM_MAP(lgtnfght_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(lgtnfght_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(lgtnfght_audio_map) MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2207,12 +2207,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::blswhstl) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_CPU_PROGRAM_MAP(blswhstl_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ + MCFG_DEVICE_PROGRAM_MAP(blswhstl_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(ssriders_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) @@ -2230,7 +2230,7 @@ MACHINE_CONFIG_START(tmnt_state::blswhstl) MCFG_SCREEN_SIZE(64*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(12*8, (64-12)*8-1, 2*8, 30*8-1 ) MCFG_SCREEN_UPDATE_DRIVER(tmnt_state, screen_update_lgtnfght) - MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(tmnt_state, screen_vblank_blswhstl)) + MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, tmnt_state, screen_vblank_blswhstl)) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD("palette", 2048) @@ -2285,12 +2285,12 @@ GFXDECODE_END MACHINE_CONFIG_START(tmnt_state::glfgreat) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_CPU_PROGRAM_MAP(glfgreat_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ + MCFG_DEVICE_PROGRAM_MAP(glfgreat_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(glfgreat_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(glfgreat_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) @@ -2351,12 +2351,12 @@ MACHINE_START_MEMBER(tmnt_state,prmrsocr) MACHINE_CONFIG_START(tmnt_state::prmrsocr) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ - MCFG_CPU_PROGRAM_MAP(prmrsocr_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) /* Confirmed */ + MCFG_DEVICE_PROGRAM_MAP(prmrsocr_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* ? */ - MCFG_CPU_PROGRAM_MAP(prmrsocr_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) /* ? */ + MCFG_DEVICE_PROGRAM_MAP(prmrsocr_audio_map) /* NMIs are generated by the 054539 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,prmrsocr) @@ -2416,16 +2416,16 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::tmnt2) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(32'000'000)/2) - MCFG_CPU_PROGRAM_MAP(tmnt2_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) + MCFG_DEVICE_PROGRAM_MAP(tmnt2_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM */ + MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM */ /* access. Access speed of ROM/RAM used on the machine is 150ns, */ /* without the wait, they cannot run on 8MHz. */ /* We are not emulating the wait state, so the ROM test ends at */ /* 02 instead of 00. */ - MCFG_CPU_PROGRAM_MAP(ssriders_audio_map) + MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) @@ -2479,12 +2479,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::ssriders) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, XTAL(32'000'000)/2) - MCFG_CPU_PROGRAM_MAP(ssriders_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, XTAL(32'000'000)/2) + MCFG_DEVICE_PROGRAM_MAP(ssriders_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, 8000000) - MCFG_CPU_PROGRAM_MAP(ssriders_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, 8000000) + MCFG_DEVICE_PROGRAM_MAP(ssriders_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) @@ -2538,9 +2538,9 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::sunsetbl) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */ - MCFG_CPU_PROGRAM_MAP(sunsetbl_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, irq4_line_hold) + MCFG_DEVICE_ADD("maincpu", M68000, 16000000) /* 16 MHz */ + MCFG_DEVICE_PROGRAM_MAP(sunsetbl_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, irq4_line_hold) MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common) @@ -2584,12 +2584,12 @@ MACHINE_CONFIG_END MACHINE_CONFIG_START(tmnt_state::thndrx2) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz */ - MCFG_CPU_PROGRAM_MAP(thndrx2_main_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) + MCFG_DEVICE_ADD("maincpu", M68000, 12000000) /* 12 MHz */ + MCFG_DEVICE_PROGRAM_MAP(thndrx2_main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt) - MCFG_CPU_ADD("audiocpu", Z80, XTAL(3'579'545)) - MCFG_CPU_PROGRAM_MAP(thndrx2_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(3'579'545)) + MCFG_DEVICE_PROGRAM_MAP(thndrx2_audio_map) /* NMIs are generated by the 053260 */ MCFG_MACHINE_START_OVERRIDE(tmnt_state,common) |