From 7ec047c3a404320ef40ca5812ae5e542e35f0cc2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 30 May 2002 06:49:39 +0000 Subject: [PATCH] The recorder's lcd_putsxy() will now output '?' instead of just skipping unknown characters. I think we will need a rather full ISO-8859-1 character set. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@809 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/firmware/drivers/lcd.c b/firmware/drivers/lcd.c index 7d53021206..21362918c8 100644 --- a/firmware/drivers/lcd.c +++ b/firmware/drivers/lcd.c @@ -501,20 +501,24 @@ void lcd_putsxy(int x, int y, char *str, int thisfont) return; /* Limit to char generation table */ - if (ch >= ASCII_MIN && ch <= ASCII_MAX) - { - if (nx == 12) - src = char_gen_12x16[ch-ASCII_MIN][0]; - else if (nx == 8) - src = char_gen_8x12[ch-ASCII_MIN][0]; - else - src = char_gen_6x8[ch-ASCII_MIN][0]; + if ((ch < ASCII_MIN) || (ch > ASCII_MAX)) + /* replace unsupported letters with question marks */ + ch = '?' - ASCII_MIN; + else + ch -= ASCII_MIN; + + if (thisfont == 2) + src = char_gen_12x16[ch][0]; + else if (thisfont == 1) + src = char_gen_8x12[ch][0]; + else + src = char_gen_6x8[ch][0]; + + lcd_bitmap (src, lcd_x, lcd_y, nx-1, ny, true); + lcd_bitmap (zeros, lcd_x+nx-1, lcd_y, 1, ny, true); - lcd_bitmap (src, lcd_x, lcd_y, nx-1, ny, true); - lcd_bitmap (zeros, lcd_x+nx-1, lcd_y, 1, ny, true); + lcd_x += nx; - lcd_x += nx; - } } }