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/taitosj.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/taitosj.cpp')
-rw-r--r-- | src/mame/drivers/taitosj.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/mame/drivers/taitosj.cpp b/src/mame/drivers/taitosj.cpp index 8cf6f50c14c..29c068110eb 100644 --- a/src/mame/drivers/taitosj.cpp +++ b/src/mame/drivers/taitosj.cpp @@ -1759,17 +1759,17 @@ WRITE8_MEMBER(taitosj_state::taitosj_dacvol_w) MACHINE_CONFIG_START(taitosj_state::nomcu) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu",Z80,XTAL(8'000'000)/2) /* 8 MHz / 2, on CPU board */ - MCFG_CPU_PROGRAM_MAP(taitosj_main_nomcu_map) - MCFG_CPU_VBLANK_INT_DRIVER("screen", taitosj_state, irq0_line_hold) + MCFG_DEVICE_ADD("maincpu",Z80,XTAL(8'000'000)/2) /* 8 MHz / 2, on CPU board */ + MCFG_DEVICE_PROGRAM_MAP(taitosj_main_nomcu_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", taitosj_state, irq0_line_hold) - MCFG_CPU_ADD("audiocpu", Z80,XTAL(6'000'000)/2) /* 6 MHz / 2, on GAME board */ - MCFG_CPU_PROGRAM_MAP(taitosj_audio_map) + MCFG_DEVICE_ADD("audiocpu", Z80,XTAL(6'000'000)/2) /* 6 MHz / 2, on GAME board */ + MCFG_DEVICE_PROGRAM_MAP(taitosj_audio_map) /* interrupts: */ /* - no interrupts synced with vblank */ /* - NMI triggered by the main CPU */ /* - periodic IRQ, with frequency 6000000/(4*16*16*10*16) = 36.621 Hz, */ - MCFG_CPU_PERIODIC_INT_DRIVER(taitosj_state, irq0_line_hold, XTAL(6'000'000)/(4*16*16*10*16)) + MCFG_DEVICE_PERIODIC_INT_DRIVER(taitosj_state, irq0_line_hold, XTAL(6'000'000)/(4*16*16*10*16)) /* video hardware */ @@ -1789,28 +1789,28 @@ MACHINE_CONFIG_START(taitosj_state::nomcu) MCFG_SPEAKER_STANDARD_MONO("speaker") MCFG_INPUT_MERGER_ALL_HIGH("soundnmi") - MCFG_INPUT_MERGER_OUTPUT_HANDLER(DEVWRITELINE("soundnmi2", input_merger_device, in_w<0>)) + MCFG_INPUT_MERGER_OUTPUT_HANDLER(WRITELINE("soundnmi2", input_merger_device, in_w<0>)) MCFG_INPUT_MERGER_ANY_HIGH("soundnmi2") MCFG_INPUT_MERGER_OUTPUT_HANDLER(INPUTLINE("audiocpu", INPUT_LINE_NMI)) - MCFG_SOUND_ADD("ay1", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC53 (this is the only AY which uses proper mixing resistors, the 3 below have outputs tied together) + MCFG_DEVICE_ADD("ay1", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC53 (this is the only AY which uses proper mixing resistors, the 3 below have outputs tied together) MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW2")) MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) - MCFG_SOUND_ADD("ay2", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC51 + MCFG_DEVICE_ADD("ay2", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC51 MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) - MCFG_AY8910_PORT_A_WRITE_CB(DEVWRITE8("dac", dac_byte_interface, write)) - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(taitosj_state, taitosj_dacvol_w)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8("dac", dac_byte_interface, write)) + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, taitosj_state, taitosj_dacvol_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_SOUND_ADD("ay3", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC49 + MCFG_DEVICE_ADD("ay3", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC49 MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) - MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(taitosj_state, input_port_4_f0_w)) + MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(*this, taitosj_state, input_port_4_f0_w)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_SOUND_ADD("ay4", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC50 + MCFG_DEVICE_ADD("ay4", AY8910, XTAL(6'000'000)/4) // 6mhz/4 on GAME board, AY-3-8910 @ IC50 MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT) /* TODO: Implement ay4 Port A bits 0 and 1 which connect to a 7416 open collector inverter, to selectively tie none, either or both of two @@ -1818,14 +1818,14 @@ MACHINE_CONFIG_START(taitosj_state::nomcu) audio output signal and high-z (i.e. do nothing). Bio Attack uses this? */ - MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(taitosj_state, taitosj_sndnmi_msk_w)) /* port Bwrite */ + MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(*this, taitosj_state, taitosj_sndnmi_msk_w)) /* port Bwrite */ MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 1.0) MCFG_WATCHDOG_ADD("watchdog") MCFG_WATCHDOG_VBLANK_INIT("screen", 128); // 74LS393 on CPU board, counts 128 vblanks before firing watchdog - MCFG_SOUND_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // 30k r-2r network - MCFG_SOUND_ADD("dacvol", DISCRETE, 0) MCFG_DISCRETE_INTF(taitosj_dacvol) + MCFG_DEVICE_ADD("dac", DAC_8BIT_R2R, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.15) // 30k r-2r network + MCFG_DEVICE_ADD("dacvol", DISCRETE) MCFG_DISCRETE_INTF(taitosj_dacvol) MCFG_SOUND_ROUTE(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE(0, "dac", -1.0, DAC_VREF_NEG_INPUT) MACHINE_CONFIG_END @@ -1835,15 +1835,15 @@ MACHINE_CONFIG_START(taitosj_state::mcu) nomcu(config); /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(taitosj_main_mcu_map) + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_PROGRAM_MAP(taitosj_main_mcu_map) - MCFG_CPU_ADD("bmcu", TAITO_SJ_SECURITY_MCU, XTAL(3'000'000)) /* xtal is 3MHz, divided by 4 internally */ + MCFG_DEVICE_ADD("bmcu", TAITO_SJ_SECURITY_MCU, XTAL(3'000'000)) /* xtal is 3MHz, divided by 4 internally */ MCFG_TAITO_SJ_SECURITY_MCU_INT_MODE(LATCH) - MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(READ8(taitosj_state, mcu_mem_r)) - MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(WRITE8(taitosj_state, mcu_mem_w)) - MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(WRITELINE(taitosj_state, mcu_intrq_w)) - MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(WRITELINE(taitosj_state, mcu_busrq_w)) + MCFG_TAITO_SJ_SECURITY_MCU_68READ_CB(READ8(*this, taitosj_state, mcu_mem_r)) + MCFG_TAITO_SJ_SECURITY_MCU_68WRITE_CB(WRITE8(*this, taitosj_state, mcu_mem_w)) + MCFG_TAITO_SJ_SECURITY_MCU_68INTRQ_CB(WRITELINE(*this, taitosj_state, mcu_intrq_w)) + MCFG_TAITO_SJ_SECURITY_MCU_BUSRQ_CB(WRITELINE(*this, taitosj_state, mcu_busrq_w)) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) MACHINE_CONFIG_END @@ -1853,8 +1853,8 @@ MACHINE_CONFIG_START(taitosj_state::kikstart) mcu(config); /* basic machine hardware */ - MCFG_CPU_MODIFY("maincpu") - MCFG_CPU_PROGRAM_MAP(kikstart_main_map) + MCFG_DEVICE_MODIFY("maincpu") + MCFG_DEVICE_PROGRAM_MAP(kikstart_main_map) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_UPDATE_DRIVER(taitosj_state, screen_update_kikstart) |