summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2019-02-08 12:32:53 +0100
committer MooglyGuy <therealmogminer@gmail.com>2019-02-08 12:33:26 +0100
commit61a50c44bcd4075226cd668c5de827bf31ed8059 (patch)
tree8397d4223d9bf170a12d5ac267892d4c474f4040
parente1bed57f7dcbf7cdf59c9dc937b0e4aada50ac9a (diff)
-dmvbus, psi_kbd: Removed MCFG macros, nw
-dmv, kdt6: Removed MACHINE_CONFIG macros, nw
-rw-r--r--src/devices/bus/dmv/dmvbus.h37
-rw-r--r--src/devices/bus/psi_kbd/psi_kbd.h34
-rw-r--r--src/mame/drivers/dmv.cpp103
-rw-r--r--src/mame/drivers/kdt6.cpp18
4 files changed, 84 insertions, 108 deletions
diff --git a/src/devices/bus/dmv/dmvbus.h b/src/devices/bus/dmv/dmvbus.h
index a10eab52bc0..53140f51dbc 100644
--- a/src/devices/bus/dmv/dmvbus.h
+++ b/src/devices/bus/dmv/dmvbus.h
@@ -59,14 +59,23 @@ class dmvcart_slot_device : public device_t,
{
public:
// construction/destruction
+ template <typename T>
+ dmvcart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt)
+ : dmvcart_slot_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
dmvcart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~dmvcart_slot_device();
- template <class Object> devcb_base &set_prog_read_callback(Object &&cb) { return m_prog_read_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_prog_write_callback(Object &&cb) { return m_prog_write_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_int_callback(Object &&cb) { return m_out_int_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_out_thold_callback(Object &&cb) { return m_out_thold_cb.set_callback(std::forward<Object>(cb)); }
+ auto prog_read() { return m_prog_read_cb.bind(); }
+ auto prog_write() { return m_prog_write_cb.bind(); }
+ auto out_int() { return m_out_int_cb.bind(); }
+ auto out_irq() { return m_out_irq_cb.bind(); }
+ auto out_thold() { return m_out_thold_cb.bind(); }
// device-level overrides
virtual void device_start() override;
@@ -105,22 +114,4 @@ public:
// device type definition
DECLARE_DEVICE_TYPE(DMVCART_SLOT, dmvcart_slot_device)
-
-/***************************************************************************
- DEVICE CONFIGURATION MACROS
-***************************************************************************/
-
-#define MCFG_DMVCART_SLOT_PROGRAM_READWRITE_CB(_read_devcb, _write_devcb) \
- downcast<dmvcart_slot_device &>(*device).set_prog_read_callback(DEVCB_##_read_devcb); \
- downcast<dmvcart_slot_device &>(*device).set_prog_write_callback(DEVCB_##_write_devcb);
-
-#define MCFG_DMVCART_SLOT_OUT_INT_CB(_devcb) \
- downcast<dmvcart_slot_device &>(*device).set_out_int_callback(DEVCB_##_devcb);
-
-#define MCFG_DMVCART_SLOT_OUT_IRQ_CB(_devcb) \
- downcast<dmvcart_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);
-
-#define MCFG_DMVCART_SLOT_OUT_THOLD_CB(_devcb) \
- downcast<dmvcart_slot_device &>(*device).set_out_thold_callback(DEVCB_##_devcb);
-
#endif // MAME_BUS_DMV_DMVBUS_H
diff --git a/src/devices/bus/psi_kbd/psi_kbd.h b/src/devices/bus/psi_kbd/psi_kbd.h
index 8e62b1df17b..39aaa84d9d3 100644
--- a/src/devices/bus/psi_kbd/psi_kbd.h
+++ b/src/devices/bus/psi_kbd/psi_kbd.h
@@ -30,21 +30,8 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_PSI_KEYBOARD_INTERFACE_ADD(_tag, _def_slot) \
- MCFG_DEVICE_ADD(_tag, PSI_KEYBOARD_INTERFACE, 0) \
- MCFG_DEVICE_SLOT_INTERFACE(psi_keyboard_devices, _def_slot, false)
-
-#define MCFG_PSI_KEYBOARD_RX_HANDLER(_devcb) \
- downcast<psi_keyboard_bus_device &>(*device).set_rx_handler(DEVCB_##_devcb);
-
-#define MCFG_PSI_KEYBOARD_KEY_STROBE_HANDLER(_devcb) \
- downcast<psi_keyboard_bus_device &>(*device).set_key_strobe_handler(DEVCB_##_devcb);
-
+// supported devices
+void psi_keyboard_devices(device_slot_interface &device);
//**************************************************************************
// TYPE DEFINITIONS
@@ -58,12 +45,20 @@ class psi_keyboard_bus_device : public device_t, public device_slot_interface
{
public:
// construction/destruction
+ psi_keyboard_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *dflt)
+ : psi_keyboard_bus_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ psi_keyboard_devices(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ }
psi_keyboard_bus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~psi_keyboard_bus_device();
// callbacks
- template <class Object> devcb_base &set_rx_handler(Object &&cb) { return m_rx_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_key_strobe_handler(Object &&cb) { return m_key_strobe_handler.set_callback(std::forward<Object>(cb)); }
+ auto rx() { return m_rx_handler.bind(); }
+ auto key_strobe() { return m_key_strobe_handler.bind(); }
// called from keyboard
DECLARE_WRITE_LINE_MEMBER( rx_w ) { m_rx_handler(state); }
@@ -104,12 +99,7 @@ protected:
psi_keyboard_bus_device *m_host;
};
-
// device type definition
DECLARE_DEVICE_TYPE(PSI_KEYBOARD_INTERFACE, psi_keyboard_bus_device)
-// supported devices
-void psi_keyboard_devices(device_slot_interface &device);
-
-
#endif // MAME_BUS_PSI_KBD_PSI_KBD_H
diff --git a/src/mame/drivers/dmv.cpp b/src/mame/drivers/dmv.cpp
index d53d64d9786..ed0a40e4ea3 100644
--- a/src/mame/drivers/dmv.cpp
+++ b/src/mame/drivers/dmv.cpp
@@ -775,11 +775,12 @@ static void dmv_slot7a(device_slot_interface &device)
device.option_add("k235", DMV_K235); // K235 Internal 8088 module with interrupt controller
}
-MACHINE_CONFIG_START(dmv_state::dmv)
+void dmv_state::dmv(machine_config &config)
+{
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu",Z80, XTAL(24'000'000) / 6)
- MCFG_DEVICE_PROGRAM_MAP(dmv_mem)
- MCFG_DEVICE_IO_MAP(dmv_io)
+ Z80(config, m_maincpu, XTAL(24'000'000) / 6);
+ m_maincpu->set_addrmap(AS_PROGRAM, &dmv_state::dmv_mem);
+ m_maincpu->set_addrmap(AS_IO, &dmv_state::dmv_io);
i8741_device &kbmcu(I8741(config, "kb_ctrl_mcu", XTAL(6'000'000)));
kbmcu.p1_in_cb().set(FUNC(dmv_state::kb_mcu_port1_r)); // bit 0 data from kb
@@ -791,13 +792,13 @@ MACHINE_CONFIG_START(dmv_state::dmv)
DMV_KEYBOARD(config, m_keyboard, 0);
/* video hardware */
- MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(50)
- MCFG_SCREEN_UPDATE_DEVICE("upd7220", upd7220_device, screen_update)
- MCFG_SCREEN_SIZE(640, 400)
- MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 400-1)
+ SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
+ m_screen->set_refresh_hz(50);
+ m_screen->set_screen_update("upd7220", FUNC(upd7220_device::screen_update));
+ m_screen->set_size(640, 400);
+ m_screen->set_visarea(0, 640-1, 0, 400-1);
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_dmv)
+ GFXDECODE(config, "gfxdecode", "palette", gfx_dmv);
PALETTE(config, m_palette, palette_device::RGB_3BIT);
config.set_default_layout(layout_dmv);
@@ -836,54 +837,46 @@ MACHINE_CONFIG_START(dmv_state::dmv)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_DEVICE_ADD("speaker", SPEAKER_SOUND)
- MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
-
- MCFG_DEVICE_ADD("slot1", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot1, nullptr, false)
- MCFG_DEVICE_ADD("slot2", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2_6, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint2_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq2_w))
- MCFG_DEVICE_ADD("slot2a", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2a, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint2a_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq2a_w))
- MCFG_DEVICE_ADD("slot3", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2_6, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint3_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq3_w))
- MCFG_DEVICE_ADD("slot4", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2_6, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint4_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq4_w))
- MCFG_DEVICE_ADD("slot5", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2_6, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint5_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq5_w))
- MCFG_DEVICE_ADD("slot6", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot2_6, nullptr, false)
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint6_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq6_w))
-
- MCFG_DEVICE_ADD("slot7", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot7, nullptr, false)
- MCFG_DMVCART_SLOT_PROGRAM_READWRITE_CB(READ8(*this, dmv_state, exp_program_r), WRITE8(*this, dmv_state, exp_program_w))
- MCFG_DMVCART_SLOT_OUT_THOLD_CB(WRITELINE(*this, dmv_state, thold7_w))
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint7_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq7_w))
- MCFG_DEVICE_ADD("slot7a", DMVCART_SLOT, 0)
- MCFG_DEVICE_SLOT_INTERFACE(dmv_slot7a, "k230", false)
- MCFG_DMVCART_SLOT_PROGRAM_READWRITE_CB(READ8(*this, dmv_state, exp_program_r), WRITE8(*this, dmv_state, exp_program_w))
- MCFG_DMVCART_SLOT_OUT_THOLD_CB(WRITELINE(*this, dmv_state, thold7_w))
- MCFG_DMVCART_SLOT_OUT_INT_CB(WRITELINE(*this, dmv_state, busint7a_w))
- MCFG_DMVCART_SLOT_OUT_IRQ_CB(WRITELINE(*this, dmv_state, irq7a_w))
+ SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
+
+ DMVCART_SLOT(config, m_slot1, dmv_slot1, nullptr);
+ DMVCART_SLOT(config, m_slot2, dmv_slot2_6, nullptr);
+ m_slot2->out_int().set(FUNC(dmv_state::busint2_w));
+ m_slot2->out_irq().set(FUNC(dmv_state::irq2_w));
+ DMVCART_SLOT(config, m_slot2a, dmv_slot2a, nullptr);
+ m_slot2a->out_int().set(FUNC(dmv_state::busint2a_w));
+ m_slot2a->out_irq().set(FUNC(dmv_state::irq2a_w));
+ DMVCART_SLOT(config, m_slot3, dmv_slot2_6, nullptr);
+ m_slot3->out_int().set(FUNC(dmv_state::busint3_w));
+ m_slot3->out_irq().set(FUNC(dmv_state::irq3_w));
+ DMVCART_SLOT(config, m_slot4, dmv_slot2_6, nullptr);
+ m_slot4->out_int().set(FUNC(dmv_state::busint4_w));
+ m_slot4->out_irq().set(FUNC(dmv_state::irq4_w));
+ DMVCART_SLOT(config, m_slot5, dmv_slot2_6, nullptr);
+ m_slot5->out_int().set(FUNC(dmv_state::busint5_w));
+ m_slot5->out_irq().set(FUNC(dmv_state::irq5_w));
+ DMVCART_SLOT(config, m_slot6, dmv_slot2_6, nullptr);
+ m_slot6->out_int().set(FUNC(dmv_state::busint6_w));
+ m_slot6->out_irq().set(FUNC(dmv_state::irq6_w));
+
+ DMVCART_SLOT(config, m_slot7, dmv_slot7, nullptr);
+ m_slot7->prog_read().set(FUNC(dmv_state::exp_program_r));
+ m_slot7->prog_write().set(FUNC(dmv_state::exp_program_w));
+ m_slot7->out_thold().set(FUNC(dmv_state::thold7_w));
+ m_slot7->out_int().set(FUNC(dmv_state::busint7_w));
+ m_slot7->out_irq().set(FUNC(dmv_state::irq7_w));
+ DMVCART_SLOT(config, m_slot7a, dmv_slot7a, "k230");
+ m_slot7a->prog_read().set(FUNC(dmv_state::exp_program_r));
+ m_slot7a->prog_write().set(FUNC(dmv_state::exp_program_w));
+ m_slot7a->out_thold().set(FUNC(dmv_state::thold7_w));
+ m_slot7a->out_int().set(FUNC(dmv_state::busint7a_w));
+ m_slot7a->out_irq().set(FUNC(dmv_state::irq7a_w));
SOFTWARE_LIST(config, "flop_list").set_original("dmv");
- MCFG_QUICKLOAD_ADD("quickload", dmv_state, dmv, "com,cpm", attotime::from_seconds(3))
-
-MACHINE_CONFIG_END
+ quickload_image_device &quickload(QUICKLOAD(config, "quickload"));
+ quickload.set_handler(snapquick_load_delegate(&QUICKLOAD_LOAD_NAME(dmv_state, dmv), this), "com,cpm", attotime::from_seconds(3));
+}
/* ROM definition */
ROM_START( dmv )
diff --git a/src/mame/drivers/kdt6.cpp b/src/mame/drivers/kdt6.cpp
index 4bd47a3d7f6..b4f7df36dcd 100644
--- a/src/mame/drivers/kdt6.cpp
+++ b/src/mame/drivers/kdt6.cpp
@@ -617,16 +617,18 @@ static const z80_daisy_config daisy_chain_intf[] =
{ nullptr }
};
-MACHINE_CONFIG_START(kdt6_state::psi98)
+void kdt6_state::psi98(machine_config &config)
+{
Z80(config, m_cpu, XTAL(16'000'000) / 4);
m_cpu->set_addrmap(AS_PROGRAM, &kdt6_state::psi98_mem);
m_cpu->set_addrmap(AS_IO, &kdt6_state::psi98_io);
m_cpu->set_daisy_config(daisy_chain_intf);
// video hardware
- MCFG_SCREEN_ADD_MONOCHROME("screen", RASTER, rgb_t::green())
- MCFG_SCREEN_RAW_PARAMS(XTAL(13'516'800), 824, 48, 688, 274, 0, 250)
- MCFG_SCREEN_UPDATE_DRIVER(kdt6_state, screen_update)
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_color(rgb_t::green());
+ screen.set_raw(XTAL(13'516'800), 824, 48, 688, 274, 0, 250);
+ screen.set_screen_update(FUNC(kdt6_state::screen_update));
PALETTE(config, m_palette, palette_device::MONOCHROME);
config.set_default_layout(layout_kdt6);
@@ -718,12 +720,12 @@ MACHINE_CONFIG_START(kdt6_state::psi98)
SOFTWARE_LIST(config, "floppy_list").set_original("psi98");
- MCFG_PSI_KEYBOARD_INTERFACE_ADD("kbd", "hle")
- MCFG_PSI_KEYBOARD_RX_HANDLER(WRITELINE(*this, kdt6_state, keyboard_rx_w))
- MCFG_PSI_KEYBOARD_KEY_STROBE_HANDLER(WRITELINE("ctc2", z80ctc_device, trg1))
+ PSI_KEYBOARD_INTERFACE(config, m_keyboard, "hle");
+ m_keyboard->rx().set(FUNC(kdt6_state::keyboard_rx_w));
+ m_keyboard->key_strobe().set("ctc2", FUNC(z80ctc_device::trg1));
// 6 ECB slots
-MACHINE_CONFIG_END
+}
//**************************************************************************