From: mrdudz Date: Wed, 15 Jul 2015 17:46:26 +0000 (+0200) Subject: added waitvblank and fixed get_tv X-Git-Tag: V2.16~231^2~20 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1414411bba07a7c15c75dbf46fbb7b227d82161e;p=cc65 added waitvblank and fixed get_tv --- diff --git a/doc/pce.sgml b/doc/pce.sgml index 4c395ae43..2d14e8361 100644 --- a/doc/pce.sgml +++ b/doc/pce.sgml @@ -77,8 +77,8 @@ Programs containing PCE specific code may use the PCE specific functions

-waitvblank -get_tv +waitvblank +get_tv (since all PCE systems are NTSC, this always returns TV_NTSC) diff --git a/include/pce.h b/include/pce.h index 613da2b0d..74b6409e1 100644 --- a/include/pce.h +++ b/include/pce.h @@ -83,8 +83,8 @@ extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ 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. */ diff --git a/libsrc/pce/readme.txt b/libsrc/pce/readme.txt index d07150913..b201893d1 100644 --- a/libsrc/pce/readme.txt +++ b/libsrc/pce/readme.txt @@ -8,9 +8,6 @@ joystick support should get verified on real hw 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 diff --git a/libsrc/pce/waitvblank.s b/libsrc/pce/waitvblank.s new file mode 100644 index 000000000..2ded2835e --- /dev/null +++ b/libsrc/pce/waitvblank.s @@ -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 + diff --git a/testcode/lib/pce/conio.c b/testcode/lib/pce/conio.c index 88c343af2..92431d142 100644 --- a/testcode/lib/pce/conio.c +++ b/testcode/lib/pce/conio.c @@ -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); @@ -68,6 +82,7 @@ void main(void) (j & joy_masks[JOY_FIRE])? " fire " : " ---- ", (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- "); } + waitvblank(); } for(;;); }