diff options
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 |
commit | 32a73f450da82c345b0f694bee311af34a5e717d (patch) | |
tree | de6259ee4c0120e992f348afcc9078e16bbe49d4 /src/mame/drivers/interpro.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/mame/drivers/interpro.cpp')
-rw-r--r-- | src/mame/drivers/interpro.cpp | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/src/mame/drivers/interpro.cpp b/src/mame/drivers/interpro.cpp index a7126aa3525..9449f6001b2 100644 --- a/src/mame/drivers/interpro.cpp +++ b/src/mame/drivers/interpro.cpp @@ -471,10 +471,11 @@ FLOPPY_FORMATS_MEMBER(interpro_state::floppy_formats) FLOPPY_PC_FORMAT FLOPPY_FORMATS_END -static SLOT_INTERFACE_START(interpro_floppies) - SLOT_INTERFACE("525dd", FLOPPY_525_DD) - SLOT_INTERFACE("35hd", FLOPPY_35_HD) -SLOT_INTERFACE_END +static void interpro_floppies(device_slot_interface &device) +{ + device.option_add("525dd", FLOPPY_525_DD); + device.option_add("35hd", FLOPPY_35_HD); +} MACHINE_CONFIG_START(interpro_state::interpro_scc1) MCFG_DEVICE_MODIFY(INTERPRO_SCC1_TAG) @@ -511,18 +512,21 @@ MACHINE_CONFIG_START(interpro_state::interpro_scc2) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(INTERPRO_SCC2_TAG, z80scc_device, ctsb_w)) MACHINE_CONFIG_END -static SLOT_INTERFACE_START(interpro_scsi_devices) - SLOT_INTERFACE("harddisk", NSCSI_HARDDISK) - SLOT_INTERFACE("cdrom", NSCSI_CDROM) -SLOT_INTERFACE_END +static void interpro_scsi_devices(device_slot_interface &device) +{ + device.option_add("harddisk", NSCSI_HARDDISK); + device.option_add("cdrom", NSCSI_CDROM); +} -static SLOT_INTERFACE_START(turquoise_scsi_devices) - SLOT_INTERFACE_INTERNAL(INTERPRO_SCSI_ADAPTER_TAG, NCR53C90A) -SLOT_INTERFACE_END +static void turquoise_scsi_devices(device_slot_interface &device) +{ + device.option_add_internal(INTERPRO_SCSI_ADAPTER_TAG, NCR53C90A); +} -static SLOT_INTERFACE_START(sapphire_scsi_devices) - SLOT_INTERFACE_INTERNAL(INTERPRO_SCSI_ADAPTER_TAG, NCR53C94) -SLOT_INTERFACE_END +static void sapphire_scsi_devices(device_slot_interface &device) +{ + device.option_add_internal(INTERPRO_SCSI_ADAPTER_TAG, NCR53C94); +} void interpro_state::interpro_scsi_adapter(device_t *device) { @@ -645,7 +649,7 @@ MACHINE_CONFIG_START(turquoise_state::turquoise) // scsi controller MCFG_NSCSI_ADD(INTERPRO_SCSI_TAG ":7", turquoise_scsi_devices, INTERPRO_SCSI_ADAPTER_TAG, true) - MCFG_DEVICE_CARD_MACHINE_CONFIG(INTERPRO_SCSI_ADAPTER_TAG, interpro_scsi_adapter) + MCFG_SLOT_OPTION_MACHINE_CONFIG(INTERPRO_SCSI_ADAPTER_TAG, interpro_scsi_adapter) // ethernet controller MCFG_DEVICE_ADD(INTERPRO_ETH_TAG, I82586, 0) @@ -697,7 +701,7 @@ MACHINE_CONFIG_START(sapphire_state::sapphire) // scsi controller MCFG_NSCSI_ADD(INTERPRO_SCSI_TAG ":7", sapphire_scsi_devices, INTERPRO_SCSI_ADAPTER_TAG, true) - MCFG_DEVICE_CARD_MACHINE_CONFIG(INTERPRO_SCSI_ADAPTER_TAG, interpro_scsi_adapter) + MCFG_SLOT_OPTION_MACHINE_CONFIG(INTERPRO_SCSI_ADAPTER_TAG, interpro_scsi_adapter) // ethernet controller MCFG_DEVICE_ADD(INTERPRO_ETH_TAG, I82596_LE16, XTAL(20'000'000)) |