Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-09-24 17:31:48 +02:00
parent b5a45c1101
commit 020bfcdcbf
6 changed files with 294 additions and 111 deletions

Binary file not shown.

View File

@ -8,13 +8,20 @@ NEW
.INB inc/macros.i .INB inc/macros.i
.INB inc/a2osx.i .INB inc/a2osx.i
.INB inc/kernel.i .INB inc/kernel.i
*--------------------------------------
DEFAULT.TIMEOUT .EQ 60
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR ZPBIN .OR ZPBIN
ZS.START ZS.START
ZPPtr1 .BS 2 ZPPtr1 .BS 2
ArgPtr .BS 2
Count .BS 1 Count .BS 1
Index .BS 1 Index .BS 1
Timeout .BS 4
bSec .BS 1
bTimeout .BS 1
bRestart .BS 1
ZS.END .ED ZS.END .ED
*-------------------------------------- *--------------------------------------
* File Header (16 Bytes) * File Header (16 Bytes)
@ -23,7 +30,7 @@ CS.START cld
jmp (.1,x) jmp (.1,x)
.DA #$61 6502,Level 1 (65c02) .DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1 .DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT .DA #S.PS.F.EVENT
.DA #0 .DA #0
.DA CS.END-CS.START Code Size (without Constants) .DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize .DA DS.END-DS.START Data SegmentSize
@ -35,9 +42,10 @@ CS.START cld
*-------------------------------------- *--------------------------------------
.1 .DA CS.INIT .1 .DA CS.INIT
.DA CS.RUN .DA CS.RUN
.DA CS.DOEVENT .DA CS.DOEVENT
.DA CS.QUIT .DA CS.QUIT
L.MSG.USAGE .DA MSG.USAGE L.MSG.USAGE .DA MSG.USAGE
L.MSG.CRLF .DA MSG.CRLF
L.MSG.SHUTDOWN .DA MSG.SHUTDOWN L.MSG.SHUTDOWN .DA MSG.SHUTDOWN
L.MSG.PS .DA MSG.PS L.MSG.PS .DA MSG.PS
L.MSG.DEV .DA MSG.DEV L.MSG.DEV .DA MSG.DEV
@ -46,63 +54,151 @@ L.MSG.DEV .DA MSG.DEV
CS.INIT clc CS.INIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN >LDYA L.MSG.SHUTDOWN CS.RUN lda #DEFAULT.TIMEOUT
>SYSCALL PutS sta Timeout
.1 inc Index
lda Index
>SYSCALL ArgV
bcs .8
>STYA ZPPtr1
>DEBUG
lda (ZPPtr1)
cmp #'-'
beq .2
lda ArgPtr+1
bne .9
>LDYA ZPPtr1
>STYA ArgPtr
bra .1
.2 ldy #2
lda (ZPPtr1),y
bne .9
dey
lda (ZPPtr1),y
cmp #'a'
bcc .3
cmp #'z'+1
bcs .3
eor #$20
.3 cmp #'T'
bne .4
inc Index
lda Index
>SYSCALL ArgV
bcs .9
>SYSCALL atol
bcs .9
>PULLL Timeout
bra .1
.4 cmp #'R'
bne .9
sec
ror bRestart
bra .1
.8 jsr CS.RUN.WAIT
bcs .99
jsr CS.RUN.PS jsr CS.RUN.PS
jsr CS.RUN.DEV jsr CS.RUN.DEV
>PUSHBI 1 >PUSHBI 1
>PUSHBI 1 INITD * lda #1 INITD
>SYSCALL Kill >SYSCALL Kill
lda #0 lda #0
sec sec
.99 rts
*--------------------------------------
.9 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
rts
*--------------------------------------
CS.RUN.WAIT >PUSHW L.MSG.SHUTDOWN
>PUSHL Timeout
>PUSHBI 4
>SYSCALL PrintF
.1 >SLEEP
lda bSec
bpl .1
stz bSec
lda bTimeout
bpl CS.RUN.WAIT
>PUSHW L.MSG.CRLF
>PUSHBI 0
>SYSCALL PrintF
clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.PS stz Count CS.RUN.PS stz Count
ldx #0 ldx #0
stx Index stx Index
.1 lda PS.Table.hPS,x .1 lda PS.Table.hPS,x
beq .7 beq .7
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPPtr1 >STYA ZPPtr1
.2 lda (ZPPtr1) .2 lda (ZPPtr1)
bpl .4 HOLD ? bpl .4 HOLD ?
ldy #S.PS.CPID ldy #S.PS.CPID
lda (ZPPtr1),y lda (ZPPtr1),y
.3 jsr CS.GetPSByID .3 jsr CS.GetPSByID
bra .2 bra .2
.4 ldy #S.PS.S .4 ldy #S.PS.S
lda (ZPPtr1),y lda (ZPPtr1),y
cmp #S.PS.S.QUIT cmp #S.PS.S.QUIT
beq .6 beq .6
ldy #S.PS.PID ldy #S.PS.PID
lda (ZPPtr1),y lda (ZPPtr1),y
beq .7 don't kill PS0 beq .7 don't kill PS0
cmp #1 cmp #1
beq .7 don't kill INITD beq .7 don't kill INITD
cmp (pPS),y don't kill myself cmp (pPS),y don't kill myself
beq .7 beq .7
jsr CS.RUN.KILL jsr CS.RUN.KILL
.5 ldy #S.PS.PPID .5 ldy #S.PS.PPID
lda (ZPPtr1),y lda (ZPPtr1),y
bne .3 go kill parent if not 0 bne .3 go kill parent if not 0
.6 inc Count .6 inc Count
.7 >SLEEP .7 >SLEEP
@ -111,10 +207,10 @@ CS.RUN.PS stz Count
ldx Index ldx Index
cpx #K.PS.MAX cpx #K.PS.MAX
bne .1 bne .1
lda Count lda Count
bne CS.RUN.PS bne CS.RUN.PS
sec sec
rts rts
*-------------------------------------- *--------------------------------------
@ -122,17 +218,17 @@ CS.RUN.KILL >PUSHW L.MSG.PS
ldy #S.PS.PID ldy #S.PS.PID
lda (ZPPtr1),y lda (ZPPtr1),y
>PUSHA >PUSHA
ldy #S.PS.hARGV ldy #S.PS.hARGV
lda (ZPPtr1),y lda (ZPPtr1),y
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>PUSHYA >PUSHYA
>PUSHBI 3 >PUSHBI 3
>SYSCALL PrintF >SYSCALL PrintF
>PUSHBI 1 >PUSHBI 1
ldy #S.PS.PID ldy #S.PS.PID
lda (ZPPtr1),y lda (ZPPtr1),y
>SYSCALL Kill >SYSCALL Kill
@ -140,7 +236,7 @@ CS.RUN.KILL >PUSHW L.MSG.PS
*-------------------------------------- *--------------------------------------
CS.RUN.DEV ldx #1 CS.RUN.DEV ldx #1
stx Index stx Index
.1 lda Dev.Table-1,x .1 lda Dev.Table-1,x
sta ZPPtr1 sta ZPPtr1
lda Dev.Table,x lda Dev.Table,x
@ -149,7 +245,7 @@ CS.RUN.DEV ldx #1
>PUSHW L.MSG.DEV >PUSHW L.MSG.DEV
>PUSHB Index >PUSHB Index
lda ZPPtr1 lda ZPPtr1
clc clc
adc #S.FD.DEV adc #S.FD.DEV
@ -157,18 +253,18 @@ CS.RUN.DEV ldx #1
lda ZPPtr1+1 lda ZPPtr1+1
adc /S.FD.DEV adc /S.FD.DEV
>PUSHYA >PUSHYA
>PUSHBI 3 >PUSHBI 3
>SYSCALL PrintF >SYSCALL PrintF
.7 inc Index .7 inc Index
inc Index inc Index
ldx Index ldx Index
cpx #K.DEV.MAX*2+1 cpx #K.DEV.MAX*2+1
bne .1 bne .1
rts rts
*-------------------------------------- *--------------------------------------
CS.GetPSByID ldx #0 CS.GetPSByID ldx #0
@ -183,34 +279,59 @@ CS.GetPSByID ldx #0
>SYSCALL GetMemPtr >SYSCALL GetMemPtr
>STYA ZPPtr1 >STYA ZPPtr1
plx plx
pla pla
ldy #S.PS.PID ldy #S.PS.PID
cmp (ZPPtr1),y cmp (ZPPtr1),y
beq .8 beq .8
.7 inx .7 inx
cpx #K.PS.MAX cpx #K.PS.MAX
bne .1 bne .1
* sec * sec
rts rts
.8 clc .8 clc
rts rts
*-------------------------------------- *--------------------------------------
CS.DOEVENT sec CS.DOEVENT lda (pEvent)
bpl .9
asl
bpl .9
sta bSec
ldx #4
ldy #0
clc
.1 lda Timeout,y
sbc #0
sta Timeout,y
iny
dex
bne .1
ror
eor #$80
sta bTimeout
.9 sec
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT clc CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.END CS.END
MSG.USAGE .AS "Usage : SHUTDOWN <NEXT.STSTEM>\r\n" MSG.USAGE .AS "Usage : SHUTDOWN <NEXT.STSTEM>\r\n"
.AZ " -T <seconds> : \r\n" .AS " -R : Restart System\r\n"
MSG.SHUTDOWN .AZ "SHUTDOWN:System..." .AS " -T <seconds> : default to 60"
MSG.CRLF .AZ "\r\n"
MSG.SHUTDOWN .AZ "\r\e[KSHUTDOWN:System will stop in %u seconds..."
MSG.PS .AZ "SHUTDOWN:Killing process %3d, %s\r\n" MSG.PS .AZ "SHUTDOWN:Killing process %3d, %s\r\n"
MSG.DEV .AZ "SHUTDOWN:Closing device %3d, %s\r\n" MSG.DEV .AZ "SHUTDOWN:Closing device %3d, %s\r\n"
*-------------------------------------- *--------------------------------------

