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/toratora.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/toratora.cpp')
-rw-r--r-- | src/mame/drivers/toratora.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mame/drivers/toratora.cpp b/src/mame/drivers/toratora.cpp index 07a60105f91..700d9fae1d3 100644 --- a/src/mame/drivers/toratora.cpp +++ b/src/mame/drivers/toratora.cpp @@ -396,26 +396,26 @@ void toratora_state::machine_reset() MACHINE_CONFIG_START(toratora_state::toratora) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", M6800, 5185000 / 8) /* 5.185 MHz XTAL divided by 8 (@ U94.12) */ - MCFG_CPU_PROGRAM_MAP(main_map) - MCFG_CPU_PERIODIC_INT_DRIVER(toratora_state, toratora_timer, 250) /* timer counting at 250 Hz */ + MCFG_DEVICE_ADD("maincpu", M6800, 5185000 / 8) /* 5.185 MHz XTAL divided by 8 (@ U94.12) */ + MCFG_DEVICE_PROGRAM_MAP(main_map) + MCFG_DEVICE_PERIODIC_INT_DRIVER(toratora_state, toratora_timer, 250) /* timer counting at 250 Hz */ MCFG_DEVICE_ADD("pia_u1", PIA6821, 0) - MCFG_PIA_WRITEPB_HANDLER(WRITE8(toratora_state,port_b_u1_w)) - MCFG_PIA_IRQA_HANDLER(WRITELINE(toratora_state,main_cpu_irq)) - MCFG_PIA_IRQB_HANDLER(WRITELINE(toratora_state,main_cpu_irq)) + MCFG_PIA_WRITEPB_HANDLER(WRITE8(*this, toratora_state,port_b_u1_w)) + MCFG_PIA_IRQA_HANDLER(WRITELINE(*this, toratora_state,main_cpu_irq)) + MCFG_PIA_IRQB_HANDLER(WRITELINE(*this, toratora_state,main_cpu_irq)) MCFG_DEVICE_ADD("pia_u3", PIA6821, 0) - MCFG_PIA_WRITEPA_HANDLER(WRITE8(toratora_state, sn1_port_a_u3_w)) - MCFG_PIA_WRITEPB_HANDLER(WRITE8(toratora_state, sn1_port_b_u3_w)) - MCFG_PIA_CA2_HANDLER(WRITELINE(toratora_state, sn1_ca2_u3_w)) + MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, toratora_state, sn1_port_a_u3_w)) + MCFG_PIA_WRITEPB_HANDLER(WRITE8(*this, toratora_state, sn1_port_b_u3_w)) + MCFG_PIA_CA2_HANDLER(WRITELINE(*this, toratora_state, sn1_ca2_u3_w)) MCFG_DEVICE_ADD("pia_u2", PIA6821, 0) MCFG_PIA_READPB_HANDLER(IOPORT("DSW")) - MCFG_PIA_WRITEPA_HANDLER(WRITE8(toratora_state,sn2_port_a_u2_w)) - MCFG_PIA_WRITEPB_HANDLER(WRITE8(toratora_state,sn2_port_b_u2_w)) - MCFG_PIA_CA2_HANDLER(WRITELINE(toratora_state,sn2_ca2_u2_w)) - MCFG_PIA_CB2_HANDLER(WRITELINE(toratora_state,cb2_u2_w)) + MCFG_PIA_WRITEPA_HANDLER(WRITE8(*this, toratora_state,sn2_port_a_u2_w)) + MCFG_PIA_WRITEPB_HANDLER(WRITE8(*this, toratora_state,sn2_port_b_u2_w)) + MCFG_PIA_CA2_HANDLER(WRITELINE(*this, toratora_state,sn2_ca2_u2_w)) + MCFG_PIA_CB2_HANDLER(WRITELINE(*this, toratora_state,cb2_u2_w)) /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) @@ -428,7 +428,7 @@ MACHINE_CONFIG_START(toratora_state::toratora) /* audio hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") - MCFG_SOUND_ADD("sn1", SN76477, 0) + MCFG_DEVICE_ADD("sn1", SN76477) MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(470), CAP_P(470)) // noise + filter MCFG_SN76477_DECAY_RES(RES_M(2)) // decay_res MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.2), RES_K(3.3)) // attack_decay_cap + attack_res @@ -444,7 +444,7 @@ MACHINE_CONFIG_START(toratora_state::toratora) MCFG_SN76477_ENABLE(1) // enable MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) - MCFG_SOUND_ADD("sn2", SN76477, 0) + MCFG_DEVICE_ADD("sn2", SN76477) MCFG_SN76477_NOISE_PARAMS(RES_K(47), RES_K(470), CAP_P(470)) // noise + filter MCFG_SN76477_DECAY_RES(RES_M(2)) // decay_res MCFG_SN76477_ATTACK_PARAMS(CAP_U(0.2), RES_K(3.3)) // attack_decay_cap + attack_res |