<!-- <itemize> -->
<!-- <item><ref id="get_tv" name="get_tv"> -->
-<!-- <item><ref id="waitvblank" name="waitvblank"> -->
+<!-- <item><ref id="waitvsync" name="waitvsync"> -->
<!-- </itemize> -->
(incomplete)
-<!doctype linuxdoc system>
+<!-- <!doctype linuxdoc system> //-->
<article>
<sect1>NES specific functions<p>
<itemize>
-<item>waitvblank - wait until the start of vblank
+<item>waitvsync - wait until the start of the next frame
<item>get_tv
</itemize>
<sect1>PCE specific functions<p>
<itemize>
-<item>waitvblank</item>
+<item>waitvsync</item>
<item>get_tv (since all PCE systems are NTSC, this always returns TV_NTSC)</item>
</itemize>
<sect1>Supervision specific functions<p>
<itemize>
-<item>waitvblank
+<item>waitvsync
</itemize>
#define JOY_START 6
#define JOY_SELECT 7
-void waitvblank (void);
-/* Wait for the vertical blanking */
+void waitvsync (void);
+/* Wait for start of next frame */
/* NOTE: all Gamate are "NTSC" */
#define get_tv() TV_NTSC
-void waitvblank (void);
-/* Wait for the vertical blanking */
+void waitvsync (void);
+/* Wait for start of the next frame */
unsigned char get_tv (void);
/* Return the video mode the machine is using. */
#define JOY_SELECT 6
#define JOY_RUN 7
-void waitvblank (void);
-/* Wait for the vertical blanking */
+void waitvsync (void);
+/* Wait for start of the next frame */
/* NOTE: all PCE are NTSC */
#define get_tv() TV_NTSC
+++ /dev/null
-
- .export _waitvblank
-
- .include "c128.inc"
-
-_waitvblank:
-
- bit MODE
- bmi @c80
-
-@l1:
- bit VIC_CTRL1
- bpl @l1
-@l2:
- bit VIC_CTRL1
- bmi @l2
- rts
-
-@c80:
- ;FIXME: do we have to switch banks?
-@l3:
- lda VDC_INDEX
- and #$20
- beq @l3
- rts
--- /dev/null
+
+ .export _waitvsync
+
+ .include "c128.inc"
+
+_waitvsync:
+
+ bit MODE
+ bmi @c80
+
+@l1:
+ bit VIC_CTRL1
+ bpl @l1
+@l2:
+ bit VIC_CTRL1
+ bmi @l2
+ rts
+
+@c80:
+ ;FIXME: do we have to switch banks?
+@l3:
+ lda VDC_INDEX
+ and #$20
+ beq @l3
+ rts
+++ /dev/null
-
- .export _waitvblank
-
- .include "c64.inc"
-
-_waitvblank:
-@l1:
- bit VIC_CTRL1
- bpl @l1
-@l2:
- bit VIC_CTRL1
- bmi @l2
- rts
--- /dev/null
+
+ .export _waitvsync
+
+ .include "c64.inc"
+
+_waitvsync:
+@l1:
+ bit VIC_CTRL1
+ bpl @l1
+@l2:
+ bit VIC_CTRL1
+ bmi @l2
+ rts
+++ /dev/null
-
- .export _waitvblank
- .import PALFLAG
- .import sys_bank, restore_bank
-
- .importzp vic
-
- .include "cbm510.inc"
-
-_waitvblank:
- rts ; FIXME
-
- jsr sys_bank ; Switch to the system bank
-
- sei
-
- ldy #VIC_CTRL1
-@l1:
- lda (vic),y
- bpl @l1
-@l2:
- lda (vic),y
- bmi @l2
-
- cli
- jmp restore_bank
--- /dev/null
+
+ .export _waitvsync
+ .import PALFLAG
+ .import sys_bank, restore_bank
+
+ .importzp vic
+
+ .include "cbm510.inc"
+
+_waitvsync:
+ rts ; FIXME
+
+ jsr sys_bank ; Switch to the system bank
+
+ sei
+
+ ldy #VIC_CTRL1
+@l1:
+ lda (vic),y
+ bpl @l1
+@l2:
+ lda (vic),y
+ bmi @l2
+
+ cli
+ jmp restore_bank
+++ /dev/null
-;
-; void waitvblank (void);
-;
-
- .include "gamate.inc"
- .include "extzp.inc"
-
- .forceimport ticktock
- .export _waitvblank
-
-; FIXME: is this actually correct?
-
-.proc _waitvblank
-
- lda tickcount
-@lp: cmp tickcount
- beq @lp
- rts
-
-.endproc
--- /dev/null
+;
+; void waitvsync (void);
+;
+
+ .include "gamate.inc"
+ .include "extzp.inc"
+
+ .forceimport ticktock
+ .export _waitvsync
+
+; FIXME: is this actually correct?
+
+.proc _waitvsync
+
+ lda tickcount
+@lp: cmp tickcount
+ beq @lp
+ rts
+
+.endproc
+++ /dev/null
-;
-; Written by Groepaz/Hitmen <groepaz@gmx.net>
-; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
-;
-; void waitvblank(void);
-;
-
- .export _waitvblank
-
- .include "nes.inc"
-
-.proc _waitvblank
-
-wait: lda PPU_STATUS
- bpl wait
- rts
-
-.endproc
--- /dev/null
+;
+; Written by Groepaz/Hitmen <groepaz@gmx.net>
+; Cleanup by Ullrich von Bassewitz <uz@cc65.org>
+;
+; void waitvsync(void);
+;
+
+ .export _waitvsync
+
+ .include "nes.inc"
+
+.proc _waitvsync
+
+wait: lda PPU_STATUS
+ bpl wait
+ rts
+
+.endproc
+++ /dev/null
-;
-; void waitvblank (void);
-;
-
- .include "pce.inc"
- .include "extzp.inc"
-
- .forceimport ticktock
- .export _waitvblank
-
-.proc _waitvblank
-
- lda tickcount
-@lp: cmp tickcount
- beq @lp
- rts
-
-.endproc
--- /dev/null
+;
+; void waitvsync (void);
+;
+
+ .include "pce.inc"
+ .include "extzp.inc"
+
+ .forceimport ticktock
+ .export _waitvsync
+
+.proc _waitvsync
+
+ lda tickcount
+@lp: cmp tickcount
+ beq @lp
+ rts
+
+.endproc
+++ /dev/null
- .export _waitvblank
-
- .include "vic20.inc"
-
-; FIXME
-; this flag doesnt work on vic20!!!
-; it will have to be filled by a get_tv() constructor or so
-PALFLAG = $2A6 ; $01 = PAL, $00 = NTSC
-
-_waitvblank:
- lda PALFLAG
- beq @ntsc
- ldx #(312-8)/2
- .byte $2c
-@ntsc:
- ldx #(262-8)/2
-@l2:
- cpx VIC_HLINE
- bcs @l2
- rts
-
--- /dev/null
+ .export _waitvsync
+
+ .include "vic20.inc"
+
+; FIXME
+; this flag doesnt work on vic20!!!
+; it will have to be filled by a get_tv() constructor or so
+PALFLAG = $2A6 ; $01 = PAL, $00 = NTSC
+
+_waitvsync:
+ lda PALFLAG
+ beq @ntsc
+ ldx #(312-8)/2
+ .byte $2c
+@ntsc:
+ ldx #(262-8)/2
+@l2:
+ cpx VIC_HLINE
+ bcs @l2
+ rts
+
gotoxy(7 + inpos,1);
#if defined(__NES__) || defined(__PCE__) || defined(__GAMATE__)
- /* not all targets have waitvblank */
- waitvblank();
+ /* not all targets have waitvsync */
+ waitvsync();
/* for targets that do not have a keyboard, read the first
joystick */
joy = joy_read(JOY_1);
break;
}
- waitvblank();
+ waitvsync();
(*((unsigned char*)LCD_XPOS)) = x;
(*((unsigned char*)LCD_YPOS)) = y;
p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]);
}
- waitvblank();
+ waitvsync();
++n;
}
}