From 7cb879d1108267ce7bccf752a8236bad86e0289f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 22 Jan 2023 05:54:50 -0800 Subject: [PATCH] fix graphics set forgot that the OS copies shadow registers over lol --- mandel.s | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mandel.s b/mandel.s index b5c5953..25eaffd 100644 --- a/mandel.s +++ b/mandel.s @@ -40,6 +40,10 @@ DMACTL = $D400 DLISTL = $D402 DLISTH = $D403 +; OS shadow registers +SDLSTL = $230 +SDLSTH = $231 + .data aspect: @@ -74,6 +78,10 @@ display_list: .byte $70 ; 8 blank lines .endrep + ; 8 scan lines, 1 row of 40-column text + .byte $42 + .addr textbuffer + ; 184 lines graphics ; ANTIC mode e (160px 2bpp, 1 scan line per line) .byte $4e @@ -87,10 +95,6 @@ display_list: .byte $0e .endrep - ; 1 line 40-column text - .byte $42 - .addr textbuffer - .byte $41 ; jump and blank .addr display_list @@ -474,14 +478,15 @@ enough: sta zoom ; Disable display DMA - lda #$00 sta DMACTL ; Set up the display list lda #.lobyte(display_list) - sta DLISTL + sta DLISTL ; actual register + sta SDLSTL ; shadow register the OS will copy in lda #.hibyte(display_list) - sta DLISTH + sta DLISTH ; actual register + sta SDLSTH ; shadow register the OS will copy in ; zero the range from framebuffer_top to framebuffer_end lda #.lobyte(framebuffer_top)