KERNEL 0.94-2

This commit is contained in:
burniouf 2021-07-25 16:03:41 +02:00
parent 7fb016f47c
commit 631571cc6e
7 changed files with 756 additions and 734 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -124,27 +124,19 @@ CIFS2.MKDir jsr ReadSocket
*-------------------------------------- *--------------------------------------
CIFS.OpenDir >STYA pPath resolved path CIFS.OpenDir >STYA pPath resolved path
>LDYAI S.FD.DIR jsr CIFS.NewFD
>SYSCALL2 GetMem
bcs .9 bcs .9
>STYA ZPPtr2
stx hFD
lda #S.FD.T.DIR lda #S.FD.T.DIR
sta (ZPPtr2) sta (pFD)
lda hHandler
ldy #S.FD.PFT
sta (ZPPtr2),y
lda #0 lda #0
ldy #S.FD.DIR.EPB ldy #S.FD.DIR.EPB
sta (ZPPtr2),y EOF Flag sta (pFD),y EOF Flag
iny iny
sta (ZPPtr2),y sta (pFD),y
iny iny
sta (ZPPtr2),y sta (pFD),y
>PUSHW pPath >PUSHW pPath
>PUSHWZ >PUSHWZ
@ -153,6 +145,8 @@ CIFS.OpenDir >STYA pPath resolved path
bcc .9 bcc .9
jsr CIFS.FreeFD jsr CIFS.FreeFD
stz CIFS.Status
sec sec
.9 rts .9 rts
@ -161,7 +155,7 @@ CIFS2.OpenDir lda #MLI.E.BADCALL
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CIFS.ReadDir jsr GetPFD CIFS.ReadDir jsr CIFS.GetFD
* jsr ClearSocket * jsr ClearSocket
@ -247,7 +241,7 @@ CIFS.ReadDir.Send
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CIFS2.ReadDir jsr GetPFD CIFS2.ReadDir jsr CIFS.GetFD
jsr ReadSocket jsr ReadSocket
bcs .9 bcs .9
@ -588,6 +582,9 @@ CIFS2.FOpen jsr ReadSocket
jsr CIFS.NewFD jsr CIFS.NewFD
bcs .91 bcs .91
lda #S.FD.T.REG
sta (pFD)
ldy #S.NETBIOS+S.SMB.H+6 FileID ldy #S.NETBIOS+S.SMB.H+6 FileID
lda (ZPRespPtr),y lda (ZPRespPtr),y
@ -644,7 +641,7 @@ CIFS2.FOpen jsr ReadSocket
sec sec
.91 stz CIFS.Status .91 stz CIFS.Status
jmp FreeRespData jsr FreeRespData
bra .90 bra .90
.9 jsr Exit.NODATA .9 jsr Exit.NODATA
@ -654,7 +651,7 @@ CIFS2.FOpen jsr ReadSocket
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CIFS.FClose jsr GetPFD CIFS.FClose jsr CIFS.GetFD
jsr GetCtx jsr GetCtx
@ -713,10 +710,10 @@ CIFS2.FClose sta hFILE
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CIFS.FRead ldy #4 hNod CIFS.FRead ldy #4 hFILE
lda (pStack),y lda (pStack),y
jsr GetPFD jsr CIFS.GetFD
jsr GetCtx jsr GetCtx
@ -856,10 +853,10 @@ CIFS2.FRead jsr ReadSocket
.90 >POP 5 .90 >POP 5
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CIFS.FWrite ldy #4 hNod CIFS.FWrite ldy #4 hFILE
lda (pStack),y lda (pStack),y
jsr GetPFD jsr CIFS.GetFD
jsr GetCtx jsr GetCtx
@ -1006,14 +1003,14 @@ CIFS.FFlush clc Nothing to do
*-------------------------------------- *--------------------------------------
CIFS2.FFlush CIFS2.FFlush
*-------------------------------------- *--------------------------------------
CIFS.FSeek ldy #5 hNod CIFS.FSeek ldy #5 hFILE
lda (pStack),y lda (pStack),y
jsr GetPFD jsr CIFS.GetFD
>PULLA >PULLA
tax whence tax whence
>PULLL DWORD >PULLL ZPPtr1 ZPPtr2
inc pStack inc pStack
@ -1165,16 +1162,34 @@ CIFS2.Rename jsr ReadSocket
.99 >RET 4 .99 >RET 4
*-------------------------------------- *--------------------------------------
CIFS.NewFD >LDYAI S.FD.REG CIFS.NewFD ldx #1
.1 lda hFDs-1,x
beq .2
inx
cpx #K.hFD.MAX+1
bne .1
lda #E.OOH
* sec
rts
.2 stx hFILE
>LDYAI 16 S.FD.REG = S.FD.DIR = 16
>SYSCALL2 GetMem >SYSCALL2 GetMem
bcs .9 bcs .9
>STYA pFD >STYA pFD
stx hFD stx hFD
lda #S.FD.T.REG txa
sta (pFD) ldx hFILE
sta hFDs-1,x
stz hFDs.hName-1,x
lda hHandler lda hHandler
ldy #S.FD.PFT ldy #S.FD.PFT
sta (pFD),y sta (pFD),y
@ -1183,9 +1198,28 @@ CIFS.NewFD >LDYAI S.FD.REG
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
CIFS.GetFD sta hFILE
tax
phx
lda hFDs.hName-1,x
>SYSCALL2 GetMemPtr
>STYA pPath
plx
lda hFDs-1,x
>SYSCALL2 GetMemPtr
>STYA pFD
rts
*--------------------------------------
CIFS.FreeFD pha CIFS.FreeFD pha
lda hFD lda hFD
>SYSCALL2 FreeMem >SYSCALL2 FreeMem
ldx hFILE
stz hFDs-1,x
pla pla
rts rts
*-------------------------------------- *--------------------------------------
@ -1212,10 +1246,10 @@ CIFS.RWGetFidOfs
*-------------------------------------- *--------------------------------------
CIFS2.RWSetOfsY phy CIFS2.RWSetOfsY phy
ldy #4 hNod ldy #4 hFILE
lda (pStack),y lda (pStack),y
jsr GetPFD jsr CIFS.GetFD
ply Count LO ply Count LO
phy phy

