Restore shadow reg instead of overwriting

This commit is contained in:
Lucas Scharenbroich 2023-04-27 23:38:26 -05:00
parent df32442fff
commit 57f57ce533

View File

@ -150,17 +150,17 @@ jmp_rtn_1 jmp l_jmp_rtn-base ; Could inline the code and
; 8 or 16 lines in order to give the system time to handle interrupts. ; 8 or 16 lines in order to give the system time to handle interrupts.
enable_int ldal stk_save+1 ; restore the stack enable_int ldal stk_save+1 ; restore the stack
tcs tcs
sep #$20 ; 8-bit mode sep #$30 ; 8-bit mode
ldal STATE_REG ; Read Bank 0 / Write Bank 0 ldal STATE_REG
and #$CF tax ; Save the value
and #$CF ; Read Bank 0 / Write Bank 0
stal STATE_REG stal STATE_REG
cli cli
nop ; Give a couple of cycles nop ; Give a couple of cycles
sei sei
ldal STATE_REG txa ; Restore the state
ora #$10 ; Read Bank 0 / Write Bank 1
stal STATE_REG stal STATE_REG
rep #$20 rep #$30
bra entry_1 bra entry_1
; This is the spot that needs to be page-aligned. In addition to simplifying the entry address ; This is the spot that needs to be page-aligned. In addition to simplifying the entry address