mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 22:54:59 +00:00
152 lines
2.9 KiB
Plaintext
152 lines
2.9 KiB
Plaintext
NEW
|
||
PREFIX /A2OSX.BUILD
|
||
AUTO 4,1
|
||
*--------------------------------------
|
||
* 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
|
||
*--------------------------------------
|
||
MSLOT .EQ $7f8
|
||
*--------------------------------------
|
||
K.IrqHAuxLC sta .6+1
|
||
pla
|
||
pha
|
||
and #$10 BRK?
|
||
bne .7
|
||
|
||
stx .5+1
|
||
sty .4+1
|
||
|
||
lda $fe Save 2 bytes in ZP
|
||
pha
|
||
lda $ff
|
||
pha
|
||
|
||
lda MSLOT Save MSLOT
|
||
pha
|
||
|
||
lda RDREADAUX
|
||
pha
|
||
sta CLRREADAUX Make sure we can access Dev.Table
|
||
|
||
jsr K.IrqH
|
||
|
||
pla Must keep Carry
|
||
bpl .1
|
||
sta SETREADAUX
|
||
|
||
.1 pla Get back MSLOT
|
||
sta MSLOT
|
||
sta .2+2
|
||
|
||
and #$C0
|
||
eor #$C0 ....mmm...not looking link Cn....
|
||
bne .3
|
||
sta $CFFF Release $C800
|
||
|
||
.2 lda $ff00 SELF MODIFIED
|
||
|
||
.3 pla
|
||
sta $ff
|
||
pla
|
||
sta $fe
|
||
|
||
.4 ldy #$ff Self Modified
|
||
.5 ldx #$ff Self Modified
|
||
.6 lda #$ff Self Modified
|
||
bcs .8
|
||
rti
|
||
|
||
.7 pla pull P
|
||
bra *
|
||
|
||
.8 jmp (IRQ.OldFFFE)
|
||
*--------------------------------------
|
||
* Called by :
|
||
* - Kernel K.IrqHAuxLC
|
||
* - ProDOS IRQ Manager (GP)
|
||
*--------------------------------------
|
||
K.IrqH jmp K.IrqH.DEV Modified by INIT
|
||
*--------------------------------------
|
||
K.IrqH.TCLOCK ldy IRQ.VBL.n0
|
||
|
||
lda $c080,y
|
||
and #$20
|
||
beq K.IrqH.DEV
|
||
|
||
lda $c080,y
|
||
lda $c088,y
|
||
|
||
inc CORE.IRQTick
|
||
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
K.IrqH.VBL jsr IRQ.VBL.MSM SERVEMOUSE
|
||
bcs K.IrqH.DEV Not From Mouse
|
||
|
||
ldx IRQ.VBL.0n
|
||
lda $778,x
|
||
and #$08 IRQ was caused by VBL ?
|
||
beq K.IrqH.DEV
|
||
|
||
ldx IRQ.VBL.MRM+2 $Cn
|
||
ldy IRQ.VBL.n0
|
||
jsr IRQ.VBL.MRM READMOUSE
|
||
|
||
inc CORE.IRQTick
|
||
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
K.IrqH.DEV >LDYAI Dev.Table
|
||
>STYA $fe
|
||
|
||
ldx DevMgr.Count
|
||
|
||
.4 ldy #S.DEV.S
|
||
lda ($fe),y
|
||
and #S.DEV.S.IRQ
|
||
beq .6
|
||
|
||
phx
|
||
jsr K.IrqHJMP
|
||
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
|
||
*--------------------------------------
|
||
IRQ.IntNum .BS 1
|
||
*--------------------------------------
|
||
IRQ.OldFFFE .BS 2
|
||
*--------------------------------------
|
||
IRQ.VBL.n0 .BS 1
|
||
IRQ.VBL.0n .BS 1
|
||
IRQ.VBL.MSM jmp $0000
|
||
IRQ.VBL.MRM jmp $0000
|
||
*--------------------------------------
|
||
K.IrqHJMP ldx #DEVMGR.IRQ
|
||
jmp ($fe)
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE /A2OSX.SRC/SYS/KERNEL.S.IRQ
|
||
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
||
ASM
|