Mercurial > sdl-ios-xcode
comparison src/joystick/mint/SDL_sysjoystick.c @ 4156:de46a1bfcbdb SDL-1.2
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
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Wed, 05 Nov 2008 20:08:17 +0000 |
parents | 28db418c7573 |
children | a1b03ba2fcd0 |
comparison
equal
deleted
inserted
replaced
4155:4d743a3d0bc1 | 4156:de46a1bfcbdb |
---|---|
217 (cookie_mch == MCH_ARANYM<<16)) { | 217 (cookie_mch == MCH_ARANYM<<16)) { |
218 if (SDL_AtariIkbd_enabled!=0) { | 218 if (SDL_AtariIkbd_enabled!=0) { |
219 TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1); | 219 TEST_JOY_ENABLED(envr, "ikbd-joy1", IKBD_JOY1); |
220 } | 220 } |
221 } | 221 } |
222 /* Joypads ports only on STE and Falcon */ | 222 /* Joypads ports on STE, Falcon and maybe others */ |
223 if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16)) { | 223 if ((cookie_mch == MCH_STE<<16) || (cookie_mch == MCH_F30<<16) || |
224 (cookie_mch == MCH_ARANYM<<16)) { | |
224 TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0); | 225 TEST_JOY_ENABLED(envr, "porta-pad", PORTA_PAD0); |
225 if (!atarijoysticks[PORTA_PAD0].enabled) { | 226 if (!atarijoysticks[PORTA_PAD0].enabled) { |
226 TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0); | 227 TEST_JOY_ENABLED(envr, "porta-joy0", PORTA_JOY0); |
227 TEST_JOY_ENABLED(envr, "porta-joy1", PORTA_JOY1); | 228 TEST_JOY_ENABLED(envr, "porta-joy1", PORTA_JOY1); |
228 if (!(atarijoysticks[PORTA_JOY0].enabled) && !(atarijoysticks[PORTA_JOY1].enabled)) { | 229 if (!(atarijoysticks[PORTA_JOY0].enabled) && !(atarijoysticks[PORTA_JOY1].enabled)) { |
435 numjoypad = 6; break; | 436 numjoypad = 6; break; |
436 case PORTB_PAD3: | 437 case PORTB_PAD3: |
437 numjoypad = 7; break; | 438 numjoypad = 7; break; |
438 } | 439 } |
439 | 440 |
440 curstate=jp_joypads[numjoypad]; | 441 curstate=jp_joypads[numjoypad] & 0xabffff; |
441 if (curstate!=prevstate) { | 442 if (curstate!=prevstate) { |
442 hatstate = SDL_HAT_CENTERED; | 443 hatstate = SDL_HAT_CENTERED; |
443 if (curstate & (1<<JP_LEFT)) { | 444 if (curstate & (1<<JP_LEFT)) { |
444 hatstate |= SDL_HAT_LEFT; | 445 hatstate |= SDL_HAT_LEFT; |
445 } | 446 } |