summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2014-03-18 14:15:57 +0000
committer Curt Coder <curtcoder@mail.com>2014-03-18 14:15:57 +0000
commit52ca000b5bfc0ef1356d4911098acba146ecc0a8 (patch)
treeca762107cbed91e99bcade3c989b7b369bcf9315 /src/mess
parentd7e58e18cd8b93575f56a01490f60cdb5d64f6b7 (diff)
Removed line_cb_t. (nw)
(MESS) nextkbd: devcb2. (nw)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/next.c14
-rw-r--r--src/mess/includes/next.h6
-rw-r--r--src/mess/machine/nextkbd.c17
-rw-r--r--src/mess/machine/nextkbd.h18
4 files changed, 32 insertions, 23 deletions
diff --git a/src/mess/drivers/next.c b/src/mess/drivers/next.c
index fcdf2febf7c..921c0c36df3 100644
--- a/src/mess/drivers/next.c
+++ b/src/mess/drivers/next.c
@@ -742,17 +742,17 @@ WRITE_LINE_MEMBER(next_state::scc_irq)
irq_set(17, state);
}
-void next_state::keyboard_irq(bool state)
+WRITE_LINE_MEMBER(next_state::keyboard_irq)
{
irq_set(3, state);
}
-void next_state::power_irq(bool state)
+WRITE_LINE_MEMBER(next_state::power_irq)
{
irq_set(2, state);
}
-void next_state::nmi_irq(bool state)
+WRITE_LINE_MEMBER(next_state::nmi_irq)
{
irq_set(31, state);
}
@@ -963,10 +963,10 @@ static MACHINE_CONFIG_START( next_base, next_state )
MCFG_DEVICE_ADD("rtc", MCCS1850, XTAL_32_768kHz)
MCFG_DEVICE_ADD("scc", SCC8530, XTAL_25MHz)
MCFG_Z8530_INTRQ_CALLBACK(WRITELINE(next_state, scc_irq))
- MCFG_NEXTKBD_ADD("keyboard",
- line_cb_t(FUNC(next_state::keyboard_irq), static_cast<next_state *>(owner)),
- line_cb_t(FUNC(next_state::power_irq), static_cast<next_state *>(owner)),
- line_cb_t(FUNC(next_state::nmi_irq), static_cast<next_state *>(owner)))
+ MCFG_DEVICE_ADD("keyboard", NEXTKBD, 0)
+ MCFG_NEXTKBD_INT_CHANGE_CALLBACK(WRITELINE(next_state, keyboard_irq))
+ MCFG_NEXTKBD_INT_POWER_CALLBACK(WRITELINE(next_state, power_irq))
+ MCFG_NEXTKBD_INT_NMI_CALLBACK(WRITELINE(next_state, nmi_irq))
MCFG_NSCSI_ADD("scsibus:0", next_scsi_devices, "cdrom", false)
MCFG_NSCSI_ADD("scsibus:1", next_scsi_devices, "harddisk", false)
MCFG_NSCSI_ADD("scsibus:2", next_scsi_devices, 0, false)
diff --git a/src/mess/includes/next.h b/src/mess/includes/next.h
index c9e25e905e7..3b212a9aafb 100644
--- a/src/mess/includes/next.h
+++ b/src/mess/includes/next.h
@@ -95,9 +95,9 @@ public:
UINT32 eventc_latch;
DECLARE_WRITE_LINE_MEMBER(scc_irq);
- void keyboard_irq(bool state);
- void power_irq(bool state);
- void nmi_irq(bool state);
+ DECLARE_WRITE_LINE_MEMBER(keyboard_irq);
+ DECLARE_WRITE_LINE_MEMBER(power_irq);
+ DECLARE_WRITE_LINE_MEMBER(nmi_irq);
DECLARE_WRITE_LINE_MEMBER(scsi_irq);
DECLARE_WRITE_LINE_MEMBER(scsi_drq);
diff --git a/src/mess/machine/nextkbd.c b/src/mess/machine/nextkbd.c
index 6967d04052b..661f2133186 100644
--- a/src/mess/machine/nextkbd.c
+++ b/src/mess/machine/nextkbd.c
@@ -9,19 +9,20 @@ DEVICE_ADDRESS_MAP_START(amap, 32, nextkbd_device)
AM_RANGE(0x8, 0xb) AM_READWRITE(data_r, data_w)
ADDRESS_MAP_END
-nextkbd_device::nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NEXTKBD, "NEXTKBD", tag, owner, clock, "nextkbd", __FILE__)
+nextkbd_device::nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, NEXTKBD, "NEXTKBD", tag, owner, clock, "nextkbd", __FILE__),
+ int_change_cb(*this),
+ int_power_cb(*this),
+ int_nmi_cb(*this)
{
}
-void nextkbd_device::setup(line_cb_t _int_change_cb, line_cb_t _int_power_cb, line_cb_t _int_nmi_cb)
-{
- int_change_cb = _int_change_cb;
- int_power_cb = _int_power_cb;
- int_nmi_cb = _int_nmi_cb;
-}
-
void nextkbd_device::device_start()
{
+ int_change_cb.resolve_safe();
+ int_power_cb.resolve_safe();
+ int_nmi_cb.resolve_safe();
+
kbd_timer = timer_alloc(0);
save_item(NAME(control));
diff --git a/src/mess/machine/nextkbd.h b/src/mess/machine/nextkbd.h
index 9c7f9b64402..9e05808c7e2 100644
--- a/src/mess/machine/nextkbd.h
+++ b/src/mess/machine/nextkbd.h
@@ -3,14 +3,22 @@
#include "emu.h"
-#define MCFG_NEXTKBD_ADD(_tag, _int_change_cb, _int_power_cb, _int_nmi_cb) \
- MCFG_DEVICE_ADD(_tag, NEXTKBD, 0) \
- downcast<nextkbd_device *>(device)->setup(_int_change_cb, _int_power_cb, _int_nmi_cb);
+#define MCFG_NEXTKBD_INT_CHANGE_CALLBACK(_write) \
+ devcb = &nextkbd_device::set_int_change_wr_callback(*device, DEVCB2_##_write);
+
+#define MCFG_NEXTKBD_INT_POWER_CALLBACK(_write) \
+ devcb = &nextkbd_device::set_int_power_wr_callback(*device, DEVCB2_##_write);
+
+#define MCFG_NEXTKBD_INT_NMI_CALLBACK(_write) \
+ devcb = &nextkbd_device::set_int_nmi_wr_callback(*device, DEVCB2_##_write);
class nextkbd_device : public device_t {
public:
nextkbd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
- void setup(line_cb_t int_change_cb, line_cb_t _int_power_cb, line_cb_t _int_nmi_cb);
+
+ template<class _Object> static devcb2_base &set_int_change_wr_callback(device_t &device, _Object object) { return downcast<nextkbd_device &>(device).int_change_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_int_power_wr_callback(device_t &device, _Object object) { return downcast<nextkbd_device &>(device).int_power_cb.set_callback(object); }
+ template<class _Object> static devcb2_base &set_int_nmi_wr_callback(device_t &device, _Object object) { return downcast<nextkbd_device &>(device).int_nmi_cb.set_callback(object); }
DECLARE_ADDRESS_MAP(amap, 32);
@@ -37,7 +45,7 @@ private:
enum { FIFO_SIZE = 32 };
enum { KEYDOWN = 0x0080, KEYVALID = 0x8000 };
- line_cb_t int_change_cb, int_power_cb, int_nmi_cb;
+ devcb2_write_line int_change_cb, int_power_cb, int_nmi_cb;
emu_timer *kbd_timer;
bool nmi_active;