2015-03-14 21:48:35 +00:00
|
|
|
|
PR#3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PREFIX /A2OSX.SRC
|
2015-03-14 21:48:35 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* GETEVENT :
|
|
|
|
|
* IN :
|
|
|
|
|
* OUT :
|
|
|
|
|
* CS = no event, A = ERROR
|
|
|
|
|
* CC * event in YA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* (pEvent)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-03-13 21:47:19 +00:00
|
|
|
|
S.GetEvents stz pEvent
|
|
|
|
|
stz EVTMGR.COUNT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
lda VBL get VLINE status
|
|
|
|
|
tax
|
2015-03-14 21:48:35 +00:00
|
|
|
|
eor EVTMGR.VBLSTATE
|
2016-03-13 21:47:19 +00:00
|
|
|
|
bpl S.GetEvents.DEV no change,no tick
|
|
|
|
|
txa
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta EVTMGR.VBLSTATE save new
|
2016-03-13 21:47:19 +00:00
|
|
|
|
bpl S.GetEvents.DEV Up2down transition,no tick
|
|
|
|
|
|
|
|
|
|
* sta PDLTRIG clr VBL (IIc)
|
|
|
|
|
* lda RDIOUDIS clr VBL (IIc)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
|
|
|
|
inc A2osX.TIMER16
|
|
|
|
|
bne .1
|
|
|
|
|
inc A2osX.TIMER16+1
|
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
.1 dec EVTMGR.HZ.CNT
|
|
|
|
|
bne S.GetEvents.DEV not yet 100ms
|
|
|
|
|
|
|
|
|
|
ldx A2osX.HZ
|
|
|
|
|
stx EVTMGR.HZ.CNT
|
|
|
|
|
|
|
|
|
|
lda #S.EVT.F.T10TH
|
|
|
|
|
|
|
|
|
|
dec EVTMGR.10TH.CNT
|
|
|
|
|
bne .2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
ldx #10
|
|
|
|
|
stx EVTMGR.10TH.CNT
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
ora #S.EVT.F.T1SEC
|
|
|
|
|
|
|
|
|
|
.2 sta (pEvent)
|
|
|
|
|
|
|
|
|
|
lda pEvent
|
|
|
|
|
clc
|
|
|
|
|
adc #S.EVT
|
|
|
|
|
sta pEvent
|
|
|
|
|
inc EVTMGR.COUNT
|
|
|
|
|
|
|
|
|
|
S.GetEvents.DEV >LDYAI DevMgr.Table
|
|
|
|
|
>STYA pDev
|
|
|
|
|
|
|
|
|
|
stz DevMgr.DevID
|
|
|
|
|
|
|
|
|
|
.1 ldy #S.DEV.F
|
|
|
|
|
lda (pDev),y get S.DEV.F
|
2016-06-24 15:02:13 +00:00
|
|
|
|
bit #S.DEV.F.EVENT
|
2016-03-13 21:47:19 +00:00
|
|
|
|
beq .2 EVENT enabled ?
|
|
|
|
|
|
|
|
|
|
lda (pDev)
|
|
|
|
|
cmp #H.BIN.HEADER.DRV65
|
|
|
|
|
bne *
|
2016-06-24 15:02:13 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
ldx #DEVMGR.GETEVENT
|
|
|
|
|
jsr pDevJmp Call DRV GetEvent function
|
|
|
|
|
bcs .2 no event
|
|
|
|
|
|
|
|
|
|
inc EVTMGR.COUNT
|
|
|
|
|
|
|
|
|
|
ldy #S.EVT.hDEV
|
|
|
|
|
lda DevMgr.DevID
|
|
|
|
|
sta (pEvent),y
|
|
|
|
|
|
|
|
|
|
lda pEvent
|
|
|
|
|
adc #S.EVT cc
|
|
|
|
|
sta pEvent
|
|
|
|
|
|
|
|
|
|
bcs .8 Event Q is full!
|
|
|
|
|
|
|
|
|
|
.2 lda pDev
|
|
|
|
|
clc
|
|
|
|
|
adc #S.DEV.SIZE
|
|
|
|
|
sta pDev
|
|
|
|
|
bcc .3
|
|
|
|
|
inc pDev+1
|
|
|
|
|
|
|
|
|
|
.3 lda DevMgr.DevID
|
|
|
|
|
inc DevMgr.DevID
|
|
|
|
|
cmp DevMgr.LastDevID
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.8 lda EVTMGR.COUNT
|
|
|
|
|
sta EVTMGR.SIZE
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 sec error code=0,CS=no event
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-03-13 21:47:19 +00:00
|
|
|
|
S.GetKeyboardEvent
|
|
|
|
|
lda KBD
|
|
|
|
|
bpl .9
|
|
|
|
|
sta KBDSTROBE
|
|
|
|
|
|
|
|
|
|
and #$7F
|
|
|
|
|
ldy #S.EVT.DATA
|
|
|
|
|
sta (pEvent),y
|
|
|
|
|
iny
|
|
|
|
|
lda OPENAPPLE
|
|
|
|
|
asl
|
|
|
|
|
lda SOLIDAPPLE
|
|
|
|
|
ror
|
|
|
|
|
and #$C0
|
|
|
|
|
sta (pEvent),y
|
|
|
|
|
|
|
|
|
|
lda #S.EVT.F.KEY
|
|
|
|
|
sta (pEvent)
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 inc A2osX.RANDOM16
|
|
|
|
|
bne .99
|
2016-03-26 07:28:47 +00:00
|
|
|
|
dec A2osX.RANDOM16+1
|
2016-03-13 21:47:19 +00:00
|
|
|
|
.99 sec no event
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-03-13 21:47:19 +00:00
|
|
|
|
S.DestroyEvent lda (pEvent)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
beq .9
|
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
bit #S.EVT.F.hMEM1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
pha
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.EVT.DATALO
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pEvent),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr S.FreeMemA
|
2016-03-13 21:47:19 +00:00
|
|
|
|
pla
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
.1 bit #S.EVT.F.hMEM2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
beq .2
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.EVT.DATAHI
|
2015-06-03 18:30:57 +00:00
|
|
|
|
lda (pEvent),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
jsr S.FreeMemA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-03-13 21:47:19 +00:00
|
|
|
|
.2 lda #0
|
|
|
|
|
sta (pEvent)
|
|
|
|
|
dec EVTMGR.COUNT
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.9 rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
EVTMGR.VBLSTATE .BS 1
|
2016-03-13 21:47:19 +00:00
|
|
|
|
EVTMGR.10TH.CNT .BS 1
|
|
|
|
|
EVTMGR.HZ.CNT .BS 1
|
|
|
|
|
EVTMGR.COUNT .BS 1
|
|
|
|
|
EVTMGR.SIZE .BS 1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.EVT
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|