View File

@ -1,15 +1,9 @@
NEW NEW
AUTO 3,1 AUTO 3,1
*-------------------------------------- *--------------------------------------
CORE.Quit ldx #5 CORE.Run ldx #1
.1 stz K.MLI.PARAMS,x bra .80 Skip PS0
dex
bpl .1
>MLICALL MLIQUIT
*--------------------------------------
CORE.Run ldx #1 Skip PS0
.1 stx CORE.PSIndex .1 stx CORE.PSIndex
@ -64,8 +58,10 @@ CORE.Run ldx #1 Skip PS0
>PUSHBI 2 >PUSHBI 2
ldy #S.PS.PID ldy #S.PS.PID
lda (pPS),y lda (pPS),y
* cmp #1 INITD ? cmp #1 INITD ?
* beq CORE.Quit bne .6
jmp CORE.Quit
.6 >SYSCALL2 Kill .6 >SYSCALL2 Kill
bra .8 bra .8
@ -74,7 +70,7 @@ CORE.Run ldx #1 Skip PS0
.8 ldx CORE.PSIndex .8 ldx CORE.PSIndex
inx inx
cpx CORE.PSCount .80 cpx CORE.PSCount
bne .1 bne .1
*-------------------------------------- *--------------------------------------
CORE.Events jsr CORE.GetEvents CORE.Events jsr CORE.GetEvents
@ -132,6 +128,23 @@ CORE.Events jsr CORE.GetEvents
>SYSCALL2 IOCTL >SYSCALL2 IOCTL
.8 jmp CORE.Run .8 jmp CORE.Run
*-------------------------------------- *--------------------------------------
CORE.Quit jsr CORE.IRQ.None.Off
lda IRQ.INTNUM
sta K.MLI.PARAMS+1
>MLICALL MLIDEALLOCIRQ
ldx #5
.1 stz K.MLI.PARAMS+1,x
dex
bpl .1
lda #4
ldx #MLIQUIT
jmp GP.MLICall
*--------------------------------------
CORE.UpdateParentPS CORE.UpdateParentPS
tax save RC From INIT or RUN tax save RC From INIT or RUN
@ -243,7 +256,8 @@ CORE.GetEvents lda #Evt.Table
* CC: Event Cleared * CC: Event Cleared
*-------------------------------------- *--------------------------------------
CORE.Dispatch ldx #1 skip PS0 CORE.Dispatch ldx #1 skip PS0
bra .80
.1 stx CORE.PSIndex .1 stx CORE.PSIndex
lda PS.Table.hPS,x lda PS.Table.hPS,x
@ -296,9 +310,11 @@ CORE.Dispatch ldx #1 skip PS0
.5 ldx CORE.PSIndex .5 ldx CORE.PSIndex
inx inx
cpx CORE.PSCount .80 cpx CORE.PSCount
bne .1 bne .1
* sec * sec
rts rts
*-------------------------------------- *--------------------------------------
* X unmodified * X unmodified
@ -474,40 +490,43 @@ CORE.EvtIndex .BS 1
CORE.EvtCount .BS 1 CORE.EvtCount .BS 1
*-------------------------------------- *--------------------------------------
* Called by : * Called by :
* - Kernel K.IrqHAuxLC * - Kernel IRQ Manager (AuxLC)
* - ProDOS IRQ Manager (GP) * - ProDOS IRQ Manager (GP)
*-------------------------------------- *--------------------------------------
K.IrqH.IIGS lda IO.IIGS.INTFLAG CORE.IRQ.IIGS lda IO.IIGS.INTFLAG
and #$08 and #$08
beq K.IrqH.DEV beq CORE.IRQ.DEV
stz IO.IIGS.CLRVBLINT stz IO.IIGS.CLRVBLINT
bra K.IrqH.Switch bra CORE.IRQ.Switch
*-------------------------------------- *--------------------------------------
K.IrqH.TCLOCK ldy IRQ.VBL.n0 CORE.IRQ.TCLOCK ldy IRQ.VBL.n0
lda $c080,y lda $c080,y
and #$20 and #$20
beq K.IrqH.DEV beq CORE.IRQ.DEV
lda $c088,y lda $c088,y
lda $c080,y lda $c080,y
bra K.IrqH.Switch bra CORE.IRQ.Switch
*-------------------------------------- *--------------------------------------
K.IrqH.VBL CORE.IRQ.MOUSE jsr $FFFF SELF MODIFIED,SERVEMOUSE
K.IrqH.VBL.MSM jsr $FFFF SELF MODIFIED,SERVEMOUSE bcs CORE.IRQ.DEV Not From Mouse
bcs K.IrqH.DEV Not From Mouse
ldx IRQ.VBL.0n ldx IRQ.VBL.0n
lda MOUSESTSx,x lda MOUSESTSx,x
and #MOUSESTSx.INTVBL IRQ was caused by VBL ? and #MOUSESTSx.INTVBL IRQ was caused by VBL ?
beq K.IrqH.DEV beq CORE.IRQ.DEV
ldx K.IrqH.VBL.MRM+2 $Cn
ldx CORE.IRQ.MOUSE.2+2 $Cn
ldy IRQ.VBL.n0 ldy IRQ.VBL.n0
K.IrqH.VBL.MRM jsr $FFFF SELF MODIFIED,READMOUSE
CORE.IRQ.MOUSE.2
jsr $FFFF SELF MODIFIED,READMOUSE
*-------------------------------------- *--------------------------------------
K.IrqH.Switch inc IRQ.Tick CORE.IRQ.Switch inc IRQ.Tick
dec CORE.CPUStatCnt dec CORE.CPUStatCnt
bne .2 bne .2
@ -547,7 +566,7 @@ K.IrqH.Switch inc IRQ.Tick
.8 clc exit with V flag set .8 clc exit with V flag set
rts rts
*-------------------------------------- *--------------------------------------
K.IrqH.DEV ldx #0 CORE.IRQ.DEV ldx #0
.1 lda IRQ.Vectors+1,x .1 lda IRQ.Vectors+1,x
beq .9 beq .9
sta .10+2 sta .10+2
@ -565,6 +584,30 @@ K.IrqH.DEV ldx #0
.8 clv clear V (no task switching) .8 clv clear V (no task switching)
rts rts
*-------------------------------------- *--------------------------------------
CORE.IRQ.IIGS.Off
lda #$08
trb IO.IIGS.INTEN
rts
CORE.IRQ.TCLOCK.Off
ldx IRQ.VBL.n0
stz $c080,x
ldx IRQ.VBL.0n
sta CLRPAGE2
stz $478,x
stz $7f8,x
rts
CORE.IRQ.MOUSE.Off
ldy CORE.IRQ.MOUSE.Off.1+2 Cn
ldy IRQ.VBL.n0
lda #0
CORE.IRQ.MOUSE.Off.1
jmp $ffff SELF MODIFIED
CORE.IRQ.None.Off
rts
*--------------------------------------
IRQ.InKernel .BS 1 IRQ.InKernel .BS 1
IRQ.InLib .BS 1 IRQ.InLib .BS 1
IRQ.SkipA2osX .BS 1 IRQ.SkipA2osX .BS 1

