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 --- apps/screens.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'apps/screens.c') diff --git a/apps/screens.c b/apps/screens.c index df1d59109b..f6def2fd89 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -254,12 +254,12 @@ static void charging_display_info(bool animate) } #else /* not HAVE_LCD_BITMAP */ -static unsigned char logo_chars[5]; +static unsigned long logo_chars[4]; static const unsigned char logo_pattern[] = { - 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, /* char 1 */ - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 2 */ - 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 3 */ - 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, /* char 4 */ + 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */ + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */ + 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */ + 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */ }; static void logo_lock_patterns(bool on) @@ -270,7 +270,6 @@ static void logo_lock_patterns(bool on) { for (i = 0; i < 4; i++) logo_chars[i] = lcd_get_locked_pattern(); - logo_chars[4] = '\0'; } else { @@ -284,19 +283,20 @@ static void charging_display_info(bool animate) int battv; unsigned i, ypos; static unsigned phase = 3; - char buf[28]; + char buf[32]; battv = battery_voltage(); - snprintf(buf, sizeof(buf), "%s %d.%02dV", logo_chars, - battv / 100, battv % 100); - lcd_puts(0, 1, buf); + snprintf(buf, sizeof(buf), " %d.%02dV", battv / 100, battv % 100); + lcd_puts(4, 1, buf); - memcpy(buf, logo_pattern, 28); /* copy logo patterns */ + memcpy(buf, logo_pattern, 32); /* copy logo patterns */ if (!animate) /* build the screen */ { lcd_double_height(false); lcd_puts(0, 0, "[Charging]"); + for (i = 0; i < 4; i++) + lcd_putc(i, 1, logo_chars[i]); } else /* animate the logo */ { @@ -307,14 +307,14 @@ static void charging_display_info(bool animate) ypos = (phase + i/5) % 9; /* "bounce" effect */ if (ypos > 4) ypos = 8 - ypos; - buf[5 - ypos + 7 * (i/5)] |= 0x10 >> (i%5); + buf[5 - ypos + 8 * (i/5)] |= 0x10 >> (i%5); } } phase++; } for (i = 0; i < 4; i++) - lcd_define_pattern(logo_chars[i], buf + 7 * i); + lcd_define_pattern(logo_chars[i], buf + 8 * i); } #endif /* (not) HAVE_LCD_BITMAP */ -- cgit v1.2.3