From bba06cfd551c7d34308ef7ea52455f07a5e2cfee Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Thu, 4 Dec 2008 23:24:45 +0000 Subject: Sansa Clip Simulator: emulate the real screen at the price of some CPU (FS#9521) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19347 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/lcd-bitmap.c | 104 +++++++++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 24 deletions(-) (limited to 'uisimulator/sdl/lcd-bitmap.c') diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c index 92480396bc..b9f5732dc7 100644 --- a/uisimulator/sdl/lcd-bitmap.c +++ b/uisimulator/sdl/lcd-bitmap.c @@ -24,15 +24,24 @@ #include "lcd-sdl.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 #endif #if LCD_DEPTH < 8 @@ -73,8 +82,9 @@ 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, x_start, y_start, width, height, LCD_WIDTH, - LCD_HEIGHT, background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); + sdl_gui_update(lcd_surface, IFSPLIT(lcd_real_surface,) x_start, y_start, + width, height, LCD_WIDTH, LCD_HEIGHT, + background ? UI_LCD_POSX : 0, background? UI_LCD_POSY : 0); } #ifdef HAVE_BACKLIGHT @@ -84,27 +94,51 @@ void sim_backlight(int 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< 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< 0) { +#ifdef UI_LCD_SPLIT + sdl_set_gradient(lcd_real_surface, &lcd_color_max, + &lcd_backlight_color_zero, &lcd_color_split, + &lcd_backlight_color_zero, (1<> 9, g >> 8, b >> 9); #if LCD_WIDTH >= LCD_HEIGHT - dst++; + dst++; #else dst += LCD_WIDTH; #endif @@ -276,7 +332,7 @@ void lcd_blit_yuv(unsigned char * const src[3], *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); #if LCD_WIDTH >= LCD_HEIGHT - dst++; + dst++; #else dst += LCD_WIDTH; #endif @@ -321,7 +377,7 @@ void lcd_blit_yuv(unsigned char * const src[3], *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); #if LCD_WIDTH >= LCD_HEIGHT - dst++; + dst++; #else dst += LCD_WIDTH; #endif @@ -341,7 +397,7 @@ void lcd_blit_yuv(unsigned char * const src[3], *dst = LCD_RGBPACK_LCD(r >> 9, g >> 8, b >> 9); #if LCD_WIDTH >= LCD_HEIGHT - dst++; + dst++; #else dst += LCD_WIDTH; #endif -- cgit v1.2.3