From 49aad01bf105fb731270a964c6130c3f52165c0d Mon Sep 17 00:00:00 2001 From: mrdudz Date: Wed, 21 Jun 2017 23:18:00 +0200 Subject: [PATCH] dont trash akku if possible, use VDC register when in 80column mode --- libsrc/c128/waitvblank.s | 16 ++++++++++++++-- libsrc/c64/waitvblank.s | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libsrc/c128/waitvblank.s b/libsrc/c128/waitvblank.s index 54699286c..e0a469d0e 100644 --- a/libsrc/c128/waitvblank.s +++ b/libsrc/c128/waitvblank.s @@ -4,10 +4,22 @@ .include "c128.inc" _waitvblank: + + lda MODE + bmi @c80 + @l1: - lda VIC_CTRL1 + bit VIC_CTRL1 bpl @l1 @l2: - lda VIC_CTRL1 + 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 index 606f41681..dd9087841 100644 --- a/libsrc/c64/waitvblank.s +++ b/libsrc/c64/waitvblank.s @@ -5,9 +5,9 @@ _waitvblank: @l1: - lda VIC_CTRL1 + bit VIC_CTRL1 bpl @l1 @l2: - lda VIC_CTRL1 + bit VIC_CTRL1 bmi @l2 rts -- 2.39.5