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/newbrain | |
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/newbrain')
-rw-r--r-- | src/devices/bus/newbrain/exp.cpp | 9 | ||||
-rw-r--r-- | src/devices/bus/newbrain/exp.h | 2 | ||||
-rw-r--r-- | src/devices/bus/newbrain/fdc.cpp | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/devices/bus/newbrain/exp.cpp b/src/devices/bus/newbrain/exp.cpp index 7a27758764a..b4675c3b89f 100644 --- a/src/devices/bus/newbrain/exp.cpp +++ b/src/devices/bus/newbrain/exp.cpp @@ -137,7 +137,8 @@ void newbrain_expansion_slot_device::iorq_w(address_space &space, offs_t offset, #include "eim.h" #include "fdc.h" -SLOT_INTERFACE_START( newbrain_expansion_cards ) - SLOT_INTERFACE("eim", NEWBRAIN_EIM) - SLOT_INTERFACE("fdc", NEWBRAIN_FDC) -SLOT_INTERFACE_END +void newbrain_expansion_cards(device_slot_interface &device) +{ + device.option_add("eim", NEWBRAIN_EIM); + device.option_add("fdc", NEWBRAIN_FDC); +} diff --git a/src/devices/bus/newbrain/exp.h b/src/devices/bus/newbrain/exp.h index 219c819d575..e3ab89a35ef 100644 --- a/src/devices/bus/newbrain/exp.h +++ b/src/devices/bus/newbrain/exp.h @@ -117,7 +117,7 @@ protected: DECLARE_DEVICE_TYPE(NEWBRAIN_EXPANSION_SLOT, newbrain_expansion_slot_device) -SLOT_INTERFACE_EXTERN( newbrain_expansion_cards ); +void newbrain_expansion_cards(device_slot_interface &device); diff --git a/src/devices/bus/newbrain/fdc.cpp b/src/devices/bus/newbrain/fdc.cpp index 9d59cd672bc..524bbbbeaec 100644 --- a/src/devices/bus/newbrain/fdc.cpp +++ b/src/devices/bus/newbrain/fdc.cpp @@ -94,9 +94,10 @@ void newbrain_fdc_device::newbrain_fdc_io(address_map &map) // newbrain_floppies //------------------------------------------------- -static SLOT_INTERFACE_START( newbrain_floppies ) - SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) -SLOT_INTERFACE_END +static void newbrain_floppies(device_slot_interface &device) +{ + device.option_add("525dd", FLOPPY_525_DD); +} //------------------------------------------------- |