Kernel 0.93+

This commit is contained in:
Rémy GIBERT 2020-01-06 08:03:37 +01:00
parent e0b8b9dfcc
commit 66ceadb5f2
11 changed files with 179 additions and 83 deletions

1
.Floppies/A2OSX.BLANK.nib generated Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -20,12 +20,15 @@ ZPPtr2 .BS 2
ZPPtrFD .BS 2
ZPPtrDevName .BS 2
ArgIndex .BS 1
Index .BS 1
hDevID .BS 1
hBuf .BS 1
hMem .BS 1
bLL .BS 1
bCustomBlkSize .BS 1
MediaBlkSize .BS 2
CatSize .BS 1
CatBlkCnt .BS 1
@ -58,8 +61,12 @@ L.LIBBLKDEV .DA LIBBLKDEV
L.MSG.USAGE .DA MSG.USAGE
L.MSG.OK .DA MSG.OK
L.MSG.ERR .DA MSG.ERR
L.MSG.CRLF .DA MSG.CRLF
L.MSG.NOSIZE .DA MSG.NOSIZE
L.MSG.INIT .DA MSG.INIT
L.MSG.LLDISK2 .DA MSG.LLDISK2
L.MSG.LL .DA MSG.LL
L.MSG.WRITECAT .DA MSG.WRITECAT
L.FMT.BLANK .DA FMT.BLANK
.DA 0
*--------------------------------------
@ -74,8 +81,8 @@ CS.RUN ldy #S.PS.ARGC
lda (pPs),y
beq .99
.1 inc ArgIndex
lda ArgIndex
.1 inc Index
lda Index
>SYSCALL ArgV
bcc .11
@ -104,8 +111,8 @@ CS.RUN ldy #S.PS.ARGC
cpy #bCustomBlkSize
bne .1
inc ArgIndex
lda ArgIndex
inc Index
lda Index
>SYSCALL ArgV
bcs .99
@ -118,14 +125,14 @@ CS.RUN ldy #S.PS.ARGC
>SYSCALL printf
lda #E.SYN
sec
rts
.9 rts
.4 lda hDevID
bne .5 Already have a dev...go get VolName
>LDYA ZPPtr1
>SYSCALL GetDevByName
bcs .99
bcs .9
>STYA ZPPtrFD
stx hDevID
@ -147,14 +154,33 @@ CS.RUN ldy #S.PS.ARGC
.8 lda hDevID
beq .99
*--------------------------------------
CS.RUN.Format jsr CS.RUN.GetBlockSize
CS.RUN.Format jsr CS.RUN.GetDevStatus
bcs .9
jsr CS.RUN.InitCat
>PUSHEA.G VolName
>PUSHW MediaBlkSize
>PUSHW ZPPtrDevName
>PUSHBI 6
>LDYA L.MSG.INIT
>SYSCALL printf
bcs .9
bit bLL
bpl .1
jsr CS.RUN.LL
bcs .9
.1 jsr CS.RUN.InitCat
bcs .9
jsr CS.RUN.BuildCat
bcs .9
jsr CS.RUN.WriteCat
bcs .9
>LDYA L.MSG.OK
>SYSCALL puts
lda #0
@ -170,7 +196,7 @@ CS.RUN.Format jsr CS.RUN.GetBlockSize
sec
rts
*--------------------------------------
CS.RUN.GetBlockSize
CS.RUN.GetDevStatus
lda bCustomBlkSize
bmi .8
@ -198,6 +224,51 @@ CS.RUN.GetBlockSize
sec
rts
*--------------------------------------
CS.RUN.LL >LDA.G DIB+S.DIB.T
cmp #S.DIB.T.DISKII
beq CS.RUN.LL.DISKII
>PUSHBI 0
>LDYA L.MSG.LL
>SYSCALL printf
bcs .9
>PUSHEA.G IOCTL
>PUSHBI IOCTL.FORMAT
lda hDevID
>SYSCALL IOCTL
.9 rts
*--------------------------------------
CS.RUN.LL.DISKII
>LDYAI 4096
>SYSCALL getmem0
bcs .9
>STYA ZPPtr1
stx hMem
stz Index
.1 >PUSHB Index
>PUSHBI 1
>LDYA L.MSG.LLDISK2
>SYSCALL printf
bcs .9
inc Index
lda Index
cmp #35
bne .1
>PUSHBI 0
>LDYA L.MSG.CRLF
>SYSCALL printf
.9 rts
*--------------------------------------
CS.RUN.InitCat lda CatSize
bne .1
@ -218,16 +289,7 @@ CS.RUN.InitCat lda CatSize
.8 clc
rts
*--------------------------------------
CS.RUN.BuildCat >PUSHEA.G VolName
>PUSHW MediaBlkSize
>PUSHW ZPPtrDevName
>PUSHBI 6
>LDYA L.MSG.INIT
>SYSCALL printf
bcs .9
jsr .7
CS.RUN.BuildCat jsr .7
>LIBCALL hLIBBLKDEV,LIBBLKDEV.GetProDOSCatSize
bcs .9
@ -238,7 +300,9 @@ CS.RUN.BuildCat >PUSHEA.G VolName
bcs .9
>STYA.G IOCTL+S.IOCTL.BUFPTR
stx hBuf
jsr .7
>PUSHEA.G VolName
>PUSHW.G IOCTL+S.IOCTL.BUFPTR
>LIBCALL hLIBBLKDEV,LIBBLKDEV.BuildProDOSCat
@ -249,14 +313,21 @@ CS.RUN.BuildCat >PUSHEA.G VolName
>PUSHB CatOptions
rts
*--------------------------------------
CS.RUN.WriteCat >PUSHEA.G IOCTL
CS.RUN.WriteCat >PUSHBI 0
>LDYA L.MSG.WRITECAT
>SYSCALL printf
.1 >PUSHEA.G IOCTL
>PUSHBI IOCTL.WRITEBLOCK
lda hDevID
>SYSCALL IOCTL
bcs .9
lda #'.'
>SYSCALL PutChar
bcs .9
>LDA.G IOCTL+S.IOCTL.BUFPTR+1
inc
inc
@ -264,7 +335,9 @@ CS.RUN.WriteCat >PUSHEA.G IOCTL
>INC.G IOCTL+S.IOCTL.BLKNUM
>SLEEP
dec CatBlkCnt
bne CS.RUN.WriteCat
bne .1
clc
.9 rts
*--------------------------------------
CS.DOEVENT sec
@ -272,9 +345,17 @@ CS.DOEVENT sec
*--------------------------------------
CS.QUIT lda hBuf
beq .1
>SYSCALL FreeMem
.1 lda hLIBBLKDEV
.1 lda hMem
beq .2
>SYSCALL FreeMem
.2 lda hLIBBLKDEV
beq .8
>SYSCALL UnloadLib
.8 clc
rts
@ -308,9 +389,13 @@ MSG.USAGE .AS "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n"
.AS " -B xxxx : override Device block size\r\n"
.AZ " -1-9 : Catalog Size (Blocks)\r\n"
MSG.OK .AZ "[OK]"
MSG.ERR .AZ "[%h]\r\n"
MSG.ERR .AS "[%h]"
MSG.CRLF .AZ "\r\n"
MSG.NOSIZE .AZ "Unable to get media size."
MSG.INIT .AZ "Formatting %s (%D Blks),Volname:%s..."
MSG.INIT .AZ "Formatting %s (%D Blks), Volname:%s\r\n"
MSG.LLDISK2 .AZ "\rTrack %02d..."
MSG.LL .AZ "\rLow Level Format..."
MSG.WRITECAT .AZ "Writing Catalog..."
FMT.BLANK .AZ "BLANK%H%H"
*--------------------------------------
OptionList .AS "LlBb"

