summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/uisdl.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-08 12:20:53 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-08 12:20:53 +0000
commitf64ebb1c1f10e8d15fcc4879d781703c86c5fb8b (patch)
tree065072709c699ac6dc3eb640368bd3f4106144e4 /uisimulator/sdl/uisdl.c
parent69b4654ea28049c7e8637d521327ba10ae405f8b (diff)
downloadrockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.tar.gz
rockbox-f64ebb1c1f10e8d15fcc4879d781703c86c5fb8b.zip
Sim I/O and threading that runs more like on target. Tweakable if any genuine slowness imitation is required for any one of them. One point of concern is the sim shutdown on an OS other than Linux just because terminating threads in a manner other than having the do it themselves is kind of dirty IMHO.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14639 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl/uisdl.c')
-rw-r--r--uisimulator/sdl/uisdl.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c
index 052fd4af83..37a0e6fe7a 100644
--- a/uisimulator/sdl/uisdl.c
+++ b/uisimulator/sdl/uisdl.c
@@ -41,6 +41,8 @@
41extern void app_main (void *); /* mod entry point */ 41extern void app_main (void *); /* mod entry point */
42extern void new_key(int key); 42extern void new_key(int key);
43extern void sim_tick_tasks(void); 43extern void sim_tick_tasks(void);
44extern void sim_io_init(void);
45extern void sim_io_shutdown(void);
44 46
45void button_event(int key, bool pressed); 47void button_event(int key, bool pressed);
46 48
@@ -167,16 +169,9 @@ bool gui_startup(void)
167 169
168bool gui_shutdown(void) 170bool gui_shutdown(void)
169{ 171{
170 int i;
171
172 SDL_KillThread(gui_thread);
173 SDL_RemoveTimer(tick_timer_id); 172 SDL_RemoveTimer(tick_timer_id);
174 173 kill_sim_threads();
175 for (i = 0; i < threadCount; i++) 174 sim_io_shutdown();
176 {
177 SDL_KillThread(threads[i]);
178 }
179
180 return true; 175 return true;
181} 176}
182 177
@@ -236,6 +231,8 @@ int main(int argc, char *argv[])
236 background = false; 231 background = false;
237 } 232 }
238 233
234 sim_io_init();
235
239 if (!gui_startup()) 236 if (!gui_startup())
240 return -1; 237 return -1;
241 238