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 0405ef0..765bc06 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -1295,7 +1295,7 @@ void mouse_tick_task(void)
x -= UI_LCD_POSX;
y -= UI_LCD_POSY;
- if(x<0 || y<0 || x>UI_LCD_WIDTH || y>UI_LCD_HEIGHT)
+ if(x<0 || y<0 || x>SIM_LCD_WIDTH || y>SIM_LCD_HEIGHT)
return;
}
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index bc2a4c4..6faa5eb 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -22,45 +22,74 @@
#include "debug.h"
#include "uisdl.h"
#include "lcd-sdl.h"
+#include "misc.h"
SDL_Surface* lcd_surface;
-#ifdef UI_LCD_SPLIT
-SDL_Surface* lcd_real_surface; /* the surface which represents the real screen */
-#endif
-int lcd_backlight_val;
#if LCD_DEPTH <= 8
#ifdef HAVE_BACKLIGHT
-SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
-SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0};
-#ifdef UI_LCD_SPLIT
-SDL_Color lcd_backlight_color_split= {UI_LCD_SPLIT_FGCOLORLIGHT, 0};
-#endif
-#endif
-SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
-SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0};
-#ifdef UI_LCD_SPLIT
-SDL_Color lcd_color_split= {UI_LCD_SPLIT_FGCOLOR, 0};
-#endif
+SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR),
+ GREEN_CMP(LCD_BL_DARKCOLOR),
+ BLUE_CMP(LCD_BL_DARKCOLOR), 0};
+SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR),
+ GREEN_CMP(LCD_BL_BRIGHTCOLOR),
+ BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0};
+#ifdef HAVE_LCD_SPLIT
+SDL_Color lcd_bl_color2_dark = {RED_CMP(LCD_BL_DARKCOLOR_2),
+ GREEN_CMP(LCD_BL_DARKCOLOR_2),
+ BLUE_CMP(LCD_BL_DARKCOLOR_2), 0};
+SDL_Color lcd_bl_color2_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR_2),
+ GREEN_CMP(LCD_BL_BRIGHTCOLOR_2),
+ BLUE_CMP(LCD_BL_BRIGHTCOLOR_2), 0};
+#endif
+#endif /* HAVE_BACKLIGHT */
+SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR),
+ GREEN_CMP(LCD_DARKCOLOR),
+ BLUE_CMP(LCD_DARKCOLOR), 0};
+SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR),
+ GREEN_CMP(LCD_BRIGHTCOLOR),
+ BLUE_CMP(LCD_BRIGHTCOLOR), 0};
+#ifdef HAVE_LCD_SPLIT
+SDL_Color lcd_color2_dark = {RED_CMP(LCD_DARKCOLOR_2),
+ GREEN_CMP(LCD_DARKCOLOR_2),
+ BLUE_CMP(LCD_DARKCOLOR_2), 0};
+SDL_Color lcd_color2_bright = {RED_CMP(LCD_BRIGHTCOLOR_2),
+ GREEN_CMP(LCD_BRIGHTCOLOR_2),
+ BLUE_CMP(LCD_BRIGHTCOLOR_2), 0};
+#endif
+
+#ifdef HAVE_LCD_SPLIT
+#define GRADIENT_MAX 127
+#else
+#define GRADIENT_MAX 128
#endif
+#endif /* LCD_DEPTH <= 8 */
#if LCD_DEPTH < 8
-int lcd_ex_shades = 0;
unsigned long (*lcd_ex_getpixel)(int, int) = NULL;
+#endif /* LCD_DEPTH < 8 */
+
+#if LCD_DEPTH == 2
+/* Only defined for positive, non-split LCD for now */
+static const unsigned char colorindex[4] = {128, 85, 43, 0};
#endif
static unsigned long get_lcd_pixel(int x, int y)
{
#if LCD_DEPTH == 1
- return ((lcd_framebuffer[y/8][x] >> (y & 7)) & 1);
+#ifdef HAVE_NEGATIVE_LCD
+ return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? GRADIENT_MAX : 0;
+#else
+ return (lcd_framebuffer[y/8][x] & (1 << (y & 7))) ? 0 : GRADIENT_MAX;
+#endif
#elif LCD_DEPTH == 2
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
- return ((lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3);
+ return colorindex[(lcd_framebuffer[y][x/4] >> (2 * (~x & 3))) & 3];
#elif LCD_PIXELFORMAT == VERTICAL_PACKING
- return ((lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3);
+ return colorindex[(lcd_framebuffer[y/4][x] >> (2 * (y & 3))) & 3];
#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
unsigned bits = (lcd_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
- return (bits | (bits >> 7)) & 3;
+ return colorindex[(bits | (bits >> 7)) & 3];
#endif
#elif LCD_DEPTH == 16
#if LCD_PIXELFORMAT == RGB565SWAPPED
@@ -80,148 +109,77 @@ void lcd_update(void)
void lcd_update_rect(int x_start, int y_start, int width, int height)
{
- sdl_update_rect(lcd_surface, x_start, y_start, width, height, LCD_WIDTH,
- LCD_HEIGHT, get_lcd_pixel);
- sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start,
- width, height, LCD_WIDTH, LCD_HEIGHT,
+ sdl_update_rect(lcd_surface, x_start, y_start, width, height,
+ LCD_WIDTH, LCD_HEIGHT, get_lcd_pixel);
+ sdl_gui_update(lcd_surface, x_start, y_start, width,
+ height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
}
#ifdef HAVE_BACKLIGHT
void sim_backlight(int value)
{
- lcd_backlight_val = value;
-
#if LCD_DEPTH <= 8
if (value > 0) {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, &lcd_backlight_color_zero,
- &lcd_backlight_color_split, 0, (1<<LCD_DEPTH));
-#else
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, 0, (1<<LCD_DEPTH));
+ sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
+ &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
+#ifdef HAVE_LCD_SPLIT
+ sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
+ &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
#endif
} else {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_color_zero, &lcd_color_max,
- &lcd_color_zero, &lcd_color_split, 0, (1<<LCD_DEPTH));
-#else
- sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, 0,
- (1<<LCD_DEPTH));
-#endif
- }
-#if LCD_DEPTH < 8
- if (lcd_ex_shades) {
- if (value > 0) {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max,
- &lcd_backlight_color_zero, &lcd_backlight_color_split,
- &lcd_backlight_color_zero,
- (1<<LCD_DEPTH), lcd_ex_shades);
-#elif defined MROBE_100
- /* quick fix, a proper fix needs to compare brightnesses */
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, (1<<LCD_DEPTH), lcd_ex_shades);
-#else
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_max,
- &lcd_backlight_color_zero, (1<<LCD_DEPTH), lcd_ex_shades);
+ sdl_set_gradient(lcd_surface, &lcd_color_dark,
+ &lcd_color_bright, 0, GRADIENT_MAX+1);
+#ifdef HAVE_LCD_SPLIT
+ sdl_set_gradient(lcd_surface, &lcd_color2_dark,
+ &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
#endif
- } else {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_color_max, &lcd_color_zero,
- &lcd_color_split, &lcd_color_zero, (1<<LCD_DEPTH),
- lcd_ex_shades);
-#elif defined MROBE_100
- /* quick fix, a proper fix needs to compare brightnesses */
- sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max,
- (1<<LCD_DEPTH), lcd_ex_shades);
-#else
- sdl_set_gradient(lcd_surface, &lcd_color_max, &lcd_color_zero,
- (1<<LCD_DEPTH), lcd_ex_shades);
-#endif
- }
}
-#endif
-
- sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) 0, 0, LCD_WIDTH,
- LCD_HEIGHT, LCD_WIDTH, LCD_HEIGHT,
+ sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
+ SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
-
-#endif
+#endif /* LCD_DEPTH <= 8 */
}
-#endif
+#endif /* HAVE_BACKLIGHT */
/* initialise simulator lcd driver */
void sim_lcd_init(void)
{
#if LCD_DEPTH == 16
- lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom,
- LCD_HEIGHT * display_zoom, LCD_DEPTH, 0, 0, 0, 0);
+ lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ SIM_LCD_WIDTH * display_zoom,
+ SIM_LCD_HEIGHT * display_zoom,
+ LCD_DEPTH, 0, 0, 0, 0);
#else
- lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom,
- LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0);
-#ifdef UI_LCD_SPLIT
- lcd_real_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
- LCD_WIDTH * display_zoom,
- (LCD_HEIGHT+UI_LCD_SPLIT_BLACK_LINES) * display_zoom, 8, 0, 0, 0, 0);
-#endif
+ lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ SIM_LCD_WIDTH * display_zoom,
+ SIM_LCD_HEIGHT * display_zoom,
+ 8, 0, 0, 0, 0);
#endif
#if LCD_DEPTH <= 8
#ifdef HAVE_BACKLIGHT
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, &lcd_backlight_color_zero,
- &lcd_backlight_color_split, 0, (1<<LCD_DEPTH));
-#else
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, 0, (1<<LCD_DEPTH));
-#endif
-#else
- sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, 0,
- (1<<LCD_DEPTH));
-#endif
-#endif
+ sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
+ &lcd_bl_color_bright, 0, GRADIENT_MAX+1);
+#ifdef HAVE_LCD_SPLIT
+ sdl_set_gradient(lcd_surface, &lcd_bl_color2_dark,
+ &lcd_bl_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+#endif
+#else /* !HAVE_BACKLIGHT */
+ sdl_set_gradient(lcd_surface, &lcd_color_dark,
+ &lcd_color_bright, 0, GRADIENT_MAX+1);
+#ifdef HAVE_LCD_SPLIT
+ sdl_set_gradient(lcd_surface, &lcd_color2_dark,
+ &lcd_color2_bright, GRADIENT_MAX+1, GRADIENT_MAX+1);
+#endif
+#endif /* !HAVE_BACKLIGHT */
+#endif /* LCD_DEPTH < 8 */
}
#if LCD_DEPTH < 8
-void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int))
+void sim_lcd_ex_init(unsigned long (*getpixel)(int, int))
{
- lcd_ex_shades = shades;
lcd_ex_getpixel = getpixel;
- if (shades) {
-#ifdef HAVE_BACKLIGHT
- if (lcd_backlight_val > 0) {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_backlight_color_max,
- &lcd_backlight_color_zero, &lcd_backlight_color_split,
- &lcd_backlight_color_zero, (1<<LCD_DEPTH), shades);
-#elif defined MROBE_100
- /* quick fix, a proper fix needs to compare brightnesses */
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max, (1<<LCD_DEPTH), shades);
-#else
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_max,
- &lcd_backlight_color_zero, (1<<LCD_DEPTH), shades);
-#endif
- }
- else
-#endif
- {
-#ifdef UI_LCD_SPLIT
- sdl_set_gradient(lcd_real_surface, &lcd_color_max, &lcd_color_zero,
- &lcd_color_split, &lcd_color_zero, (1<<LCD_DEPTH), shades);
-#elif defined MROBE_100
- /* quick fix, a proper fix needs to compare brightnesses */
- sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max,
- (1<<LCD_DEPTH), shades);
-#else
- sdl_set_gradient(lcd_surface, &lcd_color_max, &lcd_color_zero,
- (1<<LCD_DEPTH), shades);
-#endif
- }
- }
}
void 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)
if (lcd_ex_getpixel) {
sdl_update_rect(lcd_surface, x_start, y_start, width, height,
LCD_WIDTH, LCD_HEIGHT, lcd_ex_getpixel);
- sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start,
- width, height, LCD_WIDTH, LCD_HEIGHT,
+ sdl_gui_update(lcd_surface, x_start, y_start, width,
+ height + LCD_SPLIT_LINES, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
background ? UI_LCD_POSX : 0,
- background? UI_LCD_POSY : 0);
+ background ? UI_LCD_POSY : 0);
}
}
#endif
diff --git a/uisimulator/sdl/lcd-bitmap.h b/uisimulator/sdl/lcd-bitmap.h
index 74aafa8..a898744 100644
--- a/uisimulator/sdl/lcd-bitmap.h
+++ b/uisimulator/sdl/lcd-bitmap.h
@@ -27,7 +27,7 @@
void sim_lcd_init(void);
#if LCD_DEPTH < 8
-void sim_lcd_ex_init(int shades, unsigned long (*getpixel)(int, int));
+void sim_lcd_ex_init(unsigned long (*getpixel)(int, int));
void sim_lcd_ex_update_rect(int x, int y, int width, int height);
#endif
diff --git a/uisimulator/sdl/lcd-charcells.c b/uisimulator/sdl/lcd-charcells.c
index 6f09858..19d27d5 100644
--- a/uisimulator/sdl/lcd-charcells.c
+++ b/uisimulator/sdl/lcd-charcells.c
@@ -35,10 +35,19 @@
extern int sim_creat(const char *name);
SDL_Surface* lcd_surface;
-SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
-SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
-SDL_Color lcd_color_max = {UI_LCD_FGCOLOR, 0};
-SDL_Color lcd_backlight_color_max = {UI_LCD_FGCOLORLIGHT, 0};
+
+SDL_Color lcd_bl_color_dark = {RED_CMP(LCD_BL_DARKCOLOR),
+ GREEN_CMP(LCD_BL_DARKCOLOR),
+ BLUE_CMP(LCD_BL_DARKCOLOR), 0};
+SDL_Color lcd_bl_color_bright = {RED_CMP(LCD_BL_BRIGHTCOLOR),
+ GREEN_CMP(LCD_BL_BRIGHTCOLOR),
+ BLUE_CMP(LCD_BL_BRIGHTCOLOR), 0};
+SDL_Color lcd_color_dark = {RED_CMP(LCD_DARKCOLOR),
+ GREEN_CMP(LCD_DARKCOLOR),
+ BLUE_CMP(LCD_DARKCOLOR), 0};
+SDL_Color lcd_color_bright = {RED_CMP(LCD_BRIGHTCOLOR),
+ GREEN_CMP(LCD_BRIGHTCOLOR),
+ BLUE_CMP(LCD_BRIGHTCOLOR), 0};
static unsigned long get_lcd_pixel(int x, int y)
@@ -78,12 +87,11 @@ void lcd_update(void)
void sim_backlight(int value)
{
if (value > 0) {
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero,
- &lcd_backlight_color_max,
- 0, (1<<LCD_DEPTH));
+ sdl_set_gradient(lcd_surface, &lcd_bl_color_bright,
+ &lcd_bl_color_dark, 0, (1<<LCD_DEPTH));
} else {
- sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max,
- 0, (1<<LCD_DEPTH));
+ sdl_set_gradient(lcd_surface, &lcd_color_bright,
+ &lcd_color_dark, 0, (1<<LCD_DEPTH));
}
sim_lcd_update_rect(0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT);
@@ -98,8 +106,8 @@ void sim_lcd_init(void)
SIM_LCD_HEIGHT * display_zoom,
8, 0, 0, 0, 0);
- sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
- 0, (1<<LCD_DEPTH));
+ sdl_set_gradient(lcd_surface, &lcd_bl_color_bright,
+ &lcd_bl_color_dark, 0, (1<<LCD_DEPTH));
}
#define BMP_COMPRESSION 0 /* BI_RGB */
@@ -133,8 +141,8 @@ static const unsigned char bmpheader[] =
LE32_CONST(BMP_NUMCOLORS), /* Number of used colours */
LE32_CONST(BMP_NUMCOLORS), /* Number of important colours */
- 0x90, 0xee, 0x90, 0x00, /* Colour #0 */
- 0x00, 0x00, 0x00, 0x00 /* Colour #1 */
+ BMP_COLOR(LCD_BL_BRIGHTCOLOR),
+ BMP_COLOR(LCD_BL_DARKCOLOR)
};
void screen_dump(void)
diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/uisimulator/sdl/lcd-remote-bitmap.c
index d165534..f5c2225 100644
--- a/uisimulator/sdl/lcd-remote-bitmap.c
+++ b/uisimulator/sdl/lcd-remote-bitmap.c
@@ -22,20 +22,38 @@
#include "uisdl.h"
#include "lcd-sdl.h"
#include "lcd-remote-bitmap.h"
+#include "misc.h"
SDL_Surface *remote_surface;
-SDL_Color remote_color_zero = {UI_REMOTE_BGCOLOR, 0};
-SDL_Color remote_backlight_color_zero = {UI_REMOTE_BGCOLORLIGHT, 0};
-SDL_Color remote_color_max = {0, 0, 0, 0};
+SDL_Color remote_bl_color_dark = {RED_CMP(LCD_REMOTE_BL_DARKCOLOR),
+ GREEN_CMP(LCD_REMOTE_BL_DARKCOLOR),
+ BLUE_CMP(LCD_REMOTE_BL_DARKCOLOR), 0};
+SDL_Color remote_bl_color_bright = {RED_CMP(LCD_REMOTE_BL_BRIGHTCOLOR),
+ GREEN_CMP(LCD_REMOTE_BL_BRIGHTCOLOR),
+ BLUE_CMP(LCD_REMOTE_BL_BRIGHTCOLOR), 0};
+SDL_Color remote_color_dark = {RED_CMP(LCD_REMOTE_DARKCOLOR),
+ GREEN_CMP(LCD_REMOTE_DARKCOLOR),
+ BLUE_CMP(LCD_REMOTE_DARKCOLOR), 0};
+SDL_Color remote_color_bright = {RED_CMP(LCD_REMOTE_BRIGHTCOLOR),
+ GREEN_CMP(LCD_REMOTE_BRIGHTCOLOR),
+ BLUE_CMP(LCD_REMOTE_BRIGHTCOLOR), 0};
-static unsigned long get_lcd_remote_pixel(int x, int y) {
+#define GRADIENT_MAX 128
+
+#if LCD_REMOTE_DEPTH == 2
+/* Only defined for positive, non-split LCD for now */
+static const unsigned char colorindex[4] = {128, 85, 43, 0};
+#endif
+
+static unsigned long get_lcd_remote_pixel(int x, int y)
+{
#if LCD_REMOTE_DEPTH == 1
- return (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 1;
+ return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : GRADIENT_MAX;
#elif LCD_REMOTE_DEPTH == 2
#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
- return (bits | (bits >> 7)) & 3;
+ return colorindex[(bits | (bits >> 7)) & 3];
#endif
#endif
}
@@ -57,11 +75,11 @@ void lcd_remote_update_rect(int x_start, int y_start, int width, int height)
void sim_remote_backlight(int value)
{
if (value > 0) {
- sdl_set_gradient(remote_surface, &remote_backlight_color_zero,
- &remote_color_max, 0, (1<<LCD_REMOTE_DEPTH));
+ sdl_set_gradient(remote_surface, &remote_bl_color_dark,
+ &remote_bl_color_bright, 0, GRADIENT_MAX+1);
} else {
- sdl_set_gradient(remote_surface, &remote_color_zero, &remote_color_max,
- 0, (1<<LCD_REMOTE_DEPTH));
+ sdl_set_gradient(remote_surface, &remote_color_dark,
+ &remote_color_bright, 0, GRADIENT_MAX+1);
}
sdl_gui_update(remote_surface, 0, 0, LCD_REMOTE_WIDTH, LCD_REMOTE_HEIGHT,
@@ -74,10 +92,11 @@ void sim_remote_backlight(int value)
void sim_lcd_remote_init(void)
{
remote_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
- LCD_REMOTE_WIDTH * display_zoom, LCD_REMOTE_HEIGHT * display_zoom,
- 8, 0, 0, 0, 0);
+ LCD_REMOTE_WIDTH * display_zoom,
+ LCD_REMOTE_HEIGHT * display_zoom,
+ 8, 0, 0, 0, 0);
- sdl_set_gradient(remote_surface, &remote_backlight_color_zero,
- &remote_color_max, 0, (1<<LCD_REMOTE_DEPTH));
+ sdl_set_gradient(remote_surface, &remote_bl_color_dark,
+ &remote_bl_color_bright, 0, GRADIENT_MAX+1);
}
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index 6431c5f..373e07f 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -21,11 +21,9 @@
#include "lcd-sdl.h"
#include "uisdl.h"
+#include "system.h" /* for MIN() and MAX() */
int display_zoom = 1;
-#ifdef UI_LCD_SPLIT
-static int gradient_steps = 0;
-#endif
void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
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,
for (x = x_start; x < xmax; x++) {
dest.x = x * display_zoom;
+#ifdef HAVE_LCD_SPLIT
+ for (y = y_start; y < MIN(ymax, LCD_SPLIT_POS); y++) {
+ dest.y = y * display_zoom;
+
+ SDL_FillRect(surface, &dest, (Uint32)(getpixel(x, y) | 0x80));
+ }
+ for (y = MAX(y_start, LCD_SPLIT_POS); y < ymax; y++) {
+ dest.y = (y + LCD_SPLIT_LINES) * display_zoom ;
+
+ SDL_FillRect(surface, &dest, (Uint32)getpixel(x, y));
+ }
+#else
for (y = y_start; y < ymax; y++) {
dest.y = y * display_zoom;
SDL_FillRect(surface, &dest, (Uint32)getpixel(x, y));
}
+#endif
}
SDL_UnlockSurface(surface);
}
-void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,)
- int x_start, int y_start, int width,
+void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
int height, int max_x, int max_y, int ui_x, int ui_y)
{
int xmax, ymax;
@@ -80,73 +90,17 @@ void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,)
SDL_Rect dest= {(ui_x + x_start) * display_zoom, (ui_y + y_start) * display_zoom,
xmax * display_zoom, ymax * display_zoom};
-#ifdef UI_LCD_SPLIT
- /* fix real screen coordinates */
- if(ymax >= UI_LCD_SPLIT_LINES)
- src.h += UI_LCD_SPLIT_BLACK_LINES * display_zoom;
-
- SDL_LockSurface(surface);
- SDL_LockSurface(real_surface);
-
- int pixel, npixels;
-
-#if LCD_DEPTH != 1
-#error "Split screen only works for monochrome displays !"
-#endif
-
- npixels = display_zoom * display_zoom * UI_LCD_SPLIT_LINES * surface->pitch;
- const unsigned char * pixels_src = (const unsigned char*)surface->pixels;
- unsigned char * pixels_dst = (unsigned char*)real_surface->pixels;
- const int start_pixel = UI_LCD_SPLIT_LINES * surface->pitch * display_zoom;
- const int stop_pixel = (UI_LCD_SPLIT_LINES+UI_LCD_SPLIT_BLACK_LINES)
- * surface->pitch * display_zoom;
-
- /* draw top pixels, change the color */
- for (pixel = 0; pixel < npixels ; pixel++)
- {
- int pix = pixels_src[pixel] + gradient_steps;
- if(pix > 255) pix = 255;
-
- pixels_dst[pixel] = pix;
- }
-
- /* copy bottom pixels */
- memcpy(&pixels_dst[stop_pixel], &pixels_src[start_pixel],
- (UI_LCD_HEIGHT - UI_LCD_SPLIT_LINES) * surface->pitch * display_zoom);
-
- /* separation lines are off */
- for (pixel = start_pixel; pixel < stop_pixel ; pixel++)
- pixels_dst[pixel] = 0;
-
- SDL_UnlockSurface(surface);
- SDL_UnlockSurface(real_surface);
-
- SDL_BlitSurface(real_surface, &src, gui_surface, &dest);
-#else
SDL_BlitSurface(surface, &src, gui_surface, &dest);
-#endif
SDL_Flip(gui_surface);
}
/* set a range of bitmap indices to a gradient from startcolour to endcolour */
void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
- IFSPLIT(SDL_Color *split_start,)
- IFSPLIT(SDL_Color *split_end ,) int first, int steps)
+ int first, int steps)
{
int i;
-
-#ifdef UI_LCD_SPLIT
- int tot_steps = steps * 2;
- if (tot_steps > 256)
- tot_steps = 256;
-
- gradient_steps = steps;
-#else
-#define tot_steps steps
-#endif
-
- SDL_Color palette[tot_steps];
+ SDL_Color palette[steps];
for (i = 0; i < steps; i++) {
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,
palette[i].b = start->b + (end->b - start->b) * i / (steps - 1);
}
-#ifdef UI_LCD_SPLIT /* extra color */
- for (i = steps ; i < tot_steps; i++) {
- palette[i].r = split_start->r + (split_end->r - split_start->r) * (i - steps) / (tot_steps - steps - 1);
- palette[i].g = split_start->g + (split_end->g - split_start->g) * (i - steps) / (tot_steps - steps - 1);
- palette[i].b = split_start->b + (split_end->b - split_start->b) * (i - steps) / (tot_steps - steps - 1);
- }
-#endif
-
- SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, tot_steps);
+ SDL_SetPalette(surface, SDL_LOGPAL|SDL_PHYSPAL, palette, first, steps);
}
diff --git a/uisimulator/sdl/lcd-sdl.h b/uisimulator/sdl/lcd-sdl.h
index b177eb1..9ffa524 100644
--- a/uisimulator/sdl/lcd-sdl.h
+++ b/uisimulator/sdl/lcd-sdl.h
@@ -25,13 +25,6 @@
#include "lcd.h"
#include "SDL.h"
-#include "uisdl.h"
-#ifdef UI_LCD_SPLIT
-#define IFSPLIT(x,y) x,y
-#else
-#define IFSPLIT(x,y)
-#endif
-
/* Default display zoom level */
extern int display_zoom;
@@ -39,13 +32,11 @@ void sdl_update_rect(SDL_Surface *surface, int x_start, int y_start, int width,
int height, int max_x, int max_y,
unsigned long (*getpixel)(int, int));
-void sdl_gui_update(SDL_Surface *surface, IFSPLIT(SDL_Surface *real_surface,)
- int x_start, int y_start, int width,
+void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
int height, int max_x, int max_y, int ui_x, int ui_y);
void sdl_set_gradient(SDL_Surface *surface, SDL_Color *start, SDL_Color *end,
- IFSPLIT( SDL_Color *split_start ,)
- IFSPLIT( SDL_Color *split_end ,) int first, int steps);
+ int first, int steps);
#endif /* #ifndef __LCDSDL_H__ */
diff --git a/uisimulator/sdl/uisdl.c b/uisimulator/sdl/uisdl.c
index 81f9722..d6a49d3 100644
--- a/uisimulator/sdl/uisdl.c
+++ b/uisimulator/sdl/uisdl.c
@@ -130,15 +130,11 @@ bool gui_startup(void)
height = UI_HEIGHT;
} else {
#ifdef HAVE_REMOTE_LCD
- width = UI_LCD_WIDTH > UI_REMOTE_WIDTH ? UI_LCD_WIDTH : UI_REMOTE_WIDTH;
- height = UI_LCD_HEIGHT + UI_REMOTE_HEIGHT;
+ width = SIM_LCD_WIDTH > SIM_REMOTE_WIDTH ? SIM_LCD_WIDTH : SIM_REMOTE_WIDTH;
+ height = SIM_LCD_HEIGHT + SIM_REMOTE_HEIGHT;
#else
- width = UI_LCD_WIDTH;
- height = UI_LCD_HEIGHT
-#ifdef UI_LCD_SPLIT
- + UI_LCD_SPLIT_BLACK_LINES
-#endif
- ;
+ width = SIM_LCD_WIDTH;
+ height = SIM_LCD_HEIGHT;
#endif
}
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h
index e33be01..6cb382c 100644
--- a/uisimulator/sdl/uisdl.h
+++ b/uisimulator/sdl/uisdl.h
@@ -31,208 +31,114 @@
#define UI_TITLE "Jukebox Recorder"
#define UI_WIDTH 270 /* width of GUI window */
#define UI_HEIGHT 406 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 80 /* x position of lcd */
-#define UI_LCD_POSY 104 /* y position of lcd (96 for real aspect) */
-#define UI_LCD_WIDTH 112
-#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
+#define UI_LCD_POSY 104 /* y position of lcd */
#elif defined(ARCHOS_PLAYER)
#define UI_TITLE "Jukebox Player"
#define UI_WIDTH 284 /* width of GUI window */
#define UI_HEIGHT 420 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 75 /* x position of lcd */
#define UI_LCD_POSY 116 /* y position of lcd */
-#define UI_LCD_WIDTH 132
-#define UI_LCD_HEIGHT 64
#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
#define UI_TITLE "Jukebox FM Recorder"
#define UI_WIDTH 285 /* width of GUI window */
#define UI_HEIGHT 414 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 126, 229, 126 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 87 /* x position of lcd */
-#define UI_LCD_POSY 77 /* y position of lcd (69 for real aspect) */
-#define UI_LCD_WIDTH 112
-#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
+#define UI_LCD_POSY 77 /* y position of lcd */
#elif defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM)
#define UI_TITLE "Ondio"
#define UI_WIDTH 155 /* width of GUI window */
#define UI_HEIGHT 334 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (backlight mod) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 21 /* x position of lcd */
-#define UI_LCD_POSY 82 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH 112
-#define UI_LCD_HEIGHT 64 /* (80 for real aspect) */
+#define UI_LCD_POSY 82 /* y position of lcd */
#elif defined(IRIVER_H120) || defined(IRIVER_H100)
#define UI_TITLE "iriver H1x0"
#define UI_WIDTH 379 /* width of GUI window */
#define UI_HEIGHT 508 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 109 /* x position of lcd */
#define UI_LCD_POSY 23 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
-#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
-#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
-#define UI_REMOTE_FGCOLOR 0, 0, 0 /* foreground color of remote LCD (no backlight) */
-#define UI_REMOTE_FGCOLORLIGHT 0, 0, 0 /* foreground color of remote LCD (backlight) */
#define UI_REMOTE_POSX 50 /* x position of remote lcd */
#define UI_REMOTE_POSY 403 /* y position of remote lcd */
-#define UI_REMOTE_WIDTH 128
-#define UI_REMOTE_HEIGHT 64
#elif defined(IRIVER_H300)
#define UI_TITLE "iriver H300"
#define UI_WIDTH 288 /* width of GUI window */
#define UI_HEIGHT 581 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 26 /* x position of lcd */
#define UI_LCD_POSY 36 /* y position of lcd */
-#define UI_LCD_WIDTH 220
-#define UI_LCD_HEIGHT 176
-#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
-#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
#define UI_REMOTE_POSX 12 /* x position of remote lcd */
#define UI_REMOTE_POSY 478 /* y position of remote lcd */
-#define UI_REMOTE_WIDTH 128
-#define UI_REMOTE_HEIGHT 64
#elif defined(IPOD_1G2G)
#define UI_TITLE "iPod 1G/2G"
#define UI_WIDTH 224 /* width of GUI window */
#define UI_HEIGHT 382 /* height of GUI window */
-#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 32 /* x position of lcd */
#define UI_LCD_POSY 12 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
#elif defined(IPOD_3G)
#define UI_TITLE "iPod 3G"
#define UI_WIDTH 218 /* width of GUI window */
#define UI_HEIGHT 389 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 29 /* x position of lcd */
#define UI_LCD_POSY 16 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
#elif defined(IPOD_4G)
#define UI_TITLE "iPod 4G"
#define UI_WIDTH 196 /* width of GUI window */
#define UI_HEIGHT 370 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 19 /* x position of lcd */
#define UI_LCD_POSY 14 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
#elif defined(IPOD_MINI) || defined(IPOD_MINI2G)
#define UI_TITLE "iPod mini"
#define UI_WIDTH 191 /* width of GUI window */
#define UI_HEIGHT 365 /* height of GUI window */
-#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 24 /* x position of lcd */
#define UI_LCD_POSY 17 /* y position of lcd */
-#define UI_LCD_WIDTH 138
-#define UI_LCD_HEIGHT 110
#elif defined(IPOD_COLOR)
#define UI_TITLE "iPod Color"
#define UI_WIDTH 261 /* width of GUI window */
#define UI_HEIGHT 493 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 21 /* x position of lcd */
#define UI_LCD_POSY 16 /* y position of lcd */
-#define UI_LCD_WIDTH 220
-#define UI_LCD_HEIGHT 176
#elif defined(IPOD_NANO)
#define UI_TITLE "iPod Nano"
#define UI_WIDTH 199 /* width of GUI window */
#define UI_HEIGHT 421 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 13 /* x position of lcd */
#define UI_LCD_POSY 14 /* y position of lcd */
-#define UI_LCD_WIDTH 176
-#define UI_LCD_HEIGHT 132
#elif defined(IPOD_VIDEO)
#define UI_TITLE "iPod Video"
#define UI_WIDTH 350 /* width of GUI window */
#define UI_HEIGHT 591 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 14 /* x position of lcd */
#define UI_LCD_POSY 12 /* y position of lcd */
-#define UI_LCD_WIDTH 320
-#define UI_LCD_HEIGHT 240
#elif defined(IAUDIO_X5)
#define UI_TITLE "iAudio X5"
#define UI_WIDTH 300 /* width of GUI window */
#define UI_HEIGHT 558 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 55 /* x position of lcd */
-#define UI_LCD_POSY 61 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
-#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
-#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
+#define UI_LCD_POSY 61 /* y position of lcd */
#define UI_REMOTE_POSX 12 /* x position of remote lcd */
#define UI_REMOTE_POSY 462 /* y position of remote lcd */
-#define UI_REMOTE_WIDTH 128
-#define UI_REMOTE_HEIGHT 96
#elif defined(IAUDIO_M5)
#define UI_TITLE "iAudio M5"
#define UI_WIDTH 374 /* width of GUI window */
#define UI_HEIGHT 650 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 82 /* x position of lcd */
-#define UI_LCD_POSY 74 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_BGCOLOR 100, 135, 100 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 223, 216, 255 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
-#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
-#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
+#define UI_LCD_POSY 74 /* y position of lcd */
#define UI_REMOTE_POSX 59 /* x position of remote lcd */
#define UI_REMOTE_POSY 509 /* y position of remote lcd */
-#define UI_REMOTE_WIDTH 128
-#define UI_REMOTE_HEIGHT 96
#elif defined(IAUDIO_M3)
#define UI_TITLE "iAudio M3"
@@ -240,68 +146,43 @@
#define UI_HEIGHT 501 /* height of GUI window */
#define UI_LCD_POSX 92 /* x position of lcd */
#define UI_LCD_POSY 348 /* y position of lcd */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no bklight) */
-#define UI_LCD_BGCOLORLIGHT 130, 180, 250 /* bkgnd color of LCD (bklight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
#elif defined(GIGABEAT_F)
#define UI_TITLE "Toshiba Gigabeat"
#define UI_WIDTH 401 /* width of GUI window */
#define UI_HEIGHT 655 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 48 /* x position of lcd */
#define UI_LCD_POSY 60 /* y position of lcd */
-#define UI_LCD_WIDTH 240
-#define UI_LCD_HEIGHT 320
#elif defined(GIGABEAT_S)
#define UI_TITLE "Toshiba Gigabeat"
#define UI_WIDTH 450 /* width of GUI window */
#define UI_HEIGHT 688 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 96 /* x position of lcd */
#define UI_LCD_POSY 90 /* y position of lcd */
-#define UI_LCD_WIDTH 240
-#define UI_LCD_HEIGHT 320
#elif defined(MROBE_500)
#define UI_TITLE "Olympus M:Robe 500"
#define UI_WIDTH 401 /* width of GUI window */
#define UI_HEIGHT 655 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 48 /* x position of lcd */
#define UI_LCD_POSY 60 /* y position of lcd */
-#define UI_LCD_WIDTH LCD_WIDTH
-#define UI_LCD_HEIGHT LCD_HEIGHT
-#define UI_REMOTE_BGCOLOR 90, 145, 90 /* bkgnd of remote lcd (no bklight) */
-#define UI_REMOTE_BGCOLORLIGHT 130, 180, 250 /* bkgnd of remote lcd (bklight) */
#define UI_REMOTE_POSX 50 /* x position of remote lcd */
#define UI_REMOTE_POSY 403 /* y position of remote lcd */
-#define UI_REMOTE_WIDTH 79
-#define UI_REMOTE_HEIGHT 16
#elif defined(IRIVER_H10)
#define UI_TITLE "iriver H10 20Gb"
#define UI_WIDTH 392 /* width of GUI window */
#define UI_HEIGHT 391 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 111 /* x position of lcd */
-#define UI_LCD_POSY 30 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#define UI_LCD_POSY 30 /* y position of lcd */
#elif defined(IRIVER_H10_5GB)
#define UI_TITLE "iriver H10 5/6Gb"
#define UI_WIDTH 353 /* width of GUI window */
#define UI_HEIGHT 460 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 112 /* x position of lcd */
-#define UI_LCD_POSY 45 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#define UI_LCD_POSY 45 /* y position of lcd */
#elif defined(SANSA_E200) || defined(SANSA_E200V2)
#ifdef SANSA_E200
@@ -311,35 +192,23 @@
#endif
#define UI_WIDTH 260 /* width of GUI window */
#define UI_HEIGHT 502 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 42 /* x position of lcd */
-#define UI_LCD_POSY 37 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#define UI_LCD_POSY 37 /* y position of lcd */
#elif defined(SANSA_C200)
#define UI_TITLE "Sansa c200"
#define UI_WIDTH 350 /* width of GUI window */
#define UI_HEIGHT 152 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 42 /* x position of lcd */
-#define UI_LCD_POSY 35 /* y position of lcd (74 for real aspect) */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
+#define UI_LCD_POSY 35 /* y position of lcd */
#elif defined(IRIVER_IFP7XX)
#define UI_TITLE "iriver iFP7xx"
#define UI_WIDTH 425 /* width of GUI window */
#define UI_HEIGHT 183 /* height of GUI window */
-#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 115 /* x position of lcd */
#define UI_LCD_POSY 54 /* y position of lcd */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
-
+
#elif defined(ARCHOS_AV300)
#define UI_TITLE "Archos AV300"
/* We are temporarily using a 2bpp LCD driver and dummy bitmap */
@@ -347,25 +216,13 @@
#define UI_HEIGHT 340 /* height of GUI window */
#define UI_LCD_POSX 50 /* x position of lcd */
#define UI_LCD_POSY 50 /* y position of lcd */
-#define UI_LCD_WIDTH 320
-#define UI_LCD_HEIGHT 240
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#elif defined(MROBE_100)
#define UI_TITLE "Olympus M:Robe 100"
#define UI_WIDTH 247 /* width of GUI window */
#define UI_HEIGHT 416 /* height of GUI window */
-#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 94, 2, 2 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 50, 50, 50 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 241, 6, 3 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 43 /* x position of lcd */
#define UI_LCD_POSY 25 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
#elif defined(COWON_D2)
#define UI_TITLE "Cowon D2"
@@ -373,25 +230,13 @@
#define UI_HEIGHT 368 /* height of GUI window */
#define UI_LCD_POSX 58 /* x position of lcd */
#define UI_LCD_POSY 67 /* y position of lcd */
-#define UI_LCD_WIDTH 320
-#define UI_LCD_HEIGHT 240
-#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#elif defined(IAUDIO_7)
#define UI_TITLE "iAudio7"
#define UI_WIDTH 494 /* width of GUI window */
#define UI_HEIGHT 214 /* height of GUI window */
-#define UI_LCD_BGCOLOR 90, 145, 90 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 173, 216, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 131 /* x position of lcd */
#define UI_LCD_POSY 38 /* y position of lcd */
-#define UI_LCD_WIDTH 160
-#define UI_LCD_HEIGHT 128
#elif defined(CREATIVE_ZVM) || defined(CREATIVE_ZVM60GB)
#ifdef CREATIVE_ZVM
@@ -403,12 +248,6 @@
#define UI_HEIGHT 643 /* height of GUI window */
#define UI_LCD_POSX 31 /* x position of lcd */
#define UI_LCD_POSY 62 /* y position of lcd */
-#define UI_LCD_WIDTH 320
-#define UI_LCD_HEIGHT 240
-#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#elif defined(CREATIVE_ZV)
#define UI_TITLE "Creative Zen Vision"
@@ -416,12 +255,6 @@
#define UI_HEIGHT 643 /* height of GUI window */
#define UI_LCD_POSX 129 /* x position of lcd */
#define UI_LCD_POSY 85 /* y position of lcd */
-#define UI_LCD_WIDTH 640
-#define UI_LCD_HEIGHT 480
-#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#elif defined(MEIZU_M6SL)
#define UI_TITLE "Meizu M6"
@@ -429,22 +262,13 @@
#define UI_HEIGHT 322 /* height of GUI window */
#define UI_LCD_POSX 39 /* x position of lcd */
#define UI_LCD_POSY 38 /* y position of lcd */
-#define UI_LCD_WIDTH 320
-#define UI_LCD_HEIGHT 240
-#define UI_LCD_BGCOLOR 32, 32, 32 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 192, 192, 192 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#elif defined(SANSA_FUZE)
#define UI_TITLE "Sansa Fuze"
#define UI_WIDTH 279 /* width of GUI window */
#define UI_HEIGHT 449 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 30 /* x position of lcd */
#define UI_LCD_POSY 31 /* y position of lcd */
-#define UI_LCD_WIDTH LCD_WIDTH
-#define UI_LCD_HEIGHT LCD_HEIGHT
#elif defined(SANSA_CLIP)
#define UI_TITLE "Sansa Clip"
@@ -452,42 +276,20 @@
#define UI_HEIGHT 325 /* height of GUI window */
#define UI_LCD_POSX 38 /* x position of lcd */
#define UI_LCD_POSY 38 /* y position of lcd */
-#define UI_LCD_WIDTH 128
-#define UI_LCD_HEIGHT 64
-#define UI_LCD_BGCOLOR 0, 0, 0 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 0, 0, 0 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 13, 226, 229 /* foreground color of LCD (backlight) */
-
-#define UI_LCD_SPLIT /* The screen is split in 2 areas */
-#define UI_LCD_SPLIT_LINES 16 /* the top 16 lines have a different color */
-#define UI_LCD_SPLIT_BLACK_LINES 2 /* The 2 areas are separated by 2 empty lines */
-/* Colors for the top part of the screen */
-#define UI_LCD_SPLIT_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_SPLIT_FGCOLORLIGHT 255, 230, 15 /* foreground color of LCD (backlight) */
#elif defined(PHILIPS_HDD1630)
#define UI_TITLE "Philips GoGear HDD1630"
#define UI_WIDTH 407 /* width of GUI window */
#define UI_HEIGHT 391 /* height of GUI window */
-/* high-colour */
#define UI_LCD_POSX 143 /* x position of lcd */
#define UI_LCD_POSY 27 /* y position of lcd */
-#define UI_LCD_WIDTH LCD_WIDTH
-#define UI_LCD_HEIGHT LCD_HEIGHT
#elif defined(SANSA_M200V4)
#define UI_TITLE "sansa m200v4"
#define UI_WIDTH 350 /* width of GUI window */
#define UI_HEIGHT 168 /* height of GUI window */
-#define UI_LCD_BGCOLOR 94, 104, 84 /* bkgnd color of LCD (no backlight) */
-#define UI_LCD_BGCOLORLIGHT 60, 160, 230 /* bkgnd color of LCD (backlight) */
-#define UI_LCD_FGCOLOR 0, 0, 0 /* foreground color of LCD (no backlight) */
-#define UI_LCD_FGCOLORLIGHT 0, 0, 0 /* foreground color of LCD (backlight) */
#define UI_LCD_POSX 42 /* x position of lcd */
#define UI_LCD_POSY 55 /* y position of lcd */
-#define UI_LCD_WIDTH LCD_WIDTH /* * 1.5 */
-#define UI_LCD_HEIGHT LCD_HEIGHT /* * 1.5 */
#else