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)
downloadrockbox-ad4e3d665734b14a28f1ba5fa874663772dab3e7.tar.gz
rockbox-ad4e3d665734b14a28f1ba5fa874663772dab3e7.zip
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
56static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/ 56static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/
57 57
58static unsigned char str[12]; /*String use to display the first line*/ 58static unsigned char str[12]; /*String use to display the first line*/
59static unsigned char hsmile,hcry,h1,h2; /*Handle for the new pattern*/ 59static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/
60 60
61static bool end; /*If true game is finished*/ 61static bool end; /*If true game is finished*/
62static struct plugin_api* rb; 62static struct plugin_api* rb;
@@ -74,8 +74,8 @@ static void impossible(void)
74static void lose(void) 74static void lose(void)
75{ 75{
76 rb->lcd_define_pattern(hsmile,smile); 76 rb->lcd_define_pattern(hsmile,smile);
77 rb->snprintf(str,sizeof(str),"You Win!!%c",hsmile); 77 rb->lcd_puts(0,1,"You Win!!");
78 rb->lcd_puts(0,1,str); 78 rb->lcd_putc(8,1,hsmile);
79 end=true; 79 end=true;
80 rb->sleep(HZ*2); 80 rb->sleep(HZ*2);
81 return; 81 return;
@@ -86,8 +86,8 @@ static void lose(void)
86static void win(void) 86static void win(void)
87{ 87{
88 rb->lcd_define_pattern(hcry,cry); 88 rb->lcd_define_pattern(hcry,cry);
89 rb->snprintf(str,sizeof(str),"You Lose!!%c",hcry); 89 rb->lcd_puts(0,1,"You Lose!!");
90 rb->lcd_puts(0,1,str); 90 rb->lcd_putc(9,1,hcry);
91 end=true; 91 end=true;
92 rb->sleep(HZ*2); 92 rb->sleep(HZ*2);
93 return; 93 return;
@@ -100,22 +100,22 @@ static void display_first_line(int x)
100 int i; 100 int i;
101 101
102 rb->snprintf(str,sizeof(str)," =%d",x); 102 rb->snprintf(str,sizeof(str)," =%d",x);
103 rb->lcd_puts(0,0,str);
103 104
104 rb->lcd_define_pattern(h1,pattern3); 105 rb->lcd_define_pattern(h1,pattern3);
105 for(i=0;i<x/3;i++) 106 for (i=0;i<x/3;i++)
106 str[i]=h1; 107 rb->lcd_putc(i,0,h1);
107 108
108 if (x%3==2) 109 if (x%3==2)
109 { 110 {
110 rb->lcd_define_pattern(h2,pattern2); 111 rb->lcd_define_pattern(h2,pattern2);
111 str[i]=h2; 112 rb->lcd_putc(i,0,h2);
112 } 113 }
113 if (x%3==1) 114 if (x%3==1)
114 { 115 {
115 rb->lcd_define_pattern(h2,pattern1); 116 rb->lcd_define_pattern(h2,pattern1);
116 str[i]=h2; 117 rb->lcd_putc(i,0,h2);
117 } 118 }
118 rb->lcd_puts(0,0,str);
119} 119}
120 120
121/* Call when the program end */ 121/* Call when the program end */