From eb96a90e5fe642102b5b81dc1e031641ed362c29 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 28 Feb 2016 22:35:46 +0100 Subject: [PATCH] initial import from old sources --- libsrc/c128/waitvblank.s | 20 ++++++++++++++++++++ libsrc/c64/waitvblank.s | 20 ++++++++++++++++++++ libsrc/cbm510/waitvblank.s | 37 +++++++++++++++++++++++++++++++++++++ libsrc/vic20/waitvblank.s | 16 ++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 libsrc/c128/waitvblank.s create mode 100644 libsrc/c64/waitvblank.s create mode 100644 libsrc/cbm510/waitvblank.s create mode 100644 libsrc/vic20/waitvblank.s 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 + -- 2.39.5