summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl/lcd-bitmap.c
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2006-02-13 21:46:28 +0000
committerDan Everton <dan@iocaine.org>2006-02-13 21:46:28 +0000
commit3ba0060ac1fa1c39596c51d4bf259142e6d1847f (patch)
tree71428db81254a9901fbf3e8a92c71f0f57410cd2 /uisimulator/sdl/lcd-bitmap.c
parentdd39e33663a4b617c3f88f48845681e772386a7f (diff)
downloadrockbox-3ba0060ac1fa1c39596c51d4bf259142e6d1847f.tar.gz
rockbox-3ba0060ac1fa1c39596c51d4bf259142e6d1847f.zip
Backlight support for 8-bit targets in SDL sim. Redo sound handling. Still doesn't work right, but is closer to how the actual Rockbox system does it. Move some stub functions in to Win32 and X11 sims to keep them compiling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8686 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl/lcd-bitmap.c')
-rw-r--r--uisimulator/sdl/lcd-bitmap.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index db4a98d823..2fd7576ecc 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -17,13 +17,15 @@
*
****************************************************************************/
+#include "debug.h"
#include "uisdl.h"
#include "lcd-sdl.h"
SDL_Surface* lcd_surface;
#if LCD_DEPTH <= 8
-SDL_Color lcd_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
+SDL_Color lcd_color_zero = {UI_LCD_BGCOLOR, 0};
+SDL_Color lcd_backlight_color_zero = {UI_LCD_BGCOLORLIGHT, 0};
SDL_Color lcd_color_max = {0, 0, 0, 0};
#endif
@@ -60,6 +62,22 @@ void lcd_update_rect(int x_start, int y_start, int width, int height)
get_lcd_pixel);
}
+#ifdef CONFIG_BACKLIGHT
+void sim_backlight(int value)
+{
+#if LCD_DEPTH <= 8
+ if (value > 0) {
+ sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, (1<<LCD_DEPTH));
+ } else {
+ sdl_set_gradient(lcd_surface, &lcd_color_zero, &lcd_color_max, (1<<LCD_DEPTH));
+ }
+
+ lcd_update();
+#else
+ DEBUGF("backlight: %s\n", (value > 0) ? "on" : "off");
+#endif
+}
+#endif
/* initialise simulator lcd driver */
void sim_lcd_init(void)