diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-03-26 07:52:13 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-03-26 07:52:13 +0000 |
commit | ad4e3d665734b14a28f1ba5fa874663772dab3e7 (patch) | |
tree | bff44652495f1319a4d11ed63b3d4e90cb11197f /uisimulator | |
parent | 165f62d0cd771660e4b8d2ba7475e14d0d6f2e9f (diff) | |
download | rockbox-ad4e3d665734b14a28f1ba5fa874663772dab3e7.tar.gz rockbox-ad4e3d665734b14a28f1ba5fa874663772dab3e7.zip |
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
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/common/lcd-playersim.c | 9 | ||||
-rw-r--r-- | uisimulator/sdl/lcd-charcell.c | 20 |
2 files changed, 15 insertions, 14 deletions
diff --git a/uisimulator/common/lcd-playersim.c b/uisimulator/common/lcd-playersim.c index 0e10acf437..4c658438d6 100644 --- a/uisimulator/common/lcd-playersim.c +++ b/uisimulator/common/lcd-playersim.c @@ -51,8 +51,8 @@ void lcd_print_icon(int x, int icon_line, bool enable, char **icon) int row=0, col; int p=0, cp=0; - struct coordinate points[LCD_WIDTH * LCD_HEIGHT]; - struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; + struct coordinate points[SIM_LCD_WIDTH * SIM_LCD_HEIGHT]; + struct coordinate clearpoints[SIM_LCD_WIDTH * SIM_LCD_HEIGHT]; while (icon[row]) { col=0; @@ -221,16 +221,15 @@ void lcd_double_height(bool on) lcd_update(); } -void lcd_define_hw_pattern(int which, const char *pattern, int length) +void lcd_define_hw_pattern(int pat, const char *pattern) { int i, j; - int pat = which / 8; unsigned char icon[8]; memset(icon, 0, sizeof icon); DEBUGF("Defining pattern %d:", pat); for (j = 0; j <= 5; j++) { - for (i = 0; i < length; i++) { + for (i = 0; i < 7; i++) { if ((pattern[i])&(1<<(j))) icon[5-j] |= (1<<(i)); } 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<<LCD_DEPTH)); @@ -142,10 +144,10 @@ void sim_lcd_init(void) #define BMP_COMPRESSION 0 /* BI_RGB */ #define BMP_NUMCOLORS (1 << LCD_DEPTH) #define BMP_BPP 1 -#define BMP_LINESIZE (((LCD_WIDTH + 31) / 32) * 4) +#define BMP_LINESIZE (((SIM_LCD_WIDTH + 31) / 32) * 4) #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) -#define BMP_DATASIZE (BMP_LINESIZE * LCD_HEIGHT) +#define BMP_DATASIZE (BMP_LINESIZE * SIM_LCD_HEIGHT) #define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) #define LE16_CONST(x) (x)&0xff, ((x)>>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; |