mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-27 04:49:20 +00:00
160 lines
3.7 KiB
Plaintext
160 lines
3.7 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.SRC
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* PUBLIC
|
||
*--------------------------------------
|
||
S.MLICreateFile >PULLW MLICALL.PARAMS+1
|
||
>PULLB MLICALL.PARAMS+3 Access
|
||
>PULLB MLICALL.PARAMS+4 File type
|
||
>PULLW MLICALL.PARAMS+5 Aux type
|
||
lda #$01 Storage=Standard Files
|
||
sta MLICALL.PARAMS+7
|
||
>MLICALL MLICREATE
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLISetFileInfo
|
||
*--------------------------------------
|
||
S.MLISetFileInfo
|
||
>PULLW ZPQuickPtr1
|
||
>PULLW MLICALL.PARAMS+1
|
||
ldy #$E
|
||
.1 lda (ZPQuickPtr1),y
|
||
sta MLICALL.PARAMS+3,y
|
||
dey
|
||
bpl .1
|
||
>MLICALL MLISETFILEINFO
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLIGetFileInfoYA
|
||
* in :
|
||
* Y,A = FileName
|
||
* out :
|
||
* Y,A = PTR To Buffer (L=15)
|
||
*--------------------------------------
|
||
S.MLIGetFileInfoYA
|
||
>STYA MLICALL.PARAMS+1
|
||
>MLICALL MLIGETFILEINFO
|
||
bcs .9
|
||
>LDYAI MLICALL.PARAMS+3
|
||
.9 rts
|
||
*--------------------------------------
|
||
* S.MLIOnline
|
||
* in :
|
||
* PULLB = Device
|
||
* PULLW = Dest PTR
|
||
*--------------------------------------
|
||
S.MLIOnline >PULLB MLICALL.PARAMS+1
|
||
>PULLW MLICALL.PARAMS+2
|
||
>MLICALL MLIONLINE
|
||
rts
|
||
*--------------------------------------
|
||
S.MLIGetPrefixYA
|
||
>STYA MLICALL.PARAMS+1
|
||
>MLICALL MLIGETPREFIX
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLIOpenYA
|
||
* in :
|
||
* YA = FileName
|
||
* out :
|
||
* A = ref_num
|
||
* X = buf hMem
|
||
*--------------------------------------
|
||
S.MLIOpenYA >STYA MLICALL.PARAMS+1
|
||
>PUSHWI 1024 get a ProDOS IO buffer
|
||
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
||
jsr S.GetMem
|
||
bcs .99
|
||
|
||
phx save Prodos Buffer hMem
|
||
>STYA MLICALL.PARAMS+3
|
||
>MLICALL MLIOPEN
|
||
bcs .98
|
||
lda MLICALL.PARAMS+5 get ref_num
|
||
plx get back Prodos Buffer hMem
|
||
rts CC
|
||
|
||
.98 plx get back Prodos Buffer hMem
|
||
pha save MLI error
|
||
txa
|
||
jsr S.FreeMemA discard Prodos Buffer
|
||
pla get back MLI error
|
||
sec
|
||
.99 rts
|
||
*--------------------------------------
|
||
* S.MLINewline
|
||
* in :
|
||
* PULLB = ref_num
|
||
* PULLB = Enable Mask
|
||
* PULLB = Newline Char
|
||
*--------------------------------------
|
||
S.MLINewLine >PULLB MLICALL.PARAMS+1
|
||
>PULLB MLICALL.PARAMS+2
|
||
>PULLB MLICALL.PARAMS+3
|
||
>MLICALL MLINEWLINE
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLIRead
|
||
* in :
|
||
* PULLB = ref_num
|
||
* PULLW = Dest PTR
|
||
* PULLW = Bytes To Read
|
||
* out :
|
||
* Y,A = Bytes Read
|
||
*--------------------------------------
|
||
S.MLIRead >PULLB MLICALL.PARAMS+1
|
||
>PULLW MLICALL.PARAMS+2
|
||
>PULLW MLICALL.PARAMS+4
|
||
>MLICALL MLIREAD
|
||
bcs .9
|
||
>LDYA MLICALL.PARAMS+6
|
||
.9 rts
|
||
*--------------------------------------
|
||
* S.MLIWrite
|
||
* in :
|
||
* PULLB = ref_num
|
||
* PULLW = Src PTR
|
||
* PULLW = Bytes To Write
|
||
* out :
|
||
* Y,A = Bytes Written
|
||
*--------------------------------------
|
||
S.MLIWrite >PULLB MLICALL.PARAMS+1
|
||
>PULLW MLICALL.PARAMS+2
|
||
>PULLW MLICALL.PARAMS+4
|
||
>MLICALL MLIWRITE
|
||
bcs .9
|
||
>LDYA MLICALL.PARAMS+6
|
||
.9 rts
|
||
*--------------------------------------
|
||
* S.MLICloseA
|
||
* in :
|
||
* A = ref_num
|
||
* out :
|
||
*--------------------------------------
|
||
S.MLICloseA sta MLICALL.PARAMS+1
|
||
>MLICALL MLICLOSE
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLIGetEOF
|
||
* in :
|
||
* A = ref_num
|
||
* out :
|
||
* Y,A,X = EOF
|
||
*--------------------------------------
|
||
S.MLIGetEOFA sta MLICALL.PARAMS+1
|
||
>MLICALL MLIGETEOF
|
||
bcs .9
|
||
>LDYA MLICALL.PARAMS+2
|
||
ldx MLICALL.PARAMS+4
|
||
clc
|
||
.9 rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE SYS/KERNEL.S.MLI
|
||
LOAD SYS/KERNEL.S
|
||
ASM
|