summaryrefslogtreecommitdiff
path: root/uisimulator
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/lcd-bitmap.c8
-rw-r--r--uisimulator/sdl/lcd-charcells.c3
-rw-r--r--uisimulator/sdl/lcd-remote-bitmap.c12
3 files changed, 11 insertions, 12 deletions
diff --git a/uisimulator/sdl/lcd-bitmap.c b/uisimulator/sdl/lcd-bitmap.c
index 8caac784ef..378889c417 100644
--- a/uisimulator/sdl/lcd-bitmap.c
+++ b/uisimulator/sdl/lcd-bitmap.c
@@ -22,7 +22,7 @@
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#include "screendump.h"
26 26
27SDL_Surface* lcd_surface; 27SDL_Surface* lcd_surface;
28 28
@@ -166,14 +166,12 @@ void sim_lcd_init(void)
166 SIM_LCD_WIDTH * display_zoom, 166 SIM_LCD_WIDTH * display_zoom,
167 SIM_LCD_HEIGHT * display_zoom, 167 SIM_LCD_HEIGHT * display_zoom,
168 LCD_DEPTH, 0, 0, 0, 0); 168 LCD_DEPTH, 0, 0, 0, 0);
169#else 169#elif LCD_DEPTH <= 8
170 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 170 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
171 SIM_LCD_WIDTH * display_zoom, 171 SIM_LCD_WIDTH * display_zoom,
172 SIM_LCD_HEIGHT * display_zoom, 172 SIM_LCD_HEIGHT * display_zoom,
173 8, 0, 0, 0, 0); 173 8, 0, 0, 0, 0);
174#endif
175 174
176#if LCD_DEPTH <= 8
177#ifdef HAVE_BACKLIGHT 175#ifdef HAVE_BACKLIGHT
178 sdl_set_gradient(lcd_surface, &lcd_bl_color_dark, 176 sdl_set_gradient(lcd_surface, &lcd_bl_color_dark,
179 &lcd_bl_color_bright, 0, NUM_SHADES); 177 &lcd_bl_color_bright, 0, NUM_SHADES);
@@ -189,7 +187,7 @@ void sim_lcd_init(void)
189 &lcd_color2_bright, NUM_SHADES, NUM_SHADES); 187 &lcd_color2_bright, NUM_SHADES, NUM_SHADES);
190#endif 188#endif
191#endif /* !HAVE_BACKLIGHT */ 189#endif /* !HAVE_BACKLIGHT */
192#endif /* LCD_DEPTH < 8 */ 190#endif /* LCD_DEPTH */
193} 191}
194 192
195#if LCD_DEPTH < 8 193#if LCD_DEPTH < 8
diff --git a/uisimulator/sdl/lcd-charcells.c b/uisimulator/sdl/lcd-charcells.c
index 19d27d5152..30aa0a6a81 100644
--- a/uisimulator/sdl/lcd-charcells.c
+++ b/uisimulator/sdl/lcd-charcells.c
@@ -22,7 +22,8 @@
22#include "debug.h" 22#include "debug.h"
23#include "lcd.h" 23#include "lcd.h"
24#include "lcd-charcell.h" 24#include "lcd-charcell.h"
25#include "misc.h" 25#inclued "screendump.h"
26#include "misc.h"
26#include <string.h> 27#include <string.h>
27#include <unistd.h> 28#include <unistd.h>
28#include <fcntl.h> 29#include <fcntl.h>
diff --git a/uisimulator/sdl/lcd-remote-bitmap.c b/uisimulator/sdl/lcd-remote-bitmap.c
index f5c2225ab2..ecb9904a40 100644
--- a/uisimulator/sdl/lcd-remote-bitmap.c
+++ b/uisimulator/sdl/lcd-remote-bitmap.c
@@ -22,7 +22,7 @@
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#include "screendump.h"
26 26
27SDL_Surface *remote_surface; 27SDL_Surface *remote_surface;
28 28
@@ -39,7 +39,7 @@ SDL_Color remote_color_bright = {RED_CMP(LCD_REMOTE_BRIGHTCOLOR),
39 GREEN_CMP(LCD_REMOTE_BRIGHTCOLOR), 39 GREEN_CMP(LCD_REMOTE_BRIGHTCOLOR),
40 BLUE_CMP(LCD_REMOTE_BRIGHTCOLOR), 0}; 40 BLUE_CMP(LCD_REMOTE_BRIGHTCOLOR), 0};
41 41
42#define GRADIENT_MAX 128 42#define NUM_SHADES 129
43 43
44#if LCD_REMOTE_DEPTH == 2 44#if LCD_REMOTE_DEPTH == 2
45/* Only defined for positive, non-split LCD for now */ 45/* Only defined for positive, non-split LCD for now */
@@ -49,7 +49,7 @@ static const unsigned char colorindex[4] = {128, 85, 43, 0};
49static unsigned long get_lcd_remote_pixel(int x, int y) 49static unsigned long get_lcd_remote_pixel(int x, int y)
50{ 50{
51#if LCD_REMOTE_DEPTH == 1 51#if LCD_REMOTE_DEPTH == 1
52 return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : GRADIENT_MAX; 52 return lcd_remote_framebuffer[y/8][x] & (1 << (y & 7)) ? 0 : (NUM_SHADES-1);
53#elif LCD_REMOTE_DEPTH == 2 53#elif LCD_REMOTE_DEPTH == 2
54#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED 54#if LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED
55 unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101; 55 unsigned bits = (lcd_remote_framebuffer[y/8][x] >> (y & 7)) & 0x0101;
@@ -76,10 +76,10 @@ void sim_remote_backlight(int value)
76{ 76{
77 if (value > 0) { 77 if (value > 0) {
78 sdl_set_gradient(remote_surface, &remote_bl_color_dark, 78 sdl_set_gradient(remote_surface, &remote_bl_color_dark,
79 &remote_bl_color_bright, 0, GRADIENT_MAX+1); 79 &remote_bl_color_bright, 0, NUM_SHADES);
80 } else { 80 } else {
81 sdl_set_gradient(remote_surface, &remote_color_dark, 81 sdl_set_gradient(remote_surface, &remote_color_dark,
82 &remote_color_bright, 0, GRADIENT_MAX+1); 82 &remote_color_bright, 0, NUM_SHADES);
83 } 83 }
84 84
85 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,
@@ -97,6 +97,6 @@ void sim_lcd_remote_init(void)
97 8, 0, 0, 0, 0); 97 8, 0, 0, 0, 0);
98 98
99 sdl_set_gradient(remote_surface, &remote_bl_color_dark, 99 sdl_set_gradient(remote_surface, &remote_bl_color_dark,
100 &remote_bl_color_bright, 0, GRADIENT_MAX+1); 100 &remote_bl_color_bright, 0, NUM_SHADES);
101} 101}
102 102