src/video/ataricommon/SDL_biosevents.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
     1.1 --- a/src/video/ataricommon/SDL_biosevents.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_biosevents.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -62,21 +62,21 @@
     1.4  /* The translation tables from a console scancode to a SDL keysym */
     1.5  static SDLKey keymap[ATARIBIOS_MAXKEYS];
     1.6  
     1.7 -static SDL_keysym *TranslateKey (int scancode, int asciicode,
     1.8 -                                 SDL_keysym * keysym, SDL_bool pressed);
     1.9 -static void UpdateSpecialKeys (int special_keys_state);
    1.10 +static SDL_keysym *TranslateKey(int scancode, int asciicode,
    1.11 +                                SDL_keysym * keysym, SDL_bool pressed);
    1.12 +static void UpdateSpecialKeys(int special_keys_state);
    1.13  
    1.14  void
    1.15 -AtariBios_InitOSKeymap (_THIS)
    1.16 +AtariBios_InitOSKeymap(_THIS)
    1.17  {
    1.18      int i, vectors_mask;
    1.19      unsigned long dummy;
    1.20  
    1.21 -    SDL_memset (bios_currentkeyboard, 0, sizeof (bios_currentkeyboard));
    1.22 -    SDL_memset (bios_previouskeyboard, 0, sizeof (bios_previouskeyboard));
    1.23 +    SDL_memset(bios_currentkeyboard, 0, sizeof(bios_currentkeyboard));
    1.24 +    SDL_memset(bios_previouskeyboard, 0, sizeof(bios_previouskeyboard));
    1.25  
    1.26      /* Initialize keymap */
    1.27 -    for (i = 0; i < sizeof (keymap); i++)
    1.28 +    for (i = 0; i < sizeof(keymap); i++)
    1.29          keymap[i] = SDLK_UNKNOWN;
    1.30  
    1.31      /* Functions keys */
    1.32 @@ -105,33 +105,33 @@
    1.33      keymap[SCANCODE_LEFTALT] = SDLK_LALT;
    1.34      keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
    1.35  
    1.36 -    use_dev_mouse = (SDL_AtariDevMouse_Open () != 0) ? SDL_TRUE : SDL_FALSE;
    1.37 +    use_dev_mouse = (SDL_AtariDevMouse_Open() != 0) ? SDL_TRUE : SDL_FALSE;
    1.38  
    1.39      vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS;  /* XBIOS joystick events */
    1.40      if (!use_dev_mouse) {
    1.41          vectors_mask |= ATARI_XBIOS_MOUSEEVENTS;        /* XBIOS mouse events */
    1.42      }
    1.43 -    if (Getcookie (C_MiNT, &dummy) == C_FOUND) {
    1.44 +    if (Getcookie(C_MiNT, &dummy) == C_FOUND) {
    1.45          vectors_mask = 0;
    1.46      }
    1.47  
    1.48 -    SDL_AtariXbios_InstallVectors (vectors_mask);
    1.49 +    SDL_AtariXbios_InstallVectors(vectors_mask);
    1.50  }
    1.51  
    1.52  void
    1.53 -AtariBios_PumpEvents (_THIS)
    1.54 +AtariBios_PumpEvents(_THIS)
    1.55  {
    1.56      int i;
    1.57      SDL_keysym keysym;
    1.58  
    1.59      /* Update pressed keys */
    1.60 -    SDL_memset (bios_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
    1.61 +    SDL_memset(bios_currentkeyboard, 0, ATARIBIOS_MAXKEYS);
    1.62  
    1.63 -    while (Bconstat (_CON)) {
    1.64 +    while (Bconstat(_CON)) {
    1.65          unsigned long key_pressed;
    1.66          unsigned char asciicode, scancode;
    1.67  
    1.68 -        key_pressed = Bconin (_CON);
    1.69 +        key_pressed = Bconin(_CON);
    1.70  
    1.71          asciicode = key_pressed;
    1.72          scancode = key_pressed >> 16;
    1.73 @@ -141,36 +141,36 @@
    1.74      }
    1.75  
    1.76      /* Read special keys */
    1.77 -    UpdateSpecialKeys (Kbshift (-1));
    1.78 +    UpdateSpecialKeys(Kbshift(-1));
    1.79  
    1.80      /* Now generate events */
    1.81      for (i = 0; i < ATARIBIOS_MAXKEYS; i++) {
    1.82          /* Key pressed ? */
    1.83          if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
    1.84 -            SDL_PrivateKeyboard (SDL_PRESSED,
    1.85 -                                 TranslateKey (i, bios_currentascii[i],
    1.86 -                                               &keysym, SDL_TRUE));
    1.87 +            SDL_PrivateKeyboard(SDL_PRESSED,
    1.88 +                                TranslateKey(i, bios_currentascii[i],
    1.89 +                                             &keysym, SDL_TRUE));
    1.90  
    1.91          /* Key unpressed ? */
    1.92          if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
    1.93 -            SDL_PrivateKeyboard (SDL_RELEASED,
    1.94 -                                 TranslateKey (i, bios_currentascii[i],
    1.95 -                                               &keysym, SDL_FALSE));
    1.96 +            SDL_PrivateKeyboard(SDL_RELEASED,
    1.97 +                                TranslateKey(i, bios_currentascii[i],
    1.98 +                                             &keysym, SDL_FALSE));
    1.99      }
   1.100  
   1.101      if (use_dev_mouse) {
   1.102 -        SDL_AtariDevMouse_PostMouseEvents (this, SDL_TRUE);
   1.103 +        SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
   1.104      } else {
   1.105 -        SDL_AtariXbios_PostMouseEvents (this, SDL_TRUE);
   1.106 +        SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
   1.107      }
   1.108  
   1.109      /* Will be previous table */
   1.110 -    SDL_memcpy (bios_previouskeyboard, bios_currentkeyboard,
   1.111 -                ATARIBIOS_MAXKEYS);
   1.112 +    SDL_memcpy(bios_previouskeyboard, bios_currentkeyboard,
   1.113 +               ATARIBIOS_MAXKEYS);
   1.114  }
   1.115  
   1.116  static void
   1.117 -UpdateSpecialKeys (int special_keys_state)
   1.118 +UpdateSpecialKeys(int special_keys_state)
   1.119  {
   1.120  #define UPDATE_SPECIAL_KEYS(numbit,scancode) \
   1.121  	{	\
   1.122 @@ -180,16 +180,16 @@
   1.123  		}	\
   1.124  	}
   1.125  
   1.126 -    UPDATE_SPECIAL_KEYS (K_RSHIFT, SCANCODE_RIGHTSHIFT);
   1.127 -    UPDATE_SPECIAL_KEYS (K_LSHIFT, SCANCODE_LEFTSHIFT);
   1.128 -    UPDATE_SPECIAL_KEYS (K_CTRL, SCANCODE_LEFTCONTROL);
   1.129 -    UPDATE_SPECIAL_KEYS (K_ALT, SCANCODE_LEFTALT);
   1.130 -    UPDATE_SPECIAL_KEYS (K_CAPSLOCK, SCANCODE_CAPSLOCK);
   1.131 +    UPDATE_SPECIAL_KEYS(K_RSHIFT, SCANCODE_RIGHTSHIFT);
   1.132 +    UPDATE_SPECIAL_KEYS(K_LSHIFT, SCANCODE_LEFTSHIFT);
   1.133 +    UPDATE_SPECIAL_KEYS(K_CTRL, SCANCODE_LEFTCONTROL);
   1.134 +    UPDATE_SPECIAL_KEYS(K_ALT, SCANCODE_LEFTALT);
   1.135 +    UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
   1.136  }
   1.137  
   1.138  static SDL_keysym *
   1.139 -TranslateKey (int scancode, int asciicode, SDL_keysym * keysym,
   1.140 -              SDL_bool pressed)
   1.141 +TranslateKey(int scancode, int asciicode, SDL_keysym * keysym,
   1.142 +             SDL_bool pressed)
   1.143  {
   1.144      /* Set the keysym information */
   1.145      keysym->scancode = scancode;
   1.146 @@ -209,11 +209,11 @@
   1.147  }
   1.148  
   1.149  void
   1.150 -AtariBios_ShutdownEvents (void)
   1.151 +AtariBios_ShutdownEvents(void)
   1.152  {
   1.153 -    SDL_AtariXbios_RestoreVectors ();
   1.154 +    SDL_AtariXbios_RestoreVectors();
   1.155      if (use_dev_mouse) {
   1.156 -        SDL_AtariDevMouse_Close ();
   1.157 +        SDL_AtariDevMouse_Close();
   1.158      }
   1.159  }
   1.160