View File

@ -19,7 +19,7 @@ ZS.START
ZPReqPtr .BS 2 ZPReqPtr .BS 2
ZPReqLen .BS 2 ZPReqLen .BS 2
ZPCtxPtr .BS 2 ZPCtxPtr .BS 2
pFD .BS 2 ZPRespPtr .BS 2
ZPPtr1 .BS 2 ZPPtr1 .BS 2
ZPPtr2 .BS 2 ZPPtr2 .BS 2
@ -31,11 +31,10 @@ pPath .BS 2
flags .BS 1 flags .BS 1
ftype .BS 1 ftype .BS 1
auxtype .BS 2 auxtype .BS 2
ZPRespPtr .BS 2 pFD .BS 2
bFlag .BS 1 bFlag .BS 1
ByteCountOfs .BS 1 ByteCountOfs .BS 1
DWORD .BS 4
ZS.END .ED ZS.END .ED
*-------------------------------------- *--------------------------------------
@ -521,19 +520,6 @@ CIFS.CallBack bit CIFS.Status
ply ply
jmp (J.CIFS2,x) jmp (J.CIFS2,x)
*-------------------------------------- *--------------------------------------
GetPFD tax
phx
lda hFDs.hName-1,x
>SYSCALL2 GetMemPtr
>STYA pPath
plx
lda hFDs-1,x
>SYSCALL2 GetMemPtr
>STYA pFD
rts
*--------------------------------------
GetCTX lda MountTable+2 GetCTX lda MountTable+2
>SYSCALL2 GetMemPtr >SYSCALL2 GetMemPtr
>STYA ZPCtxPtr >STYA ZPCtxPtr

View File

