summaryrefslogtreecommitdiff
path: root/apps/plugins/nim.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-26 07:52:13 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-26 07:52:13 +0000
commitad4e3d665734b14a28f1ba5fa874663772dab3e7 (patch)
treebff44652495f1319a4d11ed63b3d4e90cb11197f /apps/plugins/nim.c
parent165f62d0cd771660e4b8d2ba7475e14d0d6f2e9f (diff)
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
Diffstat (limited to 'apps/plugins/nim.c')
-rw-r--r--apps/plugins/nim.c20
1 files changed, 10 insertions, 10 deletions
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;i<x/3;i++)
- str[i]=h1;
+ for (i=0;i<x/3;i++)
+ rb->lcd_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 */