ksp_theme: fix interrupt bug on older Apple IIs

This commit is contained in:
Vince Weaver 2018-09-04 12:51:13 -04:00
parent 762ebf13fe
commit 42e4f41997
3 changed files with 21 additions and 6 deletions

View File

@ -352,7 +352,8 @@ forever_loop:
; Then it sets up the stack like an interrupt and calls 0x3fe
interrupt_handler:
pha ; save A
; pha ; save A
; A saved by firmware to $45
txa
pha
tya
@ -549,10 +550,13 @@ done_left_interrupt:
done_interrupt:
pla
tay
pla
tax
tay ; restore Y
pla
tax ; restore X
lda $45 ; restore A
rti

View File

@ -338,8 +338,13 @@ forever_loop:
; Then it sets up the stack like an interrupt and calls 0x3fe
interrupt_handler:
pha ; save A
; Should we save X and Y too?
; pha ; firmware saves A to $45 for us
txa ; save X
pha
tya
pha ; save Y
bit $C404 ; can clear 6522 interrupt by reading T1C-L
@ -437,6 +442,12 @@ not_done:
done_interrupt:
pla
tay ; restore y
pla
tax ; restore X
lda $45 ; restore A
rti

Binary file not shown.