added waitvblank and fixed get_tv

This commit is contained in:
mrdudz
2015-07-15 19:46:26 +02:00
parent c3d45e4c47
commit 1414411bba
5 changed files with 39 additions and 9 deletions

View File

@@ -77,8 +77,8 @@ Programs containing PCE specific code may use the <tt/pce.h/ header file.
<sect1>PCE specific functions<p> <sect1>PCE specific functions<p>
<itemize> <itemize>
<item>waitvblank <item>waitvblank</item>
<item>get_tv <item>get_tv</item> (since all PCE systems are NTSC, this always returns TV_NTSC)
</itemize> </itemize>

View File

@@ -83,8 +83,8 @@ extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
void waitvblank (void); void waitvblank (void);
/* Wait for the vertical blanking */ /* Wait for the vertical blanking */
/* FIXME: not implemented */ /* all PCE are NTSC */
unsigned char get_tv (void); #define get_tv() TV_NTSC
/* Return the video mode the machine is using. */ /* Return the video mode the machine is using. */

View 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 some graphical petscii chars should get added to the charset
interruptor support in crt0 (and cfg) is missing interruptor support in crt0 (and cfg) is missing

18
libsrc/pce/waitvblank.s Normal file
View File

@@ -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

View 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); gotoxy(13,4);
cprintf("%02x", datavar); cprintf("%02x", datavar);
gotoxy(13,5); gotoxy(13,5);
@@ -68,6 +82,7 @@ void main(void)
(j & joy_masks[JOY_FIRE])? " fire " : " ---- ", (j & joy_masks[JOY_FIRE])? " fire " : " ---- ",
(j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- "); (j & joy_masks[JOY_FIRE2])? "fire2 " : " ---- ");
} }
waitvblank();
} }
for(;;); for(;;);
} }