mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-23 07:35:19 +00:00
107 lines
1.8 KiB
Plaintext
107 lines
1.8 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*/--------------------------------------
|
||
* #GetDevByIDA
|
||
* ##IN:
|
||
* A = DevID
|
||
* ##OUT:
|
||
* CC = OK, CS = ERROR
|
||
* Y,A = devslot
|
||
* note: X Unmodified
|
||
*\--------------------------------------
|
||
K.GetDevByIDA cmp DevMgr.LastDevID
|
||
beq .1
|
||
bcs K.GetDevDNF
|
||
|
||
.1 pha save ID
|
||
|
||
asl
|
||
asl
|
||
asl
|
||
asl
|
||
adc #DevMgr.Table
|
||
tay
|
||
pla
|
||
php
|
||
lsr
|
||
lsr
|
||
lsr
|
||
lsr
|
||
plp
|
||
adc /DevMgr.Table
|
||
rts CC
|
||
*/--------------------------------------
|
||
* #GetDevIDByNameYA
|
||
* ##IN:
|
||
* Y,A = Ptr to device name (PStr)
|
||
* ##OUT:
|
||
* CC = OK, CS = ERROR
|
||
* X = DEVID
|
||
* Y,A = pDev
|
||
*\--------------------------------------
|
||
K.GetDevByNameYA
|
||
>STYA ZPQuickPtr1
|
||
>LDYAI DevMgr.Table+S.DEV.NAME
|
||
>STYA ZPQuickPtr2
|
||
|
||
ldx #0
|
||
|
||
.1 lda (ZPQuickPtr1)
|
||
cmp (ZPQuickPtr2)
|
||
bne .3
|
||
|
||
tay
|
||
|
||
.2 lda (ZPQuickPtr1),y
|
||
cmp (ZPQuickPtr2),y
|
||
bne .3
|
||
|
||
dey
|
||
bne .2
|
||
|
||
lda ZPQuickPtr2
|
||
sec
|
||
sbc #S.DEV.NAME
|
||
tay
|
||
lda ZPQuickPtr2+1
|
||
sbc /S.DEV.NAME
|
||
clc
|
||
rts
|
||
|
||
.3 lda ZPQuickPtr2
|
||
clc
|
||
adc #S.DEV
|
||
sta ZPQuickPtr2
|
||
bcc .4
|
||
|
||
inc ZPQuickPtr2+1
|
||
|
||
.4 cpx DevMgr.LastDevID
|
||
inx
|
||
bcc .1
|
||
|
||
K.GetDevDNF lda #DEVMGR.ERRDNF
|
||
rts
|
||
*/--------------------------------------
|
||
* #GetDevInfoA
|
||
* ##IN:
|
||
* A = DevID
|
||
* ##OUT:
|
||
* CC = OK, CS = ERROR
|
||
* Y,A = Ptr to S.DEVINFO
|
||
*\--------------------------------------
|
||
K.GetDevInfoA jsr K.GetDevByIDA
|
||
bcs K.GetDevDNF
|
||
>STYA ZPQuickPtr1
|
||
ldx #DEVMGR.GETINFO
|
||
jmp (ZPQuickPtr1)
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.DEV
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|