src/joystick/nds/SDL_sysjoystick.c
changeset 2750 e3affc66d963
parent 2749 1c5f440a60fe
child 2859 99210400e8b9
     1.1 --- a/src/joystick/nds/SDL_sysjoystick.c	Sat Sep 06 00:10:16 2008 +0000
     1.2 +++ b/src/joystick/nds/SDL_sysjoystick.c	Sat Sep 06 04:31:34 2008 +0000
     1.3 @@ -44,7 +44,8 @@
     1.4  int
     1.5  SDL_SYS_JoystickInit(void)
     1.6  {
     1.7 -    SDL_numjoysticks = 1;
     1.8     return (1);
     1.9 +    SDL_numjoysticks = 1;
    1.10 +    
    1.11 return (1);
    1.12  }
    1.13  
    1.14  /* Function to get the device-dependent name of a joystick */
    1.15 @@ -78,14 +79,14 @@
    1.16   * but instead should call SDL_PrivateJoystick*() to deliver events
    1.17   * and update joystick device state.
    1.18   */
    1.19 -void
    1.20 +    void
    1.21  SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
    1.22  {
    1.23      u32 keysd, keysu;
    1.24      int magnitude = 16384;
    1.25      
    1.26 -    /*scanKeys(); - this is done in PumpEvents, because touch uses it too */
    1.27 -    keysd = keysDown();
    1.28 +        /*scanKeys(); - this is done in PumpEvents, because touch uses it too */ 
    1.29 +        keysd = keysDown();
    1.30      keysu = keysUp();
    1.31  
    1.32      if ((keysd & KEY_UP)) {
    1.33 @@ -100,58 +101,58 @@
    1.34      if ((keysd & KEY_RIGHT)) {
    1.35          SDL_PrivateJoystickAxis(joystick, 0, magnitude);
    1.36      }
    1.37 -
    1.38     if ((keysu & (KEY_UP | KEY_DOWN))) {
    1.39 +    
    1.40 if ((keysu & (KEY_UP | KEY_DOWN))) {
    1.41          SDL_PrivateJoystickAxis(joystick, 1, 0);
    1.42      }
    1.43 -
    1.44     if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
    1.45 +    
    1.46 if ((keysu & (KEY_LEFT | KEY_RIGHT))) {
    1.47          SDL_PrivateJoystickAxis(joystick, 0, 0);
    1.48      }
    1.49 -    
    1.50     if ((keysd & KEY_A)) {
    1.51 +    
    1.52 if ((keysd & KEY_A)) {
    1.53          SDL_PrivateJoystickButton(joystick, 0, SDL_PRESSED);
    1.54      }
    1.55 -    
    1.56     if ((keysd & KEY_B)) {
    1.57 +    
    1.58 if ((keysd & KEY_B)) {
    1.59          SDL_PrivateJoystickButton(joystick, 1, SDL_PRESSED);
    1.60      }
    1.61 -    
    1.62     if ((keysd & KEY_X)) {
    1.63 +    
    1.64 if ((keysd & KEY_X)) {
    1.65          SDL_PrivateJoystickButton(joystick, 2, SDL_PRESSED);
    1.66      }
    1.67 -    
    1.68     if ((keysd & KEY_Y)) {
    1.69 +    
    1.70 if ((keysd & KEY_Y)) {
    1.71          SDL_PrivateJoystickButton(joystick, 3, SDL_PRESSED);
    1.72      }
    1.73 -    
    1.74     if ((keysd & KEY_L)) {
    1.75 +    
    1.76 if ((keysd & KEY_L)) {
    1.77          SDL_PrivateJoystickButton(joystick, 4, SDL_PRESSED);
    1.78      }
    1.79 -    
    1.80     if ((keysd & KEY_R)) {
    1.81 +    
    1.82 if ((keysd & KEY_R)) {
    1.83          SDL_PrivateJoystickButton(joystick, 5, SDL_PRESSED);
    1.84      }
    1.85 -    
    1.86     if ((keysd & KEY_SELECT)) {
    1.87 +    
    1.88 if ((keysd & KEY_SELECT)) {
    1.89          SDL_PrivateJoystickButton(joystick, 6, SDL_PRESSED);
    1.90      }
    1.91 -    
    1.92     if ((keysd & KEY_START)) {
    1.93 +    
    1.94 if ((keysd & KEY_START)) {
    1.95          SDL_PrivateJoystickButton(joystick, 7, SDL_PRESSED);
    1.96      }
    1.97 -    
    1.98     if ((keysu & KEY_A)) {
    1.99 +    
   1.100 if ((keysu & KEY_A)) {
   1.101          SDL_PrivateJoystickButton(joystick, 0, SDL_RELEASED);
   1.102      }
   1.103 -    
   1.104     if ((keysu & KEY_B)) {
   1.105 +    
   1.106 if ((keysu & KEY_B)) {
   1.107          SDL_PrivateJoystickButton(joystick, 1, SDL_RELEASED);
   1.108      }
   1.109 -    
   1.110     if ((keysu & KEY_X)) {
   1.111 +    
   1.112 if ((keysu & KEY_X)) {
   1.113          SDL_PrivateJoystickButton(joystick, 2, SDL_RELEASED);
   1.114      }
   1.115 -    
   1.116     if ((keysu & KEY_Y)) {
   1.117 +    
   1.118 if ((keysu & KEY_Y)) {
   1.119          SDL_PrivateJoystickButton(joystick, 3, SDL_RELEASED);
   1.120      }
   1.121 -    
   1.122     if ((keysu & KEY_L)) {
   1.123 +    
   1.124 if ((keysu & KEY_L)) {
   1.125          SDL_PrivateJoystickButton(joystick, 4, SDL_RELEASED);
   1.126      }
   1.127 -    
   1.128     if ((keysu & KEY_R)) {
   1.129 +    
   1.130 if ((keysu & KEY_R)) {
   1.131          SDL_PrivateJoystickButton(joystick, 5, SDL_RELEASED);
   1.132      }
   1.133 -    
   1.134     if ((keysu & KEY_SELECT)) {
   1.135 +    
   1.136 if ((keysu & KEY_SELECT)) {
   1.137          SDL_PrivateJoystickButton(joystick, 6, SDL_RELEASED);
   1.138      }
   1.139 -    
   1.140     if ((keysu & KEY_START)) {
   1.141 +    
   1.142 if ((keysu & KEY_START)) {
   1.143          SDL_PrivateJoystickButton(joystick, 7, SDL_RELEASED);
   1.144      }
   1.145  
   1.146 }
   1.147 @@ -169,4 +170,3 @@
   1.148  }
   1.149  
   1.150  #endif /* SDL_JOYSTICK_NDS */
   1.151 -