diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/lcd-charcell.c | 612 | ||||
-rw-r--r-- | firmware/drivers/lcd-charset-player.c | 594 | ||||
-rw-r--r-- | firmware/drivers/lcd-player-charset.c | 751 | ||||
-rw-r--r-- | firmware/drivers/lcd-player.c | 830 |
4 files changed, 1206 insertions, 1581 deletions
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 */ | ||
45 | struct pattern_info { | ||
46 | short count; | ||
47 | unsigned short xchar; | ||
48 | }; | ||
49 | |||
50 | struct 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 | |||
60 | static int find_xchar(unsigned long ucs); | ||
61 | |||
62 | /** globals **/ | ||
63 | |||
64 | /* The "frame"buffer */ | ||
65 | static unsigned char lcd_buffer[LCD_WIDTH][LCD_HEIGHT]; | ||
66 | #ifdef SIMULATOR | ||
67 | unsigned char hardware_buffer_lcd[LCD_WIDTH][LCD_HEIGHT]; | ||
68 | #endif | ||
69 | |||
70 | static int xmargin = 0; | ||
71 | static int ymargin = 0; | ||
72 | |||
73 | static 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 */ | ||
75 | static bool xfont_variable_locked[VARIABLE_XCHARS]; | ||
76 | static struct pattern_info hw_pattern[MAX_HW_PATTERNS]; | ||
77 | static struct cursor_info cursor; | ||
78 | |||
79 | /* scrolling */ | ||
80 | static volatile int scrolling_lines=0; /* Bitpattern of which lines are scrolling */ | ||
81 | static void scroll_thread(void); | ||
82 | static char scroll_stack[DEFAULT_STACK_SIZE]; | ||
83 | static const char scroll_name[] = "scroll"; | ||
84 | static int scroll_ticks = 12; /* # of ticks between updates */ | ||
85 | static int scroll_delay = HZ/2; /* delay before starting scroll */ | ||
86 | static int bidir_limit = 50; /* percent */ | ||
87 | static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ | ||
88 | static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */ | ||
89 | static struct scrollinfo scroll[SCROLLABLE_LINES]; | ||
90 | |||
91 | static 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 */ | ||
98 | void 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 | |||
113 | void lcd_setmargins(int x, int y) | ||
114 | { | ||
115 | xmargin = x; | ||
116 | ymargin = y; | ||
117 | } | ||
118 | |||
119 | int lcd_getxmargin(void) | ||
120 | { | ||
121 | return xmargin; | ||
122 | } | ||
123 | |||
124 | int lcd_getymargin(void) | ||
125 | { | ||
126 | return ymargin; | ||
127 | } | ||
128 | |||
129 | int 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 | |||
143 | static 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 | |||
165 | static 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 | |||
176 | static 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 | |||
186 | static 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 | |||
221 | static 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 | |||
257 | static 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 | |||
280 | static 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 | |||
298 | unsigned 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 | |||
313 | void 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 | |||
325 | void 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 */ | ||
343 | void 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 */ | ||
357 | void 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 */ | ||
366 | void 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 */ | ||
382 | void 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 */ | ||
399 | static 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 */ | ||
419 | void 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 */ | ||
427 | void 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 */ | ||
433 | void 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 | |||
448 | void lcd_stop_scroll(void) | ||
449 | { | ||
450 | scrolling_lines=0; | ||
451 | } | ||
452 | |||
453 | void lcd_scroll_speed(int speed) | ||
454 | { | ||
455 | scroll_ticks = scroll_tick_table[speed]; | ||
456 | } | ||
457 | |||
458 | void lcd_scroll_delay(int ms) | ||
459 | { | ||
460 | scroll_delay = ms / (HZ / 10); | ||
461 | } | ||
462 | |||
463 | void lcd_bidir_scroll(int percent) | ||
464 | { | ||
465 | bidir_limit = percent; | ||
466 | } | ||
467 | |||
468 | void lcd_jump_scroll(int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */ | ||
469 | { | ||
470 | jump_scroll = mode; | ||
471 | } | ||
472 | |||
473 | void lcd_jump_scroll_delay(int ms) | ||
474 | { | ||
475 | jump_scroll_delay = ms / (HZ / 10); | ||
476 | } | ||
477 | |||
478 | void lcd_puts_scroll(int x, int y, const unsigned char *string) | ||
479 | { | ||
480 | lcd_puts_scroll_offset(x, y, string, 0); | ||
481 | } | ||
482 | |||
483 | void 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 | |||
535 | static 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 | |||
25 | int hw_pattern_count; /* actual number of user-definable hw patterns */ | ||
26 | |||
27 | const struct xchar_info *xchar_info; | ||
28 | int xchar_info_size; /* number of entries */ | ||
29 | |||
30 | static 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 | |||
273 | static 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 | |||
503 | const 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 | |||
580 | void 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 | |||
29 | unsigned 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 | |||
290 | unsigned 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 */ | ||
552 | const 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 | |||
652 | unsigned 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 | |||
61 | extern unsigned short new_lcd_rocklatin1_to_xlcd[]; | ||
62 | extern unsigned short old_lcd_rocklatin1_to_xlcd[]; | ||
63 | extern const unsigned char lcd_player_extended_lcd_to_rocklatin1[]; | ||
64 | extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8]; | ||
65 | |||
66 | /*** generic code ***/ | ||
67 | |||
68 | #define MAX_CURSOR_CHARS 8 | ||
69 | struct 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 | |||
79 | static void scroll_thread(void); | ||
80 | static char scroll_stack[DEFAULT_STACK_SIZE]; | ||
81 | static const char scroll_name[] = "scroll"; | ||
82 | static int scroll_ticks = 12; /* # of ticks between updates */ | ||
83 | static int scroll_delay = HZ/2; /* delay before starting scroll */ | ||
84 | static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ | ||
85 | static int scroll_spacing = 3; /* spaces between end and start of text */ | ||
86 | static int bidir_limit = 50; /* percent */ | ||
87 | static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */ | ||
88 | |||
89 | static struct scrollinfo scroll[SCROLLABLE_LINES]; | ||
90 | |||
91 | static char extended_chars_mapped[NO_EXTENDED_LCD_CHARS]; | ||
92 | static char extended_pattern_content[8]; /* Which char is mapped in pattern */ | ||
93 | static char extended_pattern_usage[8]; /* Counting number of times used */ | ||
94 | static char pattern_size; /* Last pattern, 3 for old LCD, 7 for new LCD */ | ||
95 | |||
96 | static bool new_lcd; | ||
97 | |||
98 | unsigned short *lcd_ascii; | ||
99 | static char lcd_contrast_set; | ||
100 | static char lcd_cram; | ||
101 | static char lcd_pram; | ||
102 | static char lcd_iram; | ||
103 | |||
104 | unsigned short buffer_xlcd[11][2]; | ||
105 | unsigned short buffer_lcd_mirror[11][2]; | ||
106 | |||
107 | #ifdef SIMULATOR | ||
108 | unsigned char hardware_buffer_lcd[11][2]; | ||
109 | #endif | ||
110 | |||
111 | #define NO_CHAR -1 | ||
112 | |||
113 | static 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 | |||
148 | static 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 | |||
180 | void 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 | |||
238 | bool 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 | |||
269 | void 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 | |||
281 | static 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 | } | ||
299 | void 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 | |||
320 | void 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 | |||
334 | void 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 | |||
347 | void 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 | |||
359 | unsigned 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 | |||
372 | void lcd_unlock_pattern(unsigned char pat) | ||
373 | { | ||
374 | lcd_ascii[pat]=RESERVED_CHAR; | ||
375 | lcd_free_pat(pat); | ||
376 | } | ||
377 | |||
378 | void 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 | ||
390 | void 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 | |||
396 | void lcd_double_height(bool on) | ||
397 | { | ||
398 | if(new_lcd) | ||
399 | lcd_write_command(on?9:8); | ||
400 | } | ||
401 | |||
402 | static 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 | |||
421 | static 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 | |||
440 | void 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 | |||
456 | int lcd_default_contrast(void) | ||
457 | { | ||
458 | return 30; | ||
459 | } | ||
460 | |||
461 | void lcd_set_contrast(int val) | ||
462 | { | ||
463 | lcd_write_command_e(lcd_contrast_set, 31 - val); | ||
464 | } | ||
465 | #endif /* SIMULATOR */ | ||
466 | |||
467 | void 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 | |||
603 | void lcd_jump_scroll (int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */ | ||
604 | { | ||
605 | jump_scroll=mode; | ||
606 | } | ||
607 | |||
608 | void lcd_bidir_scroll(int percent) | ||
609 | { | ||
610 | bidir_limit = percent; | ||
611 | } | ||
612 | |||
613 | void 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 | |||
669 | void 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 | |||
686 | static 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 | |||
692 | void lcd_scroll_speed(int speed) | ||
693 | { | ||
694 | scroll_ticks = scroll_tick_table[speed]; | ||
695 | } | ||
696 | |||
697 | void lcd_scroll_delay(int ms) | ||
698 | { | ||
699 | scroll_delay = ms / (HZ / 10); | ||
700 | } | ||
701 | |||
702 | void lcd_jump_scroll_delay(int ms) | ||
703 | { | ||
704 | jump_scroll_delay = ms / (HZ / 10); | ||
705 | } | ||
706 | |||
707 | static 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 */ | ||