summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/chartables.c102
-rw-r--r--firmware/drivers/lcd.c51
2 files changed, 153 insertions, 0 deletions
diff --git a/firmware/chartables.c b/firmware/chartables.c
index 0e61291b4d..e1f2c73b10 100644
--- a/firmware/chartables.c
+++ b/firmware/chartables.c
@@ -306,4 +306,106 @@ const unsigned char char_gen_12x16[][22] =
306 { 0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0x00,0x00 } 306 { 0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0xff,0x3f,0x00,0x00 }
307}; 307};
308 308
309#ifdef LCD_PROPFONTS
310unsigned char char_dw_8x8_prop[][9] = {
311 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x17}, /* 20 */
312 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 21 */
313 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 22 */
314 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 23 */
315 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 24 */
316 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 25 */
317 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 26 */
318 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 27 */
319 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 28 */
320 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 29 */
321 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2a */
322 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2b */
323 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2c */
324 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2d */
325 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2e */
326 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 2f */
327
328 { 0x7c,0x82,0x8a,0x7c,0x0,0x0,0x0,0x0,0x47 /* 0 0x30 */ },
329 { 0x84,0xfe,0x80,0x0,0x0,0x0,0x0,0x0,0x37 /* 1 */ },
330 { 0xe4,0x92,0x92,0x8c,0x0,0x0,0x0,0x0,0x47 /* 2 */ },
331 { 0x44,0x92,0x92,0x6c,0x0,0x0,0x0,0x0,0x47 /* 3 */ },
332 { 0x1e,0x10,0x10,0xfe,0x0,0x0,0x0,0x0,0x47 /* 4 */ },
333 { 0x4e,0x92,0x92,0x62,0x0,0x0,0x0,0x0,0x47 /* 5 */ },
334 { 0x7c,0x92,0x92,0x60,0x0,0x0,0x0,0x0,0x47 /* 6 */ },
335 { 0x2,0x12,0x12,0xfe,0x0,0x0,0x0,0x0,0x47 /* 7 */ },
336 { 0x6c,0x92,0x92,0x6c,0x0,0x0,0x0,0x0,0x47 /* 8 */ },
337 { 0xc,0x92,0x92,0x7c,0x0,0x0,0x0,0x0,0x47 /* 9 */ },
338
339 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3a */
340 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3b */
341 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3c */
342 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3d */
343 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3e */
344 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 3f */
345 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 40 */
346
347 { 0xfc,0x22,0x22,0xfc,0x0,0x0,0x0,0x0,0x47 /* A */ },
348 { 0xfe,0x92,0x92,0x6c,0x0,0x0,0x0,0x0,0x47 /* B */ },
349 { 0x7c,0x82,0x82,0x44,0x0,0x0,0x0,0x0,0x47 /* C */ },
350 { 0xfe,0x82,0x82,0x7c,0x0,0x0,0x0,0x0,0x47 /* D */ },
351 { 0xfe,0x92,0x92,0x82,0x0,0x0,0x0,0x0,0x47 /* E */ },
352 { 0xfe,0x12,0x12,0x2,0x0,0x0,0x0,0x0,0x47 /* F */ },
353 { 0x7c,0x82,0x92,0xf2,0x0,0x0,0x0,0x0,0x47 /* G */ },
354 { 0xfe,0x10,0x10,0xfe,0x0,0x0,0x0,0x0,0x47 /* H */ },
355 { 0x82,0xfe,0x82,0x0,0x0,0x0,0x0,0x0,0x37 /* I */ },
356 { 0x42,0x82,0x82,0x7e,0x0,0x0,0x0,0x0,0x47 /* J */ },
357 { 0xfe,0x10,0x28,0xc6,0x0,0x0,0x0,0x0,0x47 /* K */ },
358 { 0xfe,0x80,0x80,0x80,0x0,0x0,0x0,0x0,0x47 /* L */ },
359 { 0xfe,0x4,0x8,0x10,0x8,0x4,0xfe,0x0,0x77 /* M */ },
360 { 0xfe,0x2,0x2,0xfc,0x0,0x0,0x0,0x0,0x47 /* N */ },
361 { 0x7c,0x82,0x82,0x7c,0x0,0x0,0x0,0x0,0x47 /* O */ },
362 { 0xfe,0x12,0x12,0xc,0x0,0x0,0x0,0x0,0x47 /* P */ },
363 { 0x7c,0x82,0xa2,0x7c,0x40,0x80,0x0,0x0,0x67 /* Q */ },
364 { 0xfe,0x12,0x12,0xec,0x0,0x0,0x0,0x0,0x47 /* R */ },
365 { 0x8c,0x92,0x92,0x62,0x0,0x0,0x0,0x0,0x47 /* S */ },
366 { 0x2,0x2,0xfe,0x2,0x2,0x0,0x0,0x0,0x57 /* T */ },
367 { 0x7e,0x80,0x80,0x7e,0x0,0x0,0x0,0x0,0x47 /* U */ },
368 { 0x3e,0x40,0x80,0x40,0x3e,0x0,0x0,0x0,0x57 /* V */ },
369 { 0xfe,0x40,0x20,0x10,0x20,0x40,0xfe,0x0,0x77 /* W */ },
370 { 0xc6,0x28,0x10,0x28,0xc6,0x0,0x0,0x0,0x57 /* X */ },
371 { 0xe,0x10,0xe0,0x10,0xe,0x0,0x0,0x0,0x57 /* Y */ },
372 { 0xe2,0x92,0x92,0x8e,0x0,0x0,0x0,0x0,0x47 /* Z */ }, /* 5a */
373
374 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 5b */
375 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 5c */
376 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 5d */
377 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 5e */
378 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 5f */
379 { 0x00,0x00,0x00,0x00,0x0,0x0,0x0,0x00,0x0}, /* 60 */
380
381 { 0x40,0xa8,0xa8,0xa8,0xf0,0x0,0x0,0x0,0x55 /* a */ }, /* 61 */
382 { 0xfe,0x90,0x90,0x90,0x60,0x0,0x0,0x0,0x57 /* b */ },
383 { 0x70,0x88,0x88,0x88,0x0,0x0,0x0,0x0,0x45 /* c */ },
384 { 0x60,0x90,0x90,0x90,0x7e,0x0,0x0,0x0,0x57 /* d */ },
385 { 0x70,0xa8,0xa8,0xa8,0x10,0x0,0x0,0x0,0x55 /* e */ },
386 { 0x10,0xfc,0x12,0x2,0x0,0x0,0x0,0x0,0x47 /* f */ },
387 { 0x10,0xa8,0xa8,0xa8,0x78,0x0,0x0,0x0,0x55 /* g */ },
388 { 0xfe,0x10,0x10,0xe0,0x0,0x0,0x0,0x0,0x47 /* h */ },
389 { 0x88,0xfa,0x80,0x0,0x0,0x0,0x0,0x0,0x37 /* i */ },
390 { 0x40,0x80,0x88,0x7a,0x0,0x0,0x0,0x0,0x47 /* j */ },
391 { 0xfe,0x20,0x50,0x88,0x0,0x0,0x0,0x0,0x47 /* k */ },
392 { 0x82,0xfe,0x80,0x0,0x0,0x0,0x0,0x0,0x37 /* l */ },
393 { 0xf8,0x8,0x70,0x8,0xf8,0x0,0x0,0x0,0x55 /* m */ },
394 { 0xf8,0x8,0x8,0xf0,0x0,0x0,0x0,0x0,0x45 /* n */ },
395 { 0x70,0x88,0x88,0x70,0x0,0x0,0x0,0x0,0x45 /* o */ },
396 { 0xf8,0x28,0x28,0x10,0x0,0x0,0x0,0x0,0x45 /* p */ },
397 { 0x10,0x28,0x28,0xf8,0x0,0x0,0x0,0x0,0x45 /* q */ },
398 { 0xf8,0x10,0x8,0x8,0x0,0x0,0x0,0x0,0x45 /* r */ },
399 { 0x90,0xa8,0xa8,0x48,0x0,0x0,0x0,0x0,0x45 /* s */ },
400 { 0x8,0xfe,0x8,0x0,0x0,0x0,0x0,0x0,0x37 /* t */ },
401 { 0x78,0x80,0x80,0x78,0x0,0x0,0x0,0x0,0x45 /* u */ },
402 { 0x38,0x40,0x80,0x40,0x38,0x0,0x0,0x0,0x55 /* v */ },
403 { 0xf8,0x80,0x60,0x80,0xf8,0x0,0x0,0x0,0x55 /* w */ },
404 { 0xd8,0x20,0xd8,0x0,0x0,0x0,0x0,0x0,0x35 /* x */ },
405 { 0x18,0xa0,0xa0,0x78,0x0,0x0,0x0,0x0,0x45 /* y */ },
406 { 0xc8,0xa8,0x98,0x0,0x0,0x0,0x0,0x0,0x35 /* z */ } /* 7a */
407};
408
409#endif
410
309#endif /* HAVE_LCD_BITMAP || SIMULATOR */ 411#endif /* HAVE_LCD_BITMAP || SIMULATOR */
diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c
index 9ed24fdb22..d09d7ed1a5 100644
--- a/firmware/drivers/lcd.c
+++ b/firmware/drivers/lcd.c
@@ -488,6 +488,50 @@ void lcd_setmargins(int x, int y)
488 ymargin = y; 488 ymargin = y;
489} 489}
490 490
491#ifdef LCD_PROPFONTS
492
493extern unsigned char char_dw_8x8_prop[][9];
494
495/*
496 * Put a string at specified bit position
497 */
498
499void lcd_putspropxy(int x, int y, char *str, int thisfont)
500{
501 int ch;
502 int nx;
503 int ny=8;
504 unsigned char *src;
505 int lcd_x = x;
506 int lcd_y = y;
507
508 (void)thisfont;
509
510 while (((ch = *str++) != '\0') && (lcd_x + nx < LCD_WIDTH))
511 {
512 if (lcd_y + ny > LCD_HEIGHT)
513 return;
514
515 /* Limit to char generation table */
516 if ((ch < ASCII_MIN) || (ch > 0x7a))
517 /* replace unsupported letters with question marks */
518 ch = ' '-ASCII_MIN;
519 else
520 ch -= ASCII_MIN;
521
522 src = char_dw_8x8_prop[ch];
523
524 nx = char_dw_8x8_prop[ch][8] >> 4;
525
526 lcd_bitmap (src, lcd_x, lcd_y, nx, ny, true);
527
528 lcd_x += nx+1;
529
530 }
531}
532
533#endif
534
491/* 535/*
492 * Put a string at specified character position 536 * Put a string at specified character position
493 */ 537 */
@@ -507,9 +551,15 @@ void lcd_puts(int x, int y, char *str)
507 ymargin = 8; 551 ymargin = 8;
508#endif 552#endif
509 553
554#ifdef LCD_PROPFONTS
555 lcd_putspropxy( xmargin + x*fonts[font],
556 ymargin + y*fontheight[font],
557 str, font );
558#else
510 lcd_putsxy( xmargin + x*fonts[font], 559 lcd_putsxy( xmargin + x*fonts[font],
511 ymargin + y*fontheight[font], 560 ymargin + y*fontheight[font],
512 str, font ); 561 str, font );
562#endif
513#if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS) 563#if defined(SIMULATOR) && defined(HAVE_LCD_CHARCELLS)
514 /* this function is being used when simulating a charcell LCD and 564 /* this function is being used when simulating a charcell LCD and
515 then we update immediately */ 565 then we update immediately */
@@ -517,6 +567,7 @@ void lcd_puts(int x, int y, char *str)
517#endif 567#endif
518} 568}
519 569
570
520/* 571/*
521 * Put a string at specified bit position 572 * Put a string at specified bit position
522 */ 573 */