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
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-15 15:39:21 +00:00
|
|
|
|
CORE.Run stz CORE.PSIndex
|
|
|
|
|
|
|
|
|
|
ldx #0
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
.1 lda PS.Table.hPS,x
|
2018-04-26 15:38:02 +00:00
|
|
|
|
beq .8
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2018-04-12 15:45:31 +00:00
|
|
|
|
>STYA pPs
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
lda (pPs) get S.PS.F
|
2017-08-29 15:19:09 +00:00
|
|
|
|
bit #S.PS.F.HOLD Waiting for Another Task to Terminate?
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.CPID
|
|
|
|
|
lda (pPs),y
|
2018-06-22 06:24:35 +00:00
|
|
|
|
jsr CORE.GetPS
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bcc .8 yes, still running....
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
lda (pPs) get S.PS.F again
|
2018-04-20 15:06:41 +00:00
|
|
|
|
eor #S.PS.F.HOLD unmark as HOLD
|
2017-08-29 15:19:09 +00:00
|
|
|
|
sta (pPs)
|
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.2 jsr CORE.PSExec INIT/RUN/QUIT/RESUME
|
2018-04-26 15:38:02 +00:00
|
|
|
|
dec IRQ.InKernel
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bcc .61 Error ?
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.5 tax Yes, From INIT or RUN,save RC
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
ldy #S.PS.PPID Notify Parent Process for exit code...
|
|
|
|
|
lda (pPs),y
|
2018-04-26 15:38:02 +00:00
|
|
|
|
beq .6 no parent process
|
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr CORE.GetPSByID X unmodified
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bcs .6 parent is dead.....skipping...
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2017-08-29 15:19:09 +00:00
|
|
|
|
lda (ZPPtr1) Parent PS is HOLD?
|
|
|
|
|
bit #S.PS.F.HOLD
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .6 no...
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
eor #S.PS.F.HOLD yes, release hold...
|
|
|
|
|
sta (ZPPtr1)
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
txa ...probably waiting for this PS to terminate....
|
2017-08-29 15:19:09 +00:00
|
|
|
|
ldy #S.PS.RC give it RC
|
|
|
|
|
sta (ZPPtr1),y
|
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
.6 lda (pPs)
|
2018-04-26 15:38:02 +00:00
|
|
|
|
and #$3F $ff^S.PS.F.INIT+S.PS.F.RUN
|
|
|
|
|
ora #S.PS.F.QUIT
|
2018-04-20 15:06:41 +00:00
|
|
|
|
sta (pPs)
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bra .7
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.61 lda (pPs)
|
|
|
|
|
bit #S.PS.F.SLEEP
|
|
|
|
|
bne .7
|
|
|
|
|
|
|
|
|
|
bit #S.PS.F.INIT
|
|
|
|
|
beq .62
|
|
|
|
|
|
|
|
|
|
eor #S.PS.F.INIT+S.PS.F.RUN go from INIT to RUN
|
|
|
|
|
sta (pPs)
|
|
|
|
|
bra .7
|
|
|
|
|
|
|
|
|
|
.62 bit #S.PS.F.QUIT
|
|
|
|
|
beq .7
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
2017-08-29 15:19:09 +00:00
|
|
|
|
ldy #S.PS.PID
|
|
|
|
|
lda (pPs),y
|
2018-07-26 06:03:49 +00:00
|
|
|
|
beq *
|
2018-10-24 15:36:45 +00:00
|
|
|
|
jsr CORE.PSFree
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bra .8
|
|
|
|
|
|
|
|
|
|
.7 jsr CORE.PSLeave Save ZP & Ptrs
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.8 inc CORE.PSIndex
|
|
|
|
|
ldx CORE.PSIndex
|
2018-10-23 15:36:57 +00:00
|
|
|
|
cpx CORE.PSCount
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bne .1
|
2017-09-06 15:00:10 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-20 15:09:55 +00:00
|
|
|
|
CORE.Events jsr CORE.GetEvents
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bcs .4 CS=no event
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr CORE.Dispatch
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bcc .4 CC=All Events Dispatched
|
|
|
|
|
|
|
|
|
|
jsr CORE.PSSelect0
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda #Evt.Table
|
2017-09-19 15:34:01 +00:00
|
|
|
|
sta pEvent
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.1 lda (pEvent)
|
|
|
|
|
beq .3
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bmi .2 Ignore & Discard any timer event
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
* jsr CORE.DumpEvent
|
2017-09-06 15:00:10 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.2 jsr CORE.DestroyEvent
|
2017-09-06 15:00:10 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.3 lda pEvent
|
|
|
|
|
clc
|
|
|
|
|
adc #S.EVT
|
|
|
|
|
sta pEvent
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda CORE.EvtCount
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bne .1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-17 16:16:05 +00:00
|
|
|
|
.4 bit OPENAPPLE
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bpl .8
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda KBD
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bpl .8
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
cmp #"1"
|
|
|
|
|
bcc .8
|
|
|
|
|
cmp #"5"
|
|
|
|
|
bcs .8
|
2017-09-08 14:49:23 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sta KBDSTROBE
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jsr CORE.ScrSel
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.8 jmp CORE.Run
|
2017-09-08 14:49:23 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-31 15:35:15 +00:00
|
|
|
|
* CORE.GetEvents :
|
|
|
|
|
* IN :
|
|
|
|
|
* OUT :
|
|
|
|
|
* CS = no event, A = ERROR
|
|
|
|
|
* CC * event in YA
|
|
|
|
|
* (pEvent)
|
|
|
|
|
*--------------------------------------
|
2017-10-27 06:36:46 +00:00
|
|
|
|
CORE.GetEvents lda #Evt.Table
|
2017-08-31 15:35:15 +00:00
|
|
|
|
sta pEvent point to start of event list
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
stz CORE.EvtCount reset Size
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
bit CORE.IRQMode do we have IRQ enabled for Ticks ?
|
|
|
|
|
bpl .1 no, regular poll
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
lda IRQ.Tick a Tick ?
|
2017-10-11 15:37:41 +00:00
|
|
|
|
beq .8 no, no event
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
dec IRQ.Tick
|
2017-10-11 15:37:41 +00:00
|
|
|
|
bra .2
|
|
|
|
|
|
|
|
|
|
.1 lda VBL get VLINE status
|
2017-08-31 15:35:15 +00:00
|
|
|
|
tax
|
2017-10-11 15:37:41 +00:00
|
|
|
|
eor CORE.VBLState
|
|
|
|
|
bpl .8 no change,no tick
|
2017-08-31 15:35:15 +00:00
|
|
|
|
txa
|
2017-10-11 15:37:41 +00:00
|
|
|
|
sta CORE.VBLState save new
|
|
|
|
|
bpl .8 Up2down transition,no tick
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
.2 lda #0
|
2017-10-11 15:37:41 +00:00
|
|
|
|
|
|
|
|
|
dec CORE.TickSec
|
2017-12-18 16:36:21 +00:00
|
|
|
|
bne .3 not yet One Sec
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
lda SYS.BASL0+38
|
|
|
|
|
eor #$C0
|
|
|
|
|
sta SYS.BASL0+38
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
ldx CORE.TickPerSec
|
|
|
|
|
stx CORE.TickSec
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
lda #S.EVT.F.T1SEC
|
|
|
|
|
bra .4 Force Resync T1 & T10...
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
.3 dec CORE.Tick10t
|
|
|
|
|
bne .6
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
.4 inc A2osX.TIMER16
|
|
|
|
|
bne .5
|
|
|
|
|
inc A2osX.TIMER16+1
|
|
|
|
|
|
|
|
|
|
.5 ldx CORE.TickPer10t
|
2017-10-11 15:37:41 +00:00
|
|
|
|
stx CORE.Tick10t
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
ora #S.EVT.F.T10TH
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-12-18 16:36:21 +00:00
|
|
|
|
.6 tax Finally, do we have an event ?
|
2017-10-11 15:37:41 +00:00
|
|
|
|
beq .8 no....
|
|
|
|
|
|
|
|
|
|
sta (pEvent)
|
|
|
|
|
inc CORE.EvtCount Add one event to Queue
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
* lda pEvent
|
|
|
|
|
* clc
|
|
|
|
|
* adc #S.EVT
|
|
|
|
|
* sta pEvent if CS, EVT queue full!!! ($100)
|
|
|
|
|
|
|
|
|
|
* MORE EVENT PROCESSING HERE
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
.8 lda CORE.EvtCount if 0, exit with CS (from cmp), and A=0 "no event"
|
2017-08-31 15:35:15 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec
|
|
|
|
|
rts
|
2017-08-31 15:35:15 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
* CORE.Dispatch
|
2017-08-29 15:19:09 +00:00
|
|
|
|
* IN:
|
|
|
|
|
* OUT:
|
|
|
|
|
* CS: Not Dispatched
|
|
|
|
|
* CC: Event Cleared
|
|
|
|
|
*--------------------------------------
|
2018-10-15 15:39:21 +00:00
|
|
|
|
CORE.Dispatch stz CORE.PSIndex
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
ldx #0
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
.1 lda PS.Table.hPS,x
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .5
|
2017-09-19 15:34:01 +00:00
|
|
|
|
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.GetMemPtr
|
2017-09-19 15:34:01 +00:00
|
|
|
|
>STYA pPS
|
|
|
|
|
|
|
|
|
|
lda (pPs) get S.PS.F
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bit #S.PS.F.INIT+S.PS.F.HOLD+S.PS.F.QUIT Init or Waiting for Another Task to Terminate?
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bne .5
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
bit #S.PS.F.EVENT Accept Events ?
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .5
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-04-13 15:18:48 +00:00
|
|
|
|
jsr CORE.PSSelect
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
lda #Evt.Table
|
2017-08-29 15:19:09 +00:00
|
|
|
|
sta pEvent Select first event in list
|
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda CORE.EvtCount
|
2018-04-26 15:38:02 +00:00
|
|
|
|
sta CORE.EvtIndex
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
.2 lda (pEvent) Empty event, select next
|
|
|
|
|
beq .3
|
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
lda (pPs)
|
|
|
|
|
ora #S.PS.F.DOEVENT
|
|
|
|
|
sta (pPs)
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
|
|
|
|
jsr CORE.PSDoEvent
|
2018-04-12 15:45:31 +00:00
|
|
|
|
dec IRQ.InKernel
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-04-20 15:06:41 +00:00
|
|
|
|
lda (pPs)
|
|
|
|
|
eor #S.PS.F.DOEVENT
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
2017-08-29 15:19:09 +00:00
|
|
|
|
bcs .3 not for this PS, try next event in list
|
|
|
|
|
|
|
|
|
|
jsr CORE.DestroyEvent this PS handled the EVT, destroy it...
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda CORE.EvtCount
|
2018-04-26 15:38:02 +00:00
|
|
|
|
beq .4 no more event, exit
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.3 dec CORE.EvtIndex
|
2017-08-29 15:19:09 +00:00
|
|
|
|
beq .4 all EVT submitted to this PS, try other PS
|
|
|
|
|
|
|
|
|
|
lda pEvent try next EVT to this PS
|
|
|
|
|
clc
|
|
|
|
|
adc #S.EVT
|
|
|
|
|
sta pEvent
|
|
|
|
|
bra .2
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
|
|
|
|
.4 jsr CORE.PSLeave
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.5 inc CORE.PSIndex
|
|
|
|
|
ldx CORE.PSIndex
|
2018-10-23 15:36:57 +00:00
|
|
|
|
cpx CORE.PSCount
|
2017-09-19 15:34:01 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.9 sec
|
2017-09-19 15:34:01 +00:00
|
|
|
|
rts
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2017-09-19 15:34:01 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-24 15:36:45 +00:00
|
|
|
|
* CORE.PSFree
|
2017-09-19 15:34:01 +00:00
|
|
|
|
* In : A = PID to free
|
|
|
|
|
*--------------------------------------
|
2018-11-28 14:58:42 +00:00
|
|
|
|
CORE.PSFree sta .10+1 Save PS ID
|
2018-10-24 15:36:45 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
jsr CORE.GetPSByID S.PS in ZPPtr1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bcs .9
|
2017-09-19 15:34:01 +00:00
|
|
|
|
>STYA ZPPtr1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
ldy #S.PS.hSS
|
|
|
|
|
jsr .8
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hDS
|
|
|
|
|
jsr .8
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hCS
|
|
|
|
|
jsr .8
|
|
|
|
|
|
2018-10-16 15:48:03 +00:00
|
|
|
|
ldy #S.PS.hARGV
|
2017-09-19 15:34:01 +00:00
|
|
|
|
jsr .8
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1) get S.PS.F
|
2018-10-17 15:31:29 +00:00
|
|
|
|
and #S.PS.F.DUPENV do we have to discard duplicated env & prefix ?
|
2017-09-19 15:34:01 +00:00
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hENV
|
|
|
|
|
jsr .8
|
|
|
|
|
|
2018-11-28 14:58:42 +00:00
|
|
|
|
.1 ldy #S.PS.hPREFIX
|
2017-09-19 15:34:01 +00:00
|
|
|
|
jsr .8
|
|
|
|
|
|
2018-11-28 14:58:42 +00:00
|
|
|
|
.10 lda #$ff Self Modified
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
ldx #0
|
2018-10-17 15:31:29 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.2 cmp PS.Table.PID,x
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .3
|
2018-10-15 15:39:21 +00:00
|
|
|
|
inx
|
2018-10-23 15:36:57 +00:00
|
|
|
|
cpx CORE.PSCount
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bne .2
|
2018-10-17 15:31:29 +00:00
|
|
|
|
beq *
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.3 stz PS.Table.PID,x
|
2018-10-17 15:31:29 +00:00
|
|
|
|
lda PS.TABLE.hPS,x
|
|
|
|
|
stz PS.TABLE.hPS,x
|
2018-06-22 06:24:35 +00:00
|
|
|
|
.4 jmp K.FreeMem
|
2017-09-19 15:34:01 +00:00
|
|
|
|
|
|
|
|
|
.8 lda (ZPPtr1),y
|
2017-09-22 15:25:21 +00:00
|
|
|
|
bne .4
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2018-10-15 15:39:21 +00:00
|
|
|
|
* X unmodified
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
2018-06-22 06:24:35 +00:00
|
|
|
|
CORE.GetPSByID tay
|
2018-10-17 06:04:52 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
jsr CORE.GetPS
|
2018-10-17 15:31:29 +00:00
|
|
|
|
bcs CORE.GetPSByID.RTS
|
2018-10-15 15:39:21 +00:00
|
|
|
|
|
2018-10-17 15:31:29 +00:00
|
|
|
|
lda PS.TABLE.hPS,y
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jmp K.GetMemPtr
|
2018-10-15 15:39:21 +00:00
|
|
|
|
|
2018-10-17 06:04:52 +00:00
|
|
|
|
.8 >LDYAI CORE.S.PS0 Select PS0
|
2018-10-17 15:31:29 +00:00
|
|
|
|
CORE.GetPSByID.8
|
2018-10-15 15:39:21 +00:00
|
|
|
|
clc
|
2018-10-17 15:31:29 +00:00
|
|
|
|
CORE.GetPSByID.RTS
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* X,A unmodified
|
2017-11-22 16:27:50 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-15 15:39:21 +00:00
|
|
|
|
CORE.GetPS ldy #0
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-10-15 15:39:21 +00:00
|
|
|
|
.1 cmp PS.Table.PID,y
|
2018-10-17 15:31:29 +00:00
|
|
|
|
beq CORE.GetPSByID.8
|
2018-10-15 15:39:21 +00:00
|
|
|
|
iny
|
2018-10-23 15:36:57 +00:00
|
|
|
|
cpy CORE.PSCount
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
2018-10-21 20:54:07 +00:00
|
|
|
|
.9 lda #E.NSP
|
2018-10-15 15:39:21 +00:00
|
|
|
|
* sec
|
2017-08-29 15:19:09 +00:00
|
|
|
|
rts
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-26 15:38:02 +00:00
|
|
|
|
*CORE.DumpEvent ldy #S.EVT-1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
*.1 >PUSHB (pEvent),y
|
|
|
|
|
* dey
|
|
|
|
|
* bpl .1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
* >LDYAI .2
|
2018-06-21 15:12:10 +00:00
|
|
|
|
* jmp K.printf
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
*.2 .AZ "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n"
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
CORE.ScrSel and #$0F
|
2017-09-20 15:09:55 +00:00
|
|
|
|
cmp A2osX.ASCREEN Same as active screen...nothing to do
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
|
2018-08-08 15:13:37 +00:00
|
|
|
|
lda A2osX.SCRNDEVS-1,x Get DevID
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .8 No device claimed this screen
|
|
|
|
|
|
2018-07-19 15:33:55 +00:00
|
|
|
|
stx A2osX.ASCREEN set active screen
|
|
|
|
|
|
2018-11-19 07:43:00 +00:00
|
|
|
|
jsr K.GetDevByID
|
2018-08-08 15:13:37 +00:00
|
|
|
|
bcs .8
|
|
|
|
|
phx
|
|
|
|
|
|
2018-07-19 15:33:55 +00:00
|
|
|
|
>PUSHWI 0 Param
|
|
|
|
|
>PUSHBI IOCTL.CONTROL request
|
|
|
|
|
pla ID
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2018-07-18 06:02:43 +00:00
|
|
|
|
jsr K.IOCTL
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.8 rts
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.DestroyEvent
|
|
|
|
|
lda (pEvent)
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
bit #S.EVT.F.hMEM1
|
|
|
|
|
beq .1
|
|
|
|
|
|
|
|
|
|
pha
|
2017-10-27 06:36:46 +00:00
|
|
|
|
ldy #S.EVT.B1
|
2017-08-29 15:19:09 +00:00
|
|
|
|
lda (pEvent),y
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.FreeMem
|
2017-08-29 15:19:09 +00:00
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
.1 bit #S.EVT.F.hMEM2
|
|
|
|
|
beq .2
|
|
|
|
|
|
2017-10-27 06:36:46 +00:00
|
|
|
|
ldy #S.EVT.B2
|
2017-08-29 15:19:09 +00:00
|
|
|
|
lda (pEvent),y
|
2018-06-21 15:12:10 +00:00
|
|
|
|
jsr K.FreeMem
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
|
|
|
|
.2 lda #0
|
|
|
|
|
sta (pEvent)
|
2017-10-11 15:37:41 +00:00
|
|
|
|
dec CORE.EvtCount
|
2017-08-29 15:19:09 +00:00
|
|
|
|
.9 rts
|
2017-09-19 15:34:01 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.PSSelect0 >LDYAI CORE.S.PS0 Select PS0
|
|
|
|
|
>STYA pPs
|
|
|
|
|
|
2017-11-21 16:27:07 +00:00
|
|
|
|
>LDYAI K.STACKTOP
|
2017-09-20 15:09:55 +00:00
|
|
|
|
>STYA pStack
|
2018-04-10 15:03:29 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2018-04-13 15:18:48 +00:00
|
|
|
|
CORE.PSSelect ldy #S.PS.ZP+ZPBIN.SIZE-1
|
2018-04-10 15:03:29 +00:00
|
|
|
|
ldx #ZPBIN.SIZE-1
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
.1 lda (pPs),y
|
|
|
|
|
sta pCode,x
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
rts
|
2018-04-26 15:38:02 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-10 15:03:29 +00:00
|
|
|
|
CORE.PSLeave ldy #S.PS.ZP+ZPBIN.SIZE-1
|
|
|
|
|
ldx #ZPBIN.SIZE-1
|
2017-09-19 15:34:01 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.1 lda pCode,x
|
2017-09-19 15:34:01 +00:00
|
|
|
|
sta (pPs),y
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
2017-09-18 15:43:00 +00:00
|
|
|
|
|
2018-04-10 15:03:29 +00:00
|
|
|
|
rts
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
2018-10-15 15:39:21 +00:00
|
|
|
|
CORE.PSExec jsr CORE.PSSelect Restore ZP & Ptrs
|
|
|
|
|
|
|
|
|
|
lda (pPS)
|
2018-04-26 15:38:02 +00:00
|
|
|
|
bit #S.PS.F.SLEEP
|
|
|
|
|
bne CORE.PSResume
|
|
|
|
|
|
|
|
|
|
bit #S.PS.F.RUN
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
bit #S.PS.F.INIT
|
|
|
|
|
bne .1
|
|
|
|
|
|
2018-07-04 14:59:12 +00:00
|
|
|
|
ldx #PS.QUIT
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.HS 2C BIT ABS
|
2018-07-04 14:59:12 +00:00
|
|
|
|
.1 ldx #PS.INIT
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.HS 2C BIT ABS
|
2018-07-04 14:59:12 +00:00
|
|
|
|
.2 ldx #PS.RUN
|
2018-04-26 15:38:02 +00:00
|
|
|
|
.HS 2C BIT ABS
|
2018-04-12 15:45:31 +00:00
|
|
|
|
|
2018-07-04 14:59:12 +00:00
|
|
|
|
CORE.PSDoEvent ldx #PS.DOEVENT
|
2018-04-26 15:38:02 +00:00
|
|
|
|
|
|
|
|
|
lda pCode+1
|
|
|
|
|
pha
|
|
|
|
|
lda pCode
|
|
|
|
|
pha
|
|
|
|
|
php
|
2018-04-20 15:06:41 +00:00
|
|
|
|
sei
|
2018-04-26 15:38:02 +00:00
|
|
|
|
inc IRQ.InKernel
|
|
|
|
|
rti
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.PSResume sei
|
|
|
|
|
|
|
|
|
|
eor #S.PS.F.SLEEP unmark as SLEEP
|
|
|
|
|
sta (pPS)
|
|
|
|
|
|
|
|
|
|
>PULLA Get !BC
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
.1 >PULLA
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.2 ldy #S.PS.PC+1
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
dey #S.PS.PC
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
dey #S.PS.P
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
dey #S.PS.Y
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
pha
|
2018-04-20 15:06:41 +00:00
|
|
|
|
|
2018-04-26 15:38:02 +00:00
|
|
|
|
dey #S.PS.X
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
dey #S.PS.A
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
|
|
|
|
|
ply
|
|
|
|
|
inc IRQ.InKernel
|
|
|
|
|
rti
|
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
DevMgr.Stat .DA DevMgr.FreeMem
|
2017-09-11 15:29:08 +00:00
|
|
|
|
DevMgr.Free .DA DevMgr.FreeMem
|
|
|
|
|
.DA DevMgr.HiMem
|
2018-07-09 15:25:38 +00:00
|
|
|
|
DevMgr.DevCnt .DA #0
|
2018-09-20 15:33:05 +00:00
|
|
|
|
DevMgr.NodCnt .DA #0
|
2017-09-11 15:29:08 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-11 15:37:41 +00:00
|
|
|
|
CORE.VBLState .BS 1
|
|
|
|
|
CORE.IRQMode .BS 1
|
|
|
|
|
CORE.TickPerSec .BS 1
|
|
|
|
|
CORE.TickPer10t .BS 1
|
|
|
|
|
CORE.TickSec .BS 1
|
|
|
|
|
CORE.Tick10t .BS 1
|
2018-10-17 15:31:29 +00:00
|
|
|
|
CORE.CPUStatCnt .DA #100
|
|
|
|
|
CORE.InKernelHits .BS 1
|
|
|
|
|
CORE.InKernelStats .BS 1
|
2017-09-11 15:29:08 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-26 15:38:02 +00:00
|
|
|
|
CORE.EvtIndex .BS 1
|
|
|
|
|
CORE.EvtCount .BS 1
|
|
|
|
|
CORE.PSIndex .BS 1
|
2018-10-23 15:36:57 +00:00
|
|
|
|
CORE.PSCount .DA #0
|
2017-09-19 15:34:01 +00:00
|
|
|
|
CORE.LastPSID .DA #0
|
2018-04-23 06:03:23 +00:00
|
|
|
|
CORE.S.PS0 .BS S.PS.hStdErr+1
|
2017-09-11 15:29:08 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-29 15:19:09 +00:00
|
|
|
|
MAN
|
2018-11-17 17:17:13 +00:00
|
|
|
|
SAVE USR/SRC/SYS/KERNEL.S.CORE
|
|
|
|
|
LOAD USR/SRC/SYS/KERNEL.S
|
2017-08-29 15:19:09 +00:00
|
|
|
|
ASM
|