mirror of
https://github.com/holub/mame
synced 2025-04-21 16:01:56 +03:00
Readd type checking to late-binding delegates. This is generally used in
a limited capacity (e.g., for devices), but the existing copy-and-rebind code would just cast the bound object without verifying the pointer was of the correct type or pointing to the correct class in the hierarchy. Objects that are late-bound must be derived from the delegate_late_bind class at some point so that a dynamic_cast from delegate_late_bind to the appropriate type succeeds. Updated the address map and custom NVRAM handlers to do the right thing with their re-binding.
This commit is contained in:
parent
8791d827c0
commit
fda7ea574d
@ -140,6 +140,17 @@ class delegate_generic_class;
|
||||
#endif
|
||||
|
||||
|
||||
// ======================> delegate_late_bind
|
||||
|
||||
// simple polymorphic class that must be mixed into any object that is late-bound
|
||||
class delegate_late_bind
|
||||
{
|
||||
public:
|
||||
delegate_late_bind() { }
|
||||
virtual ~delegate_late_bind() { }
|
||||
};
|
||||
|
||||
|
||||
// ======================> delegate_traits
|
||||
|
||||
// delegate_traits is a meta-template that is used to provide a static function pointer
|
||||
@ -254,15 +265,17 @@ struct delegate_raw_mfp
|
||||
template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam>
|
||||
class delegate_base
|
||||
{
|
||||
typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object);
|
||||
typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func;
|
||||
|
||||
public:
|
||||
// generic constructor
|
||||
delegate_base()
|
||||
: m_name(NULL),
|
||||
m_function(NULL),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL) { }
|
||||
m_callobject(NULL),
|
||||
m_function(NULL),
|
||||
m_latebinder(NULL) { }
|
||||
|
||||
// copy constructor
|
||||
delegate_base(const delegate_base &src)
|
||||
@ -270,25 +283,27 @@ public:
|
||||
m_object(src.m_object),
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction) { }
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { }
|
||||
|
||||
// copy constructor with re-bind
|
||||
template<class _FunctionClass>
|
||||
delegate_base(const delegate_base &src, _FunctionClass *object)
|
||||
// copy constructor with late bind
|
||||
delegate_base(const delegate_base &src, delegate_late_bind &object)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_callobject(src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { late_bind(object); }
|
||||
|
||||
// construct from member function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_function(&delegate_base::method_stub<_FunctionClass>),
|
||||
m_object(NULL),
|
||||
m_callobject(reinterpret_cast<delegate_generic_class *>(this)),
|
||||
m_rawfunction(funcptr) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_function(&delegate_base::method_stub<_FunctionClass>),
|
||||
m_rawfunction(funcptr),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// construct from static function with object pointer
|
||||
template<class _FunctionClass>
|
||||
@ -296,7 +311,8 @@ public:
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// construct from static reference function with object pointer
|
||||
template<class _FunctionClass>
|
||||
@ -304,7 +320,8 @@ public:
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_callobject(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// copy operator
|
||||
delegate_base &operator=(const delegate_base &src)
|
||||
@ -316,6 +333,7 @@ public:
|
||||
m_callobject = src.is_mfp() ? reinterpret_cast<delegate_generic_class *>(this) : src.m_object;
|
||||
m_function = src.m_function;
|
||||
m_rawfunction = src.m_rawfunction;
|
||||
m_latebinder = src.m_latebinder;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -338,24 +356,8 @@ public:
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_callobject, p1, p2, p3); }
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_callobject, p1, p2, p3, p4); }
|
||||
|
||||
// static stub creators
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
// late binding
|
||||
void late_bind(delegate_late_bind &object) { bind((*m_latebinder)(object)); }
|
||||
|
||||
protected:
|
||||
// bind the actual object
|
||||
@ -414,12 +416,20 @@ protected:
|
||||
return (reinterpret_cast<_FunctionClass *>(_this->m_object)->*mfp)(p1, p2, p3, p4);
|
||||
}
|
||||
|
||||
// late binding helper
|
||||
template<class _FunctionClass>
|
||||
static delegate_generic_class *late_bind_helper(delegate_late_bind &object)
|
||||
{
|
||||
return reinterpret_cast<delegate_generic_class *>(dynamic_cast<_FunctionClass *>(&object));
|
||||
}
|
||||
|
||||
// internal state
|
||||
const char * m_name; // name string
|
||||
generic_static_func m_function; // generic static function pointer
|
||||
delegate_raw_mfp m_rawfunction; // copy of raw MFP
|
||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||
delegate_generic_class * m_callobject; // pointer to the object used for calling
|
||||
generic_static_func m_function; // generic static function pointer
|
||||
delegate_raw_mfp m_rawfunction; // copy of raw MFP
|
||||
late_bind_func m_latebinder; // late binding helper
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -488,6 +498,7 @@ struct delegate_internal_mfp
|
||||
template<typename _ReturnType, typename _P1Type = _noparam, typename _P2Type = _noparam, typename _P3Type = _noparam, typename _P4Type = _noparam>
|
||||
class delegate_base
|
||||
{
|
||||
typedef delegate_generic_class *(*late_bind_func)(delegate_late_bind &object);
|
||||
typedef typename delegate_traits<delegate_generic_class, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type generic_static_func;
|
||||
|
||||
public:
|
||||
@ -495,22 +506,24 @@ public:
|
||||
delegate_base()
|
||||
: m_name(NULL),
|
||||
m_object(NULL),
|
||||
m_function(NULL) { }
|
||||
m_function(NULL),
|
||||
m_latebinder(NULL) { }
|
||||
|
||||
// copy constructor
|
||||
delegate_base(const delegate_base &src)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction) { }
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { }
|
||||
|
||||
// copy constructor with re-bind
|
||||
template<class _FunctionClass>
|
||||
delegate_base(const delegate_base &src, _FunctionClass *object)
|
||||
// copy constructor with late bind
|
||||
delegate_base(const delegate_base &src, delegate_late_bind &object)
|
||||
: m_name(src.m_name),
|
||||
m_object(src.m_object),
|
||||
m_function(src.m_function),
|
||||
m_rawfunction(src.m_rawfunction) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_rawfunction(src.m_rawfunction),
|
||||
m_latebinder(src.m_latebinder) { late_bind(object); }
|
||||
|
||||
// construct from member function with object pointer
|
||||
template<class _FunctionClass>
|
||||
@ -518,21 +531,24 @@ public:
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_function(NULL),
|
||||
m_rawfunction(funcptr) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_rawfunction(funcptr),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// construct from static function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// construct from static reference function with object pointer
|
||||
template<class _FunctionClass>
|
||||
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
||||
: m_name(name),
|
||||
m_object(NULL),
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
m_function(reinterpret_cast<generic_static_func>(funcptr)),
|
||||
m_latebinder(&late_bind_helper<_FunctionClass>) { bind(reinterpret_cast<delegate_generic_class *>(object)); }
|
||||
|
||||
// copy operator
|
||||
delegate_base &operator=(const delegate_base &src)
|
||||
@ -543,6 +559,7 @@ public:
|
||||
m_object = src.m_object;
|
||||
m_function = src.m_function;
|
||||
m_rawfunction = src.m_rawfunction;
|
||||
m_latebinder = src.m_latebinder;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@ -565,24 +582,8 @@ public:
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3) const { return (*m_function)(m_object, p1, p2, p3); }
|
||||
_ReturnType operator()(_P1Type p1, _P2Type p2, _P3Type p3, _P4Type p4) const { return (*m_function)(m_object, p1, p2, p3, p4); }
|
||||
|
||||
// static stub creators
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
|
||||
template<class _FunctionClass, typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type _Function>
|
||||
static delegate_base static_creator(const char *name)
|
||||
{
|
||||
return delegate_base(_Function, name, (_FunctionClass *)NULL);
|
||||
}
|
||||
// late binding
|
||||
void late_bind(delegate_late_bind &object) { bind((*m_latebinder)(object)); }
|
||||
|
||||
protected:
|
||||
// bind the actual object
|
||||
@ -592,12 +593,20 @@ protected:
|
||||
if (m_object != NULL && m_rawfunction.m_function != 0)
|
||||
m_function = reinterpret_cast<generic_static_func>(m_rawfunction.convert_to_generic(m_object));
|
||||
}
|
||||
|
||||
// late binding helper
|
||||
template<class _FunctionClass>
|
||||
static delegate_generic_class *late_bind_helper(delegate_late_bind &object)
|
||||
{
|
||||
return reinterpret_cast<delegate_generic_class *>(dynamic_cast<_FunctionClass *>(&object));
|
||||
}
|
||||
|
||||
// internal state
|
||||
const char * m_name; // name string
|
||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||
generic_static_func m_function; // generic static function pointer
|
||||
delegate_internal_mfp m_rawfunction; // raw member function definition
|
||||
late_bind_func m_latebinder; // late binding helper
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -620,7 +629,7 @@ class delegate<_ReturnType ()> : public delegate_base<_ReturnType>
|
||||
public:
|
||||
delegate() : basetype() { }
|
||||
delegate(const basetype &src) : basetype(src) { }
|
||||
template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { }
|
||||
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _noparam, _noparam, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
@ -635,7 +644,7 @@ class delegate<_ReturnType (_P1Type)> : public delegate_base<_ReturnType, _P1Typ
|
||||
public:
|
||||
delegate() : basetype() { }
|
||||
delegate(const basetype &src) : basetype(src) { }
|
||||
template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { }
|
||||
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _noparam, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
@ -650,7 +659,7 @@ class delegate<_ReturnType (_P1Type, _P2Type)> : public delegate_base<_ReturnTyp
|
||||
public:
|
||||
delegate() : basetype() { }
|
||||
delegate(const basetype &src) : basetype(src) { }
|
||||
template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { }
|
||||
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _noparam, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
@ -665,7 +674,7 @@ class delegate<_ReturnType (_P1Type, _P2Type, _P3Type)> : public delegate_base<_
|
||||
public:
|
||||
delegate() : basetype() { }
|
||||
delegate(const basetype &src) : basetype(src) { }
|
||||
template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { }
|
||||
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _noparam>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
@ -680,7 +689,7 @@ class delegate<_ReturnType (_P1Type, _P2Type, _P3Type, _P4Type)> : public delega
|
||||
public:
|
||||
delegate() : basetype() { }
|
||||
delegate(const basetype &src) : basetype(src) { }
|
||||
template<class _FunctionClass> delegate(const basetype &src, _FunctionClass *object) : basetype(src, object) { }
|
||||
delegate(const basetype &src, delegate_late_bind &object) : basetype(src, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::member_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
template<class _FunctionClass> delegate(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object) : basetype(funcptr, name, object) { }
|
||||
|
@ -175,7 +175,7 @@ private:
|
||||
// ======================> device_t
|
||||
|
||||
// device_t represents a device
|
||||
class device_t
|
||||
class device_t : public delegate_late_bind
|
||||
{
|
||||
DISABLE_COPYING(device_t);
|
||||
|
||||
|
@ -96,7 +96,7 @@ void nvram_device::device_start()
|
||||
{
|
||||
// bind our handler
|
||||
if (!m_custom_handler.isnull())
|
||||
m_custom_handler = nvram_init_delegate(m_custom_handler, m_owner);
|
||||
m_custom_handler = nvram_init_delegate(m_custom_handler, *m_owner);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2039,7 +2039,6 @@ void address_space::populate_from_map()
|
||||
void address_space::populate_map_entry(const address_map_entry &entry, read_or_write readorwrite)
|
||||
{
|
||||
const map_handler_data &data = (readorwrite == ROW_READ) ? entry.m_read : entry.m_write;
|
||||
void *object;
|
||||
device_t *device;
|
||||
|
||||
// based on the handler type, alter the bits, name, funcptr, and object
|
||||
@ -2067,25 +2066,25 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
|
||||
break;
|
||||
|
||||
case AMH_DEVICE_DELEGATE:
|
||||
object = machine().device(data.m_tag);
|
||||
if (object == NULL)
|
||||
device = machine().device(data.m_tag);
|
||||
if (device == NULL)
|
||||
throw emu_fatalerror("Attempted to map a non-existent device '%s' in space %s of device '%s'\n", data.m_tag, m_name, m_device.tag());
|
||||
|
||||
if (readorwrite == ROW_READ)
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, object), data.m_mask); break;
|
||||
case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, object), data.m_mask); break;
|
||||
case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, object), data.m_mask); break;
|
||||
case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, object), data.m_mask); break;
|
||||
case 8: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read8_delegate(entry.m_rproto8, *device), data.m_mask); break;
|
||||
case 16: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read16_delegate(entry.m_rproto16, *device), data.m_mask); break;
|
||||
case 32: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read32_delegate(entry.m_rproto32, *device), data.m_mask); break;
|
||||
case 64: install_read_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, read64_delegate(entry.m_rproto64, *device), data.m_mask); break;
|
||||
}
|
||||
else
|
||||
switch (data.m_bits)
|
||||
{
|
||||
case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, object), data.m_mask); break;
|
||||
case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, object), data.m_mask); break;
|
||||
case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, object), data.m_mask); break;
|
||||
case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, object), data.m_mask); break;
|
||||
case 8: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write8_delegate(entry.m_wproto8, *device), data.m_mask); break;
|
||||
case 16: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write16_delegate(entry.m_wproto16, *device), data.m_mask); break;
|
||||
case 32: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write32_delegate(entry.m_wproto32, *device), data.m_mask); break;
|
||||
case 64: install_write_handler(entry.m_addrstart, entry.m_addrend, entry.m_addrmask, entry.m_addrmirror, write64_delegate(entry.m_wproto64, *device), data.m_mask); break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user