diff options
author | 2013-01-26 18:53:13 +0000 | |
---|---|---|
committer | 2013-01-26 18:53:13 +0000 | |
commit | 31ddd3a1aa4702cf83b387b597412d3261d4e4b9 (patch) | |
tree | 2bfdb858d80fe4d73107319266b4c3fe231e555c /src/mess/machine/vcsctrl.c | |
parent | 380368e16fe8c94e2c0950e6e73df2e2e1964d40 (diff) |
(MESS) c64/c128: Implemented parallel joystick pot X/Y read. [Curt Coder]
(MESS) vcsctrl: Removed runtime tag lookups. (nw)
Diffstat (limited to 'src/mess/machine/vcsctrl.c')
-rw-r--r-- | src/mess/machine/vcsctrl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mess/machine/vcsctrl.c b/src/mess/machine/vcsctrl.c index e550b6785d9..8b7158b0cde 100644 --- a/src/mess/machine/vcsctrl.c +++ b/src/mess/machine/vcsctrl.c @@ -53,8 +53,8 @@ device_vcs_control_port_interface::~device_vcs_control_port_interface() //------------------------------------------------- vcs_control_port_device::vcs_control_port_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - device_t(mconfig, VCS_CONTROL_PORT, "Atari VCS control port", tag, owner, clock), - device_slot_interface(mconfig, *this) + device_t(mconfig, VCS_CONTROL_PORT, "Atari VCS control port", tag, owner, clock), + device_slot_interface(mconfig, *this) { } @@ -78,15 +78,17 @@ void vcs_control_port_device::device_start() } -UINT8 vcs_control_port_device::joy_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_joy_r(); return data; } +UINT8 vcs_control_port_device::joy_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_joy_r(); return data; } READ8_MEMBER( vcs_control_port_device::joy_r ) { return joy_r(); } -UINT8 vcs_control_port_device::pot_x_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_x_r(); return data; } +UINT8 vcs_control_port_device::pot_x_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_pot_x_r(); return data; } READ8_MEMBER( vcs_control_port_device::pot_x_r ) { return pot_x_r(); } -UINT8 vcs_control_port_device::pot_y_r() { UINT8 data = 0xff; if (m_device != NULL) data = m_device->vcs_pot_y_r(); return data; } +UINT8 vcs_control_port_device::pot_y_r() { UINT8 data = 0xff; if (exists()) data = m_device->vcs_pot_y_r(); return data; } READ8_MEMBER( vcs_control_port_device::pot_y_r ) { return pot_y_r(); } -void vcs_control_port_device::joy_w( UINT8 data ) { if ( m_device != NULL ) m_device->vcs_joy_w( data ); } +void vcs_control_port_device::joy_w( UINT8 data ) { if ( exists() ) m_device->vcs_joy_w( data ); } WRITE8_MEMBER( vcs_control_port_device::joy_w ) { joy_w(data); } - +bool vcs_control_port_device::exists() { return m_device != NULL; } +bool vcs_control_port_device::has_pot_x() { return exists() && m_device->has_pot_x(); } +bool vcs_control_port_device::has_pot_y() { return exists() && m_device->has_pot_y(); } //------------------------------------------------- // SLOT_INTERFACE( vcs_control_port_devices ) |