View File

@ -286,8 +286,8 @@ CL.PrintEOL >LDA.G CL.Ptr
CL.PrintEOL.8 clc
rts
*--------------------------------------
CL.PrintCLBuf >LDYA ZPCLBuf
>PUSHYA
CL.PrintCLBuf >PUSHW ZPCLBuf
ldy #S.PS.hStdOut
lda (pPs),y
>SYSCALL fputs

View File

@ -167,36 +167,21 @@ CMD.SET lda (ZPArgVBufPtr)
>STYA ZPPTR1
.1 lda (ZPPTR1)
beq .8 Ending 0 ?
beq .9 Ending 0 ?
jsr GetPtr1LenY
>PUSHW L.MSG.PRINTENV
tya
sec
adc ZPPTR1
sta ZPPTR2
lda #0
adc ZPPTR1+1
sta ZPPTR2+1
>PUSHW ZPPTR2 Push value
>PUSHW ZPPTR1 Push name
jsr CMD.SET.PRINT
jsr GetPtr1NextString
bcs .9
>PUSHW ZPPTR1 Push value
jsr GetPtr1NextString
>PUSHBI 4
>SYSCALL printf2
bcc .1
ldy #$ff
.3 iny
lda (ZPPTR2),y
bne .3
tya
sec
adc ZPPTR2
sta ZPPTR1
lda #0
adc ZPPTR2+1
sta ZPPTR1+1
bra .1
.8 clc
.9 rts
*--------------------------------------
* SET +X VAR = VALUE1 op VALUE2 op VALUE3 ...
@ -263,6 +248,7 @@ CMD.SET.1
.8 clc
.9 rts
.99 jmp CMD.E.CSYN
CMD.SET.YA >PUSHYA
@ -280,13 +266,15 @@ CMD.SET.GET >LDYA ZPVarNamePtr
clc
rts
.1 >PUSHYA push value
>LDYA ZPVarNamePtr
>PUSHYA push name
*--------------------------------------
CMD.SET.PRINT >PUSHBI 4
>LDYA L.MSG.PRINTENV
>SYSCALL printf
.1 pha
>PUSHW L.MSG.PRINTENV
>PUSHW ZPVarNamePtr push name
pla
>PUSHYA push value
>PUSHBI 4
>SYSCALL printf2
rts
*--------------------------------------
CMD.SET.EXEC jsr CORE.ArgV.NextChar skip "`"
@ -347,13 +335,15 @@ CMD.ECHO stz ZPPtr1 echo -N
beq .3
lda #C.SPACE
>SYSCALL putchar
.3 >PUSHBI 0
>LDYA ZPArgVBufPtr
>SYSCALL printf
.3 jsr CMD.PrintArgVBufPtr
bcs .9
inc ZPPtr1+1
.4 jsr CORE.ArgV.Next
bne .1
.7 bit ZPPtr1
bmi .8
@ -371,7 +361,7 @@ CMD.ECHO.CSYN lda #E.CSYN
CMD.ECHO.RTS rts
*--------------------------------------
CMD.READ lda (ZPArgVBufPtr)
beq .9
beq CMD.ECHO.CSYN
stz ZPVarNamePtr+1
>STZ.G bREAD.S
@ -392,21 +382,17 @@ CMD.READ lda (ZPArgVBufPtr)
bne .3
jsr CORE.ArgV.Next
beq .9
beq CMD.ECHO.CSYN
>PUSHBI 0
>LDYA ZPArgVBufPtr
>SYSCALL printf
jsr CMD.PrintArgVBufPtr
bcs CMD.ECHO.RTS
bra .5
.9 jmp CMD.E.CSYN
.3 cmp #'N'
bne .9
bne CMD.ECHO.CSYN
jsr CORE.ArgV.Next
beq .9
beq CMD.ECHO.CSYN
jsr EXP.GetInt8Arg
bcs CMD.ECHO.RTS
@ -421,7 +407,7 @@ CMD.READ lda (ZPArgVBufPtr)
bne .1
lda ZPVarNamePtr+1
beq .9
beq CMD.ECHO.CSYN
CMD.READ.VAR jsr CL.Reset
@ -1033,13 +1019,13 @@ CMD.NEXT.LIST.TOKEN
lda (pData),y
sta ZPPtr1+1
ldy #0
.10 jsr GetPtr1Next
.10 jsr GetPtr1NextChar
beq .3
cmp #C.SPACE
beq .10
sta (ZPCLBuf),y
iny
.1 jsr GetPtr1Next
.1 jsr GetPtr1NextChar
beq .3
cmp #C.SPACE
@ -1248,6 +1234,12 @@ CMD.IsSwitch lda (ZPArgVBufPtr)
CMD.IsSwitch.RTS
rts
*--------------------------------------
CMD.PrintArgVBufPtr
>PUSHBI 0
>LDYA ZPArgVBufPtr
>SYSCALL printf
rts
*--------------------------------------
MAN
SAVE USR/SRC/BIN/SH.S.CMD
LOAD USR/SRC/BIN/SH.S

