summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2018-11-15 20:22:45 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2018-11-15 20:22:45 +0100
commitd14efd5e7222db043a5303725b2bc33e14d183c4 (patch)
tree579cbd172c4652f705d08eb0480812a6a8bb51c4
parent00391d612427abc5f36c19633dab624debe77ebf (diff)
gayle: removed MCFG macros (nw)
-rw-r--r--src/devices/machine/gayle.cpp3
-rw-r--r--src/devices/machine/gayle.h35
-rw-r--r--src/mame/drivers/amiga.cpp26
3 files changed, 22 insertions, 42 deletions
diff --git a/src/devices/machine/gayle.cpp b/src/devices/machine/gayle.cpp
index 1c0326b0ae6..0115c7f7a24 100644
--- a/src/devices/machine/gayle.cpp
+++ b/src/devices/machine/gayle.cpp
@@ -58,6 +58,9 @@ void gayle_device::device_start()
m_cs0_write.resolve_safe();
m_cs1_read.resolve_safe(0xffff);
m_cs1_write.resolve_safe();
+
+ save_item(NAME(m_gayle_id_count));
+ save_item(NAME(m_gayle_reg));
}
//-------------------------------------------------
diff --git a/src/devices/machine/gayle.h b/src/devices/machine/gayle.h
index 64a75c6f518..20c554adf34 100644
--- a/src/devices/machine/gayle.h
+++ b/src/devices/machine/gayle.h
@@ -14,31 +14,6 @@
#pragma once
-
-//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-#define MCFG_GAYLE_ADD(_tag, _clock, _id) \
- MCFG_DEVICE_ADD(_tag, GAYLE, _clock) \
- downcast<gayle_device &>(*device).set_id(_id);
-
-#define MCFG_GAYLE_INT2_HANDLER(_devcb) \
- downcast<gayle_device &>(*device).set_int2_handler(DEVCB_##_devcb);
-
-#define MCFG_GAYLE_CS0_READ_HANDLER(_devcb) \
- downcast<gayle_device &>(*device).set_cs0_read_handler(DEVCB_##_devcb);
-
-#define MCFG_GAYLE_CS0_WRITE_HANDLER(_devcb) \
- downcast<gayle_device &>(*device).set_cs0_write_handler(DEVCB_##_devcb);
-
-#define MCFG_GAYLE_CS1_READ_HANDLER(_devcb) \
- downcast<gayle_device &>(*device).set_cs1_read_handler(DEVCB_##_devcb);
-
-#define MCFG_GAYLE_CS1_WRITE_HANDLER(_devcb) \
- downcast<gayle_device &>(*device).set_cs1_write_handler(DEVCB_##_devcb);
-
-
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -52,11 +27,11 @@ public:
gayle_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
- template <class Object> devcb_base &set_int2_handler(Object &&cb) { return m_int2_w.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cs0_read_handler(Object &&cb) { return m_cs0_read.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cs0_write_handler(Object &&cb) { return m_cs0_write.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cs1_read_handler(Object &&cb) { return m_cs1_read.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_cs1_write_handler(Object &&cb) { return m_cs1_write.set_callback(std::forward<Object>(cb)); }
+ auto int2_handler() { return m_int2_w.bind(); }
+ auto cs0_read_handler() { return m_cs0_read.bind(); }
+ auto cs0_write_handler() { return m_cs0_write.bind(); }
+ auto cs1_read_handler() { return m_cs1_read.bind(); }
+ auto cs1_write_handler() { return m_cs1_write.bind(); }
// interface
DECLARE_WRITE_LINE_MEMBER( ide_interrupt_w );
diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp
index 7393be9ae4c..adcd3b1c9ab 100644
--- a/src/mame/drivers/amiga.cpp
+++ b/src/mame/drivers/amiga.cpp
@@ -1932,12 +1932,13 @@ MACHINE_CONFIG_START(a600_state::a600)
ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map16).set_options(ENDIANNESS_BIG, 16, 22, 0x200000);
- MCFG_GAYLE_ADD("gayle", amiga_state::CLK_28M_PAL / 2, a600_state::GAYLE_ID)
- MCFG_GAYLE_INT2_HANDLER(WRITELINE(*this, a600_state, gayle_int2_w))
- MCFG_GAYLE_CS0_READ_HANDLER(READ16("ata", ata_interface_device, cs0_r))
- MCFG_GAYLE_CS0_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs0_w))
- MCFG_GAYLE_CS1_READ_HANDLER(READ16("ata", ata_interface_device, cs1_r))
- MCFG_GAYLE_CS1_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs1_w))
+ gayle_device &gayle(GAYLE(config, "gayle", amiga_state::CLK_28M_PAL / 2));
+ gayle.set_id(a600_state::GAYLE_ID);
+ gayle.int2_handler().set(FUNC(a600_state::gayle_int2_w));
+ gayle.cs0_read_handler().set("ata", FUNC(ata_interface_device::cs0_r));
+ gayle.cs0_write_handler().set("ata", FUNC(ata_interface_device::cs0_w));
+ gayle.cs1_read_handler().set("ata", FUNC(ata_interface_device::cs1_r));
+ gayle.cs1_write_handler().set("ata", FUNC(ata_interface_device::cs1_w));
ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false));
ata.irq_handler().set("gayle", FUNC(gayle_device::ide_interrupt_w));
@@ -1989,12 +1990,13 @@ MACHINE_CONFIG_START(a1200_state::a1200)
MCFG_VIDEO_START_OVERRIDE(amiga_state, amiga_aga)
- MCFG_GAYLE_ADD("gayle", amiga_state::CLK_28M_PAL / 2, a1200_state::GAYLE_ID)
- MCFG_GAYLE_INT2_HANDLER(WRITELINE(*this, a1200_state, gayle_int2_w))
- MCFG_GAYLE_CS0_READ_HANDLER(READ16("ata", ata_interface_device, cs0_r))
- MCFG_GAYLE_CS0_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs0_w))
- MCFG_GAYLE_CS1_READ_HANDLER(READ16("ata", ata_interface_device, cs1_r))
- MCFG_GAYLE_CS1_WRITE_HANDLER(WRITE16("ata", ata_interface_device, cs1_w))
+ gayle_device &gayle(GAYLE(config, "gayle", amiga_state::CLK_28M_PAL / 2));
+ gayle.set_id(a1200_state::GAYLE_ID);
+ gayle.int2_handler().set(FUNC(a1200_state::gayle_int2_w));
+ gayle.cs0_read_handler().set("ata", FUNC(ata_interface_device::cs0_r));
+ gayle.cs0_write_handler().set("ata", FUNC(ata_interface_device::cs0_w));
+ gayle.cs1_read_handler().set("ata", FUNC(ata_interface_device::cs1_r));
+ gayle.cs1_write_handler().set("ata", FUNC(ata_interface_device::cs1_w));
ata_interface_device &ata(ATA_INTERFACE(config, "ata").options(ata_devices, "hdd", nullptr, false));
ata.irq_handler().set("gayle", FUNC(gayle_device::ide_interrupt_w));