A2osX/SYS/KERNEL.S.IRQ.txt

131 lines
2.5 KiB
Plaintext
Raw Normal View History

PR#3
PREFIX /A2OSX.BUILD
LOMEM $A00
INC 1
AUTO 6
*--------------------------------------
* 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
*--------------------------------------
2016-09-21 15:20:37 +00:00
K.IrqHandlerAuxLC
sta K.IrqMgr.A
pla
pha
and #$10 BRK?
beq .10
bra *
2016-09-21 15:20:37 +00:00
lda K.IrqMgr.A
.82 jmp (K.IrqMgrOldFFFE)
2016-09-21 15:20:37 +00:00
.10 stx K.IrqMgr.X
sty K.IrqMgr.Y
lda $fe
pha
lda $ff
pha
lda RDREADAUX
pha
sta CLRREADAUX Make sure we can access DevMgr.Table
jsr K.IrqHandler
pla Must keep Carry
bpl .81
sta SETREADAUX
.81 pla
sta $ff
pla
sta $fe
ldy K.IrqMgr.Y
ldx K.IrqMgr.X
lda K.IrqMgr.A
bcs .82
rti
*--------------------------------------
K.IrqMgrOldFFFE .BS 2
K.IrqMgr.A .BS 1
K.IrqMgr.X .BS 1
K.IrqMgr.Y .BS 1
K.IrkMgr.VBL .BS 1
K.IrkMgr.VBLINT .BS 1
*--------------------------------------
* Called by :
* Kernel IrqHandlerAuxLC
* ProDOS IRQ Manager (GP)
*--------------------------------------
K.IrqHandler lda K.IrkMgr.VBL
beq K.IrqHandler.DEV 0, totally disabled....
K.IrqHandler.VBL
jsr K.IrqMgrVBL.MSM SERVEMOUSE
bcs K.IrqHandler.DEV Not From Mouse
ldx K.IrqMgrVBL.0n
lda $778,x
and #$08 IRQ was caused by VBL ?
beq K.IrqHandler.DEV
ldx K.IrqMgrVBL.MRM+2 $Cn
ldy K.IrqMgrVBL.n0
jsr K.IrqMgrVBL.MRM READMOUSE
inc K.IrkMgr.VBLINT
lda SYS.BASL0+37
eor #$80
sta SYS.BASL0+37
sec
ror K.IrkMgr.VBL Confirm VBL signal valid for EvtMgr
clc
rts
*--------------------------------------
K.IrqHandler.DEV
>LDYAI DevMgr.Table
>STYA $fe
ldx DevMgr.Count
.4 ldy #S.DEV.S
lda ($fe),y
and #S.DEV.S.IRQ
beq .6
phx
2016-09-21 15:20:37 +00:00
jsr K.IrqHandlerJMP
plx
bcc .8 CC, IRQ cleared by device
.6 lda $fe
clc
adc #S.DEV
sta $fe
bcc .7
inc $ff
.7 dex
bne .4
sec
.8 rts
*--------------------------------------
K.IrqMgrVBL.n0 .BS 1
K.IrqMgrVBL.0n .BS 1
K.IrqMgrVBL.MSM jmp $0000
K.IrqMgrVBL.MRM jmp $0000
*--------------------------------------
K.IrqHandlerJMP ldx #DEVMGR.IRQ
jmp ($fe)
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.IRQ
LOAD /A2OSX.SRC/SYS/KERNEL.S
ASM