From 9a1f9c7209f5f0eb865e14edc2783290f7459d44 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Wed, 7 Oct 2020 15:45:20 +0200 Subject: [PATCH] U64/JiffyDOS - do not blank screen if one can disable badlines --- src/kernal/iec_fast/jiffydos_load.s | 41 ++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/kernal/iec_fast/jiffydos_load.s b/src/kernal/iec_fast/jiffydos_load.s index 5d05b8cd..7ff2392d 100644 --- a/src/kernal/iec_fast/jiffydos_load.s +++ b/src/kernal/iec_fast/jiffydos_load.s @@ -27,13 +27,30 @@ jiffydos_load: !ifdef CONFIG_IEC_JIFFYDOS_BLANK { +!ifdef CONFIG_MB_U64 { + + ; Check if turbo register is available + lda U64_TURBOCTL + cmp #$FF + beq @1 + + ; Store turbo register content, disable badlines + sta TBTCNT + lda #$80 + sta U64_TURBOCTL + bne @2 + + ; Normal flow - no turbo register +} + +@1: ; Preserve register with screen status (blank/visible) lda VIC_SCROLY sta TBTCNT ; Blank screen to make sure no sprite/badline will interrupt jsr screen_off - +@2: ; Preserve 3 lowest bits of CIA2_PRA XXX deduplicate this lda CIA2_PRA @@ -42,9 +59,12 @@ jiffydos_load: } else { +@1: ; Store previous sprite status in temporary variable jsr jiffydos_prepare sta TBTCNT +@2: + } ; A trick to shorten EAL update time @@ -148,15 +168,34 @@ jiffydos_load_end: !ifdef CONFIG_IEC_JIFFYDOS_BLANK { +!ifdef CONFIG_MB_U64 { + + ; Check if turbo register is available + lda U64_TURBOCTL + cmp #$FF + beq @3 + + ; Restore turbo register content + lda TBTCNT + sta U64_TURBOCTL + jmp @4 + + ; Normal flow - no turbo register +} + +@3: ; Restore screen state lda TBTCNT sta VIC_SCROLY +@4: } else { +@3: ; Re-enable sprites lda TBTCNT sta VIC_SPENA +@4: } ; Store last byte as unoptimized LOAD routine would