From ad4e3d665734b14a28f1ba5fa874663772dab3e7 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 26 Mar 2007 07:52:13 +0000 Subject: 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 --- apps/plugins/nim.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'apps/plugins/nim.c') diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c index b309e296c0..9089cad00a 100644 --- a/apps/plugins/nim.c +++ b/apps/plugins/nim.c @@ -56,7 +56,7 @@ static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2 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 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 struct plugin_api* rb; @@ -74,8 +74,8 @@ static void impossible(void) static void lose(void) { rb->lcd_define_pattern(hsmile,smile); - rb->snprintf(str,sizeof(str),"You Win!!%c",hsmile); - rb->lcd_puts(0,1,str); + rb->lcd_puts(0,1,"You Win!!"); + rb->lcd_putc(8,1,hsmile); end=true; rb->sleep(HZ*2); return; @@ -86,8 +86,8 @@ static void lose(void) static void win(void) { rb->lcd_define_pattern(hcry,cry); - rb->snprintf(str,sizeof(str),"You Lose!!%c",hcry); - rb->lcd_puts(0,1,str); + rb->lcd_puts(0,1,"You Lose!!"); + rb->lcd_putc(9,1,hcry); end=true; rb->sleep(HZ*2); return; @@ -100,22 +100,22 @@ static void display_first_line(int x) int i; rb->snprintf(str,sizeof(str)," =%d",x); + rb->lcd_puts(0,0,str); rb->lcd_define_pattern(h1,pattern3); - for(i=0;ilcd_putc(i,0,h1); if (x%3==2) { rb->lcd_define_pattern(h2,pattern2); - str[i]=h2; + rb->lcd_putc(i,0,h2); } if (x%3==1) { 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 */ -- cgit v1.2.3