IENTAUX/IENTMAIN macros for IRQ handlers. No CLI!

This commit is contained in:
Bobbi Webber-Manners 2021-08-17 12:00:50 -04:00
parent 0d93ec933c
commit 5313c6188e
4 changed files with 23 additions and 4 deletions

Binary file not shown.

View File

@ -128,6 +128,25 @@ ENTMAIN MAC
CLI ; Re-enable IRQ after XFER
EOM
* Macro called on re-entry to aux memory
* For use in interrupt handlers (no CLI!)
IENTAUX MAC
LDX $0101 ; Recover alt SP
TXS
LDX STRTBCKL
STX STRTL
LDX STRTBCKH
STX STRTH
EOM
* Macro called on re-entry to main memory
* For use in interrupt handlers (no CLI!)
IENTMAIN MAC
TXS ; Main SP already in X
LDX $C081 ; Bank in ROM
LDX $C081
EOM
* Enable writing to main memory (for code running in aux)
WRTMAIN MAC
SEI ; Keeps IRQ handler easy

View File

@ -173,15 +173,15 @@ IRQBRKHDLR
:IRQ >>> XF2MAIN,A2IRQ ; Bounce to Apple IRQ handler
IRQBRKRET
>>> ENTAUX
>>> IENTAUX ; IENTAUX does not do CLI
PLA ; TODO: Pass on to IRQ1V
TAX
PLA
NULLRTI RTI
* Invoked from GSBRK in main memory. On IIgs only.
GSBRKAUX >>> ENTAUX
JMP IRQBRKHDLR ; See if this works!!
GSBRKAUX >>> IENTAUX ; IENTAUX does not do CLI
JMP IRQBRKHDLR
PRERR LDY #$01
PRERRLP LDA (FAULT),Y

View File

@ -7,7 +7,7 @@
* Trampoline in main memory used by aux memory IRQ handler
* to invoke Apple II / ProDOS IRQs in main memory
A2IRQ >>> ENTMAIN
A2IRQ >>> IENTMAIN ; IENTMAIN does not do CLI
JSR A2IRQ2
>>> XF2AUX,IRQBRKRET
A2IRQ2 PHP ; Fake things to look like IRQ