X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=samples%2Fhello.c;h=dd15128d2b4410efdf30ba68ea0d3f1aac1a851c;hb=2cd4b5109a59c3743b38369359c389cc1b9edab4;hp=90a1d4bdcee00562653ab64d1085c11b400db85c;hpb=0390c34e88e9512b81ce35a9ba36d137d1c80c44;p=cc65 diff --git a/samples/hello.c b/samples/hello.c index 90a1d4bdc..dd15128d2 100644 --- a/samples/hello.c +++ b/samples/hello.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include @@ -34,11 +34,10 @@ int main (void) { unsigned char XSize, YSize; - /* Set screen colors, hide the cursor */ - textcolor (COLOR_WHITE); - bordercolor (COLOR_BLACK); - bgcolor (COLOR_BLACK); - cursor (0); + /* Set screen colors */ + (void) textcolor (COLOR_WHITE); + (void) bordercolor (COLOR_BLACK); + (void) bgcolor (COLOR_BLACK); /* Clear the screen, put cursor in upper left corner */ clrscr (); @@ -68,8 +67,19 @@ int main (void) gotoxy ((XSize - strlen (Text)) / 2, YSize / 2); cprintf ("%s", Text); +#if defined(__NES__) || defined(__PCE__) || defined(__GAMATE__) + + /* Wait for the user to press a button */ + joy_install (joy_static_stddrv); + while (!joy_read (JOY_1)) ; + joy_uninstall (); + +#else + /* Wait for the user to press a key */ - (void) cgetc (); + cgetc (); + +#endif /* Clear the screen again */ clrscr (); @@ -77,6 +87,3 @@ int main (void) /* Done */ return EXIT_SUCCESS; } - - -