summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/button.c2
-rw-r--r--uisimulator/sdl/lcd-bitmap.c230
-rw-r--r--uisimulator/sdl/lcd-bitmap.h2
-rw-r--r--uisimulator/sdl/lcd-charcells.c34
-rw-r--r--uisimulator/sdl/lcd-remote-bitmap.c47
-rw-r--r--uisimulator/sdl/lcd-sdl.c90
-rw-r--r--uisimulator/sdl/lcd-sdl.h13
-rw-r--r--uisimulator/sdl/uisdl.c12
-rw-r--r--uisimulator/sdl/uisdl.h218
9 files changed, 184 insertions, 464 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 0405ef0d1e..765bc0608e 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -1295,7 +1295,7 @@ void mouse_tick_task(void)
1295 x -= UI_LCD_POSX; 1295 x -= UI_LCD_POSX;
1296 y -= UI_LCD_POSY; 1296 y -= UI_LCD_POSY;
1297 1297
1298 if(x<0 || y<0 || x>UI_LCD_WIDTH || y>UI_LCD_HEIGHT) 1298 if(x<0 || y<0 || x>SIM_LCD_WIDTH || y>SIM_LCD_HEIGHT)
1299 return; 1299 return;
1300 } 1300 }
1301 1301
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index bc2a4c46f4..6faa5eb0b2 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -22,45 +22,74 @@
22#include "debug.h" 22#include "debug.h"
23#include "uisdl.h" 23#include "uisdl.h"
24#include "lcd-sdl.h" 24#include "lcd-sdl.h"
25#include "misc.h"
25 26
26SDL_Surface* lcd_surface; 27SDL_Surface* lcd_surface;
27#ifdef UI_LCD_SPLIT
28SDL_Surface* lcd_real_surface; /* the surface which represents the real screen */
29#endif
30int lcd_backlight_val;
31 28
32#if LCD_DEPTH <= 8 29#if LCD_DEPTH <= 8
33#ifdef HAVE_BACKLIGHT 30#ifdef HAVE_BACKLIGHT
34SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; 31SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR),
35SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0}; 32 GREEN_CMP(LCD_BL_DARKCOLOR),
36#ifdef UI_LCD_SPLIT 33 BLUE_CMP(LCD_BL_DARKCOLOR), 0};
37SDL_Color lcd_backlight_color_split= {UI_LCD_SPLIT_FGCOLORLIGHT, 0}; 34SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR),
38#endif 35 GREEN_CMP(LCD_BL_BRIGHTCOLOR),
39#endif 36 BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0};
40SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; 37#ifdef HAVE_LCD_SPLIT
41SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0}; 38SDL_Color lcd_bl_color2_dark = {RED_CMP(LCD_BL_DARKCOLOR_2),
42#ifdef UI_LCD_SPLIT 39 GREEN_CMP(LCD_BL_DARKCOLOR_2),
43SDL_Color lcd_color_split= {UI_LCD_SPLIT_FGCOLOR, 0}; 40 BLUE_CMP(LCD_BL_DARKCOLOR_2), 0};
44#endif 41SDL_Color lcd_bl_color2_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR_2),
42 GREEN_CMP(LCD_BL_BRIGHTCOLOR_2),
43 BLUE_CMP(LCD_BL_BRIGHTCOLOR_2), 0};
44#endif
45#endif /* HAVE_BACKLIGHT */
46SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR),
47 GREEN_CMP(LCD_DARKCOLOR),
48 BLUE_CMP(LCD_DARKCOLOR), 0};
49SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR),
50 GREEN_CMP(LCD_BRIGHTCOLOR),
51 BLUE_CMP(LCD_BRIGHTCOLOR), 0};
52#ifdef HAVE_LCD_SPLIT
53SDL_Color lcd_color2_dark = {RED_CMP(LCD_DARKCOLOR_2),
54 GREEN_CMP(LCD_DARKCOLOR_2),
55 BLUE_CMP(LCD_DARKCOLOR_2), 0};
56SDL_Color lcd_color2_bright = {RED_CMP(LCD_BRIGHTCOLOR_2),
57 GREEN_CMP(LCD_BRIGHTCOLOR_2),
58 BLUE_CMP(LCD_BRIGHTCOLOR_2), 0};
59#endif
60
61#ifdef HAVE_LCD_SPLIT
62#define GRADIENT_MAX 127
63#else
64#define GRADIENT_MAX 128
45#endif 65#endif
66#endif /* LCD_DEPTH <= 8 */
46 67
47#if LCD_DEPTH < 8 68#if LCD_DEPTH < 8
48int lcd_ex_shades = 0;
49unsigned long (*lcd_ex_getpixel)(int, int) = NULL; 69unsigned long (*lcd_ex_getpixel)(int, int) = NULL;
70#endif /* LCD_DEPTH < 8 */
71
72#if LCD_DEPTH == 2
73/* Only defined for positive, non-split LCD for now */
74static const unsigned char colorindex[4] = {128, 85, 43, 0};
50#endif 75#endif
51 76
52static unsigned long get_lcd_pixel(int x, int y) 77static unsigned long get_lcd_pixel(int x, int y)
53{ 78{
54#if LCD_DEPTH == 1 79#if LCD_DEPTH == 1
55 return ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1); 80#ifdef HAVE_NEGATIVE_LCD
81 return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? GRADIENT_MAX : 0;
82#else
83 return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : GRADIENT_MAX;
84#endif
56#elif LCD_DEPTH == 2 85#elif LCD_DEPTH == 2
57#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 86#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
58 return ((lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3); 87 return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3];
59#elif LCD_PIXELFORMAT == VERTICAL_PACKING 88#elif LCD_PIXELFORMAT == VERTICAL_PACKING
60 return ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3); 89 return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3];
61#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED 90#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
62 unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101; 91 unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
63 return (bits | (bits >> 7)) & 3; 92 return colorindex[(bits | (bits >> 7)) & 3];
64#endif 93#endif
65#elif LCD_DEPTH == 16 94#elif LCD_DEPTH == 16
66#if LCD_PIXELFORMAT == RGB565SWAPPED 95#if LCD_PIXELFORMAT == RGB565SWAPPED
@@ -80,148 +109,77 @@ void lcd_update(void)
80 109
81void lcd_update_rect(int x_start, int y_start, int width, int height) 110void lcd_update_rect(int x_start, int y_start, int width, int height)
82{ 111{
83 sdl_update_rect(lcd_surface, x_start, y_start, width, height, LCD_WIDTH, 112 sdl_update_rect(lcd_surface, x_start, y_start, width, height,
84 LCD_HEIGHT, get_lcd_pixel); 113 LCD_WIDTH, LCD_HEIGHT, get_lcd_pixel);
85 sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start, 114 sdl_gui_update(lcd_surface, x_start, y_start, width,
86 width, height, LCD_WIDTH, LCD_HEIGHT, 115 height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
87 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); 116 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
88} 117}
89 118
90#ifdef HAVE_BACKLIGHT 119#ifdef HAVE_BACKLIGHT
91void sim_backlight(int value) 120void sim_backlight(int value)
92{ 121{
93 lcd_backlight_val = value;
94
95#if LCD_DEPTH <= 8 122#if LCD_DEPTH <= 8
96 if (value > 0) { 123 if (value > 0) {
97#ifdef UI_LCD_SPLIT 124 sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
98 sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_zero, 125 &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
99 &lcd_backlight_color_max, &lcd_backlight_color_zero, 126#ifdef HAVE_LCD_SPLIT
100 &lcd_backlight_color_split, 0, (1<<LCD_DEPTH)); 127 sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
101#else 128 &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
102 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
103 &lcd_backlight_color_max, 0, (1<<LCD_DEPTH));
104#endif 129#endif
105 } else { 130 } else {
106#ifdef UI_LCD_SPLIT 131 sdl_set_gradient(lcd_surface, &lcd_color_dark,
107 sdl_set_gradient(lcd_real_surface, &lcd_color_zero, &lcd_color_max, 132 &lcd_color_bright, 0, GRADIENT_MAX+1);
108 &lcd_color_zero, &lcd_color_split, 0, (1<<LCD_DEPTH)); 133#ifdef HAVE_LCD_SPLIT
109#else 134 sdl_set_gradient(lcd_surface, &lcd_color2_dark,
110 sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, 0, 135 &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
111 (1<<LCD_DEPTH));
112#endif
113 }
114#if LCD_DEPTH < 8
115 if (lcd_ex_shades) {
116 if (value > 0) {
117#ifdef UI_LCD_SPLIT
118 sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max,
119 &lcd_backlight_color_zero, &lcd_backlight_color_split,
120 &lcd_backlight_color_zero,
121 (1<<LCD_DEPTH), lcd_ex_shades);
122#elif defined MROBE_100
123 /* quick fix, a proper fix needs to compare brightnesses */
124 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
125 &lcd_backlight_color_max, (1<<LCD_DEPTH), lcd_ex_shades);
126#else
127 sdl_set_gradient(lcd_surface, &lcd_backlight_color_max,
128 &lcd_backlight_color_zero, (1<<LCD_DEPTH), lcd_ex_shades);
129#endif 136#endif
130 } else {
131#ifdef UI_LCD_SPLIT
132 sdl_set_gradient(lcd_real_surface, &lcd_color_max, &lcd_color_zero,
133 &lcd_color_split, &lcd_color_zero, (1<<LCD_DEPTH),
134 lcd_ex_shades);
135#elif defined MROBE_100
136 /* quick fix, a proper fix needs to compare brightnesses */
137 sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max,
138 (1<<LCD_DEPTH), lcd_ex_shades);
139#else
140 sdl_set_gradient(lcd_surface, &lcd_color_max, &lcd_color_zero,
141 (1<<LCD_DEPTH), lcd_ex_shades);
142#endif
143 }
144 } 137 }
145#endif 138 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
146 139 SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
147 sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) 0, 0, LCD_WIDTH,
148 LCD_HEIGHT, LCD_WIDTH, LCD_HEIGHT,
149 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); 140 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
150 141#endif /* LCD_DEPTH <= 8 */
151#endif
152} 142}
153#endif 143#endif /* HAVE_BACKLIGHT */
154 144
155/* initialise simulator lcd driver */ 145/* initialise simulator lcd driver */
156void sim_lcd_init(void) 146void sim_lcd_init(void)
157{ 147{
158#if LCD_DEPTH == 16 148#if LCD_DEPTH == 16
159 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, 149 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
160 LCD_HEIGHT * display_zoom, LCD_DEPTH, 0, 0, 0, 0); 150 SIM_LCD_WIDTH * display_zoom,
151 SIM_LCD_HEIGHT * display_zoom,
152 LCD_DEPTH, 0, 0, 0, 0);
161#else 153#else
162 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, 154 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
163 LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0); 155 SIM_LCD_WIDTH * display_zoom,
164#ifdef UI_LCD_SPLIT 156 SIM_LCD_HEIGHT * display_zoom,
165 lcd_real_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 157 8, 0, 0, 0, 0);
166 LCD_WIDTH * display_zoom,
167 (LCD_HEIGHT+UI_LCD_SPLIT_BLACK_LINES) * display_zoom, 8, 0, 0, 0, 0);
168#endif
169#endif 158#endif
170 159
171#if LCD_DEPTH <= 8 160#if LCD_DEPTH <= 8
172#ifdef HAVE_BACKLIGHT 161#ifdef HAVE_BACKLIGHT
173#ifdef UI_LCD_SPLIT 162 sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
174 sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_zero, 163 &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
175 &lcd_backlight_color_max, &lcd_backlight_color_zero, 164#ifdef HAVE_LCD_SPLIT
176 &lcd_backlight_color_split, 0, (1<<LCD_DEPTH)); 165 sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
177#else 166 &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
178 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, 167#endif
179 &lcd_backlight_color_max, 0, (1<<LCD_DEPTH)); 168#else /* !HAVE_BACKLIGHT */
180#endif 169 sdl_set_gradient(lcd_surface, &lcd_color_dark,
181#else 170 &lcd_color_bright, 0, GRADIENT_MAX+1);
182 sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, 0, 171#ifdef HAVE_LCD_SPLIT
183 (1<<LCD_DEPTH)); 172 sdl_set_gradient(lcd_surface, &lcd_color2_dark,
184#endif 173 &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
185#endif 174#endif
175#endif /* !HAVE_BACKLIGHT */
176#endif /* LCD_DEPTH < 8 */
186} 177}
187 178
188#if LCD_DEPTH < 8 179#if LCD_DEPTH < 8
189void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int)) 180void sim_lcd_ex_init(unsigned long (*getpixel)(int, int))
190{ 181{
191 lcd_ex_shades = shades;
192 lcd_ex_getpixel = getpixel; 182 lcd_ex_getpixel = getpixel;
193 if (shades) {
194#ifdef HAVE_BACKLIGHT
195 if (lcd_backlight_val > 0) {
196#ifdef UI_LCD_SPLIT
197 sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max,
198 &lcd_backlight_color_zero, &lcd_backlight_color_split,
199 &lcd_backlight_color_zero, (1<<LCD_DEPTH), shades);
200#elif defined MROBE_100
201 /* quick fix, a proper fix needs to compare brightnesses */
202 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
203 &lcd_backlight_color_max, (1<<LCD_DEPTH), shades);
204#else
205 sdl_set_gradient(lcd_surface, &lcd_backlight_color_max,
206 &lcd_backlight_color_zero, (1<<LCD_DEPTH), shades);
207#endif
208 }
209 else
210#endif
211 {
212#ifdef UI_LCD_SPLIT
213 sdl_set_gradient(lcd_real_surface, &lcd_color_max, &lcd_color_zero,
214 &lcd_color_split, &lcd_color_zero, (1<<LCD_DEPTH), shades);
215#elif defined MROBE_100
216 /* quick fix, a proper fix needs to compare brightnesses */
217 sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max,
218 (1<<LCD_DEPTH), shades);
219#else
220 sdl_set_gradient(lcd_surface, &lcd_color_max, &lcd_color_zero,
221 (1<<LCD_DEPTH), shades);
222#endif
223 }
224 }
225} 183}
226 184
227void sim_lcd_ex_update_rect(int x_start, int y_start, int width, int height) 185void sim_lcd_ex_update_rect(int x_start, int y_start, int width, int height)
@@ -229,10 +187,10 @@ void sim_lcd_ex_update_rect(int x_start, int y_start, int width, int height)
229 if (lcd_ex_getpixel) { 187 if (lcd_ex_getpixel) {
230 sdl_update_rect(lcd_surface, x_start, y_start, width, height, 188 sdl_update_rect(lcd_surface, x_start, y_start, width, height,
231 LCD_WIDTH, LCD_HEIGHT, lcd_ex_getpixel); 189 LCD_WIDTH, LCD_HEIGHT, lcd_ex_getpixel);
232 sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start, 190 sdl_gui_update(lcd_surface, x_start, y_start, width,
233 width, height, LCD_WIDTH, LCD_HEIGHT, 191 height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
234 background ? UI_LCD_POSX : 0, 192 background ? UI_LCD_POSX : 0,
235 background? UI_LCD_POSY : 0); 193 background ? UI_LCD_POSY : 0);
236 } 194 }
237} 195}
238#endif 196#endif
diff --git a/uisimulator/sdl/lcd-bitmap.h b/uisimulator/sdl/lcd-bitmap.h
index 74aafa8cd1..a898744b41 100644
--- a/uisimulator/sdl/lcd-bitmap.h
+++ b/uisimulator/sdl/lcd-bitmap.h
@@ -27,7 +27,7 @@
27 27
28void sim_lcd_init(void); 28void sim_lcd_init(void);
29#if LCD_DEPTH < 8 29#if LCD_DEPTH < 8
30void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int)); 30void sim_lcd_ex_init(unsigned long (*getpixel)(int, int));
31void sim_lcd_ex_update_rect(int x, int y, int width, int height); 31void sim_lcd_ex_update_rect(int x, int y, int width, int height);
32#endif 32#endif
33 33
diff --git a/uisimulator/sdl/lcd-charcells.c b/uisimulator/sdl/lcd-charcells.c
index 6f09858717..19d27d5152 100644
--- a/uisimulator/sdl/lcd-charcells.c
+++ b/uisimulator/sdl/lcd-charcells.c
@@ -35,10 +35,19 @@
35extern int sim_creat(const char *name); 35extern int sim_creat(const char *name);
36 36
37SDL_Surface* lcd_surface; 37SDL_Surface* lcd_surface;
38SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0}; 38
39SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0}; 39SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR),
40SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0}; 40 GREEN_CMP(LCD_BL_DARKCOLOR),
41SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0}; 41 BLUE_CMP(LCD_BL_DARKCOLOR), 0};
42SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR),
43 GREEN_CMP(LCD_BL_BRIGHTCOLOR),
44 BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0};
45SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR),
46 GREEN_CMP(LCD_DARKCOLOR),
47 BLUE_CMP(LCD_DARKCOLOR), 0};
48SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR),
49 GREEN_CMP(LCD_BRIGHTCOLOR),
50 BLUE_CMP(LCD_BRIGHTCOLOR), 0};
42 51
43 52
44static unsigned long get_lcd_pixel(int x, int y) 53static unsigned long get_lcd_pixel(int x, int y)
@@ -78,12 +87,11 @@ void lcd_update(void)
78void sim_backlight(int value) 87void sim_backlight(int value)
79{ 88{
80 if (value > 0) { 89 if (value > 0) {
81 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, 90 sdl_set_gradient(lcd_surface, &lcd_bl_color_bright,
82 &lcd_backlight_color_max, 91 &lcd_bl_color_dark, 0, (1<<LCD_DEPTH));
83 0, (1<<LCD_DEPTH));
84 } else { 92 } else {
85 sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, 93 sdl_set_gradient(lcd_surface, &lcd_color_bright,
86 0, (1<<LCD_DEPTH)); 94 &lcd_color_dark, 0, (1<<LCD_DEPTH));
87 } 95 }
88 96
89 sim_lcd_update_rect(0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT); 97 sim_lcd_update_rect(0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT);
@@ -98,8 +106,8 @@ void sim_lcd_init(void)
98 SIM_LCD_HEIGHT * display_zoom, 106 SIM_LCD_HEIGHT * display_zoom,
99 8, 0, 0, 0, 0); 107 8, 0, 0, 0, 0);
100 108
101 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, 109 sdl_set_gradient(lcd_surface, &lcd_bl_color_bright,
102 0, (1<<LCD_DEPTH)); 110 &lcd_bl_color_dark, 0, (1<<LCD_DEPTH));
103} 111}
104 112
105#define BMP_COMPRESSION 0 /* BI_RGB */ 113#define BMP_COMPRESSION 0 /* BI_RGB */
@@ -133,8 +141,8 @@ static const unsigned char bmpheader[] =
133 LE32_CONST(BMP_NUMCOLORS), /* Number of used colours */ 141 LE32_CONST(BMP_NUMCOLORS), /* Number of used colours */
134 LE32_CONST(BMP_NUMCOLORS), /* Number of important colours */ 142 LE32_CONST(BMP_NUMCOLORS), /* Number of important colours */
135 143
136 0x90, 0xee, 0x90, 0x00, /* Colour #0 */ 144 BMP_COLOR(LCD_BL_BRIGHTCOLOR),
137 0x00, 0x00, 0x00, 0x00 /* Colour #1 */ 145 BMP_COLOR(LCD_BL_DARKCOLOR)
138}; 146};
139 147
140void screen_dump(void) 148void screen_dump(void)
diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/uisimulator/sdl/lcd-remote-bitmap.c
index d165534e00..f5c2225ab2 100644
--- a/uisimulator/sdl/lcd-remote-bitmap.c
+++ b/uisimulator/sdl/lcd-remote-bitmap.c
@@ -22,20 +22,38 @@
22#include "uisdl.h" 22#include "uisdl.h"
23#include "lcd-sdl.h" 23#include "lcd-sdl.h"
24#include "lcd-remote-bitmap.h" 24#include "lcd-remote-bitmap.h"
25#include "misc.h"
25 26
26SDL_Surface *remote_surface; 27SDL_Surface *remote_surface;
27 28
28SDL_Color remote_color_zero = {UI_REMOTE_BGCOLOR, 0}; 29SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR),
29SDL_Color remote_backlight_color_zero = {UI_REMOTE_BGCOLORLIGHT, 0}; 30 GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR),
30SDL_Color remote_color_max = {0, 0, 0, 0}; 31 BLUE_CMP(LCD_REMOTE_BL_DARKCOLOR), 0};
32SDL_Color remote_bl_color_bright = {RED_CMP(LCD_REMOTE_BL_BRIGHTCOLOR),
33 GREEN_CMP(LCD_REMOTE_BL_BRIGHTCOLOR),
34 BLUE_CMP(LCD_REMOTE_BL_BRIGHTCOLOR), 0};
35SDL_Color remote_color_dark = {RED_CMP(LCD_REMOTE_DARKCOLOR),
36 GREEN_CMP(LCD_REMOTE_DARKCOLOR),
37 BLUE_CMP(LCD_REMOTE_DARKCOLOR), 0};
38SDL_Color remote_color_bright = {RED_CMP(LCD_REMOTE_BRIGHTCOLOR),
39 GREEN_CMP(LCD_REMOTE_BRIGHTCOLOR),
40 BLUE_CMP(LCD_REMOTE_BRIGHTCOLOR), 0};
31 41
32static unsigned long get_lcd_remote_pixel(int x, int y) { 42#define GRADIENT_MAX 128
43
44#if LCD_REMOTE_DEPTH == 2
45/* Only defined for positive, non-split LCD for now */
46static const unsigned char colorindex[4] = {128, 85, 43, 0};
47#endif
48
49static unsigned long get_lcd_remote_pixel(int x, int y)
50{
33#if LCD_REMOTE_DEPTH == 1 51#if LCD_REMOTE_DEPTH == 1
34 return (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 1; 52 return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : GRADIENT_MAX;
35#elif LCD_REMOTE_DEPTH == 2 53#elif LCD_REMOTE_DEPTH == 2
36#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED 54#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
37 unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101; 55 unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
38 return (bits | (bits >> 7)) & 3; 56 return colorindex[(bits | (bits >> 7)) & 3];
39#endif 57#endif
40#endif 58#endif
41} 59}
@@ -57,11 +75,11 @@ void lcd_remote_update_rect(int x_start, int y_start, int width, int height)
57void sim_remote_backlight(int value) 75void sim_remote_backlight(int value)
58{ 76{
59 if (value > 0) { 77 if (value > 0) {
60 sdl_set_gradient(remote_surface, &remote_backlight_color_zero, 78 sdl_set_gradient(remote_surface, &remote_bl_color_dark,
61 &remote_color_max, 0, (1<<LCD_REMOTE_DEPTH)); 79 &remote_bl_color_bright, 0, GRADIENT_MAX+1);
62 } else { 80 } else {
63 sdl_set_gradient(remote_surface, &remote_color_zero, &remote_color_max, 81 sdl_set_gradient(remote_surface, &remote_color_dark,
64 0, (1<<LCD_REMOTE_DEPTH)); 82 &remote_color_bright, 0, GRADIENT_MAX+1);
65 } 83 }
66 84
67 sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT, 85 sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
@@ -74,10 +92,11 @@ void sim_remote_backlight(int value)
74void sim_lcd_remote_init(void) 92void sim_lcd_remote_init(void)
75{ 93{
76 remote_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 94 remote_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
77 LCD_REMOTE_WIDTH * display_zoom, LCD_REMOTE_HEIGHT * display_zoom, 95 LCD_REMOTE_WIDTH * display_zoom,
78 8, 0, 0, 0, 0); 96 LCD_REMOTE_HEIGHT * display_zoom,
97 8, 0, 0, 0, 0);
79 98
80 sdl_set_gradient(remote_surface, &remote_backlight_color_zero, 99 sdl_set_gradient(remote_surface, &remote_bl_color_dark,
81 &remote_color_max, 0, (1<<LCD_REMOTE_DEPTH)); 100 &remote_bl_color_bright, 0, GRADIENT_MAX+1);
82} 101}
83 102
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index 6431c5f39d..373e07ffc0 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -21,11 +21,9 @@
21 21
22#include "lcd-sdl.h" 22#include "lcd-sdl.h"
23#include "uisdl.h" 23#include "uisdl.h"
24#include "system.h" /* for MIN() and MAX() */
24 25
25int display_zoom = 1; 26int display_zoom = 1;
26#ifdef UI_LCD_SPLIT
27static int gradient_steps = 0;
28#endif
29 27
30void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width, 28void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
31 int height, int max_x, int max_y, 29 int height, int max_x, int max_y,
@@ -51,18 +49,30 @@ void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
51 for (x = x_start; x < xmax; x++) { 49 for (x = x_start; x < xmax; x++) {
52 dest.x = x * display_zoom; 50 dest.x = x * display_zoom;
53 51
52#ifdef HAVE_LCD_SPLIT
53 for (y = y_start; y < MIN(ymax, LCD_SPLIT_POS); y++) {
54 dest.y = y * display_zoom;
55
56 SDL_FillRect(surface, &dest, (Uint32)(getpixel(x, y) | 0x80));
57 }
58 for (y = MAX(y_start, LCD_SPLIT_POS); y < ymax; y++) {
59 dest.y = (y + LCD_SPLIT_LINES) * display_zoom ;
60
61 SDL_FillRect(surface, &dest, (Uint32)getpixel(x, y));
62 }
63#else
54 for (y = y_start; y < ymax; y++) { 64 for (y = y_start; y < ymax; y++) {
55 dest.y = y * display_zoom; 65 dest.y = y * display_zoom;
56 66
57 SDL_FillRect(surface, &dest, (Uint32)getpixel(x, y)); 67 SDL_FillRect(surface, &dest, (Uint32)getpixel(x, y));
58 } 68 }
69#endif
59 } 70 }
60 71
61 SDL_UnlockSurface(surface); 72 SDL_UnlockSurface(surface);
62} 73}
63 74
64void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,) 75void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
65 int x_start, int y_start, int width,
66 int height, int max_x, int max_y, int ui_x, int ui_y) 76 int height, int max_x, int max_y, int ui_x, int ui_y)
67{ 77{
68 int xmax, ymax; 78 int xmax, ymax;
@@ -80,73 +90,17 @@ void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,)
80 SDL_Rect dest= {(ui_x + x_start) * display_zoom, (ui_y + y_start) * display_zoom, 90 SDL_Rect dest= {(ui_x + x_start) * display_zoom, (ui_y + y_start) * display_zoom,
81 xmax * display_zoom, ymax * display_zoom}; 91 xmax * display_zoom, ymax * display_zoom};
82 92
83#ifdef UI_LCD_SPLIT
84 /* fix real screen coordinates */
85 if(ymax >= UI_LCD_SPLIT_LINES)
86 src.h += UI_LCD_SPLIT_BLACK_LINES * display_zoom;
87
88 SDL_LockSurface(surface);
89 SDL_LockSurface(real_surface);
90
91 int pixel, npixels;
92
93#if LCD_DEPTH != 1
94#error "Split screen only works for monochrome displays !"
95#endif
96
97 npixels = display_zoom * display_zoom * UI_LCD_SPLIT_LINES * surface->pitch;
98 const unsigned char * pixels_src = (const unsigned char*)surface->pixels;
99 unsigned char * pixels_dst = (unsigned char*)real_surface->pixels;
100 const int start_pixel = UI_LCD_SPLIT_LINES * surface->pitch * display_zoom;
101 const int stop_pixel = (UI_LCD_SPLIT_LINES+UI_LCD_SPLIT_BLACK_LINES)
102 * surface->pitch * display_zoom;
103
104 /* draw top pixels, change the color */
105 for (pixel = 0; pixel < npixels ; pixel++)
106 {
107 int pix = pixels_src[pixel] + gradient_steps;
108 if(pix > 255) pix = 255;
109
110 pixels_dst[pixel] = pix;
111 }
112
113 /* copy bottom pixels */
114 memcpy(&pixels_dst[stop_pixel], &pixels_src[start_pixel],
115 (UI_LCD_HEIGHT - UI_LCD_SPLIT_LINES) * surface->pitch * display_zoom);
116
117 /* separation lines are off */
118 for (pixel = start_pixel; pixel < stop_pixel ; pixel++)
119 pixels_dst[pixel] = 0;
120
121 SDL_UnlockSurface(surface);
122 SDL_UnlockSurface(real_surface);
123
124 SDL_BlitSurface(real_surface, &src, gui_surface, &dest);
125#else
126 SDL_BlitSurface(surface, &src, gui_surface, &dest); 93 SDL_BlitSurface(surface, &src, gui_surface, &dest);
127#endif
128 94
129 SDL_Flip(gui_surface); 95 SDL_Flip(gui_surface);
130} 96}
131 97
132/* set a range of bitmap indices to a gradient from startcolour to endcolour */ 98/* set a range of bitmap indices to a gradient from startcolour to endcolour */
133void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, 99void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
134 IFSPLIT(SDL_Color *split_start,) 100 int first, int steps)
135 IFSPLIT(SDL_Color *split_end ,) int first, int steps)
136{ 101{
137 int i; 102 int i;
138 103 SDL_Color palette[steps];
139#ifdef UI_LCD_SPLIT
140 int tot_steps = steps * 2;
141 if (tot_steps > 256)
142 tot_steps = 256;
143
144 gradient_steps = steps;
145#else
146#define tot_steps steps
147#endif
148
149 SDL_Color palette[tot_steps];
150 104
151 for (i = 0; i < steps; i++) { 105 for (i = 0; i < steps; i++) {
152 palette[i].r = start->r + (end->r - start->r) * i / (steps - 1); 106 palette[i].r = start->r + (end->r - start->r) * i / (steps - 1);
@@ -154,14 +108,6 @@ void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
154 palette[i].b = start->b + (end->b - start->b) * i / (steps - 1); 108 palette[i].b = start->b + (end->b - start->b) * i / (steps - 1);
155 } 109 }
156 110
157#ifdef UI_LCD_SPLIT /* extra color */ 111 SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, steps);
158 for (i = steps ; i < tot_steps; i++) {
159 palette[i].r = split_start->r + (split_end->r - split_start->r) * (i - steps) / (tot_steps - steps - 1);
160 palette[i].g = split_start->g + (split_end->g - split_start->g) * (i - steps) / (tot_steps - steps - 1);
161 palette[i].b = split_start->b + (split_end->b - split_start->b) * (i - steps) / (tot_steps - steps - 1);
162 }
163#endif
164
165 SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, tot_steps);
166} 112}
167 113
diff --git a/uisimulator/sdl/lcd-sdl.h b/uisimulator/sdl/lcd-sdl.h
index b177eb14c9..9ffa5246cf 100644
--- a/uisimulator/sdl/lcd-sdl.h
+++ b/uisimulator/sdl/lcd-sdl.h
@@ -25,13 +25,6 @@
25#include "lcd.h" 25#include "lcd.h"
26#include "SDL.h" 26#include "SDL.h"
27 27
28#include "uisdl.h"
29#ifdef UI_LCD_SPLIT
30#define IFSPLIT(x,y) x,y
31#else
32#define IFSPLIT(x,y)
33#endif
34
35/* Default display zoom level */ 28/* Default display zoom level */
36extern int display_zoom; 29extern int display_zoom;
37 30
@@ -39,13 +32,11 @@ void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
39 int height, int max_x, int max_y, 32 int height, int max_x, int max_y,
40 unsigned long (*getpixel)(int, int)); 33 unsigned long (*getpixel)(int, int));
41 34
42void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,) 35void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
43 int x_start, int y_start, int width,
44 int height, int max_x, int max_y, int ui_x, int ui_y); 36 int height, int max_x, int max_y, int ui_x, int ui_y);
45 37
46void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end, 38void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
47 IFSPLIT( SDL_Color *split_start ,) 39 int first, int steps);
48 IFSPLIT( SDL_Color *split_end ,) int first, int steps);
49 40
50#endif /* #ifndef __LCDSDL_H__ */ 41#endif /* #ifndef __LCDSDL_H__ */
51 42
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c
index 81f9722a68..d6a49d3a60 100644
--- a/uisimulator/sdl/uisdl.c
+++ b/uisimulator/sdl/uisdl.c
@@ -130,15 +130,11 @@ bool gui_startup(void)
130 height = UI_HEIGHT; 130 height = UI_HEIGHT;
131 } else { 131 } else {
132#ifdef HAVE_REMOTE_LCD 132#ifdef HAVE_REMOTE_LCD
133 width = UI_LCD_WIDTH > UI_REMOTE_WIDTH ? UI_LCD_WIDTH : UI_REMOTE_WIDTH; 133 width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH;
134 height = UI_LCD_HEIGHT + UI_REMOTE_HEIGHT; 134 height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT;
135#else 135#else
136 width = UI_LCD_WIDTH; 136 width = SIM_LCD_WIDTH;
137 height = UI_LCD_HEIGHT 137 height = SIM_LCD_HEIGHT;
138#ifdef UI_LCD_SPLIT
139 + UI_LCD_SPLIT_BLACK_LINES
140#endif
141 ;
142#endif 138#endif
143 } 139 }
144 140
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index e33be01948..6cb382ce8b 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -31,208 +31,114 @@
31#define UI_TITLE "Jukebox Recorder" 31#define UI_TITLE "Jukebox Recorder"
32#define UI_WIDTH 270 /* width of GUI window */ 32#define UI_WIDTH 270 /* width of GUI window */
33#define UI_HEIGHT 406 /* height of GUI window */ 33#define UI_HEIGHT 406 /* height of GUI window */
34#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
35#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
36#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
37#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
38#define UI_LCD_POSX 80 /* x position of lcd */ 34#define UI_LCD_POSX 80 /* x position of lcd */
39#define UI_LCD_POSY 104 /* y position of lcd (96 for real aspect) */ 35#define UI_LCD_POSY 104 /* y position of lcd */
40#define UI_LCD_WIDTH 112
41#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
42 36
43#elif defined(ARCHOS_PLAYER) 37#elif defined(ARCHOS_PLAYER)
44#define UI_TITLE "Jukebox Player" 38#define UI_TITLE "Jukebox Player"
45#define UI_WIDTH 284 /* width of GUI window */ 39#define UI_WIDTH 284 /* width of GUI window */
46#define UI_HEIGHT 420 /* height of GUI window */ 40#define UI_HEIGHT 420 /* height of GUI window */
47#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
48#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
49#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
50#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
51#define UI_LCD_POSX 75 /* x position of lcd */ 41#define UI_LCD_POSX 75 /* x position of lcd */
52#define UI_LCD_POSY 116 /* y position of lcd */ 42#define UI_LCD_POSY 116 /* y position of lcd */
53#define UI_LCD_WIDTH 132
54#define UI_LCD_HEIGHT 64
55 43
56#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) 44#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
57#define UI_TITLE "Jukebox FM Recorder" 45#define UI_TITLE "Jukebox FM Recorder"
58#define UI_WIDTH 285 /* width of GUI window */ 46#define UI_WIDTH 285 /* width of GUI window */
59#define UI_HEIGHT 414 /* height of GUI window */ 47#define UI_HEIGHT 414 /* height of GUI window */
60#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
61#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
62#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
63#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
64#define UI_LCD_POSX 87 /* x position of lcd */ 48#define UI_LCD_POSX 87 /* x position of lcd */
65#define UI_LCD_POSY 77 /* y position of lcd (69 for real aspect) */ 49#define UI_LCD_POSY 77 /* y position of lcd */
66#define UI_LCD_WIDTH 112
67#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
68 50
69#elif defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM) 51#elif defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM)
70#define UI_TITLE "Ondio" 52#define UI_TITLE "Ondio"
71#define UI_WIDTH 155 /* width of GUI window */ 53#define UI_WIDTH 155 /* width of GUI window */
72#define UI_HEIGHT 334 /* height of GUI window */ 54#define UI_HEIGHT 334 /* height of GUI window */
73#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
74#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (backlight mod) */
75#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
76#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
77#define UI_LCD_POSX 21 /* x position of lcd */ 55#define UI_LCD_POSX 21 /* x position of lcd */
78#define UI_LCD_POSY 82 /* y position of lcd (74 for real aspect) */ 56#define UI_LCD_POSY 82 /* y position of lcd */
79#define UI_LCD_WIDTH 112
80#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
81 57
82#elif defined(IRIVER_H120) || defined(IRIVER_H100) 58#elif defined(IRIVER_H120) || defined(IRIVER_H100)
83#define UI_TITLE "iriver H1x0" 59#define UI_TITLE "iriver H1x0"
84#define UI_WIDTH 379 /* width of GUI window */ 60#define UI_WIDTH 379 /* width of GUI window */
85#define UI_HEIGHT 508 /* height of GUI window */ 61#define UI_HEIGHT 508 /* height of GUI window */
86#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
87#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
88#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
89#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
90#define UI_LCD_POSX 109 /* x position of lcd */ 62#define UI_LCD_POSX 109 /* x position of lcd */
91#define UI_LCD_POSY 23 /* y position of lcd */ 63#define UI_LCD_POSY 23 /* y position of lcd */
92#define UI_LCD_WIDTH 160
93#define UI_LCD_HEIGHT 128
94#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
95#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
96#define UI_REMOTE_FGCOLOR 0, 0, 0 /* foreground color of remote LCD (no backlight) */
97#define UI_REMOTE_FGCOLORLIGHT 0, 0, 0 /* foreground color of remote LCD (backlight) */
98#define UI_REMOTE_POSX 50 /* x position of remote lcd */ 64#define UI_REMOTE_POSX 50 /* x position of remote lcd */
99#define UI_REMOTE_POSY 403 /* y position of remote lcd */ 65#define UI_REMOTE_POSY 403 /* y position of remote lcd */
100#define UI_REMOTE_WIDTH 128
101#define UI_REMOTE_HEIGHT 64
102 66
103#elif defined(IRIVER_H300) 67#elif defined(IRIVER_H300)
104#define UI_TITLE "iriver H300" 68#define UI_TITLE "iriver H300"
105#define UI_WIDTH 288 /* width of GUI window */ 69#define UI_WIDTH 288 /* width of GUI window */
106#define UI_HEIGHT 581 /* height of GUI window */ 70#define UI_HEIGHT 581 /* height of GUI window */
107/* high-colour */
108#define UI_LCD_POSX 26 /* x position of lcd */ 71#define UI_LCD_POSX 26 /* x position of lcd */
109#define UI_LCD_POSY 36 /* y position of lcd */ 72#define UI_LCD_POSY 36 /* y position of lcd */
110#define UI_LCD_WIDTH 220
111#define UI_LCD_HEIGHT 176
112#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
113#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
114#define UI_REMOTE_POSX 12 /* x position of remote lcd */ 73#define UI_REMOTE_POSX 12 /* x position of remote lcd */
115#define UI_REMOTE_POSY 478 /* y position of remote lcd */ 74#define UI_REMOTE_POSY 478 /* y position of remote lcd */
116#define UI_REMOTE_WIDTH 128
117#define UI_REMOTE_HEIGHT 64
118 75
119#elif defined(IPOD_1G2G) 76#elif defined(IPOD_1G2G)
120#define UI_TITLE "iPod 1G/2G" 77#define UI_TITLE "iPod 1G/2G"
121#define UI_WIDTH 224 /* width of GUI window */ 78#define UI_WIDTH 224 /* width of GUI window */
122#define UI_HEIGHT 382 /* height of GUI window */ 79#define UI_HEIGHT 382 /* height of GUI window */
123#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
124#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
125#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
126#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
127#define UI_LCD_POSX 32 /* x position of lcd */ 80#define UI_LCD_POSX 32 /* x position of lcd */
128#define UI_LCD_POSY 12 /* y position of lcd */ 81#define UI_LCD_POSY 12 /* y position of lcd */
129#define UI_LCD_WIDTH 160
130#define UI_LCD_HEIGHT 128
131 82
132#elif defined(IPOD_3G) 83#elif defined(IPOD_3G)
133#define UI_TITLE "iPod 3G" 84#define UI_TITLE "iPod 3G"
134#define UI_WIDTH 218 /* width of GUI window */ 85#define UI_WIDTH 218 /* width of GUI window */
135#define UI_HEIGHT 389 /* height of GUI window */ 86#define UI_HEIGHT 389 /* height of GUI window */
136#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
137#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
138#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
139#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
140#define UI_LCD_POSX 29 /* x position of lcd */ 87#define UI_LCD_POSX 29 /* x position of lcd */
141#define UI_LCD_POSY 16 /* y position of lcd */ 88#define UI_LCD_POSY 16 /* y position of lcd */
142#define UI_LCD_WIDTH 160
143#define UI_LCD_HEIGHT 128
144 89
145#elif defined(IPOD_4G) 90#elif defined(IPOD_4G)
146#define UI_TITLE "iPod 4G" 91#define UI_TITLE "iPod 4G"
147#define UI_WIDTH 196 /* width of GUI window */ 92#define UI_WIDTH 196 /* width of GUI window */
148#define UI_HEIGHT 370 /* height of GUI window */ 93#define UI_HEIGHT 370 /* height of GUI window */
149#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
150#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
151#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
152#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
153#define UI_LCD_POSX 19 /* x position of lcd */ 94#define UI_LCD_POSX 19 /* x position of lcd */
154#define UI_LCD_POSY 14 /* y position of lcd */ 95#define UI_LCD_POSY 14 /* y position of lcd */
155#define UI_LCD_WIDTH 160
156#define UI_LCD_HEIGHT 128
157 96
158#elif defined(IPOD_MINI) || defined(IPOD_MINI2G) 97#elif defined(IPOD_MINI) || defined(IPOD_MINI2G)
159#define UI_TITLE "iPod mini" 98#define UI_TITLE "iPod mini"
160#define UI_WIDTH 191 /* width of GUI window */ 99#define UI_WIDTH 191 /* width of GUI window */
161#define UI_HEIGHT 365 /* height of GUI window */ 100#define UI_HEIGHT 365 /* height of GUI window */
162#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
163#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
164#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
165#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
166#define UI_LCD_POSX 24 /* x position of lcd */ 101#define UI_LCD_POSX 24 /* x position of lcd */
167#define UI_LCD_POSY 17 /* y position of lcd */ 102#define UI_LCD_POSY 17 /* y position of lcd */
168#define UI_LCD_WIDTH 138
169#define UI_LCD_HEIGHT 110
170 103
171#elif defined(IPOD_COLOR) 104#elif defined(IPOD_COLOR)
172#define UI_TITLE "iPod Color" 105#define UI_TITLE "iPod Color"
173#define UI_WIDTH 261 /* width of GUI window */ 106#define UI_WIDTH 261 /* width of GUI window */
174#define UI_HEIGHT 493 /* height of GUI window */ 107#define UI_HEIGHT 493 /* height of GUI window */
175/* high-colour */
176#define UI_LCD_POSX 21 /* x position of lcd */ 108#define UI_LCD_POSX 21 /* x position of lcd */
177#define UI_LCD_POSY 16 /* y position of lcd */ 109#define UI_LCD_POSY 16 /* y position of lcd */
178#define UI_LCD_WIDTH 220
179#define UI_LCD_HEIGHT 176
180 110
181#elif defined(IPOD_NANO) 111#elif defined(IPOD_NANO)
182#define UI_TITLE "iPod Nano" 112#define UI_TITLE "iPod Nano"
183#define UI_WIDTH 199 /* width of GUI window */ 113#define UI_WIDTH 199 /* width of GUI window */
184#define UI_HEIGHT 421 /* height of GUI window */ 114#define UI_HEIGHT 421 /* height of GUI window */
185/* high-colour */
186#define UI_LCD_POSX 13 /* x position of lcd */ 115#define UI_LCD_POSX 13 /* x position of lcd */
187#define UI_LCD_POSY 14 /* y position of lcd */ 116#define UI_LCD_POSY 14 /* y position of lcd */
188#define UI_LCD_WIDTH 176
189#define UI_LCD_HEIGHT 132
190 117
191#elif defined(IPOD_VIDEO) 118#elif defined(IPOD_VIDEO)
192#define UI_TITLE "iPod Video" 119#define UI_TITLE "iPod Video"
193#define UI_WIDTH 350 /* width of GUI window */ 120#define UI_WIDTH 350 /* width of GUI window */
194#define UI_HEIGHT 591 /* height of GUI window */ 121#define UI_HEIGHT 591 /* height of GUI window */
195/* high-colour */
196#define UI_LCD_POSX 14 /* x position of lcd */ 122#define UI_LCD_POSX 14 /* x position of lcd */
197#define UI_LCD_POSY 12 /* y position of lcd */ 123#define UI_LCD_POSY 12 /* y position of lcd */
198#define UI_LCD_WIDTH 320
199#define UI_LCD_HEIGHT 240
200 124
201#elif defined(IAUDIO_X5) 125#elif defined(IAUDIO_X5)
202#define UI_TITLE "iAudio X5" 126#define UI_TITLE "iAudio X5"
203#define UI_WIDTH 300 /* width of GUI window */ 127#define UI_WIDTH 300 /* width of GUI window */
204#define UI_HEIGHT 558 /* height of GUI window */ 128#define UI_HEIGHT 558 /* height of GUI window */
205/* high-colour */
206#define UI_LCD_POSX 55 /* x position of lcd */ 129#define UI_LCD_POSX 55 /* x position of lcd */
207#define UI_LCD_POSY 61 /* y position of lcd (74 for real aspect) */ 130#define UI_LCD_POSY 61 /* y position of lcd */
208#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
209#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
210#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
211#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
212#define UI_REMOTE_POSX 12 /* x position of remote lcd */ 131#define UI_REMOTE_POSX 12 /* x position of remote lcd */
213#define UI_REMOTE_POSY 462 /* y position of remote lcd */ 132#define UI_REMOTE_POSY 462 /* y position of remote lcd */
214#define UI_REMOTE_WIDTH 128
215#define UI_REMOTE_HEIGHT 96
216 133
217#elif defined(IAUDIO_M5) 134#elif defined(IAUDIO_M5)
218#define UI_TITLE "iAudio M5" 135#define UI_TITLE "iAudio M5"
219#define UI_WIDTH 374 /* width of GUI window */ 136#define UI_WIDTH 374 /* width of GUI window */
220#define UI_HEIGHT 650 /* height of GUI window */ 137#define UI_HEIGHT 650 /* height of GUI window */
221/* high-colour */
222#define UI_LCD_POSX 82 /* x position of lcd */ 138#define UI_LCD_POSX 82 /* x position of lcd */
223#define UI_LCD_POSY 74 /* y position of lcd (74 for real aspect) */ 139#define UI_LCD_POSY 74 /* y position of lcd */
224#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
225#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
226#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
227#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
228#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
229#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
230#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
231#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
232#define UI_REMOTE_POSX 59 /* x position of remote lcd */ 140#define UI_REMOTE_POSX 59 /* x position of remote lcd */
233#define UI_REMOTE_POSY 509 /* y position of remote lcd */ 141#define UI_REMOTE_POSY 509 /* y position of remote lcd */
234#define UI_REMOTE_WIDTH 128
235#define UI_REMOTE_HEIGHT 96
236 142
237#elif defined(IAUDIO_M3) 143#elif defined(IAUDIO_M3)
238#define UI_TITLE "iAudio M3" 144#define UI_TITLE "iAudio M3"
@@ -240,68 +146,43 @@
240#define UI_HEIGHT 501 /* height of GUI window */ 146#define UI_HEIGHT 501 /* height of GUI window */
241#define UI_LCD_POSX 92 /* x position of lcd */ 147#define UI_LCD_POSX 92 /* x position of lcd */
242#define UI_LCD_POSY 348 /* y position of lcd */ 148#define UI_LCD_POSY 348 /* y position of lcd */
243#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no bklight) */
244#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (bklight) */
245#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
246#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
247#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
248#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
249 149
250#elif defined(GIGABEAT_F) 150#elif defined(GIGABEAT_F)
251#define UI_TITLE "Toshiba Gigabeat" 151#define UI_TITLE "Toshiba Gigabeat"
252#define UI_WIDTH 401 /* width of GUI window */ 152#define UI_WIDTH 401 /* width of GUI window */
253#define UI_HEIGHT 655 /* height of GUI window */ 153#define UI_HEIGHT 655 /* height of GUI window */
254/* high-colour */
255#define UI_LCD_POSX 48 /* x position of lcd */ 154#define UI_LCD_POSX 48 /* x position of lcd */
256#define UI_LCD_POSY 60 /* y position of lcd */ 155#define UI_LCD_POSY 60 /* y position of lcd */
257#define UI_LCD_WIDTH 240
258#define UI_LCD_HEIGHT 320
259 156
260#elif defined(GIGABEAT_S) 157#elif defined(GIGABEAT_S)
261#define UI_TITLE "Toshiba Gigabeat" 158#define UI_TITLE "Toshiba Gigabeat"
262#define UI_WIDTH 450 /* width of GUI window */ 159#define UI_WIDTH 450 /* width of GUI window */
263#define UI_HEIGHT 688 /* height of GUI window */ 160#define UI_HEIGHT 688 /* height of GUI window */
264/* high-colour */
265#define UI_LCD_POSX 96 /* x position of lcd */ 161#define UI_LCD_POSX 96 /* x position of lcd */
266#define UI_LCD_POSY 90 /* y position of lcd */ 162#define UI_LCD_POSY 90 /* y position of lcd */
267#define UI_LCD_WIDTH 240
268#define UI_LCD_HEIGHT 320
269 163
270#elif defined(MROBE_500) 164#elif defined(MROBE_500)
271#define UI_TITLE "Olympus M:Robe 500" 165#define UI_TITLE "Olympus M:Robe 500"
272#define UI_WIDTH 401 /* width of GUI window */ 166#define UI_WIDTH 401 /* width of GUI window */
273#define UI_HEIGHT 655 /* height of GUI window */ 167#define UI_HEIGHT 655 /* height of GUI window */
274/* high-colour */
275#define UI_LCD_POSX 48 /* x position of lcd */ 168#define UI_LCD_POSX 48 /* x position of lcd */
276#define UI_LCD_POSY 60 /* y position of lcd */ 169#define UI_LCD_POSY 60 /* y position of lcd */
277#define UI_LCD_WIDTH LCD_WIDTH
278#define UI_LCD_HEIGHT LCD_HEIGHT
279#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
280#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
281#define UI_REMOTE_POSX 50 /* x position of remote lcd */ 170#define UI_REMOTE_POSX 50 /* x position of remote lcd */
282#define UI_REMOTE_POSY 403 /* y position of remote lcd */ 171#define UI_REMOTE_POSY 403 /* y position of remote lcd */
283#define UI_REMOTE_WIDTH 79
284#define UI_REMOTE_HEIGHT 16
285 172
286#elif defined(IRIVER_H10) 173#elif defined(IRIVER_H10)
287#define UI_TITLE "iriver H10 20Gb" 174#define UI_TITLE "iriver H10 20Gb"
288#define UI_WIDTH 392 /* width of GUI window */ 175#define UI_WIDTH 392 /* width of GUI window */
289#define UI_HEIGHT 391 /* height of GUI window */ 176#define UI_HEIGHT 391 /* height of GUI window */
290/* high-colour */
291#define UI_LCD_POSX 111 /* x position of lcd */ 177#define UI_LCD_POSX 111 /* x position of lcd */
292#define UI_LCD_POSY 30 /* y position of lcd (74 for real aspect) */ 178#define UI_LCD_POSY 30 /* y position of lcd */
293#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
294#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
295 179
296#elif defined(IRIVER_H10_5GB) 180#elif defined(IRIVER_H10_5GB)
297#define UI_TITLE "iriver H10 5/6Gb" 181#define UI_TITLE "iriver H10 5/6Gb"
298#define UI_WIDTH 353 /* width of GUI window */ 182#define UI_WIDTH 353 /* width of GUI window */
299#define UI_HEIGHT 460 /* height of GUI window */ 183#define UI_HEIGHT 460 /* height of GUI window */
300/* high-colour */
301#define UI_LCD_POSX 112 /* x position of lcd */ 184#define UI_LCD_POSX 112 /* x position of lcd */
302#define UI_LCD_POSY 45 /* y position of lcd (74 for real aspect) */ 185#define UI_LCD_POSY 45 /* y position of lcd */
303#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
304#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
305 186
306#elif defined(SANSA_E200) || defined(SANSA_E200V2) 187#elif defined(SANSA_E200) || defined(SANSA_E200V2)
307#ifdef SANSA_E200 188#ifdef SANSA_E200
@@ -311,35 +192,23 @@
311#endif 192#endif
312#define UI_WIDTH 260 /* width of GUI window */ 193#define UI_WIDTH 260 /* width of GUI window */
313#define UI_HEIGHT 502 /* height of GUI window */ 194#define UI_HEIGHT 502 /* height of GUI window */
314/* high-colour */
315#define UI_LCD_POSX 42 /* x position of lcd */ 195#define UI_LCD_POSX 42 /* x position of lcd */
316#define UI_LCD_POSY 37 /* y position of lcd (74 for real aspect) */ 196#define UI_LCD_POSY 37 /* y position of lcd */
317#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
318#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
319 197
320#elif defined(SANSA_C200) 198#elif defined(SANSA_C200)
321#define UI_TITLE "Sansa c200" 199#define UI_TITLE "Sansa c200"
322#define UI_WIDTH 350 /* width of GUI window */ 200#define UI_WIDTH 350 /* width of GUI window */
323#define UI_HEIGHT 152 /* height of GUI window */ 201#define UI_HEIGHT 152 /* height of GUI window */
324/* high-colour */
325#define UI_LCD_POSX 42 /* x position of lcd */ 202#define UI_LCD_POSX 42 /* x position of lcd */
326#define UI_LCD_POSY 35 /* y position of lcd (74 for real aspect) */ 203#define UI_LCD_POSY 35 /* y position of lcd */
327#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
328#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
329 204
330#elif defined(IRIVER_IFP7XX) 205#elif defined(IRIVER_IFP7XX)
331#define UI_TITLE "iriver iFP7xx" 206#define UI_TITLE "iriver iFP7xx"
332#define UI_WIDTH 425 /* width of GUI window */ 207#define UI_WIDTH 425 /* width of GUI window */
333#define UI_HEIGHT 183 /* height of GUI window */ 208#define UI_HEIGHT 183 /* height of GUI window */
334#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */
335#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */
336#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
337#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
338#define UI_LCD_POSX 115 /* x position of lcd */ 209#define UI_LCD_POSX 115 /* x position of lcd */
339#define UI_LCD_POSY 54 /* y position of lcd */ 210#define UI_LCD_POSY 54 /* y position of lcd */
340#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */ 211
341#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
342
343#elif defined(ARCHOS_AV300) 212#elif defined(ARCHOS_AV300)
344#define UI_TITLE "Archos AV300" 213#define UI_TITLE "Archos AV300"
345/* We are temporarily using a 2bpp LCD driver and dummy bitmap */ 214/* We are temporarily using a 2bpp LCD driver and dummy bitmap */
@@ -347,25 +216,13 @@
347#define UI_HEIGHT 340 /* height of GUI window */ 216#define UI_HEIGHT 340 /* height of GUI window */
348#define UI_LCD_POSX 50 /* x position of lcd */ 217#define UI_LCD_POSX 50 /* x position of lcd */
349#define UI_LCD_POSY 50 /* y position of lcd */ 218#define UI_LCD_POSY 50 /* y position of lcd */
350#define UI_LCD_WIDTH 320
351#define UI_LCD_HEIGHT 240
352#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
353#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
354#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
355#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
356 219
357#elif defined(MROBE_100) 220#elif defined(MROBE_100)
358#define UI_TITLE "Olympus M:Robe 100" 221#define UI_TITLE "Olympus M:Robe 100"
359#define UI_WIDTH 247 /* width of GUI window */ 222#define UI_WIDTH 247 /* width of GUI window */
360#define UI_HEIGHT 416 /* height of GUI window */ 223#define UI_HEIGHT 416 /* height of GUI window */
361#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */
362#define UI_LCD_BGCOLORLIGHT 94, 2, 2 /* bkgnd color of LCD (backlight) */
363#define UI_LCD_FGCOLOR 50, 50, 50 /* foreground color of LCD (no backlight) */
364#define UI_LCD_FGCOLORLIGHT 241, 6, 3 /* foreground color of LCD (backlight) */
365#define UI_LCD_POSX 43 /* x position of lcd */ 224#define UI_LCD_POSX 43 /* x position of lcd */
366#define UI_LCD_POSY 25 /* y position of lcd */ 225#define UI_LCD_POSY 25 /* y position of lcd */
367#define UI_LCD_WIDTH 160
368#define UI_LCD_HEIGHT 128
369 226
370#elif defined(COWON_D2) 227#elif defined(COWON_D2)
371#define UI_TITLE "Cowon D2" 228#define UI_TITLE "Cowon D2"
@@ -373,25 +230,13 @@
373#define UI_HEIGHT 368 /* height of GUI window */ 230#define UI_HEIGHT 368 /* height of GUI window */
374#define UI_LCD_POSX 58 /* x position of lcd */ 231#define UI_LCD_POSX 58 /* x position of lcd */
375#define UI_LCD_POSY 67 /* y position of lcd */ 232#define UI_LCD_POSY 67 /* y position of lcd */
376#define UI_LCD_WIDTH 320
377#define UI_LCD_HEIGHT 240
378#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
379#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
380#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
381#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
382 233
383#elif defined(IAUDIO_7) 234#elif defined(IAUDIO_7)
384#define UI_TITLE "iAudio7" 235#define UI_TITLE "iAudio7"
385#define UI_WIDTH 494 /* width of GUI window */ 236#define UI_WIDTH 494 /* width of GUI window */
386#define UI_HEIGHT 214 /* height of GUI window */ 237#define UI_HEIGHT 214 /* height of GUI window */
387#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
388#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
389#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
390#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
391#define UI_LCD_POSX 131 /* x position of lcd */ 238#define UI_LCD_POSX 131 /* x position of lcd */
392#define UI_LCD_POSY 38 /* y position of lcd */ 239#define UI_LCD_POSY 38 /* y position of lcd */
393#define UI_LCD_WIDTH 160
394#define UI_LCD_HEIGHT 128
395 240
396#elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB) 241#elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB)
397#ifdef CREATIVE_ZVM 242#ifdef CREATIVE_ZVM
@@ -403,12 +248,6 @@
403#define UI_HEIGHT 643 /* height of GUI window */ 248#define UI_HEIGHT 643 /* height of GUI window */
404#define UI_LCD_POSX 31 /* x position of lcd */ 249#define UI_LCD_POSX 31 /* x position of lcd */
405#define UI_LCD_POSY 62 /* y position of lcd */ 250#define UI_LCD_POSY 62 /* y position of lcd */
406#define UI_LCD_WIDTH 320
407#define UI_LCD_HEIGHT 240
408#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
409#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
410#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
411#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
412 251
413#elif defined(CREATIVE_ZV) 252#elif defined(CREATIVE_ZV)
414#define UI_TITLE "Creative Zen Vision" 253#define UI_TITLE "Creative Zen Vision"
@@ -416,12 +255,6 @@
416#define UI_HEIGHT 643 /* height of GUI window */ 255#define UI_HEIGHT 643 /* height of GUI window */
417#define UI_LCD_POSX 129 /* x position of lcd */ 256#define UI_LCD_POSX 129 /* x position of lcd */
418#define UI_LCD_POSY 85 /* y position of lcd */ 257#define UI_LCD_POSY 85 /* y position of lcd */
419#define UI_LCD_WIDTH 640
420#define UI_LCD_HEIGHT 480
421#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
422#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
423#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
424#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
425 258
426#elif defined(MEIZU_M6SL) 259#elif defined(MEIZU_M6SL)
427#define UI_TITLE "Meizu M6" 260#define UI_TITLE "Meizu M6"
@@ -429,22 +262,13 @@
429#define UI_HEIGHT 322 /* height of GUI window */ 262#define UI_HEIGHT 322 /* height of GUI window */
430#define UI_LCD_POSX 39 /* x position of lcd */ 263#define UI_LCD_POSX 39 /* x position of lcd */
431#define UI_LCD_POSY 38 /* y position of lcd */ 264#define UI_LCD_POSY 38 /* y position of lcd */
432#define UI_LCD_WIDTH 320
433#define UI_LCD_HEIGHT 240
434#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
435#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
436#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
437#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
438 265
439#elif defined(SANSA_FUZE) 266#elif defined(SANSA_FUZE)
440#define UI_TITLE "Sansa Fuze" 267#define UI_TITLE "Sansa Fuze"
441#define UI_WIDTH 279 /* width of GUI window */ 268#define UI_WIDTH 279 /* width of GUI window */
442#define UI_HEIGHT 449 /* height of GUI window */ 269#define UI_HEIGHT 449 /* height of GUI window */
443/* high-colour */
444#define UI_LCD_POSX 30 /* x position of lcd */ 270#define UI_LCD_POSX 30 /* x position of lcd */
445#define UI_LCD_POSY 31 /* y position of lcd */ 271#define UI_LCD_POSY 31 /* y position of lcd */
446#define UI_LCD_WIDTH LCD_WIDTH
447#define UI_LCD_HEIGHT LCD_HEIGHT
448 272
449#elif defined(SANSA_CLIP) 273#elif defined(SANSA_CLIP)
450#define UI_TITLE "Sansa Clip" 274#define UI_TITLE "Sansa Clip"
@@ -452,42 +276,20 @@
452#define UI_HEIGHT 325 /* height of GUI window */ 276#define UI_HEIGHT 325 /* height of GUI window */
453#define UI_LCD_POSX 38 /* x position of lcd */ 277#define UI_LCD_POSX 38 /* x position of lcd */
454#define UI_LCD_POSY 38 /* y position of lcd */ 278#define UI_LCD_POSY 38 /* y position of lcd */
455#define UI_LCD_WIDTH 128
456#define UI_LCD_HEIGHT 64
457#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */
458#define UI_LCD_BGCOLORLIGHT 0, 0, 0 /* bkgnd color of LCD (backlight) */
459#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
460#define UI_LCD_FGCOLORLIGHT 13, 226, 229 /* foreground color of LCD (backlight) */
461
462#define UI_LCD_SPLIT /* The screen is split in 2 areas */
463#define UI_LCD_SPLIT_LINES 16 /* the top 16 lines have a different color */
464#define UI_LCD_SPLIT_BLACK_LINES 2 /* The 2 areas are separated by 2 empty lines */
465/* Colors for the top part of the screen */
466#define UI_LCD_SPLIT_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
467#define UI_LCD_SPLIT_FGCOLORLIGHT 255, 230, 15 /* foreground color of LCD (backlight) */
468 279
469#elif defined(PHILIPS_HDD1630) 280#elif defined(PHILIPS_HDD1630)
470#define UI_TITLE "Philips GoGear HDD1630" 281#define UI_TITLE "Philips GoGear HDD1630"
471#define UI_WIDTH 407 /* width of GUI window */ 282#define UI_WIDTH 407 /* width of GUI window */
472#define UI_HEIGHT 391 /* height of GUI window */ 283#define UI_HEIGHT 391 /* height of GUI window */
473/* high-colour */
474#define UI_LCD_POSX 143 /* x position of lcd */ 284#define UI_LCD_POSX 143 /* x position of lcd */
475#define UI_LCD_POSY 27 /* y position of lcd */ 285#define UI_LCD_POSY 27 /* y position of lcd */
476#define UI_LCD_WIDTH LCD_WIDTH
477#define UI_LCD_HEIGHT LCD_HEIGHT
478 286
479#elif defined(SANSA_M200V4) 287#elif defined(SANSA_M200V4)
480#define UI_TITLE "sansa m200v4" 288#define UI_TITLE "sansa m200v4"
481#define UI_WIDTH 350 /* width of GUI window */ 289#define UI_WIDTH 350 /* width of GUI window */
482#define UI_HEIGHT 168 /* height of GUI window */ 290#define UI_HEIGHT 168 /* height of GUI window */
483#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */
484#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */
485#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
486#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
487#define UI_LCD_POSX 42 /* x position of lcd */ 291#define UI_LCD_POSX 42 /* x position of lcd */
488#define UI_LCD_POSY 55 /* y position of lcd */ 292#define UI_LCD_POSY 55 /* y position of lcd */
489#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
490#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
491 293
492 294
493#else 295#else