]> git.sur5r.net Git - cc65/commitdiff
added waitvblank and fixed get_tv
authormrdudz <mrdudz@users.noreply.github.com>
Wed, 15 Jul 2015 17:46:26 +0000 (19:46 +0200)
committermrdudz <mrdudz@users.noreply.github.com>
Wed, 15 Jul 2015 17:46:26 +0000 (19:46 +0200)
doc/pce.sgml
include/pce.h
libsrc/pce/readme.txt
libsrc/pce/waitvblank.s [new file with mode: 0644]
testcode/lib/pce/conio.c

index 4c395ae43d476b804a30c036a9b3c05d8993ac5c..2d14e8361f72a5f1343cc2ccf3f7dabc3830fe87 100644 (file)
@@ -77,8 +77,8 @@ Programs containing PCE specific code may use the <tt/pce.h/ header file.
 <sect1>PCE specific functions<p>
 
 <itemize>
 <sect1>PCE specific functions<p>
 
 <itemize>
-<item>waitvblank
-<item>get_tv
+<item>waitvblank</item>
+<item>get_tv</item> (since all PCE systems are NTSC, this always returns TV_NTSC)
 </itemize>
 
 
 </itemize>
 
 
index 613da2b0d4171a364361bdc731d964cc90b4c635..74b6409e189803412087f4eb1760a60ac332648c 100644 (file)
@@ -83,8 +83,8 @@ extern void pce_stdjoy_joy[];       /* Referred to by joy_static_stddrv[] */
 void waitvblank (void);
 /* Wait for the vertical blanking */
 
 void waitvblank (void);
 /* Wait for the vertical blanking */
 
-/* FIXME: not implemented */
-unsigned char get_tv (void);
+/* all PCE are NTSC */
+#define get_tv() TV_NTSC
 /* Return the video mode the machine is using. */
 
 
 /* Return the video mode the machine is using. */
 
 
index d071509137d2c648f11dbd7641e73a54e26bc61f..b201893d12d98bdee30f3ab16528849a3777de03 100644 (file)
@@ -8,9 +8,6 @@ joystick support should get verified on real hw
 
 revers() is a dummy function, actual reverse output is not supported yet
 
 
 revers() is a dummy function, actual reverse output is not supported yet
 
-waitvblank() is missing
-get_tv() is missing
-
 some graphical petscii chars should get added to the charset
 
 interruptor support in crt0 (and cfg) is missing
 some graphical petscii chars should get added to the charset
 
 interruptor support in crt0 (and cfg) is missing
diff --git a/libsrc/pce/waitvblank.s b/libsrc/pce/waitvblank.s
new file mode 100644 (file)
index 0000000..2ded283
--- /dev/null
@@ -0,0 +1,18 @@
+;
+; void waitvblank (void);
+;
+
+        .include "pce.inc"
+
+        .export         _waitvblank
+;;        .importzp       tickcount
+
+.proc   _waitvblank
+
+        lda tickcount
+@lp:    cmp tickcount
+        beq @lp
+        rts
+
+.endproc
+
index 88c343af255ecb15a8b0eaa7267782f3135458db..92431d14225ed28368e8c37bbba31b5e504d53e3 100644 (file)
@@ -43,8 +43,22 @@ void main(void)
         );
     }
 
         );
     }
 
-    for(;;)
-    {
+    i = get_tv();
+    gotoxy(30,0);
+    cputs("TV Mode: ");
+    switch(i) {
+        case TV_NTSC:
+            cputs("NTSC");
+            break;
+        case TV_PAL:
+            cputs("PAL");
+            break;
+        case TV_OTHER:
+            cputs("OTHER");
+            break;
+    }
+
+    for(;;) {
         gotoxy(13,4);
         cprintf("%02x", datavar);
         gotoxy(13,5);
         gotoxy(13,4);
         cprintf("%02x", datavar);
         gotoxy(13,5);
@@ -68,6 +82,7 @@ void main(void)
                      (j & joy_masks[JOY_FIRE])?  " fire " : " ---- ",
                      (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- ");
         }
                      (j & joy_masks[JOY_FIRE])?  " fire " : " ---- ",
                      (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- ");
         }
+        waitvblank();
     }
     for(;;);
 }
     }
     for(;;);
 }