Aranym now has Joypad emulation. Also mask bits for joypad state, for bits only used for buttons, to avoid generating events when dummy bits are set SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Wed, 05 Nov 2008 20:08:17 +0000
branchSDL-1.2
changeset 4156de46a1bfcbdb
parent 4155 4d743a3d0bc1
child 4157 baf615f9f2a0
Aranym now has Joypad emulation. Also mask bits for joypad state, for bits only used for buttons, to avoid generating events when dummy bits are set
src/joystick/mint/SDL_sysjoystick.c
     1.1 --- a/src/joystick/mint/SDL_sysjoystick.c	Mon Oct 13 20:50:20 2008 +0000
     1.2 +++ b/src/joystick/mint/SDL_sysjoystick.c	Wed Nov 05 20:08:17 2008 +0000
     1.3 @@ -219,8 +219,9 @@
     1.4  				TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1);
     1.5  			}
     1.6  		}
     1.7 -		/* Joypads ports only on STE and Falcon */
     1.8 -		if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16)) {
     1.9 +		/* Joypads ports on STE, Falcon and maybe others */
    1.10 +		if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) ||
    1.11 +			(cookie_mch == MCH_ARANYM<<16)) {
    1.12  			TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0);
    1.13  			if (!atarijoysticks[PORTA_PAD0].enabled) {
    1.14  				TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0);
    1.15 @@ -437,7 +438,7 @@
    1.16  						numjoypad = 7;	break;
    1.17  				}				
    1.18  				
    1.19 -				curstate=jp_joypads[numjoypad];
    1.20 +				curstate=jp_joypads[numjoypad] & 0xabffff;
    1.21  				if (curstate!=prevstate) {
    1.22  					hatstate = SDL_HAT_CENTERED;
    1.23  					if (curstate & (1<<JP_LEFT)) {