View File

@ -373,17 +373,17 @@ GO.EXIT.JMP jmp $FFFF SELF MODIFIED
* must exit with RTS * must exit with RTS
* - CC if IRQ cleared, CS if NOT * - CC if IRQ cleared, CS if NOT
*-------------------------------------- *--------------------------------------
GP.IrqH cld GP.IRQ cld
bit IRQ.SkipA2osX After A2osX IRQ.H ? bit IRQ.SkipA2osX After A2osX IRQ.H ?
bmi GP.IrqH.Exit bmi GP.IRQ.Exit
sta SETALTZP switch to aux LC sta SETALTZP switch to aux LC
tsx tsx
stx A2osX.SaveSM stx A2osX.SaveSM
ldx A2osX.SaveSX ldx A2osX.SaveSX
txs txs
GP.IrqH.JSR jsr K.IrqH.DEV SELF MODIFIED GP.IRQ.JSR jsr CORE.IRQ.DEV SELF MODIFIED
tsx go back to Main tsx go back to Main
stx A2osX.SaveSX stx A2osX.SaveSX
ldx A2osX.SaveSM ldx A2osX.SaveSM
@ -391,7 +391,7 @@ GP.IrqH.JSR jsr K.IrqH.DEV SELF MODIFIED
sta CLRALTZP sta CLRALTZP
rts rts
GP.IrqH.Exit stz IRQ.SkipA2osX reset flag GP.IRQ.Exit stz IRQ.SkipA2osX reset flag
sec sec
rts rts
*-------------------------------------- *--------------------------------------

