2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-05-25 19:24:07 +00:00
|
|
|
|
AUTO 3,1
|
2015-12-10 18:53:30 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* called directly by IRQ Vector $FFFE in AuxLC
|
|
|
|
|
* Must keep:
|
|
|
|
|
* A,X,Y
|
|
|
|
|
* SETREADAUX
|
|
|
|
|
* if we are here, Aux ZP/Stack already On
|
|
|
|
|
* Exit with RTI
|
|
|
|
|
* if A2osX Drivers cannot clear IRQ,
|
|
|
|
|
* must call regular System Handler
|
|
|
|
|
*--------------------------------------
|
2018-03-29 15:29:47 +00:00
|
|
|
|
MSLOT .EQ $7f8
|
|
|
|
|
*--------------------------------------
|
2020-09-24 15:31:48 +00:00
|
|
|
|
*IRQ.BRK jmp IRQ.6
|
2018-05-18 13:59:11 +00:00
|
|
|
|
*--------------------------------------
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.Handler cld
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
sta IRQ.6+1
|
2015-12-10 18:53:30 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
and #$10 BRK?
|
2020-09-24 15:31:48 +00:00
|
|
|
|
* bne IRQ.BRK
|
2018-07-25 15:26:14 +00:00
|
|
|
|
bne *
|
2019-09-27 14:53:44 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
stx IRQ.5+1
|
|
|
|
|
sty IRQ.4+1
|
2020-09-04 15:21:15 +00:00
|
|
|
|
|
2018-12-17 07:02:03 +00:00
|
|
|
|
lda RDPAGE2
|
|
|
|
|
pha
|
|
|
|
|
sta CLRPAGE2
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
lda RD80STORE
|
|
|
|
|
pha
|
2020-11-25 16:29:06 +00:00
|
|
|
|
sta CLR80STORE
|
|
|
|
|
|
2015-12-10 18:53:30 +00:00
|
|
|
|
lda RDREADAUX
|
|
|
|
|
pha
|
2018-07-11 15:13:29 +00:00
|
|
|
|
sta CLRREADAUX Make sure we can access FD.Table
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
lda RDWRITEAUX
|
|
|
|
|
pha
|
|
|
|
|
sta CLRWRITEAUX Driver may R/W in screen holes
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
lda MSLOT Save MSLOT
|
|
|
|
|
pha
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
|
|
|
|
lda RDCXROM C100-C7ff state
|
2018-05-18 13:59:11 +00:00
|
|
|
|
pha
|
2020-11-25 16:29:06 +00:00
|
|
|
|
sta CLRCXROM Enable access to slot C100-C7ff space
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.JSR jsr CORE.IRQ.DEV SELF MODIFIED
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
ldx #CLRCXROM
|
|
|
|
|
|
|
|
|
|
pla Get CXROM State
|
|
|
|
|
bpl .3
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2020-11-25 16:29:06 +00:00
|
|
|
|
inx X = SETCXROM
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.3 sta $C000,x
|
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
pla Get back MSLOT
|
2018-03-29 15:29:47 +00:00
|
|
|
|
sta MSLOT
|
2020-09-24 15:31:48 +00:00
|
|
|
|
sta IRQ.2+2
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
and #$F0
|
2019-09-27 14:53:44 +00:00
|
|
|
|
eor #$C0 ....mmm...not looking like Cn....
|
2020-09-24 15:31:48 +00:00
|
|
|
|
bne IRQ.3
|
2019-09-27 14:53:44 +00:00
|
|
|
|
|
2020-11-25 16:29:06 +00:00
|
|
|
|
sta CLRC8ROM Release $C800
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.2 lda $ff00 SELF MODIFIED
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.3 pla Must keep Carry
|
2018-05-18 13:59:11 +00:00
|
|
|
|
bpl .1
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
sta SETWRITEAUX
|
2019-10-03 06:25:27 +00:00
|
|
|
|
clv coming for AUX.....cancel switch
|
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
.1 pla
|
|
|
|
|
bpl .2
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
sta SETREADAUX
|
2019-10-03 06:25:27 +00:00
|
|
|
|
clv coming for AUX.....cancel switch
|
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
.2 pla
|
2018-12-17 07:02:03 +00:00
|
|
|
|
bpl .3
|
|
|
|
|
|
2020-09-04 15:21:15 +00:00
|
|
|
|
sta SET80STORE
|
|
|
|
|
|
|
|
|
|
.3 pla
|
|
|
|
|
bpl .30
|
|
|
|
|
|
2018-12-17 07:02:03 +00:00
|
|
|
|
sta SETPAGE2
|
2019-03-27 21:14:40 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
.30 bvc IRQ.4 if not V, skip task switching
|
2019-09-27 14:53:44 +00:00
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
tsx Check Stack if before "dec IRQ.InKernel"
|
|
|
|
|
cpx #$fc $1ff-PChi-PClo-P = $1fc
|
|
|
|
|
bcs .8 in CORE.Run or CORE.Dispatch
|
2019-09-27 14:53:44 +00:00
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
lda $103,x
|
|
|
|
|
cmp /A2osX.SYSCALL
|
|
|
|
|
bcs .8 we are in kernel GP or LC
|
|
|
|
|
|
|
|
|
|
php
|
2018-04-11 15:35:51 +00:00
|
|
|
|
php make room for 2 additional bytes
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
tsx
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
lda $104,x get RTI PC LO
|
2018-12-17 07:02:03 +00:00
|
|
|
|
bne .4
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
dec $105,x adjust RTI PC HI
|
2018-04-13 15:18:48 +00:00
|
|
|
|
|
2018-12-17 07:02:03 +00:00
|
|
|
|
.4 dec $104,x back one byte, to make it a "RTS" return adddress
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
|
|
|
|
lda $103,x get IRQ pushed P
|
2019-10-03 06:25:27 +00:00
|
|
|
|
sta $101,x down 2 bytes
|
2018-05-24 15:21:38 +00:00
|
|
|
|
lda #A2osX.SLEEP make a RTI like "jsr A2osX.SLEEP"
|
2018-04-20 15:06:41 +00:00
|
|
|
|
sta $102,x
|
2018-05-24 15:21:38 +00:00
|
|
|
|
lda /A2osX.SLEEP with RTS=PC IRQ-1
|
2018-04-20 15:06:41 +00:00
|
|
|
|
sta $103,x
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.4 ldy #$ff Self Modified
|
|
|
|
|
IRQ.5 ldx #$ff Self Modified
|
|
|
|
|
IRQ.6 lda #$ff Self Modified
|
|
|
|
|
bcc IRQ.8
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2020-09-25 12:05:23 +00:00
|
|
|
|
dec IRQ.Skip Make regular ProDOS IRQ manager skip A2osX
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.JMP jmp $FFFF SELF MODIFIED Not handled, pass to ProDOS
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
IRQ.8 rti
|
2017-01-25 16:18:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-12-10 18:53:30 +00:00
|
|
|
|
MAN
|
2018-11-17 17:17:13 +00:00
|
|
|
|
SAVE USR/SRC/SYS/KERNEL.S.IRQ
|
|
|
|
|
LOAD USR/SRC/SYS/KERNEL.S
|
2015-12-10 18:53:30 +00:00
|
|
|
|
ASM
|