First step of charcell LCD code rework: * Make it fully unicode aware so that adding non-ISO8859-1 scripts becomes possible (limited by the LCD capabilities of course). * Make the API more similar to the bitmap LCD code's API. * Moved hardware dependent parts to target tree. * Simplified code. * Jumpscroll temporarily non-functional.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12916 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2007-03-26 07:52:13 +00:00
parent 165f62d0cd
commit ad4e3d6657
26 changed files with 1652 additions and 1806 deletions

View file

@ -26,13 +26,13 @@
typedef const unsigned char * ICON; typedef const unsigned char * ICON;
#define NOICON NULL #define NOICON NULL
#else #else
typedef short ICON; typedef long ICON;
#define NOICON -1 #define NOICON -1
#endif #endif
#define Icon_NOICON -1 #define Icon_NOICON -1
#define CURSOR_CHAR 0x92 #define CURSOR_CHAR 0xe10c
#define CURSOR_WIDTH 6 #define CURSOR_WIDTH 6
#define CURSOR_HEIGHT 8 #define CURSOR_HEIGHT 8

View file

@ -30,8 +30,8 @@
enum { enum {
Icon_Queued = 'Q', Icon_Queued = 'Q',
Icon_Moving = 'M', Icon_Moving = 'M',
Icon_Unknown = 0x90, Icon_Unknown = 0xe100,
Icon_Bookmark = 0x16, Icon_Bookmark,
Icon_Plugin, Icon_Plugin,
Icon_Folder, Icon_Folder,
Icon_Firmware, Icon_Firmware,

View file

@ -31,53 +31,46 @@
#include "misc.h" #include "misc.h"
#include "rbunicode.h" #include "rbunicode.h"
#define KBD_BUF_SIZE 64
#define KEYBOARD_PAGES 3 #define KEYBOARD_PAGES 3
extern unsigned short *lcd_ascii; static unsigned short *kbd_setupkeys(int page, int* len)
static unsigned char* kbd_setupkeys(int page, int* len)
{ {
static unsigned char lines[128]; static unsigned short kbdline[KBD_BUF_SIZE];
const unsigned char *p;
unsigned ch;
int i = 0; int i = 0;
switch (page) switch (page)
{ {
case 0: /* Capitals */ case 0: /* Capitals */
for (ch = 'A'; ch <= 'Z'; ch++) p = "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅ"
lines[i++] = ch; "ÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÝ";
for (ch = 0xc0; ch <= 0xdd; ch++)
if (lcd_ascii[ch] != NOCHAR_NEW && lcd_ascii[ch] != NOCHAR_OLD)
lines[i++] = ch;
break; break;
case 1: /* Small */ case 1: /* Small */
for (ch = 'a'; ch <= 'z'; ch++) p = "abcdefghijklmnopqrstuvwxyzßàáâãä"
lines[i++] = ch; "åçèéêëìíîïñòóôöøùúûüýÿ";
for (ch = 0xdf; ch <= 0xff; ch++)
if (lcd_ascii[ch] != NOCHAR_NEW && lcd_ascii[ch] != NOCHAR_OLD)
lines[i++] = ch;
break; break;
case 2: /* Others */ default: /* Others */
for (ch = ' '; ch <= '@'; ch++) p = " !\"#$%&'()*+,-./0123456789:;<=>?@[]_{}~";
lines[i++] = ch;
break; break;
} }
lines[i] = 0; while (*p)
p = utf8decode(p, &kbdline[i++]);
*len = i; *len = i;
return lines; return kbdline;
} }
/* Delimiters for highlighting the character selected for insertion */ /* Delimiters for highlighting the character selected for insertion */
#define KEYBOARD_INSERT_LEFT 0x81 #define KEYBOARD_INSERT_LEFT 0xe110
#define KEYBOARD_INSERT_RIGHT 0x82 #define KEYBOARD_INSERT_RIGHT 0xe10f
#define KEYBOARD_CURSOR 0x7f #define KEYBOARD_CURSOR 0x7f
#define KEYBOARD_ARROW 0x92 #define KEYBOARD_ARROW 0xe10c
/* helper function to spell a char if voice UI is enabled */ /* helper function to spell a char if voice UI is enabled */
static void kbd_spellchar(char c) static void kbd_spellchar(char c)
@ -101,9 +94,8 @@ int kbd_input(char* text, int buflen)
int len, len_utf8, i, j; int len, len_utf8, i, j;
int editpos, curpos, leftpos; int editpos, curpos, leftpos;
unsigned char *line = kbd_setupkeys(page, &linelen); unsigned short *line = kbd_setupkeys(page, &linelen);
unsigned char temptext[36]; unsigned char temptext[36];
unsigned char tmp;
unsigned char *utf8; unsigned char *utf8;
int button, lastbutton = 0; int button, lastbutton = 0;
@ -131,19 +123,13 @@ int kbd_input(char* text, int buflen)
lcd_putc(0, 1, ' '); lcd_putc(0, 1, ' ');
} }
/* Draw insert chars */ lcd_putc(1, 0, KEYBOARD_INSERT_LEFT);
utf8 = temptext; lcd_putc(2, 0, line[x]);
tmp = KEYBOARD_INSERT_LEFT; lcd_putc(3, 0, KEYBOARD_INSERT_RIGHT);
utf8 = iso_decode(&tmp, utf8, 0, 1);
utf8 = iso_decode(&line[x], utf8, 0, 1);
tmp = KEYBOARD_INSERT_RIGHT;
utf8 = iso_decode(&tmp, utf8, 0, 1);
for (i = 1; i < 8; i++) for (i = 1; i < 8; i++)
{ {
utf8 = iso_decode(&line[(x+i)%linelen], utf8, 0, 1); lcd_putc(i + 3, 0, line[(x+i)%linelen]);
} }
*utf8 = 0;
lcd_puts(1, 0, temptext);
/* write out the text */ /* write out the text */
curpos = MIN(MIN(editpos, 10 - MIN(len_utf8 - editpos, 3)), 9); curpos = MIN(MIN(editpos, 10 - MIN(len_utf8 - editpos, 3)), 9);
@ -270,7 +256,7 @@ int kbd_input(char* text, int buflen)
} }
else /* inserts the selected char */ else /* inserts the selected char */
{ {
utf8 = iso_decode((unsigned char*)&line[x], temptext, 0, 1); utf8 = utf8encode(line[x], temptext);
*utf8 = 0; *utf8 = 0;
j = strlen(temptext); j = strlen(temptext);
if (len + j < buflen) if (len + j < buflen)

View file

@ -67,6 +67,9 @@ static const struct plugin_api rockbox_api = {
/* lcd */ /* lcd */
lcd_set_contrast, lcd_set_contrast,
lcd_clear_display, lcd_clear_display,
lcd_setmargins,
lcd_getstringsize,
lcd_putsxy,
lcd_puts, lcd_puts,
lcd_puts_scroll, lcd_puts_scroll,
lcd_stop_scroll, lcd_stop_scroll,
@ -80,11 +83,9 @@ static const struct plugin_api rockbox_api = {
PREFIX(lcd_icon), PREFIX(lcd_icon),
lcd_double_height, lcd_double_height,
#else #else
lcd_setmargins,
lcd_set_drawmode, lcd_set_drawmode,
lcd_get_drawmode, lcd_get_drawmode,
lcd_setfont, lcd_setfont,
lcd_getstringsize,
lcd_drawpixel, lcd_drawpixel,
lcd_drawline, lcd_drawline,
lcd_hline, lcd_hline,
@ -109,7 +110,6 @@ static const struct plugin_api rockbox_api = {
bidi_l2v, bidi_l2v,
font_get_bits, font_get_bits,
font_load, font_load,
lcd_putsxy,
lcd_puts_style, lcd_puts_style,
lcd_puts_scroll_style, lcd_puts_scroll_style,
&lcd_framebuffer[0][0], &lcd_framebuffer[0][0],

View file

@ -110,12 +110,12 @@
#define PLUGIN_MAGIC 0x526F634B /* RocK */ #define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */ /* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 49 #define PLUGIN_API_VERSION 50
/* update this to latest version if a change to the api struct breaks /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 47 #define PLUGIN_MIN_API_VERSION 50
/* plugin return codes */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -135,24 +135,25 @@ struct plugin_api {
/* lcd */ /* lcd */
void (*lcd_set_contrast)(int x); void (*lcd_set_contrast)(int x);
void (*lcd_clear_display)(void); void (*lcd_clear_display)(void);
void (*lcd_setmargins)(int x, int y);
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
void (*lcd_puts)(int x, int y, const unsigned char *string); void (*lcd_puts)(int x, int y, const unsigned char *string);
void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); void (*lcd_puts_scroll)(int x, int y, const unsigned char* string);
void (*lcd_stop_scroll)(void); void (*lcd_stop_scroll)(void);
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
void (*lcd_define_pattern)(int which,const char *pattern); void (*lcd_define_pattern)(unsigned long ucs, const char *pattern);
unsigned char (*lcd_get_locked_pattern)(void); unsigned long (*lcd_get_locked_pattern)(void);
void (*lcd_unlock_pattern)(unsigned char pat); void (*lcd_unlock_pattern)(unsigned long ucs);
void (*lcd_putc)(int x, int y, unsigned short ch); void (*lcd_putc)(int x, int y, unsigned long ucs);
void (*lcd_put_cursor)(int x, int y, char cursor_char); void (*lcd_put_cursor)(int x, int y, unsigned long ucs);
void (*lcd_remove_cursor)(void); void (*lcd_remove_cursor)(void);
void (*PREFIX(lcd_icon))(int icon, bool enable); void (*PREFIX(lcd_icon))(int icon, bool enable);
void (*lcd_double_height)(bool on); void (*lcd_double_height)(bool on);
#else #else
void (*lcd_setmargins)(int x, int y);
void (*lcd_set_drawmode)(int mode); void (*lcd_set_drawmode)(int mode);
int (*lcd_get_drawmode)(void); int (*lcd_get_drawmode)(void);
void (*lcd_setfont)(int font); void (*lcd_setfont)(int font);
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
void (*lcd_drawpixel)(int x, int y); void (*lcd_drawpixel)(int x, int y);
void (*lcd_drawline)(int x1, int y1, int x2, int y2); void (*lcd_drawline)(int x1, int y1, int x2, int y2);
void (*lcd_hline)(int x1, int x2, int y); void (*lcd_hline)(int x1, int x2, int y);
@ -184,7 +185,6 @@ struct plugin_api {
unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
struct font* (*font_load)(const char *path); struct font* (*font_load)(const char *path);
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
int style); int style);

View file

@ -138,7 +138,7 @@ static unsigned char *abbrev_str[12] = {
}; };
static unsigned char heuro,hhome; /*Handles for the new patterns*/ static unsigned long heuro,hhome; /*Handles for the new patterns*/
static struct plugin_api* rb; static struct plugin_api* rb;
@ -239,7 +239,6 @@ static void round(longlong_t* i, longlong_t* f, int n)
*/ */
static void display(longlong_t euro, longlong_t home, bool pos) static void display(longlong_t euro, longlong_t home, bool pos)
{ {
char c1,c2;
longlong_t i,f; longlong_t i,f;
unsigned char str[20]; unsigned char str[20];
unsigned char s1[20]; unsigned char s1[20];
@ -247,52 +246,50 @@ static void display(longlong_t euro, longlong_t home, bool pos)
if (pos) if (pos)
{ /*Edit the second line*/ { /*Edit the second line*/
c1=0x20; rb->strcpy(s1," %6d.%02d");
rb->strcpy(s1,"%c%c%6d.%02d");
c2=0x81;
if (nb_digit[country]==2) if (nb_digit[country]==2)
rb->strcpy(s2,"%c%c%06d.%02d"); rb->strcpy(s2,"\xee\x84\x90%06d.%02d");
else else
rb->strcpy(s2,"%c%c%09d"); rb->strcpy(s2,"\xee\x84\x90%09d");
} }
else else
{ {
c1=0x81; rb->strcpy(s1,"\xee\x84\x90%06d.%02d");
rb->strcpy(s1,"%c%c%06d.%02d");
c2=0x20;
if (nb_digit[country]==2) if (nb_digit[country]==2)
rb->strcpy(s2,"%c%c%6d.%02d"); rb->strcpy(s2," %6d.%02d");
else else
rb->strcpy(s2,"%c%c%9d"); rb->strcpy(s2," %9d");
} }
rb->lcd_remove_cursor(); rb->lcd_remove_cursor();
/*First line*/ /*First line*/
rb->lcd_putc(0,0,heuro);
split(euro,&i,&f); split(euro,&i,&f);
if (pos) if (pos)
round(&i,&f,2); round(&i,&f,2);
rb->snprintf(str,sizeof(str),s1,heuro,c1,(int)i,(int)f); rb->snprintf(str,sizeof(str),s1,(int)i,(int)f);
if (!pos) if (!pos)
{ {
rb->lcd_puts(0,0,str); rb->lcd_puts(1,0,str);
rb->lcd_put_cursor(10-cur_pos,0,0x5F); rb->lcd_put_cursor(10-cur_pos,0,0x5F);
} }
else else
rb->lcd_puts_scroll(0,0,str); rb->lcd_puts_scroll(1,0,str);
/*Second line*/ /*Second line*/
rb->lcd_putc(0,1,hhome);
split(home,&i,&f); split(home,&i,&f);
if (!pos) if (!pos)
round(&i,&f,nb_digit[country]); round(&i,&f,nb_digit[country]);
rb->snprintf(str,sizeof(str),s2,hhome,c2,(int)i,(int)f); rb->snprintf(str,sizeof(str),s2,(int)i,(int)f);
if (pos) if (pos)
{ {
rb->lcd_puts(0,1,str); rb->lcd_puts(1,1,str);
rb->lcd_put_cursor(10-cur_pos,1,0x5F); rb->lcd_put_cursor(10-cur_pos,1,0x5F);
} }
else else
rb->lcd_puts_scroll(0,1,str); rb->lcd_puts_scroll(1,1,str);
} }
@ -363,7 +360,7 @@ static int euro_menu(void)
rb->lcd_clear_display(); rb->lcd_clear_display();
rb->lcd_puts(0,0," Currency"); rb->lcd_puts(0,0," Currency");
rb->lcd_puts(0,1," Exit"); rb->lcd_puts(0,1," Exit");
rb->lcd_putc(0,c,0x81); rb->lcd_putc(0,c,0xe110);
switch (rb->button_get(true)) switch (rb->button_get(true))
{ {

View file

@ -203,7 +203,7 @@ static const unsigned char tk_pat[4][7] = {
}; };
static unsigned char cur_pat[7]; static unsigned char cur_pat[7];
static unsigned char gfx_chars[5]; static unsigned long gfx_chars[5];
static void release_gfx(void) static void release_gfx(void)
{ {

View file

@ -47,7 +47,7 @@ static unsigned char pattern[]={
}; };
static unsigned char str[12]; /*Containt the first line*/ static unsigned char str[12]; /*Containt the first line*/
static unsigned char h1,h2,h3; /*Handle for the pattern*/ static unsigned long h1,h2,h3; /*Handle for the pattern*/
/* here is a global api struct pointer. while not strictly necessary, /* here is a global api struct pointer. while not strictly necessary,
it's nice not to have to pass the api pointer in all function calls it's nice not to have to pass the api pointer in all function calls
@ -109,10 +109,12 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb->lcd_define_pattern(h1, pattern); rb->lcd_define_pattern(h1, pattern);
rb->lcd_define_pattern(h2, pattern+7); rb->lcd_define_pattern(h2, pattern+7);
rb->lcd_define_pattern(h3, pattern+28); rb->lcd_define_pattern(h3, pattern+28);
rb->snprintf(str,sizeof(str),"%c%cJackpot%c%c",h1,h2,h2,h1);
rb->lcd_puts(0,0,str); rb->lcd_puts(0,0," Jackpot ");
rb->snprintf(str,sizeof(str)," %c V1.1 %c",h3,h3); rb->lcd_putc(0,0,h1); rb->lcd_putc(1,0,h2);
rb->lcd_puts(0,1,str); rb->lcd_putc(9,0,h2); rb->lcd_putc(10,0,h1);
rb->lcd_puts(0,1," V1.1 ");
rb->lcd_putc(1,1,h3); rb->lcd_putc(9,1,h3);
rb->sleep(HZ*2); rb->sleep(HZ*2);
rb->lcd_clear_display(); rb->lcd_clear_display();

View file

@ -31,7 +31,7 @@ static int char_width;
static int char_height; static int char_height;
static int pixel_height; static int pixel_height;
static int pixel_width; static int pixel_width;
static unsigned char gfx_chars[8]; static unsigned long gfx_chars[8];
static unsigned char gfx_buffer[56]; static unsigned char gfx_buffer[56];
static int drawmode = DRMODE_SOLID; static int drawmode = DRMODE_SOLID;

View file

@ -56,7 +56,7 @@ static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2
static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/ static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/
static unsigned char str[12]; /*String use to display the first line*/ static unsigned char str[12]; /*String use to display the first line*/
static unsigned char hsmile,hcry,h1,h2; /*Handle for the new pattern*/ static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/
static bool end; /*If true game is finished*/ static bool end; /*If true game is finished*/
static struct plugin_api* rb; static struct plugin_api* rb;
@ -74,8 +74,8 @@ static void impossible(void)
static void lose(void) static void lose(void)
{ {
rb->lcd_define_pattern(hsmile,smile); rb->lcd_define_pattern(hsmile,smile);
rb->snprintf(str,sizeof(str),"You Win!!%c",hsmile); rb->lcd_puts(0,1,"You Win!!");
rb->lcd_puts(0,1,str); rb->lcd_putc(8,1,hsmile);
end=true; end=true;
rb->sleep(HZ*2); rb->sleep(HZ*2);
return; return;
@ -86,8 +86,8 @@ static void lose(void)
static void win(void) static void win(void)
{ {
rb->lcd_define_pattern(hcry,cry); rb->lcd_define_pattern(hcry,cry);
rb->snprintf(str,sizeof(str),"You Lose!!%c",hcry); rb->lcd_puts(0,1,"You Lose!!");
rb->lcd_puts(0,1,str); rb->lcd_putc(9,1,hcry);
end=true; end=true;
rb->sleep(HZ*2); rb->sleep(HZ*2);
return; return;
@ -100,22 +100,22 @@ static void display_first_line(int x)
int i; int i;
rb->snprintf(str,sizeof(str)," =%d",x); rb->snprintf(str,sizeof(str)," =%d",x);
rb->lcd_puts(0,0,str);
rb->lcd_define_pattern(h1,pattern3); rb->lcd_define_pattern(h1,pattern3);
for (i=0;i<x/3;i++) for (i=0;i<x/3;i++)
str[i]=h1; rb->lcd_putc(i,0,h1);
if (x%3==2) if (x%3==2)
{ {
rb->lcd_define_pattern(h2,pattern2); rb->lcd_define_pattern(h2,pattern2);
str[i]=h2; rb->lcd_putc(i,0,h2);
} }
if (x%3==1) if (x%3==1)
{ {
rb->lcd_define_pattern(h2,pattern1); rb->lcd_define_pattern(h2,pattern1);
str[i]=h2; rb->lcd_putc(i,0,h2);
} }
rb->lcd_puts(0,0,str);
} }
/* Call when the program end */ /* Call when the program end */

View file

@ -41,16 +41,15 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->depth=LCD_REMOTE_DEPTH; screen->depth=LCD_REMOTE_DEPTH;
screen->has_disk_led=false; screen->has_disk_led=false;
#if 1 /* all remote LCDs are bitmapped so far */
screen->width=LCD_REMOTE_WIDTH; screen->width=LCD_REMOTE_WIDTH;
screen->height=LCD_REMOTE_HEIGHT; screen->height=LCD_REMOTE_HEIGHT;
screen->setmargins=&lcd_remote_setmargins; screen->setmargins=&lcd_remote_setmargins;
screen->getymargin=&lcd_remote_getymargin; screen->getymargin=&lcd_remote_getymargin;
screen->getxmargin=&lcd_remote_getxmargin; screen->getxmargin=&lcd_remote_getxmargin;
screen->getstringsize=&lcd_remote_getstringsize;
#if 1 /* all remote LCDs are bitmapped so far */
screen->setfont=&lcd_remote_setfont; screen->setfont=&lcd_remote_setfont;
screen->setfont(FONT_UI); screen->setfont(FONT_UI);
screen->getstringsize=&lcd_remote_getstringsize;
screen->putsxy=&lcd_remote_putsxy;
screen->mono_bitmap=&lcd_remote_mono_bitmap; screen->mono_bitmap=&lcd_remote_mono_bitmap;
screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part; screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part;
screen->set_drawmode=&lcd_remote_set_drawmode; screen->set_drawmode=&lcd_remote_set_drawmode;
@ -70,20 +69,14 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->drawline=&lcd_remote_drawline; screen->drawline=&lcd_remote_drawline;
screen->vline=&lcd_remote_vline; screen->vline=&lcd_remote_vline;
screen->hline=&lcd_remote_hline; screen->hline=&lcd_remote_hline;
screen->scroll_speed=&lcd_remote_scroll_speed;
screen->scroll_delay=&lcd_remote_scroll_delay;
screen->scroll_step=&lcd_remote_scroll_step; screen->scroll_step=&lcd_remote_scroll_step;
screen->invertscroll=&lcd_remote_invertscroll; screen->invertscroll=&lcd_remote_invertscroll;
#endif /* LCD_REMOTE_DEPTH > 1 */
screen->puts_offset=&lcd_remote_puts_offset;
screen->puts_style_offset=&lcd_remote_puts_style_offset; screen->puts_style_offset=&lcd_remote_puts_style_offset;
screen->puts_scroll_style=&lcd_remote_puts_scroll_style; screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset; screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset;
#endif /* 1 */
#if 0 /* no charcell remote LCDs so far */ #if 0 /* no charcell remote LCDs so far */
screen->width=11;
screen->height=2;
screen->double_height=&lcd_remote_double_height; screen->double_height=&lcd_remote_double_height;
screen->putc=&lcd_remote_putc; screen->putc=&lcd_remote_putc;
screen->get_locked_pattern=&lcd_remote_get_locked_pattern; screen->get_locked_pattern=&lcd_remote_get_locked_pattern;
@ -96,11 +89,16 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
#endif /* 0 */ #endif /* 0 */
screen->init=&lcd_remote_init; screen->init=&lcd_remote_init;
screen->putsxy=&lcd_remote_putsxy;
screen->puts=&lcd_remote_puts;
screen->puts_offset=&lcd_remote_puts_offset;
screen->puts_scroll=&lcd_remote_puts_scroll; screen->puts_scroll=&lcd_remote_puts_scroll;
screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
screen->scroll_speed=&lcd_remote_scroll_speed;
screen->scroll_delay=&lcd_remote_scroll_delay;
screen->stop_scroll=&lcd_remote_stop_scroll; screen->stop_scroll=&lcd_remote_stop_scroll;
screen->clear_display=&lcd_remote_clear_display; screen->clear_display=&lcd_remote_clear_display;
screen->update=&lcd_remote_update; screen->update=&lcd_remote_update;
screen->puts=&lcd_remote_puts;
screen->backlight_on=&remote_backlight_on; screen->backlight_on=&remote_backlight_on;
screen->backlight_off=&remote_backlight_off; screen->backlight_off=&remote_backlight_off;
screen->is_backlight_on=&is_remote_backlight_on; screen->is_backlight_on=&is_remote_backlight_on;
@ -116,16 +114,15 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
#elif defined(HAVE_REMOTE_LCD) #elif defined(HAVE_REMOTE_LCD)
screen->has_disk_led=true; screen->has_disk_led=true;
#endif #endif
#ifdef HAVE_LCD_BITMAP
screen->width=LCD_WIDTH; screen->width=LCD_WIDTH;
screen->height=LCD_HEIGHT; screen->height=LCD_HEIGHT;
screen->setmargins=&lcd_setmargins; screen->setmargins=&lcd_setmargins;
screen->getymargin=&lcd_getymargin; screen->getymargin=&lcd_getymargin;
screen->getxmargin=&lcd_getxmargin; screen->getxmargin=&lcd_getxmargin;
screen->getstringsize=&lcd_getstringsize;
#ifdef HAVE_LCD_BITMAP
screen->setfont=&lcd_setfont; screen->setfont=&lcd_setfont;
screen->setfont(FONT_UI); screen->setfont(FONT_UI);
screen->getstringsize=&lcd_getstringsize;
screen->putsxy=&lcd_putsxy;
screen->mono_bitmap=&lcd_mono_bitmap; screen->mono_bitmap=&lcd_mono_bitmap;
screen->mono_bitmap_part=&lcd_mono_bitmap_part; screen->mono_bitmap_part=&lcd_mono_bitmap_part;
screen->set_drawmode=&lcd_set_drawmode; screen->set_drawmode=&lcd_set_drawmode;
@ -147,7 +144,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->get_foreground=&lcd_get_foreground; screen->get_foreground=&lcd_get_foreground;
screen->set_background=&lcd_set_background; screen->set_background=&lcd_set_background;
screen->set_foreground=&lcd_set_foreground; screen->set_foreground=&lcd_set_foreground;
#endif #endif /* LCD_DEPTH > 1 */
screen->update_rect=&lcd_update_rect; screen->update_rect=&lcd_update_rect;
screen->fillrect=&lcd_fillrect; screen->fillrect=&lcd_fillrect;
screen->drawrect=&lcd_drawrect; screen->drawrect=&lcd_drawrect;
@ -155,20 +152,14 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->drawline=&lcd_drawline; screen->drawline=&lcd_drawline;
screen->vline=&lcd_vline; screen->vline=&lcd_vline;
screen->hline=&lcd_hline; screen->hline=&lcd_hline;
screen->scroll_speed=&lcd_scroll_speed;
screen->scroll_delay=&lcd_scroll_delay;
screen->scroll_step=&lcd_scroll_step; screen->scroll_step=&lcd_scroll_step;
screen->invertscroll=&lcd_invertscroll; screen->invertscroll=&lcd_invertscroll;
screen->puts_offset=&lcd_puts_offset;
screen->puts_style_offset=&lcd_puts_style_offset; screen->puts_style_offset=&lcd_puts_style_offset;
screen->puts_scroll_style=&lcd_puts_scroll_style; screen->puts_scroll_style=&lcd_puts_scroll_style;
screen->puts_scroll_offset=&lcd_puts_scroll_offset;
screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset; screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset;
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
screen->width=11; /* width in characters instead of pixels */
screen->height=2;
screen->double_height=&lcd_double_height; screen->double_height=&lcd_double_height;
screen->putc=&lcd_putc; screen->putc=&lcd_putc;
screen->get_locked_pattern=&lcd_get_locked_pattern; screen->get_locked_pattern=&lcd_get_locked_pattern;
@ -181,13 +172,18 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
#endif /* HAVE_LCD_CHARCELLS */ #endif /* HAVE_LCD_CHARCELLS */
screen->init=&lcd_init; screen->init=&lcd_init;
screen->putsxy=&lcd_putsxy;
screen->puts=&lcd_puts;
screen->puts_offset=&lcd_puts_offset;
screen->puts_scroll=&lcd_puts_scroll; screen->puts_scroll=&lcd_puts_scroll;
screen->puts_scroll_offset=&lcd_puts_scroll_offset;
screen->scroll_speed=&lcd_scroll_speed;
screen->scroll_delay=&lcd_scroll_delay;
screen->stop_scroll=&lcd_stop_scroll; screen->stop_scroll=&lcd_stop_scroll;
screen->clear_display=&lcd_clear_display; screen->clear_display=&lcd_clear_display;
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) #if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
screen->update=&lcd_update; screen->update=&lcd_update;
#endif #endif
screen->puts=&lcd_puts;
screen->backlight_on=&backlight_on; screen->backlight_on=&backlight_on;
screen->backlight_off=&backlight_off; screen->backlight_off=&backlight_off;
screen->is_backlight_on=&is_backlight_on; screen->is_backlight_on=&is_backlight_on;

View file

@ -60,24 +60,19 @@ struct screen
#ifdef HAS_BUTTONBAR #ifdef HAS_BUTTONBAR
bool has_buttonbar; bool has_buttonbar;
#endif #endif
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
void (*setmargins)(int x, int y); void (*setmargins)(int x, int y);
int (*getxmargin)(void); int (*getxmargin)(void);
int (*getymargin)(void); int (*getymargin)(void);
void (*setfont)(int newfont);
int (*getstringsize)(const unsigned char *str, int *w, int *h); int (*getstringsize)(const unsigned char *str, int *w, int *h);
void (*putsxy)(int x, int y, const unsigned char *str); #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
void (*setfont)(int newfont);
void (*scroll_step)(int pixels); void (*scroll_step)(int pixels);
void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
void (*puts_style_offset)(int x, int y, const unsigned char *str, void (*puts_style_offset)(int x, int y, const unsigned char *str,
int style, int offset); int style, int offset);
void (*puts_scroll_style)(int x, int y, const unsigned char *string, void (*puts_scroll_style)(int x, int y, const unsigned char *string,
int style); int style);
void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
int offset);
void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string, void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string,
int style, int offset); int style, int offset);
void (*mono_bitmap)(const unsigned char *src, void (*mono_bitmap)(const unsigned char *src,
@ -114,17 +109,22 @@ struct screen
#ifdef HAVE_LCD_CHARCELLS /* no charcell remote LCDs so far */ #ifdef HAVE_LCD_CHARCELLS /* no charcell remote LCDs so far */
void (*double_height)(bool on); void (*double_height)(bool on);
void (*putc)(int x, int y, unsigned short ch); void (*putc)(int x, int y, unsigned long ucs);
void (*icon)(int icon, bool enable); void (*icon)(int icon, bool enable);
unsigned long (*get_locked_pattern)(void);
void (*define_pattern)(unsigned long ucs, const char *pattern);
#endif #endif
void (*init)(void); void (*init)(void);
void (*putsxy)(int x, int y, const unsigned char *str);
void (*puts)(int x, int y, const unsigned char *str);
void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
void (*puts_scroll)(int x, int y, const unsigned char *string); void (*puts_scroll)(int x, int y, const unsigned char *string);
void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
int offset);
void (*scroll_speed)(int speed); void (*scroll_speed)(int speed);
void (*scroll_delay)(int ms); void (*scroll_delay)(int ms);
void (*stop_scroll)(void); void (*stop_scroll)(void);
void (*clear_display)(void); void (*clear_display)(void);
unsigned char (*get_locked_pattern)(void);
void (*define_pattern)(int pat, const char *pattern);
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) || defined(SIMULATOR) #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) || defined(SIMULATOR)
void (*update)(void); void (*update)(void);
#endif #endif
@ -132,7 +132,6 @@ struct screen
void (*backlight_off)(void); void (*backlight_off)(void);
bool (*is_backlight_on)(void); bool (*is_backlight_on)(void);
void (*backlight_set_timeout)(int index); void (*backlight_set_timeout)(int index);
void (*puts)(int x, int y, const unsigned char *str);
}; };
/* /*

View file

@ -254,12 +254,12 @@ static void charging_display_info(bool animate)
} }
#else /* not HAVE_LCD_BITMAP */ #else /* not HAVE_LCD_BITMAP */
static unsigned char logo_chars[5]; static unsigned long logo_chars[4];
static const unsigned char logo_pattern[] = { static const unsigned char logo_pattern[] = {
0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, /* char 1 */ 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 2 */ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */
0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, /* char 3 */ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */
0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, /* char 4 */ 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */
}; };
static void logo_lock_patterns(bool on) static void logo_lock_patterns(bool on)
@ -270,7 +270,6 @@ static void logo_lock_patterns(bool on)
{ {
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
logo_chars[i] = lcd_get_locked_pattern(); logo_chars[i] = lcd_get_locked_pattern();
logo_chars[4] = '\0';
} }
else else
{ {
@ -284,19 +283,20 @@ static void charging_display_info(bool animate)
int battv; int battv;
unsigned i, ypos; unsigned i, ypos;
static unsigned phase = 3; static unsigned phase = 3;
char buf[28]; char buf[32];
battv = battery_voltage(); battv = battery_voltage();
snprintf(buf, sizeof(buf), "%s %d.%02dV", logo_chars, snprintf(buf, sizeof(buf), " %d.%02dV", battv / 100, battv % 100);
battv / 100, battv % 100); lcd_puts(4, 1, buf);
lcd_puts(0, 1, buf);
memcpy(buf, logo_pattern, 28); /* copy logo patterns */ memcpy(buf, logo_pattern, 32); /* copy logo patterns */
if (!animate) /* build the screen */ if (!animate) /* build the screen */
{ {
lcd_double_height(false); lcd_double_height(false);
lcd_puts(0, 0, "[Charging]"); lcd_puts(0, 0, "[Charging]");
for (i = 0; i < 4; i++)
lcd_putc(i, 1, logo_chars[i]);
} }
else /* animate the logo */ else /* animate the logo */
{ {
@ -307,14 +307,14 @@ static void charging_display_info(bool animate)
ypos = (phase + i/5) % 9; /* "bounce" effect */ ypos = (phase + i/5) % 9; /* "bounce" effect */
if (ypos > 4) if (ypos > 4)
ypos = 8 - ypos; ypos = 8 - ypos;
buf[5 - ypos + 7 * (i/5)] |= 0x10 >> (i%5); buf[5 - ypos + 8 * (i/5)] |= 0x10 >> (i%5);
} }
} }
phase++; phase++;
} }
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
lcd_define_pattern(logo_chars[i], buf + 7 * i); lcd_define_pattern(logo_chars[i], buf + 8 * i);
} }
#endif /* (not) HAVE_LCD_BITMAP */ #endif /* (not) HAVE_LCD_BITMAP */

