summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/lcd-charcell.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/lcd-charcell.c')
-rw-r--r--uisimulator/sdl/lcd-charcell.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/uisimulator/sdl/lcd-charcell.c b/uisimulator/sdl/lcd-charcell.c
index cb31d6349b..8849efc7cd 100644
--- a/uisimulator/sdl/lcd-charcell.c
+++ b/uisimulator/sdl/lcd-charcell.c
@@ -132,8 +132,10 @@ void sim_backlight(int value)
132/* initialise simulator lcd driver */ 132/* initialise simulator lcd driver */
133void sim_lcd_init(void) 133void sim_lcd_init(void)
134{ 134{
135 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, 135 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
136 LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0); 136 SIM_LCD_WIDTH * display_zoom,
137 SIM_LCD_HEIGHT * display_zoom,
138 8, 0, 0, 0, 0);
137 139
138 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, 140 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
139 0, (1<<LCD_DEPTH)); 141 0, (1<<LCD_DEPTH));
@@ -142,10 +144,10 @@ void sim_lcd_init(void)
142#define BMP_COMPRESSION 0 /* BI_RGB */ 144#define BMP_COMPRESSION 0 /* BI_RGB */
143#define BMP_NUMCOLORS (1 << LCD_DEPTH) 145#define BMP_NUMCOLORS (1 << LCD_DEPTH)
144#define BMP_BPP 1 146#define BMP_BPP 1
145#define BMP_LINESIZE (((LCD_WIDTH + 31) / 32) * 4) 147#define BMP_LINESIZE (((SIM_LCD_WIDTH + 31) / 32) * 4)
146 148
147#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) 149#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS)
148#define BMP_DATASIZE (BMP_LINESIZE * LCD_HEIGHT) 150#define BMP_DATASIZE (BMP_LINESIZE * SIM_LCD_HEIGHT)
149#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) 151#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE)
150 152
151#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff 153#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff
@@ -159,8 +161,8 @@ static const unsigned char bmpheader[] =
159 LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */ 161 LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
160 162
161 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ 163 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */
162 LE32_CONST(LCD_WIDTH), /* Width in pixels */ 164 LE32_CONST(SIM_LCD_WIDTH), /* Width in pixels */
163 LE32_CONST(LCD_HEIGHT), /* Height in pixels */ 165 LE32_CONST(SIM_LCD_HEIGHT), /* Height in pixels */
164 0x01, 0x00, /* Number of planes (always 1) */ 166 0x01, 0x00, /* Number of planes (always 1) */
165 LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ 167 LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */
166 LE32_CONST(BMP_COMPRESSION),/* Compression mode */ 168 LE32_CONST(BMP_COMPRESSION),/* Compression mode */
@@ -193,15 +195,15 @@ void screen_dump(void)
193 SDL_LockSurface(lcd_surface); 195 SDL_LockSurface(lcd_surface);
194 196
195 /* BMP image goes bottom up */ 197 /* BMP image goes bottom up */
196 for (y = LCD_HEIGHT - 1; y >= 0; y--) 198 for (y = SIM_LCD_HEIGHT - 1; y >= 0; y--)
197 { 199 {
198 Uint8 *src = (Uint8 *)lcd_surface->pixels 200 Uint8 *src = (Uint8 *)lcd_surface->pixels
199 + y * LCD_WIDTH * display_zoom * display_zoom; 201 + y * SIM_LCD_WIDTH * display_zoom * display_zoom;
200 unsigned char *dst = line; 202 unsigned char *dst = line;
201 unsigned dst_mask = 0x80; 203 unsigned dst_mask = 0x80;
202 204
203 memset(line, 0, sizeof(line)); 205 memset(line, 0, sizeof(line));
204 for (x = LCD_WIDTH; x > 0; x--) 206 for (x = SIM_LCD_WIDTH; x > 0; x--)
205 { 207 {
206 if (*src) 208 if (*src)
207 *dst |= dst_mask; 209 *dst |= dst_mask;