diff options
author | 2018-06-17 01:50:47 +1000 | |
---|---|---|
committer | 2018-06-17 01:50:47 +1000 | |
commit | b0d19b944db2b37b52ea7a636c98b2010c996a81 (patch) | |
tree | 42c1dfd2a8148f2d2ec45100083484dfcfda0717 /src/devices/bus/vcs_ctrl/ctrl.h | |
parent | 67fd77d2442fc4f1b22829171f4642df5b59a623 (diff) |
more macro removal and overload disambiguation (nw)
Diffstat (limited to 'src/devices/bus/vcs_ctrl/ctrl.h')
-rw-r--r-- | src/devices/bus/vcs_ctrl/ctrl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/devices/bus/vcs_ctrl/ctrl.h b/src/devices/bus/vcs_ctrl/ctrl.h index 4e098548329..2018d70ba34 100644 --- a/src/devices/bus/vcs_ctrl/ctrl.h +++ b/src/devices/bus/vcs_ctrl/ctrl.h @@ -85,14 +85,14 @@ public: // pin 8 - GND // bit 6 - pin 9 - // - uint8_t joy_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_joy_r(); return data; } - DECLARE_READ8_MEMBER( joy_r ) { return joy_r(); } - uint8_t pot_x_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_pot_x_r(); return data; } - DECLARE_READ8_MEMBER( pot_x_r ) { return pot_x_r(); } - uint8_t pot_y_r() { uint8_t data = 0xff; if (exists()) data = m_device->vcs_pot_y_r(); return data; } - DECLARE_READ8_MEMBER( pot_y_r ) { return pot_y_r(); } - - void joy_w( uint8_t data ) { if ( exists() ) m_device->vcs_joy_w( data ); } + uint8_t read_joy() { return exists() ? m_device->vcs_joy_r() : 0xff; } + DECLARE_READ8_MEMBER( joy_r ) { return read_joy(); } + uint8_t read_pot_x() { return exists() ? m_device->vcs_pot_x_r() : 0xff; } + DECLARE_READ8_MEMBER( pot_x_r ) { return read_pot_x(); } + uint8_t read_pot_y() { return exists() ? m_device->vcs_pot_y_r() : 0xff; } + DECLARE_READ8_MEMBER( pot_y_r ) { return read_pot_y(); } + + void joy_w(uint8_t data) { if (exists()) m_device->vcs_joy_w(data); } bool exists() { return m_device != nullptr; } bool has_pot_x() { return exists() && m_device->has_pot_x(); } |