@@ -9,8 +9,6 @@ static unsigned char font8x8_spacing[128];
99
1010int main (void )
1111{
12- int i ;
13-
1412 /* Initialize graphics drawing */
1513 gfx_Begin ();
1614
@@ -24,15 +22,30 @@ int main(void)
2422 /* Waits for a key */
2523 while (!os_GetCSC ());
2624
25+ PrintCentered ("Before: ***" );
26+
27+ /* Waits for a key */
28+ while (!os_GetCSC ());
29+
30+ /* Get a pointer to the character data for '*' by passing in NULL */
31+ unsigned char * char_ptr = gfx_SetCharData ('*' , NULL );
32+
33+ /* Invert the pixels of '*' */
34+ for (int i = 0 ; i < 8 ; i ++ ) {
35+ char_ptr [i ] = ~char_ptr [i ];
36+ }
37+
38+ PrintCentered ("After: ***" );
39+
40+ /* Waits for a key */
41+ while (!os_GetCSC ());
42+
2743 /* Change the font by shifting each character up 1 */
28- for (i = 127 ; i > 0 ; -- i )
44+ for (int i = 127 ; i > 0 ; -- i )
2945 {
3046 gfx_SetCharData (i , & font8x8 [(i - 1 ) * 8 ]);
3147 }
3248
33- /* Clear old string */
34- gfx_FillScreen (255 );
35-
3649 /* Print with the changed font */
3750 PrintCentered ("Uijt!tusjoh!xbt!ijeefo\"" );
3851
@@ -48,9 +61,12 @@ int main(void)
4861/* Prints a screen centered string */
4962void PrintCentered (const char * str )
5063{
51- gfx_PrintStringXY (str ,
52- (GFX_LCD_WIDTH - gfx_GetStringWidth (str )) / 2 ,
53- (GFX_LCD_HEIGHT - 8 ) / 2 );
64+ /* Clear old string */
65+ gfx_FillScreen (255 );
66+
67+ int x_center = (GFX_LCD_WIDTH - gfx_GetStringWidth (str )) / 2 ;
68+ int y_center = (GFX_LCD_HEIGHT - 8 ) / 2 ;
69+ gfx_PrintStringXY (str , x_center , y_center );
5470}
5571
5672static unsigned char font8x8_spacing [128 ] =
@@ -181,7 +197,7 @@ static unsigned char font8x8[128 * 8] =
181197 0x00 , 0x00 , 0x00 , 0x7e , 0x46 , 0x62 , 0x62 , 0x7e , // Char 111 (o)
182198 0x00 , 0x00 , 0x00 , 0x7e , 0x46 , 0x42 , 0x7e , 0x60 , // Char 112 (p)
183199 0x60 , 0x00 , 0x00 , 0x7e , 0x46 , 0x42 , 0x7e , 0x02 , // Char 113 (q)
184- 0x02 , 0x00 , 0x00 , 0x7e , 0x46 , 0x60 , 0x60 , 0x60 , // Char 114 (r)
200+ 0x00 , 0x00 , 0x00 , 0x7e , 0x46 , 0x60 , 0x60 , 0x60 , // Char 114 (r)
185201 0x00 , 0x00 , 0x00 , 0x7c , 0x40 , 0x7c , 0x04 , 0x7c , // Char 115 (s)
186202 0x00 , 0x10 , 0x10 , 0x3c , 0x10 , 0x10 , 0x18 , 0x1c , // Char 116 (t)
187203 0x00 , 0x00 , 0x00 , 0x46 , 0x46 , 0x62 , 0x62 , 0x7e , // Char 117 (u)
0 commit comments