trying clean disable of interrupts

This commit is contained in:
Brooke Vibber 2022-11-29 12:59:26 -08:00
parent f9431749d2
commit 1f813b4e8e

View file

@ -8,6 +8,7 @@ COLPF2 = $D018
COLPF3 = $D019
COLBK = $D01A
DMACTL = $D400
WSYNC = $D40A
VCOUNT = $D40B
NMIEN = $D40E
@ -82,7 +83,7 @@ displaylist:
; Disable display DMA
lda #$00
sta SDMCTL
sta DMACTL
; Set up the display list
lda #.lobyte(displaylist)
@ -90,10 +91,6 @@ displaylist:
lda #.hibyte(displaylist)
sta SDLSTH
; Disable VBI and DLI but allow Reset
lda #(128 + 64)
sta NMIEN
; Manually wait for first scan line
wait_vblank:
lda VCOUNT
@ -101,7 +98,12 @@ wait_vblank:
; Re-enable display DMA
lda #$22
sta SDMCTL
sta DMACTL
; Disable VBI and DLI but allow Reset
lda #32
sta NMIEN
wait_loop:
sta WSYNC