View File

@ -22,7 +22,7 @@ Kernel.Init2 sei
>LDYA PAKME.MAIN >LDYA PAKME.MAIN
>STYA ZPInBufPtr >STYA ZPInBufPtr
>LDYAI CORE.Run >LDYAI A2osX.EndTables
jsr A2osX.Unpak jsr A2osX.Unpak
>LDYA PAKME.AUX >LDYA PAKME.AUX
@ -595,6 +595,7 @@ CPU.Init.Z80 >PUSHWI MSG.Z80
>PUSHBI 1 >PUSHBI 1
>SYSCALL2 printf >SYSCALL2 printf
rts rts
.9 >LDYAI MSG.Z80.KO .9 >LDYAI MSG.Z80.KO
>SYSCALL2 puts >SYSCALL2 puts
rts rts
@ -793,7 +794,7 @@ DevMgrInit.AddBDev
>PUSHWI FD.BDEV >PUSHWI FD.BDEV
>PUSHWI FD.BDEV.NAME >PUSHWI FD.BDEV.NAME
>SYSCALL2 MKDev >SYSCALL2 MKDev
DevMgrInit.AddBDev.RTS
rts rts
*-------------------------------------- *--------------------------------------
* Setup AuxLC $FFFE->Kernel IRQ Handler * Setup AuxLC $FFFE->Kernel IRQ Handler
@ -805,11 +806,11 @@ IrqMgrInit >LDYAI MSG.IRQ
php php
sei sei
>LDYA $FFFE >LDYA $FFFE
>STYA K.IrqHAuxLC.JMP+1 >STYA IRQ.JMP+1
>LDYAI K.IrqHAuxLC >LDYAI IRQ.Handler
>STYA $FFFE >STYA $FFFE
>LDYAI GP.IrqH >LDYAI GP.IRQ
>STYA K.MLI.PARAMS+2 >STYA K.MLI.PARAMS+2
>MLICALL MLIALLOCIRQ >MLICALL MLIALLOCIRQ
@ -831,12 +832,19 @@ IrqMgrInit >LDYAI MSG.IRQ
jsr IrqMgrInit.HZ2Tick jsr IrqMgrInit.HZ2Tick
>LDYAI K.IrqH.IIGS >LDYAI CORE.IRQ.IIGS
jsr IrqMgrInit.SetV jsr IrqMgrInit.SetV
>LDYAI CORE.IRQ.IIGS.Off
>STYA CORE.Quit+1
>LDYAI MSG.IRQ.IIGS >LDYAI MSG.IRQ.IIGS
bra .8 bra .8
.9 plp
sec
rts
.1 cmp #A2osX.HWType.IIc .1 cmp #A2osX.HWType.IIc
beq .2 beq .2
@ -845,9 +853,12 @@ IrqMgrInit >LDYAI MSG.IRQ
lda #"C" lda #"C"
sta IRQ.Mode sta IRQ.Mode
>LDYAI K.IrqH.TCLOCK >LDYAI CORE.IRQ.TCLOCK
jsr IrqMgrInit.SetV jsr IrqMgrInit.SetV
>LDYAI CORE.IRQ.TCLOCK.Off
>STYA CORE.Quit+1
>LDYAI MSG.IRQ.CLOCK >LDYAI MSG.IRQ.CLOCK
bra .8 bra .8
@ -856,10 +867,13 @@ IrqMgrInit >LDYAI MSG.IRQ
lda #"V" lda #"V"
sta IRQ.Mode sta IRQ.Mode
>LDYAI K.IrqH.VBL >LDYAI CORE.IRQ.MOUSE
jsr IrqMgrInit.SetV jsr IrqMgrInit.SetV
>LDYAI MSG.IRQ.VBL >LDYAI CORE.IRQ.MOUSE.Off
>STYA CORE.Quit+1
>LDYAI MSG.IRQ.MOUSE
bra .8 bra .8
.3 jsr IrqMgrInit.HZ2Tick .3 jsr IrqMgrInit.HZ2Tick
@ -871,13 +885,9 @@ IrqMgrInit >LDYAI MSG.IRQ
.8 >SYSCALL2 puts .8 >SYSCALL2 puts
clc clc
rts rts
.9 plp
sec
rts
*-------------------------------------- *--------------------------------------
IrqMgrInit.SetV >STYA K.IrqHAuxLC.JSR+1 IrqMgrInit.SetV >STYA IRQ.JSR+1
>STYA GP.IrqH.JSR+1 >STYA GP.IRQ.JSR+1
rts rts
*-------------------------------------- *--------------------------------------
IrqMgrInit.TClock IrqMgrInit.TClock
@ -915,12 +925,15 @@ IrqMgrInit.TClock
sty IRQ.VBL.n0 sty IRQ.VBL.n0
lda #A2osX.S.CLK lda #A2osX.S.CLK
sta A2osX.S,x sta A2osX.S,x
php php
sei sei
lda #$40+$20 Enable interrupt + 64Hz lda #$40+$20 Enable interrupt + 64Hz
sta $c080,y sta $c080,y
lda #$40
sta CLRPAGE2 sta CLRPAGE2
lda #$40
sta $478,x sta $478,x
sta $7f8,x sta $7f8,x
@ -959,8 +972,9 @@ IrqMgrInit.Mouse
.4 lda ZPPtr1+1 .4 lda ZPPtr1+1
sta .11+2 sta .11+2
sta K.IrqH.VBL.MSM+2 sta CORE.IRQ.MOUSE.Off.1+2
sta K.IrqH.VBL.MRM+2 sta CORE.IRQ.MOUSE+2
sta CORE.IRQ.MOUSE.2+2
and #$0f and #$0f
sta IRQ.VBL.0n sta IRQ.VBL.0n
asl asl
@ -975,7 +989,10 @@ IrqMgrInit.Mouse
bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly bit RROMBNK2 Renable ROM to allow MOUSE II firmware works properly
ldy #INITMOUSE ldy #INITMOUSE
jsr .10 jsr .10
ldy #SETMOUSE ldy #SETMOUSE
lda (ZPPtr1),y
sta CORE.IRQ.MOUSE.Off.1+1
lda #MOUSEMODx.INTVBL+MOUSEMODx.ACTIVE lda #MOUSEMODx.INTVBL+MOUSEMODx.ACTIVE
jsr .10 jsr .10
@ -983,17 +1000,19 @@ IrqMgrInit.Mouse
bit RRAMWRAMBNK1 bit RRAMWRAMBNK1
ldy #SERVEMOUSE ldy #SERVEMOUSE
lda (ZPPtr1),y lda (ZPPtr1),y
sta K.IrqH.VBL.MSM+1 sta CORE.IRQ.MOUSE+1
ldy #READMOUSE ldy #READMOUSE
lda (ZPPtr1),y lda (ZPPtr1),y
sta K.IrqH.VBL.MRM+1 sta CORE.IRQ.MOUSE.2+1
jsr IrqMgrInit.HZ2Tick jsr IrqMgrInit.HZ2Tick
dec CORE.IRQMode dec CORE.IRQMode
plp plp
clc clc
rts rts
.9 plp .9 plp
sec sec
rts rts
@ -1196,7 +1215,7 @@ DRV.BLKDEV .DA DRV.RamDrive
*-------------------------------------- *--------------------------------------
MSG.IRQ .AZ "Interrupt Manager..." MSG.IRQ .AZ "Interrupt Manager..."
MSG.IRQ.IIGS .AZ " Apple IIgs VBL IRQ Activated." MSG.IRQ.IIGS .AZ " Apple IIgs VBL IRQ Activated."
MSG.IRQ.VBL .AZ " Mouse Card VBL IRQ Activated." MSG.IRQ.MOUSE .AZ " Mouse Card VBL IRQ Activated."
MSG.IRQ.CLOCK .AZ " Clock Card IRQ Activated." MSG.IRQ.CLOCK .AZ " Clock Card IRQ Activated."
MSG.IRQ.POLL .AZ " Polling Mode." MSG.IRQ.POLL .AZ " Polling Mode."
MSG.EVT .AZ "Event Manager..." MSG.EVT .AZ "Event Manager..."

