Skip to content

Commit

Permalink
Atari joystick fixes contributed by Patrice Mandin
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 5, 2002
1 parent 589b297 commit 13885cd
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/joystick/mint/SDL_sysjoystick.c
Expand Up @@ -351,19 +351,19 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
if ((curstate & (IKBD_JOY_LEFT|IKBD_JOY_RIGHT)) != (prevstate & (IKBD_JOY_LEFT|IKBD_JOY_RIGHT))) {
curaxis=0;
if (curstate & IKBD_JOY_LEFT) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & IKBD_JOY_RIGHT) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,0,curaxis);
}
/* Y axis */
if ((curstate & (IKBD_JOY_UP|IKBD_JOY_DOWN)) != (prevstate & (IKBD_JOY_UP|IKBD_JOY_DOWN))) {
curaxis=0;
if (curstate & IKBD_JOY_UP) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & IKBD_JOY_DOWN) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,1,curaxis);
}
Expand Down Expand Up @@ -393,19 +393,19 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
if ((curstate & ((1<<JP_LEFT)|(1<<JP_RIGHT))) != (prevstate & ((1<<JP_LEFT)|(1<<JP_RIGHT)))) {
curaxis=0;
if (curstate & (1<<JP_LEFT)) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & (1<<JP_RIGHT)) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,0,curaxis);
}
/* Y axis */
if ((curstate & ((1<<JP_UP)|(1<<JP_DOWN))) != (prevstate & ((1<<JP_UP)|(1<<JP_DOWN)))) {
curaxis=0;
if (curstate & (1<<JP_UP)) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & (1<<JP_DOWN)) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,1,curaxis);
}
Expand Down Expand Up @@ -446,19 +446,19 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
if ((curstate & (PORT_JS_LEFT|PORT_JS_RIGHT)) != (prevstate & (PORT_JS_LEFT|PORT_JS_RIGHT))) {
curaxis=0;
if (curstate & PORT_JS_LEFT) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & PORT_JS_RIGHT) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,0,curaxis);
}
/* Y axis */
if ((curstate & (PORT_JS_UP|PORT_JS_DOWN)) != (prevstate & (PORT_JS_UP|PORT_JS_DOWN))) {
curaxis=0;
if (curstate & PORT_JS_UP) {
curaxis=-128;
curaxis=0x8000;
} else if (curstate & PORT_JS_DOWN) {
curaxis=127;
curaxis=0x7fff;
}
SDL_PrivateJoystickAxis(joystick,1,curaxis);
}
Expand All @@ -483,9 +483,9 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)

if (curstate != prevstate) {
/* X axis */
SDL_PrivateJoystickAxis(joystick,0,(jp_lightpens[0]>>8)-128);
SDL_PrivateJoystickAxis(joystick,0,jp_lightpens[0] ^ 0x8000);
/* Y axis */
SDL_PrivateJoystickAxis(joystick,1,(jp_lightpens[1]>>8)-128);
SDL_PrivateJoystickAxis(joystick,1,jp_lightpens[1] ^ 0x8000);
/* Buttons */
for (i=0;i<2;i++) {
int button;
Expand Down Expand Up @@ -517,9 +517,9 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)

if (curstate != prevstate) {
/* X axis */
SDL_PrivateJoystickAxis(joystick,0,(jp_paddles[numpaddle]>>8)-128);
SDL_PrivateJoystickAxis(joystick,0,jp_paddles[numpaddle] ^ 0x8000);
/* Y axis */
SDL_PrivateJoystickAxis(joystick,1,(jp_paddles[numpaddle+1]>>8)-128);
SDL_PrivateJoystickAxis(joystick,1,jp_paddles[numpaddle+1] ^ 0x8000);
/* Buttons */
for (i=0;i<2;i++) {
int button;
Expand Down

0 comments on commit 13885cd

Please sign in to comment.