]> git.sur5r.net Git - cc65/blobdiff - samples/fire.c
Switched Apple II output format to AppleSingle.
[cc65] / samples / fire.c
index bbea872cf1c92adb17a44345f4451d67d2b9a3d6..40eff0707814acc745cebd1ea0235688163487ee 100644 (file)
@@ -1,12 +1,12 @@
-/*****************************************************************************
- * fire test program for cc65.                                               *
- *                                                                           *
- * (w)2002 by groepaz/hitmen                                                 *
- *                                                                           *
- * Cleanup and porting by Ullrich von Bassewitz.                            *
- * 2004-06-08, Greg King                                                     *
- *                                                                           *
- *****************************************************************************/
+/*****************************************************************************\
+** fire test program for cc65.                                               **
+**                                                                           **
+** (w)2002 by groepaz/hitmen                                                 **
+**                                                                           **
+** Cleanup and porting by Ullrich von Bassewitz.                             **
+** 2004-06-08, Greg King                                                     **
+**                                                                           **
+\*****************************************************************************/
 
 
 
@@ -17,6 +17,7 @@
 #include <string.h> /* for memset */
 #include <time.h>
 #include <conio.h>
+#include <cbm.h>
 
 
 
@@ -26,7 +27,7 @@
 #  define SCREEN2               0xE400
 #  define CHARSET               0xE800
 #  define COLORRAM              0xD800
-#  define outb(addr,val)               (*(addr) = (val))
+#  define outb(addr,val)        (*(addr) = (val))
 #  define inb(addr)             (*(addr))
 #elif defined(__C128__)
 #  define BUFFER                0x0400
@@ -34,7 +35,7 @@
 #  define SCREEN2               0xE400
 #  define CHARSET               0xE800
 #  define COLORRAM              0xD800
-#  define outb(addr,val)               (*(addr) = (val))
+#  define outb(addr,val)        (*(addr) = (val))
 #  define inb(addr)             (*(addr))
 #elif defined(__CBM510__)
 #  define BUFFER                0xF800
@@ -60,9 +61,9 @@
 
 
 #ifdef DOVSYNC
-#  define waitvsync() while ((signed char)VIC.ctrl1 >= 0)
+#  define WAITVSYNC() waitvsync()
 #else
-#  define waitvsync()
+#  define WAITVSYNC()
 #endif
 
 
@@ -187,8 +188,8 @@ int main (void)
 #endif
 #if defined(__C128__)
     /* Save and change some flags, so that kernal/basic interrupt handler will
-     * not interfere with our routine.
-     */
+    ** not interfere with our routine.
+    */
     initflag = *(unsigned char*) 0xA04;
     *(unsigned char*) 0xA04 &= 0xFE;
     graphflag = *(unsigned char*) 0xD8;
@@ -201,14 +202,14 @@ int main (void)
     /* Run the demo until a key was hit */
     t = clock ();
     while (!kbhit()) {
-       /* Build page 1, then make it visible */
+        /* Build page 1, then make it visible */
         fire (SCREEN1);
-        waitvsync ();
+        WAITVSYNC ();
         outb (&VIC.addr, PAGE1);
 
         /* Build page 2, then make it visible */
         fire (SCREEN2);
-        waitvsync ();
+        WAITVSYNC ();
         outb (&VIC.addr, PAGE2);
 
         /* Count frames */