View file

@ -59,8 +59,8 @@ common/unicode.c
/* Display */ /* Display */
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
drivers/lcd-player-charset.c drivers/lcd-charcell.c
drivers/lcd-player.c drivers/lcd-charset-player.c
#endif /* HAVE_LCD_CHARCELLS */ #endif /* HAVE_LCD_CHARCELLS */
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
@ -317,6 +317,7 @@ target/sh/archos/ata-archos.c
target/sh/archos/ata-as-archos.S target/sh/archos/ata-as-archos.S
target/sh/archos/player/button-player.c target/sh/archos/player/button-player.c
target/sh/archos/player/lcd-as-player.S target/sh/archos/player/lcd-as-player.S
target/sh/archos/player/lcd-player.c
#endif /* SIMULATOR */ #endif /* SIMULATOR */
#endif /* ARCHOS_PLAYER */ #endif /* ARCHOS_PLAYER */

View file

@ -0,0 +1,612 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
* Based on the work of Alan Korr, Kjell Ericson and others
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include "hwcompat.h"
#include "lcd.h"
#include "kernel.h"
#include "thread.h"
#include <string.h>
#include <stdlib.h>
#include "file.h"
#include "debug.h"
#include "system.h"
#include "lcd-charcell.h"
#include "rbunicode.h"
/** definitions **/
#define SCROLLABLE_LINES LCD_HEIGHT
#define VARIABLE_XCHARS 16 /* number of software user-definable characters */
#define NO_PATTERN (-1)
#define SCROLL_MODE_OFF 0
#define SCROLL_MODE_RUN 1
/* track usage of user-definable characters */
struct pattern_info {
short count;
unsigned short xchar;
};
struct cursor_info {
unsigned char hw_char;
bool enabled;
bool visible;
int x;
int y;
int divider;
int downcount;
};
static int find_xchar(unsigned long ucs);
/** globals **/
/* The "frame"buffer */
static unsigned char lcd_buffer[LCD_WIDTH][LCD_HEIGHT];
#ifdef SIMULATOR
unsigned char hardware_buffer_lcd[LCD_WIDTH][LCD_HEIGHT];
#endif
static int xmargin = 0;
static int ymargin = 0;
static unsigned char xfont_variable[VARIABLE_XCHARS][(HW_PATTERN_SIZE+3)&~3];
/* round up pattern size to a multiple of 4 bytes for faster access */
static bool xfont_variable_locked[VARIABLE_XCHARS];
static struct pattern_info hw_pattern[MAX_HW_PATTERNS];
static struct cursor_info cursor;
/* scrolling */
static volatile int scrolling_lines=0; /* Bitpattern of which lines are scrolling */
static void scroll_thread(void);
static char scroll_stack[DEFAULT_STACK_SIZE];
static const char scroll_name[] = "scroll";
static int scroll_ticks = 12; /* # of ticks between updates */
static int scroll_delay = HZ/2; /* delay before starting scroll */
static int bidir_limit = 50; /* percent */
static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */
static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
static struct scrollinfo scroll[SCROLLABLE_LINES];
static const char scroll_tick_table[16] = {
/* Hz values:
1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */
100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3
};
/* LCD init */
void lcd_init (void)
{
lcd_init_device();
lcd_charset_init();
memset(hw_pattern, 0, sizeof(hw_pattern));
memset(lcd_buffer, xchar_info[find_xchar(' ')].hw_char, sizeof(lcd_buffer));
create_thread(scroll_thread, scroll_stack,
sizeof(scroll_stack), scroll_name
IF_PRIO(, PRIORITY_USER_INTERFACE)
IF_COP(, CPU, false));
}
/** parameter handling **/
void lcd_setmargins(int x, int y)
{
xmargin = x;
ymargin = y;
}
int lcd_getxmargin(void)
{
return xmargin;
}
int lcd_getymargin(void)
{
return ymargin;
}
int lcd_getstringsize(const unsigned char *str, int *w, int *h)
{
int width = utf8length(str);
if (w)
*w = width;
if (h)
*h = 1;
return width;
}
/** low-level functions **/
static int find_xchar(unsigned long ucs)
{
int low = 0;
int high = xchar_info_size - 1;
do
{
int probe = (low + high) >> 1;
if (xchar_info[probe].ucs < ucs)
low = probe + 1;
else if (xchar_info[probe].ucs > ucs)
high = probe - 1;
else
return probe;
}
while (low <= high);
/* Not found: return index of no-char symbol (last symbol, hardcoded). */
return xchar_info_size - 1;
}
static int xchar_to_pat(int xchar)
{
int i;
for (i = 0; i < hw_pattern_count; i++)
if (hw_pattern[i].xchar == xchar)
return i;
return NO_PATTERN;
}
static const unsigned char *xchar_to_glyph(int xchar)
{
unsigned index = xchar_info[xchar].glyph;
if (index & 0x8000)
return xfont_variable[index & 0x7fff];
else
return xfont_fixed[index];
}
static void lcd_free_pat(int xchar)
{
int x, y;
unsigned char substitute;
int pat = xchar_to_pat(xchar);
if (pat != NO_PATTERN)
{
substitute = xchar_info[xchar].hw_char;
for (x = 0; x < LCD_WIDTH; x++)
{
for (y = 0; y < LCD_HEIGHT; y++)
{
if (pat == lcd_buffer[x][y])
{
lcd_buffer[x][y] = substitute;
#ifdef SIMULATOR
hardware_buffer_lcd[x][y] = substitute;
#else
lcd_put_hw_char(x, y, substitute);
#endif
}
}
}
if (cursor.enabled && pat == cursor.hw_char)
cursor.hw_char = substitute;
hw_pattern[pat].count = 0;
#ifdef SIMULATOR
lcd_update();
#endif
}
}
static int lcd_get_free_pat(int xchar)
{
static int last_used_pat = 0;
int pat = last_used_pat; /* start from last used pattern */
int least_pat = pat; /* pattern with least priority */
int least_priority = xchar_info[hw_pattern[pat].xchar].priority;
int i;
for (i = 0; i < hw_pattern_count; i++)
{
if (++pat >= hw_pattern_count) /* Keep 'pat' within limits */
pat = 0;
if (hw_pattern[pat].count == 0)
{
hw_pattern[pat].xchar = xchar;
last_used_pat = pat;
return pat;
}
if (xchar_info[hw_pattern[pat].xchar].priority < least_priority)
{
least_priority = xchar_info[hw_pattern[pat].xchar].priority;
least_pat = pat;
}
}
if (xchar_info[xchar].priority > least_priority) /* prioritized char */
{
lcd_free_pat(hw_pattern[least_pat].xchar);
hw_pattern[least_pat].xchar = xchar;
last_used_pat = least_pat;
return least_pat;
}
return NO_PATTERN;
}
static int map_xchar(int xchar)
{
int pat;
if (xchar_info[xchar].priority > 0) /* soft char */
{
pat = xchar_to_pat(xchar);
if (pat == NO_PATTERN) /* not yet mapped */
{
pat = lcd_get_free_pat(xchar); /* try to map */
if (pat == NO_PATTERN) /* failed: just use substitute */
return xchar_info[xchar].hw_char;
else /* define pattern */
lcd_define_hw_pattern(pat, xchar_to_glyph(xchar));
}
hw_pattern[pat].count++; /* increase reference count */
return pat;
}
else /* hardware char */
return xchar_info[xchar].hw_char;
}
static void lcd_putxchar(int x, int y, int xchar)
{
int lcd_char = lcd_buffer[x][y];
if (lcd_char < hw_pattern_count) /* old char was soft */
hw_pattern[lcd_char].count--; /* decrease old reference count */
lcd_buffer[x][y] = lcd_char = map_xchar(xchar);
#ifdef SIMULATOR
hardware_buffer_lcd[x][y] = lcd_char;
lcd_update();
#else
lcd_put_hw_char(x, y, lcd_char);
#endif
}
/** user-definable pattern handling **/
unsigned long lcd_get_locked_pattern(void)
{
int i = 0;
for (i = 0; i < VARIABLE_XCHARS; i++)
{
if (!xfont_variable_locked[i])
{
xfont_variable_locked[i] = true;
return 0xe000 + i; /* hard-coded */
}
}
return 0;
}
void lcd_unlock_pattern(unsigned long ucs)
{
int xchar = find_xchar(ucs);
int index = xchar_info[xchar].glyph;
if (index & 0x8000) /* variable extended char */
{
lcd_free_pat(xchar);
xfont_variable_locked[index & 0x7fff] = false;
}
}
void lcd_define_pattern(unsigned long ucs, const char *pattern)
{
int xchar = find_xchar(ucs);
int index = xchar_info[xchar].glyph;
int pat;
if (index & 0x8000) /* variable extended char */
{
memcpy(xfont_variable[index & 0x7fff], pattern, HW_PATTERN_SIZE);
pat = xchar_to_pat(xchar);
if (pat != NO_PATTERN)
lcd_define_hw_pattern(pat, pattern);
}
}
/** output functions **/
/* Clear the whole display */
void lcd_clear_display(void)
{
int x, y;
int xchar = find_xchar(' ');
lcd_stop_scroll();
lcd_remove_cursor();
for (x = 0; x < LCD_WIDTH; x++)
for (y = 0; y < LCD_HEIGHT; y++)
lcd_putxchar(x, y, xchar);
}
/* Put an unicode character at the given position */
void lcd_putc(int x, int y, unsigned long ucs)
{
if ((unsigned)x >= LCD_WIDTH || (unsigned)y >= LCD_HEIGHT)
return;
lcd_putxchar(x, y, find_xchar(ucs));
}
/* Show cursor (alternating with existing character) at the given position */
void lcd_put_cursor(int x, int y, unsigned long cursor_ucs)
{
if ((unsigned)x >= LCD_WIDTH || (unsigned)y >= LCD_HEIGHT
|| cursor.enabled)
return;
cursor.enabled = true;
cursor.visible = false;
cursor.hw_char = map_xchar(find_xchar(cursor_ucs));
cursor.x = x;
cursor.y = y;
cursor.downcount = 0;
cursor.divider = 4;
}
/* Remove the cursor */
void lcd_remove_cursor(void)
{
if (cursor.enabled)
{
if (cursor.hw_char < hw_pattern_count) /* soft char, unmap */
hw_pattern[cursor.hw_char].count--;
cursor.enabled = false;
#ifdef SIMULATOR
hardware_buffer_lcd[cursor.x][cursor.y] = lcd_buffer[cursor.x][cursor.y];
#else
lcd_put_hw_char(cursor.x, cursor.y, lcd_buffer[cursor.x][cursor.y]);
#endif
}
}
/* Put a string at a given position, skipping first ofs chars */
static int lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str)
{
unsigned short ucs;
const unsigned char *utf8 = str;
while (*utf8 && x < LCD_WIDTH)
{
utf8 = utf8decode(utf8, &ucs);
if (ofs > 0)
{
ofs--;
continue;
}
lcd_putc(x++, y, ucs);
}
return x;
}
/* Put a string at a given position */
void lcd_putsxy(int x, int y, const unsigned char *str)
{
lcd_putsxyofs(x, y, 0, str);
}
/*** Line oriented text output ***/
/* Put a string at a given char position */
void lcd_puts(int x, int y, const unsigned char *str)
{
lcd_puts_offset(x, y, str, 0);
}
/* Put a string at a given char position, skipping first offset chars */
void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
{
/* make sure scrolling is turned off on the line we are updating */
scrolling_lines &= ~(1 << y);
x += xmargin;
y += ymargin;
x = lcd_putsxyofs(x, y, offset, str);
while (x < LCD_WIDTH)
lcd_putc(x++, y, ' ');
}
/** scrolling **/
void lcd_stop_scroll(void)
{
scrolling_lines=0;
}
void lcd_scroll_speed(int speed)
{
scroll_ticks = scroll_tick_table[speed];
}
void lcd_scroll_delay(int ms)
{
scroll_delay = ms / (HZ / 10);
}
void lcd_bidir_scroll(int percent)
{
bidir_limit = percent;
}
void lcd_jump_scroll(int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
{
jump_scroll = mode;
}
void lcd_jump_scroll_delay(int ms)
{
jump_scroll_delay = ms / (HZ / 10);
}
void lcd_puts_scroll(int x, int y, const unsigned char *string)
{
lcd_puts_scroll_offset(x, y, string, 0);
}
void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
int offset)
{
struct scrollinfo* s;
int len;
s = &scroll[y];
s->start_tick = current_tick + scroll_delay;
lcd_puts_offset(x, y, string, offset);
len = utf8length(string);
if (LCD_WIDTH - xmargin < len)
{
/* prepare scroll line */
char *end;
memset(s->line, 0, sizeof s->line);
strcpy(s->line, string);
/* get width */
s->len = utf8length(s->line);
/* scroll bidirectional or forward only depending on the string width */
if (bidir_limit)
{
s->bidir = s->len < (LCD_WIDTH - xmargin) * (100 + bidir_limit) / 100;
}
else
s->bidir = false;
if (!s->bidir) /* add spaces if scrolling in the round */
{
strcat(s->line, " ");
/* get new width incl. spaces */
s->len += SCROLL_SPACING;
}
end = strchr(s->line, '\0');
strncpy(end, string, LCD_WIDTH);
s->offset = offset;
s->startx = xmargin + x;
s->backward = false;
scrolling_lines |= (1<<y);
}
else
/* force a bit switch-off since it doesn't scroll */
scrolling_lines &= ~(1<<y);
}
static void scroll_thread(void)
{
struct scrollinfo* s;
int index;
int xpos, ypos;
/* initialize scroll struct array */
scrolling_lines = 0;
while (1)
{
for (index = 0; index < SCROLLABLE_LINES; index++)
{
/* really scroll? */
if (!(scrolling_lines&(1<<index)))
continue;
s = &scroll[index];
/* check pause */
if (TIME_BEFORE(current_tick, s->start_tick))
continue;
if (s->backward)
s->offset--;
else
s->offset++;
xpos = s->startx;
ypos = ymargin + index;
if (s->bidir) /* scroll bidirectional */
{
if (s->offset <= 0)
{
/* at beginning of line */
s->offset = 0;
s->backward = false;
s->start_tick = current_tick + scroll_delay * 2;
}
if (s->offset >= s->len - (LCD_WIDTH - xpos))
{
/* at end of line */
s->offset = s->len - (LCD_WIDTH - xpos);
s->backward = true;
s->start_tick = current_tick + scroll_delay * 2;
}
}
else /* scroll forward the whole time */
{
if (s->offset >= s->len)
s->offset -= s->len;
}
lcd_putsxyofs(xpos, ypos, s->offset, s->line);
}
if (cursor.enabled)
{
if (--cursor.downcount < 0)
{
int lcd_char;
cursor.downcount = cursor.divider;
cursor.visible = !cursor.visible;
lcd_char = cursor.visible ? cursor.hw_char
: lcd_buffer[cursor.x][cursor.y];
#ifdef SIMULATOR
hardware_buffer_lcd[cursor.x][cursor.y] = lcd_char;
#else
lcd_put_hw_char(cursor.x, cursor.y, lcd_char);
#endif
}
}
#ifdef SIMULATOR
lcd_update();
#endif
sleep(scroll_ticks);
}
}

