]> git.sur5r.net Git - cc65/blobdiff - samples/plasma.c
C90 param, void
[cc65] / samples / plasma.c
index ef21ef60ee227ada2bce1bfa276744de8c1c3845..ac17265f3791d01c858e9538ed7c5ac177fda3a7 100644 (file)
@@ -1,17 +1,18 @@
-/*****************************************************************************
- * plasma test program for cc65.                                             *
- *                                                                           *
- * (w)2001 by groepaz/hitmen                                                 *
- *                                                                           *
- * Cleanup and porting by Ullrich von Bassewitz.                             *
- *                                                                           *
- *****************************************************************************/
+/*****************************************************************************\
+** plasma test program for cc65.                                             **
+**                                                                           **
+** (w)2001 by groepaz/hitmen                                                 **
+**                                                                           **
+** Cleanup and porting by Ullrich von Bassewitz.                             **
+**                                                                           **
+\*****************************************************************************/
 
 
 
 #include <stdlib.h>
 #include <time.h>
 #include <conio.h>
+#include <cc65.h>
 
 
 
@@ -121,9 +122,9 @@ static void doplasma (register unsigned char* scrn)
     c2B -= 3;
     for (ii = 0; ii < 25; ++ii) {
         /* Unrolling the following loop will give a speed increase of
-         * nearly 100% (~24fps), but it will also increase the code
-         * size a lot.
-         */
+        ** nearly 100% (~24fps), but it will also increase the code
+        ** size a lot.
+        */
         for (i = 0; i < 40; ++i, ++scrn) {
             *scrn = (xbuf[i] + ybuf[ii]);
         }
@@ -203,9 +204,9 @@ int main (void)
     outb (&CIA2.pra, (block & 0xFC) | ((SCREEN1 >> 14) ^ 0x03));
 #endif
 #if defined(__C128__)
-    /* Save and change some flags, so that kernal/basic interupt handler will
-     * not interfere with our routine.
-     */
+    /* Save and change some flags, so that kernal/basic interrupt handler will
+    ** not interfere with our routine.
+    */
     initflag = *(unsigned char*) 0xA04;
     *(unsigned char*) 0xA04 &= 0xFE;
     graphflag = *(unsigned char*) 0xD8;
@@ -292,12 +293,11 @@ int main (void)
     gotoxy (0, 1); cprintf ("frames: %lu", f);
     gotoxy (0, 2); cprintf ("fps   : %lu.%u", fps, fps10);
 
-    /* Wait for a key, then end */
-    cputsxy (0, 4, "Press any key when done...");
-    (void) cgetc ();
+    if (doesclrscrafterexit ()) {
+        cputsxy (0, 4, "Press any key when done...");
+        (void) cgetc ();
+    }
 
     /* Done */
     return EXIT_SUCCESS;
 }
-
-