View File

@ -357,6 +357,7 @@ CORE.Lookup >STYA ZPPtr2
lda #E.SYN
sec
rts
.7 iny
lda (ZPPtr2),y Get Src text char...
beq .9 end of text

View File

@ -353,9 +353,12 @@ CS.RUN.BATCH >LDA.G bSET.X
lda (ZPInputBufPtr),y
sta (ZPArgVBuf),y
beq .4
eor #C.CR
bne .3
sta (ZPArgVBuf),y
.4 >PUSHW ZPArgVBuf
>PUSHBI 2
>LDYA L.MSG.TRACE
@ -488,11 +491,12 @@ RemoveStrFromArgV
jsr StrCpyPtr1Ptr2
tya
beq .8
jsr AddAp1Ptr2
bra .2
.8 rts
*--------------------------------------
GetPtr1Next lda (ZPPtr1)
GetPtr1NextChar lda (ZPPtr1)
beq IncPtr1.8
IncPtr1 inc ZPPtr1
@ -506,6 +510,9 @@ GetPtr1LenY ldy #$ff
bne .1
rts
*--------------------------------------
GetPtr1NextString
jsr GetPtr1LenY
*--------------------------------------
AddYp1Ptr1 tya
AddAp1Ptr1 sec
.HS 90 BCC

