Mercurial > sdl-ios-xcode
comparison src/joystick/amigaos/SDL_sysjoystick.c @ 255:dcb5e869f8b5
Updated Amiga port by Gabriele Greco
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 16 Dec 2001 20:00:27 +0000 |
parents | e8157fcb3114 |
children | f6ffac90895c |
comparison
equal
deleted
inserted
replaced
254:4fc12b8edf74 | 255:dcb5e869f8b5 |
---|---|
29 /* This is the system specific header for the SDL joystick API */ | 29 /* This is the system specific header for the SDL joystick API */ |
30 | 30 |
31 #include <stdio.h> /* For the definition of NULL */ | 31 #include <stdio.h> /* For the definition of NULL */ |
32 | 32 |
33 #include <libraries/lowlevel.h> | 33 #include <libraries/lowlevel.h> |
34 #ifdef __SASC | 34 #if defined(__SASC) || defined(STORMC4_WOS) |
35 #include <proto/exec.h> | 35 #include <proto/exec.h> |
36 #include <proto/lowlevel.h> | 36 #include <proto/lowlevel.h> |
37 #include <proto/graphics.h> | 37 #include <proto/graphics.h> |
38 #else | 38 #else |
39 #include <inline/exec.h> | 39 #include <inline/exec.h> |
70 JPF_BUTTON_GREEN, | 70 JPF_BUTTON_GREEN, |
71 JPF_BUTTON_FORWARD, | 71 JPF_BUTTON_FORWARD, |
72 JPF_BUTTON_REVERSE, | 72 JPF_BUTTON_REVERSE, |
73 }; | 73 }; |
74 | 74 |
75 struct joystick_hwdata | 75 struct joystick_hwdata |
76 { | 76 { |
77 ULONG joystate; | 77 ULONG joystate; |
78 }; | 78 }; |
79 | 79 |
80 int SDL_SYS_JoystickInit(void) | 80 int SDL_SYS_JoystickInit(void) |
126 | 126 |
127 /* This loop is to check if the controller is a joypad */ | 127 /* This loop is to check if the controller is a joypad */ |
128 | 128 |
129 for(i=0;i<20;i++) | 129 for(i=0;i<20;i++) |
130 { | 130 { |
131 temp=ReadJoyPort(joystick->index); | 131 temp=ReadJoyPort(joystick->index^1); // fix to invert amiga joyports |
132 WaitTOF(); | 132 WaitTOF(); |
133 } | 133 } |
134 | 134 |
135 if((temp&JP_TYPE_MASK)==JP_TYPE_GAMECTLR) | 135 if((temp&JP_TYPE_MASK)==JP_TYPE_GAMECTLR) |
136 joystick->nbuttons=7; | 136 joystick->nbuttons=7; |
150 * but instead should call SDL_PrivateJoystick*() to deliver events | 150 * but instead should call SDL_PrivateJoystick*() to deliver events |
151 * and update joystick device state. | 151 * and update joystick device state. |
152 */ | 152 */ |
153 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) | 153 void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick) |
154 { | 154 { |
155 ULONG data; | 155 ULONG data; |
156 int i; | 156 int i; |
157 | 157 |
158 if(joystick->index<2) | 158 if(joystick->index<2) |
159 { | 159 { |
160 data=ReadJoyPort(joystick->index); | 160 data=ReadJoyPort(joystick->index); |