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/vtech/memexp | |
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/vtech/memexp')
-rw-r--r-- | src/devices/bus/vtech/memexp/carts.cpp | 21 | ||||
-rw-r--r-- | src/devices/bus/vtech/memexp/carts.h | 2 | ||||
-rw-r--r-- | src/devices/bus/vtech/memexp/floppy.cpp | 7 |
3 files changed, 16 insertions, 14 deletions
diff --git a/src/devices/bus/vtech/memexp/carts.cpp b/src/devices/bus/vtech/memexp/carts.cpp index 9ca95b56dee..41bd9d42c0f 100644 --- a/src/devices/bus/vtech/memexp/carts.cpp +++ b/src/devices/bus/vtech/memexp/carts.cpp @@ -16,13 +16,14 @@ #include "wordpro.h" -SLOT_INTERFACE_START( vtech_memexp_carts ) - SLOT_INTERFACE("floppy", VTECH_FLOPPY_CONTROLLER) - SLOT_INTERFACE("laser110_16k", VTECH_LASER110_16K) - SLOT_INTERFACE("laser210_16k", VTECH_LASER210_16K) - SLOT_INTERFACE("laser310_16k", VTECH_LASER310_16K) - SLOT_INTERFACE("laser_64k", VTECH_LASER_64K) - SLOT_INTERFACE("rs232", VTECH_RS232_INTERFACE) - SLOT_INTERFACE("rtty", VTECH_RTTY_INTERFACE) - SLOT_INTERFACE("wordpro", VTECH_WORDPRO) -SLOT_INTERFACE_END +void vtech_memexp_carts(device_slot_interface &device) +{ + device.option_add("floppy", VTECH_FLOPPY_CONTROLLER); + device.option_add("laser110_16k", VTECH_LASER110_16K); + device.option_add("laser210_16k", VTECH_LASER210_16K); + device.option_add("laser310_16k", VTECH_LASER310_16K); + device.option_add("laser_64k", VTECH_LASER_64K); + device.option_add("rs232", VTECH_RS232_INTERFACE); + device.option_add("rtty", VTECH_RTTY_INTERFACE); + device.option_add("wordpro", VTECH_WORDPRO); +} diff --git a/src/devices/bus/vtech/memexp/carts.h b/src/devices/bus/vtech/memexp/carts.h index f8baa314256..b0ab76dd4d8 100644 --- a/src/devices/bus/vtech/memexp/carts.h +++ b/src/devices/bus/vtech/memexp/carts.h @@ -11,6 +11,6 @@ #pragma once -SLOT_INTERFACE_EXTERN( vtech_memexp_carts ); +void vtech_memexp_carts(device_slot_interface &device); #endif // MAME_BUS_VTECH_MEMEXP_CARTS_H diff --git a/src/devices/bus/vtech/memexp/floppy.cpp b/src/devices/bus/vtech/memexp/floppy.cpp index 0788a653012..51410184e6c 100644 --- a/src/devices/bus/vtech/memexp/floppy.cpp +++ b/src/devices/bus/vtech/memexp/floppy.cpp @@ -45,9 +45,10 @@ const tiny_rom_entry *vtech_floppy_controller_device::device_rom_region() const // device_add_mconfig - add device configuration //------------------------------------------------- -static SLOT_INTERFACE_START( laser_floppies ) - SLOT_INTERFACE("525", FLOPPY_525_SSSD) -SLOT_INTERFACE_END +static void laser_floppies(device_slot_interface &device) +{ + device.option_add("525", FLOPPY_525_SSSD); +} MACHINE_CONFIG_START(vtech_floppy_controller_device::device_add_mconfig) MCFG_MEMEXP_SLOT_ADD("mem") |