From ad4e3d665734b14a28f1ba5fa874663772dab3e7 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 26 Mar 2007 07:52:13 +0000 Subject: First step of charcell LCD code rework: * Make it fully unicode aware so that adding non-ISO8859-1 scripts becomes possible (limited by the LCD capabilities of course). * Make the API more similar to the bitmap LCD code's API. * Moved hardware dependent parts to target tree. * Simplified code. * Jumpscroll temporarily non-functional. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12916 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/lcd-charcell.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'uisimulator/sdl/lcd-charcell.c') 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) /* initialise simulator lcd driver */ void sim_lcd_init(void) { - lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, - LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0); + lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, + SIM_LCD_WIDTH * display_zoom, + SIM_LCD_HEIGHT * display_zoom, + 8, 0, 0, 0, 0); sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, 0, (1<>8)&0xff @@ -159,8 +161,8 @@ static const unsigned char bmpheader[] = LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */ 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ - LE32_CONST(LCD_WIDTH), /* Width in pixels */ - LE32_CONST(LCD_HEIGHT), /* Height in pixels */ + LE32_CONST(SIM_LCD_WIDTH), /* Width in pixels */ + LE32_CONST(SIM_LCD_HEIGHT), /* Height in pixels */ 0x01, 0x00, /* Number of planes (always 1) */ LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ LE32_CONST(BMP_COMPRESSION),/* Compression mode */ @@ -193,15 +195,15 @@ void screen_dump(void) SDL_LockSurface(lcd_surface); /* BMP image goes bottom up */ - for (y = LCD_HEIGHT - 1; y >= 0; y--) + for (y = SIM_LCD_HEIGHT - 1; y >= 0; y--) { Uint8 *src = (Uint8 *)lcd_surface->pixels - + y * LCD_WIDTH * display_zoom * display_zoom; + + y * SIM_LCD_WIDTH * display_zoom * display_zoom; unsigned char *dst = line; unsigned dst_mask = 0x80; memset(line, 0, sizeof(line)); - for (x = LCD_WIDTH; x > 0; x--) + for (x = SIM_LCD_WIDTH; x > 0; x--) { if (*src) *dst |= dst_mask; -- cgit v1.2.3