From 6247b942e5265f38dbf2f7f6ec706fa671205bda Mon Sep 17 00:00:00 2001 From: blondie7575 Date: Sun, 10 Mar 2024 13:36:28 -0700 Subject: [PATCH] Fixed loading screen showing garbage on real hardware --- loaderGraphics.s | 25 +++++++++++++++++++++++++ titleScreen.s | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/loaderGraphics.s b/loaderGraphics.s index 2789cc8..621fe40 100644 --- a/loaderGraphics.s +++ b/loaderGraphics.s @@ -9,12 +9,16 @@ loaderPalette: showLoadingScreen: lda #$0000 jsr slowColorFill + SHRVIDEO SHADOWMEMORY + + jsr initSCBs lda #loaderPalette sta PARAML0 lda #0 jsr setPalette + BORDER_COLOR #$7 lda #$1111 jsr slowColorFill @@ -55,3 +59,24 @@ slowColorFillLoop: slowColorFillLoopDone: rts + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; initSCBs +; Initialize all scanline control bytes +; +; Trashes A,X + +initSCBs: + BITS8 + lda #0 + ldx #200 ;set all 200 scbs to A + +initSCBsLoop: + dex + sta $e19d00,x + cpx #0 + bne initSCBsLoop + BITS16 + rts + diff --git a/titleScreen.s b/titleScreen.s index 8a66876..36e754d 100644 --- a/titleScreen.s +++ b/titleScreen.s @@ -23,8 +23,8 @@ CAT1_VRAM = $5da0 ; Shows the title screen and main game menu ; titleScreen: - lda #%10000000 ; Set all SCBs to 320, no interrupts, palette 0 - jsr initSCBs + jsr setScanLineInterruptVector + ;jsr setVBLInterruptVector stz leftScreenEdge ; Copy title screen art from where it was loaded in bank 6