diff options
author | Steve Bavin <pondlife@pondlife.me> | 2009-10-26 09:58:39 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2009-10-26 09:58:39 +0000 |
commit | b341f5d594c10ff541764a506dc8a2d5c6a8752a (patch) | |
tree | 3534c2875b5c1de85185757c2d649772478080a3 /uisimulator | |
parent | 58c07fbfa8f51b28ef33d61ec9f505499b84109c (diff) | |
download | rockbox-b341f5d594c10ff541764a506dc8a2d5c6a8752a.tar.gz rockbox-b341f5d594c10ff541764a506dc8a2d5c6a8752a.zip |
FS#10700 - Add --noremote option to simulator.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23358 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/sdl/lcd-remote-bitmap.c | 42 | ||||
-rw-r--r-- | uisimulator/sdl/uisdl.c | 40 |
2 files changed, 56 insertions, 26 deletions
diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/uisimulator/sdl/lcd-remote-bitmap.c index ecb9904a40..c44e476288 100644 --- a/uisimulator/sdl/lcd-remote-bitmap.c +++ b/uisimulator/sdl/lcd-remote-bitmap.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "lcd-remote-bitmap.h" | 24 | #include "lcd-remote-bitmap.h" |
25 | #include "screendump.h" | 25 | #include "screendump.h" |
26 | 26 | ||
27 | SDL_Surface *remote_surface; | 27 | SDL_Surface *remote_surface = 0; |
28 | 28 | ||
29 | SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR), | 29 | SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR), |
30 | GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR), | 30 | GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR), |
@@ -65,27 +65,35 @@ void lcd_remote_update (void) | |||
65 | 65 | ||
66 | void lcd_remote_update_rect(int x_start, int y_start, int width, int height) | 66 | void lcd_remote_update_rect(int x_start, int y_start, int width, int height) |
67 | { | 67 | { |
68 | sdl_update_rect(remote_surface, x_start, y_start, width, height, | 68 | if (remote_surface) |
69 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel); | 69 | { |
70 | sdl_gui_update(remote_surface, x_start, y_start, width, height, | 70 | sdl_update_rect(remote_surface, x_start, y_start, width, height, |
71 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0, | 71 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, get_lcd_remote_pixel); |
72 | background ? UI_REMOTE_POSY : LCD_HEIGHT); | 72 | sdl_gui_update(remote_surface, x_start, y_start, width, height, |
73 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, background ? UI_REMOTE_POSX : 0, | ||
74 | background ? UI_REMOTE_POSY : LCD_HEIGHT); | ||
75 | } | ||
73 | } | 76 | } |
74 | 77 | ||
75 | void sim_remote_backlight(int value) | 78 | void sim_remote_backlight(int value) |
76 | { | 79 | { |
77 | if (value > 0) { | 80 | if (remote_surface) |
78 | sdl_set_gradient(remote_surface, &remote_bl_color_dark, | 81 | { |
79 | &remote_bl_color_bright, 0, NUM_SHADES); | 82 | if (value > 0) |
80 | } else { | 83 | { |
81 | sdl_set_gradient(remote_surface, &remote_color_dark, | 84 | sdl_set_gradient(remote_surface, &remote_bl_color_dark, |
82 | &remote_color_bright, 0, NUM_SHADES); | 85 | &remote_bl_color_bright, 0, NUM_SHADES); |
86 | } | ||
87 | else | ||
88 | { | ||
89 | sdl_set_gradient(remote_surface, &remote_color_dark, | ||
90 | &remote_color_bright, 0, NUM_SHADES); | ||
91 | } | ||
92 | sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
93 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
94 | background ? UI_REMOTE_POSX : 0, | ||
95 | background? UI_REMOTE_POSY : LCD_HEIGHT); | ||
83 | } | 96 | } |
84 | |||
85 | sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
86 | LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, | ||
87 | background ? UI_REMOTE_POSX : 0, | ||
88 | background? UI_REMOTE_POSY : LCD_HEIGHT); | ||
89 | } | 97 | } |
90 | 98 | ||
91 | /* initialise simulator lcd remote driver */ | 99 | /* initialise simulator lcd remote driver */ |
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c index d6a49d3a60..3ab098e5ba 100644 --- a/uisimulator/sdl/uisdl.c +++ b/uisimulator/sdl/uisdl.c | |||
@@ -48,6 +48,9 @@ void button_event(int key, bool pressed); | |||
48 | 48 | ||
49 | SDL_Surface *gui_surface; | 49 | SDL_Surface *gui_surface; |
50 | bool background = true; /* use backgrounds by default */ | 50 | bool background = true; /* use backgrounds by default */ |
51 | #ifdef HAVE_REMOTE_LCD | ||
52 | static bool showremote = true; /* include remote by default */ | ||
53 | #endif | ||
51 | 54 | ||
52 | bool lcd_display_redraw = true; /* Used for player simulator */ | 55 | bool lcd_display_redraw = true; /* Used for player simulator */ |
53 | char having_new_lcd = true; /* Used for player simulator */ | 56 | char having_new_lcd = true; /* Used for player simulator */ |
@@ -124,18 +127,25 @@ bool gui_startup(void) | |||
124 | } | 127 | } |
125 | 128 | ||
126 | /* Set things up */ | 129 | /* Set things up */ |
127 | 130 | if (background) | |
128 | if (background) { | 131 | { |
129 | width = UI_WIDTH; | 132 | width = UI_WIDTH; |
130 | height = UI_HEIGHT; | 133 | height = UI_HEIGHT; |
131 | } else { | 134 | } |
135 | else | ||
136 | { | ||
132 | #ifdef HAVE_REMOTE_LCD | 137 | #ifdef HAVE_REMOTE_LCD |
133 | width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH; | 138 | if (showremote) |
134 | height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT; | 139 | { |
135 | #else | 140 | width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH; |
136 | width = SIM_LCD_WIDTH; | 141 | height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT; |
137 | height = SIM_LCD_HEIGHT; | 142 | } |
143 | else | ||
138 | #endif | 144 | #endif |
145 | { | ||
146 | width = SIM_LCD_WIDTH; | ||
147 | height = SIM_LCD_HEIGHT; | ||
148 | } | ||
139 | } | 149 | } |
140 | 150 | ||
141 | 151 | ||
@@ -148,7 +158,8 @@ bool gui_startup(void) | |||
148 | 158 | ||
149 | sim_lcd_init(); | 159 | sim_lcd_init(); |
150 | #ifdef HAVE_REMOTE_LCD | 160 | #ifdef HAVE_REMOTE_LCD |
151 | sim_lcd_remote_init(); | 161 | if (showremote) |
162 | sim_lcd_remote_init(); | ||
152 | #endif | 163 | #endif |
153 | 164 | ||
154 | SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); | 165 | SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); |
@@ -197,6 +208,14 @@ int main(int argc, char *argv[]) | |||
197 | background = false; | 208 | background = false; |
198 | printf("Disabling background image.\n"); | 209 | printf("Disabling background image.\n"); |
199 | } | 210 | } |
211 | #ifdef HAVE_REMOTE_LCD | ||
212 | else if (!strcmp("--noremote", argv[x])) | ||
213 | { | ||
214 | showremote = false; | ||
215 | background = false; | ||
216 | printf("Disabling remote image.\n"); | ||
217 | } | ||
218 | #endif | ||
200 | else if (!strcmp("--old_lcd", argv[x])) | 219 | else if (!strcmp("--old_lcd", argv[x])) |
201 | { | 220 | { |
202 | having_new_lcd = false; | 221 | having_new_lcd = false; |
@@ -232,6 +251,9 @@ int main(int argc, char *argv[]) | |||
232 | printf(" --debugaudio \t Write raw PCM data to audiodebug.raw\n"); | 251 | printf(" --debugaudio \t Write raw PCM data to audiodebug.raw\n"); |
233 | printf(" --debugwps \t Print advanced WPS debug info\n"); | 252 | printf(" --debugwps \t Print advanced WPS debug info\n"); |
234 | printf(" --nobackground \t Disable the background image\n"); | 253 | printf(" --nobackground \t Disable the background image\n"); |
254 | #ifdef HAVE_REMOTE_LCD | ||
255 | printf(" --noremote \t Disable the remote image (will disable backgrounds)\n"); | ||
256 | #endif | ||
235 | printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); | 257 | printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); |
236 | printf(" --zoom [VAL]\t Window zoom (will disable backgrounds)\n"); | 258 | printf(" --zoom [VAL]\t Window zoom (will disable backgrounds)\n"); |
237 | printf(" --alarm \t Simulate a wake-up on alarm\n"); | 259 | printf(" --alarm \t Simulate a wake-up on alarm\n"); |