Mercurial > sdl-ios-xcode
comparison src/video/ataricommon/SDL_gemdosevents.c @ 2043:adf732f1f016
Formatting update
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 24 Sep 2006 15:56:55 +0000 |
parents | b657f0bc72c2 |
children | 99210400e8b9 |
comparison
equal
deleted
inserted
replaced
2042:3908e1f808e1 | 2043:adf732f1f016 |
---|---|
43 | 43 |
44 static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS]; | 44 static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS]; |
45 static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS]; | 45 static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS]; |
46 static SDL_bool use_dev_mouse = SDL_FALSE; | 46 static SDL_bool use_dev_mouse = SDL_FALSE; |
47 | 47 |
48 enum { | 48 enum |
49 DEV_BUSY=0, | 49 { |
50 DEV_READY | 50 DEV_BUSY = 0, |
51 DEV_READY | |
51 }; | 52 }; |
52 | 53 |
53 static void UpdateSpecialKeys(int special_keys_state); | 54 static void UpdateSpecialKeys(int special_keys_state); |
54 | 55 |
55 void | 56 void |
66 vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */ | 67 vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS; /* XBIOS joystick events */ |
67 if (!use_dev_mouse) { | 68 if (!use_dev_mouse) { |
68 vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */ | 69 vectors_mask |= ATARI_XBIOS_MOUSEEVENTS; /* XBIOS mouse events */ |
69 } | 70 } |
70 /*if (Getcookie(C_MiNT, &dummy) == C_FOUND) { | 71 /*if (Getcookie(C_MiNT, &dummy) == C_FOUND) { |
71 vectors_mask = 0; | 72 vectors_mask = 0; |
72 }*/ | 73 } */ |
73 | 74 |
74 SDL_AtariXbios_InstallVectors(vectors_mask); | 75 SDL_AtariXbios_InstallVectors(vectors_mask); |
75 } | 76 } |
76 | 77 |
77 void | 78 void |
83 /* Update pressed keys */ | 84 /* Update pressed keys */ |
84 SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS); | 85 SDL_memset(gemdos_currentkeyboard, 0, ATARIBIOS_MAXKEYS); |
85 | 86 |
86 while (Cconis() != DEV_BUSY) { | 87 while (Cconis() != DEV_BUSY) { |
87 unsigned long key_pressed; | 88 unsigned long key_pressed; |
88 key_pressed=Cnecin(); | 89 key_pressed = Cnecin(); |
89 gemdos_currentkeyboard[(key_pressed>>16)&(ATARIBIOS_MAXKEYS-1)]=0xFF; | 90 gemdos_currentkeyboard[(key_pressed >> 16) & (ATARIBIOS_MAXKEYS - 1)] |
91 = 0xFF; | |
90 } | 92 } |
91 | 93 |
92 /* Read special keys */ | 94 /* Read special keys */ |
93 UpdateSpecialKeys(Kbshift(-1)); | 95 UpdateSpecialKeys(Kbshift(-1)); |
94 | 96 |
100 SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE)); | 102 SDL_Atari_TranslateKey(i, &keysym, SDL_TRUE)); |
101 | 103 |
102 /* Key unpressed ? */ | 104 /* Key unpressed ? */ |
103 if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i]) | 105 if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i]) |
104 SDL_PrivateKeyboard(SDL_RELEASED, | 106 SDL_PrivateKeyboard(SDL_RELEASED, |
105 SDL_Atari_TranslateKey(i, &keysym, SDL_FALSE)); | 107 SDL_Atari_TranslateKey(i, &keysym, |
108 SDL_FALSE)); | |
106 } | 109 } |
107 | 110 |
108 if (use_dev_mouse) { | 111 if (use_dev_mouse) { |
109 SDL_AtariDevMouse_PostMouseEvents(_this, SDL_TRUE); | 112 SDL_AtariDevMouse_PostMouseEvents(_this, SDL_TRUE); |
110 } else { | 113 } else { |