From: mrdudz Date: Mon, 17 Jul 2017 21:15:05 +0000 (+0200) Subject: rename all waitvblank() to waitvsync() X-Git-Tag: V2.17~116^2~7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1abce3a2a1d7df81a580e9120a34e1d697085b3e;p=cc65 rename all waitvblank() to waitvsync() --- diff --git a/doc/funcref.sgml b/doc/funcref.sgml index a2ccf6c73..b5295a63b 100644 --- a/doc/funcref.sgml +++ b/doc/funcref.sgml @@ -415,7 +415,7 @@ function. - + (incomplete) diff --git a/doc/nes.sgml b/doc/nes.sgml index 98c25b6af..31d1aa396 100644 --- a/doc/nes.sgml +++ b/doc/nes.sgml @@ -1,4 +1,4 @@ - +
@@ -69,7 +69,7 @@ Programs containing NES specific code may use the NES specific functions

-waitvblank - wait until the start of vblank +waitvsync - wait until the start of the next frame get_tv diff --git a/doc/pce.sgml b/doc/pce.sgml index ba59c31a7..124cb329e 100644 --- a/doc/pce.sgml +++ b/doc/pce.sgml @@ -77,7 +77,7 @@ Programs containing PCE specific code may use the PCE specific functions

-waitvblank +waitvsync get_tv (since all PCE systems are NTSC, this always returns TV_NTSC) diff --git a/doc/supervision.sgml b/doc/supervision.sgml index 97495dea5..2466aa480 100644 --- a/doc/supervision.sgml +++ b/doc/supervision.sgml @@ -66,7 +66,7 @@ Programs containing Supervision specific code may use the Supervision specific functions

