comparison src/video/ataricommon/SDL_atarievents.c @ 2032:ddf89133aebc

Started work to update for 1.3 api
author Patrice Mandin <patmandin@gmail.com>
date Wed, 20 Sep 2006 21:22:08 +0000
parents d774e9d7c2a8
children 59e1a50193aa
comparison
equal deleted inserted replaced
2031:f54073d86c82 2032:ddf89133aebc
58 58
59 /* The translation tables from a console scancode to a SDL keysym */ 59 /* The translation tables from a console scancode to a SDL keysym */
60 static SDLKey keymap[ATARIBIOS_MAXKEYS]; 60 static SDLKey keymap[ATARIBIOS_MAXKEYS];
61 static unsigned char *keytab_normal; 61 static unsigned char *keytab_normal;
62 62
63 void (*Atari_ShutdownEvents) (void); 63 void (*SDL_Atari_ShutdownEvents) (void);
64 64
65 static void 65 static void
66 Atari_InitializeEvents(_THIS) 66 SDL_Atari_InitializeEvents(_THIS)
67 { 67 {
68 const char *envr; 68 const char *envr;
69 unsigned long cookie_mch; 69 unsigned long cookie_mch;
70 70
71 /* Test if we are on an Atari machine or not */ 71 /* Test if we are on an Atari machine or not */
79 case MCH_ST: 79 case MCH_ST:
80 case MCH_STE: 80 case MCH_STE:
81 case MCH_TT: 81 case MCH_TT:
82 case MCH_F30: 82 case MCH_F30:
83 case MCH_ARANYM: 83 case MCH_ARANYM:
84 this->InitOSKeymap = AtariIkbd_InitOSKeymap; 84 _this->PumpEvents = AtariIkbd_PumpEvents;
85 this->PumpEvents = AtariIkbd_PumpEvents; 85 SDL_Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
86 Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
87 break; 86 break;
88 default: 87 default:
89 this->InitOSKeymap = AtariGemdos_InitOSKeymap; 88 _this->PumpEvents = AtariGemdos_PumpEvents;
90 this->PumpEvents = AtariGemdos_PumpEvents; 89 SDL_Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
91 Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
92 break; 90 break;
93 } 91 }
94 92
95 envr = SDL_getenv("SDL_ATARI_EVENTSDRIVER"); 93 envr = SDL_getenv("SDL_ATARI_EVENTSDRIVER");
96 94
97 if (!envr) { 95 if (!envr) {
98 return; 96 return;
99 } 97 }
100 98
101 if (SDL_strcmp(envr, "ikbd") == 0) { 99 if (SDL_strcmp(envr, "ikbd") == 0) {
102 this->InitOSKeymap = AtariIkbd_InitOSKeymap; 100 _this->PumpEvents = AtariIkbd_PumpEvents;
103 this->PumpEvents = AtariIkbd_PumpEvents; 101 SDL_Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
104 Atari_ShutdownEvents = AtariIkbd_ShutdownEvents;
105 } 102 }
106 103
107 if (SDL_strcmp(envr, "gemdos") == 0) { 104 if (SDL_strcmp(envr, "gemdos") == 0) {
108 this->InitOSKeymap = AtariGemdos_InitOSKeymap; 105 _this->PumpEvents = AtariGemdos_PumpEvents;
109 this->PumpEvents = AtariGemdos_PumpEvents; 106 SDL_Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
110 Atari_ShutdownEvents = AtariGemdos_ShutdownEvents;
111 } 107 }
112 108
113 if (SDL_strcmp(envr, "bios") == 0) { 109 if (SDL_strcmp(envr, "bios") == 0) {
114 this->InitOSKeymap = AtariBios_InitOSKeymap; 110 _this->PumpEvents = AtariBios_PumpEvents;
115 this->PumpEvents = AtariBios_PumpEvents; 111 SDL_Atari_ShutdownEvents = AtariBios_ShutdownEvents;
116 Atari_ShutdownEvents = AtariBios_ShutdownEvents; 112 }
117 } 113
118 } 114 SDL_Atari_InitInternalKeymap(_this);
119
120 void
121 Atari_InitOSKeymap(_THIS)
122 {
123 Atari_InitializeEvents(this);
124
125 SDL_Atari_InitInternalKeymap(this);
126
127 /* Call choosen routine */
128 this->InitOSKeymap(this);
129 } 115 }
130 116
131 void 117 void
132 Atari_PumpEvents(_THIS) 118 Atari_PumpEvents(_THIS)
133 { 119 {
134 Atari_InitializeEvents(this); 120 static int first_time = 1;
121 if (first_time) {
122 Atari_InitializeEvents(_this);
123 first_time = 0;
124 }
135 125
136 /* Call choosen routine */ 126 /* Call choosen routine */
137 this->PumpEvents(this); 127 _this->PumpEvents(_this);
138 } 128 }
139 129
140 void 130 void
141 SDL_Atari_InitInternalKeymap(_THIS) 131 SDL_Atari_InitInternalKeymap(_THIS)
142 { 132 {