]> git.sur5r.net Git - cc65/blobdiff - samples/diodemo.c
Remove trailings spaces from CBM-related asm files
[cc65] / samples / diodemo.c
index ba97184ac02330b8d18e5a8960f16307de2b511f..3e52f2fa920c8b67c69a17ceac128acf174252e4 100644 (file)
@@ -36,6 +36,7 @@
 #include <conio.h>
 #include <ctype.h>
 #include <errno.h>
+#include <cc65.h>
 #include <dio.h>
 
 
@@ -60,8 +61,9 @@ static unsigned char AskForDrive (const char* Name)
     unsigned char Drive = 0;
     char          Char;
 
-    cprintf ("\r\n%s Drive ID ?", Name);
+    cprintf ("\r\n%s Drive ID ? ", Name);
 
+    cursor (1);
     do {
         Char = cgetc ();
         if (isdigit (Char)) {
@@ -69,6 +71,7 @@ static unsigned char AskForDrive (const char* Name)
             Drive = Drive * 10 + Char - '0';
         }
     } while (Char != CH_ENTER);
+    cursor (0);
 
     return Drive;
 }
@@ -121,6 +124,11 @@ int main (int argc, const char* argv[])
     clrscr ();
     screensize (&ScreenX, &ScreenY);
 
+    /* Allow user to read exit messages */
+    if (doesclrscrafterexit ()) {
+        atexit ((void (*)) cgetc);
+    }
+
     cputs ("Floppy Disk Copy\r\n");
     chline (16);
     cputs ("\r\n");