View File

@ -12,19 +12,19 @@ NEW
*-------------------------------------- *--------------------------------------
MSLOT .EQ $7f8 MSLOT .EQ $7f8
*-------------------------------------- *--------------------------------------
K.IrqHAuxLC.BRK jmp K.IrqHAuxLC.6 *IRQ.BRK jmp IRQ.6
*-------------------------------------- *--------------------------------------
K.IrqHAuxLC cld IRQ.Handler cld
sta K.IrqHAuxLC.6+1 sta IRQ.6+1
pla pla
pha pha
and #$10 BRK? and #$10 BRK?
* bne K.IrqHAuxLC.BRK * bne IRQ.BRK
bne * bne *
stx K.IrqHAuxLC.5+1 stx IRQ.5+1
sty K.IrqHAuxLC.4+1 sty IRQ.4+1
lda RDPAGE2 lda RDPAGE2
pha pha
@ -43,7 +43,7 @@ K.IrqHAuxLC cld
pha pha
sta CLRCXROM Enable access to slot C800 space sta CLRCXROM Enable access to slot C800 space
K.IrqHAuxLC.JSR jsr K.IrqH.DEV SELF MODIFIED IRQ.JSR jsr CORE.IRQ.DEV SELF MODIFIED
ldx #CLRCXROM ldx #CLRCXROM
@ -56,17 +56,17 @@ K.IrqHAuxLC.JSR jsr K.IrqH.DEV SELF MODIFIED
pla Get back MSLOT pla Get back MSLOT
sta MSLOT sta MSLOT
sta K.IrqHAuxLC.2+2 sta IRQ.2+2
and #$F0 and #$F0
eor #$C0 ....mmm...not looking like Cn.... eor #$C0 ....mmm...not looking like Cn....
bne K.IrqHAuxLC.3 bne IRQ.3
sta $CFFF Release $C800 sta $CFFF Release $C800
K.IrqHAuxLC.2 lda $ff00 SELF MODIFIED IRQ.2 lda $ff00 SELF MODIFIED
K.IrqHAuxLC.3 pla Must keep Carry IRQ.3 pla Must keep Carry
bpl .1 bpl .1
sta SETWRITEAUX sta SETWRITEAUX
@ -88,7 +88,7 @@ K.IrqHAuxLC.3 pla Must keep Carry
sta SETPAGE2 sta SETPAGE2
.30 bvc K.IrqHAuxLC.4 if not V, skip task switching .30 bvc IRQ.4 if not V, skip task switching
tsx Check Stack if before "dec IRQ.InKernel" tsx Check Stack if before "dec IRQ.InKernel"
cpx #$fc $1ff-PChi-PClo-P = $1fc cpx #$fc $1ff-PChi-PClo-P = $1fc
@ -123,15 +123,15 @@ K.IrqHAuxLC.3 pla Must keep Carry
.8 clc .8 clc
K.IrqHAuxLC.4 ldy #$ff Self Modified IRQ.4 ldy #$ff Self Modified
K.IrqHAuxLC.5 ldx #$ff Self Modified IRQ.5 ldx #$ff Self Modified
K.IrqHAuxLC.6 lda #$ff Self Modified IRQ.6 lda #$ff Self Modified
bcc K.IrqHAuxLC.8 bcc IRQ.8
dec IRQ.SkipA2osX Make regular ProDOS IRQ manager skip A2osX dec IRQ.SkipA2osX Make regular ProDOS IRQ manager skip A2osX
K.IrqHAuxLC.JMP jmp $FFFF SELF MODIFIED Not handled, pass to ProDOS IRQ.JMP jmp $FFFF SELF MODIFIED Not handled, pass to ProDOS
K.IrqHAuxLC.8 rti IRQ.8 rti
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE USR/SRC/SYS/KERNEL.S.IRQ SAVE USR/SRC/SYS/KERNEL.S.IRQ