Swap in LC before destructors, ROM after

This commit is contained in:
Colin Leroy-Mira
2024-01-21 16:50:59 +01:00
committed by Oliver Schmidt
parent 57e65a6bf6
commit f0b5b02966
3 changed files with 7 additions and 4 deletions

View File

@@ -40,12 +40,15 @@ _exit: ldx #<exit
lda #>exit
jsr reset ; Setup RESET vector
; Switch in ROM, in case it wasn't already switched in by a RESET.
bit $C082
; Switch in LC bank 2 for R/O in case it was switched out by a RESET.
bit $C080
; Call the module destructors.
jsr donelib
; Switch in ROM.
bit $C082
; Restore the original RESET vector.
exit: ldx #$02
: lda rvsave,x