Skip to content

Commit

Permalink
atari:joystick: fix fire button reporting
Browse files Browse the repository at this point in the history
As port 0 is supposed to be always occupied by mouse, fire button on
port 1 is never reported as part of the joystick packet.

This is because the right mouse button on port 0 is wired to the fire
button on port 1 and IKBD reports fire button on port 1 only if mouse
reporting on port 0 is disabled (what we certainly don't want).
  • Loading branch information
mikrosk committed May 17, 2024
1 parent 5f749cc commit 0569bc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/joystick/mint/SDL_sysjoystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ int SDL_SYS_JoystickInit(void)
atarijoysticks[PORTB_PAD3].enabled = SDL_TRUE;
}
if (!atarijoysticks[IKBD_JOY1].enabled) {
atarijoysticks[XBIOS_JOY1].enabled=SDL_AtariXbios_enabled;
atarijoysticks[XBIOS_JOY1].enabled=(SDL_AtariXbios_enabled!=0);
}

/* Read environment for joysticks to enable */
Expand Down Expand Up @@ -505,9 +505,11 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)

if (numjoystick==IKBD_JOY1) {
curstate = SDL_AtariIkbd_joystick & 0xff;
curstate |= (SDL_AtariIkbd_mouseb & 0x01) << 7;
}
if (numjoystick==XBIOS_JOY1) {
curstate = SDL_AtariXbios_joystick & 0xff;
curstate |= (SDL_AtariXbios_mouseb & 0x01) << 7;
}

if (curstate != prevstate) {
Expand Down

0 comments on commit 0569bc6

Please sign in to comment.