@ -356,10 +356,10 @@ DS1216E.DATA2 .EQ A1L
*-------------------------------------- *--------------------------------------
LDR.ClkDevScan php LDR.ClkDevScan php
sei sei
lda RDCXROM lda RDCXROM
php php
sta SETCXROM sta SETCXROM
* sta $C100 * sta $C100
@ -387,9 +387,9 @@ LDR.ClkDevScan php
.3 lda DS1216E.SIG-1,y .3 lda DS1216E.SIG-1,y
phy phy
ldy #8 ....of 8 bits ldy #8 ....of 8 bits
.4 ldx #0 .4 ldx #0
lsr lsr
bcc .5 bcc .5
@ -420,7 +420,7 @@ LDR.ClkDevScan php
plp plp
bmi .8 bmi .8
sta CLRCXROM sta CLRCXROM
.8 plp .8 plp
@ -444,7 +444,7 @@ LDR.ClkDevScan php
LDR.ClkDevTCLK stz idxl LDR.ClkDevTCLK stz idxl
lda #$C1 lda #$C1
sta idxl+1 sta idxl+1
lda #1 lda #1
sta LDR.SlotIdx sta LDR.SlotIdx
@ -615,7 +615,7 @@ LDR.BlkDevScan stz idxl
cpx #2 CS if 2 devs or more cpx #2 CS if 2 devs or more
jsr LDR.AddBlkDevs install 1 or 2 devices from this slot. jsr LDR.AddBlkDevs install 1 or 2 devices from this slot.
.7 .7
.8 dec idxl+1 next lower slot. .8 dec idxl+1 next lower slot.
dec LDR.SlotIdx have all slots been checked ? dec LDR.SlotIdx have all slots been checked ?
@ -875,7 +875,7 @@ LDR.CheckDiskID ldy #5
clc clc
php php
.8 ldx LDR.SlotIdx .8 ldx LDR.SlotIdx
lda sltbit-1,x lda sltbit-1,x
@ -883,18 +883,18 @@ LDR.CheckDiskID ldy #5
.9 plp .9 plp
rts rts
.3 sec .3 sec
php php
ldx #0 ldx #0
.4 cmp (idxl),y .4 cmp (idxl),y
bne .9 bne .9
inx inx
bne .4 bne .4
bra .8 bra .8
*-------------------------------------- *--------------------------------------
LDR.SetDevID ldy #$FE check attributes byte. LDR.SetDevID ldy #$FE check attributes byte.
@ -907,34 +907,37 @@ LDR.SetDevID ldy #$FE check attributes byte.
sta devid sta devid
rts rts
*-------------------------------------- *--------------------------------------
LDR.Scr80Select php LDR.Scr80Select jsr LDR.IsIIc
bcs .99
php
sei sei
sta SETC3ROM sta SETC3ROM
ldx #COL80IDX.Cnt-1 ldx #COL80IDX.Cnt-1
.1 ldy COL80IDX,x .1 ldy COL80IDX,x
lda $C300,y lda $C300,y
cmp COL80VAL,x cmp COL80VAL,x
bne .9 bne .9
dex dex
bpl .1 bpl .1
lda $C30C is it an apple 80 col compatible card? lda $C30C is it an apple 80 col compatible card?
and #$F0 and #$F0
cmp #$80 cmp #$80
bne .9 bne .9
plp plp
rts rts
.9 sta CLRC3ROM .9 sta CLRC3ROM
plp plp
rts .99 rts
*-------------------------------------- *--------------------------------------
LDR.Scr80Init lda #$8C Reset 80 col screen ($0C:HOME) LDR.Scr80Init lda #$8C Reset 80 col screen ($0C:HOME)
jsr $C300 jsr $C300
@ -965,6 +968,7 @@ LDR.Scr80Init lda #$8C Reset 80 col screen ($0C:HOME)
sta SETIOUDIS sta SETIOUDIS
sta SETDHIRES sta SETDHIRES
bmi .10 bmi .10
sta CLRIOUDIS sta CLRIOUDIS
.10 sta CLRTEXT .10 sta CLRTEXT
@ -1088,6 +1092,15 @@ LDR.PrintX bit RROMBNK2
sta CLRPAGE2 for screen holes proper access sta CLRPAGE2 for screen holes proper access
rts rts
*-------------------------------------- *--------------------------------------
LDR.IsIIc lda MACHID
and #MACHID.T
cmp #MACHID.T.IIc
beq .9
clc
.9 rts
*--------------------------------------
PALETTE.MAIN .HS 00.02.04.06.08.0A.0C.0E PALETTE.MAIN .HS 00.02.04.06.08.0A.0C.0E
.HS 01.03.05.07.09.0B.0D.0F .HS 01.03.05.07.09.0B.0D.0F
PALETTE.AUX .HS 00.01.02.03.04.05.06.07 PALETTE.AUX .HS 00.01.02.03.04.05.06.07

View File