-waitvblank +waitvsync diff --git a/include/gamate.h b/include/gamate.h index 82bca08b1..96c70c9bc 100644 --- a/include/gamate.h +++ b/include/gamate.h @@ -188,8 +188,8 @@ extern void gamate_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ #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 diff --git a/include/nes.h b/include/nes.h index a472a0f3c..95e2fe93b 100644 --- a/include/nes.h +++ b/include/nes.h @@ -163,8 +163,8 @@ extern void nes_64_56_2_tgi[]; /* Referred to by tgi_static_stddrv[] */ -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. */ diff --git a/include/pce.h b/include/pce.h index 7700654c8..856a2fa1d 100644 --- a/include/pce.h +++ b/include/pce.h @@ -83,8 +83,8 @@ extern void pce_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */ #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 diff --git a/libsrc/c128/waitvblank.s b/libsrc/c128/waitvblank.s deleted file mode 100644 index c144e11c2..000000000 --- a/libsrc/c128/waitvblank.s +++ /dev/null @@ -1,25 +0,0 @@ - - .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 diff --git a/libsrc/c128/waitvsync.s b/libsrc/c128/waitvsync.s new file mode 100644 index 000000000..1597e5fa0 --- /dev/null +++ b/libsrc/c128/waitvsync.s @@ -0,0 +1,25 @@ + + .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 diff --git a/libsrc/c64/waitvblank.s b/libsrc/c64/waitvblank.s deleted file mode 100644 index dd9087841..000000000 --- a/libsrc/c64/waitvblank.s +++ /dev/null @@ -1,13 +0,0 @@ - - .export _waitvblank - - .include "c64.inc" - -_waitvblank: -@l1: - bit VIC_CTRL1 - bpl @l1 -@l2: - bit VIC_CTRL1 - bmi @l2 - rts diff --git a/libsrc/c64/waitvsync.s b/libsrc/c64/waitvsync.s new file mode 100644 index 000000000..15ef61bb7 --- /dev/null +++ b/libsrc/c64/waitvsync.s @@ -0,0 +1,13 @@ + + .export _waitvsync + + .include "c64.inc" + +_waitvsync: +@l1: + bit VIC_CTRL1 + bpl @l1 +@l2: + bit VIC_CTRL1 + bmi @l2 + rts diff --git a/libsrc/cbm510/waitvblank.s b/libsrc/cbm510/waitvblank.s deleted file mode 100644 index 975861f2c..000000000 --- a/libsrc/cbm510/waitvblank.s +++ /dev/null @@ -1,26 +0,0 @@ - - .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 diff --git a/libsrc/cbm510/waitvsync.s b/libsrc/cbm510/waitvsync.s new file mode 100644 index 000000000..bd631e4d6 --- /dev/null +++ b/libsrc/cbm510/waitvsync.s @@ -0,0 +1,26 @@ + + .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 diff --git a/libsrc/gamate/waitvblank.s b/libsrc/gamate/waitvblank.s deleted file mode 100644 index 66686c08a..000000000 --- a/libsrc/gamate/waitvblank.s +++ /dev/null @@ -1,20 +0,0 @@ -; -; 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 diff --git a/libsrc/gamate/waitvsync.s b/libsrc/gamate/waitvsync.s new file mode 100644 index 000000000..9b1199055 --- /dev/null +++ b/libsrc/gamate/waitvsync.s @@ -0,0 +1,20 @@ +; +; 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 diff --git a/libsrc/nes/waitvblank.s b/libsrc/nes/waitvblank.s deleted file mode 100644 index 408646904..000000000 --- a/libsrc/nes/waitvblank.s +++ /dev/null @@ -1,18 +0,0 @@ -; -; Written by Groepaz/Hitmen -; Cleanup by Ullrich von Bassewitz -; -; void waitvblank(void); -; - - .export _waitvblank - - .include "nes.inc" - -.proc _waitvblank - -wait: lda PPU_STATUS - bpl wait - rts - -.endproc diff --git a/libsrc/nes/waitvsync.s b/libsrc/nes/waitvsync.s new file mode 100644 index 000000000..11a231ac4 --- /dev/null +++ b/libsrc/nes/waitvsync.s @@ -0,0 +1,18 @@ +; +; Written by Groepaz/Hitmen +; Cleanup by Ullrich von Bassewitz +; +; void waitvsync(void); +; + + .export _waitvsync + + .include "nes.inc" + +.proc _waitvsync + +wait: lda PPU_STATUS + bpl wait + rts + +.endproc diff --git a/libsrc/pce/waitvblank.s b/libsrc/pce/waitvblank.s deleted file mode 100644 index b9f0f902f..000000000 --- a/libsrc/pce/waitvblank.s +++ /dev/null @@ -1,18 +0,0 @@ -; -; void waitvblank (void); -; - - .include "pce.inc" - .include "extzp.inc" - - .forceimport ticktock - .export _waitvblank - -.proc _waitvblank - - lda tickcount -@lp: cmp tickcount - beq @lp - rts - -.endproc diff --git a/libsrc/pce/waitvsync.s b/libsrc/pce/waitvsync.s new file mode 100644 index 000000000..f1eab36f8 --- /dev/null +++ b/libsrc/pce/waitvsync.s @@ -0,0 +1,18 @@ +; +; void waitvsync (void); +; + + .include "pce.inc" + .include "extzp.inc" + + .forceimport ticktock + .export _waitvsync + +.proc _waitvsync + + lda tickcount +@lp: cmp tickcount + beq @lp + rts + +.endproc diff --git a/libsrc/vic20/waitvblank.s b/libsrc/vic20/waitvblank.s deleted file mode 100644 index 246c44640..000000000 --- a/libsrc/vic20/waitvblank.s +++ /dev/null @@ -1,21 +0,0 @@ - .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 - diff --git a/libsrc/vic20/waitvsync.s b/libsrc/vic20/waitvsync.s new file mode 100644 index 000000000..9f0d50565 --- /dev/null +++ b/libsrc/vic20/waitvsync.s @@ -0,0 +1,21 @@ + .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 + diff --git a/testcode/lib/conio.c b/testcode/lib/conio.c index fe977ec08..13188d1cd 100644 --- a/testcode/lib/conio.c +++ b/testcode/lib/conio.c @@ -117,8 +117,8 @@ void main(void) 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); diff --git a/testcode/lib/gamate/ctest.c b/testcode/lib/gamate/ctest.c index dfebd9bef..793770cee 100644 --- a/testcode/lib/gamate/ctest.c +++ b/testcode/lib/gamate/ctest.c @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) break; } - waitvblank(); + waitvsync(); (*((unsigned char*)LCD_XPOS)) = x; (*((unsigned char*)LCD_YPOS)) = y; diff --git a/testcode/lib/pce/conio.c b/testcode/lib/pce/conio.c index a4bd63b15..00ae3c157 100644 --- a/testcode/lib/pce/conio.c +++ b/testcode/lib/pce/conio.c @@ -123,7 +123,7 @@ void main(void) p[8],p[9],p[10],p[11],p[12],p[13],p[14],p[15]); } - waitvblank(); + waitvsync(); ++n; } }