summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/icon.h4
-rw-r--r--apps/player/icons.h4
-rw-r--r--apps/player/keyboard.c66
-rw-r--r--apps/plugin.c6
-rw-r--r--apps/plugin.h22
-rw-r--r--apps/plugins/euroconverter.c35
-rw-r--r--apps/plugins/flipit.c2
-rw-r--r--apps/plugins/jackpot.c12
-rw-r--r--apps/plugins/lib/playergfx.c2
-rw-r--r--apps/plugins/nim.c20
-rw-r--r--apps/screen_access.c40
-rw-r--r--apps/screen_access.h21
-rw-r--r--apps/screens.c26
-rw-r--r--firmware/SOURCES5
-rw-r--r--firmware/drivers/lcd-charcell.c612
-rw-r--r--firmware/drivers/lcd-charset-player.c594
-rw-r--r--firmware/drivers/lcd-player-charset.c751
-rw-r--r--firmware/drivers/lcd-player.c830
-rw-r--r--firmware/export/config-player.h9
-rw-r--r--firmware/export/lcd-charcell.h41
-rw-r--r--firmware/export/lcd-player-charset.h27
-rw-r--r--firmware/export/lcd.h63
-rw-r--r--firmware/target/sh/archos/player/lcd-player.c235
-rwxr-xr-xtools/configure2
-rw-r--r--uisimulator/common/lcd-playersim.c9
-rw-r--r--uisimulator/sdl/lcd-charcell.c20
26 files changed, 1652 insertions, 1806 deletions
diff --git a/apps/gui/icon.h b/apps/gui/icon.h
index e21db7a133..9ceda9e933 100644
--- a/apps/gui/icon.h
+++ b/apps/gui/icon.h
@@ -26,13 +26,13 @@
26typedef const unsigned char * ICON; 26typedef const unsigned char * ICON;
27#define NOICON NULL 27#define NOICON NULL
28#else 28#else
29typedef short ICON; 29typedef long ICON;
30#define NOICON -1 30#define NOICON -1
31#endif 31#endif
32 32
33#define Icon_NOICON -1 33#define Icon_NOICON -1
34 34
35#define CURSOR_CHAR 0x92 35#define CURSOR_CHAR 0xe10c
36#define CURSOR_WIDTH 6 36#define CURSOR_WIDTH 6
37#define CURSOR_HEIGHT 8 37#define CURSOR_HEIGHT 8
38 38
diff --git a/apps/player/icons.h b/apps/player/icons.h
index 32a6adf75a..5df94b09e3 100644
--- a/apps/player/icons.h
+++ b/apps/player/icons.h
@@ -30,8 +30,8 @@
30enum { 30enum {
31 Icon_Queued = 'Q', 31 Icon_Queued = 'Q',
32 Icon_Moving = 'M', 32 Icon_Moving = 'M',
33 Icon_Unknown = 0x90, 33 Icon_Unknown = 0xe100,
34 Icon_Bookmark = 0x16, 34 Icon_Bookmark,
35 Icon_Plugin, 35 Icon_Plugin,
36 Icon_Folder, 36 Icon_Folder,
37 Icon_Firmware, 37 Icon_Firmware,
diff --git a/apps/player/keyboard.c b/apps/player/keyboard.c
index 380edd5e95..791693f9fe 100644
--- a/apps/player/keyboard.c
+++ b/apps/player/keyboard.c
@@ -31,53 +31,46 @@
31#include "misc.h" 31#include "misc.h"
32#include "rbunicode.h" 32#include "rbunicode.h"
33 33
34#define KBD_BUF_SIZE 64
34#define KEYBOARD_PAGES 3 35#define KEYBOARD_PAGES 3
35 36
36extern unsigned short *lcd_ascii; 37static unsigned short *kbd_setupkeys(int page, int* len)
37
38static unsigned char* kbd_setupkeys(int page, int* len)
39{ 38{
40 static unsigned char lines[128]; 39 static unsigned short kbdline[KBD_BUF_SIZE];
41 40 const unsigned char *p;
42 unsigned ch;
43 int i = 0; 41 int i = 0;
44 42
45 switch (page) 43 switch (page)
46 { 44 {
47 case 0: /* Capitals */ 45 case 0: /* Capitals */
48 for (ch = 'A'; ch <= 'Z'; ch++) 46 p = "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅ"
49 lines[i++] = ch; 47 "ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÝ";
50 for (ch = 0xc0; ch <= 0xdd; ch++)
51 if (lcd_ascii[ch] != NOCHAR_NEW && lcd_ascii[ch] != NOCHAR_OLD)
52 lines[i++] = ch;
53 break; 48 break;
54 49
55 case 1: /* Small */ 50 case 1: /* Small */
56 for (ch = 'a'; ch <= 'z'; ch++) 51 p = "abcdefghijklmnopqrstuvwxyzßàáâãä"
57 lines[i++] = ch; 52 "åçèéêëìíîïñòóôöøùúûüýÿ";
58 for (ch = 0xdf; ch <= 0xff; ch++)
59 if (lcd_ascii[ch] != NOCHAR_NEW && lcd_ascii[ch] != NOCHAR_OLD)
60 lines[i++] = ch;
61 break; 53 break;
62 54
63 case 2: /* Others */ 55 default: /* Others */
64 for (ch = ' '; ch <= '@'; ch++) 56 p = " !\"#$%&'()*+,-./0123456789:;<=>?@[]_{}~";
65 lines[i++] = ch;
66 break; 57 break;
67 } 58 }
68 59
69 lines[i] = 0; 60 while (*p)
61 p = utf8decode(p, &kbdline[i++]);
62
70 *len = i; 63 *len = i;
71 64
72 return lines; 65 return kbdline;
73} 66}
74 67
75/* Delimiters for highlighting the character selected for insertion */ 68/* Delimiters for highlighting the character selected for insertion */
76#define KEYBOARD_INSERT_LEFT 0x81 69#define KEYBOARD_INSERT_LEFT 0xe110
77#define KEYBOARD_INSERT_RIGHT 0x82 70#define KEYBOARD_INSERT_RIGHT 0xe10f
78 71
79#define KEYBOARD_CURSOR 0x7f 72#define KEYBOARD_CURSOR 0x7f
80#define KEYBOARD_ARROW 0x92 73#define KEYBOARD_ARROW 0xe10c
81 74
82/* helper function to spell a char if voice UI is enabled */ 75/* helper function to spell a char if voice UI is enabled */
83static void kbd_spellchar(char c) 76static void kbd_spellchar(char c)
@@ -101,9 +94,8 @@ int kbd_input(char* text, int buflen)
101 94
102 int len, len_utf8, i, j; 95 int len, len_utf8, i, j;
103 int editpos, curpos, leftpos; 96 int editpos, curpos, leftpos;
104 unsigned char *line = kbd_setupkeys(page, &linelen); 97 unsigned short *line = kbd_setupkeys(page, &linelen);
105 unsigned char temptext[36]; 98 unsigned char temptext[36];
106 unsigned char tmp;
107 unsigned char *utf8; 99 unsigned char *utf8;
108 100
109 int button, lastbutton = 0; 101 int button, lastbutton = 0;
@@ -130,20 +122,14 @@ int kbd_input(char* text, int buflen)
130 lcd_putc(0, 0, KEYBOARD_ARROW); 122 lcd_putc(0, 0, KEYBOARD_ARROW);
131 lcd_putc(0, 1, ' '); 123 lcd_putc(0, 1, ' ');
132 } 124 }
133 125
134 /* Draw insert chars */ 126 lcd_putc(1, 0, KEYBOARD_INSERT_LEFT);
135 utf8 = temptext; 127 lcd_putc(2, 0, line[x]);
136 tmp = KEYBOARD_INSERT_LEFT; 128 lcd_putc(3, 0, KEYBOARD_INSERT_RIGHT);
137 utf8 = iso_decode(&tmp, utf8, 0, 1);
138 utf8 = iso_decode(&line[x], utf8, 0, 1);
139 tmp = KEYBOARD_INSERT_RIGHT;
140 utf8 = iso_decode(&tmp, utf8, 0, 1);
141 for (i = 1; i < 8; i++) 129 for (i = 1; i < 8; i++)
142 { 130 {
143 utf8 = iso_decode(&line[(x+i)%linelen], utf8, 0, 1); 131 lcd_putc(i + 3, 0, line[(x+i)%linelen]);
144 } 132 }
145 *utf8 = 0;
146 lcd_puts(1, 0, temptext);
147 133
148 /* write out the text */ 134 /* write out the text */
149 curpos = MIN(MIN(editpos, 10 - MIN(len_utf8 - editpos, 3)), 9); 135 curpos = MIN(MIN(editpos, 10 - MIN(len_utf8 - editpos, 3)), 9);
@@ -175,7 +161,7 @@ int kbd_input(char* text, int buflen)
175 lcd_remove_cursor(); 161 lcd_remove_cursor();
176 lcd_puts(1, 1, temptext); 162 lcd_puts(1, 1, temptext);
177 lcd_put_cursor(curpos + 1, 1, KEYBOARD_CURSOR); 163 lcd_put_cursor(curpos + 1, 1, KEYBOARD_CURSOR);
178 164
179 gui_syncstatusbar_draw(&statusbars, true); 165 gui_syncstatusbar_draw(&statusbars, true);
180 } 166 }
181 167
@@ -270,7 +256,7 @@ int kbd_input(char* text, int buflen)
270 } 256 }
271 else /* inserts the selected char */ 257 else /* inserts the selected char */
272 { 258 {
273 utf8 = iso_decode((unsigned char*)&line[x], temptext, 0, 1); 259 utf8 = utf8encode(line[x], temptext);
274 *utf8 = 0; 260 *utf8 = 0;
275 j = strlen(temptext); 261 j = strlen(temptext);
276 if (len + j < buflen) 262 if (len + j < buflen)
diff --git a/apps/plugin.c b/apps/plugin.c
index 7a2ce00e23..de04269a89 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -67,6 +67,9 @@ static const struct plugin_api rockbox_api = {
67 /* lcd */ 67 /* lcd */
68 lcd_set_contrast, 68 lcd_set_contrast,
69 lcd_clear_display, 69 lcd_clear_display,
70 lcd_setmargins,
71 lcd_getstringsize,
72 lcd_putsxy,
70 lcd_puts, 73 lcd_puts,
71 lcd_puts_scroll, 74 lcd_puts_scroll,
72 lcd_stop_scroll, 75 lcd_stop_scroll,
@@ -80,11 +83,9 @@ static const struct plugin_api rockbox_api = {
80 PREFIX(lcd_icon), 83 PREFIX(lcd_icon),
81 lcd_double_height, 84 lcd_double_height,
82#else 85#else
83 lcd_setmargins,
84 lcd_set_drawmode, 86 lcd_set_drawmode,
85 lcd_get_drawmode, 87 lcd_get_drawmode,
86 lcd_setfont, 88 lcd_setfont,
87 lcd_getstringsize,
88 lcd_drawpixel, 89 lcd_drawpixel,
89 lcd_drawline, 90 lcd_drawline,
90 lcd_hline, 91 lcd_hline,
@@ -109,7 +110,6 @@ static const struct plugin_api rockbox_api = {
109 bidi_l2v, 110 bidi_l2v,
110 font_get_bits, 111 font_get_bits,
111 font_load, 112 font_load,
112 lcd_putsxy,
113 lcd_puts_style, 113 lcd_puts_style,
114 lcd_puts_scroll_style, 114 lcd_puts_scroll_style,
115 &lcd_framebuffer[0][0], 115 &lcd_framebuffer[0][0],
diff --git a/apps/plugin.h b/apps/plugin.h
index dbe79368da..7688057d86 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -29,7 +29,7 @@
29#define MEM 2 29#define MEM 2
30#endif 30#endif
31 31
32#include <stdbool.h> 32#include <stdbool.h>
33#include <sys/types.h> 33#include <sys/types.h>
34#include <stdarg.h> 34#include <stdarg.h>
35#include <stdio.h> 35#include <stdio.h>
@@ -110,12 +110,12 @@
110#define PLUGIN_MAGIC 0x526F634B /* RocK */ 110#define PLUGIN_MAGIC 0x526F634B /* RocK */
111 111
112/* increase this every time the api struct changes */ 112/* increase this every time the api struct changes */
113#define PLUGIN_API_VERSION 49 113#define PLUGIN_API_VERSION 50
114 114
115/* update this to latest version if a change to the api struct breaks 115/* update this to latest version if a change to the api struct breaks
116 backwards compatibility (and please take the opportunity to sort in any 116 backwards compatibility (and please take the opportunity to sort in any
117 new function which are "waiting" at the end of the function table) */ 117 new function which are "waiting" at the end of the function table) */
118#define PLUGIN_MIN_API_VERSION 47 118#define PLUGIN_MIN_API_VERSION 50
119 119
120/* plugin return codes */ 120/* plugin return codes */
121enum plugin_status { 121enum plugin_status {
@@ -135,24 +135,25 @@ struct plugin_api {
135 /* lcd */ 135 /* lcd */
136 void (*lcd_set_contrast)(int x); 136 void (*lcd_set_contrast)(int x);
137 void (*lcd_clear_display)(void); 137 void (*lcd_clear_display)(void);
138 void (*lcd_setmargins)(int x, int y);
139 int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
140 void (*lcd_putsxy)(int x, int y, const unsigned char *string);
138 void (*lcd_puts)(int x, int y, const unsigned char *string); 141 void (*lcd_puts)(int x, int y, const unsigned char *string);
139 void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); 142 void (*lcd_puts_scroll)(int x, int y, const unsigned char* string);
140 void (*lcd_stop_scroll)(void); 143 void (*lcd_stop_scroll)(void);
141#ifdef HAVE_LCD_CHARCELLS 144#ifdef HAVE_LCD_CHARCELLS
142 void (*lcd_define_pattern)(int which,const char *pattern); 145 void (*lcd_define_pattern)(unsigned long ucs, const char *pattern);
143 unsigned char (*lcd_get_locked_pattern)(void); 146 unsigned long (*lcd_get_locked_pattern)(void);
144 void (*lcd_unlock_pattern)(unsigned char pat); 147 void (*lcd_unlock_pattern)(unsigned long ucs);
145 void (*lcd_putc)(int x, int y, unsigned short ch); 148 void (*lcd_putc)(int x, int y, unsigned long ucs);
146 void (*lcd_put_cursor)(int x, int y, char cursor_char); 149 void (*lcd_put_cursor)(int x, int y, unsigned long ucs);
147 void (*lcd_remove_cursor)(void); 150 void (*lcd_remove_cursor)(void);
148 void (*PREFIX(lcd_icon))(int icon, bool enable); 151 void (*PREFIX(lcd_icon))(int icon, bool enable);
149 void (*lcd_double_height)(bool on); 152 void (*lcd_double_height)(bool on);
150#else 153#else
151 void (*lcd_setmargins)(int x, int y);
152 void (*lcd_set_drawmode)(int mode); 154 void (*lcd_set_drawmode)(int mode);
153 int (*lcd_get_drawmode)(void); 155 int (*lcd_get_drawmode)(void);
154 void (*lcd_setfont)(int font); 156 void (*lcd_setfont)(int font);
155 int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
156 void (*lcd_drawpixel)(int x, int y); 157 void (*lcd_drawpixel)(int x, int y);
157 void (*lcd_drawline)(int x1, int y1, int x2, int y2); 158 void (*lcd_drawline)(int x1, int y1, int x2, int y2);
158 void (*lcd_hline)(int x1, int x2, int y); 159 void (*lcd_hline)(int x1, int x2, int y);
@@ -184,7 +185,6 @@ struct plugin_api {
184 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); 185 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
185 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); 186 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
186 struct font* (*font_load)(const char *path); 187 struct font* (*font_load)(const char *path);
187 void (*lcd_putsxy)(int x, int y, const unsigned char *string);
188 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); 188 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
189 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, 189 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
190 int style); 190 int style);
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c
index 3cf36affea..97ec21dd98 100644
--- a/apps/plugins/euroconverter.c
+++ b/apps/plugins/euroconverter.c
@@ -138,7 +138,7 @@ static unsigned char *abbrev_str[12] = {
138 }; 138 };
139 139
140 140
141static unsigned char heuro,hhome; /*Handles for the new patterns*/ 141static unsigned long heuro,hhome; /*Handles for the new patterns*/
142 142
143static struct plugin_api* rb; 143static struct plugin_api* rb;
144 144
@@ -239,7 +239,6 @@ static void round(longlong_t* i, longlong_t* f, int n)
239*/ 239*/
240static void display(longlong_t euro, longlong_t home, bool pos) 240static void display(longlong_t euro, longlong_t home, bool pos)
241{ 241{
242 char c1,c2;
243 longlong_t i,f; 242 longlong_t i,f;
244 unsigned char str[20]; 243 unsigned char str[20];
245 unsigned char s1[20]; 244 unsigned char s1[20];
@@ -247,52 +246,50 @@ static void display(longlong_t euro, longlong_t home, bool pos)
247 246
248 if (pos) 247 if (pos)
249 { /*Edit the second line*/ 248 { /*Edit the second line*/
250 c1=0x20; 249 rb->strcpy(s1," %6d.%02d");
251 rb->strcpy(s1,"%c%c%6d.%02d");
252 c2=0x81;
253 if (nb_digit[country]==2) 250 if (nb_digit[country]==2)
254 rb->strcpy(s2,"%c%c%06d.%02d"); 251 rb->strcpy(s2,"\xee\x84\x90%06d.%02d");
255 else 252 else
256 rb->strcpy(s2,"%c%c%09d"); 253 rb->strcpy(s2,"\xee\x84\x90%09d");
257 } 254 }
258 else 255 else
259 { 256 {
260 c1=0x81; 257 rb->strcpy(s1,"\xee\x84\x90%06d.%02d");
261 rb->strcpy(s1,"%c%c%06d.%02d");
262 c2=0x20;
263 if (nb_digit[country]==2) 258 if (nb_digit[country]==2)
264 rb->strcpy(s2,"%c%c%6d.%02d"); 259 rb->strcpy(s2," %6d.%02d");
265 else 260 else
266 rb->strcpy(s2,"%c%c%9d"); 261 rb->strcpy(s2," %9d");
267 } 262 }
268 263
269 rb->lcd_remove_cursor(); 264 rb->lcd_remove_cursor();
270 /*First line*/ 265 /*First line*/
266 rb->lcd_putc(0,0,heuro);
271 split(euro,&i,&f); 267 split(euro,&i,&f);
272 if (pos) 268 if (pos)
273 round(&i,&f,2); 269 round(&i,&f,2);
274 rb->snprintf(str,sizeof(str),s1,heuro,c1,(int)i,(int)f); 270 rb->snprintf(str,sizeof(str),s1,(int)i,(int)f);
275 271
276 if (!pos) 272 if (!pos)
277 { 273 {
278 rb->lcd_puts(0,0,str); 274 rb->lcd_puts(1,0,str);
279 rb->lcd_put_cursor(10-cur_pos,0,0x5F); 275 rb->lcd_put_cursor(10-cur_pos,0,0x5F);
280 } 276 }
281 else 277 else
282 rb->lcd_puts_scroll(0,0,str); 278 rb->lcd_puts_scroll(1,0,str);
283 279
284 /*Second line*/ 280 /*Second line*/
281 rb->lcd_putc(0,1,hhome);
285 split(home,&i,&f); 282 split(home,&i,&f);
286 if (!pos) 283 if (!pos)
287 round(&i,&f,nb_digit[country]); 284 round(&i,&f,nb_digit[country]);
288 rb->snprintf(str,sizeof(str),s2,hhome,c2,(int)i,(int)f); 285 rb->snprintf(str,sizeof(str),s2,(int)i,(int)f);
289 if (pos) 286 if (pos)
290 { 287 {
291 rb->lcd_puts(0,1,str); 288 rb->lcd_puts(1,1,str);
292 rb->lcd_put_cursor(10-cur_pos,1,0x5F); 289 rb->lcd_put_cursor(10-cur_pos,1,0x5F);
293 } 290 }
294 else 291 else
295 rb->lcd_puts_scroll(0,1,str); 292 rb->lcd_puts_scroll(1,1,str);
296} 293}
297 294
298 295
@@ -363,7 +360,7 @@ static int euro_menu(void)
363 rb->lcd_clear_display(); 360 rb->lcd_clear_display();
364 rb->lcd_puts(0,0," Currency"); 361 rb->lcd_puts(0,0," Currency");
365 rb->lcd_puts(0,1," Exit"); 362 rb->lcd_puts(0,1," Exit");
366 rb->lcd_putc(0,c,0x81); 363 rb->lcd_putc(0,c,0xe110);
367 364
368 switch (rb->button_get(true)) 365 switch (rb->button_get(true))
369 { 366 {
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index fd02bc4789..91afc9eca7 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -203,7 +203,7 @@ static const unsigned char tk_pat[4][7] = {
203}; 203};
204 204
205static unsigned char cur_pat[7]; 205static unsigned char cur_pat[7];
206static unsigned char gfx_chars[5]; 206static unsigned long gfx_chars[5];
207 207
208static void release_gfx(void) 208static void release_gfx(void)
209{ 209{
diff --git a/apps/plugins/jackpot.c b/apps/plugins/jackpot.c
index a2ebb81f5c..37ee4514e7 100644
--- a/apps/plugins/jackpot.c
+++ b/apps/plugins/jackpot.c
@@ -47,7 +47,7 @@ static unsigned char pattern[]={
47}; 47};
48 48
49static unsigned char str[12]; /*Containt the first line*/ 49static unsigned char str[12]; /*Containt the first line*/
50static unsigned char h1,h2,h3; /*Handle for the pattern*/ 50static unsigned long h1,h2,h3; /*Handle for the pattern*/
51 51
52/* here is a global api struct pointer. while not strictly necessary, 52/* here is a global api struct pointer. while not strictly necessary,
53 it's nice not to have to pass the api pointer in all function calls 53 it's nice not to have to pass the api pointer in all function calls
@@ -109,10 +109,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
109 rb->lcd_define_pattern(h1, pattern); 109 rb->lcd_define_pattern(h1, pattern);
110 rb->lcd_define_pattern(h2, pattern+7); 110 rb->lcd_define_pattern(h2, pattern+7);
111 rb->lcd_define_pattern(h3, pattern+28); 111 rb->lcd_define_pattern(h3, pattern+28);
112 rb->snprintf(str,sizeof(str),"%c%cJackpot%c%c",h1,h2,h2,h1); 112
113 rb->lcd_puts(0,0,str); 113 rb->lcd_puts(0,0," Jackpot ");
114 rb->snprintf(str,sizeof(str)," %c V1.1 %c",h3,h3); 114 rb->lcd_putc(0,0,h1); rb->lcd_putc(1,0,h2);
115 rb->lcd_puts(0,1,str); 115 rb->lcd_putc(9,0,h2); rb->lcd_putc(10,0,h1);
116 rb->lcd_puts(0,1," V1.1 ");
117 rb->lcd_putc(1,1,h3); rb->lcd_putc(9,1,h3);
116 rb->sleep(HZ*2); 118 rb->sleep(HZ*2);
117 rb->lcd_clear_display(); 119 rb->lcd_clear_display();
118 120
diff --git a/apps/plugins/lib/playergfx.c b/apps/plugins/lib/playergfx.c
index 1df7a3be4c..0e0a5d3788 100644
--- a/apps/plugins/lib/playergfx.c
+++ b/apps/plugins/lib/playergfx.c
@@ -31,7 +31,7 @@ static int char_width;
31static int char_height; 31static int char_height;
32static int pixel_height; 32static int pixel_height;
33static int pixel_width; 33static int pixel_width;
34static unsigned char gfx_chars[8]; 34static unsigned long gfx_chars[8];
35static unsigned char gfx_buffer[56]; 35static unsigned char gfx_buffer[56];
36static int drawmode = DRMODE_SOLID; 36static int drawmode = DRMODE_SOLID;
37 37
diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c
index b309e296c0..9089cad00a 100644
--- a/apps/plugins/nim.c
+++ b/apps/plugins/nim.c
@@ -56,7 +56,7 @@ static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2
56static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/ 56static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/
57 57
58static unsigned char str[12]; /*String use to display the first line*/ 58static unsigned char str[12]; /*String use to display the first line*/
59static unsigned char hsmile,hcry,h1,h2; /*Handle for the new pattern*/ 59static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/
60 60
61static bool end; /*If true game is finished*/ 61static bool end; /*If true game is finished*/
62static struct plugin_api* rb; 62static struct plugin_api* rb;
@@ -74,8 +74,8 @@ static void impossible(void)
74static void lose(void) 74static void lose(void)
75{ 75{
76 rb->lcd_define_pattern(hsmile,smile); 76 rb->lcd_define_pattern(hsmile,smile);
77 rb->snprintf(str,sizeof(str),"You Win!!%c",hsmile); 77 rb->lcd_puts(0,1,"You Win!!");
78 rb->lcd_puts(0,1,str); 78 rb->lcd_putc(8,1,hsmile);
79 end=true; 79 end=true;
80 rb->sleep(HZ*2); 80 rb->sleep(HZ*2);
81 return; 81 return;
@@ -86,8 +86,8 @@ static void lose(void)
86static void win(void) 86static void win(void)
87{ 87{
88 rb->lcd_define_pattern(hcry,cry); 88 rb->lcd_define_pattern(hcry,cry);
89 rb->snprintf(str,sizeof(str),"You Lose!!%c",hcry); 89 rb->lcd_puts(0,1,"You Lose!!");
90 rb->lcd_puts(0,1,str); 90 rb->lcd_putc(9,1,hcry);
91 end=true; 91 end=true;
92 rb->sleep(HZ*2); 92 rb->sleep(HZ*2);
93 return; 93 return;
@@ -100,22 +100,22 @@ static void display_first_line(int x)
100 int i; 100 int i;
101 101
102 rb->snprintf(str,sizeof(str)," =%d",x); 102 rb->snprintf(str,sizeof(str)," =%d",x);
103 rb->lcd_puts(0,0,str);
103 104
104 rb->lcd_define_pattern(h1,pattern3); 105 rb->lcd_define_pattern(h1,pattern3);
105 for(i=0;i<x/3;i++) 106 for (i=0;i<x/3;i++)
106 str[i]=h1; 107 rb->lcd_putc(i,0,h1);
107 108
108 if (x%3==2) 109 if (x%3==2)
109 { 110 {
110 rb->lcd_define_pattern(h2,pattern2); 111 rb->lcd_define_pattern(h2,pattern2);
111 str[i]=h2; 112 rb->lcd_putc(i,0,h2);
112 } 113 }
113 if (x%3==1) 114 if (x%3==1)
114 { 115 {
115 rb->lcd_define_pattern(h2,pattern1); 116 rb->lcd_define_pattern(h2,pattern1);
116 str[i]=h2; 117 rb->lcd_putc(i,0,h2);
117 } 118 }
118 rb->lcd_puts(0,0,str);
119} 119}
120 120
121/* Call when the program end */ 121/* Call when the program end */
diff --git a/apps/screen_access.c b/apps/screen_access.c
index 00db92769b..6728c4ea2a 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -41,16 +41,15 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
41 screen->depth=LCD_REMOTE_DEPTH; 41 screen->depth=LCD_REMOTE_DEPTH;
42 screen->has_disk_led=false; 42 screen->has_disk_led=false;
43 43
44#if 1 /* all remote LCDs are bitmapped so far */
45 screen->width=LCD_REMOTE_WIDTH; 44 screen->width=LCD_REMOTE_WIDTH;
46 screen->height=LCD_REMOTE_HEIGHT; 45 screen->height=LCD_REMOTE_HEIGHT;
47 screen->setmargins=&lcd_remote_setmargins; 46 screen->setmargins=&lcd_remote_setmargins;
48 screen->getymargin=&lcd_remote_getymargin; 47 screen->getymargin=&lcd_remote_getymargin;
49 screen->getxmargin=&lcd_remote_getxmargin; 48 screen->getxmargin=&lcd_remote_getxmargin;
49 screen->getstringsize=&lcd_remote_getstringsize;
50#if 1 /* all remote LCDs are bitmapped so far */
50 screen->setfont=&lcd_remote_setfont; 51 screen->setfont=&lcd_remote_setfont;
51 screen->setfont(FONT_UI); 52 screen->setfont(FONT_UI);
52 screen->getstringsize=&lcd_remote_getstringsize;
53 screen->putsxy=&lcd_remote_putsxy;
54 screen->mono_bitmap=&lcd_remote_mono_bitmap; 53 screen->mono_bitmap=&lcd_remote_mono_bitmap;
55 screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part; 54 screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part;
56 screen->set_drawmode=&lcd_remote_set_drawmode; 55 screen->set_drawmode=&lcd_remote_set_drawmode;
@@ -70,20 +69,14 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
70 screen->drawline=&lcd_remote_drawline; 69 screen->drawline=&lcd_remote_drawline;
71 screen->vline=&lcd_remote_vline; 70 screen->vline=&lcd_remote_vline;
72 screen->hline=&lcd_remote_hline; 71 screen->hline=&lcd_remote_hline;
73 screen->scroll_speed=&lcd_remote_scroll_speed;
74 screen->scroll_delay=&lcd_remote_scroll_delay;
75 screen->scroll_step=&lcd_remote_scroll_step; 72 screen->scroll_step=&lcd_remote_scroll_step;
76 screen->invertscroll=&lcd_remote_invertscroll; 73 screen->invertscroll=&lcd_remote_invertscroll;
77#endif /* LCD_REMOTE_DEPTH > 1 */
78 screen->puts_offset=&lcd_remote_puts_offset;
79 screen->puts_style_offset=&lcd_remote_puts_style_offset; 74 screen->puts_style_offset=&lcd_remote_puts_style_offset;
80 screen->puts_scroll_style=&lcd_remote_puts_scroll_style; 75 screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
81 screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
82 screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset; 76 screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset;
77#endif /* 1 */
83 78
84#if 0 /* no charcell remote LCDs so far */ 79#if 0 /* no charcell remote LCDs so far */
85 screen->width=11;
86 screen->height=2;
87 screen->double_height=&lcd_remote_double_height; 80 screen->double_height=&lcd_remote_double_height;
88 screen->putc=&lcd_remote_putc; 81 screen->putc=&lcd_remote_putc;
89 screen->get_locked_pattern=&lcd_remote_get_locked_pattern; 82 screen->get_locked_pattern=&lcd_remote_get_locked_pattern;
@@ -96,11 +89,16 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
96#endif /* 0 */ 89#endif /* 0 */
97 90
98 screen->init=&lcd_remote_init; 91 screen->init=&lcd_remote_init;
92 screen->putsxy=&lcd_remote_putsxy;
93 screen->puts=&lcd_remote_puts;
94 screen->puts_offset=&lcd_remote_puts_offset;
99 screen->puts_scroll=&lcd_remote_puts_scroll; 95 screen->puts_scroll=&lcd_remote_puts_scroll;
96 screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
97 screen->scroll_speed=&lcd_remote_scroll_speed;
98 screen->scroll_delay=&lcd_remote_scroll_delay;
100 screen->stop_scroll=&lcd_remote_stop_scroll; 99 screen->stop_scroll=&lcd_remote_stop_scroll;
101 screen->clear_display=&lcd_remote_clear_display; 100 screen->clear_display=&lcd_remote_clear_display;
102 screen->update=&lcd_remote_update; 101 screen->update=&lcd_remote_update;
103 screen->puts=&lcd_remote_puts;
104 screen->backlight_on=&remote_backlight_on; 102 screen->backlight_on=&remote_backlight_on;
105 screen->backlight_off=&remote_backlight_off; 103 screen->backlight_off=&remote_backlight_off;
106 screen->is_backlight_on=&is_remote_backlight_on; 104 screen->is_backlight_on=&is_remote_backlight_on;
@@ -116,16 +114,15 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
116#elif defined(HAVE_REMOTE_LCD) 114#elif defined(HAVE_REMOTE_LCD)
117 screen->has_disk_led=true; 115 screen->has_disk_led=true;
118#endif 116#endif
119#ifdef HAVE_LCD_BITMAP
120 screen->width=LCD_WIDTH; 117 screen->width=LCD_WIDTH;
121 screen->height=LCD_HEIGHT; 118 screen->height=LCD_HEIGHT;
122 screen->setmargins=&lcd_setmargins; 119 screen->setmargins=&lcd_setmargins;
123 screen->getymargin=&lcd_getymargin; 120 screen->getymargin=&lcd_getymargin;
124 screen->getxmargin=&lcd_getxmargin; 121 screen->getxmargin=&lcd_getxmargin;
122 screen->getstringsize=&lcd_getstringsize;
123#ifdef HAVE_LCD_BITMAP
125 screen->setfont=&lcd_setfont; 124 screen->setfont=&lcd_setfont;
126 screen->setfont(FONT_UI); 125 screen->setfont(FONT_UI);
127 screen->getstringsize=&lcd_getstringsize;
128 screen->putsxy=&lcd_putsxy;
129 screen->mono_bitmap=&lcd_mono_bitmap; 126 screen->mono_bitmap=&lcd_mono_bitmap;
130 screen->mono_bitmap_part=&lcd_mono_bitmap_part; 127 screen->mono_bitmap_part=&lcd_mono_bitmap_part;
131 screen->set_drawmode=&lcd_set_drawmode; 128 screen->set_drawmode=&lcd_set_drawmode;
@@ -147,7 +144,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
147 screen->get_foreground=&lcd_get_foreground; 144 screen->get_foreground=&lcd_get_foreground;
148 screen->set_background=&lcd_set_background; 145 screen->set_background=&lcd_set_background;
149 screen->set_foreground=&lcd_set_foreground; 146 screen->set_foreground=&lcd_set_foreground;
150#endif 147#endif /* LCD_DEPTH > 1 */
151 screen->update_rect=&lcd_update_rect; 148 screen->update_rect=&lcd_update_rect;
152 screen->fillrect=&lcd_fillrect; 149 screen->fillrect=&lcd_fillrect;
153 screen->drawrect=&lcd_drawrect; 150 screen->drawrect=&lcd_drawrect;
@@ -155,20 +152,14 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
155 screen->drawline=&lcd_drawline; 152 screen->drawline=&lcd_drawline;
156 screen->vline=&lcd_vline; 153 screen->vline=&lcd_vline;
157 screen->hline=&lcd_hline; 154 screen->hline=&lcd_hline;
158 screen->scroll_speed=&lcd_scroll_speed;
159 screen->scroll_delay=&lcd_scroll_delay;
160 screen->scroll_step=&lcd_scroll_step; 155 screen->scroll_step=&lcd_scroll_step;
161 screen->invertscroll=&lcd_invertscroll; 156 screen->invertscroll=&lcd_invertscroll;
162 screen->puts_offset=&lcd_puts_offset;
163 screen->puts_style_offset=&lcd_puts_style_offset; 157 screen->puts_style_offset=&lcd_puts_style_offset;
164 screen->puts_scroll_style=&lcd_puts_scroll_style; 158 screen->puts_scroll_style=&lcd_puts_scroll_style;
165 screen->puts_scroll_offset=&lcd_puts_scroll_offset;
166 screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset; 159 screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset;
167#endif /* HAVE_LCD_BITMAP */ 160#endif /* HAVE_LCD_BITMAP */
168 161
169#ifdef HAVE_LCD_CHARCELLS 162#ifdef HAVE_LCD_CHARCELLS
170 screen->width=11; /* width in characters instead of pixels */
171 screen->height=2;
172 screen->double_height=&lcd_double_height; 163 screen->double_height=&lcd_double_height;
173 screen->putc=&lcd_putc; 164 screen->putc=&lcd_putc;
174 screen->get_locked_pattern=&lcd_get_locked_pattern; 165 screen->get_locked_pattern=&lcd_get_locked_pattern;
@@ -181,13 +172,18 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
181#endif /* HAVE_LCD_CHARCELLS */ 172#endif /* HAVE_LCD_CHARCELLS */
182 173
183 screen->init=&lcd_init; 174 screen->init=&lcd_init;
175 screen->putsxy=&lcd_putsxy;
176 screen->puts=&lcd_puts;
177 screen->puts_offset=&lcd_puts_offset;
184 screen->puts_scroll=&lcd_puts_scroll; 178 screen->puts_scroll=&lcd_puts_scroll;
179 screen->puts_scroll_offset=&lcd_puts_scroll_offset;
180 screen->scroll_speed=&lcd_scroll_speed;
181 screen->scroll_delay=&lcd_scroll_delay;
185 screen->stop_scroll=&lcd_stop_scroll; 182 screen->stop_scroll=&lcd_stop_scroll;
186 screen->clear_display=&lcd_clear_display; 183 screen->clear_display=&lcd_clear_display;
187#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) 184#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
188 screen->update=&lcd_update; 185 screen->update=&lcd_update;
189#endif 186#endif
190 screen->puts=&lcd_puts;
191 screen->backlight_on=&backlight_on; 187 screen->backlight_on=&backlight_on;
192 screen->backlight_off=&backlight_off; 188 screen->backlight_off=&backlight_off;
193 screen->is_backlight_on=&is_backlight_on; 189 screen->is_backlight_on=&is_backlight_on;
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 54f2d64fdb..c1d8b5f9b8 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -60,24 +60,19 @@ struct screen
60#ifdef HAS_BUTTONBAR 60#ifdef HAS_BUTTONBAR
61 bool has_buttonbar; 61 bool has_buttonbar;
62#endif 62#endif
63
64#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
65 void (*setmargins)(int x, int y); 63 void (*setmargins)(int x, int y);
66 int (*getxmargin)(void); 64 int (*getxmargin)(void);
67 int (*getymargin)(void); 65 int (*getymargin)(void);
68 66
69 void (*setfont)(int newfont);
70 int (*getstringsize)(const unsigned char *str, int *w, int *h); 67 int (*getstringsize)(const unsigned char *str, int *w, int *h);
71 void (*putsxy)(int x, int y, const unsigned char *str); 68#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
69 void (*setfont)(int newfont);
72 70
73 void (*scroll_step)(int pixels); 71 void (*scroll_step)(int pixels);
74 void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
75 void (*puts_style_offset)(int x, int y, const unsigned char *str, 72 void (*puts_style_offset)(int x, int y, const unsigned char *str,
76 int style, int offset); 73 int style, int offset);
77 void (*puts_scroll_style)(int x, int y, const unsigned char *string, 74 void (*puts_scroll_style)(int x, int y, const unsigned char *string,
78 int style); 75 int style);
79 void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
80 int offset);
81 void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string, 76 void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string,
82 int style, int offset); 77 int style, int offset);
83 void (*mono_bitmap)(const unsigned char *src, 78 void (*mono_bitmap)(const unsigned char *src,
@@ -114,17 +109,22 @@ struct screen
114 109
115#ifdef HAVE_LCD_CHARCELLS /* no charcell remote LCDs so far */ 110#ifdef HAVE_LCD_CHARCELLS /* no charcell remote LCDs so far */
116 void (*double_height)(bool on); 111 void (*double_height)(bool on);
117 void (*putc)(int x, int y, unsigned short ch); 112 void (*putc)(int x, int y, unsigned long ucs);
118 void (*icon)(int icon, bool enable); 113 void (*icon)(int icon, bool enable);
114 unsigned long (*get_locked_pattern)(void);
115 void (*define_pattern)(unsigned long ucs, const char *pattern);
119#endif 116#endif
120 void (*init)(void); 117 void (*init)(void);
118 void (*putsxy)(int x, int y, const unsigned char *str);
119 void (*puts)(int x, int y, const unsigned char *str);
120 void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
121 void (*puts_scroll)(int x, int y, const unsigned char *string); 121 void (*puts_scroll)(int x, int y, const unsigned char *string);
122 void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
123 int offset);
122 void (*scroll_speed)(int speed); 124 void (*scroll_speed)(int speed);
123 void (*scroll_delay)(int ms); 125 void (*scroll_delay)(int ms);
124 void (*stop_scroll)(void); 126 void (*stop_scroll)(void);
125 void (*clear_display)(void); 127 void (*clear_display)(void);
126 unsigned char (*get_locked_pattern)(void);
127 void (*define_pattern)(int pat, const char *pattern);
128#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) || defined(SIMULATOR) 128#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) || defined(SIMULATOR)
129 void (*update)(void); 129 void (*update)(void);
130#endif 130#endif
@@ -132,7 +132,6 @@ struct screen
132 void (*backlight_off)(void); 132 void (*backlight_off)(void);
133 bool (*is_backlight_on)(void); 133 bool (*is_backlight_on)(void);
134 void (*backlight_set_timeout)(int index); 134 void (*backlight_set_timeout)(int index);
135 void (*puts)(int x, int y, const unsigned char *str);
136}; 135};
137 136
138/* 137/*
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
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 65ae84b45d..9ec97c191e 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -59,8 +59,8 @@ common/unicode.c
59 59
60/* Display */ 60/* Display */
61#ifdef HAVE_LCD_CHARCELLS 61#ifdef HAVE_LCD_CHARCELLS
62drivers/lcd-player-charset.c 62drivers/lcd-charcell.c
63drivers/lcd-player.c 63drivers/lcd-charset-player.c
64#endif /* HAVE_LCD_CHARCELLS */ 64#endif /* HAVE_LCD_CHARCELLS */
65 65
66#ifdef HAVE_LCD_BITMAP 66#ifdef HAVE_LCD_BITMAP
@@ -317,6 +317,7 @@ target/sh/archos/ata-archos.c
317target/sh/archos/ata-as-archos.S 317target/sh/archos/ata-as-archos.S
318target/sh/archos/player/button-player.c 318target/sh/archos/player/button-player.c
319target/sh/archos/player/lcd-as-player.S 319target/sh/archos/player/lcd-as-player.S
320target/sh/archos/player/lcd-player.c
320#endif /* SIMULATOR */ 321#endif /* SIMULATOR */
321#endif /* ARCHOS_PLAYER */ 322#endif /* ARCHOS_PLAYER */
322 323
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c
new file mode 100644
index 0000000000..ce0eca94ca
--- /dev/null
+++ b/firmware/drivers/lcd-charcell.c
@@ -0,0 +1,612 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 * Based on the work of Alan Korr, Kjell Ericson and others
12 *
13 * All files in this archive are subject to the GNU General Public License.
14 * See the file COPYING in the source tree root for full license agreement.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20#include "config.h"
21#include "hwcompat.h"
22
23#include "lcd.h"
24#include "kernel.h"
25#include "thread.h"
26#include <string.h>
27#include <stdlib.h>
28#include "file.h"
29#include "debug.h"
30#include "system.h"
31#include "lcd-charcell.h"
32#include "rbunicode.h"
33
34/** definitions **/
35
36#define SCROLLABLE_LINES LCD_HEIGHT
37#define VARIABLE_XCHARS 16 /* number of software user-definable characters */
38
39#define NO_PATTERN (-1)
40
41#define SCROLL_MODE_OFF 0
42#define SCROLL_MODE_RUN 1
43
44/* track usage of user-definable characters */
45struct pattern_info {
46 short count;
47 unsigned short xchar;
48};
49
50struct cursor_info {
51 unsigned char hw_char;
52 bool enabled;
53 bool visible;
54 int x;
55 int y;
56 int divider;
57 int downcount;
58};
59
60static int find_xchar(unsigned long ucs);
61
62/** globals **/
63
64/* The "frame"buffer */
65static unsigned char lcd_buffer[LCD_WIDTH][LCD_HEIGHT];
66#ifdef SIMULATOR
67unsigned char hardware_buffer_lcd[LCD_WIDTH][LCD_HEIGHT];
68#endif
69
70static int xmargin = 0;
71static int ymargin = 0;
72
73static unsigned char xfont_variable[VARIABLE_XCHARS][(HW_PATTERN_SIZE+3)&~3];
74 /* round up pattern size to a multiple of 4 bytes for faster access */
75static bool xfont_variable_locked[VARIABLE_XCHARS];
76static struct pattern_info hw_pattern[MAX_HW_PATTERNS];
77static struct cursor_info cursor;
78
79/* scrolling */
80static volatile int scrolling_lines=0; /* Bitpattern of which lines are scrolling */
81static void scroll_thread(void);
82static char scroll_stack[DEFAULT_STACK_SIZE];
83static const char scroll_name[] = "scroll";
84static int scroll_ticks = 12; /* # of ticks between updates */
85static int scroll_delay = HZ/2; /* delay before starting scroll */
86static int bidir_limit = 50; /* percent */
87static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */
88static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
89static struct scrollinfo scroll[SCROLLABLE_LINES];
90
91static const char scroll_tick_table[16] = {
92 /* Hz values:
93 1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */
94 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3
95};
96
97/* LCD init */
98void lcd_init (void)
99{
100 lcd_init_device();
101 lcd_charset_init();
102 memset(hw_pattern, 0, sizeof(hw_pattern));
103 memset(lcd_buffer, xchar_info[find_xchar(' ')].hw_char, sizeof(lcd_buffer));
104
105 create_thread(scroll_thread, scroll_stack,
106 sizeof(scroll_stack), scroll_name
107 IF_PRIO(, PRIORITY_USER_INTERFACE)
108 IF_COP(, CPU, false));
109}
110
111/** parameter handling **/
112
113void lcd_setmargins(int x, int y)
114{
115 xmargin = x;
116 ymargin = y;
117}
118
119int lcd_getxmargin(void)
120{
121 return xmargin;
122}
123
124int lcd_getymargin(void)
125{
126 return ymargin;
127}
128
129int lcd_getstringsize(const unsigned char *str, int *w, int *h)
130{
131 int width = utf8length(str);
132
133 if (w)
134 *w = width;
135 if (h)
136 *h = 1;
137
138 return width;
139}
140
141/** low-level functions **/
142
143static int find_xchar(unsigned long ucs)
144{
145 int low = 0;
146 int high = xchar_info_size - 1;
147
148 do
149 {
150 int probe = (low + high) >> 1;
151
152 if (xchar_info[probe].ucs < ucs)
153 low = probe + 1;
154 else if (xchar_info[probe].ucs > ucs)
155 high = probe - 1;
156 else
157 return probe;
158 }
159 while (low <= high);
160
161 /* Not found: return index of no-char symbol (last symbol, hardcoded). */
162 return xchar_info_size - 1;
163}
164
165static int xchar_to_pat(int xchar)
166{
167 int i;
168
169 for (i = 0; i < hw_pattern_count; i++)
170 if (hw_pattern[i].xchar == xchar)
171 return i;
172
173 return NO_PATTERN;
174}
175
176static const unsigned char *xchar_to_glyph(int xchar)
177{
178 unsigned index = xchar_info[xchar].glyph;
179
180 if (index & 0x8000)
181 return xfont_variable[index & 0x7fff];
182 else
183 return xfont_fixed[index];
184}
185
186static void lcd_free_pat(int xchar)
187{
188 int x, y;
189 unsigned char substitute;
190 int pat = xchar_to_pat(xchar);
191
192 if (pat != NO_PATTERN)
193 {
194 substitute = xchar_info[xchar].hw_char;
195
196 for (x = 0; x < LCD_WIDTH; x++)
197 {
198 for (y = 0; y < LCD_HEIGHT; y++)
199 {
200 if (pat == lcd_buffer[x][y])
201 {
202 lcd_buffer[x][y] = substitute;
203#ifdef SIMULATOR
204 hardware_buffer_lcd[x][y] = substitute;
205#else
206 lcd_put_hw_char(x, y, substitute);
207#endif
208 }
209 }
210 }
211 if (cursor.enabled && pat == cursor.hw_char)
212 cursor.hw_char = substitute;
213
214 hw_pattern[pat].count = 0;
215#ifdef SIMULATOR
216 lcd_update();
217#endif
218 }
219}
220
221static int lcd_get_free_pat(int xchar)
222{
223 static int last_used_pat = 0;
224
225 int pat = last_used_pat; /* start from last used pattern */
226 int least_pat = pat; /* pattern with least priority */
227 int least_priority = xchar_info[hw_pattern[pat].xchar].priority;
228 int i;
229
230 for (i = 0; i < hw_pattern_count; i++)
231 {
232 if (++pat >= hw_pattern_count) /* Keep 'pat' within limits */
233 pat = 0;
234
235 if (hw_pattern[pat].count == 0)
236 {
237 hw_pattern[pat].xchar = xchar;
238 last_used_pat = pat;
239 return pat;
240 }
241 if (xchar_info[hw_pattern[pat].xchar].priority < least_priority)
242 {
243 least_priority = xchar_info[hw_pattern[pat].xchar].priority;
244 least_pat = pat;
245 }
246 }
247 if (xchar_info[xchar].priority > least_priority) /* prioritized char */
248 {
249 lcd_free_pat(hw_pattern[least_pat].xchar);
250 hw_pattern[least_pat].xchar = xchar;
251 last_used_pat = least_pat;
252 return least_pat;
253 }
254 return NO_PATTERN;
255}
256
257static int map_xchar(int xchar)
258{
259 int pat;
260
261 if (xchar_info[xchar].priority > 0) /* soft char */
262 {
263 pat = xchar_to_pat(xchar);
264
265 if (pat == NO_PATTERN) /* not yet mapped */
266 {
267 pat = lcd_get_free_pat(xchar); /* try to map */
268 if (pat == NO_PATTERN) /* failed: just use substitute */
269 return xchar_info[xchar].hw_char;
270 else /* define pattern */
271 lcd_define_hw_pattern(pat, xchar_to_glyph(xchar));
272 }
273 hw_pattern[pat].count++; /* increase reference count */
274 return pat;
275 }
276 else /* hardware char */
277 return xchar_info[xchar].hw_char;
278}
279
280static void lcd_putxchar(int x, int y, int xchar)
281{
282 int lcd_char = lcd_buffer[x][y];
283
284 if (lcd_char < hw_pattern_count) /* old char was soft */
285 hw_pattern[lcd_char].count--; /* decrease old reference count */
286
287 lcd_buffer[x][y] = lcd_char = map_xchar(xchar);
288#ifdef SIMULATOR
289 hardware_buffer_lcd[x][y] = lcd_char;
290 lcd_update();
291#else
292 lcd_put_hw_char(x, y, lcd_char);
293#endif
294}
295
296/** user-definable pattern handling **/
297
298unsigned long lcd_get_locked_pattern(void)
299{
300 int i = 0;
301
302 for (i = 0; i < VARIABLE_XCHARS; i++)
303 {
304 if (!xfont_variable_locked[i])
305 {
306 xfont_variable_locked[i] = true;
307 return 0xe000 + i; /* hard-coded */
308 }
309 }
310 return 0;
311}
312
313void lcd_unlock_pattern(unsigned long ucs)
314{
315 int xchar = find_xchar(ucs);
316 int index = xchar_info[xchar].glyph;
317
318 if (index & 0x8000) /* variable extended char */
319 {
320 lcd_free_pat(xchar);
321 xfont_variable_locked[index & 0x7fff] = false;
322 }
323}
324
325void lcd_define_pattern(unsigned long ucs, const char *pattern)
326{
327 int xchar = find_xchar(ucs);
328 int index = xchar_info[xchar].glyph;
329 int pat;
330
331 if (index & 0x8000) /* variable extended char */
332 {
333 memcpy(xfont_variable[index & 0x7fff], pattern, HW_PATTERN_SIZE);
334 pat = xchar_to_pat(xchar);
335 if (pat != NO_PATTERN)
336 lcd_define_hw_pattern(pat, pattern);
337 }
338}
339
340/** output functions **/
341
342/* Clear the whole display */
343void lcd_clear_display(void)
344{
345 int x, y;
346 int xchar = find_xchar(' ');
347
348 lcd_stop_scroll();
349 lcd_remove_cursor();
350
351 for (x = 0; x < LCD_WIDTH; x++)
352 for (y = 0; y < LCD_HEIGHT; y++)
353 lcd_putxchar(x, y, xchar);
354}
355
356/* Put an unicode character at the given position */
357void lcd_putc(int x, int y, unsigned long ucs)
358{
359 if ((unsigned)x >= LCD_WIDTH || (unsigned)y >= LCD_HEIGHT)
360 return;
361
362 lcd_putxchar(x, y, find_xchar(ucs));
363}
364
365/* Show cursor (alternating with existing character) at the given position */
366void lcd_put_cursor(int x, int y, unsigned long cursor_ucs)
367{
368 if ((unsigned)x >= LCD_WIDTH || (unsigned)y >= LCD_HEIGHT
369 || cursor.enabled)
370 return;
371
372 cursor.enabled = true;
373 cursor.visible = false;
374 cursor.hw_char = map_xchar(find_xchar(cursor_ucs));
375 cursor.x = x;
376 cursor.y = y;
377 cursor.downcount = 0;
378 cursor.divider = 4;
379}
380
381/* Remove the cursor */
382void lcd_remove_cursor(void)
383{
384 if (cursor.enabled)
385 {
386 if (cursor.hw_char < hw_pattern_count) /* soft char, unmap */
387 hw_pattern[cursor.hw_char].count--;
388
389 cursor.enabled = false;
390#ifdef SIMULATOR
391 hardware_buffer_lcd[cursor.x][cursor.y] = lcd_buffer[cursor.x][cursor.y];
392#else
393 lcd_put_hw_char(cursor.x, cursor.y, lcd_buffer[cursor.x][cursor.y]);
394#endif
395 }
396}
397
398/* Put a string at a given position, skipping first ofs chars */
399static int lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
400{
401 unsigned short ucs;
402 const unsigned char *utf8 = str;
403
404 while (*utf8 && x < LCD_WIDTH)
405 {
406 utf8 = utf8decode(utf8, &ucs);
407
408 if (ofs > 0)
409 {
410 ofs--;
411 continue;
412 }
413 lcd_putc(x++, y, ucs);
414 }
415 return x;
416}
417
418/* Put a string at a given position */
419void lcd_putsxy(int x, int y, const unsigned char *str)
420{
421 lcd_putsxyofs(x, y, 0, str);
422}
423
424/*** Line oriented text output ***/
425
426/* Put a string at a given char position */
427void lcd_puts(int x, int y, const unsigned char *str)
428{
429 lcd_puts_offset(x, y, str, 0);
430}
431
432/* Put a string at a given char position, skipping first offset chars */
433void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
434{
435 /* make sure scrolling is turned off on the line we are updating */
436 scrolling_lines &= ~(1 << y);
437
438 x += xmargin;
439 y += ymargin;
440
441 x = lcd_putsxyofs(x, y, offset, str);
442 while (x < LCD_WIDTH)
443 lcd_putc(x++, y, ' ');
444}
445
446/** scrolling **/
447
448void lcd_stop_scroll(void)
449{
450 scrolling_lines=0;
451}
452
453void lcd_scroll_speed(int speed)
454{
455 scroll_ticks = scroll_tick_table[speed];
456}
457
458void lcd_scroll_delay(int ms)
459{
460 scroll_delay = ms / (HZ / 10);
461}
462
463void lcd_bidir_scroll(int percent)
464{
465 bidir_limit = percent;
466}
467
468void lcd_jump_scroll(int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
469{
470 jump_scroll = mode;
471}
472
473void lcd_jump_scroll_delay(int ms)
474{
475 jump_scroll_delay = ms / (HZ / 10);
476}
477
478void lcd_puts_scroll(int x, int y, const unsigned char *string)
479{
480 lcd_puts_scroll_offset(x, y, string, 0);
481}
482
483void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
484 int offset)
485{
486 struct scrollinfo* s;
487 int len;
488
489 s = &scroll[y];
490
491 s->start_tick = current_tick + scroll_delay;
492
493 lcd_puts_offset(x, y, string, offset);
494 len = utf8length(string);
495
496 if (LCD_WIDTH - xmargin < len)
497 {
498 /* prepare scroll line */
499 char *end;
500
501 memset(s->line, 0, sizeof s->line);
502 strcpy(s->line, string);
503
504 /* get width */
505 s->len = utf8length(s->line);
506
507 /* scroll bidirectional or forward only depending on the string width */
508 if (bidir_limit)
509 {
510 s->bidir = s->len < (LCD_WIDTH - xmargin) * (100 + bidir_limit) / 100;
511 }
512 else
513 s->bidir = false;
514
515 if (!s->bidir) /* add spaces if scrolling in the round */
516 {
517 strcat(s->line, " ");
518 /* get new width incl. spaces */
519 s->len += SCROLL_SPACING;
520 }
521
522 end = strchr(s->line, '\0');
523 strncpy(end, string, LCD_WIDTH);
524
525 s->offset = offset;
526 s->startx = xmargin + x;
527 s->backward = false;
528 scrolling_lines |= (1<<y);
529 }
530 else
531 /* force a bit switch-off since it doesn't scroll */
532 scrolling_lines &= ~(1<<y);
533}
534
535static void scroll_thread(void)
536{
537 struct scrollinfo* s;
538 int index;
539 int xpos, ypos;
540
541 /* initialize scroll struct array */
542 scrolling_lines = 0;
543
544 while (1)
545 {
546 for (index = 0; index < SCROLLABLE_LINES; index++)
547 {
548 /* really scroll? */
549 if (!(scrolling_lines&(1<<index)))
550 continue;
551
552 s = &scroll[index];
553
554 /* check pause */
555 if (TIME_BEFORE(current_tick, s->start_tick))
556 continue;
557
558 if (s->backward)
559 s->offset--;
560 else
561 s->offset++;
562
563 xpos = s->startx;
564 ypos = ymargin + index;
565
566 if (s->bidir) /* scroll bidirectional */
567 {
568 if (s->offset <= 0)
569 {
570 /* at beginning of line */
571 s->offset = 0;
572 s->backward = false;
573 s->start_tick = current_tick + scroll_delay * 2;
574 }
575 if (s->offset >= s->len - (LCD_WIDTH - xpos))
576 {
577 /* at end of line */
578 s->offset = s->len - (LCD_WIDTH - xpos);
579 s->backward = true;
580 s->start_tick = current_tick + scroll_delay * 2;
581 }
582 }
583 else /* scroll forward the whole time */
584 {
585 if (s->offset >= s->len)
586 s->offset -= s->len;
587 }
588 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
589 }
590 if (cursor.enabled)
591 {
592 if (--cursor.downcount < 0)
593 {
594 int lcd_char;
595
596 cursor.downcount = cursor.divider;
597 cursor.visible = !cursor.visible;
598 lcd_char = cursor.visible ? cursor.hw_char
599 : lcd_buffer[cursor.x][cursor.y];
600#ifdef SIMULATOR
601 hardware_buffer_lcd[cursor.x][cursor.y] = lcd_char;
602#else
603 lcd_put_hw_char(cursor.x, cursor.y, lcd_char);
604#endif
605 }
606 }
607#ifdef SIMULATOR
608 lcd_update();
609#endif
610 sleep(scroll_ticks);
611 }
612}
diff --git a/firmware/drivers/lcd-charset-player.c b/firmware/drivers/lcd-charset-player.c
new file mode 100644
index 0000000000..1276f2840d
--- /dev/null
+++ b/firmware/drivers/lcd-charset-player.c
@@ -0,0 +1,594 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "hwcompat.h"
22
23#include "lcd-charcell.h"
24
25int hw_pattern_count; /* actual number of user-definable hw patterns */
26
27const struct xchar_info *xchar_info;
28int xchar_info_size; /* number of entries */
29
30static const struct xchar_info xchar_info_newlcd[] = {
31 /* Standard ascii */
32 { 0x20, 0, 0, 0x20 }, /* */
33 { 0x21, 0, 0, 0x21 }, /* ! */
34 { 0x22, 0, 0, 0x22 }, /* " */
35 { 0x23, 0, 0, 0x23 }, /* # */
36 { 0x24, 0, 0, 0x24 }, /* $ */
37 { 0x25, 0, 0, 0x25 }, /* % */
38 { 0x26, 0, 0, 0x26 }, /* & */
39 { 0x27, 0, 0, 0x27 }, /* ' */
40 { 0x28, 0, 0, 0x28 }, /* ( */
41 { 0x29, 0, 0, 0x29 }, /* ) */
42 { 0x2a, 0, 0, 0x2a }, /* * */
43 { 0x2b, 0, 0, 0x2b }, /* + */
44 { 0x2c, 0, 0, 0x2c }, /* , */
45 { 0x2d, 0, 0, 0x2d }, /* - */
46 { 0x2e, 0, 0, 0x2e }, /* . */
47 { 0x2f, 0, 0, 0x2f }, /* / */
48 { 0x30, 0, 0, 0x30 }, /* 0 */
49 { 0x31, 0, 0, 0x31 }, /* 1 */
50 { 0x32, 0, 0, 0x32 }, /* 2 */
51 { 0x33, 0, 0, 0x33 }, /* 3 */
52 { 0x34, 0, 0, 0x34 }, /* 4 */
53 { 0x35, 0, 0, 0x35 }, /* 5 */
54 { 0x36, 0, 0, 0x36 }, /* 6 */
55 { 0x37, 0, 0, 0x37 }, /* 7 */
56 { 0x38, 0, 0, 0x38 }, /* 8 */
57 { 0x39, 0, 0, 0x39 }, /* 9 */
58 { 0x3a, 0, 0, 0x3a }, /* : */
59 { 0x3b, 0, 0, 0x3b }, /* ; */
60 { 0x3c, 0, 0, 0x3c }, /* < */
61 { 0x3d, 0, 0, 0x3d }, /* = */
62 { 0x3e, 0, 0, 0x3e }, /* > */
63 { 0x3f, 0, 0, 0x3f }, /* ? */
64 { 0x40, 0, 0, 0x40 }, /* @ */
65 { 0x41, 0, 0, 0x41 }, /* A */
66 { 0x42, 0, 0, 0x42 }, /* B */
67 { 0x43, 0, 0, 0x43 }, /* C */
68 { 0x44, 0, 0, 0x44 }, /* D */
69 { 0x45, 0, 0, 0x45 }, /* E */
70 { 0x46, 0, 0, 0x46 }, /* F */
71 { 0x47, 0, 0, 0x47 }, /* G */
72 { 0x48, 0, 0, 0x48 }, /* H */
73 { 0x49, 0, 0, 0x49 }, /* I */
74 { 0x4a, 0, 0, 0x4a }, /* J */
75 { 0x4b, 0, 0, 0x4b }, /* K */
76 { 0x4c, 0, 0, 0x4c }, /* L */
77 { 0x4d, 0, 0, 0x4d }, /* M */
78 { 0x4e, 0, 0, 0x4e }, /* N */
79 { 0x4f, 0, 0, 0x4f }, /* O */
80 { 0x50, 0, 0, 0x50 }, /* P */
81 { 0x51, 0, 0, 0x51 }, /* Q */
82 { 0x52, 0, 0, 0x52 }, /* R */
83 { 0x53, 0, 0, 0x53 }, /* S */
84 { 0x54, 0, 0, 0x54 }, /* T */
85 { 0x55, 0, 0, 0x55 }, /* U */
86 { 0x56, 0, 0, 0x56 }, /* V */
87 { 0x57, 0, 0, 0x57 }, /* W */
88 { 0x58, 0, 0, 0x58 }, /* X */
89 { 0x59, 0, 0, 0x59 }, /* Y */
90 { 0x5a, 0, 0, 0x5a }, /* Z */
91 { 0x5b, 0, 0, 0x5b }, /* [ */
92 { 0x5c, 0, 0, 0x12 }, /* \ */
93 { 0x5d, 0, 0, 0x5d }, /* ] */
94 { 0x5e, 0, 0, 0x5e }, /* ^ */
95 { 0x5f, 0, 0, 0x5f }, /* _ */
96 { 0x60, 0, 0, 0x60 }, /* ` */
97 { 0x61, 0, 0, 0x61 }, /* a */
98 { 0x62, 0, 0, 0x62 }, /* b */
99 { 0x63, 0, 0, 0x63 }, /* c */
100 { 0x64, 0, 0, 0x64 }, /* d */
101 { 0x65, 0, 0, 0x65 }, /* e */
102 { 0x66, 0, 0, 0x66 }, /* f */
103 { 0x67, 0, 0, 0x67 }, /* g */
104 { 0x68, 0, 0, 0x68 }, /* h */
105 { 0x69, 0, 0, 0x69 }, /* i */
106 { 0x6a, 0, 0, 0x6a }, /* j */
107 { 0x6b, 0, 0, 0x6b }, /* k */
108 { 0x6c, 0, 0, 0x6c }, /* l */
109 { 0x6d, 0, 0, 0x6d }, /* m */
110 { 0x6e, 0, 0, 0x6e }, /* n */
111 { 0x6f, 0, 0, 0x6f }, /* o */
112 { 0x70, 0, 0, 0x70 }, /* p */
113 { 0x71, 0, 0, 0x71 }, /* q */
114 { 0x72, 0, 0, 0x72 }, /* r */
115 { 0x73, 0, 0, 0x73 }, /* s */
116 { 0x74, 0, 0, 0x74 }, /* t */
117 { 0x75, 0, 0, 0x75 }, /* u */
118 { 0x76, 0, 0, 0x76 }, /* v */
119 { 0x77, 0, 0, 0x77 }, /* w */
120 { 0x78, 0, 0, 0x78 }, /* x */
121 { 0x79, 0, 0, 0x79 }, /* y */
122 { 0x7a, 0, 0, 0x7a }, /* z */
123 { 0x7b, 0, 0, 0x7b }, /* { */
124 { 0x7c, 0, 0, 0x7c }, /* | */
125 { 0x7d, 0, 0, 0x7d }, /* } */
126 { 0x7e, 0, 0, 0xf0 }, /* ~ */
127 { 0x7f, 0, 0, 0xfe }, /* (full grid) */
128
129#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
130 /* Latin 1 */
131 { 0xa0, 0, 0, 0x20 }, /* (non-breaking space) */
132
133 { 0xa3, 0x000f, 1, 0x4c }, /* (pound sign) */
134
135 { 0xa5, 0, 0, 0x5c }, /* (yen sign) */
136
137 { 0xa7, 0, 0, 0x15 }, /* (paragraph sign) */
138
139 { 0xab, 0, 0, 0x9e }, /* (left double-angle quotation mark) */
140
141 { 0xaf, 0x0010, 1, 0x2d }, /* (macron) */
142
143 { 0xb1, 0, 0, 0x95 }, /* (plus-minus sign) */
144 { 0xb2, 0, 0, 0x99 }, /* (superscript 2) */
145 { 0xb3, 0, 0, 0x9a }, /* (superscript 3) */
146
147 { 0xb5, 0, 0, 0xe6 }, /* (micro sign) */
148 { 0xb6, 0, 0, 0x14 }, /* (pilcrow sign) */
149 { 0xb7, 0, 0, 0xa5 }, /* (middle dot) */
150
151 { 0xbb, 0, 0, 0x9f }, /* (right double-angle quotation mark) */
152 { 0xbc, 0, 0, 0x9c }, /* (one quarter) */
153 { 0xbd, 0, 0, 0x9b }, /* (one half) */
154 { 0xbe, 0, 0, 0x9d }, /* (three quarters) */
155 { 0xbf, 0x0011, 1, 0x3f }, /* (inverted ?) */
156 { 0xc0, 0x0012, 1, 0x41 }, /* (A grave) */
157 { 0xc1, 0x0013, 1, 0x41 }, /* (A acute) */
158 { 0xc2, 0x0014, 1, 0x41 }, /* (A circumflex) */
159 { 0xc3, 0x0015, 1, 0x41 }, /* (A tilde) */
160 { 0xc4, 0x0016, 1, 0x41 }, /* (A dieresis) */
161 { 0xc5, 0x0017, 1, 0x41 }, /* (A with ring above) */
162 { 0xc6, 0x0018, 1, 0x41 }, /* (AE ligature) */
163 { 0xc7, 0x0019, 1, 0x43 }, /* (C cedilla) */
164 { 0xc8, 0x001a, 1, 0x45 }, /* (E grave) */
165 { 0xc9, 0x001b, 1, 0x45 }, /* (E acute) */
166 { 0xca, 0x001c, 1, 0x45 }, /* (E circumflex) */
167 { 0xcb, 0x001d, 1, 0x45 }, /* (E dieresis) */
168 { 0xcc, 0x001e, 1, 0x49 }, /* (I grave) */
169 { 0xcd, 0x001f, 1, 0x49 }, /* (I acute) */
170 { 0xce, 0, 0, 0x49 }, /* (I circumflex) */
171 { 0xcf, 0, 0, 0x49 }, /* (I dieresis) */
172 { 0xd0, 0x0020, 1, 0x44 }, /* (ETH) */
173 { 0xd1, 0x0021, 1, 0x4e }, /* (N tilde) */
174 { 0xd2, 0x0022, 1, 0x4f }, /* (O grave) */
175 { 0xd3, 0x0023, 1, 0x4f }, /* (O acute) */
176 { 0xd4, 0x0024, 1, 0x4f }, /* (O circumflex) */
177 { 0xd5, 0x0025, 1, 0x4f }, /* (O tilde) */
178 { 0xd6, 0x0026, 1, 0x4f }, /* (O dieresis) */
179 { 0xd7, 0, 0, 0x96 }, /* (multiplication sign) */
180 { 0xd8, 0x0027, 1, 0x4f }, /* (O stroke) */
181 { 0xd9, 0x0028, 1, 0x55 }, /* (U grave) */
182 { 0xda, 0x0029, 1, 0x55 }, /* (U acute) */
183 { 0xdb, 0, 0, 0x55 }, /* (U circumflex) */
184 { 0xdc, 0x002a, 1, 0x55 }, /* (U dieresis) */
185 { 0xdd, 0, 0, 0x59 }, /* (Y acute) */
186
187 { 0xdf, 0, 0, 0xe1 }, /* (sharp s) */
188 { 0xe0, 0x002b, 1, 0x61 }, /* (a grave) */
189 { 0xe1, 0x002c, 1, 0x61 }, /* (a acute) */
190 { 0xe2, 0x002d, 1, 0x61 }, /* (a circumflex) */
191 { 0xe3, 0x002e, 1, 0x61 }, /* (a tilde) */
192 { 0xe4, 0x002f, 1, 0x61 }, /* (a dieresis) */
193 { 0xe5, 0x0030, 1, 0x61 }, /* (a with ring above) */
194
195 { 0xe7, 0x0031, 1, 0x63 }, /* (c cedilla) */
196 { 0xe8, 0x0032, 1, 0x65 }, /* (e grave) */
197 { 0xe9, 0x0033, 1, 0x65 }, /* (e acute) */
198 { 0xea, 0x0034, 1, 0x65 }, /* (e circumflex) */
199 { 0xeb, 0x0035, 1, 0x65 }, /* (e dieresis) */
200 { 0xec, 0, 0, 0x69 }, /* (i grave) */
201 { 0xed, 0x0036, 1, 0x69 }, /* (i acute) */
202 { 0xee, 0x0037, 1, 0x69 }, /* (i circumflex) */
203 { 0xef, 0x0038, 1, 0x69 }, /* (i dieresis) */
204
205 { 0xf1, 0x0039, 1, 0x6e }, /* (n tilde) */
206 { 0xf2, 0x003a, 1, 0x6f }, /* (o grave) */
207 { 0xf3, 0x003b, 1, 0x6f }, /* (o acute) */
208 { 0xf4, 0x003c, 1, 0x6f }, /* (o circumflex) */
209 { 0xf5, 0x003d, 1, 0x6f }, /* (o tilde) */
210 { 0xf6, 0x003e, 1, 0x6f }, /* (o dieresis) */
211 { 0xf7, 0, 0, 0x97 }, /* (division sign) */
212 { 0xf8, 0x003f, 1, 0x6f }, /* (o slash) */
213 { 0xf9, 0x0040, 1, 0x75 }, /* (u grave) */
214 { 0xfa, 0x0041, 1, 0x75 }, /* (u acute) */
215 { 0xfb, 0, 0, 0x75 }, /* (u circumflex) */
216 { 0xfc, 0x0042, 1, 0x75 }, /* (u dieresis) */
217 { 0xfd, 0x0043, 1, 0x79 }, /* (y acute) */
218
219 { 0xff, 0, 0, 0x79 }, /* (y dieresis) */
220
221 /* Runtime-definable characters */
222 { 0xe000, 0x8000, 15, 0x20 }, /* variable character 0 */
223 { 0xe001, 0x8001, 15, 0x20 }, /* variable character 1 */
224 { 0xe002, 0x8002, 15, 0x20 }, /* variable character 2 */
225 { 0xe003, 0x8003, 15, 0x20 }, /* variable character 3 */
226 { 0xe004, 0x8004, 15, 0x20 }, /* variable character 4 */
227 { 0xe005, 0x8005, 15, 0x20 }, /* variable character 5 */
228 { 0xe006, 0x8006, 15, 0x20 }, /* variable character 6 */
229 { 0xe007, 0x8007, 15, 0x20 }, /* variable character 7 */
230 { 0xe008, 0x8008, 15, 0x20 }, /* variable character 8 */
231 { 0xe009, 0x8009, 15, 0x20 }, /* variable character 9 */
232 { 0xe00a, 0x800a, 15, 0x20 }, /* variable character 10 */
233 { 0xe00b, 0x800b, 15, 0x20 }, /* variable character 11 */
234 { 0xe00c, 0x800c, 15, 0x20 }, /* variable character 12 */
235 { 0xe00d, 0x800d, 15, 0x20 }, /* variable character 13 */
236 { 0xe00e, 0x800e, 15, 0x20 }, /* variable character 14 */
237 { 0xe00f, 0x800f, 15, 0x20 }, /* variable character 15 */
238
239 /* Icons and special symbols */
240 { 0xe100, 0x0004, 14, 0x3f }, /* unknown icon (mirrored ?) */
241 { 0xe101, 0x0005, 14, 0x94 }, /* bookmark icon */
242 { 0xe102, 0x0006, 14, 0x29 }, /* plugin icon */
243 { 0xe103, 0x0007, 14, 0x91 }, /* folder icon */
244 { 0xe104, 0x0008, 14, 0x78 }, /* firmware icon */
245 { 0xe105, 0x0009, 14, 0x2b }, /* language icon */
246 { 0xe106, 0x000a, 14, 0x13 }, /* audio icon (note) */
247 { 0xe107, 0x000b, 14, 0x94 }, /* wps icon */
248 { 0xe108, 0x000c, 14, 0xd0 }, /* playlist icon */
249 { 0xe109, 0x000d, 14, 0xd0 }, /* text file icon */
250 { 0xe10a, 0x000e, 14, 0xd0 }, /* config icon */
251 { 0xe10b, 0, 0, 0x7f }, /* left arrow */
252 { 0xe10c, 0, 0, 0x7e }, /* right arrow */
253 { 0xe10d, 0, 0, 0x18 }, /* up arrow */
254 { 0xe10e, 0, 0, 0x19 }, /* down arrow */
255 { 0xe10f, 0, 0, 0x11 }, /* filled left arrow */
256 { 0xe110, 0, 0, 0x10 }, /* filled right arrow */
257 { 0xe111, 0, 0, 0x1f }, /* filled up arrow */
258 { 0xe112, 0, 0, 0x1e }, /* filled down arrow */
259 { 0xe113, 0, 0, 0x20 }, /* level 0/7 */
260 { 0xe114, 0, 0, 0x80 }, /* level 1/7 */
261 { 0xe115, 0, 0, 0x81 }, /* level 2/7 */
262 { 0xe116, 0, 0, 0x82 }, /* level 3/7 */
263 { 0xe117, 0, 0, 0x83 }, /* level 4/7 */
264 { 0xe118, 0, 0, 0x84 }, /* level 5/7 */
265 { 0xe119, 0, 0, 0x85 }, /* level 6/7 */
266 { 0xe11a, 0, 0, 0x86 }, /* level 7/7 */
267#endif /* !BOOTLOADER */
268
269 /* no-char symbol */
270 { 0xfffd, 0, 0, 0x91 },
271};
272
273static const struct xchar_info xchar_info_oldlcd[] = {
274 /* Standard ascii */
275 { 0x20, 0, 0, 0x24 }, /* */
276 { 0x21, 0, 0, 0x25 }, /* ! */
277 { 0x22, 0, 0, 0x26 }, /* " */
278 { 0x23, 0, 0, 0x27 }, /* # */
279 { 0x24, 0, 0, 0x28 }, /* $ */
280 { 0x25, 0, 0, 0x29 }, /* % */
281 { 0x26, 0, 0, 0x2a }, /* & */
282 { 0x27, 0, 0, 0x2b }, /* ' */
283 { 0x28, 0, 0, 0x2c }, /* ( */
284 { 0x29, 0, 0, 0x2d }, /* ) */
285 { 0x2a, 0, 0, 0x2e }, /* * */
286 { 0x2b, 0, 0, 0x2f }, /* + */
287 { 0x2c, 0, 0, 0x30 }, /* , */
288 { 0x2d, 0, 0, 0x31 }, /* - */
289 { 0x2e, 0, 0, 0x32 }, /* . */
290 { 0x2f, 0, 0, 0x33 }, /* / */
291 { 0x30, 0, 0, 0x34 }, /* 0 */
292 { 0x31, 0, 0, 0x35 }, /* 1 */
293 { 0x32, 0, 0, 0x36 }, /* 2 */
294 { 0x33, 0, 0, 0x37 }, /* 3 */
295 { 0x34, 0, 0, 0x38 }, /* 4 */
296 { 0x35, 0, 0, 0x39 }, /* 5 */
297 { 0x36, 0, 0, 0x3a }, /* 6 */
298 { 0x37, 0, 0, 0x3b }, /* 7 */
299 { 0x38, 0, 0, 0x3c }, /* 8 */
300 { 0x39, 0, 0, 0x3d }, /* 9 */
301 { 0x3a, 0, 0, 0x3e }, /* : */
302 { 0x3b, 0, 0, 0x3f }, /* ; */
303 { 0x3c, 0, 0, 0x40 }, /* < */
304 { 0x3d, 0, 0, 0x41 }, /* = */
305 { 0x3e, 0, 0, 0x42 }, /* > */
306 { 0x3f, 0, 0, 0x43 }, /* ? */
307 { 0x40, 0, 0, 0x04 }, /* @ */
308 { 0x41, 0, 0, 0x45 }, /* A */
309 { 0x42, 0, 0, 0x46 }, /* B */
310 { 0x43, 0, 0, 0x47 }, /* C */
311 { 0x44, 0, 0, 0x48 }, /* D */
312 { 0x45, 0, 0, 0x49 }, /* E */
313 { 0x46, 0, 0, 0x4a }, /* F */
314 { 0x47, 0, 0, 0x4b }, /* G */
315 { 0x48, 0, 0, 0x4c }, /* H */
316 { 0x49, 0, 0, 0x4d }, /* I */
317 { 0x4a, 0, 0, 0x4e }, /* J */
318 { 0x4b, 0, 0, 0x4f }, /* K */
319 { 0x4c, 0, 0, 0x50 }, /* L */
320 { 0x4d, 0, 0, 0x51 }, /* M */
321 { 0x4e, 0, 0, 0x52 }, /* N */
322 { 0x4f, 0, 0, 0x53 }, /* O */
323 { 0x50, 0, 0, 0x54 }, /* P */
324 { 0x51, 0, 0, 0x55 }, /* Q */
325 { 0x52, 0, 0, 0x56 }, /* R */
326 { 0x53, 0, 0, 0x57 }, /* S */
327 { 0x54, 0, 0, 0x58 }, /* T */
328 { 0x55, 0, 0, 0x59 }, /* U */
329 { 0x56, 0, 0, 0x5a }, /* V */
330 { 0x57, 0, 0, 0x5b }, /* W */
331 { 0x58, 0, 0, 0x5c }, /* X */
332 { 0x59, 0, 0, 0x5d }, /* Y */
333 { 0x5a, 0, 0, 0x5e }, /* Z */
334 { 0x5b, 0, 0, 0xa9 }, /* [ */
335 { 0x5c, 0x0000, 2, 0x33 }, /* \ */
336 { 0x5d, 0, 0, 0xce }, /* ] */
337
338 { 0x5f, 0, 0, 0x15 }, /* _ */
339 { 0x60, 0x0001, 2, 0x2b }, /* ` */
340 { 0x61, 0, 0, 0x65 }, /* a */
341 { 0x62, 0, 0, 0x66 }, /* b */
342 { 0x63, 0, 0, 0x67 }, /* c */
343 { 0x64, 0, 0, 0x68 }, /* d */
344 { 0x65, 0, 0, 0x69 }, /* e */
345 { 0x66, 0, 0, 0x6a }, /* f */
346 { 0x67, 0, 0, 0x6b }, /* g */
347 { 0x68, 0, 0, 0x6c }, /* h */
348 { 0x69, 0, 0, 0x6d }, /* i */
349 { 0x6a, 0, 0, 0x6e }, /* j */
350 { 0x6b, 0, 0, 0x6f }, /* k */
351 { 0x6c, 0, 0, 0x70 }, /* l */
352 { 0x6d, 0, 0, 0x71 }, /* m */
353 { 0x6e, 0, 0, 0x72 }, /* n */
354 { 0x6f, 0, 0, 0x73 }, /* o */
355 { 0x70, 0, 0, 0x74 }, /* p */
356 { 0x71, 0, 0, 0x75 }, /* q */
357 { 0x72, 0, 0, 0x76 }, /* r */
358 { 0x73, 0, 0, 0x77 }, /* s */
359 { 0x74, 0, 0, 0x78 }, /* t */
360 { 0x75, 0, 0, 0x79 }, /* u */
361 { 0x76, 0, 0, 0x7a }, /* v */
362 { 0x77, 0, 0, 0x7b }, /* w */
363 { 0x78, 0, 0, 0x7c }, /* x */
364 { 0x79, 0, 0, 0x7d }, /* y */
365 { 0x7a, 0, 0, 0x7e }, /* z */
366 { 0x7b, 0, 0, 0x2c }, /* { (hard-coded ( ) */
367 { 0x7c, 0x0002, 2, 0x25 }, /* | */
368 { 0x7d, 0, 0, 0x2d }, /* } (hard-coded ) ) */
369 { 0x7e, 0x0003, 2, 0x31 }, /* ~ */
370 { 0x7f, 0, 0, 0x8b }, /* (full grid) */
371
372#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
373 /* Latin 1 */
374 { 0xa0, 0, 0, 0x24 }, /* (non-breaking space) */
375 { 0xa1, 0, 0, 0x44 }, /* (inverted !) */
376 { 0xa2, 0, 0, 0xa8 }, /* (cent sign) */
377 { 0xa3, 0, 0, 0x05 }, /* (pound sign) */
378 { 0xa4, 0, 0, 0x28 }, /* (currency sign) */
379 { 0xa5, 0, 0, 0x07 }, /* (yen sign) */
380
381 { 0xa7, 0, 0, 0x63 }, /* (paragraph sign) */
382
383 { 0xaf, 0, 0, 0xee }, /* (macron) */
384
385 { 0xbf, 0, 0, 0x64 }, /* (inverted ?) */
386 { 0xc0, 0, 0, 0x8c }, /* (A grave) */
387 { 0xc1, 0, 0, 0x8d }, /* (A acute) */
388 { 0xc2, 0, 0, 0x8e }, /* (A circumflex) */
389 { 0xc3, 0, 0, 0x8f }, /* (A tilde) */
390 { 0xc4, 0, 0, 0x5f }, /* (A dieresis) */
391 { 0xc5, 0, 0, 0x12 }, /* (A with ring above) */
392 { 0xc6, 0, 0, 0x20 }, /* (AE ligature) */
393 { 0xc7, 0, 0, 0x0d }, /* (C cedilla) */
394 { 0xc8, 0, 0, 0x90 }, /* (E grave) */
395 { 0xc9, 0, 0, 0x23 }, /* (E acute) */
396 { 0xca, 0, 0, 0x91 }, /* (E circumflex) */
397 { 0xcb, 0, 0, 0x92 }, /* (E dieresis) */
398 { 0xcc, 0, 0, 0x93 }, /* (I grave) */
399 { 0xcd, 0, 0, 0x94 }, /* (I acute) */
400 { 0xce, 0, 0, 0x4d }, /* (I circumflex) */
401 { 0xcf, 0, 0, 0x4d }, /* (I dieresis) */
402 { 0xd0, 0, 0, 0x95 }, /* (ETH) */
403 { 0xd1, 0, 0, 0x61 }, /* (N tilde) */
404 { 0xd2, 0, 0, 0x96 }, /* (O grave) */
405 { 0xd3, 0, 0, 0x97 }, /* (O acute) */
406 { 0xd4, 0, 0, 0x98 }, /* (O circumflex) */
407 { 0xd5, 0, 0, 0x99 }, /* (O tilde) */
408 { 0xd6, 0, 0, 0x60 }, /* (O dieresis) */
409 { 0xd7, 0, 0, 0xde }, /* (multiplication sign) */
410 { 0xd8, 0, 0, 0x0f }, /* (O stroke) */
411 { 0xd9, 0, 0, 0x9a }, /* (U grave) */
412 { 0xda, 0, 0, 0x9b }, /* (U acute) */
413 { 0xdb, 0, 0, 0x59 }, /* (U circumflex) */
414 { 0xdc, 0, 0, 0x62 }, /* (U dieresis) */
415 { 0xdd, 0, 0, 0x5d }, /* (Y acute) */
416
417 { 0xdf, 0, 0, 0x22 }, /* (sharp s) */
418 { 0xe0, 0, 0, 0x83 }, /* (a grave) */
419 { 0xe1, 0, 0, 0x9c }, /* (a acute) */
420 { 0xe2, 0, 0, 0x9d }, /* (a circumflex) */
421 { 0xe3, 0, 0, 0x9e }, /* (a tilde) */
422 { 0xe4, 0, 0, 0x7f }, /* (a dieresis) */
423 { 0xe5, 0, 0, 0x13 }, /* (a with ring above) */
424
425 { 0xe7, 0, 0, 0x84 }, /* (c cedilla) */
426 { 0xe8, 0, 0, 0x08 }, /* (e grave) */
427 { 0xe9, 0, 0, 0x09 }, /* (e acute) */
428 { 0xea, 0, 0, 0x9f }, /* (e circumflex) */
429 { 0xeb, 0, 0, 0xa0 }, /* (e dieresis) */
430 { 0xec, 0, 0, 0x6d }, /* (i grave) */
431 { 0xed, 0, 0, 0xa1 }, /* (i acute) */
432 { 0xee, 0, 0, 0xa2 }, /* (i circumflex) */
433 { 0xef, 0, 0, 0xa3 }, /* (i dieresis) */
434
435 { 0xf1, 0, 0, 0x81 }, /* (n tilde) */
436 { 0xf2, 0, 0, 0x0c }, /* (o grave) */
437 { 0xf3, 0, 0, 0xa4 }, /* (o acute) */
438 { 0xf4, 0, 0, 0xa5 }, /* (o circumflex) */
439 { 0xf5, 0, 0, 0xa6 }, /* (o tilde) */
440 { 0xf6, 0, 0, 0x80 }, /* (o dieresis) */
441
442 { 0xf8, 0, 0, 0x10 }, /* (o slash) */
443 { 0xf9, 0, 0, 0x0a }, /* (u grave) */
444 { 0xfa, 0, 0, 0xa7 }, /* (u acute) */
445 { 0xfb, 0, 0, 0x79 }, /* (u circumflex) */
446 { 0xfc, 0, 0, 0xa2 }, /* (u dieresis) */
447 { 0xfd, 0, 0, 0xaf }, /* (y acute) */
448
449 { 0xff, 0, 0, 0x7d }, /* (y dieresis) */
450
451 /* Runtime-definable characters */
452 { 0xe000, 0x8000, 15, 0x24 }, /* variable character 0 */
453 { 0xe001, 0x8001, 15, 0x24 }, /* variable character 1 */
454 { 0xe002, 0x8002, 15, 0x24 }, /* variable character 2 */
455 { 0xe003, 0x8003, 15, 0x24 }, /* variable character 3 */
456 { 0xe004, 0x8004, 15, 0x24 }, /* variable character 4 */
457 { 0xe005, 0x8005, 15, 0x24 }, /* variable character 5 */
458 { 0xe006, 0x8006, 15, 0x24 }, /* variable character 6 */
459 { 0xe007, 0x8007, 15, 0x24 }, /* variable character 7 */
460 { 0xe008, 0x8008, 15, 0x24 }, /* variable character 8 */
461 { 0xe009, 0x8009, 15, 0x24 }, /* variable character 9 */
462 { 0xe00a, 0x800a, 15, 0x24 }, /* variable character 10 */
463 { 0xe00b, 0x800b, 15, 0x24 }, /* variable character 11 */
464 { 0xe00c, 0x800c, 15, 0x24 }, /* variable character 12 */
465 { 0xe00d, 0x800d, 15, 0x24 }, /* variable character 13 */
466 { 0xe00e, 0x800e, 15, 0x24 }, /* variable character 14 */
467 { 0xe00f, 0x800f, 15, 0x24 }, /* variable character 15 */
468
469 /* Icons and special symbols */
470 { 0xe100, 0x0004, 14, 0x43 }, /* unknown icon (mirrored ?) */
471 { 0xe101, 0x0005, 14, 0xd4 }, /* bookmark icon */
472 { 0xe102, 0x0006, 14, 0x2d }, /* plugin icon */
473 { 0xe103, 0x0007, 14, 0x34 }, /* folder icon */
474 { 0xe104, 0x0008, 14, 0x7c }, /* firmware icon */
475 { 0xe105, 0x0009, 14, 0x2f }, /* language icon */
476 { 0xe106, 0, 0, 0xfc }, /* audio icon (note) */
477 { 0xe107, 0x000b, 14, 0xd4 }, /* wps icon */
478 { 0xe108, 0x000c, 14, 0xfa }, /* playlist icon */
479 { 0xe109, 0x000f, 14, 0xfa }, /* text file icon */
480 { 0xe10a, 0x000e, 14, 0xfa }, /* config icon */
481 { 0xe10b, 0, 0, 0x88 }, /* left arrow */
482 { 0xe10c, 0, 0, 0x89 }, /* right arrow */
483 { 0xe10d, 0, 0, 0x86 }, /* up arrow */
484 { 0xe10e, 0, 0, 0x87 }, /* down arrow */
485 { 0xe10f, 0, 0, 0x88 }, /* filled left arrow */
486 { 0xe110, 0, 0, 0x89 }, /* filled right arrow */
487 { 0xe111, 0, 0, 0x86 }, /* filled up arrow */
488 { 0xe112, 0, 0, 0x87 }, /* filled down arrow */
489 { 0xe113, 0, 0, 0x24 }, /* level 0/7 */
490 { 0xe114, 0, 0, 0x15 }, /* level 1/7 */
491 { 0xe115, 0, 0, 0xdf }, /* level 2/7 */
492 { 0xe116, 0, 0, 0xe0 }, /* level 3/7 */
493 { 0xe117, 0, 0, 0xe1 }, /* level 4/7 */
494 { 0xe118, 0, 0, 0xe2 }, /* level 5/7 */
495 { 0xe119, 0, 0, 0xe3 }, /* level 6/7 */
496 { 0xe11a, 0, 0, 0xec }, /* level 7/7 */
497#endif /* !BOOTLOADER */
498
499 /* no-char symbol */
500 { 0xfffd, 0, 0, 0xd8 },
501};
502
503const unsigned char xfont_fixed[][8] = {
504 /* Standard ascii */
505 { 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00}, /* 0x000 \ */
506 { 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x001 ` */
507 { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00}, /* 0x002 | */
508 { 0x00, 0x00, 0x08, 0x15, 0x02, 0x00, 0x00, 0x00}, /* 0x003 ~ */
509
510#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
511 /* Icons and special symbols */
512 { 0x0c, 0x12, 0x12, 0x08, 0x08, 0x00, 0x08, 0x00}, /* 0x004 unknown icon */
513 { 0x00, 0x03, 0x07, 0x0e, 0x1c, 0x08, 0x00, 0x00}, /* 0x005 bookmark icon */
514 { 0x04, 0x1e, 0x07, 0x1f, 0x05, 0x01, 0x06, 0x00}, /* 0x006 plugin icon */
515 { 0x0c, 0x13, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x00}, /* 0x007 folder icon */
516 { 0x1f, 0x11, 0x1b, 0x15, 0x1b, 0x11, 0x1f, 0x00}, /* 0x008 firmware icon */
517 { 0x00, 0x1f, 0x15, 0x1f, 0x15, 0x1f, 0x00, 0x00}, /* 0x009 language icon */
518 { 0x03, 0x05, 0x09, 0x09, 0x0b, 0x1b, 0x18, 0x00}, /* 0x00a audio icon (note) */
519 { 0x01, 0x01, 0x02, 0x02, 0x14, 0x0c, 0x04, 0x00}, /* 0x00b wps icon */
520 { 0x17, 0x00, 0x17, 0x00, 0x17, 0x00, 0x17, 0x00}, /* 0x00c playlist icon */
521 { 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 0x00d text file icon */
522 { 0x0b, 0x10, 0x0b, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 0x00e config icon */
523 /* Latin 1 */
524 { 0x06, 0x09, 0x08, 0x1e, 0x08, 0x08, 0x1f, 0x00}, /* 0x00f (pound sign) */
525 { 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x010 (macron) */
526 { 0x04, 0x00, 0x04, 0x08, 0x10, 0x11, 0x0e, 0x00}, /* 0x011 (inverted ?) */
527 { 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x012 (A grave) */
528 { 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x013 (A acute) */
529 { 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x014 (a circumflex) */
530 { 0x0d, 0x12, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x015 (A tilde) */
531 { 0x0a, 0x00, 0x04, 0x0a, 0x11, 0x1f, 0x11, 0x00}, /* 0x016 (A dieresis) */
532 { 0x04, 0x0a, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x00}, /* 0x017 (A with ring above) */
533 { 0x0f, 0x14, 0x14, 0x1f, 0x14, 0x14, 0x17, 0x00}, /* 0x018 (AE ligature) */
534 { 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x02, 0x0e, 0x00}, /* 0x019 (C cedilla) */
535 { 0x08, 0x04, 0x1f, 0x10, 0x1e, 0x10, 0x1f, 0x00}, /* 0x01a (E grave) */
536 { 0x02, 0x04, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01b (E acute) */
537 { 0x04, 0x0a, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01c (E circumflex) */
538 { 0x0a, 0x00, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01d (E dieresis)*/
539 { 0x08, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 0x01e (I grave) */
540 { 0x02, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 0x01f (I acute) */
541 { 0x0c, 0x0a, 0x09, 0x1d, 0x09, 0x0a, 0x0c, 0x00}, /* 0x020 (ETH) */
542 { 0x0d, 0x12, 0x00, 0x19, 0x15, 0x13, 0x11, 0x00}, /* 0x021 (N tilde) */
543 { 0x08, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x022 (O grave) */
544 { 0x02, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x023 (O acute) */
545 { 0x04, 0x0a, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x024 (O circumflex) */
546 { 0x0d, 0x12, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x025 (O tilde) */
547 { 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x026 (O dieresis) */
548 { 0x01, 0x0e, 0x13, 0x15, 0x19, 0x0e, 0x10, 0x00}, /* 0x027 (O stroke) */
549 { 0x08, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x028 (U grave) */
550 { 0x02, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x029 (U acute) */
551 { 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x02a (U dieresis) */
552 { 0x08, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02b (a grave) */
553 { 0x02, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02c (a acute) */
554 { 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02d (a circumflex) */
555 { 0x0d, 0x12, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02e (a tilde) */
556 { 0x0a, 0x00, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02f (a dieresis) */
557 { 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x030 (a with ring above) */
558 { 0x00, 0x0f, 0x10, 0x10, 0x0f, 0x02, 0x04, 0x00}, /* 0x031 (c cedilla) */
559 { 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x032 (e grave) */
560 { 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x033 (e acute) */
561 { 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x034 (e circumflex) */
562 { 0x0a, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x035 (e dieresis) */
563 { 0x02, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x036 (i acute) */
564 { 0x04, 0x0a, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x037 (i circumflex) */
565 { 0x0a, 0x00, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x038 (i dieresis) */
566 { 0x0d, 0x12, 0x00, 0x16, 0x19, 0x11, 0x11, 0x00}, /* 0x039 (n tilde) */
567 { 0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03a (o grave) */
568 { 0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03b (o acute) */
569 { 0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03c (o circumflex) */
570 { 0x0d, 0x12, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03d (o tilde) */
571 { 0x00, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03e (o dieresis) */
572 { 0x00, 0x02, 0x0e, 0x15, 0x15, 0x0e, 0x08, 0x00}, /* 0x03f (o slash) */
573 { 0x08, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x040 (u grave) */
574 { 0x02, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x041 (u acute) */
575 { 0x00, 0x0a, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x042 (u dieresis) */
576 { 0x02, 0x04, 0x11, 0x11, 0x0f, 0x01, 0x0e, 0x00}, /* 0x043 (y acute) */
577#endif /* !BOOTLOADER */
578};
579
580void lcd_charset_init(void)
581{
582 if (is_new_player())
583 {
584 hw_pattern_count = 8;
585 xchar_info = xchar_info_newlcd;
586 xchar_info_size = sizeof(xchar_info_newlcd)/sizeof(struct xchar_info);
587 }
588 else /* old lcd */
589 {
590 hw_pattern_count = 4;
591 xchar_info = xchar_info_oldlcd;
592 xchar_info_size = sizeof(xchar_info_oldlcd)/sizeof(struct xchar_info);
593 }
594}
diff --git a/firmware/drivers/lcd-player-charset.c b/firmware/drivers/lcd-player-charset.c
deleted file mode 100644
index 790f0df1c4..0000000000
--- a/firmware/drivers/lcd-player-charset.c
+++ /dev/null
@@ -1,751 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Kjell Ericson
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifndef __CONFIG_H__
20/* to easier allow this source file to be used even from tools when config.h
21 cannot be included safely */
22#include "config.h"
23#endif
24
25#ifdef HAVE_LCD_CHARCELLS
26
27#include "lcd-player-charset.h"
28
29unsigned short new_lcd_rocklatin1_to_xlcd[] =
30{
31 NOCHAR_NEW, /* 0x00 reserved never to be used */
32 RESERVED_CHAR, /* reserved */
33 RESERVED_CHAR, /* reserved */
34 RESERVED_CHAR, /* reserved */
35 RESERVED_CHAR, /* reserved */
36 RESERVED_CHAR, /* reserved */
37 RESERVED_CHAR, /* reserved */
38 RESERVED_CHAR, /* reserved */
39 RESERVED_CHAR, /* reserved */
40 RESERVED_CHAR, /* reserved */
41 RESERVED_CHAR, /* reserved */
42 RESERVED_CHAR, /* reserved */
43 RESERVED_CHAR, /* reserved */
44 RESERVED_CHAR, /* reserved */
45 RESERVED_CHAR, /* reserved */
46 RESERVED_CHAR, /* reserved */
47 RESERVED_CHAR, /* reserved */
48 RESERVED_CHAR, /* reserved */
49 RESERVED_CHAR, /* reserved */
50 RESERVED_CHAR, /* reserved */
51 RESERVED_CHAR, /* reserved */
52 RESERVED_CHAR, /* reserved */
53 0x216, /* 0x16 .. "bookmark" icon */
54 0x217, /* 0x17 .. "plugin" icon */
55 0x218, /* 0x18 .. "folder" icon */
56 0x219, /* 0x19 .. "MOD/AJZ" icon (winlatin o (dote in the middle) */
57 0x21a, /* 0x1a .. "language" icon (winlatin - (a bit longer minus sign) */
58 0x21b, /* 0x1b .. "note" icon */
59 0x21c, /* 0x1c .. "WPS" icon */
60 0x21d, /* 0x1d .. "playlist" icon */
61 0x21e, /* 0x1e .. "text file" icon (winlatin - (much longer minus sign) */
62 0x21f, /* 0x1f .. "config file" icon (winlatin ~) */
63
64 0x020, /* 0x20 .. */
65 0x021, /* 0x21 .. ! */
66 0x022, /* 0x22 .. " */
67 0x023, /* 0x23 .. # */
68 0x024, /* 0x24 .. $ */
69 0x025, /* 0x25 .. % */
70 0x026, /* 0x26 .. & */
71 0x027, /* 0x27 .. ' */
72 0x028, /* 0x28 .. ( */
73 0x029, /* 0x29 .. ) */
74 0x02a, /* 0x2a .. * */
75 0x02b, /* 0x2b .. + */
76 0x02c, /* 0x2c .. , */
77 0x02d, /* 0x2d .. - */
78 0x02e, /* 0x2e .. . */
79 0x02f, /* 0x2f .. / */
80 0x030, /* 0x30 .. 0 */
81 0x031, /* 0x31 .. 1 */
82 0x032, /* 0x32 .. 2 */
83 0x033, /* 0x33 .. 3 */
84 0x034, /* 0x34 .. 4 */
85 0x035, /* 0x35 .. 5 */
86 0x036, /* 0x36 .. 6 */
87 0x037, /* 0x37 .. 7 */
88 0x038, /* 0x38 .. 8 */
89 0x039, /* 0x39 .. 9 */
90 0x03a, /* 0x3a .. : */
91 0x03b, /* 0x3b .. ; */
92 0x03c, /* 0x3c .. < */
93 0x03d, /* 0x3d .. = */
94 0x03e, /* 0x3e .. > */
95 0x03f, /* 0x3f .. ? */
96 0x040, /* 0x40 .. @ */
97 0x041, /* 0x41 .. A */
98 0x042, /* 0x42 .. B */
99 0x043, /* 0x43 .. C */
100 0x044, /* 0x44 .. D */
101 0x045, /* 0x45 .. E */
102 0x046, /* 0x46 .. F */
103 0x047, /* 0x47 .. G */
104 0x048, /* 0x48 .. H */
105 0x049, /* 0x49 .. I */
106 0x04a, /* 0x4a .. J */
107 0x04b, /* 0x4b .. K */
108 0x04c, /* 0x4c .. L */
109 0x04d, /* 0x4d .. M */
110 0x04e, /* 0x4e .. N */
111 0x04f, /* 0x4f .. O */
112 0x050, /* 0x50 .. P */
113 0x051, /* 0x51 .. Q */
114 0x052, /* 0x52 .. R */
115 0x053, /* 0x53 .. S */
116 0x054, /* 0x54 .. T */
117 0x055, /* 0x55 .. U */
118 0x056, /* 0x56 .. V */
119 0x057, /* 0x57 .. W */
120 0x058, /* 0x58 .. X */
121 0x059, /* 0x59 .. Y */
122 0x05a, /* 0x5a .. Z */
123 0x05b, /* 0x5b .. [ */
124 0x012, /* 0x5c .. \ */
125 0x05d, /* 0x5d .. ] */
126 0x05e, /* 0x5e .. ^ */
127 0x05f, /* 0x5f .. _ */
128 0x060, /* 0x60 .. ` */
129 0x061, /* 0x00 97 .. a */
130 0x062, /* 0x00 98 .. b */
131 0x063, /* 0x00 99 .. c */
132 0x064, /* 0x64 .. d */
133 0x065, /* 0x65 .. e */
134 0x066, /* 0x66 .. f */
135 0x067, /* 0x67 .. g */
136 0x068, /* 0x68 .. h */
137 0x069, /* 0x69 .. i */
138 0x06a, /* 0x6a .. j */
139 0x06b, /* 0x6b .. k */
140 0x06c, /* 0x6c .. l */
141 0x06d, /* 0x6d .. m */
142 0x06e, /* 0x6e .. n */
143 0x06f, /* 0x6f .. o */
144 0x070, /* 0x70 .. p */
145 0x071, /* 0x71 .. q */
146 0x072, /* 0x72 .. r */
147 0x073, /* 0x73 .. s */
148 0x074, /* 0x74 .. t */
149 0x075, /* 0x75 .. u */
150 0x076, /* 0x76 .. v */
151 0x077, /* 0x77 .. w */
152 0x078, /* 0x78 .. x */
153 0x079, /* 0x79 .. y */
154 0x07a, /* 0x7a .. z */
155 0x07b, /* 0x7b ..*/ /* Old LCD hardcoded to "(" */
156 0x07c, /* 0x7c .. | */
157 0x07d, /* 0x7d .. } */ /* Old LCD hardcoded to ")" */
158 0x0f0, /* 0x7e .. ~ */
159 0x0fe, /* 0x7f .. full grid */
160 NOCHAR_NEW, /* 0x80 winlatin Eurosign */
161 0x010, /* 0x81 filled-left-arrow (winlatin undefined) */
162 0x011, /* 0x82 filled-right-arrow (winlatin comma) */
163 0x01e, /* 0x83 filled-up-arrow (winlatin f) */
164 0x01f, /* 0x84 filled-up-arrow (winlatin ") */
165 0x224, /* 0x85 .. (three dots) */
166 0x081, /* 0x86 meter level 2 (winlatin undefined) */
167 0x082, /* 0x87 meter level 3 (winlatin undefined) */
168 0x083, /* 0x88 meter level 4 (winlatin undefined) */
169 0x084, /* 0x89 meter level 5 (winlatin Promille) */
170 0x085, /* 0x8a meter level 6 (winlatin 'S' with upside down ^) */
171 0x086, /* 0x8b meter level 7 (full) (winlatin '<') */
172 NOCHAR_NEW, /* 0x8c .. CE */
173 NOCHAR_NEW, /* 0x8d .. */
174 0x225, /* 0x8e .. 'Z' with upside down ^ */
175 NOCHAR_NEW, /* 0x8f .. */
176 0x25d, /* 0x90 "unknown" icon */
177 0x094, /* 0x91 .. */
178 0x07e, /* 0x92 .. */
179 0x091, /* 0x93 .. folder icon susbstitute */
180 0x013, /* 0x94 .. note icon substitute */
181 0x0d0, /* 0x95 .. text/language/config icon substitute (winlatin o (dote in the middle) */
182 NOCHAR_NEW, /* 0x96 .. (winlatin - (a bit longer minus sign) */
183 NOCHAR_NEW, /* 0x97 .. (winlatin - (much longer minus sign) */
184 NOCHAR_NEW, /* 0x98 .. (winlatin ~) */
185 NOCHAR_NEW, /* 0x99 .. (winlatin TM) */
186 NOCHAR_NEW, /* 0x9a .. 's' with upside down ^ */
187 NOCHAR_NEW, /* 0x9b .. > */
188 NOCHAR_NEW, /* 0x9c .. oe */
189 NOCHAR_NEW, /* 0x9d .. */
190 0x225, /* 0x9e .. 'z' with upside down ^ */
191 0x059, /* 0x9f .. Large (Y with two dots) */
192 NOCHAR_NEW, /* 0xa0 .. */
193 NOCHAR_NEW, /* 0xa1 .. */
194 NOCHAR_NEW, /* 0xa2 .. */
195 0x226, /* 0xa3 .. */
196 NOCHAR_NEW, /* 0xa4 .. */
197 NOCHAR_NEW, /* 0xa5 .. */
198 NOCHAR_NEW, /* 0xa6 .. */
199 0x015, /* 0xa7 .. */
200 NOCHAR_NEW, /* 0xa8 .. */
201 NOCHAR_NEW, /* 0xa9 .. (copyright) */
202 NOCHAR_NEW, /* 0xaa .. */
203 NOCHAR_NEW, /* 0xab .. "<<" */
204 NOCHAR_NEW, /* 0xac .. (unknown) */
205 NOCHAR_NEW, /* 0xad .. (unkown1 */
206 NOCHAR_NEW, /* 0xae .. (register)*/
207 0x228, /* 0xaf .. */
208 NOCHAR_NEW, /* 0xb0 .. */
209 NOCHAR_NEW, /* 0xb1 .. */
210 NOCHAR_NEW, /* 0xb2 .. */
211 NOCHAR_NEW, /* 0xb3 .. */
212 NOCHAR_NEW, /* 0xb4 .. */
213 NOCHAR_NEW, /* 0xb5 .. */
214 NOCHAR_NEW, /* 0xb6 .. 1 */
215 NOCHAR_NEW, /* 0xb7 .. */
216 NOCHAR_NEW, /* 0xb8 .. */
217 NOCHAR_NEW, /* 0xb9 .. */
218 NOCHAR_NEW, /* 0xba .. */
219 NOCHAR_NEW, /* 0xbb .. " */
220 NOCHAR_NEW, /* 0xbc .. */
221 NOCHAR_NEW, /* 0xbd .. */
222 NOCHAR_NEW, /* 0xbe .. */
223 0x229, /* 0xbf .. */
224 0x22a, /* 0xc0 .. */
225 0x22b, /* 0xc1 .. */
226 0x22c, /* 0xc2 .. */
227 0x22d, /* 0xc3 .. */
228 0x22e, /* 0xc4 .. */
229 0x22f, /* 0xc5 .. */
230 0x230, /* 0xc6 .. */
231 0x231, /* 0xc7 .. */
232 0x232, /* 0xc8 .. */
233 0x233, /* 0xc9 .. */
234 0x234, /* 0xca .. */
235 0x235, /* 0xcb .. */
236 0x236, /* 0xcc .. */
237 0x237, /* 0xcd .. */
238 0x049, /* 0xce .. */
239 0x049, /* 0xcf .. */
240 0x238, /* 0xd0 .. */
241 0x239, /* 0xd1 .. */
242 0x23a, /* 0xd2 .. */
243 0x23b, /* 0xd3 .. */
244 0x23c, /* 0xd4 .. */
245 0x23d, /* 0xd5 .. */
246 0x23e, /* 0xd6 .. */
247 0x23f, /* 0xd7 .. */
248 0x240, /* 0xd8 .. */
249 0x241, /* 0xd9 .. */
250 0x242, /* 0xda .. */
251 0x055, /* 0xdb .. */
252 0x243, /* 0xdc .. */
253 0x059, /* 0xdd .. */
254 NOCHAR_NEW, /* 0xde .. */
255 0x244, /* 0xdf .. */
256 0x245, /* 0xe0 .. */
257 0x246, /* 0xe1 .. */
258 0x247, /* 0xe2 .. */
259 0x248, /* 0xe3 .. */
260 0x249, /* 0xe4 .. */
261 0x24a, /* 0xe5 .. */
262 NOCHAR_NEW, /* 0xe6 .. */
263 0x24b, /* 0xe7 .. */
264 0x24c, /* 0xe8 .. */
265 0x24d, /* 0xe9 .. */
266 0x24e, /* 0xea .. */
267 0x24f, /* 0xeb .. */
268 0x069, /* 0xec .. */
269 0x250, /* 0xed .. */
270 0x251, /* 0xee .. */
271 0x252, /* 0xef .. */
272 NOCHAR_NEW, /* 0xf0 .. */
273 0x253, /* 0xf1 .. */
274 0x23a, /* 0xf2 .. */
275 0x254, /* 0xf3 .. */
276 0x255, /* 0xf4 .. */
277 0x256, /* 0xf5 .. */
278 0x257, /* 0xf6 .. */
279 NOCHAR_NEW, /* 0xf7 .. */
280 0x258, /* 0xf8 .. */
281 0x259, /* 0xf9 .. */
282 0x25a, /* 0xfa .. */
283 0x075, /* 0xfb .. */
284 0x25b, /* 0xfc .. */
285 0x25c, /* 0xfd .. */
286 NOCHAR_NEW, /* 0xfe .. */
287 0x079, /* 0xff .. */
288};
289
290unsigned short old_lcd_rocklatin1_to_xlcd[] =
291{
292 /* OLD LCD */
293 NOCHAR_OLD, /* 0x00 reserved never to be used */
294 RESERVED_CHAR, /* reserved */
295 RESERVED_CHAR, /* reserved */
296 RESERVED_CHAR, /* reserved */
297 RESERVED_CHAR, /* reserved */
298 RESERVED_CHAR, /* reserved */
299 RESERVED_CHAR, /* reserved */
300 RESERVED_CHAR, /* reserved */
301 RESERVED_CHAR, /* reserved */
302 RESERVED_CHAR, /* reserved */
303 RESERVED_CHAR, /* reserved */
304 RESERVED_CHAR, /* reserved */
305 RESERVED_CHAR, /* reserved */
306 RESERVED_CHAR, /* reserved */
307 RESERVED_CHAR, /* reserved */
308 RESERVED_CHAR, /* reserved */
309 RESERVED_CHAR, /* reserved */
310 RESERVED_CHAR, /* reserved */
311 RESERVED_CHAR, /* reserved */
312 RESERVED_CHAR, /* reserved */
313 RESERVED_CHAR, /* reserved */
314 RESERVED_CHAR, /* reserved */
315 0x216, /* 0x16 .. "bookmark" icon */
316 0x217, /* 0x17 .. "plugin" icon */
317 0x218, /* 0x18 .. "folder" icon */
318 0x219, /* 0x19 .. "MOD/AJZ" icon (winlatin o (dote in the middle) */
319 0x21a, /* 0x1a .. "language" icon (winlatin - (a bit longer minus sign) */
320 0x0fc, /* 0x1b .. "note" icon */
321 0x0d4, /* 0x1c .. "WPS" icon */
322 0x21d, /* 0x1d .. "playlist" icon */
323 0x21e, /* 0x1e .. "text file" icon (winlatin - (much longer minus sign) */
324 0x21f, /* 0x1f .. "config file" icon (winlatin ~) */
325 0x024, /* 0x20 .. */
326 0x025, /* 0x21 .. ! */
327 0x026, /* 0x22 .. " */
328 0x027, /* 0x23 .. # */
329 0x006, /* 0x24 .. $ */
330 0x029, /* 0x25 .. % */
331 0x02a, /* 0x26 .. & */
332 0x02b, /* 0x27 .. ' */
333 0x02c, /* 0x28 .. ( */
334 0x02d, /* 0x29 .. ) */
335 0x02e, /* 0x2a .. * */
336 0x02f, /* 0x2b .. + */
337 0x030, /* 0x2c .. , */
338 0x031, /* 0x2d .. - */
339 0x032, /* 0x2e .. . */
340 0x033, /* 0x2f .. / */
341 0x034, /* 0x30 .. 0 */
342 0x035, /* 0x31 .. 1 */
343 0x036, /* 0x32 .. 2 */
344 0x037, /* 0x33 .. 3 */
345 0x038, /* 0x34 .. 4 */
346 0x039, /* 0x35 .. 5 */
347 0x03a, /* 0x36 .. 6 */
348 0x03b, /* 0x37 .. 7 */
349 0x03c, /* 0x38 .. 8 */
350 0x03d, /* 0x39 .. 9 */
351 0x03e, /* 0x3a .. : */
352 0x03f, /* 0x3b .. ; */
353 0x040, /* 0x3c .. < */
354 0x041, /* 0x3d .. = */
355 0x042, /* 0x3e .. > */
356 0x043, /* 0x3f .. ? */
357 0x004, /* 0x40 .. @ */
358 0x045, /* 0x41 .. A */
359 0x046, /* 0x42 .. B */
360 0x047, /* 0x43 .. C */
361 0x048, /* 0x44 .. D */
362 0x049, /* 0x45 .. E */
363 0x04a, /* 0x46 .. F */
364 0x04b, /* 0x47 .. G */
365 0x04c, /* 0x48 .. H */
366 0x04d, /* 0x49 .. I */
367 0x04e, /* 0x4a .. J */
368 0x04f, /* 0x4b .. K */
369 0x050, /* 0x4c .. L */
370 0x051, /* 0x4d .. M */
371 0x052, /* 0x4e .. N */
372 0x053, /* 0x4f .. O */
373 0x054, /* 0x50 .. P */
374 0x055, /* 0x51 .. Q */
375 0x056, /* 0x52 .. R */
376 0x057, /* 0x53 .. S */
377 0x058, /* 0x54 .. T */
378 0x059, /* 0x55 .. U */
379 0x05a, /* 0x56 .. V */
380 0x05b, /* 0x57 .. W */
381 0x05c, /* 0x58 .. X */
382 0x05d, /* 0x59 .. Y */
383 0x05e, /* 0x5a .. Z */
384 0x0a9, /* 0x5b .. [ */ /* New LCD hardcoded to "(" */
385 0x220, /* 0x5c .. \ */
386 0x0ce, /* 0x5d .. ] */ /* New LCD hardcoded to ")" */
387 NOCHAR_OLD, /* 0x5e .. ^ */
388 0x015, /* 0x5f .. _ */
389 0x221, /* 0x60 .. ` */
390 0x065, /* 0x00 97 .. a */
391 0x066, /* 0x00 98 .. b */
392 0x067, /* 0x00 99 .. c */
393 0x068, /* 0x64 .. d */
394 0x069, /* 0x65 .. e */
395 0x06a, /* 0x66 .. f */
396 0x06b, /* 0x67 .. g */
397 0x06c, /* 0x68 .. h */
398 0x06d, /* 0x69 .. i */
399 0x06e, /* 0x6a .. j */
400 0x06f, /* 0x6b .. k */
401 0x070, /* 0x6c .. l */
402 0x071, /* 0x6d .. m */
403 0x072, /* 0x6e .. n */
404 0x073, /* 0x6f .. o */
405 0x074, /* 0x70 .. p */
406 0x075, /* 0x71 .. q */
407 0x076, /* 0x72 .. r */
408 0x077, /* 0x73 .. s */
409 0x078, /* 0x74 .. t */
410 0x079, /* 0x75 .. u */
411 0x07a, /* 0x76 .. v */
412 0x07b, /* 0x77 .. w */
413 0x07c, /* 0x78 .. x */
414 0x07d, /* 0x79 .. y */
415 0x07e, /* 0x7a .. z */
416 0x02c, /* 0x7b ..*/ /* Old LCD hardcoded to "(" */
417 0x222, /* 0x7c .. | */
418 0x02d, /* 0x7d .. } */ /* Old LCD hardcoded to ")" */
419 0x223, /* 0x7e .. ~ */
420 0x08b, /* 0x7f full grid */
421 NOCHAR_OLD, /* 0x80 winlatin Eurosign */
422 0x089, /* 0x81 filled-left-arrow (winlatin undefined) */
423 0x088, /* 0x82 filled-right-arrow (winlatin comma) */
424 0x087, /* 0x83 filled-up-arrow (winlatin f) */
425 0x086, /* 0x84 filled-up-arrow (winlatin ") */
426 0x085, /* 0x85 .. (three dots) */
427 0x0df, /* 0x86 meter level 2 (winlatin undefined) */
428 0x0e0, /* 0x87 meter level 3 (winlatin undefined) */
429 0x0e1, /* 0x88 meter level 4 (winlatin undefined) */
430 0x0e2, /* 0x89 meter level 5 (winlatin Promille) */
431 0x0e3, /* 0x8a meter level 6 (winlatin 'S' with upside down ^) */
432 0x0ec, /* 0x8a meter level 7 (full) (winlatin '<') */
433 NOCHAR_OLD, /* 0x8c .. CE */
434 NOCHAR_OLD, /* 0x8d .. */
435 0x0bd, /* 0x8e .. 'Z' with upside down ^ */
436 NOCHAR_OLD, /* 0x8f .. */
437 0x25d, /* 0x90 "unknown" icon */
438 0x0d4, /* 0x91 .. */
439 0x089, /* 0x92 .. */
440 0x034, /* 0x93 .. folder icon substitute */
441 0x0fc, /* 0x94 .. note icon substitute */
442 0x0fa, /* 0x95 .. text/language/config icon substitute (winlatin o (dote in the middle) */
443 NOCHAR_OLD, /* 0x96 .. (winlatin - (a bit longer minus sign) */
444 NOCHAR_OLD, /* 0x97 .. (winlatin - (much longer minus sign) */
445 NOCHAR_OLD, /* 0x98 .. (winlatin ~) */
446 NOCHAR_OLD, /* 0x99 .. (winlatin TM) */
447 NOCHAR_OLD, /* 0x9a .. 's' with upside down ^ */
448 NOCHAR_OLD, /* 0x9b .. > */
449 NOCHAR_OLD, /* 0x9c .. oe */
450 NOCHAR_OLD, /* 0x9d .. */
451 0x0bd, /* 0x9e .. 'z' with upside down ^ */
452 NOCHAR_OLD, /* 0x9f .. Large (Y with two dots) */
453 NOCHAR_OLD, /* 0xa0 .. */
454 NOCHAR_OLD, /* 0xa1 .. */
455 NOCHAR_OLD, /* 0xa2 .. */
456 0x005, /* 0xa3 .. */
457 NOCHAR_OLD, /* 0xa4 .. */
458 NOCHAR_OLD, /* 0xa5 .. */
459 NOCHAR_OLD, /* 0xa6 .. */
460 0x063, /* 0xa7 .. */
461 NOCHAR_OLD, /* 0xa8 .. */
462 NOCHAR_OLD, /* 0xa9 .. (copyright) */
463 NOCHAR_OLD, /* 0xaa .. */
464 NOCHAR_OLD, /* 0xab .. "<<" */
465 NOCHAR_OLD, /* 0xac .. (unknown) */
466 NOCHAR_OLD, /* 0xad .. (unkown1 */
467 NOCHAR_OLD, /* 0xae .. (register)*/
468 0x0ee, /* 0xaf .. */
469 NOCHAR_OLD, /* 0xb0 .. */
470 NOCHAR_OLD, /* 0xb1 .. */
471 NOCHAR_OLD, /* 0xb2 .. */
472 NOCHAR_OLD, /* 0xb3 .. */
473 NOCHAR_OLD, /* 0xb4 .. */
474 NOCHAR_OLD, /* 0xb5 .. */
475 NOCHAR_OLD, /* 0xb6 .. 1 */
476 NOCHAR_OLD, /* 0xb7 .. */
477 NOCHAR_OLD, /* 0xb8 .. */
478 NOCHAR_OLD, /* 0xb9 .. */
479 NOCHAR_OLD, /* 0xba .. */
480 NOCHAR_OLD, /* 0xbb .. " */
481 NOCHAR_OLD, /* 0xbc .. */
482 NOCHAR_OLD, /* 0xbd .. */
483 NOCHAR_OLD, /* 0xbe .. */
484 0x064, /* 0xbf .. */
485 0x08c, /* 0xc0 .. */
486 0x08d, /* 0xc1 .. */
487 0x08e, /* 0xc2 .. */
488 0x08f, /* 0xc3 .. */
489 0x05f, /* 0xc4 .. */
490 0x012, /* 0xc5 .. */
491 0x020, /* 0xc6 .. */
492 0x00d, /* 0xc7 .. */
493 0x090, /* 0xc8 .. */
494 0x023, /* 0xc9 .. */
495 0x091, /* 0xca .. */
496 0x092, /* 0xcb .. */
497 0x093, /* 0xcc .. */
498 0x094, /* 0xcd .. */
499 0x049, /* 0xce .. */
500 0x049, /* 0xcf .. */
501 0x095, /* 0xd0 .. */
502 0x061, /* 0xd1 .. */
503 0x096, /* 0xd2 .. */
504 0x097, /* 0xd3 .. */
505 0x098, /* 0xd4 .. */
506 0x099, /* 0xd5 .. */
507 0x060, /* 0xd6 .. */
508 0x0de, /* 0xd7 .. */
509 0x00f, /* 0xd8 .. */
510 0x09a, /* 0xd9 .. */
511 0x09b, /* 0xda .. */
512 0x059, /* 0xdb .. */
513 0x062, /* 0xdc .. */
514 0x0af, /* 0xdd .. */
515 NOCHAR_OLD, /* 0xde .. */
516 0x022, /* 0xdf .. */
517 0x083, /* 0xe0 .. */
518 0x09c, /* 0xe1 .. */
519 0x09d, /* 0xe2 .. */
520 0x09e, /* 0xe3 .. */
521 0x07f, /* 0xe4 .. */
522 0x09d, /* 0xe5 .. */
523 NOCHAR_OLD, /* 0xe6 .. */
524 0x084, /* 0xe7 .. */
525 0x008, /* 0xe8 .. */
526 0x009, /* 0xe9 .. */
527 0x09f, /* 0xea .. */
528 0x0a0, /* 0xeb .. */
529 0x06d, /* 0xec .. */
530 0x0a1, /* 0xed .. */
531 0x0a2, /* 0xee .. */
532 0x0a3, /* 0xef .. */
533 NOCHAR_OLD, /* 0xf0 .. */
534 0x081, /* 0xf1 .. */
535 0x096, /* 0xf2 .. */
536 0x0a4, /* 0xf3 .. */
537 0x0a5, /* 0xf4 .. */
538 0x0a6, /* 0xf5 .. */
539 0x080, /* 0xf6 .. */
540 NOCHAR_OLD, /* 0xf7 .. */
541 0x010, /* 0xf8 .. */
542 0x00a, /* 0xf9 .. */
543 0x0a7, /* 0xfa .. */
544 0x079, /* 0xfb .. */
545 0x082, /* 0xfc .. */
546 0x0af, /* 0xfd .. */
547 NOCHAR_OLD, /* 0xfe .. */
548 0x07d, /* 0xff .. */
549};
550
551/* second table -- substitute */
552const unsigned char
553 lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] =
554{
555/* 00 */ NOCHAR_NEW, /* 0-16 user defined */
556/* 01 */ NOCHAR_NEW, /* 0-16 user defined */
557/* 02 */ NOCHAR_NEW, /* 0-16 user defined */
558/* 03 */ NOCHAR_NEW, /* 0-16 user defined */
559/* 04 */ NOCHAR_NEW, /* 0-16 user defined */
560/* 05 */ NOCHAR_NEW, /* 0-16 user defined */
561/* 06 */ NOCHAR_NEW, /* 0-16 user defined */
562/* 07 */ NOCHAR_NEW, /* 0-16 user defined */
563/* 08 */ NOCHAR_NEW, /* 0-16 user defined */
564/* 09 */ NOCHAR_NEW, /* 0-16 user defined */
565/* 0a */ NOCHAR_NEW, /* 0-16 user defined */
566/* 0b */ NOCHAR_NEW, /* 0-16 user defined */
567/* 0c */ NOCHAR_NEW, /* 0-16 user defined */
568/* 0d */ NOCHAR_NEW, /* 0-16 user defined */
569/* 0e */ NOCHAR_NEW, /* 0-16 user defined */
570/* 0f */ NOCHAR_NEW, /* 0-16 user defined */
571/* 10 */ NOCHAR_NEW, /* reserved */
572/* 11 */ NOCHAR_NEW, /* reserved */
573/* 12 */ NOCHAR_NEW, /* reserved */
574/* 13 */ NOCHAR_NEW, /* reserved */
575/* 14 */ NOCHAR_NEW, /* reserved */
576/* 15 */ NOCHAR_NEW, /* reserved */
577/* 16 */ 0x91, /* bookmark icon */
578/* 17 */ 0x29, /* plugin icon */
579/* 18 */ 0x93, /* folder icon */
580/* 19 */ 'x', /* MOD/AJZ icon */
581/* 1a */ '+', /* language icon */
582/* 1b */ 0x94, /* note icon */
583/* 1c */ 0x91, /* WPS icon */
584/* 1d */ 0x95, /* playlist icon */
585/* 1e */ 0x95, /* text file icon */
586/* 1f */ 0x95, /* config file icon */
587/* 20 */ '/', /* substitute char for old lcd \ */
588/* 21 */ '\'', /* substitute char for old lcd ` */
589/* 22 */ '!', /* substitute char for old lcd | */
590/* 23 */ '-', /* substitute char for old lcd ~ */
591/* 24 */ '.', /* substitute char for new lcd (three dots) */
592/* 25 */ 'z', /* substitue char for new lcd (0x0bd) 'z' with upside down ^ */
593/* 26 */ 'L', /* substitue char for new lcd (0x005) */
594/* 27 */ NOCHAR_NEW, /* empty */
595/* 28 */ '-', /* substitue char for new lcd (0x0ee) */
596/* 29 */ '?', /* substitue char for new lcd (0x064) */
597/* 2a */ 'A', /* substitue char for new lcd (0x08c) */
598/* 2b */ 'A', /* substitue char for new lcd (0x08d) */
599/* 2c */ 'A', /* substitue char for new lcd (0x08e) */
600/* 2d */ 'A', /* substitue char for new lcd (0x08e) */
601/* 2e */ 'A', /* substitue char for new lcd (0x05f) */
602/* 2f */ 'A', /* substitue char for new lcd (0x012) */
603/* 30 */ 'A', /* substitue char for new lcd (0x020) */
604/* 31 */ 'C', /* substitue char for new lcd (0x00d) */
605/* 32 */ 'E', /* substitue char for new lcd (0x090) */
606/* 33 */ 'E', /* substitue char for new lcd (0x023) */
607/* 34 */ 'E', /* substitue char for new lcd (0x091) */
608/* 35 */ 'E', /* substitue char for new lcd (0x092) */
609/* 36 */ 'I', /* substitue char for new lcd (0x093) */
610/* 37 */ 'I', /* substitue char for new lcd (0x094) */
611/* 38 */ 'D', /* substitue char for new lcd (0x095) */
612/* 39 */ 'N', /* substitue char for new lcd (0x061) */
613/* 3a */ 'O', /* substitue char for new lcd (0x096) */
614/* 3b */ 'O', /* substitue char for new lcd (0x097) */
615/* 3c */ 'O', /* substitue char for new lcd (0x098) */
616/* 3d */ 'O', /* substitue char for new lcd (0x099) */
617/* 3e */ 'O', /* substitue char for new lcd (0x060) */
618/* 3f */ 'x', /* substitue char for new lcd (0x0de) */
619/* 40 */ '0', /* substitue char for new lcd (0x00f) */
620/* 41 */ 'U', /* substitue char for new lcd (0x09a) */
621/* 42 */ 'U', /* substitue char for new lcd (0x09b) */
622/* 43 */ 'U', /* substitue char for new lcd (0x062) */
623/* 44 */ 'B', /* substitue char for new lcd (0x022) */
624/* 45 */ 'a', /* substitue char for new lcd (0x083) */
625/* 46 */ 'a', /* substitue char for new lcd (0x09c) */
626/* 47 */ 'a', /* substitue char for new lcd (0x09d) */
627/* 48 */ 'a', /* substitue char for new lcd (0x09e) */
628/* 49 */ 'a', /* substitue char for new lcd (0x07f) */
629/* 4a */ 'a', /* substitue char for new lcd (0x09d) */
630/* 4b */ 'c', /* substitue char for new lcd (0x084) */
631/* 4c */ 'e', /* substitue char for new lcd (0x008) */
632/* 4d */ 'e', /* substitue char for new lcd (0x009) */
633/* 4e */ 'e', /* substitue char for new lcd (0x09f) */
634/* 4f */ 'e', /* substitue char for new lcd (0x0a0) */
635/* 50 */ 'i', /* substitue char for new lcd (0x0a1) */
636/* 51 */ 'i', /* substitue char for new lcd (0x0a2) */
637/* 52 */ 'i', /* substitue char for new lcd (0x0a3) */
638/* 53 */ 'n', /* substitue char for new lcd (0x081) */
639/* 54 */ 'o', /* substitue char for new lcd (0x0a4) */
640/* 55 */ 'o', /* substitue char for new lcd (0x0a5) */
641/* 56 */ 'o', /* substitue char for new lcd (0x0a6) */
642/* 57 */ 'o', /* substitue char for new lcd (0x080) */
643/* 58 */ 'o', /* substitue char for new lcd (0x010) */
644/* 59 */ 'u', /* substitue char for new lcd (0x00a) */
645/* 5a */ 'u', /* substitue char for new lcd (0x0a7) */
646/* 5b */ 'u', /* substitue char for new lcd (0x082) */
647/* 5c */ 'y', /* substitue char for new lcd (0x0af) */
648/* 5d */ '?', /* unknown icon */
649
650};
651
652unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8] = {
653 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 00 */
654 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 01 */
655 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 02 */
656 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 03 */
657 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 04 */
658 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 05 */
659 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 06 */
660 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 07 */
661 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 08 */
662 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 09 */
663 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0a */
664 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0b */
665 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0c */
666 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0d */
667 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0e */
668 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0f */
669 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 10 */
670 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 11 */
671 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 12 */
672 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 13 */
673 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 14 */
674 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 15 */
675 { 0x00, 0x03, 0x07, 0x0e, 0x1c, 0x08, 0x00, 0x00}, /* 16 Bookmark icon */
676 { 0x04, 0x1e, 0x07, 0x1f, 0x05, 0x01, 0x06, 0x00}, /* 17 Plugin file icon */
677 { 0x0c, 0x13, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x00}, /* 18 Folder icon */
678 { 0x1f, 0x11, 0x1b, 0x15, 0x1b, 0x11, 0x1f, 0x00}, /* 19 MOD/AJZ icon */
679 { 0x00, 0x1f, 0x15, 0x1f, 0x15, 0x1f, 0x00, 0x00}, /* 1a Language icon */
680 { 0x03, 0x05, 0x09, 0x09, 0x0b, 0x1b, 0x18, 0x00}, /* 1b note icon */
681 { 0x01, 0x01, 0x02, 0x02, 0x14, 0x0c, 0x04, 0x00}, /* 1c WPS icon */
682 { 0x17, 0x00, 0x17, 0x00, 0x17, 0x00, 0x17, 0x00}, /* 1d Playlist icon */
683 { 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 1e Text file icon */
684 { 0x0b, 0x10, 0x0b, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 1f Config file icon */
685
686 /* Unprioritized chars follows below, least prioritized char last */
687 { 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00}, /* 20 '\' new lcd 0x12 */
688 { 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 21 '`' new lcd 0x60 */
689 { 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00}, /* 22 '|' new lcd 0x7c */
690 { 0x00, 0x00, 0x08, 0x15, 0x02, 0x00, 0x00, 0x00}, /* 23 '~' new lcd 0xf0 */
691 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00}, /* 24 old lcd 0x85 */
692 { 0x0a, 0x04, 0x1f, 0x02, 0x04, 0x08, 0x1f, 0x00}, /* 25 old lcd 0xbd */
693 { 0x06, 0x09, 0x08, 0x1e, 0x08, 0x08, 0x1f, 0x00}, /* 26 old lcd 0x05 */
694 { 0x0e, 0x10, 0x0e, 0x11, 0x0e, 0x01, 0x0e, 0x00}, /* 27 old lcd 0x63 */
695 { 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 28 old lcd 0xee */
696 { 0x04, 0x00, 0x04, 0x08, 0x10, 0x11, 0x0e, 0x00}, /* 29 old lcd 0x64 */
697 { 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2a old lcd 0x8c */
698 { 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2b old lcd 0x8d */
699 { 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2c old lcd 0x8e */
700 { 0x0d, 0x12, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2d old lcd 0x8f */
701 { 0x0a, 0x00, 0x04, 0x0a, 0x11, 0x1f, 0x11, 0x00}, /* 2e old lcd 0x5f */
702 { 0x04, 0x0a, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x00}, /* 2f old lcd 0x12 */
703 { 0x0f, 0x14, 0x14, 0x1f, 0x14, 0x14, 0x17, 0x00}, /* 30 old lcd 0x20 */
704 { 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x02, 0x0e, 0x00}, /* 31 old lcd 0x0d */
705 { 0x08, 0x04, 0x1f, 0x10, 0x1e, 0x10, 0x1f, 0x00}, /* 32 old lcd 0x90 */
706 { 0x02, 0x04, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 33 old lcd 0x23 */
707 { 0x04, 0x0a, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 34 old lcd 0x91 */
708 { 0x0a, 0x00, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 35 old lcd 0x92 */
709 { 0x08, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 36 old lcd 0x93 */
710 { 0x02, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 37 old lcd 0x94 */
711 { 0x0c, 0x0a, 0x09, 0x1d, 0x09, 0x0a, 0x0c, 0x00}, /* 38 old lcd 0x95 */
712 { 0x0d, 0x12, 0x00, 0x19, 0x15, 0x13, 0x11, 0x00}, /* 39 old lcd 0x61 */
713 { 0x08, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3a old lcd 0x96 */
714 { 0x02, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3b old lcd 0x97 */
715 { 0x04, 0x0a, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3c old lcd 0x98 */
716 { 0x0d, 0x12, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3d old lcd 0x99 */
717 { 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3e old lcd 0x60 */
718 { 0x00, 0x00, 0x00, 0x00, 0x0a, 0x04, 0x0a, 0x00}, /* 3f old lcd 0xde */
719 { 0x01, 0x0e, 0x13, 0x15, 0x19, 0x0e, 0x10, 0x00}, /* 40 old lcd 0x0f */
720 { 0x08, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 41 old lcd 0x9a */
721 { 0x02, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 42 old lcd 0x9b */
722 { 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 43 old lcd 0x62 */
723 { 0x0c, 0x12, 0x16, 0x11, 0x11, 0x16, 0x10, 0x00}, /* 44 old lcd 0x22 */
724 { 0x08, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 45 old lcd 0x83 */
725 { 0x02, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 46 old lcd 0x9c */
726 { 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 47 old lcd 0x9d */
727 { 0x0d, 0x12, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 48 old lcd 0x9e */
728 { 0x0a, 0x00, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 49 old lcd 0x7f */
729 { 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 4a old lcd 0x9d */
730 { 0x00, 0x0f, 0x10, 0x10, 0x0f, 0x02, 0x04, 0x00}, /* 4b old lcd 0x84 */
731 { 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4c old lcd 0x08 */
732 { 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4d old lcd 0x09 */
733 { 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4e old lcd 0x9f */
734 { 0x0a, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4f old lcd 0xa0 */
735 { 0x02, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 50 old lcd 0xa1 */
736 { 0x04, 0x0a, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 51 old lcd 0xa2 */
737 { 0x0a, 0x00, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 52 old lcd 0xa3 */
738 { 0x0d, 0x12, 0x00, 0x16, 0x19, 0x11, 0x11, 0x00}, /* 53 old lcd 0x81 */
739 { 0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 54 old lcd 0xa4 */
740 { 0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 55 old lcd 0xa5 */
741 { 0x0d, 0x12, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 56 old lcd 0xa6 */
742 { 0x00, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 57 old lcd 0x80 */
743 { 0x00, 0x02, 0x0e, 0x15, 0x15, 0x0e, 0x08, 0x00}, /* 58 old lcd 0x10 */
744 { 0x08, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 59 old lcd 0x0a */
745 { 0x02, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 5a old lcd 0xa7 */
746 { 0x00, 0x0a, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 5b old lcd 0x82 */
747 { 0x02, 0x04, 0x11, 0x11, 0x0f, 0x01, 0x0e, 0x00}, /* 5c old lcd 0xaf */
748 { 0x0c, 0x12, 0x12, 0x08, 0x08, 0x00, 0x08, 0x00}, /* 5d Unknown icon */
749};
750
751#endif /* HAVE_LCD_CHARCELLS */
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
deleted file mode 100644
index dd99246611..0000000000
--- a/firmware/drivers/lcd-player.c
+++ /dev/null
@@ -1,830 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "config.h"
20#include "hwcompat.h"
21
22#ifdef HAVE_LCD_CHARCELLS
23
24#include "lcd.h"
25#include "kernel.h"
26#include "thread.h"
27#include <string.h>
28#include <stdlib.h>
29#include "file.h"
30#include "debug.h"
31#include "system.h"
32#include "font.h"
33#include "lcd-player-charset.h"
34#include "rbunicode.h"
35
36/*** definitions ***/
37
38#define OLD_LCD_CONTRAST_SET ((char)0xA8)
39#define OLD_LCD_CRAM ((char)0xB0) /* Characters */
40#define OLD_LCD_PRAM ((char)0x80) /* Patterns */
41#define OLD_LCD_IRAM ((char)0xE0) /* Icons */
42
43#define NEW_LCD_CONTRAST_SET ((char)0x50)
44#define NEW_LCD_CRAM ((char)0x80) /* Characters */
45#define NEW_LCD_PRAM ((char)0xC0) /* Patterns */
46#define NEW_LCD_IRAM ((char)0x40) /* Icons */
47#define NEW_LCD_FUNCTION_SET ((char)0x10)
48#define NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET ((char)0x0c)
49#define NEW_LCD_POWER_CONTROL_REGISTER_SET ((char)0x20)
50#define NEW_LCD_DISPLAY_CONTROL_SET ((char)0x28)
51
52#define LCD_CURSOR(x,y) ((char)(lcd_cram+((y)*16+(x))))
53#define LCD_ICON(i) ((char)(lcd_iram+i))
54
55#define SCROLLABLE_LINES 2
56
57#define SCROLL_MODE_OFF 0
58#define SCROLL_MODE_PAUSE 1
59#define SCROLL_MODE_RUN 2
60
61extern unsigned short new_lcd_rocklatin1_to_xlcd[];
62extern unsigned short old_lcd_rocklatin1_to_xlcd[];
63extern const unsigned char lcd_player_extended_lcd_to_rocklatin1[];
64extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8];
65
66/*** generic code ***/
67
68#define MAX_CURSOR_CHARS 8
69struct cursorinfo {
70 int len;
71 char text[MAX_CURSOR_CHARS];
72 int textpos;
73 int y_pos;
74 int x_pos;
75 int divider;
76 int downcount;
77} cursor;
78
79static void scroll_thread(void);
80static char scroll_stack[DEFAULT_STACK_SIZE];
81static const char scroll_name[] = "scroll";
82static int scroll_ticks = 12; /* # of ticks between updates */
83static int scroll_delay = HZ/2; /* delay before starting scroll */
84static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */
85static int scroll_spacing = 3; /* spaces between end and start of text */
86static int bidir_limit = 50; /* percent */
87static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
88
89static struct scrollinfo scroll[SCROLLABLE_LINES];
90
91static char extended_chars_mapped[NO_EXTENDED_LCD_CHARS];
92static char extended_pattern_content[8]; /* Which char is mapped in pattern */
93static char extended_pattern_usage[8]; /* Counting number of times used */
94static char pattern_size; /* Last pattern, 3 for old LCD, 7 for new LCD */
95
96static bool new_lcd;
97
98unsigned short *lcd_ascii;
99static char lcd_contrast_set;
100static char lcd_cram;
101static char lcd_pram;
102static char lcd_iram;
103
104unsigned short buffer_xlcd[11][2];
105unsigned short buffer_lcd_mirror[11][2];
106
107#ifdef SIMULATOR
108unsigned char hardware_buffer_lcd[11][2];
109#endif
110
111#define NO_CHAR -1
112
113static void lcd_free_pat(int map_ch)
114{
115 int x, y;
116 unsigned char substitute_char;
117
118 int pat;
119 pat=extended_chars_mapped[map_ch];
120 if (pat!=NO_CHAR) {
121
122 substitute_char=lcd_player_extended_lcd_to_rocklatin1[map_ch];
123
124 /* TODO: use a define for the screen width! */
125 for (x=0; x<11; x++) {
126 /* TODO: use a define for the screen height! */
127 for (y=0; y<2; y++) {
128 if (map_ch==lcd_ascii[buffer_xlcd[x][y]]-512) {
129 buffer_xlcd[x][y]=substitute_char;
130 buffer_lcd_mirror[x][y]=substitute_char;
131#ifdef SIMULATOR
132 hardware_buffer_lcd[x][y]=substitute_char;
133#else
134 lcd_write_command_e(LCD_CURSOR(x, y), substitute_char);
135#endif
136 }
137 }
138 }
139 extended_chars_mapped[map_ch]=NO_CHAR;
140 extended_pattern_content[pat]=NO_CHAR;
141 extended_pattern_usage[pat]=0;
142 }
143#ifdef SIMULATOR
144 lcd_update();
145#endif
146}
147
148static int lcd_get_free_pat(int ch)
149{
150 int pat;
151 int last_pat=0;
152 static int last_used_pat=0;
153 int loop;
154
155 pat=last_used_pat;
156 for (loop=0; loop<=pattern_size; loop++) {
157 pat=(pat+1)&pattern_size; /* Keep 'pat' within limits */
158 if (extended_pattern_usage[pat]==0) {
159 int map_ch=extended_pattern_content[pat];
160 if (map_ch != NO_CHAR) {
161 extended_chars_mapped[map_ch]=NO_CHAR;
162 extended_pattern_content[pat]=NO_CHAR;
163 }
164 last_used_pat=pat;
165 return pat;
166 }
167 if (extended_pattern_content[pat]>extended_pattern_content[last_pat])
168 last_pat=pat;
169 }
170 if (ch<32) { /* Prioritized char */
171 /* Remove last_pat */
172 lcd_free_pat(extended_pattern_content[last_pat]);
173 last_used_pat=last_pat;
174 return last_pat;
175 }
176 return NO_CHAR;
177
178}
179
180void xlcd_update(void)
181{
182 int x, y;
183 for (x=0; x<11; x++) {
184 for (y=0; y<2; y++) {
185 unsigned short ch=buffer_xlcd[x][y];
186 unsigned char hw_ch=0xff;
187 if (ch==buffer_lcd_mirror[x][y])
188 continue; /* No need to redraw */
189 buffer_lcd_mirror[x][y]=ch;
190 if (ch>=256 && ch<512) {
191 hw_ch=ch-256;
192 } else {
193 int map_ch=lcd_ascii[ch];
194 if (map_ch<512) {
195 hw_ch=map_ch;
196 }
197 else {
198 map_ch=map_ch-512;
199 if (extended_chars_mapped[map_ch]!=NO_CHAR) {
200 hw_ch=extended_chars_mapped[map_ch];
201 extended_pattern_usage[hw_ch]++;
202 }
203 else {
204 int pat;
205 pat=lcd_get_free_pat(map_ch);
206 if (pat<0) {
207 /* Find substitute char */
208 map_ch=
209 lcd_player_extended_lcd_to_rocklatin1[map_ch];
210 hw_ch=lcd_ascii[map_ch];
211 } else {
212#ifdef DEBUG
213 if (extended_pattern_usage[pat]!=0) {
214 DEBUGF("***Pattern %d is not zero!\n", pat);
215 }
216#endif
217 extended_chars_mapped[map_ch]=pat;
218 extended_pattern_content[pat]=map_ch;
219 extended_pattern_usage[pat]=1;
220 lcd_define_hw_pattern(pat*8,
221 extended_font_player[map_ch],
222 8);
223 hw_ch=pat;
224 }
225 }
226 }
227 }
228#ifdef SIMULATOR
229 hardware_buffer_lcd[x][y]=hw_ch;
230#else
231 lcd_write_command_e(LCD_CURSOR(x,y), hw_ch);
232#endif
233 }
234 }
235 lcd_update();
236}
237
238bool lcdx_putc(int x, int y, unsigned short ch)
239{
240 int lcd_char;
241 if (buffer_xlcd[x][y]==ch)
242 return false; /* Same char, ignore any update */
243 lcd_char=lcd_ascii[buffer_xlcd[x][y]];
244 if (lcd_char>=512) {
245 /* The removed char is a defined pattern, count down the reference. */
246 extended_pattern_usage[(int)extended_chars_mapped[lcd_char-512]]--;
247#ifdef DEBUG
248 if (extended_pattern_usage[(int)extended_chars_mapped[lcd_char]]<0) {
249 DEBUGF("**** Mapped char %02x is less than 0!\n", lcd_char);
250 }
251#endif
252 }
253
254 buffer_xlcd[x][y]=ch;
255
256 lcd_char=lcd_ascii[ch];
257 if (lcd_char>=256)
258 return true; /* Caller shall call xlcd_update() when done */
259
260 buffer_lcd_mirror[x][y]=lcd_char;
261#ifdef SIMULATOR
262 hardware_buffer_lcd[x][y]=lcd_char;
263#else
264 lcd_write_command_e(LCD_CURSOR(x, y), lcd_char);
265#endif
266 return false;
267}
268
269void lcd_clear_display(void)
270{
271 int i;
272 bool update=false;
273 lcd_stop_scroll();
274 cursor.len=0; /* Stop cursor */
275 for (i=0;i<22;i++)
276 update|=lcdx_putc(i%11, i/11, ' ');
277 if (update)
278 xlcd_update();
279}
280
281static void lcd_puts_cont_scroll(int x, int y, const unsigned char *string)
282{
283 bool update=false;
284
285 for (; *string && x<11; x++)
286 {
287 /* We should check if char is over 256 */
288 update|=lcdx_putc(x, y, *(unsigned char*)string++);
289 }
290
291 for (; x<11; x++)
292 update|=lcdx_putc(x, y, ' ');
293 if (update)
294 xlcd_update();
295#ifdef SIMULATOR
296 lcd_update();
297#endif
298}
299void lcd_puts(int x, int y, const unsigned char *string)
300{
301 int i=0;
302 unsigned short ucs;
303 const unsigned char *utf8 = string;
304 unsigned char tmp[12];
305
306 while (*utf8 && i<11) {
307 utf8 = utf8decode(utf8, &ucs);
308 if (ucs < 256)
309 tmp[i++] = ucs;
310 else
311 tmp[i++] = '?';
312 }
313
314 tmp[i] = 0;
315
316 scroll[y].mode=SCROLL_MODE_OFF;
317 return lcd_puts_cont_scroll(x, y, tmp);
318}
319
320void lcd_put_cursor(int x, int y, char cursor_char)
321{
322 if (cursor.len == 0) {
323 cursor.text[0]=buffer_xlcd[x][y];
324 cursor.text[1]=cursor_char;
325 cursor.len=2;
326 cursor.textpos=0;
327 cursor.y_pos=y;
328 cursor.x_pos=x;
329 cursor.downcount=0;
330 cursor.divider=4;
331 }
332}
333
334void lcd_remove_cursor(void)
335{
336 if (cursor.len!=0) {
337 bool up;
338 cursor.len=0;
339 up = lcdx_putc(cursor.x_pos, cursor.y_pos, cursor.text[0]);
340#ifdef SIMULATOR
341 if(up)
342 lcd_update();
343#endif
344 }
345}
346
347void lcd_putc(int x, int y, unsigned short ch)
348{
349 bool update;
350 if (x<0 || y<0) {
351 return;
352 }
353 update=lcdx_putc(x, y, ch);
354
355 if (update)
356 xlcd_update();
357}
358
359unsigned char lcd_get_locked_pattern(void)
360{
361 unsigned char pat=1;
362 while (pat<LAST_RESERVED_CHAR) {
363 if (lcd_ascii[pat]==RESERVED_CHAR) {
364 lcd_ascii[pat]=0x200+pat;
365 return pat;
366 }
367 pat++;
368 }
369 return 0;
370}
371
372void lcd_unlock_pattern(unsigned char pat)
373{
374 lcd_ascii[pat]=RESERVED_CHAR;
375 lcd_free_pat(pat);
376}
377
378void lcd_define_pattern(int pat, const char *pattern)
379{
380 int i;
381 for (i=0; i<7; i++) {
382 extended_font_player[pat][i]=pattern[i];
383 }
384 if (extended_chars_mapped[pat]!=NO_CHAR) {
385 lcd_define_hw_pattern(extended_chars_mapped[pat]*8, pattern, 7);
386 }
387}
388
389#ifndef SIMULATOR
390void lcd_define_hw_pattern (int which,const char *pattern,int length)
391{
392 lcd_write_command(lcd_pram | which);
393 lcd_write_data(pattern, length);
394}
395
396void lcd_double_height(bool on)
397{
398 if(new_lcd)
399 lcd_write_command(on?9:8);
400}
401
402static const char icon_pos[] =
403{
404 0, 0, 0, 0, /* Battery */
405 2, /* USB */
406 3, /* Play */
407 4, /* Record */
408 5, /* Pause */
409 5, /* Audio */
410 6, /* Repeat */
411 7, /* 1 */
412 9, /* Volume */
413 9, /* Volume 1 */
414 9, /* Volume 2 */
415 10, /* Volume 3 */
416 10, /* Volume 4 */
417 10, /* Volume 5 */
418 10, /* Param */
419};
420
421static const char icon_mask[] =
422{
423 0x02, 0x08, 0x04, 0x10, /* Battery */
424 0x04, /* USB */
425 0x10, /* Play */
426 0x10, /* Record */
427 0x02, /* Pause */
428 0x10, /* Audio */
429 0x02, /* Repeat */
430 0x01, /* 1 */
431 0x04, /* Volume */
432 0x02, /* Volume 1 */
433 0x01, /* Volume 2 */
434 0x08, /* Volume 3 */
435 0x04, /* Volume 4 */
436 0x01, /* Volume 5 */
437 0x10, /* Param */
438};
439
440void lcd_icon(int icon, bool enable)
441{
442 static unsigned char icon_mirror[11] = {0};
443 int pos, mask;
444
445 pos = icon_pos[icon];
446 mask = icon_mask[icon];
447
448 if(enable)
449 icon_mirror[pos] |= mask;
450 else
451 icon_mirror[pos] &= ~mask;
452
453 lcd_write_command_e(LCD_ICON(pos), icon_mirror[pos]);
454}
455
456int lcd_default_contrast(void)
457{
458 return 30;
459}
460
461void lcd_set_contrast(int val)
462{
463 lcd_write_command_e(lcd_contrast_set, 31 - val);
464}
465#endif /* SIMULATOR */
466
467void lcd_init (void)
468{
469 unsigned char data_vector[64];
470
471 (void)data_vector;
472
473 new_lcd = is_new_player();
474 memset(extended_chars_mapped, NO_CHAR, sizeof(extended_chars_mapped));
475 memset(extended_pattern_content, NO_CHAR,sizeof(extended_pattern_content));
476 memset(extended_pattern_usage, 0, sizeof(extended_pattern_usage));
477
478 if(new_lcd) {
479 lcd_ascii = new_lcd_rocklatin1_to_xlcd;
480 lcd_contrast_set = NEW_LCD_CONTRAST_SET;
481 lcd_cram = NEW_LCD_CRAM;
482 lcd_pram = NEW_LCD_PRAM;
483 lcd_iram = NEW_LCD_IRAM;
484 pattern_size=7; /* Last pattern, 7 for new LCD */
485
486#ifndef SIMULATOR
487 /* LCD init for cold start */
488 PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
489 or_b(0x0f, &PBIORL); /* ... output */
490 or_b(0x0f, &PBDRL); /* ... and high */
491
492 lcd_write_command(NEW_LCD_FUNCTION_SET + 1); /* CGRAM selected */
493 lcd_write_command_e(NEW_LCD_CONTRAST_SET, 0x08);
494 lcd_write_command(NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET + 2);
495 /* oscillator on */
496 lcd_write_command(NEW_LCD_POWER_CONTROL_REGISTER_SET + 7);
497 /* opamp buffer + voltage booster on*/
498
499 memset(data_vector, 0x20, 64);
500 lcd_write_command(NEW_LCD_CRAM); /* Set DDRAM address */
501 lcd_write_data(data_vector, 64); /* all spaces */
502
503 memset(data_vector, 0, 64);
504 lcd_write_command(NEW_LCD_PRAM); /* Set CGRAM address */
505 lcd_write_data(data_vector, 64); /* zero out */
506 lcd_write_command(NEW_LCD_IRAM); /* Set ICONRAM address */
507 lcd_write_data(data_vector, 16); /* zero out */
508
509 lcd_write_command(NEW_LCD_DISPLAY_CONTROL_SET + 1); /* display on */
510#endif /* !SIMULATOR */
511 }
512 else {
513 lcd_ascii = old_lcd_rocklatin1_to_xlcd;
514 lcd_contrast_set = OLD_LCD_CONTRAST_SET;
515 lcd_cram = OLD_LCD_CRAM;
516 lcd_pram = OLD_LCD_PRAM;
517 lcd_iram = OLD_LCD_IRAM;
518 pattern_size=3; /* Last pattern, 3 for old LCD */
519
520#ifndef SIMULATOR
521#if 1
522 /* LCD init for cold start */
523 PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
524 or_b(0x0f, &PBIORL); /* ... output */
525 or_b(0x0f, &PBDRL); /* ... and high */
526
527 lcd_write_command(0x61);
528 lcd_write_command(0x42);
529 lcd_write_command(0x57);
530
531 memset(data_vector, 0x24, 13);
532 lcd_write_command(OLD_LCD_CRAM); /* Set DDRAM address */
533 lcd_write_data(data_vector, 13); /* all spaces */
534 lcd_write_command(OLD_LCD_CRAM + 0x10);
535 lcd_write_data(data_vector, 13);
536 lcd_write_command(OLD_LCD_CRAM + 0x20);
537 lcd_write_data(data_vector, 13);
538
539 memset(data_vector, 0, 32);
540 lcd_write_command(OLD_LCD_PRAM); /* Set CGRAM address */
541 lcd_write_data(data_vector, 32); /* zero out */
542 lcd_write_command(OLD_LCD_IRAM); /* Set ICONRAM address */
543 lcd_write_data(data_vector, 13); /* zero out */
544 lcd_write_command(OLD_LCD_IRAM + 0x10);
545 lcd_write_data(data_vector, 13);
546
547 lcd_write_command(0x31);
548#else
549 /* archos look-alike code, left here for reference. As soon as the
550 * rockbox version is confirmed working, this will go away */
551 {
552 int i;
553
554 PBCR2 &= 0xc000;
555 PBIOR |= 0x000f;
556 PBDR |= 0x0002;
557 PBDR |= 0x0001;
558 PBDR |= 0x0004;
559 PBDR |= 0x0008;
560
561 for (i=0; i<200; i++) asm volatile ("nop"); /* wait 100 us */
562
563 PBDR &= 0xfffd; /* CS low (assert) */
564
565 for (i=0; i<100; i++) asm volatile ("nop"); /* wait 50 us */
566
567 lcd_write_command(0x61);
568 lcd_write_command(0x42);
569 lcd_write_command(0x57);
570
571 memset(data_vector, 0x24, 13);
572 lcd_write_command(0xb0); /* Set DDRAM address */
573 lcd_write_data(data_vector, 13); /* all spaces */
574 lcd_write_command(0xc0);
575 lcd_write_data(data_vector, 13);
576 lcd_write_command(0xd0);
577 lcd_write_data(data_vector, 13);
578
579 memset(data_vector, 0, 32);
580 lcd_write_command(0x80); /* Set CGRAM address */
581 lcd_write_data(data_vector, 32); /* zero out */
582 lcd_write_command(0xe0); /* Set ICONRAM address */
583 lcd_write_data(data_vector, 13); /* zero out */
584 lcd_write_command(0xf0);
585 lcd_write_data(data_vector, 13);
586
587 for (i=0; i<300000; i++) asm volatile ("nop"); /* wait 150 ms */
588
589 lcd_write_command(0x31);
590 lcd_write_command_e(0xa8, 0); /* Set contrast control */
591 }
592#endif
593#endif /* !SIMULATOR */
594 }
595
596 lcd_set_contrast(lcd_default_contrast());
597
598 create_thread(scroll_thread, scroll_stack,
599 sizeof(scroll_stack), scroll_name IF_PRIO(, PRIORITY_USER_INTERFACE)
600 IF_COP(, CPU, false));
601}
602
603void lcd_jump_scroll (int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
604{
605 jump_scroll=mode;
606}
607
608void lcd_bidir_scroll(int percent)
609{
610 bidir_limit = percent;
611}
612
613void lcd_puts_scroll(int x, int y, const unsigned char* string )
614{
615 struct scrollinfo* s;
616 int i=0;
617 unsigned short ucs;
618 const unsigned char *utf8 = string;
619 unsigned char tmp[utf8length(string)+1];
620
621 while (*utf8) {
622 utf8 = utf8decode(utf8, &ucs);
623 if (ucs < 256)
624 tmp[i++] = ucs;
625 else
626 tmp[i++] = '?';
627 }
628
629 tmp[i] = 0;
630
631
632 s = &scroll[y];
633
634 lcd_puts_cont_scroll(x,y,tmp);
635 s->textlen = strlen(tmp);
636
637 if ( s->textlen > 11-x ) {
638 s->mode = SCROLL_MODE_RUN;
639 s->scroll_start_tick = current_tick + scroll_delay;
640 s->offset=0;
641 s->startx=x;
642 s->starty=y;
643 s->direction=+1;
644 s->jump_scroll=0;
645 s->jump_scroll_steps=0;
646 if (jump_scroll && jump_scroll_delay<scroll_ticks*(s->textlen-11+x)) {
647 s->jump_scroll_steps=11-x;
648 s->jump_scroll=jump_scroll;
649 }
650 strncpy(s->text,tmp,sizeof s->text);
651 s->turn_offset=-1;
652 if (bidir_limit && (s->textlen < ((11-x)*(100+bidir_limit))/100)) {
653 s->turn_offset=s->textlen+x-11;
654 }
655 else {
656 for (i=0; i<scroll_spacing &&
657 s->textlen<(int)sizeof(s->text); i++) {
658 s->text[s->textlen++]=' ';
659 }
660 }
661 if (s->textlen<(int)sizeof(s->text))
662 s->text[s->textlen]=' ';
663 s->text[sizeof s->text - 1] = 0;
664 }
665 else
666 s->mode = SCROLL_MODE_OFF;
667}
668
669void lcd_stop_scroll(void)
670{
671 struct scrollinfo* s;
672 int index;
673
674 for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
675 s = &scroll[index];
676 if ( s->mode == SCROLL_MODE_RUN ||
677 s->mode == SCROLL_MODE_PAUSE ) {
678 /* restore scrolled row */
679 lcd_puts(s->startx, s->starty, s->text);
680 }
681 }
682
683 lcd_update();
684}
685
686static const char scroll_tick_table[16] = {
687 /* Hz values:
688 1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */
689 100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3
690};
691
692void lcd_scroll_speed(int speed)
693{
694 scroll_ticks = scroll_tick_table[speed];
695}
696
697void lcd_scroll_delay(int ms)
698{
699 scroll_delay = ms / (HZ / 10);
700}
701
702void lcd_jump_scroll_delay(int ms)
703{
704 jump_scroll_delay = ms / (HZ / 10);
705}
706
707static void scroll_thread(void)
708{
709 struct scrollinfo* s;
710 int index;
711 int i, o;
712 bool update;
713
714 /* initialize scroll struct array */
715 for (index = 0; index < SCROLLABLE_LINES; index++) {
716 scroll[index].mode = SCROLL_MODE_OFF;
717 }
718
719 while ( 1 ) {
720
721 update = false;
722
723 for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
724 s = &scroll[index];
725 if ( s->mode == SCROLL_MODE_RUN ) {
726 if ( TIME_AFTER(current_tick, s->scroll_start_tick) ) {
727 char buffer[12];
728 int jumping_scroll=s->jump_scroll;
729 update = true;
730 if (s->jump_scroll) {
731
732 /* Find new position to start jump scroll by
733 * finding last white space within
734 * jump_scroll_steps */
735 int i;
736 o = s->offset = s->offset + s->jump_scroll_steps;
737 for (i = 0; i < s->jump_scroll_steps; i++, o--) {
738 if (o < s->textlen &&
739 ((0x20 <= s->text[o] && s->text[o] <= 0x2f) || s->text[o] == '_'))
740 {
741 s->offset = o;
742 break;
743 }
744 }
745
746 s->scroll_start_tick = current_tick +
747 jump_scroll_delay;
748 /* Eat space */
749 while (s->offset < s->textlen &&
750 ((0x20 <= s->text[s->offset] && s->text[s->offset] <= 0x2f) ||
751 s->text[s->offset] == '_')) {
752 s->offset++;
753 }
754 if (s->offset >= s->textlen) {
755 s->offset=0;
756 s->scroll_start_tick = current_tick +
757 scroll_delay;
758 if (s->jump_scroll != JUMP_SCROLL_ALWAYS) {
759 s->jump_scroll--;
760 s->direction=1;
761 }
762 }
763 } else {
764 if ( s->offset < s->textlen-1 ) {
765 s->offset+=s->direction;
766 if (s->offset==0) {
767 s->direction=+1;
768 s->scroll_start_tick = current_tick +
769 scroll_delay;
770 } else {
771 if (s->offset == s->turn_offset) {
772 s->direction=-1;
773 s->scroll_start_tick = current_tick +
774 scroll_delay;
775 }
776 }
777 }
778 else {
779 s->offset = 0;
780 }
781 }
782
783 i=0;
784 o=s->offset;
785 while (i<11) {
786 buffer[i++]=s->text[o++];
787 if (o==s->textlen /* || (jump_scroll && buffer[i-1] == ' ') */)
788 break;
789 }
790 o=0;
791 if (s->turn_offset == -1 && !jumping_scroll) {
792 while (i<11) {
793 buffer[i++]=s->text[o++];
794 }
795 } else {
796 while (i<11) {
797 buffer[i++]=' ';
798 }
799 }
800 buffer[11]=0;
801
802 lcd_puts_cont_scroll(s->startx, s->starty, buffer);
803 }
804 }
805 if (cursor.len>0) {
806 if (cursor.downcount--<0) {
807 cursor.downcount=cursor.divider;
808 cursor.textpos++;
809 if (cursor.textpos>=cursor.len)
810 cursor.textpos=0;
811#ifdef SIMULATOR
812 lcdx_putc(cursor.x_pos, cursor.y_pos,
813 cursor.text[cursor.textpos]);
814 update=true;
815#else
816 update|=lcdx_putc(cursor.x_pos, cursor.y_pos,
817 cursor.text[cursor.textpos]);
818#endif
819 }
820 }
821 if (update) {
822 lcd_update();
823 }
824 }
825
826 sleep(scroll_ticks);
827 }
828}
829
830#endif /* HAVE_LCD_CHARCELLS */
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index ef5eedef79..e462ef2d8e 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -4,10 +4,11 @@
4/* define this if you would like tagcache to build on this target */ 4/* define this if you would like tagcache to build on this target */
5#define HAVE_TAGCACHE 5#define HAVE_TAGCACHE
6 6
7/* LCD dimensions (for the simulator) */ 7#define LCD_WIDTH 11
8#define LCD_WIDTH 132 /* Display width in pixels */ 8#define LCD_HEIGHT 2
9#define LCD_HEIGHT 64 /* Display height in pixels */ 9#define LCD_DEPTH 1
10#define LCD_DEPTH 1 10#define SIM_LCD_WIDTH 132 /* pixels */
11#define SIM_LCD_HEIGHT 64 /* pixels */
11 12
12/* define this if you have the Player's keyboard */ 13/* define this if you have the Player's keyboard */
13#define CONFIG_KEYPAD PLAYER_PAD 14#define CONFIG_KEYPAD PLAYER_PAD
diff --git a/firmware/export/lcd-charcell.h b/firmware/export/lcd-charcell.h
new file mode 100644
index 0000000000..2676056e63
--- /dev/null
+++ b/firmware/export/lcd-charcell.h
@@ -0,0 +1,41 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: lcd-player.c 12835 2007-03-18 17:58:49Z amiconn $
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20/* map unicode characters to hardware or extended lcd characters */
21struct xchar_info {
22 unsigned short ucs;
23 unsigned short glyph;
24 /* 0x0000..0x7fff: fixed extended characters
25 * 0x8000..0xffff: variable extended characters
26 * Dontcare if priority == 0 */
27 unsigned char priority;
28 unsigned char hw_char; /* direct or substitute */
29};
30
31/* target dependent - to be adjusted for other charcell targets */
32#define HW_PATTERN_SIZE 7 /* number of bytes per pattern */
33#define MAX_HW_PATTERNS 8 /* max. number of user-definable hw patterns */
34extern int hw_pattern_count; /* actual number of user-definable hw patterns */
35
36extern const struct xchar_info *xchar_info;
37extern int xchar_info_size; /* number of entries */
38extern const unsigned char xfont_fixed[][8];
39
40void lcd_charset_init(void);
41
diff --git a/firmware/export/lcd-player-charset.h b/firmware/export/lcd-player-charset.h
deleted file mode 100644
index c94fab8f3b..0000000000
--- a/firmware/export/lcd-player-charset.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Kjell Ericson
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifdef HAVE_LCD_CHARCELLS
20
21#define NO_EXTENDED_LCD_CHARS 0x5e
22#define RESERVED_CHAR 0xff
23#define LAST_RESERVED_CHAR 0x16
24#define NOCHAR_OLD 0x24
25#define NOCHAR_NEW 0x20
26
27#endif
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 1b7dbb4795..0d56389480 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -59,12 +59,21 @@ extern void lcd_init_device(void);
59extern void lcd_backlight(bool on); 59extern void lcd_backlight(bool on);
60extern int lcd_default_contrast(void); 60extern int lcd_default_contrast(void);
61extern void lcd_set_contrast(int val); 61extern void lcd_set_contrast(int val);
62extern void lcd_setmargins(int xmargin, int ymargin);
63extern int lcd_getxmargin(void);
64extern int lcd_getymargin(void);
65extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
62 66
63extern void lcd_clear_display(void); 67extern void lcd_clear_display(void);
68extern void lcd_putsxy(int x, int y, const unsigned char *string);
64extern void lcd_puts(int x, int y, const unsigned char *string); 69extern void lcd_puts(int x, int y, const unsigned char *string);
65extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); 70extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
66extern void lcd_putc(int x, int y, unsigned short ch); 71extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
72extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
73 int offset);
74extern void lcd_putc(int x, int y, unsigned long ucs);
67extern void lcd_stop_scroll(void); 75extern void lcd_stop_scroll(void);
76extern void lcd_bidir_scroll(int threshold);
68extern void lcd_scroll_speed(int speed); 77extern void lcd_scroll_speed(int speed);
69extern void lcd_scroll_delay(int ms); 78extern void lcd_scroll_delay(int ms);
70extern void lcd_puts_scroll(int x, int y, const unsigned char* string); 79extern void lcd_puts_scroll(int x, int y, const unsigned char* string);
@@ -123,14 +132,14 @@ enum
123 ICON_PARAM 132 ICON_PARAM
124}; 133};
125 134
126extern void lcd_double_height(bool on); 135void lcd_double_height(bool on);
127extern void lcd_define_hw_pattern(int which,const char *pattern,int length); 136void lcd_put_hw_char(int x, int y, unsigned char hw_char);
128extern void lcd_define_pattern(int which,const char *pattern); 137void lcd_define_hw_pattern(int which, const char *pattern);
129unsigned char lcd_get_locked_pattern(void); 138void lcd_define_pattern(unsigned long ucs, const char *pattern);
130void lcd_unlock_pattern(unsigned char pat); 139unsigned long lcd_get_locked_pattern(void);
131void lcd_put_cursor(int x, int y, char cursor_char); 140void lcd_unlock_pattern(unsigned long ucs);
141void lcd_put_cursor(int x, int y, unsigned long cursor_ucs);
132void lcd_remove_cursor(void); 142void lcd_remove_cursor(void);
133extern void lcd_bidir_scroll(int threshold);
134#define JUMP_SCROLL_ALWAYS 5 143#define JUMP_SCROLL_ALWAYS 5
135extern void lcd_jump_scroll(int mode); /* 0=off, 1=once, ..., ALWAYS */ 144extern void lcd_jump_scroll(int mode); /* 0=off, 1=once, ..., ALWAYS */
136extern void lcd_jump_scroll_delay(int ms); 145extern void lcd_jump_scroll_delay(int ms);
@@ -303,17 +312,10 @@ extern void lcd_set_flip(bool yesno);
303 312
304extern void lcd_set_drawmode(int mode); 313extern void lcd_set_drawmode(int mode);
305extern int lcd_get_drawmode(void); 314extern int lcd_get_drawmode(void);
306extern void lcd_setmargins(int xmargin, int ymargin);
307extern int lcd_getxmargin(void);
308extern int lcd_getymargin(void);
309extern void lcd_setfont(int font); 315extern void lcd_setfont(int font);
310extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
311 316
312extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
313extern void lcd_puts_style_offset(int x, int y, const unsigned char *str, 317extern void lcd_puts_style_offset(int x, int y, const unsigned char *str,
314 int style, int offset); 318 int style, int offset);
315extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
316 int offset);
317extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, 319extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
318 int style, int offset); 320 int style, int offset);
319 321
@@ -338,10 +340,8 @@ extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
338 int stride, int x, int y, int width, int height); 340 int stride, int x, int y, int width, int height);
339extern void lcd_bitmap(const fb_data *src, int x, int y, int width, 341extern void lcd_bitmap(const fb_data *src, int x, int y, int width,
340 int height); 342 int height);
341extern void lcd_putsxy(int x, int y, const unsigned char *string);
342 343
343extern void lcd_invertscroll(int x, int y); 344extern void lcd_invertscroll(int x, int y);
344extern void lcd_bidir_scroll(int threshold);
345extern void lcd_scroll_step(int pixels); 345extern void lcd_scroll_step(int pixels);
346 346
347#if LCD_DEPTH > 1 347#if LCD_DEPTH > 1
@@ -380,36 +380,25 @@ extern void lcd_bitmap_transparent(const fb_data *src, int x, int y,
380#endif /* HAVE_LCD_BITMAP */ 380#endif /* HAVE_LCD_BITMAP */
381 381
382/* internal usage, but in multiple drivers */ 382/* internal usage, but in multiple drivers */
383#define SCROLL_SPACING 3
383#ifdef HAVE_LCD_BITMAP 384#ifdef HAVE_LCD_BITMAP
384#define SCROLL_SPACING 3 385#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2)
385#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2) 386#else
387#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH + SCROLL_SPACING + 2)
388#endif
386 389
387struct scrollinfo { 390struct scrollinfo {
388 char line[SCROLL_LINE_SIZE]; 391 char line[SCROLL_LINE_SIZE];
389 int len; /* length of line in chars */ 392 int len; /* length of line in chars */
390 int width; /* length of line in pixels */
391 int offset; 393 int offset;
392 int startx; 394 int startx;
395#ifdef HAVE_LCD_BITMAP
396 int width; /* length of line in pixels */
397 bool invert; /* invert the scrolled text */
398#endif
393 bool backward; /* scroll presently forward or backward? */ 399 bool backward; /* scroll presently forward or backward? */
394 bool bidir; 400 bool bidir;
395 bool invert; /* invert the scrolled text */
396 long start_tick; 401 long start_tick;
397}; 402};
398#else /* !HAVE_LCD_BITMAP */
399
400struct scrollinfo {
401 int mode;
402 char text[MAX_PATH];
403 int textlen;
404 int offset;
405 int turn_offset;
406 int startx;
407 int starty;
408 long scroll_start_tick;
409 int direction; /* +1 for right or -1 for left*/
410 int jump_scroll;
411 int jump_scroll_steps;
412};
413#endif
414 403
415#endif /* __LCD_H__ */ 404#endif /* __LCD_H__ */
diff --git a/firmware/target/sh/archos/player/lcd-player.c b/firmware/target/sh/archos/player/lcd-player.c
new file mode 100644
index 0000000000..7018b2277a
--- /dev/null
+++ b/firmware/target/sh/archos/player/lcd-player.c
@@ -0,0 +1,235 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: lcd-player.c 12835 2007-03-18 17:58:49Z amiconn $
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 * Based on the work of Alan Korr, Kjell Ericson and others
12 *
13 * All files in this archive are subject to the GNU General Public License.
14 * See the file COPYING in the source tree root for full license agreement.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 ****************************************************************************/
20
21#include "config.h"
22#include <string.h>
23#include "hwcompat.h"
24#include "system.h"
25#include "lcd.h"
26
27#define OLD_LCD_CRAM ((char)0xB0) /* Characters */
28#define OLD_LCD_PRAM ((char)0x80) /* Patterns */
29#define OLD_LCD_IRAM ((char)0xE0) /* Icons */
30#define OLD_LCD_CONTRAST_SET ((char)0xA8)
31
32#define NEW_LCD_CRAM ((char)0x80) /* Characters */
33#define NEW_LCD_PRAM ((char)0xC0) /* Patterns */
34#define NEW_LCD_IRAM ((char)0x40) /* Icons */
35#define NEW_LCD_CONTRAST_SET ((char)0x50)
36#define NEW_LCD_FUNCTION_SET ((char)0x10)
37#define NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET ((char)0x0c)
38#define NEW_LCD_POWER_CONTROL_REGISTER_SET ((char)0x20)
39#define NEW_LCD_DISPLAY_CONTROL_SET ((char)0x28)
40#define NEW_LCD_SET_DOUBLE_HEIGHT ((char)0x08)
41
42#define LCD_CURSOR(x,y) ((char)(lcd_cram+((y)*16+(x))))
43#define LCD_ICON(i) ((char)(lcd_iram+i))
44
45static bool new_lcd;
46static char lcd_contrast_set;
47static char lcd_cram;
48static char lcd_pram;
49static char lcd_iram;
50
51/* hardware configuration */
52
53int lcd_default_contrast(void)
54{
55 return 30;
56}
57
58void lcd_set_contrast(int val)
59{
60 lcd_write_command_e(lcd_contrast_set, 31 - val);
61}
62
63/* charcell specific */
64
65void lcd_double_height(bool on)
66{
67 if(new_lcd)
68 lcd_write_command(on ? (NEW_LCD_SET_DOUBLE_HEIGHT|1)
69 : NEW_LCD_SET_DOUBLE_HEIGHT);
70}
71
72void lcd_put_hw_char(int x, int y, unsigned char hw_char)
73{
74 lcd_write_command_e(LCD_CURSOR(x, y), hw_char);
75}
76
77void lcd_define_hw_pattern (int which, const char *pattern)
78{
79 lcd_write_command(lcd_pram | (which << 3));
80 lcd_write_data(pattern, 7);
81}
82
83void lcd_icon(int icon, bool enable)
84{
85 static const struct {
86 char pos;
87 char mask;
88 } icontab[] = {
89 { 0, 0x02}, { 0, 0x08}, { 0, 0x04}, { 0, 0x10}, /* Battery */
90 { 2, 0x04}, /* USB */
91 { 3, 0x10}, /* Play */
92 { 4, 0x10}, /* Record */
93 { 5, 0x02}, /* Pause */
94 { 5, 0x10}, /* Audio */
95 { 6, 0x02}, /* Repeat */
96 { 7, 0x01}, /* 1 */
97 { 9, 0x04}, /* Volume */
98 { 9, 0x02}, { 9, 0x01}, {10, 0x08}, {10, 0x04}, {10, 0x01}, /* Vol 1-5 */
99 {10, 0x10}, /* Param */
100 };
101 static char icon_mirror[11] = {0};
102
103 int pos, mask;
104
105 pos = icontab[icon].pos;
106 mask = icontab[icon].mask;
107
108 if (enable)
109 icon_mirror[pos] |= mask;
110 else
111 icon_mirror[pos] &= ~mask;
112
113 lcd_write_command_e(LCD_ICON(pos), icon_mirror[pos]);
114}
115
116/* device specific init */
117void lcd_init_device(void)
118{
119 unsigned char data_vector[64];
120
121 new_lcd = is_new_player();
122
123 if (new_lcd)
124 {
125 lcd_contrast_set = NEW_LCD_CONTRAST_SET;
126 lcd_cram = NEW_LCD_CRAM;
127 lcd_pram = NEW_LCD_PRAM;
128 lcd_iram = NEW_LCD_IRAM;
129
130 /* LCD init for cold start */
131 PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
132 or_b(0x0f, &PBDRL); /* ... high */
133 or_b(0x0f, &PBIORL); /* ... and output */
134
135 lcd_write_command(NEW_LCD_FUNCTION_SET + 1); /* CGRAM selected */
136 lcd_write_command_e(NEW_LCD_CONTRAST_SET, 0x08);
137 lcd_write_command(NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET + 2);
138 /* oscillator on */
139 lcd_write_command(NEW_LCD_POWER_CONTROL_REGISTER_SET + 7);
140 /* opamp buffer + voltage booster on*/
141
142 memset(data_vector, 0x20, 64);
143 lcd_write_command(NEW_LCD_CRAM); /* Set DDRAM address */
144 lcd_write_data(data_vector, 64); /* all spaces */
145
146 memset(data_vector, 0, 64);
147 lcd_write_command(NEW_LCD_PRAM); /* Set CGRAM address */
148 lcd_write_data(data_vector, 64); /* zero out */
149 lcd_write_command(NEW_LCD_IRAM); /* Set ICONRAM address */
150 lcd_write_data(data_vector, 16); /* zero out */
151
152 lcd_write_command(NEW_LCD_DISPLAY_CONTROL_SET + 1); /* display on */
153 }
154 else
155 {
156 lcd_contrast_set = OLD_LCD_CONTRAST_SET;
157 lcd_cram = OLD_LCD_CRAM;
158 lcd_pram = OLD_LCD_PRAM;
159 lcd_iram = OLD_LCD_IRAM;
160
161#if 1
162 /* LCD init for cold start */
163 PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
164 or_b(0x0f, &PBDRL); /* ... high */
165 or_b(0x0f, &PBIORL); /* ... and output */
166
167 lcd_write_command(0x61);
168 lcd_write_command(0x42);
169 lcd_write_command(0x57);
170
171 memset(data_vector, 0x24, 13);
172 lcd_write_command(OLD_LCD_CRAM); /* Set DDRAM address */
173 lcd_write_data(data_vector, 13); /* all spaces */
174 lcd_write_command(OLD_LCD_CRAM + 0x10);
175 lcd_write_data(data_vector, 13);
176 lcd_write_command(OLD_LCD_CRAM + 0x20);
177 lcd_write_data(data_vector, 13);
178
179 memset(data_vector, 0, 32);
180 lcd_write_command(OLD_LCD_PRAM); /* Set CGRAM address */
181 lcd_write_data(data_vector, 32); /* zero out */
182 lcd_write_command(OLD_LCD_IRAM); /* Set ICONRAM address */
183 lcd_write_data(data_vector, 13); /* zero out */
184 lcd_write_command(OLD_LCD_IRAM + 0x10);
185 lcd_write_data(data_vector, 13);
186
187 lcd_write_command(0x31);
188#else
189 /* archos look-alike code, left here for reference. As soon as the
190 * rockbox version is confirmed working, this will go away */
191 {
192 int i;
193
194 PBCR2 &= 0xc000;
195 PBIOR |= 0x000f;
196 PBDR |= 0x0002;
197 PBDR |= 0x0001;
198 PBDR |= 0x0004;
199 PBDR |= 0x0008;
200
201 for (i=0; i<200; i++) asm volatile ("nop"); /* wait 100 us */
202
203 PBDR &= 0xfffd; /* CS low (assert) */
204
205 for (i=0; i<100; i++) asm volatile ("nop"); /* wait 50 us */
206
207 lcd_write_command(0x61);
208 lcd_write_command(0x42);
209 lcd_write_command(0x57);
210
211 memset(data_vector, 0x24, 13);
212 lcd_write_command(0xb0); /* Set DDRAM address */
213 lcd_write_data(data_vector, 13); /* all spaces */
214 lcd_write_command(0xc0);
215 lcd_write_data(data_vector, 13);
216 lcd_write_command(0xd0);
217 lcd_write_data(data_vector, 13);
218
219 memset(data_vector, 0, 32);
220 lcd_write_command(0x80); /* Set CGRAM address */
221 lcd_write_data(data_vector, 32); /* zero out */
222 lcd_write_command(0xe0); /* Set ICONRAM address */
223 lcd_write_data(data_vector, 13); /* zero out */
224 lcd_write_command(0xf0);
225 lcd_write_data(data_vector, 13);
226
227 for (i=0; i<300000; i++) asm volatile ("nop"); /* wait 150 ms */
228
229 lcd_write_command(0x31);
230 lcd_write_command_e(0xa8, 0); /* Set contrast control */
231 }
232#endif
233 }
234 lcd_set_contrast(lcd_default_contrast());
235}
diff --git a/tools/configure b/tools/configure
index a691c98d7f..1b469c855b 100755
--- a/tools/configure
+++ b/tools/configure
@@ -661,7 +661,7 @@ EOF
661 661
662 # toolset is the tools within the tools directory that we build for 662 # toolset is the tools within the tools directory that we build for
663 # this particular target. 663 # this particular target.
664 toolset="$toolset scramble descramble sh2d generate_rocklatin uclpack" 664 toolset="$toolset scramble descramble sh2d uclpack"
665 665
666 # Note: the convbdf is present in the toolset just because: 1) the 666 # Note: the convbdf is present in the toolset just because: 1) the
667 # firmware/Makefile assumes it is present always, and 2) we will need it when we 667 # firmware/Makefile assumes it is present always, and 2) we will need it when we
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)
51 int row=0, col; 51 int row=0, col;
52 52
53 int p=0, cp=0; 53 int p=0, cp=0;
54 struct coordinate points[LCD_WIDTH * LCD_HEIGHT]; 54 struct coordinate points[SIM_LCD_WIDTH * SIM_LCD_HEIGHT];
55 struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; 55 struct coordinate clearpoints[SIM_LCD_WIDTH * SIM_LCD_HEIGHT];
56 56
57 while (icon[row]) { 57 while (icon[row]) {
58 col=0; 58 col=0;
@@ -221,16 +221,15 @@ void lcd_double_height(bool on)
221 lcd_update(); 221 lcd_update();
222} 222}
223 223
224void lcd_define_hw_pattern(int which, const char *pattern, int length) 224void lcd_define_hw_pattern(int pat, const char *pattern)
225{ 225{
226 int i, j; 226 int i, j;
227 int pat = which / 8;
228 unsigned char icon[8]; 227 unsigned char icon[8];
229 memset(icon, 0, sizeof icon); 228 memset(icon, 0, sizeof icon);
230 229
231 DEBUGF("Defining pattern %d:", pat); 230 DEBUGF("Defining pattern %d:", pat);
232 for (j = 0; j <= 5; j++) { 231 for (j = 0; j <= 5; j++) {
233 for (i = 0; i < length; i++) { 232 for (i = 0; i < 7; i++) {
234 if ((pattern[i])&(1<<(j))) 233 if ((pattern[i])&(1<<(j)))
235 icon[5-j] |= (1<<(i)); 234 icon[5-j] |= (1<<(i));
236 } 235 }
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)
132/* initialise simulator lcd driver */ 132/* initialise simulator lcd driver */
133void sim_lcd_init(void) 133void sim_lcd_init(void)
134{ 134{
135 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, 135 lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
136 LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0); 136 SIM_LCD_WIDTH * display_zoom,
137 SIM_LCD_HEIGHT * display_zoom,
138 8, 0, 0, 0, 0);
137 139
138 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, 140 sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
139 0, (1<<LCD_DEPTH)); 141 0, (1<<LCD_DEPTH));
@@ -142,10 +144,10 @@ void sim_lcd_init(void)
142#define BMP_COMPRESSION 0 /* BI_RGB */ 144#define BMP_COMPRESSION 0 /* BI_RGB */
143#define BMP_NUMCOLORS (1 << LCD_DEPTH) 145#define BMP_NUMCOLORS (1 << LCD_DEPTH)
144#define BMP_BPP 1 146#define BMP_BPP 1
145#define BMP_LINESIZE (((LCD_WIDTH + 31) / 32) * 4) 147#define BMP_LINESIZE (((SIM_LCD_WIDTH + 31) / 32) * 4)
146 148
147#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) 149#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS)
148#define BMP_DATASIZE (BMP_LINESIZE * LCD_HEIGHT) 150#define BMP_DATASIZE (BMP_LINESIZE * SIM_LCD_HEIGHT)
149#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) 151#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE)
150 152
151#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff 153#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff
@@ -159,8 +161,8 @@ static const unsigned char bmpheader[] =
159 LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */ 161 LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
160 162
161 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ 163 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */
162 LE32_CONST(LCD_WIDTH), /* Width in pixels */ 164 LE32_CONST(SIM_LCD_WIDTH), /* Width in pixels */
163 LE32_CONST(LCD_HEIGHT), /* Height in pixels */ 165 LE32_CONST(SIM_LCD_HEIGHT), /* Height in pixels */
164 0x01, 0x00, /* Number of planes (always 1) */ 166 0x01, 0x00, /* Number of planes (always 1) */
165 LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ 167 LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */
166 LE32_CONST(BMP_COMPRESSION),/* Compression mode */ 168 LE32_CONST(BMP_COMPRESSION),/* Compression mode */
@@ -193,15 +195,15 @@ void screen_dump(void)
193 SDL_LockSurface(lcd_surface); 195 SDL_LockSurface(lcd_surface);
194 196
195 /* BMP image goes bottom up */ 197 /* BMP image goes bottom up */
196 for (y = LCD_HEIGHT - 1; y >= 0; y--) 198 for (y = SIM_LCD_HEIGHT - 1; y >= 0; y--)
197 { 199 {
198 Uint8 *src = (Uint8 *)lcd_surface->pixels 200 Uint8 *src = (Uint8 *)lcd_surface->pixels
199 + y * LCD_WIDTH * display_zoom * display_zoom; 201 + y * SIM_LCD_WIDTH * display_zoom * display_zoom;
200 unsigned char *dst = line; 202 unsigned char *dst = line;
201 unsigned dst_mask = 0x80; 203 unsigned dst_mask = 0x80;
202 204
203 memset(line, 0, sizeof(line)); 205 memset(line, 0, sizeof(line));
204 for (x = LCD_WIDTH; x > 0; x--) 206 for (x = SIM_LCD_WIDTH; x > 0; x--)
205 { 207 {
206 if (*src) 208 if (*src)
207 *dst |= dst_mask; 209 *dst |= dst_mask;