]> git.sur5r.net Git - cc65/blobdiff - samples/mousedemo.c
The _printf routine does not return anything.
[cc65] / samples / mousedemo.c
index 276bc29049789aeca2b13bffde3089eda41a05bb..96b39eea4060b7bb46a5fe4e3cef5b8a63393b03 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Demo program for mouse usage. Will work for the C64/C128/CBM510/Atari
+ * Demo program for mouse usage. Will work for the C64/C128/CBM510/Atari/Apple2
  *
  * Ullrich von Bassewitz, 13.09.2001
  *
 #include <string.h>
 #include <mouse.h>
 #include <conio.h>
+#include <ctype.h>
 #include <dbg.h>
 
 
 
-#if defined(__C64__) || defined(__C128__) || defined(__CBM510__)
+#if defined(__C64__) || defined(__C128__)
 
 /* Address of data for sprite 0 */
 #if defined(__C64__)
 #  define SPRITE0_DATA    0x0340
 #  define SPRITE0_PTR            0x07F8
-#  define DRIVER          "c64-1351.mou"
 #elif defined(__C128__)
 #  define SPRITE0_DATA    0x0E00
 #  define SPRITE0_PTR     0x07F8
-#  define DRIVER          "c128-1351.mou"
-#elif defined(__CBM510__)
-#  define SPRITE0_DATA    0xF400
-#  define SPRITE0_PTR     0xF3F8
-#  define DRIVER          ""            /* Currently unavailable */
 #endif
 
 /* The mouse sprite (an arrow) */
@@ -80,8 +75,8 @@ static void DoWarning (void)
             "driver with the name\n"
             "    %s\n"
             "on disk! Press 'y' if you have it or\n"
-            "any other key to exit.\n", DRIVER);
-    if (cgetc () != 'y') {
+            "any other key to exit.\n", mouse_stddrv);
+    if (tolower (cgetc ()) != 'y') {
         exit (EXIT_SUCCESS);
     }
     printf ("Ok. Please wait patiently...\n");
@@ -113,9 +108,9 @@ int main (void)
     DoWarning ();
 
     /* Clear the screen, set white on black */
-    bordercolor (COLOR_BLACK);
-    bgcolor (COLOR_BLACK);
-    textcolor (COLOR_GRAY3);
+    (void) bordercolor (COLOR_BLACK);
+    (void) bgcolor (COLOR_BLACK);
+    (void) textcolor (COLOR_GRAY3);
     cursor (0);
     clrscr ();
 
@@ -136,7 +131,8 @@ int main (void)
 #endif
 
     /* Load and install the mouse driver */
-    CheckError ("mouse_load_driver", mouse_load_driver (&mouse_def_callbacks, DRIVER));
+    CheckError ("mouse_load_driver",
+                mouse_load_driver (&mouse_def_callbacks, mouse_stddrv));
 
     /* Print a help line */
     revers (1);
@@ -147,8 +143,8 @@ int main (void)
     Done = 0;
     ShowState (Invisible = 1);
     while (!Done) {
-       if (kbhit()) {
-           switch (cgetc()) {
+       if (kbhit ()) {
+           switch (tolower (cgetc ())) {
                case 'd':
                    BREAK();
                    break;