mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 20:33:13 +00:00
152 lines
3.4 KiB
Plaintext
152 lines
3.4 KiB
Plaintext
PR#3
|
||
PREFIX /A2OSX.BUILD
|
||
NEW
|
||
INC 1
|
||
AUTO 6
|
||
.LIST OFF
|
||
.OP 65C02
|
||
*--------------------------------------
|
||
* PUBLIC
|
||
*--------------------------------------
|
||
S.MLICreate
|
||
S.MLIDestroy
|
||
S.MLIRename
|
||
S.MLISetFileInfo
|
||
*--------------------------------------
|
||
* S.MLIGetFileInfoA
|
||
* in :
|
||
* A = hMem To FileName
|
||
* out :
|
||
* Y,A = PTR To Buffer (L=15)
|
||
*--------------------------------------
|
||
S.MLIGetFileInfoA
|
||
jsr S.GetMemPtrA
|
||
S.MLIGetFileInfo
|
||
>STYA MLICALL.PARAMS+1
|
||
>KMLICALL 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
|
||
>KMLICALL MLIONLINE
|
||
rts
|
||
*--------------------------------------
|
||
S.MLISetPrefix
|
||
*--------------------------------------
|
||
S.MLIGetPrefixA jsr S.GetMemPtrA
|
||
S.MLIGetPrefix >STYA MLICALL.PARAMS+1
|
||
>KMLICALL MLIGETPREFIX
|
||
rts
|
||
*--------------------------------------
|
||
* S.MLIOpenA
|
||
* in :
|
||
* A = hMem To FileName
|
||
* out :
|
||
* A = ref_num
|
||
* X = buf hMem
|
||
*--------------------------------------
|
||
S.MLIOpenA jsr S.GetMemPtrA
|
||
S.MLIOpen >STYA MLICALL.PARAMS+1
|
||
>PUSHWI 1024 get a ProDOS IO buffer
|
||
>PUSHBI S.MEM.F.ALIGN+S.MEM.F.NOMOV
|
||
jsr S.GetMem
|
||
bcs .99
|
||
phx save Prodos Buffer hMem
|
||
>STYA MLICALL.PARAMS+3
|
||
>KMLICALL 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
|
||
>KMLICALL 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
|
||
>KMLICALL MLIREAD
|
||
bcs .9
|
||
>LDYA MLICALL.PARAMS+6
|
||
.9 rts
|
||
*--------------------------------------
|
||
* S.MLIWrite
|
||
* in :
|
||
* PULLB = ref_num
|
||
* PULLW = Dest PTR
|
||
* PULLW = Bytes To Read
|
||
* out :
|
||
* Y,A = Bytes Written
|
||
*--------------------------------------
|
||
S.MLIWrite >PULLB MLICALL.PARAMS+1
|
||
>PULLW MLICALL.PARAMS+2
|
||
>PULLW MLICALL.PARAMS+4
|
||
>KMLICALL MLIWRITE
|
||
bcs .9
|
||
>LDYA MLICALL.PARAMS+6
|
||
.9 rts
|
||
*--------------------------------------
|
||
* S.MLIClose
|
||
* in :
|
||
* A = ref_num
|
||
* out :
|
||
*--------------------------------------
|
||
S.MLICloseA sta MLICALL.PARAMS+1
|
||
>KMLICALL MLICLOSE
|
||
rts
|
||
*--------------------------------------
|
||
S.MLIFlushA
|
||
S.MLISetMark
|
||
S.MLIGetMark
|
||
S.MLISetEOF
|
||
*--------------------------------------
|
||
* S.MLIGetEOF
|
||
* in :
|
||
* A = ref_num
|
||
* out :
|
||
* Y,A,X = EOF
|
||
*--------------------------------------
|
||
S.MLIGetEOFA sta MLICALL.PARAMS+1
|
||
>KMLICALL 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
|