summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-04-22 05:29:25 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-04-22 05:29:25 +0000
commit75160ba9c2ebfeb4d8637eeab34d546ed4bf175d (patch)
treeea86eea3953bccd9793ae3529bddc5ef91391283 /src
parent066015be04ea6e152024f36aaf8a21ef0b426580 (diff)
For 16-bit devcb handlers, use separately-named templates
devcb_stub16, which in turn required new macros DEVCB_MEMBER16, DEVCB_DRIVER_MEMBER16, and DEVCB_DEVICE_MEMBER16. Sorry about this, but the differences between the function types is apparently not sufficient for proper template differentiation under MSVC.
Diffstat (limited to 'src')
-rw-r--r--src/emu/devcb.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 5d377e86306..2df5b6e1b39 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -117,7 +117,7 @@ UINT8 devcb_stub(device_t *device, offs_t offset)
// static template for a read16 stub function that calls through a given READ16_MEMBER
template<class _Class, UINT16 (_Class::*_Function)(address_space &, offs_t, UINT16)>
-UINT16 devcb_stub(device_t *device, offs_t offset, UINT16 mask=0xffff)
+UINT16 devcb_stub16(device_t *device, offs_t offset, UINT16 mask=0xffff)
{
_Class *target = downcast<_Class *>(device);
return (target->*_Function)(*device->machine().memory().first_space(), offset, mask);
@@ -141,7 +141,7 @@ void devcb_stub(device_t *device, offs_t offset, UINT8 data)
// static template for a write16 stub function that calls through a given WRITE16_MEMBER
template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT16, UINT16)>
-void devcb_stub(device_t *device, offs_t offset, UINT16 data, UINT16 mask=0xffff)
+void devcb_stub16(device_t *device, offs_t offset, UINT16 data, UINT16 mask=0xffff)
{
_Class *target = downcast<_Class *>(device);
(target->*_Function)(*device->machine().memory().first_space(), offset, data, mask);
@@ -154,16 +154,19 @@ void devcb_stub(device_t *device, offs_t offset, UINT16 data, UINT16 mask=0xffff
#define DEVCB_LINE_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, "", #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL, NULL }
#define DEVCB_HANDLER(func) { DEVCB_TYPE_DEVICE, 0, "", #func, NULL, func, NULL }
#define DEVCB_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, "", #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb>, NULL }
+#define DEVCB_MEMBER16(cls,memb) { DEVCB_TYPE_DEVICE, 0, "", #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb>, NULL }
// line or read/write handlers for the driver device
#define DEVCB_DRIVER_LINE_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL, NULL }
#define DEVCB_DRIVER_MEMBER(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb>, NULL }
+#define DEVCB_DRIVER_MEMBER16(cls,memb) { DEVCB_TYPE_DEVICE, 0, ":", #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb>, NULL }
// line or read/write handlers for another device
#define DEVCB_DEVICE_LINE(tag,func) { DEVCB_TYPE_DEVICE, 0, tag, #func, func, NULL, NULL }
#define DEVCB_DEVICE_LINE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, &devcb_line_stub<cls, &cls::memb>, NULL, NULL }
#define DEVCB_DEVICE_HANDLER(tag,func) { DEVCB_TYPE_DEVICE, 0, tag, #func, NULL, func, NULL }
#define DEVCB_DEVICE_MEMBER(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub<cls, &cls::memb>, NULL }
+#define DEVCB_DEVICE_MEMBER16(tag,cls,memb) { DEVCB_TYPE_DEVICE, 0, tag, #cls "::" #memb, NULL, &devcb_stub16<cls, &cls::memb>, NULL }
// constant values
#define DEVCB_CONSTANT(value) { DEVCB_TYPE_CONSTANT, value, NULL, NULL, NULL, NULL }