summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/neogeo_ctrl
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-04 03:01:32 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-04 03:01:32 +1000
commit32a73f450da82c345b0f694bee311af34a5e717d (patch)
treede6259ee4c0120e992f348afcc9078e16bbe49d4 /src/devices/bus/neogeo_ctrl
parentaa96f47092f764f089c2ce9e0f26d756197150e8 (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/neogeo_ctrl')
-rw-r--r--src/devices/bus/neogeo_ctrl/ctrl.cpp44
-rw-r--r--src/devices/bus/neogeo_ctrl/ctrl.h8
2 files changed, 28 insertions, 24 deletions
diff --git a/src/devices/bus/neogeo_ctrl/ctrl.cpp b/src/devices/bus/neogeo_ctrl/ctrl.cpp
index 2a936c1fa53..023d28adaf8 100644
--- a/src/devices/bus/neogeo_ctrl/ctrl.cpp
+++ b/src/devices/bus/neogeo_ctrl/ctrl.cpp
@@ -189,23 +189,27 @@ void neogeo_ctrl_edge_port_device::write_ctrlsel(uint8_t data)
// SLOT_INTERFACE( neogeo_control_port_devices )
//-------------------------------------------------
-SLOT_INTERFACE_START( neogeo_controls )
- SLOT_INTERFACE("joy", NEOGEO_JOY)
- SLOT_INTERFACE("mahjong", NEOGEO_MJCTRL)
-SLOT_INTERFACE_END
-
-SLOT_INTERFACE_START( neogeo_arc_edge )
- SLOT_INTERFACE("joy", NEOGEO_JOY_AC)
-SLOT_INTERFACE_END
-
-SLOT_INTERFACE_START( neogeo_arc_edge_fixed )
- SLOT_INTERFACE("joy", NEOGEO_JOY_AC)
- SLOT_INTERFACE("dial", NEOGEO_DIAL)
- SLOT_INTERFACE("irrmaze", NEOGEO_IRRMAZE)
- SLOT_INTERFACE("kiz4p", NEOGEO_KIZ4P)
-SLOT_INTERFACE_END
-
-SLOT_INTERFACE_START( neogeo_arc_pin15 )
- SLOT_INTERFACE("mahjong", NEOGEO_MJCTRL_AC)
- SLOT_INTERFACE("joy", NEOGEO_JOY)
-SLOT_INTERFACE_END
+void neogeo_controls(device_slot_interface &device)
+{
+ device.option_add("joy", NEOGEO_JOY);
+ device.option_add("mahjong", NEOGEO_MJCTRL);
+}
+
+void neogeo_arc_edge(device_slot_interface &device)
+{
+ device.option_add("joy", NEOGEO_JOY_AC);
+}
+
+void neogeo_arc_edge_fixed(device_slot_interface &device)
+{
+ device.option_add("joy", NEOGEO_JOY_AC);
+ device.option_add("dial", NEOGEO_DIAL);
+ device.option_add("irrmaze", NEOGEO_IRRMAZE);
+ device.option_add("kiz4p", NEOGEO_KIZ4P);
+}
+
+void neogeo_arc_pin15(device_slot_interface &device)
+{
+ device.option_add("mahjong", NEOGEO_MJCTRL_AC);
+ device.option_add("joy", NEOGEO_JOY);
+}
diff --git a/src/devices/bus/neogeo_ctrl/ctrl.h b/src/devices/bus/neogeo_ctrl/ctrl.h
index ea133f30b79..aee534d61ad 100644
--- a/src/devices/bus/neogeo_ctrl/ctrl.h
+++ b/src/devices/bus/neogeo_ctrl/ctrl.h
@@ -118,10 +118,10 @@ DECLARE_DEVICE_TYPE(NEOGEO_CTRL_EDGE_CONNECTOR, neogeo_ctrl_edge_port_device)
-SLOT_INTERFACE_EXTERN( neogeo_controls );
-SLOT_INTERFACE_EXTERN( neogeo_arc_edge );
-SLOT_INTERFACE_EXTERN( neogeo_arc_edge_fixed );
-SLOT_INTERFACE_EXTERN( neogeo_arc_pin15 );
+void neogeo_controls(device_slot_interface &device);
+void neogeo_arc_edge(device_slot_interface &device);
+void neogeo_arc_edge_fixed(device_slot_interface &device);
+void neogeo_arc_pin15(device_slot_interface &device);
#endif // MAME_BUS_NEOGEO_CTRL_CTRL_H