@ -190,7 +190,7 @@ InitSrcDirYA >PUSHYA
bne .2 bne .2
.3 txa .3 txa
beq .91 no wc, file not found.... beq .90 no wc, file not found....
.4 jsr GetPtr1Len Search end of string..... .4 jsr GetPtr1Len Search end of string.....
@ -253,8 +253,8 @@ InitSrcDirYA >PUSHYA
clc clc
rts rts
.91 lda #MLI.E.FNOTFND .90 lda #MLI.E.FNOTFND
.9 pha .9 pha
>LDA.G hFullPath >LDA.G hFullPath
@ -357,7 +357,7 @@ InitDstDirYA >PUSHYA
.7 jsr .9 Cleanup .7 jsr .9 Cleanup
clc clc
.99 rts rts
.9 pha .9 pha
>LDA.G hFullPath >LDA.G hFullPath
@ -551,43 +551,47 @@ EnterSubDirY lda (pData),y
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
LeaveSubDir >LDA.G index LeaveSubDir >LDA.G index
beq .9 beq .7
jsr GethDIRENT.A jsr GethDIRENT.A
jsr LeaveSubDir.free
jsr GethDIR
beq .1 beq .1
pha
lda #0
sta (pData),y
pla
>SYSCALL FreeMem
.1 jsr GethDIR
pha pha
lda #0 lda #0
sta (pData),y sta (pData),y
pla pla
>SYSCALL CloseDir >SYSCALL CloseDir
>DEC.G index .1 >DEC.G index
bne .8 bne .8
ldy #hSrcBasePath .7 >LDA.G hSrcBasePath
lda (pData),y jsr LeaveSubDir.free
>SYSCALL FreeMem
.DO X.COPY.TO.DEST=1 .DO X.COPY.TO.DEST=1
ldy #hDstBasePath >LDA.G hDstBasePath
lda (pData),y jsr LeaveSubDir.free
>SYSCALL FreeMem
.FIN .FIN
.9 sec sec
rts rts
.8 clc .8 clc
rts rts
*--------------------------------------
LeaveSubDir.free
tax
beq .8
lda #0
sta (pData),y
txa
>SYSCALL FreeMem
.8 rts
*-------------------------------------- *--------------------------------------
BasePath.. .DO X.COPY.TO.DEST=1 BasePath.. .DO X.COPY.TO.DEST=1

View File

@ -142,11 +142,6 @@ DEV.WRITE ldx #IOCTL.WRITE
*\-------------------------------------- *\--------------------------------------
K.MKDev jsr SHARED.PullP2P1 ptr2=name,tr1=fd K.MKDev jsr SHARED.PullP2P1 ptr2=name,tr1=fd
jsr DEV.GetFreeFD
bcs .9
stx IO.hFILE
ldy #$ff ldy #$ff
ldx #S.FD.DEV ldx #S.FD.DEV
@ -157,22 +152,13 @@ K.MKDev jsr SHARED.PullP2P1 ptr2=name,tr1=fd
txa txa
tay tay
lda #0 lda #S.FD.T.CDEV
jsr K.GetMem jsr DEV.MkFDy
bcs .9 bcs .9
>STYA pFD
>STYA .4+1 >STYA .4+1
stx IO.hFD
txa
ldx IO.hFILE
sta hFDs-1,x
stz hFDs.hName-1,x
ldy #S.FD.DEV-1 ldy #S.FD.DEV-1
.2 lda (ZPPtr1),y .2 lda (ZPPtr1),y
@ -267,15 +253,25 @@ DEV.GetPDrv ldy #S.FD.DEV.DRVPTR
rts rts
*-------------------------------------- *--------------------------------------
DEV.MkFD sta .8+1 S.FD.T DEV.MkFD ldy #16 Y = Size, MAX=16 for S.FD.DIR
jsr DEV.GetFreeFD
bcs .9
stx IO.hFILE
ldy #16 MAX=16 for S.FD.DIR
DEV.MkFDy sta .8+1 A = S.FD.T
ldx #1
.1 lda hFDs-1,x
beq .2
inx
cpx #K.hFD.MAX+1
bne .1
lda #E.OOH
* sec
rts
.2 stx IO.hFILE
lda #0 lda #0
ldx #S.MEM.F.INIT0+S.MEM.F.FD ldx #S.MEM.F.INIT0+S.MEM.F.FD
jsr MEM.GetMem.YAX jsr MEM.GetMem.YAX
@ -284,6 +280,8 @@ DEV.MkFD sta .8+1 S.FD.T
>STYA pFD >STYA pFD
stx IO.hFD stx IO.hFD
pha
txa txa
.7 ldx IO.hFILE .7 ldx IO.hFILE
@ -292,27 +290,13 @@ DEV.MkFD sta .8+1 S.FD.T
stz hFDs.hName-1,x stz hFDs.hName-1,x
.8 lda #$ff SELF MODIFIED .8 lda #$ff SELF MODIFIED
sta (pFD) X = hFD, A = T sta (pFD)
pla Y,A = pFD, X = hFILE
* clc * clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
DEV.GetFreeFD ldx #1
clc
.1 lda hFDs-1,x
beq .8
inx
cpx #K.hFD.MAX+1
bne .1
lda #E.OOH
* sec
.8 rts
*--------------------------------------
DEV.hFDFree lda IO.hFD DEV.hFDFree lda IO.hFD
beq .8 beq .8