2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2017-08-29 15:19:09 +00:00
|
|
|
|
PREFIX /A2OSX.BUILD
|
2017-12-22 21:24:30 +00:00
|
|
|
|
AUTO 4,1
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-19 15:34:01 +00:00
|
|
|
|
CORE.Run lda CORE.PSCount
|
|
|
|
|
sta CORE.Counter
|
2017-09-20 15:09:55 +00:00
|
|
|
|
bne .1 SHOULD NEVER HAPPEN!!!
|
2017-11-22 16:27:50 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
jmp CORE.Events
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.1 ldx CORE.Counter
|
|
|
|
|
lda PS.Table.PID-1,x
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .8
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda PS.Table.hMem-1,x
|
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>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
|
2017-10-06 15:25:14 +00:00
|
|
|
|
jsr CORE.GetPSStatus.A
|
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
|
2017-08-29 15:19:09 +00:00
|
|
|
|
and #$FF^S.PS.F.HOLD unmark as HOLD
|
|
|
|
|
sta (pPs)
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.2 jsr CORE.PSEnter Restore at least ZP & Ptrs
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
lda (pPs) get S.PS.F again
|
2017-08-29 15:19:09 +00:00
|
|
|
|
bit #S.PS.F.SLEEP Is this PS sleeping?
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .3 no, call INIT/RUN
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
and #$FF^S.PS.F.SLEEP unmark as SLEEP
|
|
|
|
|
sta (pPS)
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
jsr CORE.PSResume Restore PC....and JMP to
|
|
|
|
|
bcc .7
|
|
|
|
|
bcs .5
|
|
|
|
|
|
|
|
|
|
.3 bit #S.PS.F.INIT
|
|
|
|
|
beq .4
|
|
|
|
|
|
|
|
|
|
and #$FF^S.PS.F.INIT unmark as INIT
|
2017-08-29 15:19:09 +00:00
|
|
|
|
sta (pPS)
|
|
|
|
|
|
|
|
|
|
ldx #TSKMGR.INIT
|
|
|
|
|
.HS 2C BIT abs
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.4 ldx #TSKMGR.RUN
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
jsr pCodeJmp Call INIT/RUN function
|
|
|
|
|
bcc .7 INIT/RUN/RESUME said CS=QUIT?
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.5 tax save RC
|
2017-08-29 15:19:09 +00:00
|
|
|
|
ldy #S.PS.PPID Notify Parent Process for exit code...
|
|
|
|
|
lda (pPs),y
|
2017-09-20 15:09:55 +00:00
|
|
|
|
jsr CORE.GetPSByID.A X unmodified
|
|
|
|
|
bcs .6 parent is dead.....skipping...
|
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
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.6 ldx #TSKMGR.QUIT Quit this process
|
2017-08-29 15:19:09 +00:00
|
|
|
|
jsr pCodeJmp Call QUIT function
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.PID
|
|
|
|
|
lda (pPs),y
|
2017-09-08 14:49:23 +00:00
|
|
|
|
jsr CORE.PSFree.A
|
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
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.8 dec CORE.Counter
|
2017-12-22 21:24:30 +00:00
|
|
|
|
beq CORE.Events
|
|
|
|
|
jmp .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
|
|
|
|
|
2017-09-19 15:34:01 +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
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda CORE.IRQTick a Tick ?
|
|
|
|
|
beq .8 no, no event
|
2017-08-31 15:35:15 +00:00
|
|
|
|
|
2017-10-11 15:37:41 +00:00
|
|
|
|
dec CORE.IRQTick
|
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
CORE.Dispatch lda CORE.PSCount
|
2017-09-19 15:34:01 +00:00
|
|
|
|
sta CORE.Counter
|
2017-08-29 15:19:09 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
.1 ldx CORE.Counter
|
2017-08-29 15:19:09 +00:00
|
|
|
|
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda PS.Table.PID-1,x
|
2017-09-20 15:09:55 +00:00
|
|
|
|
beq .5
|
2017-09-19 15:34:01 +00:00
|
|
|
|
|
|
|
|
|
lda PS.Table.hMem-1,x
|
|
|
|
|
jsr K.GetMemPtr.A
|
|
|
|
|
>STYA pPS
|
|
|
|
|
|
|
|
|
|
lda (pPs) get S.PS.F
|
2017-08-29 15:19:09 +00:00
|
|
|
|
bit #S.PS.F.INIT+S.PS.F.HOLD 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
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
jsr CORE.PSEnter
|
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
|
2017-08-29 15:19:09 +00:00
|
|
|
|
sta TSKMGR.EVENTCNT
|
|
|
|
|
|
|
|
|
|
.2 lda (pEvent) Empty event, select next
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
ldx #TSKMGR.DOEVENT
|
|
|
|
|
jsr pCodeJmp Call DOEVENT function
|
|
|
|
|
bcs .3 not for this PS, try next event in list
|
|
|
|
|
|
|
|
|
|
jsr CORE.DestroyEvent this PS handled the EVT, destroy it...
|
2017-10-11 15:37:41 +00:00
|
|
|
|
lda CORE.EvtCount
|
2017-08-29 15:19:09 +00:00
|
|
|
|
beq .8 no more event, exit
|
|
|
|
|
|
|
|
|
|
.3 dec TSKMGR.EVENTCNT
|
|
|
|
|
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
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.5 dec CORE.Counter
|
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-10-18 15:32:56 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
pCodeJmp jmp (pCode)
|
2017-09-19 15:34:01 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-20 15:09:55 +00:00
|
|
|
|
CORE.Quit clc
|
2017-08-29 15:19:09 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-09-19 15:34:01 +00:00
|
|
|
|
* PS.Free.A
|
|
|
|
|
* In : A = PID to free
|
|
|
|
|
*--------------------------------------
|
2017-09-20 15:09:55 +00:00
|
|
|
|
CORE.PSFree.A sta .1+1 Save PS ID
|
|
|
|
|
jsr CORE.GetPSByID.A PS in ZPPtr1
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hARGS
|
|
|
|
|
jsr .8
|
|
|
|
|
|
|
|
|
|
lda (ZPPtr1) get S.PS.F
|
2017-10-06 15:25:14 +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
|
|
|
|
|
|
|
|
|
|
ldy #S.PS.hPREFIX
|
|
|
|
|
jsr .8
|
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.1 lda #$ff Self Modified
|
|
|
|
|
|
|
|
|
|
ldx CORE.PSCount
|
|
|
|
|
|
|
|
|
|
.2 cmp PS.Table.PID-1,x
|
|
|
|
|
beq .3
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
bra *
|
|
|
|
|
|
|
|
|
|
.3 stz PS.Table.PID-1,x
|
2017-09-19 15:34:01 +00:00
|
|
|
|
lda PS.TABLE.hMem-1,x
|
2017-09-22 15:25:21 +00:00
|
|
|
|
.4 jmp K.FreeMem.A
|
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
|
|
|
|
|
*--------------------------------------
|
2017-09-20 15:09:55 +00:00
|
|
|
|
* X unmodofied
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.GetPSByID.A
|
2017-10-06 15:25:14 +00:00
|
|
|
|
jsr CORE.GetPSStatus.A
|
|
|
|
|
bcs .9
|
|
|
|
|
lda PS.TABLE.hMem-1,y
|
|
|
|
|
jmp K.GetMemPtr.A
|
|
|
|
|
.9 rts
|
2017-11-22 16:27:50 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-06 15:25:14 +00:00
|
|
|
|
CORE.GetPSStatus.A
|
2017-09-20 15:09:55 +00:00
|
|
|
|
ldy CORE.PSCount
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
.1 cmp PS.Table.PID-1,y
|
2017-10-06 15:25:14 +00:00
|
|
|
|
beq .8
|
2017-09-20 15:09:55 +00:00
|
|
|
|
dey
|
|
|
|
|
bne .1
|
|
|
|
|
|
2017-10-26 16:01:54 +00:00
|
|
|
|
.9 lda #K.E.NSP
|
2017-09-20 15:09:55 +00:00
|
|
|
|
sec
|
2017-08-29 15:19:09 +00:00
|
|
|
|
rts
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
2017-10-06 15:25:14 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.DumpEvent ldy #S.EVT-1
|
|
|
|
|
|
|
|
|
|
.1 >PUSHB (pEvent),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
>LDYAI .2
|
|
|
|
|
jmp K.PrintF.YA
|
|
|
|
|
|
|
|
|
|
.2 >CSTR "!Evt:F=%b,Dev=$%h,LO=$%h,HI=$%h,W1=$%H,W2=$%H\n"
|
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
|
|
|
|
|
lda A2osX.SCRNDEVS-1,x
|
|
|
|
|
beq .8 No device claimed this screen
|
|
|
|
|
|
|
|
|
|
jsr K.GetDevByID.A x unmodified.....
|
|
|
|
|
bcs .8 ???
|
|
|
|
|
|
|
|
|
|
stx A2osX.ASCREEN
|
|
|
|
|
|
2018-01-15 06:50:44 +00:00
|
|
|
|
>STYA .1+1
|
2017-09-20 15:09:55 +00:00
|
|
|
|
|
|
|
|
|
ldx #DEVMGR.CONTROL
|
2018-01-15 06:50:44 +00:00
|
|
|
|
.1 jmp $ffff SELF MODIFED
|
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
|
|
|
|
|
jsr K.FreeMem.A
|
|
|
|
|
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
|
|
|
|
|
jsr K.FreeMem.A
|
|
|
|
|
|
|
|
|
|
.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
|
2017-09-19 15:34:01 +00:00
|
|
|
|
rts
|
2017-09-20 15:09:55 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-26 16:01:54 +00:00
|
|
|
|
CORE.PSLeave ldy #S.PS.ZP+23
|
2017-09-19 15:34:01 +00:00
|
|
|
|
ldx #23
|
|
|
|
|
|
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
|
|
|
|
|
2017-09-15 06:37:15 +00:00
|
|
|
|
clc No error,
|
|
|
|
|
rts back to Kernel
|
2017-08-29 15:19:09 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-26 16:01:54 +00:00
|
|
|
|
CORE.PSEnter ldy #S.PS.ZP+23
|
2017-09-20 15:09:55 +00:00
|
|
|
|
ldx #23
|
2017-09-18 15:43:00 +00:00
|
|
|
|
|
2017-09-20 15:09:55 +00:00
|
|
|
|
.1 lda (pPs),y
|
|
|
|
|
sta pCode,x
|
|
|
|
|
dey
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CORE.PSResume ldy #S.PS.PC
|
2017-09-18 15:43:00 +00:00
|
|
|
|
lda (pPs),y
|
|
|
|
|
sec Advance PC by one as it was saved by a JSR
|
|
|
|
|
adc pCode setup by PS.Select
|
2017-09-19 15:34:01 +00:00
|
|
|
|
sta .8+1
|
2017-09-18 15:43:00 +00:00
|
|
|
|
iny
|
|
|
|
|
lda (pPs),y
|
|
|
|
|
adc pCode+1
|
2017-09-19 15:34:01 +00:00
|
|
|
|
sta .8+2
|
|
|
|
|
|
|
|
|
|
.8 jmp $FFFF
|
2017-09-18 15:43:00 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-11 15:29:08 +00:00
|
|
|
|
TSKMGR.EVENTCNT .BS 1
|
|
|
|
|
*--------------------------------------
|
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
|
|
|
|
|
DevMgr.Count .DA #2 NUL,SYS
|
|
|
|
|
*--------------------------------------
|
2017-10-11 15:37:41 +00:00
|
|
|
|
CORE.EvtCount .BS 1
|
|
|
|
|
|
|
|
|
|
CORE.VBLState .BS 1
|
|
|
|
|
|
|
|
|
|
CORE.IRQMode .BS 1
|
|
|
|
|
CORE.IRQTick .BS 1
|
|
|
|
|
|
|
|
|
|
CORE.TickPerSec .BS 1
|
|
|
|
|
CORE.TickPer10t .BS 1
|
|
|
|
|
CORE.TickSec .BS 1
|
|
|
|
|
CORE.Tick10t .BS 1
|
2017-09-11 15:29:08 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-19 15:34:01 +00:00
|
|
|
|
CORE.Counter .BS 1
|
|
|
|
|
CORE.PSCount .DA #0
|
|
|
|
|
CORE.LastPSID .DA #0
|
2017-11-21 16:27:07 +00:00
|
|
|
|
CORE.S.PS0 .BS S.PS.PC+2
|
2017-09-11 15:29:08 +00:00
|
|
|
|
*--------------------------------------
|
2017-08-29 15:19:09 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.SRC/SYS/KERNEL.S.CORE
|
|
|
|
|
LOAD /A2OSX.SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|