mirror of
https://github.com/holub/mame
synced 2025-07-03 09:06:08 +03:00
Expand read_line to all 0s or all 1s; fixes cases where read_line
(specifically vblank) callbacks are mapped to multiple bits.
This commit is contained in:
parent
286cfe8b08
commit
df346d7397
@ -1664,13 +1664,13 @@ ATTR_COLD void INPUT_PORTS_NAME(_name)(device_t &owner, ioport_list &portlist, a
|
|||||||
template<int (*_FunctionPointer)(device_t *)>
|
template<int (*_FunctionPointer)(device_t *)>
|
||||||
ioport_value ioport_read_line_wrapper(device_t &device, ioport_field &field, void *param)
|
ioport_value ioport_read_line_wrapper(device_t &device, ioport_field &field, void *param)
|
||||||
{
|
{
|
||||||
return (*_FunctionPointer)(&device);
|
return ((*_FunctionPointer)(&device) & 1) ? ~ioport_value(0) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
|
template<class _FunctionClass, int (_FunctionClass::*_FunctionPointer)()>
|
||||||
ioport_value ioport_read_line_wrapper(_FunctionClass &device, ioport_field &field, void *param)
|
ioport_value ioport_read_line_wrapper(_FunctionClass &device, ioport_field &field, void *param)
|
||||||
{
|
{
|
||||||
return (device.*_FunctionPointer)();
|
return ((device.*_FunctionPointer)() & 1) ? ~ioport_value(0) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<void (*_FunctionPointer)(device_t *, int)>
|
template<void (*_FunctionPointer)(device_t *, int)>
|
||||||
|
Loading…
Reference in New Issue
Block a user