summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-26 07:52:13 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-26 07:52:13 +0000
commitad4e3d665734b14a28f1ba5fa874663772dab3e7 (patch)
treebff44652495f1319a4d11ed63b3d4e90cb11197f /apps/screens.c
parent165f62d0cd771660e4b8d2ba7475e14d0d6f2e9f (diff)
downloadrockbox-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 'apps/screens.c')
-rw-r--r--apps/screens.c26
1 files changed, 13 insertions, 13 deletions
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)
254} 254}
255#else /* not HAVE_LCD_BITMAP */ 255#else /* not HAVE_LCD_BITMAP */
256 256
257static unsigned char logo_chars[5]; 257static unsigned long logo_chars[4];
258static const unsigned char logo_pattern[] = { 258static const unsigned char logo_pattern[] = {
259 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, /* char 1 */ 259 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */
260 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 2 */ 260 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */
261 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 3 */ 261 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */
262 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, /* char 4 */ 262 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */
263}; 263};
264 264
265static void logo_lock_patterns(bool on) 265static void logo_lock_patterns(bool on)
@@ -270,7 +270,6 @@ static void logo_lock_patterns(bool on)
270 { 270 {
271 for (i = 0; i < 4; i++) 271 for (i = 0; i < 4; i++)
272 logo_chars[i] = lcd_get_locked_pattern(); 272 logo_chars[i] = lcd_get_locked_pattern();
273 logo_chars[4] = '\0';
274 } 273 }
275 else 274 else
276 { 275 {
@@ -284,19 +283,20 @@ static void charging_display_info(bool animate)
284 int battv; 283 int battv;
285 unsigned i, ypos; 284 unsigned i, ypos;
286 static unsigned phase = 3; 285 static unsigned phase = 3;
287 char buf[28]; 286 char buf[32];
288 287
289 battv = battery_voltage(); 288 battv = battery_voltage();
290 snprintf(buf, sizeof(buf), "%s %d.%02dV", logo_chars, 289 snprintf(buf, sizeof(buf), " %d.%02dV", battv / 100, battv % 100);
291 battv / 100, battv % 100); 290 lcd_puts(4, 1, buf);
292 lcd_puts(0, 1, buf);
293 291
294 memcpy(buf, logo_pattern, 28); /* copy logo patterns */ 292 memcpy(buf, logo_pattern, 32); /* copy logo patterns */
295 293
296 if (!animate) /* build the screen */ 294 if (!animate) /* build the screen */
297 { 295 {
298 lcd_double_height(false); 296 lcd_double_height(false);
299 lcd_puts(0, 0, "[Charging]"); 297 lcd_puts(0, 0, "[Charging]");
298 for (i = 0; i < 4; i++)
299 lcd_putc(i, 1, logo_chars[i]);
300 } 300 }
301 else /* animate the logo */ 301 else /* animate the logo */
302 { 302 {
@@ -307,14 +307,14 @@ static void charging_display_info(bool animate)
307 ypos = (phase + i/5) % 9; /* "bounce" effect */ 307 ypos = (phase + i/5) % 9; /* "bounce" effect */
308 if (ypos > 4) 308 if (ypos > 4)
309 ypos = 8 - ypos; 309 ypos = 8 - ypos;
310 buf[5 - ypos + 7 * (i/5)] |= 0x10 >> (i%5); 310 buf[5 - ypos + 8 * (i/5)] |= 0x10 >> (i%5);
311 } 311 }
312 } 312 }
313 phase++; 313 phase++;
314 } 314 }
315 315
316 for (i = 0; i < 4; i++) 316 for (i = 0; i < 4; i++)
317 lcd_define_pattern(logo_chars[i], buf + 7 * i); 317 lcd_define_pattern(logo_chars[i], buf + 8 * i);
318} 318}
319#endif /* (not) HAVE_LCD_BITMAP */ 319#endif /* (not) HAVE_LCD_BITMAP */
320 320