diff options
Diffstat (limited to 'src/devices/bus/vtech/ioexp/joystick.cpp')
-rw-r--r-- | src/devices/bus/vtech/ioexp/joystick.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/devices/bus/vtech/ioexp/joystick.cpp b/src/devices/bus/vtech/ioexp/joystick.cpp index 7570deca3b5..f54125c64ae 100644 --- a/src/devices/bus/vtech/ioexp/joystick.cpp +++ b/src/devices/bus/vtech/ioexp/joystick.cpp @@ -20,6 +20,16 @@ DEFINE_DEVICE_TYPE(VTECH_JOYSTICK_INTERFACE, vtech_joystick_interface_device, "vtech_joystick", "Laser/VZ Joystick Interface") //------------------------------------------------- +// io_map - memory space address map +//------------------------------------------------- + +void vtech_joystick_interface_device::io_map(address_map &map) +{ + map.unmap_value_high(); + map(0x20, 0x2f).r(FUNC(vtech_joystick_interface_device::joystick_r)); +} + +//------------------------------------------------- // input_ports - device-specific input ports //------------------------------------------------- @@ -66,8 +76,7 @@ ioport_constructor vtech_joystick_interface_device::device_input_ports() const //------------------------------------------------- vtech_joystick_interface_device::vtech_joystick_interface_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, VTECH_JOYSTICK_INTERFACE, tag, owner, clock), - device_vtech_ioexp_interface(mconfig, *this), + vtech_ioexp_device(mconfig, VTECH_JOYSTICK_INTERFACE, tag, owner, clock), m_joy0(*this, "joystick_0"), m_joy0_arm(*this, "joystick_0_arm"), m_joy1(*this, "joystick_1"), @@ -81,15 +90,7 @@ vtech_joystick_interface_device::vtech_joystick_interface_device(const machine_c void vtech_joystick_interface_device::device_start() { -} - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void vtech_joystick_interface_device::device_reset() -{ - io_space().install_read_handler(0x20, 0x2f, read8_delegate(FUNC(vtech_joystick_interface_device::joystick_r), this)); + vtech_ioexp_device::device_start(); } @@ -97,7 +98,7 @@ void vtech_joystick_interface_device::device_reset() // IMPLEMENTATION //************************************************************************** -READ8_MEMBER( vtech_joystick_interface_device::joystick_r ) +uint8_t vtech_joystick_interface_device::joystick_r(offs_t offset) { uint8_t data = 0xff; |