View file

@ -0,0 +1,594 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include "hwcompat.h"
#include "lcd-charcell.h"
int hw_pattern_count; /* actual number of user-definable hw patterns */
const struct xchar_info *xchar_info;
int xchar_info_size; /* number of entries */
static const struct xchar_info xchar_info_newlcd[] = {
/* Standard ascii */
{ 0x20, 0, 0, 0x20 }, /* */
{ 0x21, 0, 0, 0x21 }, /* ! */
{ 0x22, 0, 0, 0x22 }, /* " */
{ 0x23, 0, 0, 0x23 }, /* # */
{ 0x24, 0, 0, 0x24 }, /* $ */
{ 0x25, 0, 0, 0x25 }, /* % */
{ 0x26, 0, 0, 0x26 }, /* & */
{ 0x27, 0, 0, 0x27 }, /* ' */
{ 0x28, 0, 0, 0x28 }, /* ( */
{ 0x29, 0, 0, 0x29 }, /* ) */
{ 0x2a, 0, 0, 0x2a }, /* * */
{ 0x2b, 0, 0, 0x2b }, /* + */
{ 0x2c, 0, 0, 0x2c }, /* , */
{ 0x2d, 0, 0, 0x2d }, /* - */
{ 0x2e, 0, 0, 0x2e }, /* . */
{ 0x2f, 0, 0, 0x2f }, /* / */
{ 0x30, 0, 0, 0x30 }, /* 0 */
{ 0x31, 0, 0, 0x31 }, /* 1 */
{ 0x32, 0, 0, 0x32 }, /* 2 */
{ 0x33, 0, 0, 0x33 }, /* 3 */
{ 0x34, 0, 0, 0x34 }, /* 4 */
{ 0x35, 0, 0, 0x35 }, /* 5 */
{ 0x36, 0, 0, 0x36 }, /* 6 */
{ 0x37, 0, 0, 0x37 }, /* 7 */
{ 0x38, 0, 0, 0x38 }, /* 8 */
{ 0x39, 0, 0, 0x39 }, /* 9 */
{ 0x3a, 0, 0, 0x3a }, /* : */
{ 0x3b, 0, 0, 0x3b }, /* ; */
{ 0x3c, 0, 0, 0x3c }, /* < */
{ 0x3d, 0, 0, 0x3d }, /* = */
{ 0x3e, 0, 0, 0x3e }, /* > */
{ 0x3f, 0, 0, 0x3f }, /* ? */
{ 0x40, 0, 0, 0x40 }, /* @ */
{ 0x41, 0, 0, 0x41 }, /* A */
{ 0x42, 0, 0, 0x42 }, /* B */
{ 0x43, 0, 0, 0x43 }, /* C */
{ 0x44, 0, 0, 0x44 }, /* D */
{ 0x45, 0, 0, 0x45 }, /* E */
{ 0x46, 0, 0, 0x46 }, /* F */
{ 0x47, 0, 0, 0x47 }, /* G */
{ 0x48, 0, 0, 0x48 }, /* H */
{ 0x49, 0, 0, 0x49 }, /* I */
{ 0x4a, 0, 0, 0x4a }, /* J */
{ 0x4b, 0, 0, 0x4b }, /* K */
{ 0x4c, 0, 0, 0x4c }, /* L */
{ 0x4d, 0, 0, 0x4d }, /* M */
{ 0x4e, 0, 0, 0x4e }, /* N */
{ 0x4f, 0, 0, 0x4f }, /* O */
{ 0x50, 0, 0, 0x50 }, /* P */
{ 0x51, 0, 0, 0x51 }, /* Q */
{ 0x52, 0, 0, 0x52 }, /* R */
{ 0x53, 0, 0, 0x53 }, /* S */
{ 0x54, 0, 0, 0x54 }, /* T */
{ 0x55, 0, 0, 0x55 }, /* U */
{ 0x56, 0, 0, 0x56 }, /* V */
{ 0x57, 0, 0, 0x57 }, /* W */
{ 0x58, 0, 0, 0x58 }, /* X */
{ 0x59, 0, 0, 0x59 }, /* Y */
{ 0x5a, 0, 0, 0x5a }, /* Z */
{ 0x5b, 0, 0, 0x5b }, /* [ */
{ 0x5c, 0, 0, 0x12 }, /* \ */
{ 0x5d, 0, 0, 0x5d }, /* ] */
{ 0x5e, 0, 0, 0x5e }, /* ^ */
{ 0x5f, 0, 0, 0x5f }, /* _ */
{ 0x60, 0, 0, 0x60 }, /* ` */
{ 0x61, 0, 0, 0x61 }, /* a */
{ 0x62, 0, 0, 0x62 }, /* b */
{ 0x63, 0, 0, 0x63 }, /* c */
{ 0x64, 0, 0, 0x64 }, /* d */
{ 0x65, 0, 0, 0x65 }, /* e */
{ 0x66, 0, 0, 0x66 }, /* f */
{ 0x67, 0, 0, 0x67 }, /* g */
{ 0x68, 0, 0, 0x68 }, /* h */
{ 0x69, 0, 0, 0x69 }, /* i */
{ 0x6a, 0, 0, 0x6a }, /* j */
{ 0x6b, 0, 0, 0x6b }, /* k */
{ 0x6c, 0, 0, 0x6c }, /* l */
{ 0x6d, 0, 0, 0x6d }, /* m */
{ 0x6e, 0, 0, 0x6e }, /* n */
{ 0x6f, 0, 0, 0x6f }, /* o */
{ 0x70, 0, 0, 0x70 }, /* p */
{ 0x71, 0, 0, 0x71 }, /* q */
{ 0x72, 0, 0, 0x72 }, /* r */
{ 0x73, 0, 0, 0x73 }, /* s */
{ 0x74, 0, 0, 0x74 }, /* t */
{ 0x75, 0, 0, 0x75 }, /* u */
{ 0x76, 0, 0, 0x76 }, /* v */
{ 0x77, 0, 0, 0x77 }, /* w */
{ 0x78, 0, 0, 0x78 }, /* x */
{ 0x79, 0, 0, 0x79 }, /* y */
{ 0x7a, 0, 0, 0x7a }, /* z */
{ 0x7b, 0, 0, 0x7b }, /* { */
{ 0x7c, 0, 0, 0x7c }, /* | */
{ 0x7d, 0, 0, 0x7d }, /* } */
{ 0x7e, 0, 0, 0xf0 }, /* ~ */
{ 0x7f, 0, 0, 0xfe }, /* (full grid) */
#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
/* Latin 1 */
{ 0xa0, 0, 0, 0x20 }, /* (non-breaking space) */
{ 0xa3, 0x000f, 1, 0x4c }, /* £ (pound sign) */
{ 0xa5, 0, 0, 0x5c }, /* ¥ (yen sign) */
{ 0xa7, 0, 0, 0x15 }, /* § (paragraph sign) */
{ 0xab, 0, 0, 0x9e }, /* « (left double-angle quotation mark) */
{ 0xaf, 0x0010, 1, 0x2d }, /* ¯ (macron) */
{ 0xb1, 0, 0, 0x95 }, /* ± (plus-minus sign) */
{ 0xb2, 0, 0, 0x99 }, /* ³ (superscript 2) */
{ 0xb3, 0, 0, 0x9a }, /* ³ (superscript 3) */
{ 0xb5, 0, 0, 0xe6 }, /* µ (micro sign) */
{ 0xb6, 0, 0, 0x14 }, /* ¶ (pilcrow sign) */
{ 0xb7, 0, 0, 0xa5 }, /* · (middle dot) */
{ 0xbb, 0, 0, 0x9f }, /* » (right double-angle quotation mark) */
{ 0xbc, 0, 0, 0x9c }, /* ¼ (one quarter) */
{ 0xbd, 0, 0, 0x9b }, /* ½ (one half) */
{ 0xbe, 0, 0, 0x9d }, /* ¾ (three quarters) */
{ 0xbf, 0x0011, 1, 0x3f }, /* ¿ (inverted ?) */
{ 0xc0, 0x0012, 1, 0x41 }, /* À (A grave) */
{ 0xc1, 0x0013, 1, 0x41 }, /* Á (A acute) */
{ 0xc2, 0x0014, 1, 0x41 }, /* Â (A circumflex) */
{ 0xc3, 0x0015, 1, 0x41 }, /* Ã (A tilde) */
{ 0xc4, 0x0016, 1, 0x41 }, /* Ä (A dieresis) */
{ 0xc5, 0x0017, 1, 0x41 }, /* Å (A with ring above) */
{ 0xc6, 0x0018, 1, 0x41 }, /* Æ (AE ligature) */
{ 0xc7, 0x0019, 1, 0x43 }, /* Ç (C cedilla) */
{ 0xc8, 0x001a, 1, 0x45 }, /* È (E grave) */
{ 0xc9, 0x001b, 1, 0x45 }, /* É (E acute) */
{ 0xca, 0x001c, 1, 0x45 }, /* Ê (E circumflex) */
{ 0xcb, 0x001d, 1, 0x45 }, /* Ë (E dieresis) */
{ 0xcc, 0x001e, 1, 0x49 }, /* Ì (I grave) */
{ 0xcd, 0x001f, 1, 0x49 }, /* Í (I acute) */
{ 0xce, 0, 0, 0x49 }, /* Î (I circumflex) */
{ 0xcf, 0, 0, 0x49 }, /* Ï (I dieresis) */
{ 0xd0, 0x0020, 1, 0x44 }, /* Ð (ETH) */
{ 0xd1, 0x0021, 1, 0x4e }, /* Ñ (N tilde) */
{ 0xd2, 0x0022, 1, 0x4f }, /* Ò (O grave) */
{ 0xd3, 0x0023, 1, 0x4f }, /* Ó (O acute) */
{ 0xd4, 0x0024, 1, 0x4f }, /* Ô (O circumflex) */
{ 0xd5, 0x0025, 1, 0x4f }, /* Õ (O tilde) */
{ 0xd6, 0x0026, 1, 0x4f }, /* Ö (O dieresis) */
{ 0xd7, 0, 0, 0x96 }, /* × (multiplication sign) */
{ 0xd8, 0x0027, 1, 0x4f }, /* Ø (O stroke) */
{ 0xd9, 0x0028, 1, 0x55 }, /* Ù (U grave) */
{ 0xda, 0x0029, 1, 0x55 }, /* Ú (U acute) */
{ 0xdb, 0, 0, 0x55 }, /* Û (U circumflex) */
{ 0xdc, 0x002a, 1, 0x55 }, /* Ü (U dieresis) */
{ 0xdd, 0, 0, 0x59 }, /* Ý (Y acute) */
{ 0xdf, 0, 0, 0xe1 }, /* ß (sharp s) */
{ 0xe0, 0x002b, 1, 0x61 }, /* à (a grave) */
{ 0xe1, 0x002c, 1, 0x61 }, /* á (a acute) */
{ 0xe2, 0x002d, 1, 0x61 }, /* â (a circumflex) */
{ 0xe3, 0x002e, 1, 0x61 }, /* ã (a tilde) */
{ 0xe4, 0x002f, 1, 0x61 }, /* ä (a dieresis) */
{ 0xe5, 0x0030, 1, 0x61 }, /* å (a with ring above) */
{ 0xe7, 0x0031, 1, 0x63 }, /* ç (c cedilla) */
{ 0xe8, 0x0032, 1, 0x65 }, /* è (e grave) */
{ 0xe9, 0x0033, 1, 0x65 }, /* é (e acute) */
{ 0xea, 0x0034, 1, 0x65 }, /* ê (e circumflex) */
{ 0xeb, 0x0035, 1, 0x65 }, /* ë (e dieresis) */
{ 0xec, 0, 0, 0x69 }, /* ì (i grave) */
{ 0xed, 0x0036, 1, 0x69 }, /* í (i acute) */
{ 0xee, 0x0037, 1, 0x69 }, /* î (i circumflex) */
{ 0xef, 0x0038, 1, 0x69 }, /* ï (i dieresis) */
{ 0xf1, 0x0039, 1, 0x6e }, /* ñ (n tilde) */
{ 0xf2, 0x003a, 1, 0x6f }, /* ò (o grave) */
{ 0xf3, 0x003b, 1, 0x6f }, /* ó (o acute) */
{ 0xf4, 0x003c, 1, 0x6f }, /* ô (o circumflex) */
{ 0xf5, 0x003d, 1, 0x6f }, /* õ (o tilde) */
{ 0xf6, 0x003e, 1, 0x6f }, /* ö (o dieresis) */
{ 0xf7, 0, 0, 0x97 }, /* ÷ (division sign) */
{ 0xf8, 0x003f, 1, 0x6f }, /* ø (o slash) */
{ 0xf9, 0x0040, 1, 0x75 }, /* ù (u grave) */
{ 0xfa, 0x0041, 1, 0x75 }, /* ú (u acute) */
{ 0xfb, 0, 0, 0x75 }, /* û (u circumflex) */
{ 0xfc, 0x0042, 1, 0x75 }, /* ü (u dieresis) */
{ 0xfd, 0x0043, 1, 0x79 }, /* ý (y acute) */
{ 0xff, 0, 0, 0x79 }, /* ÿ (y dieresis) */
/* Runtime-definable characters */
{ 0xe000, 0x8000, 15, 0x20 }, /* variable character 0 */
{ 0xe001, 0x8001, 15, 0x20 }, /* variable character 1 */
{ 0xe002, 0x8002, 15, 0x20 }, /* variable character 2 */
{ 0xe003, 0x8003, 15, 0x20 }, /* variable character 3 */
{ 0xe004, 0x8004, 15, 0x20 }, /* variable character 4 */
{ 0xe005, 0x8005, 15, 0x20 }, /* variable character 5 */
{ 0xe006, 0x8006, 15, 0x20 }, /* variable character 6 */
{ 0xe007, 0x8007, 15, 0x20 }, /* variable character 7 */
{ 0xe008, 0x8008, 15, 0x20 }, /* variable character 8 */
{ 0xe009, 0x8009, 15, 0x20 }, /* variable character 9 */
{ 0xe00a, 0x800a, 15, 0x20 }, /* variable character 10 */
{ 0xe00b, 0x800b, 15, 0x20 }, /* variable character 11 */
{ 0xe00c, 0x800c, 15, 0x20 }, /* variable character 12 */
{ 0xe00d, 0x800d, 15, 0x20 }, /* variable character 13 */
{ 0xe00e, 0x800e, 15, 0x20 }, /* variable character 14 */
{ 0xe00f, 0x800f, 15, 0x20 }, /* variable character 15 */
/* Icons and special symbols */
{ 0xe100, 0x0004, 14, 0x3f }, /* unknown icon (mirrored ?) */
{ 0xe101, 0x0005, 14, 0x94 }, /* bookmark icon */
{ 0xe102, 0x0006, 14, 0x29 }, /* plugin icon */
{ 0xe103, 0x0007, 14, 0x91 }, /* folder icon */
{ 0xe104, 0x0008, 14, 0x78 }, /* firmware icon */
{ 0xe105, 0x0009, 14, 0x2b }, /* language icon */
{ 0xe106, 0x000a, 14, 0x13 }, /* audio icon (note) */
{ 0xe107, 0x000b, 14, 0x94 }, /* wps icon */
{ 0xe108, 0x000c, 14, 0xd0 }, /* playlist icon */
{ 0xe109, 0x000d, 14, 0xd0 }, /* text file icon */
{ 0xe10a, 0x000e, 14, 0xd0 }, /* config icon */
{ 0xe10b, 0, 0, 0x7f }, /* left arrow */
{ 0xe10c, 0, 0, 0x7e }, /* right arrow */
{ 0xe10d, 0, 0, 0x18 }, /* up arrow */
{ 0xe10e, 0, 0, 0x19 }, /* down arrow */
{ 0xe10f, 0, 0, 0x11 }, /* filled left arrow */
{ 0xe110, 0, 0, 0x10 }, /* filled right arrow */
{ 0xe111, 0, 0, 0x1f }, /* filled up arrow */
{ 0xe112, 0, 0, 0x1e }, /* filled down arrow */
{ 0xe113, 0, 0, 0x20 }, /* level 0/7 */
{ 0xe114, 0, 0, 0x80 }, /* level 1/7 */
{ 0xe115, 0, 0, 0x81 }, /* level 2/7 */
{ 0xe116, 0, 0, 0x82 }, /* level 3/7 */
{ 0xe117, 0, 0, 0x83 }, /* level 4/7 */
{ 0xe118, 0, 0, 0x84 }, /* level 5/7 */
{ 0xe119, 0, 0, 0x85 }, /* level 6/7 */
{ 0xe11a, 0, 0, 0x86 }, /* level 7/7 */
#endif /* !BOOTLOADER */
/* no-char symbol */
{ 0xfffd, 0, 0, 0x91 },
};
static const struct xchar_info xchar_info_oldlcd[] = {
/* Standard ascii */
{ 0x20, 0, 0, 0x24 }, /* */
{ 0x21, 0, 0, 0x25 }, /* ! */
{ 0x22, 0, 0, 0x26 }, /* " */
{ 0x23, 0, 0, 0x27 }, /* # */
{ 0x24, 0, 0, 0x28 }, /* $ */
{ 0x25, 0, 0, 0x29 }, /* % */
{ 0x26, 0, 0, 0x2a }, /* & */
{ 0x27, 0, 0, 0x2b }, /* ' */
{ 0x28, 0, 0, 0x2c }, /* ( */
{ 0x29, 0, 0, 0x2d }, /* ) */
{ 0x2a, 0, 0, 0x2e }, /* * */
{ 0x2b, 0, 0, 0x2f }, /* + */
{ 0x2c, 0, 0, 0x30 }, /* , */
{ 0x2d, 0, 0, 0x31 }, /* - */
{ 0x2e, 0, 0, 0x32 }, /* . */
{ 0x2f, 0, 0, 0x33 }, /* / */
{ 0x30, 0, 0, 0x34 }, /* 0 */
{ 0x31, 0, 0, 0x35 }, /* 1 */
{ 0x32, 0, 0, 0x36 }, /* 2 */
{ 0x33, 0, 0, 0x37 }, /* 3 */
{ 0x34, 0, 0, 0x38 }, /* 4 */
{ 0x35, 0, 0, 0x39 }, /* 5 */
{ 0x36, 0, 0, 0x3a }, /* 6 */
{ 0x37, 0, 0, 0x3b }, /* 7 */
{ 0x38, 0, 0, 0x3c }, /* 8 */
{ 0x39, 0, 0, 0x3d }, /* 9 */
{ 0x3a, 0, 0, 0x3e }, /* : */
{ 0x3b, 0, 0, 0x3f }, /* ; */
{ 0x3c, 0, 0, 0x40 }, /* < */
{ 0x3d, 0, 0, 0x41 }, /* = */
{ 0x3e, 0, 0, 0x42 }, /* > */
{ 0x3f, 0, 0, 0x43 }, /* ? */
{ 0x40, 0, 0, 0x04 }, /* @ */
{ 0x41, 0, 0, 0x45 }, /* A */
{ 0x42, 0, 0, 0x46 }, /* B */
{ 0x43, 0, 0, 0x47 }, /* C */
{ 0x44, 0, 0, 0x48 }, /* D */
{ 0x45, 0, 0, 0x49 }, /* E */
{ 0x46, 0, 0, 0x4a }, /* F */
{ 0x47, 0, 0, 0x4b }, /* G */
{ 0x48, 0, 0, 0x4c }, /* H */
{ 0x49, 0, 0, 0x4d }, /* I */
{ 0x4a, 0, 0, 0x4e }, /* J */
{ 0x4b, 0, 0, 0x4f }, /* K */
{ 0x4c, 0, 0, 0x50 }, /* L */
{ 0x4d, 0, 0, 0x51 }, /* M */
{ 0x4e, 0, 0, 0x52 }, /* N */
{ 0x4f, 0, 0, 0x53 }, /* O */
{ 0x50, 0, 0, 0x54 }, /* P */
{ 0x51, 0, 0, 0x55 }, /* Q */
{ 0x52, 0, 0, 0x56 }, /* R */
{ 0x53, 0, 0, 0x57 }, /* S */
{ 0x54, 0, 0, 0x58 }, /* T */
{ 0x55, 0, 0, 0x59 }, /* U */
{ 0x56, 0, 0, 0x5a }, /* V */
{ 0x57, 0, 0, 0x5b }, /* W */
{ 0x58, 0, 0, 0x5c }, /* X */
{ 0x59, 0, 0, 0x5d }, /* Y */
{ 0x5a, 0, 0, 0x5e }, /* Z */
{ 0x5b, 0, 0, 0xa9 }, /* [ */
{ 0x5c, 0x0000, 2, 0x33 }, /* \ */
{ 0x5d, 0, 0, 0xce }, /* ] */
{ 0x5f, 0, 0, 0x15 }, /* _ */
{ 0x60, 0x0001, 2, 0x2b }, /* ` */
{ 0x61, 0, 0, 0x65 }, /* a */
{ 0x62, 0, 0, 0x66 }, /* b */
{ 0x63, 0, 0, 0x67 }, /* c */
{ 0x64, 0, 0, 0x68 }, /* d */
{ 0x65, 0, 0, 0x69 }, /* e */
{ 0x66, 0, 0, 0x6a }, /* f */
{ 0x67, 0, 0, 0x6b }, /* g */
{ 0x68, 0, 0, 0x6c }, /* h */
{ 0x69, 0, 0, 0x6d }, /* i */
{ 0x6a, 0, 0, 0x6e }, /* j */
{ 0x6b, 0, 0, 0x6f }, /* k */
{ 0x6c, 0, 0, 0x70 }, /* l */
{ 0x6d, 0, 0, 0x71 }, /* m */
{ 0x6e, 0, 0, 0x72 }, /* n */
{ 0x6f, 0, 0, 0x73 }, /* o */
{ 0x70, 0, 0, 0x74 }, /* p */
{ 0x71, 0, 0, 0x75 }, /* q */
{ 0x72, 0, 0, 0x76 }, /* r */
{ 0x73, 0, 0, 0x77 }, /* s */
{ 0x74, 0, 0, 0x78 }, /* t */
{ 0x75, 0, 0, 0x79 }, /* u */
{ 0x76, 0, 0, 0x7a }, /* v */
{ 0x77, 0, 0, 0x7b }, /* w */
{ 0x78, 0, 0, 0x7c }, /* x */
{ 0x79, 0, 0, 0x7d }, /* y */
{ 0x7a, 0, 0, 0x7e }, /* z */
{ 0x7b, 0, 0, 0x2c }, /* { (hard-coded ( ) */
{ 0x7c, 0x0002, 2, 0x25 }, /* | */
{ 0x7d, 0, 0, 0x2d }, /* } (hard-coded ) ) */
{ 0x7e, 0x0003, 2, 0x31 }, /* ~ */
{ 0x7f, 0, 0, 0x8b }, /* (full grid) */
#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
/* Latin 1 */
{ 0xa0, 0, 0, 0x24 }, /* (non-breaking space) */
{ 0xa1, 0, 0, 0x44 }, /* ¡ (inverted !) */
{ 0xa2, 0, 0, 0xa8 }, /* ¢ (cent sign) */
{ 0xa3, 0, 0, 0x05 }, /* £ (pound sign) */
{ 0xa4, 0, 0, 0x28 }, /* ¤ (currency sign) */
{ 0xa5, 0, 0, 0x07 }, /* ¥ (yen sign) */
{ 0xa7, 0, 0, 0x63 }, /* § (paragraph sign) */
{ 0xaf, 0, 0, 0xee }, /* ¯ (macron) */
{ 0xbf, 0, 0, 0x64 }, /* ¿ (inverted ?) */
{ 0xc0, 0, 0, 0x8c }, /* À (A grave) */
{ 0xc1, 0, 0, 0x8d }, /* Á (A acute) */
{ 0xc2, 0, 0, 0x8e }, /* Â (A circumflex) */
{ 0xc3, 0, 0, 0x8f }, /* Ã (A tilde) */
{ 0xc4, 0, 0, 0x5f }, /* Ä (A dieresis) */
{ 0xc5, 0, 0, 0x12 }, /* Å (A with ring above) */
{ 0xc6, 0, 0, 0x20 }, /* Æ (AE ligature) */
{ 0xc7, 0, 0, 0x0d }, /* Ç (C cedilla) */
{ 0xc8, 0, 0, 0x90 }, /* È (E grave) */
{ 0xc9, 0, 0, 0x23 }, /* É (E acute) */
{ 0xca, 0, 0, 0x91 }, /* Ê (E circumflex) */
{ 0xcb, 0, 0, 0x92 }, /* Ë (E dieresis) */
{ 0xcc, 0, 0, 0x93 }, /* Ì (I grave) */
{ 0xcd, 0, 0, 0x94 }, /* Í (I acute) */
{ 0xce, 0, 0, 0x4d }, /* Î (I circumflex) */
{ 0xcf, 0, 0, 0x4d }, /* Ï (I dieresis) */
{ 0xd0, 0, 0, 0x95 }, /* Ð (ETH) */
{ 0xd1, 0, 0, 0x61 }, /* Ñ (N tilde) */
{ 0xd2, 0, 0, 0x96 }, /* Ò (O grave) */
{ 0xd3, 0, 0, 0x97 }, /* Ó (O acute) */
{ 0xd4, 0, 0, 0x98 }, /* Ô (O circumflex) */
{ 0xd5, 0, 0, 0x99 }, /* Õ (O tilde) */
{ 0xd6, 0, 0, 0x60 }, /* Ö (O dieresis) */
{ 0xd7, 0, 0, 0xde }, /* × (multiplication sign) */
{ 0xd8, 0, 0, 0x0f }, /* Ø (O stroke) */
{ 0xd9, 0, 0, 0x9a }, /* Ù (U grave) */
{ 0xda, 0, 0, 0x9b }, /* Ú (U acute) */
{ 0xdb, 0, 0, 0x59 }, /* Û (U circumflex) */
{ 0xdc, 0, 0, 0x62 }, /* Ü (U dieresis) */
{ 0xdd, 0, 0, 0x5d }, /* Ý (Y acute) */
{ 0xdf, 0, 0, 0x22 }, /* ß (sharp s) */
{ 0xe0, 0, 0, 0x83 }, /* à (a grave) */
{ 0xe1, 0, 0, 0x9c }, /* á (a acute) */
{ 0xe2, 0, 0, 0x9d }, /* â (a circumflex) */
{ 0xe3, 0, 0, 0x9e }, /* ã (a tilde) */
{ 0xe4, 0, 0, 0x7f }, /* ä (a dieresis) */
{ 0xe5, 0, 0, 0x13 }, /* å (a with ring above) */
{ 0xe7, 0, 0, 0x84 }, /* ç (c cedilla) */
{ 0xe8, 0, 0, 0x08 }, /* è (e grave) */
{ 0xe9, 0, 0, 0x09 }, /* é (e acute) */
{ 0xea, 0, 0, 0x9f }, /* ê (e circumflex) */
{ 0xeb, 0, 0, 0xa0 }, /* ë (e dieresis) */
{ 0xec, 0, 0, 0x6d }, /* ì (i grave) */
{ 0xed, 0, 0, 0xa1 }, /* í (i acute) */
{ 0xee, 0, 0, 0xa2 }, /* î (i circumflex) */
{ 0xef, 0, 0, 0xa3 }, /* ï (i dieresis) */
{ 0xf1, 0, 0, 0x81 }, /* ñ (n tilde) */
{ 0xf2, 0, 0, 0x0c }, /* ò (o grave) */
{ 0xf3, 0, 0, 0xa4 }, /* ó (o acute) */
{ 0xf4, 0, 0, 0xa5 }, /* ô (o circumflex) */
{ 0xf5, 0, 0, 0xa6 }, /* õ (o tilde) */
{ 0xf6, 0, 0, 0x80 }, /* ö (o dieresis) */
{ 0xf8, 0, 0, 0x10 }, /* ø (o slash) */
{ 0xf9, 0, 0, 0x0a }, /* ù (u grave) */
{ 0xfa, 0, 0, 0xa7 }, /* ú (u acute) */
{ 0xfb, 0, 0, 0x79 }, /* û (u circumflex) */
{ 0xfc, 0, 0, 0xa2 }, /* ü (u dieresis) */
{ 0xfd, 0, 0, 0xaf }, /* ý (y acute) */
{ 0xff, 0, 0, 0x7d }, /* ÿ (y dieresis) */
/* Runtime-definable characters */
{ 0xe000, 0x8000, 15, 0x24 }, /* variable character 0 */
{ 0xe001, 0x8001, 15, 0x24 }, /* variable character 1 */
{ 0xe002, 0x8002, 15, 0x24 }, /* variable character 2 */
{ 0xe003, 0x8003, 15, 0x24 }, /* variable character 3 */
{ 0xe004, 0x8004, 15, 0x24 }, /* variable character 4 */
{ 0xe005, 0x8005, 15, 0x24 }, /* variable character 5 */
{ 0xe006, 0x8006, 15, 0x24 }, /* variable character 6 */
{ 0xe007, 0x8007, 15, 0x24 }, /* variable character 7 */
{ 0xe008, 0x8008, 15, 0x24 }, /* variable character 8 */
{ 0xe009, 0x8009, 15, 0x24 }, /* variable character 9 */
{ 0xe00a, 0x800a, 15, 0x24 }, /* variable character 10 */
{ 0xe00b, 0x800b, 15, 0x24 }, /* variable character 11 */
{ 0xe00c, 0x800c, 15, 0x24 }, /* variable character 12 */
{ 0xe00d, 0x800d, 15, 0x24 }, /* variable character 13 */
{ 0xe00e, 0x800e, 15, 0x24 }, /* variable character 14 */
{ 0xe00f, 0x800f, 15, 0x24 }, /* variable character 15 */
/* Icons and special symbols */
{ 0xe100, 0x0004, 14, 0x43 }, /* unknown icon (mirrored ?) */
{ 0xe101, 0x0005, 14, 0xd4 }, /* bookmark icon */
{ 0xe102, 0x0006, 14, 0x2d }, /* plugin icon */
{ 0xe103, 0x0007, 14, 0x34 }, /* folder icon */
{ 0xe104, 0x0008, 14, 0x7c }, /* firmware icon */
{ 0xe105, 0x0009, 14, 0x2f }, /* language icon */
{ 0xe106, 0, 0, 0xfc }, /* audio icon (note) */
{ 0xe107, 0x000b, 14, 0xd4 }, /* wps icon */
{ 0xe108, 0x000c, 14, 0xfa }, /* playlist icon */
{ 0xe109, 0x000f, 14, 0xfa }, /* text file icon */
{ 0xe10a, 0x000e, 14, 0xfa }, /* config icon */
{ 0xe10b, 0, 0, 0x88 }, /* left arrow */
{ 0xe10c, 0, 0, 0x89 }, /* right arrow */
{ 0xe10d, 0, 0, 0x86 }, /* up arrow */
{ 0xe10e, 0, 0, 0x87 }, /* down arrow */
{ 0xe10f, 0, 0, 0x88 }, /* filled left arrow */
{ 0xe110, 0, 0, 0x89 }, /* filled right arrow */
{ 0xe111, 0, 0, 0x86 }, /* filled up arrow */
{ 0xe112, 0, 0, 0x87 }, /* filled down arrow */
{ 0xe113, 0, 0, 0x24 }, /* level 0/7 */
{ 0xe114, 0, 0, 0x15 }, /* level 1/7 */
{ 0xe115, 0, 0, 0xdf }, /* level 2/7 */
{ 0xe116, 0, 0, 0xe0 }, /* level 3/7 */
{ 0xe117, 0, 0, 0xe1 }, /* level 4/7 */
{ 0xe118, 0, 0, 0xe2 }, /* level 5/7 */
{ 0xe119, 0, 0, 0xe3 }, /* level 6/7 */
{ 0xe11a, 0, 0, 0xec }, /* level 7/7 */
#endif /* !BOOTLOADER */
/* no-char symbol */
{ 0xfffd, 0, 0, 0xd8 },
};
const unsigned char xfont_fixed[][8] = {
/* Standard ascii */
{ 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00}, /* 0x000 \ */
{ 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x001 ` */
{ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00}, /* 0x002 | */
{ 0x00, 0x00, 0x08, 0x15, 0x02, 0x00, 0x00, 0x00}, /* 0x003 ~ */
#ifndef BOOTLOADER /* bootloader only supports pure ASCII */
/* Icons and special symbols */
{ 0x0c, 0x12, 0x12, 0x08, 0x08, 0x00, 0x08, 0x00}, /* 0x004 unknown icon */
{ 0x00, 0x03, 0x07, 0x0e, 0x1c, 0x08, 0x00, 0x00}, /* 0x005 bookmark icon */
{ 0x04, 0x1e, 0x07, 0x1f, 0x05, 0x01, 0x06, 0x00}, /* 0x006 plugin icon */
{ 0x0c, 0x13, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x00}, /* 0x007 folder icon */
{ 0x1f, 0x11, 0x1b, 0x15, 0x1b, 0x11, 0x1f, 0x00}, /* 0x008 firmware icon */
{ 0x00, 0x1f, 0x15, 0x1f, 0x15, 0x1f, 0x00, 0x00}, /* 0x009 language icon */
{ 0x03, 0x05, 0x09, 0x09, 0x0b, 0x1b, 0x18, 0x00}, /* 0x00a audio icon (note) */
{ 0x01, 0x01, 0x02, 0x02, 0x14, 0x0c, 0x04, 0x00}, /* 0x00b wps icon */
{ 0x17, 0x00, 0x17, 0x00, 0x17, 0x00, 0x17, 0x00}, /* 0x00c playlist icon */
{ 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 0x00d text file icon */
{ 0x0b, 0x10, 0x0b, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 0x00e config icon */
/* Latin 1 */
{ 0x06, 0x09, 0x08, 0x1e, 0x08, 0x08, 0x1f, 0x00}, /* 0x00f £ (pound sign) */
{ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x010 ¯ (macron) */
{ 0x04, 0x00, 0x04, 0x08, 0x10, 0x11, 0x0e, 0x00}, /* 0x011 ¿ (inverted ?) */
{ 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x012 À (A grave) */
{ 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x013 Á (A acute) */
{ 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x014 Â (a circumflex) */
{ 0x0d, 0x12, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 0x015 Ã (A tilde) */
{ 0x0a, 0x00, 0x04, 0x0a, 0x11, 0x1f, 0x11, 0x00}, /* 0x016 Ä (A dieresis) */
{ 0x04, 0x0a, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x00}, /* 0x017 Å (A with ring above) */
{ 0x0f, 0x14, 0x14, 0x1f, 0x14, 0x14, 0x17, 0x00}, /* 0x018 Æ (AE ligature) */
{ 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x02, 0x0e, 0x00}, /* 0x019 Ç (C cedilla) */
{ 0x08, 0x04, 0x1f, 0x10, 0x1e, 0x10, 0x1f, 0x00}, /* 0x01a È (E grave) */
{ 0x02, 0x04, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01b É (E acute) */
{ 0x04, 0x0a, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01c Ê (E circumflex) */
{ 0x0a, 0x00, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 0x01d Ë (E dieresis)*/
{ 0x08, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 0x01e Ì (I grave) */
{ 0x02, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 0x01f Í (I acute) */
{ 0x0c, 0x0a, 0x09, 0x1d, 0x09, 0x0a, 0x0c, 0x00}, /* 0x020 Ð (ETH) */
{ 0x0d, 0x12, 0x00, 0x19, 0x15, 0x13, 0x11, 0x00}, /* 0x021 Ñ (N tilde) */
{ 0x08, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x022 Ò (O grave) */
{ 0x02, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x023 Ó (O acute) */
{ 0x04, 0x0a, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x024 Ô (O circumflex) */
{ 0x0d, 0x12, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x025 Õ (O tilde) */
{ 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x026 Ö (O dieresis) */
{ 0x01, 0x0e, 0x13, 0x15, 0x19, 0x0e, 0x10, 0x00}, /* 0x027 Ø (O stroke) */
{ 0x08, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x028 Ù (U grave) */
{ 0x02, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x029 Ú (U acute) */
{ 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 0x02a Ü (U dieresis) */
{ 0x08, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02b à (a grave) */
{ 0x02, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02c á (a acute) */
{ 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02d â (a circumflex) */
{ 0x0d, 0x12, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02e ã (a tilde) */
{ 0x0a, 0x00, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x02f ä (a dieresis) */
{ 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 0x030 å (a with ring above) */
{ 0x00, 0x0f, 0x10, 0x10, 0x0f, 0x02, 0x04, 0x00}, /* 0x031 ç (c cedilla) */
{ 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x032 è (e grave) */
{ 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x033 é (e acute) */
{ 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x034 ê (e circumflex) */
{ 0x0a, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 0x035 ë (e dieresis) */
{ 0x02, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x036 í (i acute) */
{ 0x04, 0x0a, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x037 î (i circumflex) */
{ 0x0a, 0x00, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 0x038 ï (i dieresis) */
{ 0x0d, 0x12, 0x00, 0x16, 0x19, 0x11, 0x11, 0x00}, /* 0x039 ñ (n tilde) */
{ 0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03a ò (o grave) */
{ 0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03b ó (o acute) */
{ 0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03c ô (o circumflex) */
{ 0x0d, 0x12, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03d õ (o tilde) */
{ 0x00, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 0x03e ö (o dieresis) */
{ 0x00, 0x02, 0x0e, 0x15, 0x15, 0x0e, 0x08, 0x00}, /* 0x03f ø (o slash) */
{ 0x08, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x040 ù (u grave) */
{ 0x02, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x041 ú (u acute) */
{ 0x00, 0x0a, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 0x042 ü (u dieresis) */
{ 0x02, 0x04, 0x11, 0x11, 0x0f, 0x01, 0x0e, 0x00}, /* 0x043 ý (y acute) */
#endif /* !BOOTLOADER */
};
void lcd_charset_init(void)
{
if (is_new_player())
{
hw_pattern_count = 8;
xchar_info = xchar_info_newlcd;
xchar_info_size = sizeof(xchar_info_newlcd)/sizeof(struct xchar_info);
}
else /* old lcd */
{
hw_pattern_count = 4;
xchar_info = xchar_info_oldlcd;
xchar_info_size = sizeof(xchar_info_oldlcd)/sizeof(struct xchar_info);
}
}

View file

@ -1,751 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2003 by Kjell Ericson
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifndef __CONFIG_H__
/* to easier allow this source file to be used even from tools when config.h
cannot be included safely */
#include "config.h"
#endif
#ifdef HAVE_LCD_CHARCELLS
#include "lcd-player-charset.h"
unsigned short new_lcd_rocklatin1_to_xlcd[] =
{
NOCHAR_NEW, /* 0x00 reserved never to be used */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
0x216, /* 0x16 .. "bookmark" icon */
0x217, /* 0x17 .. "plugin" icon */
0x218, /* 0x18 .. "folder" icon */
0x219, /* 0x19 .. "MOD/AJZ" icon (winlatin o (dote in the middle) */
0x21a, /* 0x1a .. "language" icon (winlatin - (a bit longer minus sign) */
0x21b, /* 0x1b .. "note" icon */
0x21c, /* 0x1c .. "WPS" icon */
0x21d, /* 0x1d .. "playlist" icon */
0x21e, /* 0x1e .. "text file" icon (winlatin - (much longer minus sign) */
0x21f, /* 0x1f .. "config file" icon (winlatin ~) */
0x020, /* 0x20 .. */
0x021, /* 0x21 .. ! */
0x022, /* 0x22 .. " */
0x023, /* 0x23 .. # */
0x024, /* 0x24 .. $ */
0x025, /* 0x25 .. % */
0x026, /* 0x26 .. & */
0x027, /* 0x27 .. ' */
0x028, /* 0x28 .. ( */
0x029, /* 0x29 .. ) */
0x02a, /* 0x2a .. * */
0x02b, /* 0x2b .. + */
0x02c, /* 0x2c .. , */
0x02d, /* 0x2d .. - */
0x02e, /* 0x2e .. . */
0x02f, /* 0x2f .. / */
0x030, /* 0x30 .. 0 */
0x031, /* 0x31 .. 1 */
0x032, /* 0x32 .. 2 */
0x033, /* 0x33 .. 3 */
0x034, /* 0x34 .. 4 */
0x035, /* 0x35 .. 5 */
0x036, /* 0x36 .. 6 */
0x037, /* 0x37 .. 7 */
0x038, /* 0x38 .. 8 */
0x039, /* 0x39 .. 9 */
0x03a, /* 0x3a .. : */
0x03b, /* 0x3b .. ; */
0x03c, /* 0x3c .. < */
0x03d, /* 0x3d .. = */
0x03e, /* 0x3e .. > */
0x03f, /* 0x3f .. ? */
0x040, /* 0x40 .. @ */
0x041, /* 0x41 .. A */
0x042, /* 0x42 .. B */
0x043, /* 0x43 .. C */
0x044, /* 0x44 .. D */
0x045, /* 0x45 .. E */
0x046, /* 0x46 .. F */
0x047, /* 0x47 .. G */
0x048, /* 0x48 .. H */
0x049, /* 0x49 .. I */
0x04a, /* 0x4a .. J */
0x04b, /* 0x4b .. K */
0x04c, /* 0x4c .. L */
0x04d, /* 0x4d .. M */
0x04e, /* 0x4e .. N */
0x04f, /* 0x4f .. O */
0x050, /* 0x50 .. P */
0x051, /* 0x51 .. Q */
0x052, /* 0x52 .. R */
0x053, /* 0x53 .. S */
0x054, /* 0x54 .. T */
0x055, /* 0x55 .. U */
0x056, /* 0x56 .. V */
0x057, /* 0x57 .. W */
0x058, /* 0x58 .. X */
0x059, /* 0x59 .. Y */
0x05a, /* 0x5a .. Z */
0x05b, /* 0x5b .. [ */
0x012, /* 0x5c .. \ */
0x05d, /* 0x5d .. ] */
0x05e, /* 0x5e .. ^ */
0x05f, /* 0x5f .. _ */
0x060, /* 0x60 .. ` */
0x061, /* 0x00 97 .. a */
0x062, /* 0x00 98 .. b */
0x063, /* 0x00 99 .. c */
0x064, /* 0x64 .. d */
0x065, /* 0x65 .. e */
0x066, /* 0x66 .. f */
0x067, /* 0x67 .. g */
0x068, /* 0x68 .. h */
0x069, /* 0x69 .. i */
0x06a, /* 0x6a .. j */
0x06b, /* 0x6b .. k */
0x06c, /* 0x6c .. l */
0x06d, /* 0x6d .. m */
0x06e, /* 0x6e .. n */
0x06f, /* 0x6f .. o */
0x070, /* 0x70 .. p */
0x071, /* 0x71 .. q */
0x072, /* 0x72 .. r */
0x073, /* 0x73 .. s */
0x074, /* 0x74 .. t */
0x075, /* 0x75 .. u */
0x076, /* 0x76 .. v */
0x077, /* 0x77 .. w */
0x078, /* 0x78 .. x */
0x079, /* 0x79 .. y */
0x07a, /* 0x7a .. z */
0x07b, /* 0x7b ..*/ /* Old LCD hardcoded to "(" */
0x07c, /* 0x7c .. | */
0x07d, /* 0x7d .. } */ /* Old LCD hardcoded to ")" */
0x0f0, /* 0x7e .. ~ */
0x0fe, /* 0x7f .. full grid */
NOCHAR_NEW, /* 0x80 winlatin Eurosign */
0x010, /* 0x81 filled-left-arrow (winlatin undefined) */
0x011, /* 0x82 filled-right-arrow (winlatin comma) */
0x01e, /* 0x83 filled-up-arrow (winlatin f) */
0x01f, /* 0x84 filled-up-arrow (winlatin ") */
0x224, /* 0x85 .. … (three dots) */
0x081, /* 0x86 meter level 2 (winlatin undefined) */
0x082, /* 0x87 meter level 3 (winlatin undefined) */
0x083, /* 0x88 meter level 4 (winlatin undefined) */
0x084, /* 0x89 meter level 5 (winlatin Promille) */
0x085, /* 0x8a meter level 6 (winlatin 'S' with upside down ^) */
0x086, /* 0x8b meter level 7 (full) (winlatin '<') */
NOCHAR_NEW, /* 0x8c .. Œ CE */
NOCHAR_NEW, /* 0x8d .. <20> */
0x225, /* 0x8e .. Ž 'Z' with upside down ^ */
NOCHAR_NEW, /* 0x8f .. <20> */
0x25d, /* 0x90 "unknown" icon */
0x094, /* 0x91 .. */
0x07e, /* 0x92 .. */
0x091, /* 0x93 .. folder icon susbstitute */
0x013, /* 0x94 .. note icon substitute */
0x0d0, /* 0x95 .. text/language/config icon substitute (winlatin o (dote in the middle) */
NOCHAR_NEW, /* 0x96 .. (winlatin - (a bit longer minus sign) */
NOCHAR_NEW, /* 0x97 .. (winlatin - (much longer minus sign) */
NOCHAR_NEW, /* 0x98 .. (winlatin ~) */
NOCHAR_NEW, /* 0x99 .. (winlatin TM) */
NOCHAR_NEW, /* 0x9a .. š 's' with upside down ^ */
NOCHAR_NEW, /* 0x9b .. > */
NOCHAR_NEW, /* 0x9c .. œ oe */
NOCHAR_NEW, /* 0x9d .. <20> */
0x225, /* 0x9e .. ž 'z' with upside down ^ */
0x059, /* 0x9f .. Ÿ Large ÿ (Y with two dots) */
NOCHAR_NEW, /* 0xa0 .. */
NOCHAR_NEW, /* 0xa1 .. ¡ */
NOCHAR_NEW, /* 0xa2 .. ¢ */
0x226, /* 0xa3 .. £ */
NOCHAR_NEW, /* 0xa4 .. ¤ */
NOCHAR_NEW, /* 0xa5 .. ¥ */
NOCHAR_NEW, /* 0xa6 .. ¦ */
0x015, /* 0xa7 .. § */
NOCHAR_NEW, /* 0xa8 .. ¨ */
NOCHAR_NEW, /* 0xa9 .. © (copyright) */
NOCHAR_NEW, /* 0xaa .. ª */
NOCHAR_NEW, /* 0xab .. "<<" */
NOCHAR_NEW, /* 0xac .. (unknown) */
NOCHAR_NEW, /* 0xad .. (unkown1 */
NOCHAR_NEW, /* 0xae .. ® (register)*/
0x228, /* 0xaf .. ¯ */
NOCHAR_NEW, /* 0xb0 .. ° */
NOCHAR_NEW, /* 0xb1 .. ± */
NOCHAR_NEW, /* 0xb2 .. ² */
NOCHAR_NEW, /* 0xb3 .. ³ */
NOCHAR_NEW, /* 0xb4 .. ´ */
NOCHAR_NEW, /* 0xb5 .. µ */
NOCHAR_NEW, /* 0xb6 .. 1 */
NOCHAR_NEW, /* 0xb7 .. · */
NOCHAR_NEW, /* 0xb8 .. ¸ */
NOCHAR_NEW, /* 0xb9 .. ¹ */
NOCHAR_NEW, /* 0xba .. º */
NOCHAR_NEW, /* 0xbb .. " */
NOCHAR_NEW, /* 0xbc .. ¼ */
NOCHAR_NEW, /* 0xbd .. ½ */
NOCHAR_NEW, /* 0xbe .. ¾ */
0x229, /* 0xbf .. ¿ */
0x22a, /* 0xc0 .. À */
0x22b, /* 0xc1 .. Á */
0x22c, /* 0xc2 .. Â */
0x22d, /* 0xc3 .. Ã */
0x22e, /* 0xc4 .. Ä */
0x22f, /* 0xc5 .. Å */
0x230, /* 0xc6 .. Æ */
0x231, /* 0xc7 .. Ç */
0x232, /* 0xc8 .. È */
0x233, /* 0xc9 .. É */
0x234, /* 0xca .. Ê */
0x235, /* 0xcb .. Ë */
0x236, /* 0xcc .. Ì */
0x237, /* 0xcd .. Í */
0x049, /* 0xce .. Î */
0x049, /* 0xcf .. Ï */
0x238, /* 0xd0 .. Ð */
0x239, /* 0xd1 .. Ñ */
0x23a, /* 0xd2 .. Ò */
0x23b, /* 0xd3 .. Ó */
0x23c, /* 0xd4 .. Ô */
0x23d, /* 0xd5 .. Õ */
0x23e, /* 0xd6 .. Ö */
0x23f, /* 0xd7 .. × */
0x240, /* 0xd8 .. Ø */
0x241, /* 0xd9 .. Ù */
0x242, /* 0xda .. Ú */
0x055, /* 0xdb .. Û */
0x243, /* 0xdc .. Ü */
0x059, /* 0xdd .. Ý */
NOCHAR_NEW, /* 0xde .. Þ */
0x244, /* 0xdf .. ß */
0x245, /* 0xe0 .. à */
0x246, /* 0xe1 .. á */
0x247, /* 0xe2 .. â */
0x248, /* 0xe3 .. ã */
0x249, /* 0xe4 .. ä */
0x24a, /* 0xe5 .. å */
NOCHAR_NEW, /* 0xe6 .. æ */
0x24b, /* 0xe7 .. ç */
0x24c, /* 0xe8 .. è */
0x24d, /* 0xe9 .. é */
0x24e, /* 0xea .. ê */
0x24f, /* 0xeb .. ë */
0x069, /* 0xec .. ì */
0x250, /* 0xed .. í */
0x251, /* 0xee .. î */
0x252, /* 0xef .. ï */
NOCHAR_NEW, /* 0xf0 .. ð */
0x253, /* 0xf1 .. ñ */
0x23a, /* 0xf2 .. ò */
0x254, /* 0xf3 .. ó */
0x255, /* 0xf4 .. ô */
0x256, /* 0xf5 .. õ */
0x257, /* 0xf6 .. ö */
NOCHAR_NEW, /* 0xf7 .. ÷ */
0x258, /* 0xf8 .. ø */
0x259, /* 0xf9 .. ù */
0x25a, /* 0xfa .. ú */
0x075, /* 0xfb .. û */
0x25b, /* 0xfc .. ü */
0x25c, /* 0xfd .. ý */
NOCHAR_NEW, /* 0xfe .. þ */
0x079, /* 0xff .. ÿ */
};
unsigned short old_lcd_rocklatin1_to_xlcd[] =
{
/* OLD LCD */
NOCHAR_OLD, /* 0x00 reserved never to be used */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
RESERVED_CHAR, /* reserved */
0x216, /* 0x16 .. "bookmark" icon */
0x217, /* 0x17 .. "plugin" icon */
0x218, /* 0x18 .. "folder" icon */
0x219, /* 0x19 .. "MOD/AJZ" icon (winlatin o (dote in the middle) */
0x21a, /* 0x1a .. "language" icon (winlatin - (a bit longer minus sign) */
0x0fc, /* 0x1b .. "note" icon */
0x0d4, /* 0x1c .. "WPS" icon */
0x21d, /* 0x1d .. "playlist" icon */
0x21e, /* 0x1e .. "text file" icon (winlatin - (much longer minus sign) */
0x21f, /* 0x1f .. "config file" icon (winlatin ~) */
0x024, /* 0x20 .. */
0x025, /* 0x21 .. ! */
0x026, /* 0x22 .. " */
0x027, /* 0x23 .. # */
0x006, /* 0x24 .. $ */
0x029, /* 0x25 .. % */
0x02a, /* 0x26 .. & */
0x02b, /* 0x27 .. ' */
0x02c, /* 0x28 .. ( */
0x02d, /* 0x29 .. ) */
0x02e, /* 0x2a .. * */
0x02f, /* 0x2b .. + */
0x030, /* 0x2c .. , */
0x031, /* 0x2d .. - */
0x032, /* 0x2e .. . */
0x033, /* 0x2f .. / */
0x034, /* 0x30 .. 0 */
0x035, /* 0x31 .. 1 */
0x036, /* 0x32 .. 2 */
0x037, /* 0x33 .. 3 */
0x038, /* 0x34 .. 4 */
0x039, /* 0x35 .. 5 */
0x03a, /* 0x36 .. 6 */
0x03b, /* 0x37 .. 7 */
0x03c, /* 0x38 .. 8 */
0x03d, /* 0x39 .. 9 */
0x03e, /* 0x3a .. : */
0x03f, /* 0x3b .. ; */
0x040, /* 0x3c .. < */
0x041, /* 0x3d .. = */
0x042, /* 0x3e .. > */
0x043, /* 0x3f .. ? */
0x004, /* 0x40 .. @ */
0x045, /* 0x41 .. A */
0x046, /* 0x42 .. B */
0x047, /* 0x43 .. C */
0x048, /* 0x44 .. D */
0x049, /* 0x45 .. E */
0x04a, /* 0x46 .. F */
0x04b, /* 0x47 .. G */
0x04c, /* 0x48 .. H */
0x04d, /* 0x49 .. I */
0x04e, /* 0x4a .. J */
0x04f, /* 0x4b .. K */
0x050, /* 0x4c .. L */
0x051, /* 0x4d .. M */
0x052, /* 0x4e .. N */
0x053, /* 0x4f .. O */
0x054, /* 0x50 .. P */
0x055, /* 0x51 .. Q */
0x056, /* 0x52 .. R */
0x057, /* 0x53 .. S */
0x058, /* 0x54 .. T */
0x059, /* 0x55 .. U */
0x05a, /* 0x56 .. V */
0x05b, /* 0x57 .. W */
0x05c, /* 0x58 .. X */
0x05d, /* 0x59 .. Y */
0x05e, /* 0x5a .. Z */
0x0a9, /* 0x5b .. [ */ /* New LCD hardcoded to "(" */
0x220, /* 0x5c .. \ */
0x0ce, /* 0x5d .. ] */ /* New LCD hardcoded to ")" */
NOCHAR_OLD, /* 0x5e .. ^ */
0x015, /* 0x5f .. _ */
0x221, /* 0x60 .. ` */
0x065, /* 0x00 97 .. a */
0x066, /* 0x00 98 .. b */
0x067, /* 0x00 99 .. c */
0x068, /* 0x64 .. d */
0x069, /* 0x65 .. e */
0x06a, /* 0x66 .. f */
0x06b, /* 0x67 .. g */
0x06c, /* 0x68 .. h */
0x06d, /* 0x69 .. i */
0x06e, /* 0x6a .. j */
0x06f, /* 0x6b .. k */
0x070, /* 0x6c .. l */
0x071, /* 0x6d .. m */
0x072, /* 0x6e .. n */
0x073, /* 0x6f .. o */
0x074, /* 0x70 .. p */
0x075, /* 0x71 .. q */
0x076, /* 0x72 .. r */
0x077, /* 0x73 .. s */
0x078, /* 0x74 .. t */
0x079, /* 0x75 .. u */
0x07a, /* 0x76 .. v */
0x07b, /* 0x77 .. w */
0x07c, /* 0x78 .. x */
0x07d, /* 0x79 .. y */
0x07e, /* 0x7a .. z */
0x02c, /* 0x7b ..*/ /* Old LCD hardcoded to "(" */
0x222, /* 0x7c .. | */
0x02d, /* 0x7d .. } */ /* Old LCD hardcoded to ")" */
0x223, /* 0x7e .. ~ */
0x08b, /* 0x7f full grid */
NOCHAR_OLD, /* 0x80 winlatin Eurosign */
0x089, /* 0x81 filled-left-arrow (winlatin undefined) */
0x088, /* 0x82 filled-right-arrow (winlatin comma) */
0x087, /* 0x83 filled-up-arrow (winlatin f) */
0x086, /* 0x84 filled-up-arrow (winlatin ") */
0x085, /* 0x85 .. … (three dots) */
0x0df, /* 0x86 meter level 2 (winlatin undefined) */
0x0e0, /* 0x87 meter level 3 (winlatin undefined) */
0x0e1, /* 0x88 meter level 4 (winlatin undefined) */
0x0e2, /* 0x89 meter level 5 (winlatin Promille) */
0x0e3, /* 0x8a meter level 6 (winlatin 'S' with upside down ^) */
0x0ec, /* 0x8a meter level 7 (full) (winlatin '<') */
NOCHAR_OLD, /* 0x8c .. Œ CE */
NOCHAR_OLD, /* 0x8d .. <20> */
0x0bd, /* 0x8e .. Ž 'Z' with upside down ^ */
NOCHAR_OLD, /* 0x8f .. <20> */
0x25d, /* 0x90 "unknown" icon */
0x0d4, /* 0x91 .. */
0x089, /* 0x92 .. */
0x034, /* 0x93 .. folder icon substitute */
0x0fc, /* 0x94 .. note icon substitute */
0x0fa, /* 0x95 .. text/language/config icon substitute (winlatin o (dote in the middle) */
NOCHAR_OLD, /* 0x96 .. (winlatin - (a bit longer minus sign) */
NOCHAR_OLD, /* 0x97 .. (winlatin - (much longer minus sign) */
NOCHAR_OLD, /* 0x98 .. (winlatin ~) */
NOCHAR_OLD, /* 0x99 .. (winlatin TM) */
NOCHAR_OLD, /* 0x9a .. š 's' with upside down ^ */
NOCHAR_OLD, /* 0x9b .. > */
NOCHAR_OLD, /* 0x9c .. œ oe */
NOCHAR_OLD, /* 0x9d .. <20> */
0x0bd, /* 0x9e .. ž 'z' with upside down ^ */
NOCHAR_OLD, /* 0x9f .. Ÿ Large ÿ (Y with two dots) */
NOCHAR_OLD, /* 0xa0 .. */
NOCHAR_OLD, /* 0xa1 .. ¡ */
NOCHAR_OLD, /* 0xa2 .. ¢ */
0x005, /* 0xa3 .. £ */
NOCHAR_OLD, /* 0xa4 .. ¤ */
NOCHAR_OLD, /* 0xa5 .. ¥ */
NOCHAR_OLD, /* 0xa6 .. ¦ */
0x063, /* 0xa7 .. § */
NOCHAR_OLD, /* 0xa8 .. ¨ */
NOCHAR_OLD, /* 0xa9 .. © (copyright) */
NOCHAR_OLD, /* 0xaa .. ª */
NOCHAR_OLD, /* 0xab .. "<<" */
NOCHAR_OLD, /* 0xac .. (unknown) */
NOCHAR_OLD, /* 0xad .. (unkown1 */
NOCHAR_OLD, /* 0xae .. ® (register)*/
0x0ee, /* 0xaf .. ¯ */
NOCHAR_OLD, /* 0xb0 .. ° */
NOCHAR_OLD, /* 0xb1 .. ± */
NOCHAR_OLD, /* 0xb2 .. ² */
NOCHAR_OLD, /* 0xb3 .. ³ */
NOCHAR_OLD, /* 0xb4 .. ´ */
NOCHAR_OLD, /* 0xb5 .. µ */
NOCHAR_OLD, /* 0xb6 .. 1 */
NOCHAR_OLD, /* 0xb7 .. · */
NOCHAR_OLD, /* 0xb8 .. ¸ */
NOCHAR_OLD, /* 0xb9 .. ¹ */
NOCHAR_OLD, /* 0xba .. º */
NOCHAR_OLD, /* 0xbb .. " */
NOCHAR_OLD, /* 0xbc .. ¼ */
NOCHAR_OLD, /* 0xbd .. ½ */
NOCHAR_OLD, /* 0xbe .. ¾ */
0x064, /* 0xbf .. ¿ */
0x08c, /* 0xc0 .. À */
0x08d, /* 0xc1 .. Á */
0x08e, /* 0xc2 .. Â */
0x08f, /* 0xc3 .. Ã */
0x05f, /* 0xc4 .. Ä */
0x012, /* 0xc5 .. Å */
0x020, /* 0xc6 .. Æ */
0x00d, /* 0xc7 .. Ç */
0x090, /* 0xc8 .. È */
0x023, /* 0xc9 .. É */
0x091, /* 0xca .. Ê */
0x092, /* 0xcb .. Ë */
0x093, /* 0xcc .. Ì */
0x094, /* 0xcd .. Í */
0x049, /* 0xce .. Î */
0x049, /* 0xcf .. Ï */
0x095, /* 0xd0 .. Ð */
0x061, /* 0xd1 .. Ñ */
0x096, /* 0xd2 .. Ò */
0x097, /* 0xd3 .. Ó */
0x098, /* 0xd4 .. Ô */
0x099, /* 0xd5 .. Õ */
0x060, /* 0xd6 .. Ö */
0x0de, /* 0xd7 .. × */
0x00f, /* 0xd8 .. Ø */
0x09a, /* 0xd9 .. Ù */
0x09b, /* 0xda .. Ú */
0x059, /* 0xdb .. Û */
0x062, /* 0xdc .. Ü */
0x0af, /* 0xdd .. Ý */
NOCHAR_OLD, /* 0xde .. Þ */
0x022, /* 0xdf .. ß */
0x083, /* 0xe0 .. à */
0x09c, /* 0xe1 .. á */
0x09d, /* 0xe2 .. â */
0x09e, /* 0xe3 .. ã */
0x07f, /* 0xe4 .. ä */
0x09d, /* 0xe5 .. å */
NOCHAR_OLD, /* 0xe6 .. æ */
0x084, /* 0xe7 .. ç */
0x008, /* 0xe8 .. è */
0x009, /* 0xe9 .. é */
0x09f, /* 0xea .. ê */
0x0a0, /* 0xeb .. ë */
0x06d, /* 0xec .. ì */
0x0a1, /* 0xed .. í */
0x0a2, /* 0xee .. î */
0x0a3, /* 0xef .. ï */
NOCHAR_OLD, /* 0xf0 .. ð */
0x081, /* 0xf1 .. ñ */
0x096, /* 0xf2 .. ò */
0x0a4, /* 0xf3 .. ó */
0x0a5, /* 0xf4 .. ô */
0x0a6, /* 0xf5 .. õ */
0x080, /* 0xf6 .. ö */
NOCHAR_OLD, /* 0xf7 .. ÷ */
0x010, /* 0xf8 .. ø */
0x00a, /* 0xf9 .. ù */
0x0a7, /* 0xfa .. ú */
0x079, /* 0xfb .. û */
0x082, /* 0xfc .. ü */
0x0af, /* 0xfd .. ý */
NOCHAR_OLD, /* 0xfe .. þ */
0x07d, /* 0xff .. ÿ */
};
/* second table -- substitute */
const unsigned char
lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] =
{
/* 00 */ NOCHAR_NEW, /* 0-16 user defined */
/* 01 */ NOCHAR_NEW, /* 0-16 user defined */
/* 02 */ NOCHAR_NEW, /* 0-16 user defined */
/* 03 */ NOCHAR_NEW, /* 0-16 user defined */
/* 04 */ NOCHAR_NEW, /* 0-16 user defined */
/* 05 */ NOCHAR_NEW, /* 0-16 user defined */
/* 06 */ NOCHAR_NEW, /* 0-16 user defined */
/* 07 */ NOCHAR_NEW, /* 0-16 user defined */
/* 08 */ NOCHAR_NEW, /* 0-16 user defined */
/* 09 */ NOCHAR_NEW, /* 0-16 user defined */
/* 0a */ NOCHAR_NEW, /* 0-16 user defined */
/* 0b */ NOCHAR_NEW, /* 0-16 user defined */
/* 0c */ NOCHAR_NEW, /* 0-16 user defined */
/* 0d */ NOCHAR_NEW, /* 0-16 user defined */
/* 0e */ NOCHAR_NEW, /* 0-16 user defined */
/* 0f */ NOCHAR_NEW, /* 0-16 user defined */
/* 10 */ NOCHAR_NEW, /* reserved */
/* 11 */ NOCHAR_NEW, /* reserved */
/* 12 */ NOCHAR_NEW, /* reserved */
/* 13 */ NOCHAR_NEW, /* reserved */
/* 14 */ NOCHAR_NEW, /* reserved */
/* 15 */ NOCHAR_NEW, /* reserved */
/* 16 */ 0x91, /* bookmark icon */
/* 17 */ 0x29, /* plugin icon */
/* 18 */ 0x93, /* folder icon */
/* 19 */ 'x', /* MOD/AJZ icon */
/* 1a */ '+', /* language icon */
/* 1b */ 0x94, /* note icon */
/* 1c */ 0x91, /* WPS icon */
/* 1d */ 0x95, /* playlist icon */
/* 1e */ 0x95, /* text file icon */
/* 1f */ 0x95, /* config file icon */
/* 20 */ '/', /* substitute char for old lcd \ */
/* 21 */ '\'', /* substitute char for old lcd ` */
/* 22 */ '!', /* substitute char for old lcd | */
/* 23 */ '-', /* substitute char for old lcd ~ */
/* 24 */ '.', /* substitute char for new lcd (three dots) */
/* 25 */ 'z', /* substitue char for new lcd (0x0bd) 'z' with upside down ^ */
/* 26 */ 'L', /* substitue char for new lcd (0x005) £ */
/* 27 */ NOCHAR_NEW, /* empty */
/* 28 */ '-', /* substitue char for new lcd (0x0ee) ¯ */
/* 29 */ '?', /* substitue char for new lcd (0x064) ¿ */
/* 2a */ 'A', /* substitue char for new lcd (0x08c) À */
/* 2b */ 'A', /* substitue char for new lcd (0x08d) Á */
/* 2c */ 'A', /* substitue char for new lcd (0x08e) Â */
/* 2d */ 'A', /* substitue char for new lcd (0x08e) Ã */
/* 2e */ 'A', /* substitue char for new lcd (0x05f) Ä */
/* 2f */ 'A', /* substitue char for new lcd (0x012) Å */
/* 30 */ 'A', /* substitue char for new lcd (0x020) Æ */
/* 31 */ 'C', /* substitue char for new lcd (0x00d) Ç */
/* 32 */ 'E', /* substitue char for new lcd (0x090) È */
/* 33 */ 'E', /* substitue char for new lcd (0x023) É */
/* 34 */ 'E', /* substitue char for new lcd (0x091) Ê */
/* 35 */ 'E', /* substitue char for new lcd (0x092) Ë */
/* 36 */ 'I', /* substitue char for new lcd (0x093) Ì */
/* 37 */ 'I', /* substitue char for new lcd (0x094) Í */
/* 38 */ 'D', /* substitue char for new lcd (0x095) Ð */
/* 39 */ 'N', /* substitue char for new lcd (0x061) Ñ */
/* 3a */ 'O', /* substitue char for new lcd (0x096) Ò */
/* 3b */ 'O', /* substitue char for new lcd (0x097) Ó */
/* 3c */ 'O', /* substitue char for new lcd (0x098) Ô */
/* 3d */ 'O', /* substitue char for new lcd (0x099) Õ */
/* 3e */ 'O', /* substitue char for new lcd (0x060) Ö */
/* 3f */ 'x', /* substitue char for new lcd (0x0de) × */
/* 40 */ '0', /* substitue char for new lcd (0x00f) Ø */
/* 41 */ 'U', /* substitue char for new lcd (0x09a) Ù */
/* 42 */ 'U', /* substitue char for new lcd (0x09b) Ú */
/* 43 */ 'U', /* substitue char for new lcd (0x062) Ü */
/* 44 */ 'B', /* substitue char for new lcd (0x022) ß */
/* 45 */ 'a', /* substitue char for new lcd (0x083) à */
/* 46 */ 'a', /* substitue char for new lcd (0x09c) á */
/* 47 */ 'a', /* substitue char for new lcd (0x09d) â */
/* 48 */ 'a', /* substitue char for new lcd (0x09e) ã */
/* 49 */ 'a', /* substitue char for new lcd (0x07f) ä */
/* 4a */ 'a', /* substitue char for new lcd (0x09d) å */
/* 4b */ 'c', /* substitue char for new lcd (0x084) ç */
/* 4c */ 'e', /* substitue char for new lcd (0x008) è */
/* 4d */ 'e', /* substitue char for new lcd (0x009) é */
/* 4e */ 'e', /* substitue char for new lcd (0x09f) ê */
/* 4f */ 'e', /* substitue char for new lcd (0x0a0) ë */
/* 50 */ 'i', /* substitue char for new lcd (0x0a1) í */
/* 51 */ 'i', /* substitue char for new lcd (0x0a2) î */
/* 52 */ 'i', /* substitue char for new lcd (0x0a3) ï */
/* 53 */ 'n', /* substitue char for new lcd (0x081) ñ */
/* 54 */ 'o', /* substitue char for new lcd (0x0a4) ó */
/* 55 */ 'o', /* substitue char for new lcd (0x0a5) ô */
/* 56 */ 'o', /* substitue char for new lcd (0x0a6) õ */
/* 57 */ 'o', /* substitue char for new lcd (0x080) ö */
/* 58 */ 'o', /* substitue char for new lcd (0x010) ø */
/* 59 */ 'u', /* substitue char for new lcd (0x00a) ù */
/* 5a */ 'u', /* substitue char for new lcd (0x0a7) ú */
/* 5b */ 'u', /* substitue char for new lcd (0x082) ü */
/* 5c */ 'y', /* substitue char for new lcd (0x0af) ý */
/* 5d */ '?', /* unknown icon */
};
unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 00 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 01 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 02 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 03 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 04 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 05 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 06 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 07 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 08 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 09 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0a */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0b */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0c */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0d */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0e */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0f */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 10 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 11 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 12 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 13 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 14 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 15 */
{ 0x00, 0x03, 0x07, 0x0e, 0x1c, 0x08, 0x00, 0x00}, /* 16 Bookmark icon */
{ 0x04, 0x1e, 0x07, 0x1f, 0x05, 0x01, 0x06, 0x00}, /* 17 Plugin file icon */
{ 0x0c, 0x13, 0x11, 0x11, 0x11, 0x11, 0x1f, 0x00}, /* 18 Folder icon */
{ 0x1f, 0x11, 0x1b, 0x15, 0x1b, 0x11, 0x1f, 0x00}, /* 19 MOD/AJZ icon */
{ 0x00, 0x1f, 0x15, 0x1f, 0x15, 0x1f, 0x00, 0x00}, /* 1a Language icon */
{ 0x03, 0x05, 0x09, 0x09, 0x0b, 0x1b, 0x18, 0x00}, /* 1b note icon */
{ 0x01, 0x01, 0x02, 0x02, 0x14, 0x0c, 0x04, 0x00}, /* 1c WPS icon */
{ 0x17, 0x00, 0x17, 0x00, 0x17, 0x00, 0x17, 0x00}, /* 1d Playlist icon */
{ 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 1e Text file icon */
{ 0x0b, 0x10, 0x0b, 0x00, 0x1f, 0x00, 0x1f, 0x00}, /* 1f Config file icon */
/* Unprioritized chars follows below, least prioritized char last */
{ 0x00, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, 0x00}, /* 20 '\' new lcd 0x12 */
{ 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 21 '`' new lcd 0x60 */
{ 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00}, /* 22 '|' new lcd 0x7c */
{ 0x00, 0x00, 0x08, 0x15, 0x02, 0x00, 0x00, 0x00}, /* 23 '~' new lcd 0xf0 */
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00}, /* 24 old lcd 0x85 */
{ 0x0a, 0x04, 0x1f, 0x02, 0x04, 0x08, 0x1f, 0x00}, /* 25 old lcd 0xbd */
{ 0x06, 0x09, 0x08, 0x1e, 0x08, 0x08, 0x1f, 0x00}, /* 26 old lcd 0x05 */
{ 0x0e, 0x10, 0x0e, 0x11, 0x0e, 0x01, 0x0e, 0x00}, /* 27 old lcd 0x63 */
{ 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 28 old lcd 0xee */
{ 0x04, 0x00, 0x04, 0x08, 0x10, 0x11, 0x0e, 0x00}, /* 29 old lcd 0x64 */
{ 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2a old lcd 0x8c */
{ 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2b old lcd 0x8d */
{ 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2c old lcd 0x8e */
{ 0x0d, 0x12, 0x0e, 0x11, 0x1f, 0x11, 0x11, 0x00}, /* 2d old lcd 0x8f */
{ 0x0a, 0x00, 0x04, 0x0a, 0x11, 0x1f, 0x11, 0x00}, /* 2e old lcd 0x5f */
{ 0x04, 0x0a, 0x04, 0x0e, 0x11, 0x1f, 0x11, 0x00}, /* 2f old lcd 0x12 */
{ 0x0f, 0x14, 0x14, 0x1f, 0x14, 0x14, 0x17, 0x00}, /* 30 old lcd 0x20 */
{ 0x0f, 0x10, 0x10, 0x10, 0x0f, 0x02, 0x0e, 0x00}, /* 31 old lcd 0x0d */
{ 0x08, 0x04, 0x1f, 0x10, 0x1e, 0x10, 0x1f, 0x00}, /* 32 old lcd 0x90 */
{ 0x02, 0x04, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 33 old lcd 0x23 */
{ 0x04, 0x0a, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 34 old lcd 0x91 */
{ 0x0a, 0x00, 0x1f, 0x10, 0x1c, 0x10, 0x1f, 0x00}, /* 35 old lcd 0x92 */
{ 0x08, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 36 old lcd 0x93 */
{ 0x02, 0x04, 0x0e, 0x04, 0x04, 0x04, 0x0e, 0x00}, /* 37 old lcd 0x94 */
{ 0x0c, 0x0a, 0x09, 0x1d, 0x09, 0x0a, 0x0c, 0x00}, /* 38 old lcd 0x95 */
{ 0x0d, 0x12, 0x00, 0x19, 0x15, 0x13, 0x11, 0x00}, /* 39 old lcd 0x61 */
{ 0x08, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3a old lcd 0x96 */
{ 0x02, 0x04, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3b old lcd 0x97 */
{ 0x04, 0x0a, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3c old lcd 0x98 */
{ 0x0d, 0x12, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3d old lcd 0x99 */
{ 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 3e old lcd 0x60 */
{ 0x00, 0x00, 0x00, 0x00, 0x0a, 0x04, 0x0a, 0x00}, /* 3f old lcd 0xde */
{ 0x01, 0x0e, 0x13, 0x15, 0x19, 0x0e, 0x10, 0x00}, /* 40 old lcd 0x0f */
{ 0x08, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 41 old lcd 0x9a */
{ 0x02, 0x04, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 42 old lcd 0x9b */
{ 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x00}, /* 43 old lcd 0x62 */
{ 0x0c, 0x12, 0x16, 0x11, 0x11, 0x16, 0x10, 0x00}, /* 44 old lcd 0x22 */
{ 0x08, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 45 old lcd 0x83 */
{ 0x02, 0x04, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 46 old lcd 0x9c */
{ 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 47 old lcd 0x9d */
{ 0x0d, 0x12, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 48 old lcd 0x9e */
{ 0x0a, 0x00, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 49 old lcd 0x7f */
{ 0x04, 0x0a, 0x0e, 0x01, 0x0f, 0x11, 0x0f, 0x00}, /* 4a old lcd 0x9d */
{ 0x00, 0x0f, 0x10, 0x10, 0x0f, 0x02, 0x04, 0x00}, /* 4b old lcd 0x84 */
{ 0x08, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4c old lcd 0x08 */
{ 0x02, 0x04, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4d old lcd 0x09 */
{ 0x04, 0x0a, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4e old lcd 0x9f */
{ 0x0a, 0x00, 0x0e, 0x11, 0x1f, 0x10, 0x0e, 0x00}, /* 4f old lcd 0xa0 */
{ 0x02, 0x04, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 50 old lcd 0xa1 */
{ 0x04, 0x0a, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 51 old lcd 0xa2 */
{ 0x0a, 0x00, 0x00, 0x0c, 0x04, 0x04, 0x0e, 0x00}, /* 52 old lcd 0xa3 */
{ 0x0d, 0x12, 0x00, 0x16, 0x19, 0x11, 0x11, 0x00}, /* 53 old lcd 0x81 */
{ 0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 54 old lcd 0xa4 */
{ 0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 55 old lcd 0xa5 */
{ 0x0d, 0x12, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 56 old lcd 0xa6 */
{ 0x00, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x0e, 0x00}, /* 57 old lcd 0x80 */
{ 0x00, 0x02, 0x0e, 0x15, 0x15, 0x0e, 0x08, 0x00}, /* 58 old lcd 0x10 */
{ 0x08, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 59 old lcd 0x0a */
{ 0x02, 0x04, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 5a old lcd 0xa7 */
{ 0x00, 0x0a, 0x00, 0x11, 0x11, 0x13, 0x0d, 0x00}, /* 5b old lcd 0x82 */
{ 0x02, 0x04, 0x11, 0x11, 0x0f, 0x01, 0x0e, 0x00}, /* 5c old lcd 0xaf */
{ 0x0c, 0x12, 0x12, 0x08, 0x08, 0x00, 0x08, 0x00}, /* 5d Unknown icon */
};
#endif /* HAVE_LCD_CHARCELLS */

View file

@ -1,830 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2002 by Alan Korr
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include "hwcompat.h"
#ifdef HAVE_LCD_CHARCELLS
#include "lcd.h"
#include "kernel.h"
#include "thread.h"
#include <string.h>
#include <stdlib.h>
#include "file.h"
#include "debug.h"
#include "system.h"
#include "font.h"
#include "lcd-player-charset.h"
#include "rbunicode.h"
/*** definitions ***/
#define OLD_LCD_CONTRAST_SET ((char)0xA8)
#define OLD_LCD_CRAM ((char)0xB0) /* Characters */
#define OLD_LCD_PRAM ((char)0x80) /* Patterns */
#define OLD_LCD_IRAM ((char)0xE0) /* Icons */
#define NEW_LCD_CONTRAST_SET ((char)0x50)
#define NEW_LCD_CRAM ((char)0x80) /* Characters */
#define NEW_LCD_PRAM ((char)0xC0) /* Patterns */
#define NEW_LCD_IRAM ((char)0x40) /* Icons */
#define NEW_LCD_FUNCTION_SET ((char)0x10)
#define NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET ((char)0x0c)
#define NEW_LCD_POWER_CONTROL_REGISTER_SET ((char)0x20)
#define NEW_LCD_DISPLAY_CONTROL_SET ((char)0x28)
#define LCD_CURSOR(x,y) ((char)(lcd_cram+((y)*16+(x))))
#define LCD_ICON(i) ((char)(lcd_iram+i))
#define SCROLLABLE_LINES 2
#define SCROLL_MODE_OFF 0
#define SCROLL_MODE_PAUSE 1
#define SCROLL_MODE_RUN 2
extern unsigned short new_lcd_rocklatin1_to_xlcd[];
extern unsigned short old_lcd_rocklatin1_to_xlcd[];
extern const unsigned char lcd_player_extended_lcd_to_rocklatin1[];
extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8];
/*** generic code ***/
#define MAX_CURSOR_CHARS 8
struct cursorinfo {
int len;
char text[MAX_CURSOR_CHARS];
int textpos;
int y_pos;
int x_pos;
int divider;
int downcount;
} cursor;
static void scroll_thread(void);
static char scroll_stack[DEFAULT_STACK_SIZE];
static const char scroll_name[] = "scroll";
static int scroll_ticks = 12; /* # of ticks between updates */
static int scroll_delay = HZ/2; /* delay before starting scroll */
static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */
static int scroll_spacing = 3; /* spaces between end and start of text */
static int bidir_limit = 50; /* percent */
static int jump_scroll = 0; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
static struct scrollinfo scroll[SCROLLABLE_LINES];
static char extended_chars_mapped[NO_EXTENDED_LCD_CHARS];
static char extended_pattern_content[8]; /* Which char is mapped in pattern */
static char extended_pattern_usage[8]; /* Counting number of times used */
static char pattern_size; /* Last pattern, 3 for old LCD, 7 for new LCD */
static bool new_lcd;
unsigned short *lcd_ascii;
static char lcd_contrast_set;
static char lcd_cram;
static char lcd_pram;
static char lcd_iram;
unsigned short buffer_xlcd[11][2];
unsigned short buffer_lcd_mirror[11][2];
#ifdef SIMULATOR
unsigned char hardware_buffer_lcd[11][2];
#endif
#define NO_CHAR -1
static void lcd_free_pat(int map_ch)
{
int x, y;
unsigned char substitute_char;
int pat;
pat=extended_chars_mapped[map_ch];
if (pat!=NO_CHAR) {
substitute_char=lcd_player_extended_lcd_to_rocklatin1[map_ch];
/* TODO: use a define for the screen width! */
for (x=0; x<11; x++) {
/* TODO: use a define for the screen height! */
for (y=0; y<2; y++) {
if (map_ch==lcd_ascii[buffer_xlcd[x][y]]-512) {
buffer_xlcd[x][y]=substitute_char;
buffer_lcd_mirror[x][y]=substitute_char;
#ifdef SIMULATOR
hardware_buffer_lcd[x][y]=substitute_char;
#else
lcd_write_command_e(LCD_CURSOR(x, y), substitute_char);
#endif
}
}
}
extended_chars_mapped[map_ch]=NO_CHAR;
extended_pattern_content[pat]=NO_CHAR;
extended_pattern_usage[pat]=0;
}
#ifdef SIMULATOR
lcd_update();
#endif
}
static int lcd_get_free_pat(int ch)
{
int pat;
int last_pat=0;
static int last_used_pat=0;
int loop;
pat=last_used_pat;
for (loop=0; loop<=pattern_size; loop++) {
pat=(pat+1)&pattern_size; /* Keep 'pat' within limits */
if (extended_pattern_usage[pat]==0) {
int map_ch=extended_pattern_content[pat];
if (map_ch != NO_CHAR) {
extended_chars_mapped[map_ch]=NO_CHAR;
extended_pattern_content[pat]=NO_CHAR;
}
last_used_pat=pat;
return pat;
}
if (extended_pattern_content[pat]>extended_pattern_content[last_pat])
last_pat=pat;
}
if (ch<32) { /* Prioritized char */
/* Remove last_pat */
lcd_free_pat(extended_pattern_content[last_pat]);
last_used_pat=last_pat;
return last_pat;
}
return NO_CHAR;
}
void xlcd_update(void)
{
int x, y;
for (x=0; x<11; x++) {
for (y=0; y<2; y++) {
unsigned short ch=buffer_xlcd[x][y];
unsigned char hw_ch=0xff;
if (ch==buffer_lcd_mirror[x][y])
continue; /* No need to redraw */
buffer_lcd_mirror[x][y]=ch;
if (ch>=256 && ch<512) {
hw_ch=ch-256;
} else {
int map_ch=lcd_ascii[ch];
if (map_ch<512) {
hw_ch=map_ch;
}
else {
map_ch=map_ch-512;
if (extended_chars_mapped[map_ch]!=NO_CHAR) {
hw_ch=extended_chars_mapped[map_ch];
extended_pattern_usage[hw_ch]++;
}
else {
int pat;
pat=lcd_get_free_pat(map_ch);
if (pat<0) {
/* Find substitute char */
map_ch=
lcd_player_extended_lcd_to_rocklatin1[map_ch];
hw_ch=lcd_ascii[map_ch];
} else {
#ifdef DEBUG
if (extended_pattern_usage[pat]!=0) {
DEBUGF("***Pattern %d is not zero!\n", pat);
}
#endif
extended_chars_mapped[map_ch]=pat;
extended_pattern_content[pat]=map_ch;
extended_pattern_usage[pat]=1;
lcd_define_hw_pattern(pat*8,
extended_font_player[map_ch],
8);
hw_ch=pat;
}
}
}
}
#ifdef SIMULATOR
hardware_buffer_lcd[x][y]=hw_ch;
#else
lcd_write_command_e(LCD_CURSOR(x,y), hw_ch);
#endif
}
}
lcd_update();
}
bool lcdx_putc(int x, int y, unsigned short ch)
{
int lcd_char;
if (buffer_xlcd[x][y]==ch)
return false; /* Same char, ignore any update */
lcd_char=lcd_ascii[buffer_xlcd[x][y]];
if (lcd_char>=512) {
/* The removed char is a defined pattern, count down the reference. */
extended_pattern_usage[(int)extended_chars_mapped[lcd_char-512]]--;
#ifdef DEBUG
if (extended_pattern_usage[(int)extended_chars_mapped[lcd_char]]<0) {
DEBUGF("**** Mapped char %02x is less than 0!\n", lcd_char);
}
#endif
}
buffer_xlcd[x][y]=ch;
lcd_char=lcd_ascii[ch];
if (lcd_char>=256)
return true; /* Caller shall call xlcd_update() when done */
buffer_lcd_mirror[x][y]=lcd_char;
#ifdef SIMULATOR
hardware_buffer_lcd[x][y]=lcd_char;
#else
lcd_write_command_e(LCD_CURSOR(x, y), lcd_char);
#endif
return false;
}
void lcd_clear_display(void)
{
int i;
bool update=false;
lcd_stop_scroll();
cursor.len=0; /* Stop cursor */
for (i=0;i<22;i++)
update|=lcdx_putc(i%11, i/11, ' ');
if (update)
xlcd_update();
}
static void lcd_puts_cont_scroll(int x, int y, const unsigned char *string)
{
bool update=false;
for (; *string && x<11; x++)
{
/* We should check if char is over 256 */
update|=lcdx_putc(x, y, *(unsigned char*)string++);
}
for (; x<11; x++)
update|=lcdx_putc(x, y, ' ');
if (update)
xlcd_update();
#ifdef SIMULATOR
lcd_update();
#endif
}
void lcd_puts(int x, int y, const unsigned char *string)
{
int i=0;
unsigned short ucs;
const unsigned char *utf8 = string;
unsigned char tmp[12];
while (*utf8 && i<11) {
utf8 = utf8decode(utf8, &ucs);
if (ucs < 256)
tmp[i++] = ucs;
else
tmp[i++] = '?';
}
tmp[i] = 0;
scroll[y].mode=SCROLL_MODE_OFF;
return lcd_puts_cont_scroll(x, y, tmp);
}
void lcd_put_cursor(int x, int y, char cursor_char)
{
if (cursor.len == 0) {
cursor.text[0]=buffer_xlcd[x][y];
cursor.text[1]=cursor_char;
cursor.len=2;
cursor.textpos=0;
cursor.y_pos=y;
cursor.x_pos=x;
cursor.downcount=0;
cursor.divider=4;
}
}
void lcd_remove_cursor(void)
{
if (cursor.len!=0) {
bool up;
cursor.len=0;
up = lcdx_putc(cursor.x_pos, cursor.y_pos, cursor.text[0]);
#ifdef SIMULATOR
if(up)
lcd_update();
#endif
}
}
void lcd_putc(int x, int y, unsigned short ch)
{
bool update;
if (x<0 || y<0) {
return;
}
update=lcdx_putc(x, y, ch);
if (update)
xlcd_update();
}
unsigned char lcd_get_locked_pattern(void)
{
unsigned char pat=1;
while (pat<LAST_RESERVED_CHAR) {
if (lcd_ascii[pat]==RESERVED_CHAR) {
lcd_ascii[pat]=0x200+pat;
return pat;
}
pat++;
}
return 0;
}
void lcd_unlock_pattern(unsigned char pat)
{
lcd_ascii[pat]=RESERVED_CHAR;
lcd_free_pat(pat);
}
void lcd_define_pattern(int pat, const char *pattern)
{
int i;
for (i=0; i<7; i++) {
extended_font_player[pat][i]=pattern[i];
}
if (extended_chars_mapped[pat]!=NO_CHAR) {
lcd_define_hw_pattern(extended_chars_mapped[pat]*8, pattern, 7);
}
}
#ifndef SIMULATOR
void lcd_define_hw_pattern (int which,const char *pattern,int length)
{
lcd_write_command(lcd_pram | which);
lcd_write_data(pattern, length);
}
void lcd_double_height(bool on)
{
if(new_lcd)
lcd_write_command(on?9:8);
}
static const char icon_pos[] =
{
0, 0, 0, 0, /* Battery */
2, /* USB */
3, /* Play */
4, /* Record */
5, /* Pause */
5, /* Audio */
6, /* Repeat */
7, /* 1 */
9, /* Volume */
9, /* Volume 1 */
9, /* Volume 2 */
10, /* Volume 3 */
10, /* Volume 4 */
10, /* Volume 5 */
10, /* Param */
};
static const char icon_mask[] =
{
0x02, 0x08, 0x04, 0x10, /* Battery */
0x04, /* USB */
0x10, /* Play */
0x10, /* Record */
0x02, /* Pause */
0x10, /* Audio */
0x02, /* Repeat */
0x01, /* 1 */
0x04, /* Volume */
0x02, /* Volume 1 */
0x01, /* Volume 2 */
0x08, /* Volume 3 */
0x04, /* Volume 4 */
0x01, /* Volume 5 */
0x10, /* Param */
};
void lcd_icon(int icon, bool enable)
{
static unsigned char icon_mirror[11] = {0};
int pos, mask;
pos = icon_pos[icon];
mask = icon_mask[icon];
if(enable)
icon_mirror[pos] |= mask;
else
icon_mirror[pos] &= ~mask;
lcd_write_command_e(LCD_ICON(pos), icon_mirror[pos]);
}
int lcd_default_contrast(void)
{
return 30;
}
void lcd_set_contrast(int val)
{
lcd_write_command_e(lcd_contrast_set, 31 - val);
}
#endif /* SIMULATOR */
void lcd_init (void)
{
unsigned char data_vector[64];
(void)data_vector;
new_lcd = is_new_player();
memset(extended_chars_mapped, NO_CHAR, sizeof(extended_chars_mapped));
memset(extended_pattern_content, NO_CHAR,sizeof(extended_pattern_content));
memset(extended_pattern_usage, 0, sizeof(extended_pattern_usage));
if(new_lcd) {
lcd_ascii = new_lcd_rocklatin1_to_xlcd;
lcd_contrast_set = NEW_LCD_CONTRAST_SET;
lcd_cram = NEW_LCD_CRAM;
lcd_pram = NEW_LCD_PRAM;
lcd_iram = NEW_LCD_IRAM;
pattern_size=7; /* Last pattern, 7 for new LCD */
#ifndef SIMULATOR
/* LCD init for cold start */
PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
or_b(0x0f, &PBIORL); /* ... output */
or_b(0x0f, &PBDRL); /* ... and high */
lcd_write_command(NEW_LCD_FUNCTION_SET + 1); /* CGRAM selected */
lcd_write_command_e(NEW_LCD_CONTRAST_SET, 0x08);
lcd_write_command(NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET + 2);
/* oscillator on */
lcd_write_command(NEW_LCD_POWER_CONTROL_REGISTER_SET + 7);
/* opamp buffer + voltage booster on*/
memset(data_vector, 0x20, 64);
lcd_write_command(NEW_LCD_CRAM); /* Set DDRAM address */
lcd_write_data(data_vector, 64); /* all spaces */
memset(data_vector, 0, 64);
lcd_write_command(NEW_LCD_PRAM); /* Set CGRAM address */
lcd_write_data(data_vector, 64); /* zero out */
lcd_write_command(NEW_LCD_IRAM); /* Set ICONRAM address */
lcd_write_data(data_vector, 16); /* zero out */
lcd_write_command(NEW_LCD_DISPLAY_CONTROL_SET + 1); /* display on */
#endif /* !SIMULATOR */
}
else {
lcd_ascii = old_lcd_rocklatin1_to_xlcd;
lcd_contrast_set = OLD_LCD_CONTRAST_SET;
lcd_cram = OLD_LCD_CRAM;
lcd_pram = OLD_LCD_PRAM;
lcd_iram = OLD_LCD_IRAM;
pattern_size=3; /* Last pattern, 3 for old LCD */
#ifndef SIMULATOR
#if 1
/* LCD init for cold start */
PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
or_b(0x0f, &PBIORL); /* ... output */
or_b(0x0f, &PBDRL); /* ... and high */
lcd_write_command(0x61);
lcd_write_command(0x42);
lcd_write_command(0x57);
memset(data_vector, 0x24, 13);
lcd_write_command(OLD_LCD_CRAM); /* Set DDRAM address */
lcd_write_data(data_vector, 13); /* all spaces */
lcd_write_command(OLD_LCD_CRAM + 0x10);
lcd_write_data(data_vector, 13);
lcd_write_command(OLD_LCD_CRAM + 0x20);
lcd_write_data(data_vector, 13);
memset(data_vector, 0, 32);
lcd_write_command(OLD_LCD_PRAM); /* Set CGRAM address */
lcd_write_data(data_vector, 32); /* zero out */
lcd_write_command(OLD_LCD_IRAM); /* Set ICONRAM address */
lcd_write_data(data_vector, 13); /* zero out */
lcd_write_command(OLD_LCD_IRAM + 0x10);
lcd_write_data(data_vector, 13);
lcd_write_command(0x31);
#else
/* archos look-alike code, left here for reference. As soon as the
* rockbox version is confirmed working, this will go away */
{
int i;
PBCR2 &= 0xc000;
PBIOR |= 0x000f;
PBDR |= 0x0002;
PBDR |= 0x0001;
PBDR |= 0x0004;
PBDR |= 0x0008;
for (i=0; i<200; i++) asm volatile ("nop"); /* wait 100 us */
PBDR &= 0xfffd; /* CS low (assert) */
for (i=0; i<100; i++) asm volatile ("nop"); /* wait 50 us */
lcd_write_command(0x61);
lcd_write_command(0x42);
lcd_write_command(0x57);
memset(data_vector, 0x24, 13);
lcd_write_command(0xb0); /* Set DDRAM address */
lcd_write_data(data_vector, 13); /* all spaces */
lcd_write_command(0xc0);
lcd_write_data(data_vector, 13);
lcd_write_command(0xd0);
lcd_write_data(data_vector, 13);
memset(data_vector, 0, 32);
lcd_write_command(0x80); /* Set CGRAM address */
lcd_write_data(data_vector, 32); /* zero out */
lcd_write_command(0xe0); /* Set ICONRAM address */
lcd_write_data(data_vector, 13); /* zero out */
lcd_write_command(0xf0);
lcd_write_data(data_vector, 13);
for (i=0; i<300000; i++) asm volatile ("nop"); /* wait 150 ms */
lcd_write_command(0x31);
lcd_write_command_e(0xa8, 0); /* Set contrast control */
}
#endif
#endif /* !SIMULATOR */
}
lcd_set_contrast(lcd_default_contrast());
create_thread(scroll_thread, scroll_stack,
sizeof(scroll_stack), scroll_name IF_PRIO(, PRIORITY_USER_INTERFACE)
IF_COP(, CPU, false));
}
void lcd_jump_scroll (int mode) /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
{
jump_scroll=mode;
}
void lcd_bidir_scroll(int percent)
{
bidir_limit = percent;
}
void lcd_puts_scroll(int x, int y, const unsigned char* string )
{
struct scrollinfo* s;
int i=0;
unsigned short ucs;
const unsigned char *utf8 = string;
unsigned char tmp[utf8length(string)+1];
while (*utf8) {
utf8 = utf8decode(utf8, &ucs);
if (ucs < 256)
tmp[i++] = ucs;
else
tmp[i++] = '?';
}
tmp[i] = 0;
s = &scroll[y];
lcd_puts_cont_scroll(x,y,tmp);
s->textlen = strlen(tmp);
if ( s->textlen > 11-x ) {
s->mode = SCROLL_MODE_RUN;
s->scroll_start_tick = current_tick + scroll_delay;
s->offset=0;
s->startx=x;
s->starty=y;
s->direction=+1;
s->jump_scroll=0;
s->jump_scroll_steps=0;
if (jump_scroll && jump_scroll_delay<scroll_ticks*(s->textlen-11+x)) {
s->jump_scroll_steps=11-x;
s->jump_scroll=jump_scroll;
}
strncpy(s->text,tmp,sizeof s->text);
s->turn_offset=-1;
if (bidir_limit && (s->textlen < ((11-x)*(100+bidir_limit))/100)) {
s->turn_offset=s->textlen+x-11;
}
else {
for (i=0; i<scroll_spacing &&
s->textlen<(int)sizeof(s->text); i++) {
s->text[s->textlen++]=' ';
}
}
if (s->textlen<(int)sizeof(s->text))
s->text[s->textlen]=' ';
s->text[sizeof s->text - 1] = 0;
}
else
s->mode = SCROLL_MODE_OFF;
}
void lcd_stop_scroll(void)
{
struct scrollinfo* s;
int index;
for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
s = &scroll[index];
if ( s->mode == SCROLL_MODE_RUN ||
s->mode == SCROLL_MODE_PAUSE ) {
/* restore scrolled row */
lcd_puts(s->startx, s->starty, s->text);
}
}
lcd_update();
}
static const char scroll_tick_table[16] = {
/* Hz values:
1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33 */
100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3
};
void lcd_scroll_speed(int speed)
{
scroll_ticks = scroll_tick_table[speed];
}
void lcd_scroll_delay(int ms)
{
scroll_delay = ms / (HZ / 10);
}
void lcd_jump_scroll_delay(int ms)
{
jump_scroll_delay = ms / (HZ / 10);
}
static void scroll_thread(void)
{
struct scrollinfo* s;
int index;
int i, o;
bool update;
/* initialize scroll struct array */
for (index = 0; index < SCROLLABLE_LINES; index++) {
scroll[index].mode = SCROLL_MODE_OFF;
}
while ( 1 ) {
update = false;
for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
s = &scroll[index];
if ( s->mode == SCROLL_MODE_RUN ) {
if ( TIME_AFTER(current_tick, s->scroll_start_tick) ) {
char buffer[12];
int jumping_scroll=s->jump_scroll;
update = true;
if (s->jump_scroll) {
/* Find new position to start jump scroll by
* finding last white space within
* jump_scroll_steps */
int i;
o = s->offset = s->offset + s->jump_scroll_steps;
for (i = 0; i < s->jump_scroll_steps; i++, o--) {
if (o < s->textlen &&
((0x20 <= s->text[o] && s->text[o] <= 0x2f) || s->text[o] == '_'))
{
s->offset = o;
break;
}
}
s->scroll_start_tick = current_tick +
jump_scroll_delay;
/* Eat space */
while (s->offset < s->textlen &&
((0x20 <= s->text[s->offset] && s->text[s->offset] <= 0x2f) ||
s->text[s->offset] == '_')) {
s->offset++;
}
if (s->offset >= s->textlen) {
s->offset=0;
s->scroll_start_tick = current_tick +
scroll_delay;
if (s->jump_scroll != JUMP_SCROLL_ALWAYS) {
s->jump_scroll--;
s->direction=1;
}
}
} else {
if ( s->offset < s->textlen-1 ) {
s->offset+=s->direction;
if (s->offset==0) {
s->direction=+1;
s->scroll_start_tick = current_tick +
scroll_delay;
} else {
if (s->offset == s->turn_offset) {
s->direction=-1;
s->scroll_start_tick = current_tick +
scroll_delay;
}
}
}
else {
s->offset = 0;
}
}
i=0;
o=s->offset;
while (i<11) {
buffer[i++]=s->text[o++];
if (o==s->textlen /* || (jump_scroll && buffer[i-1] == ' ') */)
break;
}
o=0;
if (s->turn_offset == -1 && !jumping_scroll) {
while (i<11) {
buffer[i++]=s->text[o++];
}
} else {
while (i<11) {
buffer[i++]=' ';
}
}
buffer[11]=0;
lcd_puts_cont_scroll(s->startx, s->starty, buffer);
}
}
if (cursor.len>0) {
if (cursor.downcount--<0) {
cursor.downcount=cursor.divider;
cursor.textpos++;
if (cursor.textpos>=cursor.len)
cursor.textpos=0;
#ifdef SIMULATOR
lcdx_putc(cursor.x_pos, cursor.y_pos,
cursor.text[cursor.textpos]);
update=true;
#else
update|=lcdx_putc(cursor.x_pos, cursor.y_pos,
cursor.text[cursor.textpos]);
#endif
}
}
if (update) {
lcd_update();
}
}
sleep(scroll_ticks);
}
}
#endif /* HAVE_LCD_CHARCELLS */

View file

@ -4,10 +4,11 @@
/* define this if you would like tagcache to build on this target */ /* define this if you would like tagcache to build on this target */
#define HAVE_TAGCACHE #define HAVE_TAGCACHE
/* LCD dimensions (for the simulator) */ #define LCD_WIDTH 11
#define LCD_WIDTH 132 /* Display width in pixels */ #define LCD_HEIGHT 2
#define LCD_HEIGHT 64 /* Display height in pixels */
#define LCD_DEPTH 1 #define LCD_DEPTH 1
#define SIM_LCD_WIDTH 132 /* pixels */
#define SIM_LCD_HEIGHT 64 /* pixels */
/* define this if you have the Player's keyboard */ /* define this if you have the Player's keyboard */
#define CONFIG_KEYPAD PLAYER_PAD #define CONFIG_KEYPAD PLAYER_PAD

View file

@ -0,0 +1,41 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id: lcd-player.c 12835 2007-03-18 17:58:49Z amiconn $
*
* Copyright (C) 2007 by Jens Arnold
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
/* map unicode characters to hardware or extended lcd characters */
struct xchar_info {
unsigned short ucs;
unsigned short glyph;
/* 0x0000..0x7fff: fixed extended characters
* 0x8000..0xffff: variable extended characters
* Dontcare if priority == 0 */
unsigned char priority;
unsigned char hw_char; /* direct or substitute */
};
/* target dependent - to be adjusted for other charcell targets */
#define HW_PATTERN_SIZE 7 /* number of bytes per pattern */
#define MAX_HW_PATTERNS 8 /* max. number of user-definable hw patterns */
extern int hw_pattern_count; /* actual number of user-definable hw patterns */
extern const struct xchar_info *xchar_info;
extern int xchar_info_size; /* number of entries */
extern const unsigned char xfont_fixed[][8];
void lcd_charset_init(void);

View file

@ -1,27 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2003 by Kjell Ericson
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#ifdef HAVE_LCD_CHARCELLS
#define NO_EXTENDED_LCD_CHARS 0x5e
#define RESERVED_CHAR 0xff
#define LAST_RESERVED_CHAR 0x16
#define NOCHAR_OLD 0x24
#define NOCHAR_NEW 0x20
#endif

View file

@ -59,12 +59,21 @@ extern void lcd_init_device(void);
extern void lcd_backlight(bool on); extern void lcd_backlight(bool on);
extern int lcd_default_contrast(void); extern int lcd_default_contrast(void);
extern void lcd_set_contrast(int val); extern void lcd_set_contrast(int val);
extern void lcd_setmargins(int xmargin, int ymargin);
extern int lcd_getxmargin(void);
extern int lcd_getymargin(void);
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
extern void lcd_clear_display(void); extern void lcd_clear_display(void);
extern void lcd_putsxy(int x, int y, const unsigned char *string);
extern void lcd_puts(int x, int y, const unsigned char *string); extern void lcd_puts(int x, int y, const unsigned char *string);
extern void lcd_puts_style(int x, int y, const unsigned char *string, int style); extern void lcd_puts_style(int x, int y, const unsigned char *string, int style);
extern void lcd_putc(int x, int y, unsigned short ch); extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
int offset);
extern void lcd_putc(int x, int y, unsigned long ucs);
extern void lcd_stop_scroll(void); extern void lcd_stop_scroll(void);
extern void lcd_bidir_scroll(int threshold);
extern void lcd_scroll_speed(int speed); extern void lcd_scroll_speed(int speed);
extern void lcd_scroll_delay(int ms); extern void lcd_scroll_delay(int ms);
extern void lcd_puts_scroll(int x, int y, const unsigned char* string); extern void lcd_puts_scroll(int x, int y, const unsigned char* string);
@ -123,14 +132,14 @@ enum
ICON_PARAM ICON_PARAM
}; };
extern void lcd_double_height(bool on); void lcd_double_height(bool on);
extern void lcd_define_hw_pattern(int which,const char *pattern,int length); void lcd_put_hw_char(int x, int y, unsigned char hw_char);
extern void lcd_define_pattern(int which,const char *pattern); void lcd_define_hw_pattern(int which, const char *pattern);
unsigned char lcd_get_locked_pattern(void); void lcd_define_pattern(unsigned long ucs, const char *pattern);
void lcd_unlock_pattern(unsigned char pat); unsigned long lcd_get_locked_pattern(void);
void lcd_put_cursor(int x, int y, char cursor_char); void lcd_unlock_pattern(unsigned long ucs);
void lcd_put_cursor(int x, int y, unsigned long cursor_ucs);
void lcd_remove_cursor(void); void lcd_remove_cursor(void);
extern void lcd_bidir_scroll(int threshold);
#define JUMP_SCROLL_ALWAYS 5 #define JUMP_SCROLL_ALWAYS 5
extern void lcd_jump_scroll(int mode); /* 0=off, 1=once, ..., ALWAYS */ extern void lcd_jump_scroll(int mode); /* 0=off, 1=once, ..., ALWAYS */
extern void lcd_jump_scroll_delay(int ms); extern void lcd_jump_scroll_delay(int ms);
@ -303,17 +312,10 @@ extern void lcd_set_flip(bool yesno);
extern void lcd_set_drawmode(int mode); extern void lcd_set_drawmode(int mode);
extern int lcd_get_drawmode(void); extern int lcd_get_drawmode(void);
extern void lcd_setmargins(int xmargin, int ymargin);
extern int lcd_getxmargin(void);
extern int lcd_getymargin(void);
extern void lcd_setfont(int font); extern void lcd_setfont(int font);
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset);
extern void lcd_puts_style_offset(int x, int y, const unsigned char *str, extern void lcd_puts_style_offset(int x, int y, const unsigned char *str,
int style, int offset); int style, int offset);
extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
int offset);
extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
int style, int offset); int style, int offset);
@ -338,10 +340,8 @@ extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
int stride, int x, int y, int width, int height); int stride, int x, int y, int width, int height);
extern void lcd_bitmap(const fb_data *src, int x, int y, int width, extern void lcd_bitmap(const fb_data *src, int x, int y, int width,
int height); int height);
extern void lcd_putsxy(int x, int y, const unsigned char *string);
extern void lcd_invertscroll(int x, int y); extern void lcd_invertscroll(int x, int y);
extern void lcd_bidir_scroll(int threshold);
extern void lcd_scroll_step(int pixels); extern void lcd_scroll_step(int pixels);
#if LCD_DEPTH > 1 #if LCD_DEPTH > 1
@ -380,36 +380,25 @@ extern void lcd_bitmap_transparent(const fb_data *src, int x, int y,
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */
/* internal usage, but in multiple drivers */ /* internal usage, but in multiple drivers */
#ifdef HAVE_LCD_BITMAP
#define SCROLL_SPACING 3 #define SCROLL_SPACING 3
#ifdef HAVE_LCD_BITMAP
#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2) #define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH/2 + SCROLL_SPACING + 2)
#else
#define SCROLL_LINE_SIZE (MAX_PATH + LCD_WIDTH + SCROLL_SPACING + 2)
#endif
struct scrollinfo { struct scrollinfo {
char line[SCROLL_LINE_SIZE]; char line[SCROLL_LINE_SIZE];
int len; /* length of line in chars */ int len; /* length of line in chars */
int width; /* length of line in pixels */
int offset; int offset;
int startx; int startx;
#ifdef HAVE_LCD_BITMAP
int width; /* length of line in pixels */
bool invert; /* invert the scrolled text */
#endif
bool backward; /* scroll presently forward or backward? */ bool backward; /* scroll presently forward or backward? */
bool bidir; bool bidir;
bool invert; /* invert the scrolled text */
long start_tick; long start_tick;
}; };
#else /* !HAVE_LCD_BITMAP */
struct scrollinfo {
int mode;
char text[MAX_PATH];
int textlen;
int offset;
int turn_offset;
int startx;
int starty;
long scroll_start_tick;
int direction; /* +1 for right or -1 for left*/
int jump_scroll;
int jump_scroll_steps;
};
#endif
#endif /* __LCD_H__ */ #endif /* __LCD_H__ */

View file

@ -0,0 +1,235 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id: lcd-player.c 12835 2007-03-18 17:58:49Z amiconn $
*
* Copyright (C) 2007 by Jens Arnold
* Based on the work of Alan Korr, Kjell Ericson and others
*
* All files in this archive are subject to the GNU General Public License.
* See the file COPYING in the source tree root for full license agreement.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "config.h"
#include <string.h>
#include "hwcompat.h"
#include "system.h"
#include "lcd.h"
#define OLD_LCD_CRAM ((char)0xB0) /* Characters */
#define OLD_LCD_PRAM ((char)0x80) /* Patterns */
#define OLD_LCD_IRAM ((char)0xE0) /* Icons */
#define OLD_LCD_CONTRAST_SET ((char)0xA8)
#define NEW_LCD_CRAM ((char)0x80) /* Characters */
#define NEW_LCD_PRAM ((char)0xC0) /* Patterns */
#define NEW_LCD_IRAM ((char)0x40) /* Icons */
#define NEW_LCD_CONTRAST_SET ((char)0x50)
#define NEW_LCD_FUNCTION_SET ((char)0x10)
#define NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET ((char)0x0c)
#define NEW_LCD_POWER_CONTROL_REGISTER_SET ((char)0x20)
#define NEW_LCD_DISPLAY_CONTROL_SET ((char)0x28)
#define NEW_LCD_SET_DOUBLE_HEIGHT ((char)0x08)
#define LCD_CURSOR(x,y) ((char)(lcd_cram+((y)*16+(x))))
#define LCD_ICON(i) ((char)(lcd_iram+i))
static bool new_lcd;
static char lcd_contrast_set;
static char lcd_cram;
static char lcd_pram;
static char lcd_iram;
/* hardware configuration */
int lcd_default_contrast(void)
{
return 30;
}
void lcd_set_contrast(int val)
{
lcd_write_command_e(lcd_contrast_set, 31 - val);
}
/* charcell specific */
void lcd_double_height(bool on)
{
if(new_lcd)
lcd_write_command(on ? (NEW_LCD_SET_DOUBLE_HEIGHT|1)
: NEW_LCD_SET_DOUBLE_HEIGHT);
}
void lcd_put_hw_char(int x, int y, unsigned char hw_char)
{
lcd_write_command_e(LCD_CURSOR(x, y), hw_char);
}
void lcd_define_hw_pattern (int which, const char *pattern)
{
lcd_write_command(lcd_pram | (which << 3));
lcd_write_data(pattern, 7);
}
void lcd_icon(int icon, bool enable)
{
static const struct {
char pos;
char mask;
} icontab[] = {
{ 0, 0x02}, { 0, 0x08}, { 0, 0x04}, { 0, 0x10}, /* Battery */
{ 2, 0x04}, /* USB */
{ 3, 0x10}, /* Play */
{ 4, 0x10}, /* Record */
{ 5, 0x02}, /* Pause */
{ 5, 0x10}, /* Audio */
{ 6, 0x02}, /* Repeat */
{ 7, 0x01}, /* 1 */
{ 9, 0x04}, /* Volume */
{ 9, 0x02}, { 9, 0x01}, {10, 0x08}, {10, 0x04}, {10, 0x01}, /* Vol 1-5 */
{10, 0x10}, /* Param */
};
static char icon_mirror[11] = {0};
int pos, mask;
pos = icontab[icon].pos;
mask = icontab[icon].mask;
if (enable)
icon_mirror[pos] |= mask;
else
icon_mirror[pos] &= ~mask;
lcd_write_command_e(LCD_ICON(pos), icon_mirror[pos]);
}
/* device specific init */
void lcd_init_device(void)
{
unsigned char data_vector[64];
new_lcd = is_new_player();
if (new_lcd)
{
lcd_contrast_set = NEW_LCD_CONTRAST_SET;
lcd_cram = NEW_LCD_CRAM;
lcd_pram = NEW_LCD_PRAM;
lcd_iram = NEW_LCD_IRAM;
/* LCD init for cold start */
PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
or_b(0x0f, &PBDRL); /* ... high */
or_b(0x0f, &PBIORL); /* ... and output */
lcd_write_command(NEW_LCD_FUNCTION_SET + 1); /* CGRAM selected */
lcd_write_command_e(NEW_LCD_CONTRAST_SET, 0x08);
lcd_write_command(NEW_LCD_POWER_SAVE_MODE_OSC_CONTROL_SET + 2);
/* oscillator on */
lcd_write_command(NEW_LCD_POWER_CONTROL_REGISTER_SET + 7);
/* opamp buffer + voltage booster on*/
memset(data_vector, 0x20, 64);
lcd_write_command(NEW_LCD_CRAM); /* Set DDRAM address */
lcd_write_data(data_vector, 64); /* all spaces */
memset(data_vector, 0, 64);
lcd_write_command(NEW_LCD_PRAM); /* Set CGRAM address */
lcd_write_data(data_vector, 64); /* zero out */
lcd_write_command(NEW_LCD_IRAM); /* Set ICONRAM address */
lcd_write_data(data_vector, 16); /* zero out */
lcd_write_command(NEW_LCD_DISPLAY_CONTROL_SET + 1); /* display on */
}
else
{
lcd_contrast_set = OLD_LCD_CONTRAST_SET;
lcd_cram = OLD_LCD_CRAM;
lcd_pram = OLD_LCD_PRAM;
lcd_iram = OLD_LCD_IRAM;
#if 1
/* LCD init for cold start */
PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
or_b(0x0f, &PBDRL); /* ... high */
or_b(0x0f, &PBIORL); /* ... and output */
lcd_write_command(0x61);
lcd_write_command(0x42);
lcd_write_command(0x57);
memset(data_vector, 0x24, 13);
lcd_write_command(OLD_LCD_CRAM); /* Set DDRAM address */
lcd_write_data(data_vector, 13); /* all spaces */
lcd_write_command(OLD_LCD_CRAM + 0x10);
lcd_write_data(data_vector, 13);
lcd_write_command(OLD_LCD_CRAM + 0x20);
lcd_write_data(data_vector, 13);
memset(data_vector, 0, 32);
lcd_write_command(OLD_LCD_PRAM); /* Set CGRAM address */
lcd_write_data(data_vector, 32); /* zero out */
lcd_write_command(OLD_LCD_IRAM); /* Set ICONRAM address */
lcd_write_data(data_vector, 13); /* zero out */
lcd_write_command(OLD_LCD_IRAM + 0x10);
lcd_write_data(data_vector, 13);
lcd_write_command(0x31);
#else
/* archos look-alike code, left here for reference. As soon as the
* rockbox version is confirmed working, this will go away */
{
int i;
PBCR2 &= 0xc000;
PBIOR |= 0x000f;
PBDR |= 0x0002;
PBDR |= 0x0001;
PBDR |= 0x0004;
PBDR |= 0x0008;
for (i=0; i<200; i++) asm volatile ("nop"); /* wait 100 us */
PBDR &= 0xfffd; /* CS low (assert) */
for (i=0; i<100; i++) asm volatile ("nop"); /* wait 50 us */
lcd_write_command(0x61);
lcd_write_command(0x42);
lcd_write_command(0x57);
memset(data_vector, 0x24, 13);
lcd_write_command(0xb0); /* Set DDRAM address */
lcd_write_data(data_vector, 13); /* all spaces */
lcd_write_command(0xc0);
lcd_write_data(data_vector, 13);
lcd_write_command(0xd0);
lcd_write_data(data_vector, 13);
memset(data_vector, 0, 32);
lcd_write_command(0x80); /* Set CGRAM address */
lcd_write_data(data_vector, 32); /* zero out */
lcd_write_command(0xe0); /* Set ICONRAM address */
lcd_write_data(data_vector, 13); /* zero out */
lcd_write_command(0xf0);
lcd_write_data(data_vector, 13);
for (i=0; i<300000; i++) asm volatile ("nop"); /* wait 150 ms */
lcd_write_command(0x31);
lcd_write_command_e(0xa8, 0); /* Set contrast control */
}
#endif
}
lcd_set_contrast(lcd_default_contrast());
}

2
tools/configure vendored
View file

@ -661,7 +661,7 @@ EOF
# toolset is the tools within the tools directory that we build for # toolset is the tools within the tools directory that we build for
# this particular target. # this particular target.
toolset="$toolset scramble descramble sh2d generate_rocklatin uclpack" toolset="$toolset scramble descramble sh2d uclpack"
# Note: the convbdf is present in the toolset just because: 1) the # Note: the convbdf is present in the toolset just because: 1) the
# firmware/Makefile assumes it is present always, and 2) we will need it when we # firmware/Makefile assumes it is present always, and 2) we will need it when we

View file

@ -51,8 +51,8 @@ void lcd_print_icon(int x, int icon_line, bool enable, char **icon)
int row=0, col; int row=0, col;
int p=0, cp=0; int p=0, cp=0;
struct coordinate points[LCD_WIDTH * LCD_HEIGHT]; struct coordinate points[SIM_LCD_WIDTH * SIM_LCD_HEIGHT];
struct coordinate clearpoints[LCD_WIDTH * LCD_HEIGHT]; struct coordinate clearpoints[SIM_LCD_WIDTH * SIM_LCD_HEIGHT];
while (icon[row]) { while (icon[row]) {
col=0; col=0;
@ -221,16 +221,15 @@ void lcd_double_height(bool on)
lcd_update(); lcd_update();
} }
void lcd_define_hw_pattern(int which, const char *pattern, int length) void lcd_define_hw_pattern(int pat, const char *pattern)
{ {
int i, j; int i, j;
int pat = which / 8;
unsigned char icon[8]; unsigned char icon[8];
memset(icon, 0, sizeof icon); memset(icon, 0, sizeof icon);
DEBUGF("Defining pattern %d:", pat); DEBUGF("Defining pattern %d:", pat);
for (j = 0; j <= 5; j++) { for (j = 0; j <= 5; j++) {
for (i = 0; i < length; i++) { for (i = 0; i < 7; i++) {
if ((pattern[i])&(1<<(j))) if ((pattern[i])&(1<<(j)))
icon[5-j] |= (1<<(i)); icon[5-j] |= (1<<(i));
} }

View file

@ -132,8 +132,10 @@ void sim_backlight(int value)
/* initialise simulator lcd driver */ /* initialise simulator lcd driver */
void sim_lcd_init(void) void sim_lcd_init(void)
{ {
lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE, LCD_WIDTH * display_zoom, lcd_surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
LCD_HEIGHT * display_zoom, 8, 0, 0, 0, 0); SIM_LCD_WIDTH * display_zoom,
SIM_LCD_HEIGHT * display_zoom,
8, 0, 0, 0, 0);
sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max, sdl_set_gradient(lcd_surface, &lcd_backlight_color_zero, &lcd_color_max,
0, (1<<LCD_DEPTH)); 0, (1<<LCD_DEPTH));
@ -142,10 +144,10 @@ void sim_lcd_init(void)
#define BMP_COMPRESSION 0 /* BI_RGB */ #define BMP_COMPRESSION 0 /* BI_RGB */
#define BMP_NUMCOLORS (1 << LCD_DEPTH) #define BMP_NUMCOLORS (1 << LCD_DEPTH)
#define BMP_BPP 1 #define BMP_BPP 1
#define BMP_LINESIZE (((LCD_WIDTH + 31) / 32) * 4) #define BMP_LINESIZE (((SIM_LCD_WIDTH + 31) / 32) * 4)
#define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS) #define BMP_HEADERSIZE (54 + 4 * BMP_NUMCOLORS)
#define BMP_DATASIZE (BMP_LINESIZE * LCD_HEIGHT) #define BMP_DATASIZE (BMP_LINESIZE * SIM_LCD_HEIGHT)
#define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE) #define BMP_TOTALSIZE (BMP_HEADERSIZE + BMP_DATASIZE)
#define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff #define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff
@ -159,8 +161,8 @@ static const unsigned char bmpheader[] =
LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */ LE32_CONST(BMP_HEADERSIZE), /* Offset to start of pixel data */
0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */ 0x28, 0x00, 0x00, 0x00, /* Size of (2nd) header */
LE32_CONST(LCD_WIDTH), /* Width in pixels */ LE32_CONST(SIM_LCD_WIDTH), /* Width in pixels */
LE32_CONST(LCD_HEIGHT), /* Height in pixels */ LE32_CONST(SIM_LCD_HEIGHT), /* Height in pixels */
0x01, 0x00, /* Number of planes (always 1) */ 0x01, 0x00, /* Number of planes (always 1) */
LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */ LE16_CONST(BMP_BPP), /* Bits per pixel 1/4/8/16/24 */
LE32_CONST(BMP_COMPRESSION),/* Compression mode */ LE32_CONST(BMP_COMPRESSION),/* Compression mode */
@ -193,15 +195,15 @@ void screen_dump(void)
SDL_LockSurface(lcd_surface); SDL_LockSurface(lcd_surface);
/* BMP image goes bottom up */ /* BMP image goes bottom up */
for (y = LCD_HEIGHT - 1; y >= 0; y--) for (y = SIM_LCD_HEIGHT - 1; y >= 0; y--)
{ {
Uint8 *src = (Uint8 *)lcd_surface->pixels Uint8 *src = (Uint8 *)lcd_surface->pixels
+ y * LCD_WIDTH * display_zoom * display_zoom; + y * SIM_LCD_WIDTH * display_zoom * display_zoom;
unsigned char *dst = line; unsigned char *dst = line;
unsigned dst_mask = 0x80; unsigned dst_mask = 0x80;
memset(line, 0, sizeof(line)); memset(line, 0, sizeof(line));
for (x = LCD_WIDTH; x > 0; x--) for (x = SIM_LCD_WIDTH; x > 0; x--)
{ {
if (*src) if (*src)
*dst |= dst_mask; *dst |= dst_mask;