summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-14 11:50:06 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-14 11:50:06 +1000
commitfea19bd797502a8d7d785f3c9ed758af9b759c42 (patch)
tree076a93409e437be2ec26cfb34473e82c69f8de91
parentdb2c8c9555c6e698e946b7b73a1f552c174b1272 (diff)
and another thing (nw)
-rw-r--r--src/devices/bus/nes/ggenie.cpp8
-rw-r--r--src/devices/bus/nes/nes_slot.h13
-rw-r--r--src/devices/bus/snes/sgb.cpp4
-rw-r--r--src/mame/drivers/nes.cpp2
4 files changed, 16 insertions, 11 deletions
diff --git a/src/devices/bus/nes/ggenie.cpp b/src/devices/bus/nes/ggenie.cpp
index dc58fbf8205..783121a2fe5 100644
--- a/src/devices/bus/nes/ggenie.cpp
+++ b/src/devices/bus/nes/ggenie.cpp
@@ -258,7 +258,7 @@ READ8_MEMBER(nes_ggenie_device::nt_r)
// device_add_mconfig - add device configuration
//-------------------------------------------------
-MACHINE_CONFIG_START(nes_ggenie_device::device_add_mconfig)
- MCFG_NES_CARTRIDGE_ADD("gg_slot", DERIVED_CLOCK(1, 1), nes_cart, nullptr)
- MCFG_NES_CARTRIDGE_NOT_MANDATORY
-MACHINE_CONFIG_END
+void nes_ggenie_device::device_add_mconfig(machine_config &config)
+{
+ NES_CART_SLOT(config, "gg_slot", DERIVED_CLOCK(1, 1), nes_cart, nullptr).set_must_be_loaded(false);
+}
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index 989f7e93d68..6ae818c841d 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -339,6 +339,15 @@ class nes_cart_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&opts, const char *dflt)
+ : nes_cart_slot_device(mconfig, tag, owner, clock)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_cart_slot_device();
@@ -414,10 +423,6 @@ DECLARE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device)
#define NESSLOT_CHRROM_REGION_TAG ":cart:chr_rom"
-#define MCFG_NES_CARTRIDGE_ADD(_tag, _clock, _slot_intf, _def_slot) \
- MCFG_DEVICE_ADD(_tag, NES_CART_SLOT, _clock) \
- MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
-
#define MCFG_NES_CARTRIDGE_NOT_MANDATORY \
static_cast<nes_cart_slot_device *>(device)->set_must_be_loaded(false);
diff --git a/src/devices/bus/snes/sgb.cpp b/src/devices/bus/snes/sgb.cpp
index 7f5cd1d5eee..e27c1e37fa9 100644
--- a/src/devices/bus/snes/sgb.cpp
+++ b/src/devices/bus/snes/sgb.cpp
@@ -167,7 +167,7 @@ MACHINE_CONFIG_START(sns_rom_sgb1_device::device_add_mconfig)
MCFG_LR35902_TIMER_CB(WRITE8(*this, sns_rom_sgb_device, gb_timer_callback))
MCFG_LR35902_HALT_BUG
- MCFG_SGB_PPU_ADD("sgb_ppu", "sgb_cpu")
+ MCFG_DEVICE_ADD("sgb_ppu", SGB_PPU, "sgb_cpu")
MCFG_DEVICE_ADD("sgb_apu", DMG_APU, 4295454)
@@ -193,7 +193,7 @@ MACHINE_CONFIG_START(sns_rom_sgb2_device::device_add_mconfig)
MCFG_LR35902_TIMER_CB(WRITE8(*this, sns_rom_sgb_device, gb_timer_callback))
MCFG_LR35902_HALT_BUG
- MCFG_SGB_PPU_ADD("sgb_ppu", "sgb_cpu")
+ MCFG_DEVICE_ADD("sgb_ppu", SGB_PPU, "sgb_cpu")
MCFG_DEVICE_ADD("sgb_apu", DMG_APU, XTAL(4'194'304))
diff --git a/src/mame/drivers/nes.cpp b/src/mame/drivers/nes.cpp
index a6cc9a51b5d..0583a6b1ea1 100644
--- a/src/mame/drivers/nes.cpp
+++ b/src/mame/drivers/nes.cpp
@@ -79,7 +79,7 @@ MACHINE_CONFIG_START(nes_state::nes)
MCFG_NES_CONTROL_PORT_ADD("ctrl2", nes_control_port2_devices, "joypad")
MCFG_NESCTRL_BRIGHTPIXEL_CB(nes_state, bright_pixel)
- MCFG_NES_CARTRIDGE_ADD("nes_slot", NTSC_APU_CLOCK, nes_cart, nullptr)
+ MCFG_DEVICE_ADD("nes_slot", NES_CART_SLOT, NTSC_APU_CLOCK, nes_cart, nullptr)
MCFG_SOFTWARE_LIST_ADD("cart_list", "nes")
MCFG_SOFTWARE_LIST_ADD("ade_list", "nes_ade") // Camerica/Codemasters Aladdin Deck Enhancer mini-carts
MCFG_SOFTWARE_LIST_ADD("ntb_list", "nes_ntbrom") // Sunsoft Nantettate! Baseball mini-carts