vcs_ctrl: Some fixes

- Hook up trigger pin writes for currently unused callback
- Invert analog ports for paddle controller
This commit is contained in:
AJR 2022-10-18 17:31:03 -04:00
parent 8773b0f000
commit 6c5326a057
6 changed files with 18 additions and 10 deletions

View File

@ -37,6 +37,9 @@ public:
virtual bool has_pot_x() { return false; }
virtual bool has_pot_y() { return false; }
// FIXME: should be made protected when port definitions become member functions
inline void trigger_w(int state);
protected:
device_vcs_control_port_interface(const machine_config &mconfig, device_t &device);
@ -72,11 +75,11 @@ public:
// bit 1 - pin 2 - Down
// bit 2 - pin 3 - Left
// bit 3 - pin 4 - Right
// bit 4 - pin 5 -
// pin 5 - Pot X
// bit 5 - pin 6 - Button
// pin 7 - +5V
// pin 8 - GND
// bit 6 - pin 9 -
// pin 9 - Pot Y
//
uint8_t read_joy() { return exists() ? m_device->vcs_joy_r() : 0xff; }
uint8_t read_pot_x() { return exists() ? m_device->vcs_pot_x_r() : 0xff; }
@ -100,6 +103,11 @@ private:
devcb_write_line m_write_trigger;
};
inline void device_vcs_control_port_interface::trigger_w(int state)
{
m_port->trigger_w(state);
}
// device type definition
DECLARE_DEVICE_TYPE(VCS_CONTROL_PORT, vcs_control_port_device)

View File

@ -25,7 +25,7 @@ static INPUT_PORTS_START( vcs_joystick_booster )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY // Pin 2
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY // Pin 3
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY // Pin 4
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // Pin 6
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_WRITE_LINE_MEMBER(vcs_joystick_booster_device, trigger_w) // Pin 6
PORT_BIT( 0xd0, IP_ACTIVE_LOW, IPT_UNUSED )
// Pin 5

View File

@ -24,7 +24,7 @@ static INPUT_PORTS_START( vcs_joystick )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_WRITE_LINE_MEMBER(vcs_joystick_device, trigger_w)
PORT_BIT( 0xd0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END

View File

@ -28,7 +28,7 @@ DEFINE_DEVICE_TYPE(VCS_MOUSE, vcs_mouse_device, "vcs_mouse", "Atari / CBM Mouse"
static INPUT_PORTS_START( vcs_mouse )
PORT_START("JOY")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_WRITE_LINE_MEMBER(vcs_mouse_device, trigger_w)
PORT_BIT( 0xde, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("POTX")

View File

@ -20,15 +20,15 @@ DEFINE_DEVICE_TYPE(VCS_PADDLES, vcs_paddles_device, "vcs_paddles", "Atari / CBM
static INPUT_PORTS_START( vcs_paddles )
PORT_START("JOY")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) // pin 3
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // pin 4
PORT_BIT( 0xf3, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("POTX")
PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(1) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255)
PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(1) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) PORT_REVERSE // pin 5
PORT_START("POTY")
PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(2) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255)
PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_PLAYER(2) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_MINMAX(0, 255) PORT_REVERSE // pin 9
INPUT_PORTS_END

View File

@ -20,7 +20,7 @@ DEFINE_DEVICE_TYPE(VCS_WHEEL, vcs_wheel_device, "vcs_wheel", "Atari / CBM Drivin
static INPUT_PORTS_START( vcs_wheel )
PORT_START("JOY")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // Pin 6
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_WRITE_LINE_MEMBER(vcs_wheel_device, trigger_w) // Pin 6
PORT_BIT( 0xdc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("WHEEL")