From: mrdudz Date: Sun, 28 Feb 2016 21:35:46 +0000 (+0100) Subject: initial import from old sources X-Git-Tag: V2.17~116^2~11 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eb96a90e5fe642102b5b81dc1e031641ed362c29;p=cc65 initial import from old sources --- diff --git a/libsrc/c128/waitvblank.s b/libsrc/c128/waitvblank.s new file mode 100644 index 000000000..a3904d858 --- /dev/null +++ b/libsrc/c128/waitvblank.s @@ -0,0 +1,20 @@ + + .export _waitvblank + + .include "c128/c128.inc" + +_waitvblank: + lda PALFLAG + beq @ntsc + ldx #(312-24)-256 + .byte $2c +@ntsc: + ldx #(262-4)-256 +@l1: + lda VIC_CTRL1 + and #$80 + beq @l1 +@l2: + cpx VIC_HLINE + bcs @l2 + rts diff --git a/libsrc/c64/waitvblank.s b/libsrc/c64/waitvblank.s new file mode 100644 index 000000000..09570f873 --- /dev/null +++ b/libsrc/c64/waitvblank.s @@ -0,0 +1,20 @@ + + .export _waitvblank + + .include "c64/c64.inc" + +_waitvblank: + lda PALFLAG + beq @ntsc + ldx #(312-24)-256 + .byte $2c +@ntsc: + ldx #(262-4)-256 +@l1: + lda VIC_CTRL1 + and #$80 + beq @l1 +@l2: + cpx VIC_HLINE + bcs @l2 + rts diff --git a/libsrc/cbm510/waitvblank.s b/libsrc/cbm510/waitvblank.s new file mode 100644 index 000000000..30cbf072f --- /dev/null +++ b/libsrc/cbm510/waitvblank.s @@ -0,0 +1,37 @@ + + .export _waitvblank + .import PALFLAG + .import sys_bank, restore_bank + + .importzp vic + + .include "cbm510/cbm510.inc" + +_waitvblank: + rts ; FIXME + + jsr sys_bank ; Switch to the system bank + + lda PALFLAG + beq ntsc + ldx #(312-24)-256 + .byte $2c +ntsc: + ldx #(262-2)-256 + + sei + ldy #VIC_CTRL1 +l1: + lda (vic),y + and #$80 + beq l1 + +;?!? +; ldy #VIC_HLINE +; txa +;l2: +; cmp (vic),y +; bcs l2 + + cli + jmp restore_bank diff --git a/libsrc/vic20/waitvblank.s b/libsrc/vic20/waitvblank.s new file mode 100644 index 000000000..b99c74bed --- /dev/null +++ b/libsrc/vic20/waitvblank.s @@ -0,0 +1,16 @@ + .export _waitvblank + + .include "vic20/vic20.inc" + +_waitvblank: + lda PALFLAG + beq @ntsc + ldx #(312-8)/2 + .byte $2c +@ntsc: + ldx #(262-8)/2 +@l2: + cpx VIC_HLINE + bcs @l2 + rts +