diff options
Diffstat (limited to 'apps/plugins/rockboy/main.c')
-rw-r--r-- | apps/plugins/rockboy/main.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/apps/plugins/rockboy/main.c b/apps/plugins/rockboy/main.c index ea5d628f04..77e9bc9ea0 100644 --- a/apps/plugins/rockboy/main.c +++ b/apps/plugins/rockboy/main.c | |||
@@ -45,16 +45,24 @@ void doevents() | |||
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | /* convenience macro for printing loading state */ | ||
49 | #define PUTS(str) do { \ | ||
50 | rb->lcd_putsxy(1, y, str); \ | ||
51 | rb->lcd_getstringsize(str, &w, &h); \ | ||
52 | y += h + 1; \ | ||
53 | } while (0) | ||
54 | |||
48 | int gnuboy_main(char *rom) | 55 | int gnuboy_main(char *rom) |
49 | { | 56 | { |
50 | int i; | 57 | int i, w, h, y; |
51 | 58 | ||
59 | y = 1; | ||
52 | // Avoid initializing video if we don't have to | 60 | // Avoid initializing video if we don't have to |
53 | // If we have special perms, drop them ASAP! | 61 | // If we have special perms, drop them ASAP! |
54 | rb->splash(HZ*1, true, "Init exports"); | 62 | PUTS("Init exports"); |
55 | init_exports(); | 63 | init_exports(); |
56 | 64 | ||
57 | rb->splash(HZ*1, true, "Loading default config"); | 65 | PUTS("Loading default config"); |
58 | for (i = 0; defaultconfig[i]; i++) | 66 | for (i = 0; defaultconfig[i]; i++) |
59 | rc_command(defaultconfig[i]); | 67 | rc_command(defaultconfig[i]); |
60 | 68 | ||
@@ -65,19 +73,20 @@ int gnuboy_main(char *rom) | |||
65 | // rc_command(cmd); | 73 | // rc_command(cmd); |
66 | 74 | ||
67 | // FIXME - make interface modules responsible for atexit() | 75 | // FIXME - make interface modules responsible for atexit() |
68 | rb->splash(HZ*1, true, "Init video"); | 76 | PUTS("Init video"); |
69 | vid_init(); | 77 | vid_init(); |
70 | rb->splash(HZ*1, true, "Init sound (nosound)"); | 78 | PUTS("Init sound (nosound)"); |
71 | pcm_init(); | 79 | pcm_init(); |
72 | rb->splash(HZ*1, true, "Loading rom"); | 80 | PUTS("Loading rom"); |
73 | loader_init(rom); | 81 | loader_init(rom); |
74 | if(shut) | 82 | if(shut) |
75 | return PLUGIN_ERROR; | 83 | return PLUGIN_ERROR; |
76 | rb->splash(HZ*1, true, "Emu reset"); | 84 | PUTS("Emu reset"); |
77 | emu_reset(); | 85 | emu_reset(); |
78 | rb->splash(HZ*1, true, "Emu run"); | 86 | PUTS("Emu run"); |
79 | emu_run(); | 87 | emu_run(); |
80 | 88 | ||
81 | // never reached | 89 | // never reached |
82 | return PLUGIN_OK; | 90 | return PLUGIN_OK; |
83 | } | 91 | } |
92 | #undef PUTS | ||