Atari joystick fixes contributed by Patrice Mandin
authorSam Lantinga <slouken@libsdl.org>
Sat, 05 Oct 2002 16:27:29 +0000
changeset 5077853b6af5957
parent 506 f097dba83975
child 508 9ff7e90aaa94
Atari joystick fixes contributed by Patrice Mandin
src/joystick/mint/SDL_sysjoystick.c
     1.1 --- a/src/joystick/mint/SDL_sysjoystick.c	Sat Oct 05 05:46:32 2002 +0000
     1.2 +++ b/src/joystick/mint/SDL_sysjoystick.c	Sat Oct 05 16:27:29 2002 +0000
     1.3 @@ -351,9 +351,9 @@
     1.4  					if ((curstate & (IKBD_JOY_LEFT|IKBD_JOY_RIGHT)) != (prevstate & (IKBD_JOY_LEFT|IKBD_JOY_RIGHT))) {
     1.5  						curaxis=0;
     1.6  						if (curstate & IKBD_JOY_LEFT) {
     1.7 -							curaxis=-128;
     1.8 +							curaxis=0x8000;
     1.9  						} else if (curstate & IKBD_JOY_RIGHT) {
    1.10 -							curaxis=127;
    1.11 +							curaxis=0x7fff;
    1.12  						}					
    1.13  						SDL_PrivateJoystickAxis(joystick,0,curaxis);
    1.14  					}
    1.15 @@ -361,9 +361,9 @@
    1.16  					if ((curstate & (IKBD_JOY_UP|IKBD_JOY_DOWN)) != (prevstate & (IKBD_JOY_UP|IKBD_JOY_DOWN))) {
    1.17  						curaxis=0;
    1.18  						if (curstate & IKBD_JOY_UP) {
    1.19 -							curaxis=-128;
    1.20 +							curaxis=0x8000;
    1.21  						} else if (curstate & IKBD_JOY_DOWN) {
    1.22 -							curaxis=127;
    1.23 +							curaxis=0x7fff;
    1.24  						}					
    1.25  						SDL_PrivateJoystickAxis(joystick,1,curaxis);
    1.26  					}
    1.27 @@ -393,9 +393,9 @@
    1.28  					if ((curstate & ((1<<JP_LEFT)|(1<<JP_RIGHT))) != (prevstate & ((1<<JP_LEFT)|(1<<JP_RIGHT)))) {
    1.29  						curaxis=0;
    1.30  						if (curstate & (1<<JP_LEFT)) {
    1.31 -							curaxis=-128;
    1.32 +							curaxis=0x8000;
    1.33  						} else if (curstate & (1<<JP_RIGHT)) {
    1.34 -							curaxis=127;
    1.35 +							curaxis=0x7fff;
    1.36  						}					
    1.37  						SDL_PrivateJoystickAxis(joystick,0,curaxis);
    1.38  					}
    1.39 @@ -403,9 +403,9 @@
    1.40  					if ((curstate & ((1<<JP_UP)|(1<<JP_DOWN))) != (prevstate & ((1<<JP_UP)|(1<<JP_DOWN)))) {
    1.41  						curaxis=0;
    1.42  						if (curstate & (1<<JP_UP)) {
    1.43 -							curaxis=-128;
    1.44 +							curaxis=0x8000;
    1.45  						} else if (curstate & (1<<JP_DOWN)) {
    1.46 -							curaxis=127;
    1.47 +							curaxis=0x7fff;
    1.48  						}					
    1.49  						SDL_PrivateJoystickAxis(joystick,1,curaxis);
    1.50  					}
    1.51 @@ -446,9 +446,9 @@
    1.52  					if ((curstate & (PORT_JS_LEFT|PORT_JS_RIGHT)) != (prevstate & (PORT_JS_LEFT|PORT_JS_RIGHT))) {
    1.53  						curaxis=0;
    1.54  						if (curstate & PORT_JS_LEFT) {
    1.55 -							curaxis=-128;
    1.56 +							curaxis=0x8000;
    1.57  						} else if (curstate & PORT_JS_RIGHT) {
    1.58 -							curaxis=127;
    1.59 +							curaxis=0x7fff;
    1.60  						}					
    1.61  						SDL_PrivateJoystickAxis(joystick,0,curaxis);
    1.62  					}
    1.63 @@ -456,9 +456,9 @@
    1.64  					if ((curstate & (PORT_JS_UP|PORT_JS_DOWN)) != (prevstate & (PORT_JS_UP|PORT_JS_DOWN))) {
    1.65  						curaxis=0;
    1.66  						if (curstate & PORT_JS_UP) {
    1.67 -							curaxis=-128;
    1.68 +							curaxis=0x8000;
    1.69  						} else if (curstate & PORT_JS_DOWN) {
    1.70 -							curaxis=127;
    1.71 +							curaxis=0x7fff;
    1.72  						}					
    1.73  						SDL_PrivateJoystickAxis(joystick,1,curaxis);
    1.74  					}
    1.75 @@ -483,9 +483,9 @@
    1.76  
    1.77  				if (curstate != prevstate) {
    1.78  					/* X axis */
    1.79 -					SDL_PrivateJoystickAxis(joystick,0,(jp_lightpens[0]>>8)-128);
    1.80 +					SDL_PrivateJoystickAxis(joystick,0,jp_lightpens[0] ^ 0x8000);
    1.81  					/* Y axis */
    1.82 -					SDL_PrivateJoystickAxis(joystick,1,(jp_lightpens[1]>>8)-128);
    1.83 +					SDL_PrivateJoystickAxis(joystick,1,jp_lightpens[1] ^ 0x8000);
    1.84  					/* Buttons */
    1.85  					for (i=0;i<2;i++) {
    1.86  						int button;
    1.87 @@ -517,9 +517,9 @@
    1.88  
    1.89  				if (curstate != prevstate) {
    1.90  					/* X axis */
    1.91 -					SDL_PrivateJoystickAxis(joystick,0,(jp_paddles[numpaddle]>>8)-128);
    1.92 +					SDL_PrivateJoystickAxis(joystick,0,jp_paddles[numpaddle] ^ 0x8000);
    1.93  					/* Y axis */
    1.94 -					SDL_PrivateJoystickAxis(joystick,1,(jp_paddles[numpaddle+1]>>8)-128);
    1.95 +					SDL_PrivateJoystickAxis(joystick,1,jp_paddles[numpaddle+1] ^ 0x8000);
    1.96  					/* Buttons */
    1.97  					for (i=0;i<2;i++) {
    1.98  						int button;