View File

@ -16,7 +16,7 @@ GAP1 .EQ 48
GAP2 .EQ 6
GAP3 .EQ 27
*--------------------------------------
Status.PrvDrvOff .EQ $80 Waiting old drive stop spining
Status.PrvDrvOff .EQ $80 Waiting old drive stop spinning
Status.DrvOn .EQ $81 Waiting target drive spin
Status.seek .EQ $82 target drive seeking
*--------------------------------------
@ -304,7 +304,7 @@ D2TrkRNIB
*\--------------------------------------
D2TrkR16s
*/--------------------------------------
* # TrkW16s
* # D2TrkW16s
* Write a track (16 sectors)
* **In:**
* PUSHW = Ptr to 16*256 buffer
@ -315,12 +315,14 @@ D2TrkR16s
* CS : A = Error
* A=0, currently starting/seeking...
*\--------------------------------------
D2TrkW16s
D2TrkW16s >PULLB DrvSlt
>PULLB TrkNum
>PULLW ZPPtr1
clc
rts
*/--------------------------------------
* # TrkWNIB
* # D2TrkWNIB
* Write a track (NIBBLE)
* **In:**
* PUSHW = Ptr to NIBBLE buffer (0 ended)
@ -337,21 +339,26 @@ D2TrkWNIB >PULLB DrvSlt
lda Status Lib is busy....?
beq .10
lda DrvSlt
cmp DrvSltInUse resume previous access ?
.10 lda DEVNUM last drive accessed by ProDOS
and #$F0 only DSSS
pha
jsr CheckDiskII was it a DISK II ?
bcs .1 no, no need to check if spinning
pla
pha
jsr DrvSpinCheck
bcc .1 not spinning....continue
pla
sta D2DrvOff,x
lda #Status.PrvDrvOff
jmp SetStatusAndExit
.1 pla
cmp DrvSlt
* beq
@ -362,7 +369,6 @@ D2TrkWNIB >PULLB DrvSlt
clc
.9 rts
*--------------------------------------
SetStatusAndExit
sta Status
@ -445,7 +451,7 @@ TrkWriter.Start lda D2ReadMode,x
ldy #0
.1 lda (ZPPtr1),y (5) as NibbleBuf is page alligned, no page crossing
.1 lda (ZPPtr1),y (5) as NibbleBuf is page aligned, no page crossing
beq .8 (2)(3 if Z) END OF TRACK
* nobody will never try to write 00000000, right?
cmp #$80 (2) if CC, it is a sync byte
@ -486,9 +492,11 @@ TrkWriter.Start lda D2ReadMode,x
plp
clc
rts
.9 lda #$2B Write Protected
sec
rts
TrkWriter.Size .EQ *-TrkWriter.Start
.EP
*--------------------------------------

View File

@ -413,12 +413,14 @@ LDR.ClkDevScan php
.9 lda DS1216E.DATA1,x
cmp DS1216E.DATA2,x
bne LDR.ClkDevTCLK
bne .90
dex
bpl .9
bra LDR.ClkDevTCLK
lda #'N'
.90 lda #'N'
ldx PAKME.NCLK
ldy PAKME.NCLK+1
bra LDR.SetupCLK