diff options
author | 2018-05-04 03:01:32 +1000 | |
---|---|---|
committer | 2018-05-04 03:01:32 +1000 | |
commit | 32a73f450da82c345b0f694bee311af34a5e717d (patch) | |
tree | de6259ee4c0120e992f348afcc9078e16bbe49d4 /src/devices/bus/intv_ctrl/ecs_ctrl.cpp | |
parent | aa96f47092f764f089c2ce9e0f26d756197150e8 (diff) |
Make MCFG_DEVICE_ADD and callable device types more flexible:
* Allows defaulted clocks (see subtle example with vboy)
* Allows additional constructors (see RS232 port in tranz330)
* Allows use of device finder in place of tag in MCFG_DEVICE_ADD
* Requires out-of-line destructor for devices using incomplete types
* Requires XTAL or explicit u32 for clocks for devices with private types
Devices must still define the standard constructor. When writing
additional constructors, be aware that the constructor runs before
device_add_mconfig in the context of the existing device, not the new
device. See osborne1, zorba, tranz330, and vboy for examples of this in
use. Compilation is a bit slower, but this is temporary while
refactoring is in progress.
Eliminated the need for MCFG_SOUND_ROUTE_EX.
Removed macros from slot option configuration - they just obfuscated
code and slowed it down with needless dynamic casts, but didn't actually
simplify it.
Diffstat (limited to 'src/devices/bus/intv_ctrl/ecs_ctrl.cpp')
-rw-r--r-- | src/devices/bus/intv_ctrl/ecs_ctrl.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp index ea3118619f9..e90292de645 100644 --- a/src/devices/bus/intv_ctrl/ecs_ctrl.cpp +++ b/src/devices/bus/intv_ctrl/ecs_ctrl.cpp @@ -118,11 +118,12 @@ void intvecs_control_port_device::write_portA(uint8_t data) // SLOT_INTERFACE( intvecs_control_port_devices ) //------------------------------------------------- -SLOT_INTERFACE_START( intvecs_control_port_devices ) - SLOT_INTERFACE("ctrls", ECS_CTRLS) - SLOT_INTERFACE("keybd", ECS_KEYBD) - SLOT_INTERFACE("synth", ECS_SYNTH) -SLOT_INTERFACE_END +void intvecs_control_port_devices(device_slot_interface &device) +{ + device.option_add("ctrls", ECS_CTRLS); + device.option_add("keybd", ECS_KEYBD); + device.option_add("synth", ECS_SYNTH); +} @@ -139,9 +140,10 @@ SLOT_INTERFACE_END DEFINE_DEVICE_TYPE(ECS_CTRLS, intvecs_ctrls_device, "intvecs_ctrls", "Mattel Intellivision ECS Hand Controller x2 (HACK)") -static SLOT_INTERFACE_START( intvecs_controller ) - SLOT_INTERFACE("handctrl", INTV_HANDCTRL) -SLOT_INTERFACE_END +static void intvecs_controller(device_slot_interface &device) +{ + device.option_add("handctrl", INTV_HANDCTRL); +} MACHINE_CONFIG_START(intvecs_ctrls_device::device_add_mconfig) MCFG_INTV_CONTROL_PORT_ADD("port1", intvecs_controller, "handctrl") |