summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/uisdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/uisdl.c')
-rw-r--r--uisimulator/sdl/uisdl.c38
1 files changed, 31 insertions, 7 deletions
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c
index 2dd6b93122..178090403f 100644
--- a/uisimulator/sdl/uisdl.c
+++ b/uisimulator/sdl/uisdl.c
@@ -20,14 +20,25 @@
20#include <stdlib.h> 20#include <stdlib.h>
21#include <string.h> 21#include <string.h>
22#include "autoconf.h" 22#include "autoconf.h"
23#include "uisdl.h"
24#include "button.h" 23#include "button.h"
25#include "thread.h" 24#include "thread.h"
26#include "thread-sdl.h"
27#include "kernel.h" 25#include "kernel.h"
28#include "sound.h" 26#include "sound.h"
27#include "uisdl.h"
28#include "lcd-sdl.h"
29#ifdef HAVE_LCD_BITMAP
30#include "lcd-bitmap.h"
31#elif HAVE_LCD_CHARCELLS
32#include "lcd-charcell.h"
33#endif
34#ifdef HAVE_REMOTE_LCD
35#include "lcd-remote.h"
36#endif
37#include "thread-sdl.h"
38#include "SDL_mutex.h"
39#include "SDL_thread.h"
29 40
30// extern functions 41/* extern functions */
31extern void app_main (void *); // mod entry point 42extern void app_main (void *); // mod entry point
32extern void new_key(int key); 43extern void new_key(int key);
33extern void sim_tick_tasks(void); 44extern void sim_tick_tasks(void);
@@ -43,8 +54,8 @@ SDL_TimerID tick_timer_id;
43SDL_Thread *sound_thread; 54SDL_Thread *sound_thread;
44#endif 55#endif
45 56
46bool lcd_display_redraw=true; // Used for player simulator 57bool lcd_display_redraw = true; /* Used for player simulator */
47char having_new_lcd=true; // Used for player simulator 58char having_new_lcd=true; /* Used for player simulator */
48 59
49long start_tick; 60long start_tick;
50 61
@@ -130,14 +141,17 @@ bool gui_startup()
130 } 141 }
131 142
132 143
133 if ((gui_surface = SDL_SetVideoMode(width, height, 24, SDL_HWSURFACE|SDL_DOUBLEBUF)) == NULL) { 144 if ((gui_surface = SDL_SetVideoMode(width * display_zoom, height * display_zoom, 24, SDL_HWSURFACE|SDL_DOUBLEBUF)) == NULL) {
134 fprintf(stderr, "fatal: %s\n", SDL_GetError()); 145 fprintf(stderr, "fatal: %s\n", SDL_GetError());
135 return false; 146 return false;
136 } 147 }
137 148
138 SDL_WM_SetCaption(UI_TITLE, NULL); 149 SDL_WM_SetCaption(UI_TITLE, NULL);
139 150
140 simlcdinit(); 151 sim_lcd_init();
152#ifdef HAVE_REMOTE_LCD
153 sim_lcd_remote_init();
154#endif
141 155
142 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); 156 SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
143 157
@@ -190,16 +204,26 @@ int main(int argc, char *argv[])
190 } else if (!strcmp("--old_lcd", argv[x])) { 204 } else if (!strcmp("--old_lcd", argv[x])) {
191 having_new_lcd = false; 205 having_new_lcd = false;
192 printf("Using old LCD layout.\n"); 206 printf("Using old LCD layout.\n");
207 } else if (!strcmp("--zoom", argv[x])) {
208 x++;
209 display_zoom=atoi(argv[x]);
210 printf("Window zoom is %d\n", display_zoom);
193 } else { 211 } else {
194 printf("rockboxui\n"); 212 printf("rockboxui\n");
195 printf("Arguments:\n"); 213 printf("Arguments:\n");
196 printf(" --background \t Use background image of hardware\n"); 214 printf(" --background \t Use background image of hardware\n");
197 printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); 215 printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n");
216 printf(" --zoom \t window zoom (will disable backgrounds)\n");
198 exit(0); 217 exit(0);
199 } 218 }
200 } 219 }
201 } 220 }
202 221
222 if (display_zoom > 1) {
223 background = false;
224 }
225
226
203 if (!gui_startup()) 227 if (!gui_startup())
204 return -1; 228 return -1;
205 229