summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-ipodcolor.h3
-rw-r--r--firmware/export/config-ipodnano.h3
-rw-r--r--firmware/export/config-ipodvideo.h3
-rw-r--r--uisimulator/sdl/lcd-bitmap.c24
-rw-r--r--uisimulator/sdl/lcd-sdl.c3
5 files changed, 31 insertions, 5 deletions
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index e7395919d6..e8a048d97f 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -49,6 +49,9 @@
49#define LCD_DEPTH 16 /* 65536 colours */ 49#define LCD_DEPTH 16 /* 65536 colours */
50#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ 50#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */
51 51
52/* LCD stays visible without backlight - simulator hint */
53#define HAVE_TRANSFLECTIVE_LCD
54
52#define CONFIG_KEYPAD IPOD_4G_PAD 55#define CONFIG_KEYPAD IPOD_4G_PAD
53 56
54/* Define this if you do software codec */ 57/* Define this if you do software codec */
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 3bf44b3abe..c90deb8e2f 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -49,6 +49,9 @@
49#define LCD_DEPTH 16 /* 65536 colours */ 49#define LCD_DEPTH 16 /* 65536 colours */
50#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */ 50#define LCD_PIXELFORMAT RGB565SWAPPED /* rgb565 byte-swapped */
51 51
52/* LCD stays visible without backlight - simulator hint */
53#define HAVE_TRANSFLECTIVE_LCD
54
52#define CONFIG_KEYPAD IPOD_4G_PAD 55#define CONFIG_KEYPAD IPOD_4G_PAD
53 56
54/* Define this if you do software codec */ 57/* Define this if you do software codec */
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index d3e8dc0140..ca8e43db77 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -49,6 +49,9 @@
49#define LCD_DEPTH 16 /* 65536 colours */ 49#define LCD_DEPTH 16 /* 65536 colours */
50#define LCD_PIXELFORMAT RGB565 /* rgb565 */ 50#define LCD_PIXELFORMAT RGB565 /* rgb565 */
51 51
52/* LCD stays visible without backlight - simulator hint */
53#define HAVE_TRANSFLECTIVE_LCD
54
52#define CONFIG_KEYPAD IPOD_4G_PAD 55#define CONFIG_KEYPAD IPOD_4G_PAD
53 56
54/* Define this if you do software codec */ 57/* Define this if you do software codec */
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index b4e6dcd4c0..8caac784ef 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -63,7 +63,16 @@ SDL_Color lcd_color2_bright = {RED_CMP(LCD_BRIGHTCOLOR_2),
63#else 63#else
64#define NUM_SHADES 129 64#define NUM_SHADES 129
65#endif 65#endif
66#endif /* LCD_DEPTH <= 8 */ 66
67#else /* LCD_DEPTH > 8 */
68
69#ifdef HAVE_TRANSFLECTIVE_LCD
70#define BACKLIGHT_OFF_ALPHA 85 /* 1/3 brightness */
71#else
72#define BACKLIGHT_OFF_ALPHA 0 /* pitch black */
73#endif
74
75#endif /* LCD_DEPTH */
67 76
68#if LCD_DEPTH < 8 77#if LCD_DEPTH < 8
69unsigned long (*lcd_ex_getpixel)(int, int) = NULL; 78unsigned long (*lcd_ex_getpixel)(int, int) = NULL;
@@ -135,12 +144,17 @@ void sim_backlight(int value)
135 &lcd_color2_bright, NUM_SHADES, NUM_SHADES); 144 &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
136#endif 145#endif
137 } 146 }
147#else /* LCD_DEPTH > 8 */
148 if (value > 0) {
149 SDL_SetAlpha(lcd_surface, 0, SDL_ALPHA_OPAQUE); /* full on */
150 } else {
151 SDL_SetAlpha(lcd_surface, SDL_SRCALPHA, BACKLIGHT_OFF_ALPHA);
152 }
153#endif /* LCD_DEPTH */
154
138 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT, 155 sdl_gui_update(lcd_surface, 0, 0, SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
139 SIM_LCD_WIDTH, SIM_LCD_HEIGHT, 156 SIM_LCD_WIDTH, SIM_LCD_HEIGHT,
140 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); 157 background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0);
141#else /* LCD_DEPTH > 8 */
142 (void)value; /* not yet simulated */
143#endif /* LCD_DEPTH */
144} 158}
145#endif /* HAVE_BACKLIGHT */ 159#endif /* HAVE_BACKLIGHT */
146 160
@@ -153,7 +167,7 @@ void sim_lcd_init(void)
153 SIM_LCD_HEIGHT * display_zoom, 167 SIM_LCD_HEIGHT * display_zoom,
154 LCD_DEPTH, 0, 0, 0, 0); 168 LCD_DEPTH, 0, 0, 0, 0);
155#else 169#else
156 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 170 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
157 SIM_LCD_WIDTH * display_zoom, 171 SIM_LCD_WIDTH * display_zoom,
158 SIM_LCD_HEIGHT * display_zoom, 172 SIM_LCD_HEIGHT * display_zoom,
159 8, 0, 0, 0, 0); 173 8, 0, 0, 0, 0);
diff --git a/uisimulator/sdl/lcd-sdl.c b/uisimulator/sdl/lcd-sdl.c
index 373e07ffc0..aa74c14cd9 100644
--- a/uisimulator/sdl/lcd-sdl.c
+++ b/uisimulator/sdl/lcd-sdl.c
@@ -90,6 +90,9 @@ void sdl_gui_update(SDL_Surface *surface, int x_start, int y_start, int width,
90 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,
91 xmax * display_zoom, ymax * display_zoom}; 91 xmax * display_zoom, ymax * display_zoom};
92 92
93 if (surface->flags & SDL_SRCALPHA) /* alpha needs a black background */
94 SDL_FillRect(gui_surface, &dest, 0);
95
93 SDL_BlitSurface(surface, &src, gui_surface, &dest); 96 SDL_BlitSurface(surface, &src, gui_surface, &dest);
94 97
95 SDL_Flip(gui_surface); 98 SDL_Flip(gui_surface);