]> git.sur5r.net Git - cc65/commitdiff
initial import from old sources
authormrdudz <mrdudz@users.noreply.github.com>
Sun, 28 Feb 2016 21:35:46 +0000 (22:35 +0100)
committermrdudz <mrdudz@users.noreply.github.com>
Sun, 28 Feb 2016 21:35:46 +0000 (22:35 +0100)
libsrc/c128/waitvblank.s [new file with mode: 0644]
libsrc/c64/waitvblank.s [new file with mode: 0644]
libsrc/cbm510/waitvblank.s [new file with mode: 0644]
libsrc/vic20/waitvblank.s [new file with mode: 0644]

diff --git a/libsrc/c128/waitvblank.s b/libsrc/c128/waitvblank.s
new file mode 100644 (file)
index 0000000..a3904d8
--- /dev/null
@@ -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 (file)
index 0000000..09570f8
--- /dev/null
@@ -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 (file)
index 0000000..30cbf07
--- /dev/null
@@ -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 (file)
index 0000000..b99c74b
--- /dev/null
@@ -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
+