2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
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-05-18 13:59:11 +00:00
|
|
|
|
K.IrqHAuxLC.BRK jmp K.IrqHAuxLC.6
|
|
|
|
|
*--------------------------------------
|
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-07-25 15:26:14 +00:00
|
|
|
|
* bne K.IrqHAuxLC.BRK
|
|
|
|
|
bne *
|
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
|
|
|
|
|
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
|
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-05-18 13:59:11 +00:00
|
|
|
|
lda MSLOT Save MSLOT
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
lda RDCXROM
|
|
|
|
|
pha
|
|
|
|
|
sta CLRCXROM Enable access to slot C800 space
|
|
|
|
|
|
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
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
ldx #CLRCXROM
|
|
|
|
|
|
|
|
|
|
pla Get CXROM State
|
|
|
|
|
bpl .3
|
|
|
|
|
inx
|
|
|
|
|
.3 sta $C000,x
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
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
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
and #$F0
|
2018-03-29 15:29:47 +00:00
|
|
|
|
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-05-18 13:59:11 +00:00
|
|
|
|
K.IrqHAuxLC.3 pla Must keep Carry
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
sta SETWRITEAUX
|
|
|
|
|
|
|
|
|
|
.1 pla
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
sta SETREADAUX
|
|
|
|
|
|
|
|
|
|
.2 pla
|
2017-01-25 16:18:35 +00:00
|
|
|
|
sta $ff
|
|
|
|
|
pla
|
|
|
|
|
sta $fe
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
|
|
|
|
bvc K.IrqHAuxLC.4 if V, skip task switching
|
|
|
|
|
|
|
|
|
|
tsx
|
|
|
|
|
txa
|
|
|
|
|
eor #$FC Only LO,HI & P on stack
|
|
|
|
|
beq K.IrqHAuxLC.4 we are in kernel CORE.Run
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
php
|
|
|
|
|
php make room for 2 additional bytes
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
tsx
|
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
lda $104,x get RTI PC LO
|
2018-05-18 13:59:11 +00:00
|
|
|
|
bne .3
|
2018-04-20 15:06:41 +00:00
|
|
|
|
dec $105,x adjust RTI PC HI
|
2018-04-13 15:18:48 +00:00
|
|
|
|
|
2018-05-18 13:59:11 +00:00
|
|
|
|
.3 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
|
|
|
|
|
sta $101,x down 2 bytes
|
2018-04-11 15:35:51 +00:00
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
lda #$A0+'S
|
|
|
|
|
eor SYS.BASL0+37
|
|
|
|
|
sta SYS.BASL0+37
|
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
|
2018-04-28 12:10:58 +00:00
|
|
|
|
K.IrqHAuxLC.JMP jmp $FFFF SELF MODIFIED Not handled, pass to ProDOS
|
2018-04-12 15:45:31 +00:00
|
|
|
|
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 $c088,y
|
2018-12-01 19:39:44 +00:00
|
|
|
|
lda $c080,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
|
|
|
|
*--------------------------------------
|
2018-04-28 12:10:58 +00:00
|
|
|
|
K.IrqH.VBL
|
|
|
|
|
K.IrqH.VBL.MSM jsr $FFFF SELF MODIFIED,SERVEMOUSE
|
2017-11-23 16:51:52 +00:00
|
|
|
|
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
|
2018-04-27 13:43:40 +00:00
|
|
|
|
lda MOUSESTSx,x
|
|
|
|
|
and #MOUSESTSx.INTVBL 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
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
ldx K.IrqH.VBL.MRM+2 $Cn
|
2017-10-27 14:56:46 +00:00
|
|
|
|
ldy IRQ.VBL.n0
|
2018-04-28 12:10:58 +00:00
|
|
|
|
K.IrqH.VBL.MRM jsr $FFFF SELF MODIFIED,READMOUSE
|
2018-04-10 15:03:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.IrqH.Switch inc IRQ.Tick
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
dec CORE.CPUStatCnt
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
lda #100
|
2018-10-17 15:31:29 +00:00
|
|
|
|
sta CORE.CPUStatCnt
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
lda CORE.InKernelHits
|
|
|
|
|
stz CORE.InKernelHits
|
|
|
|
|
stz CORE.InKernelStats
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
ldx #K.PS.MAX-1
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.1 lda PS.Table.Hits-1,x
|
|
|
|
|
stz PS.Table.Hits-1,x
|
2018-10-17 15:31:29 +00:00
|
|
|
|
sta PS.Table.Stats-1,x
|
2018-04-26 15:38:02 +00:00
|
|
|
|
dex
|
2018-10-15 15:39:21 +00:00
|
|
|
|
bpl .1
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
|
|
|
|
.2 lda IRQ.InKernel keep V flag set
|
|
|
|
|
bpl .3
|
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
inc CORE.InKernelHits
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
|
|
|
|
.9 clv
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldx CORE.PSIndex
|
2018-10-17 15:31:29 +00:00
|
|
|
|
inc PS.Table.Hits,x
|
2018-04-26 15:38:02 +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-20 15:06:41 +00:00
|
|
|
|
lda (pPs)
|
|
|
|
|
and #S.PS.F.DOEVENT
|
|
|
|
|
bne .9
|
|
|
|
|
|
2018-04-11 15:35:51 +00:00
|
|
|
|
.8 clc exit with V flag set
|
2017-02-06 17:04:03 +00:00
|
|
|
|
rts
|
2017-09-21 15:29:45 +00:00
|
|
|
|
*--------------------------------------
|
2018-07-05 15:39:36 +00:00
|
|
|
|
K.IrqH.DEV ldx #0
|
|
|
|
|
|
2018-10-11 15:23:06 +00:00
|
|
|
|
.1 lda IRQ.Vectors+1,x
|
|
|
|
|
beq .9
|
2018-07-05 15:39:36 +00:00
|
|
|
|
|
2018-07-10 15:33:13 +00:00
|
|
|
|
sta $ff
|
2018-10-11 15:23:06 +00:00
|
|
|
|
lda IRQ.Vectors,x
|
|
|
|
|
sta $fe
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
2018-07-10 15:33:13 +00:00
|
|
|
|
ldy #S.FD.DEV.DRVPTR
|
2015-12-10 18:53:30 +00:00
|
|
|
|
lda ($fe),y
|
2018-07-05 15:39:36 +00:00
|
|
|
|
|
2018-07-10 15:33:13 +00:00
|
|
|
|
sta .10+1
|
2018-07-05 15:39:36 +00:00
|
|
|
|
iny
|
|
|
|
|
lda ($fe),y
|
|
|
|
|
sta .10+2
|
|
|
|
|
|
2018-07-10 15:33:13 +00:00
|
|
|
|
phx
|
|
|
|
|
ldx #IOCTL.IRQ
|
2018-07-05 15:39:36 +00:00
|
|
|
|
.10 jsr $ffff SELF MODIFIED
|
|
|
|
|
|
2017-01-25 16:18:35 +00:00
|
|
|
|
plx
|
2015-12-10 18:53:30 +00:00
|
|
|
|
bcc .8 CC, IRQ cleared by device
|
|
|
|
|
|
2018-07-05 15:39:36 +00:00
|
|
|
|
.2 inx
|
2018-10-11 15:23:06 +00:00
|
|
|
|
inx
|
2017-02-02 17:30:07 +00:00
|
|
|
|
|
2018-10-11 15:23:06 +00:00
|
|
|
|
.3 cpx #K.IRQDEV.MAX*2
|
2018-04-27 14:35:55 +00:00
|
|
|
|
bne .1
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
2018-10-11 15:23:06 +00:00
|
|
|
|
.9 sec
|
2017-01-25 16:18:35 +00:00
|
|
|
|
|
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-10-11 15:23:06 +00:00
|
|
|
|
IRQ.Vectors .BS K.IRQDEV.MAX*2
|
|
|
|
|
*--------------------------------------
|
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
|