2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-03-29 15:48:15 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,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
|
|
|
|
|
*--------------------------------------
|
2018-04-11 15:35:51 +00:00
|
|
|
|
K.IrqHAuxLC cld
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
|
|
|
|
sec
|
2018-04-11 15:35:51 +00:00
|
|
|
|
|
|
|
|
|
sta K.IrqHAuxLC.6+1
|
2015-12-10 18:53:30 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
and #$10 BRK?
|
2018-04-12 15:45:31 +00:00
|
|
|
|
bne K.IrqHAuxLC.6
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
stx K.IrqHAuxLC.5+1
|
|
|
|
|
sty K.IrqHAuxLC.4+1
|
2015-12-10 18:53:30 +00:00
|
|
|
|
|
2018-03-29 15:29:47 +00:00
|
|
|
|
lda $fe Save 2 bytes in ZP
|
2015-12-10 18:53:30 +00:00
|
|
|
|
pha
|
|
|
|
|
lda $ff
|
|
|
|
|
pha
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
|
|
|
|
lda MSLOT Save MSLOT
|
|
|
|
|
pha
|
|
|
|
|
|
2015-12-10 18:53:30 +00:00
|
|
|
|
lda RDREADAUX
|
|
|
|
|
pha
|
2017-10-27 06:36:46 +00:00
|
|
|
|
sta CLRREADAUX Make sure we can access Dev.Table
|
2015-12-10 18:53:30 +00:00
|
|
|
|
|
2018-04-05 20:32:22 +00:00
|
|
|
|
lda RDWRITEAUX
|
|
|
|
|
pha
|
|
|
|
|
sta CLRWRITEAUX Driver may R/W in screen holes
|
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.JSR jsr K.IrqH.DEV SELF MODIFIED
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
|
|
|
|
pla Must keep Carry
|
2018-04-10 15:03:29 +00:00
|
|
|
|
bpl K.IrqHAuxLC.10
|
2018-04-05 20:32:22 +00:00
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.10 pla
|
|
|
|
|
bpl K.IrqHAuxLC.1
|
2017-01-25 16:18:35 +00:00
|
|
|
|
sta SETREADAUX
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.1 pla Get back MSLOT
|
2018-03-29 15:29:47 +00:00
|
|
|
|
sta MSLOT
|
2018-04-10 15:03:29 +00:00
|
|
|
|
sta K.IrqHAuxLC.2+2
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
|
|
|
|
and #$C0
|
|
|
|
|
eor #$C0 ....mmm...not looking link Cn....
|
2018-04-10 15:03:29 +00:00
|
|
|
|
bne K.IrqHAuxLC.3
|
2018-03-29 15:29:47 +00:00
|
|
|
|
sta $CFFF Release $C800
|
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.2 lda $ff00 SELF MODIFIED
|
2018-03-29 15:29:47 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.3 pla
|
2017-01-25 16:18:35 +00:00
|
|
|
|
sta $ff
|
|
|
|
|
pla
|
|
|
|
|
sta $fe
|
2018-04-11 15:35:51 +00:00
|
|
|
|
bvc K.IrqHAuxLC.4 no task switching
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
php
|
|
|
|
|
php make room for 2 additional bytes
|
|
|
|
|
php keep track of C
|
|
|
|
|
tsx
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
|
2018-04-13 15:18:48 +00:00
|
|
|
|
lda $105,x get RTI PC LO
|
2018-04-11 15:35:51 +00:00
|
|
|
|
sbc #1 back one byte, to make it a "RTS" return adddress
|
2018-04-13 15:18:48 +00:00
|
|
|
|
sta $105,x
|
2018-04-11 15:35:51 +00:00
|
|
|
|
bcs .1
|
2018-04-13 15:18:48 +00:00
|
|
|
|
dec $106,x adjust RTI PC HI
|
|
|
|
|
|
|
|
|
|
.1 lda $104,x get IRQ pushed P
|
|
|
|
|
sta $102,x down 2 bytes
|
2018-04-11 15:35:51 +00:00
|
|
|
|
|
2018-04-13 15:18:48 +00:00
|
|
|
|
lda #CORE.Switch make a RTI like "jsr CORE.Sleep"
|
2018-04-11 15:35:51 +00:00
|
|
|
|
sta $103,x
|
2018-04-13 15:18:48 +00:00
|
|
|
|
lda /CORE.Switch with RTS=PC IRQ-1
|
|
|
|
|
sta $104,x
|
2018-04-11 15:35:51 +00:00
|
|
|
|
|
|
|
|
|
plp
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IrqHAuxLC.4 ldy #$ff Self Modified
|
|
|
|
|
K.IrqHAuxLC.5 ldx #$ff Self Modified
|
|
|
|
|
K.IrqHAuxLC.6 lda #$ff Self Modified
|
2018-04-12 15:45:31 +00:00
|
|
|
|
bcc K.IrqHAuxLC.8
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-04-12 15:45:31 +00:00
|
|
|
|
dec IRQ.SkipA2osX Make regular ProDOS IRQ manager skip A2osX
|
|
|
|
|
jmp (K.IRQ.OldFFFE) Not handled, pass to ProDOS
|
|
|
|
|
K.IrqHAuxLC.8 rti
|
2017-01-25 16:18:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-06-02 15:14:42 +00:00
|
|
|
|
* Called by :
|
2017-10-27 14:56:46 +00:00
|
|
|
|
* - Kernel K.IrqHAuxLC
|
|
|
|
|
* - ProDOS IRQ Manager (GP)
|
2017-01-25 16:18:35 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
K.IrqH.TCLOCK ldy IRQ.VBL.n0
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
lda $c080,y
|
|
|
|
|
and #$20
|
2017-10-27 14:56:46 +00:00
|
|
|
|
beq K.IrqH.DEV
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
lda $c080,y
|
|
|
|
|
lda $c088,y
|
2017-09-21 15:29:45 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
bra K.IrqH.Switch
|
2017-10-11 15:37:41 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
K.IrqH.VBL jsr IRQ.VBL.MSM SERVEMOUSE
|
|
|
|
|
bcs K.IrqH.DEV Not From Mouse
|
2017-03-02 22:14:04 +00:00
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ldx IRQ.VBL.0n
|
2017-03-02 22:14:04 +00:00
|
|
|
|
lda $778,x
|
|
|
|
|
and #$08 IRQ was caused by VBL ?
|
2017-10-27 14:56:46 +00:00
|
|
|
|
beq K.IrqH.DEV
|
2017-02-06 17:04:03 +00:00
|
|
|
|
|
2017-11-23 16:51:52 +00:00
|
|
|
|
ldx IRQ.VBL.MRM+2 $Cn
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ldy IRQ.VBL.n0
|
2017-11-23 16:51:52 +00:00
|
|
|
|
jsr IRQ.VBL.MRM READMOUSE
|
2018-04-10 15:03:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.IrqH.Switch inc IRQ.Tick
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
bit A2osX.F A2osX.F.PMODE .EQ %01000000
|
|
|
|
|
bvc .8
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
lda IRQ.InKernel keep V flag set
|
2018-04-12 15:45:31 +00:00
|
|
|
|
bmi .9
|
2018-04-10 15:03:29 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
lda #$A0+'S
|
|
|
|
|
eor SYS.BASL0+37
|
2018-04-13 15:18:48 +00:00
|
|
|
|
sta SYS.BASL0+37
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.STATS
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pPs),y
|
2018-04-10 15:03:29 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
.8 clc exit with V flag set
|
2017-02-06 17:04:03 +00:00
|
|
|
|
rts
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
|
|
|
|
.9 clv
|
|
|
|
|
clc
|
|
|
|
|
rts
|
2017-09-21 15:29:45 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
K.IrqH.DEV >LDYAI Dev.Table
|
2017-02-06 17:04:03 +00:00
|
|
|
|
>STYA $fe
|
|
|
|
|
|
2017-01-25 16:18:35 +00:00
|
|
|
|
ldx DevMgr.Count
|
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.4 ldy #S.DEV.S
|
2015-12-10 18:53:30 +00:00
|
|
|
|
lda ($fe),y
|
2017-02-02 17:30:07 +00:00
|
|
|
|
and #S.DEV.S.IRQ
|
2017-06-02 15:14:42 +00:00
|
|
|
|
beq .6
|
2017-02-02 17:30:07 +00:00
|
|
|
|
|
2017-01-25 16:18:35 +00:00
|
|
|
|
phx
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr K.IrqHJMP
|
2017-01-25 16:18:35 +00:00
|
|
|
|
plx
|
2015-12-10 18:53:30 +00:00
|
|
|
|
bcc .8 CC, IRQ cleared by device
|
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.6 lda $fe
|
2017-02-02 17:30:07 +00:00
|
|
|
|
clc
|
|
|
|
|
adc #S.DEV
|
2015-12-10 18:53:30 +00:00
|
|
|
|
sta $fe
|
2017-06-02 15:14:42 +00:00
|
|
|
|
bcc .7
|
2015-12-10 18:53:30 +00:00
|
|
|
|
inc $ff
|
2017-02-02 17:30:07 +00:00
|
|
|
|
|
2017-06-02 15:14:42 +00:00
|
|
|
|
.7 dex
|
|
|
|
|
bne .4
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
.8 clv clear V (no task switching)
|
|
|
|
|
rts
|
2017-01-25 16:18:35 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-10 15:03:29 +00:00
|
|
|
|
K.IRQ.OldFFFE .BS 2
|
2017-02-06 17:04:03 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
K.IrqHJMP ldx #DEVMGR.IRQ
|
2017-03-15 16:44:15 +00:00
|
|
|
|
jmp ($fe)
|
2015-12-10 18:53:30 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2017-03-29 15:48:15 +00:00
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
2015-12-10 18:53:30 +00:00
|
|
|
|
ASM
|