Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-05-19 15:00:17 +02:00
parent 01fbc4c874
commit d1967faf4a
16 changed files with 165 additions and 106 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,7 @@ NEW
.LIST OFF
.OP 65C02
.OR $2000
.TF BIN/CHMOD
.TF bin/chmod
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I

View File

@ -598,6 +598,8 @@ hLIBBLKDEV .BS 1
*--------------------------------------
MSG.USAGE .AS "Usage : FORMAT <BLOCKDEV> [VOLUME.NAME]\r\n"
.AS " -L : Low-Level Format\r\n"
.AS " -H : 35trk drives, High Density: 47 tracks, 376 Blocks\r\n"
.AS " -X : 40trk drives, 320 Blocks, combined with -H = 432 Blocks\r\n"
.AS " -B xxxx : override Device block size\r\n"
.AZ " -1-9 : Catalog Size (Blocks)\r\n"
MSG.OK .AZ "[OK]"
@ -607,7 +609,7 @@ MSG.NOSIZE .AZ "Unable to get media size."
MSG.INIT .AZ "Formatting %s, Volname:%s\r\n"
MSG.LL .AZ "Low Level Format %D Blks\r\n"
MSG.LLDISK2 .AZ "\rWriting Track %02d (%02d/%02d)..."
MSG.VERIFY .AZ "\rVerifying Track %02d, Block:%05D..."
MSG.VERIFY .AZ "\rVerifying Track %02d, Block %05D..."
MSG.WRITECAT .AZ "Writing Catalog..."
FMT.BLANK .AZ "BLANK%H%H"
*--------------------------------------

View File

@ -176,11 +176,10 @@ CS.RUN.HOSTOK >INC.G ArgIndex
>SYSCALL ArgV
bcs .9
pha
>PUSHWZ Aux type
>PUSHBI S.FI.T.TXT
>PUSHYA
>PUSHBI O.RDONLY
pla
>PUSHBI S.FI.T.TXT
>PUSHWZ Aux type
>SYSCALL LoadTxtFile
bcs .9

View File

@ -35,11 +35,16 @@ CS.INIT clc
CS.RUN lda #1
>SYSCALL ArgV
bcs .99
>PUSHYA
>PUSHWI S.STAT.MODE.FO+S.STAT.MODE.FG+S.STAT.MODE.FU
>SYSCALL MKDir
bcs .9
lda #0
sec
.9 rts
.99 lda #E.SYN
sec
rts

View File

@ -59,8 +59,8 @@ CS.RUN.READ jsr NSC.Init
dex
bpl .1
>PUSHW L.MSG.READ.KO
>PUSHBI 0
>LDYA L.MSG.READ.KO
>SYSCALL PrintF
lda #MLI.E.NODEV
sec
@ -68,8 +68,8 @@ CS.RUN.READ jsr NSC.Init
.8 jsr NSC.Dump
>PUSHW L.MSG.USAGE
>PUSHBI 0
>LDYA L.MSG.USAGE
>SYSCALL PrintF
lda #0 tell TSKMGR that all done ok, but
sec we do not want to stay in memory
@ -235,42 +235,51 @@ NSC.Write php
.99 plp
rts
*--------------------------------------
NSC.Dump ldx #1
NSC.Dump >PUSHW L.MSG.READ.OK1
ldx #1
ldy #1
lda DS1216E.DATA+3
bit #%00010000
beq .1
dex
.1 bit #%00100000
beq .2
dey
.2 txa
.2 tya
>PUSHA
tya
txa
>PUSHA
>PUSHBI 2
>LDYA L.MSG.READ.OK1
>SYSCALL PrintF
>PUSHBI 2
>LDYA L.MSG.READ.OK2.24
bit DS1216E.DATA+4
bpl .3
>LDYA L.MSG.READ.OK2.12
.3 >SYSCALL PrintF
.3 >SYSCALL PutS
>PUSHBI 0
>LDYA L.MSG.READ.OK3
>SYSCALL PrintF
lda DS1216E.DATA
jsr PrintBCD
lda #'/'
>SYSCALL PutChar
lda DS1216E.DATA+1
jsr PrintBCD
lda #'/'
>SYSCALL PutChar
lda DS1216E.DATA+2
jsr PrintBCD
@ -283,21 +292,26 @@ NSC.Dump ldx #1
.4 and #$3F
jsr PrintBCD
lda #':'
>SYSCALL PutChar
lda DS1216E.DATA+5
jsr PrintBCD
lda #':'
>SYSCALL PutChar
lda DS1216E.DATA+6
jsr PrintBCD
* lda #'.'
* >SYSCALL PutChar
* lda DS1216E.DATA+7
* jsr PrintBCD
>PUSHW L.MSG.CRLF
>PUSHBI 0
>LDYA L.MSG.CRLF
>SYSCALL PrintF
rts
*--------------------------------------
@ -345,7 +359,7 @@ MSG.READ.KO .AZ "DS1216E Not Detected.\r\n"
MSG.READ.OK1 .AZ "DS1216E Detected : /OSC=%d, /RST=%d, mode="
MSG.READ.OK2.12 .AZ "am/pm"
MSG.READ.OK2.24 .AZ "24h"
MSG.READ.OK3 .AZ "\r\n\r\nCurrent Date/Time : "
MSG.READ.OK3 .AZ "\r\nCurrent Date/Time : "
MSG.USAGE .AS "\r\nTo Reset the chip and set clock, type:\r\nNSCUTIL YY/MM/DD,hh:mm:ss"
MSG.CRLF .AZ "\r\n"
DS1216E.PATTERN .HS 5CA33AC55CA33AC5 Reverted 7->0

View File

@ -82,8 +82,8 @@ CS.RUN >INC.G ArgIndex
jsr CS.RUN.CheckOpt
bcc CS.RUN
.9 >PUSHBI 0
>LDYA L.MSG.USAGE
.9 >PUSHW L.MSG.USAGE
>PUSHBI 0
>SYSCALL PrintF
lda #E.SYN
sec
@ -316,9 +316,9 @@ CS.RUN.FILE.LOOP
*--------------------------------------
CS.RUN.CheckErr bcc .9
pha
>PUSHW L.MSG.ERR
>PUSHA
>PUSHBI 1
>LDYA L.MSG.ERR
>SYSCALL PrintF
lda bContinue
eor #$80
@ -339,18 +339,21 @@ CS.RUN.GetFilePath
*--------------------------------------
CS.RUN.OpenFile ldx #12
ldy #fCharCount
lda #0
.1 sta (pData),y
iny
dex
bne .1
>PUSHWZ Aux type
>PUSHBI 0 Type
>PUSHW ZPFullPath
>PUSHBI O.RDONLY+O.TEXT
>LDYA ZPFullPath
>PUSHBI 0 Type
>PUSHWZ Aux type
>SYSCALL FOpen
bcs .9
>STA.G hFile
.9 rts

View File

@ -497,10 +497,13 @@ CS.RUN.Rename ldy #hSrcFullPath
*--------------------------------------
.DO X.COPY.TO.DEST=1
CS.RUN.CopyStart
>STZ.G hSrcFile
>STA.G hDstFile
ldy #hSrcFullPath
lda #O.RDONLY
jsr CS.RUN.Open
bcs .99
bcs .9
>STA.G hSrcFile
@ -518,14 +521,8 @@ CS.RUN.CopyStart
clc
rts
.9 pha
>LDA.G hSrcFile
>SYSCALL FClose
pla
sec
.99 >STA.G CopyRC
rts
.9 >STA.G CopyRC
jmp CS.RUN.CopyEnd
*--------------------------------------
CS.RUN.Open pha Save open mode
jsr CS.RUN.GetPathY
@ -558,41 +555,49 @@ CS.RUN.Copy >STZ.G hCopyBuf
>LDA.G hSrcFile
>SYSCALL FRead
bcc .1
cmp #MLI.E.EOF
bne .9
lda #0
bra .9
.1 >PUSHYA Bytes To Write
>PUSHW ZPPtr1 Src Ptr
>LDA.G hDstFile
>SYSCALL FWrite
bcs .9
>LDA.G hCopyBuf
>SYSCALL FreeMem
ldy #bQuiet
lda (pData),y
bmi .8
lda #'.'
>SYSCALL PutChar
rts
.8 clc
rts
.8 rts
.9 ldy #CopyRC
sta (pData),y
>LDA.G hCopyBuf
beq CS.RUN.CopyEnd
>SYSCALL FreeMem
*--------------------------------------
CS.RUN.CopyEnd >LDA.G hSrcFile
CS.RUN.CopyEnd php
pha
>LDA.G hSrcFile
>SYSCALL FClose
>LDA.G hDstFile
>SYSCALL FClose
>STZ.G bCopy
clc
pla
plp
rts
.FIN
*--------------------------------------
@ -679,11 +684,7 @@ CS.QUIT jsr LeaveSubDir
>LDA.G bCopy
bpl .1
>LDA.G hSrcFile
>SYSCALL FClose
>LDA.G hDstFile
>SYSCALL FClose
jsr CS.RUN.CopyEnd
.1 ldy #hDstFullPath
jsr .7

View File

@ -52,8 +52,10 @@ Dev.Detect >STYA ARGS
>LDYA L.MSG.DETECT
>SYSCALL PutS
stz ZPArgPtr
lda #$C1
sta ZPArgPtr+1
.1 and #$0f
tay
lda A2osX.S,y
@ -65,9 +67,12 @@ Dev.Detect >STYA ARGS
lda (ZPArgPtr),y
cmp DEVSIG.Value,x
bne .3
dex
bpl .2
bra .4
.3 inc FD.DEV.NAME+3
inc ZPArgPtr+1 no match, try next slot....
lda ZPArgPtr+1
@ -121,39 +126,48 @@ Dev.ParseArgs >LDYA ARGS
>STYA ZPArgPTR
lda (ZPArgPTR)
bne .1
clc
rts
.1 stz ZPhParity
stz ZPhControl
>LDYAI 256
>SYSCALL GetMem
bcs .2
>STYA ZPParityPtr
stx ZPhParity
>LDYAI 256
>SYSCALL GetMem
.2 bcs .90
>STYA ZPControlPtr
stx ZPhControl
>PUSHW ZPArgPtr
>PUSHW L.SSCANF.ARGS
>PUSHW ZPControlPtr
>PUSHW ZPParityPtr
>PUSHW L.DCB.STOP
>PUSHW L.DCB.DATA
>PUSHW L.DCB.BAUD
>PUSHW L.DCB.DATA
>PUSHW L.DCB.STOP
>PUSHW ZPParityPtr
>PUSHW ZPControlPtr
>PUSHBI 10 5 x byte PTRs
>SYSCALL sscanf
bcs .90
.90 lda ZPhControl
beq .91
>SYSCALL FreeMem
.91 lda ZPhParity
beq .92
>SYSCALL FreeMem
.92 lda #E.SYN

View File

@ -256,7 +256,7 @@ endcode ldx slotz
jmp seek
*--------------------------------------
BB.MSG.ERR .AS -"BOOT ERROR"
BB.MSG.ERR .AS -"ERROR"
BB.MSG.ERR.Len .EQ *-BB.MSG.ERR
BB.ProDOS .DA #$26 $20 = storage type + 6 = "PRODOS" len
.AS "PRODOS"
@ -323,40 +323,45 @@ seek lda BB.HdrTrk get track we're on
jsr BB.PhaseOn
lda #40
lda #60
jsr BB.MSWait Trash X
ldx slotz
lda IO.D2.Ph0Off,x
nop
lda IO.D2.Ph1Off,x
nop
lda IO.D2.Ph2Off,x
nop
lda IO.D2.Ph3Off,x
lda #60
jsr BB.MSWait Trash X
bcs .1 CS from MSWAIT
bra .1 65c02
*--------------------------------------
BB.PhaseOn pha
jsr .7
pla
bit #1 1,3,5,7 ?
beq .8
BB.PhaseOn bit #1 1,3,5,7 ?
beq .7
inc 2,4,6,0
pha
bcs .1 move out,start by+1
jsr .7
pla
.1 inc 2,4,6,0
jsr .7
bcc BB.MSWait.RTS
pla
.7 and #6 mask for 0,2,4,6
ora slotz Slot $n0
tax
lda IO.D2.Ph0On,x turn on one phase
.8 rts
lda #1
*--------------------------------------
BB.MSWait sec (6) JSR (2)
BB.MSWait php
sec (6) JSR (2)
.1 ldx #17 (2)
.1 ldx #19 (2)
.2 dex (2) delay 86 usec.
bne .2 (2+) 2 + 5x16 + 2 + 2
@ -364,7 +369,9 @@ BB.MSWait sec (6) JSR (2)
sbc #1 (2) done 'n' intervals?
bne .1 (2+) a-reg counts
rts (6)
plp
BB.MSWait.RTS rts (6)
*--------------------------------------
BB.Trk2Qtrk asl x2
sta .1+1

View File

@ -38,22 +38,23 @@ D2MoveHead >PULLB MoveTo
bcs .2
inc MoveFrom>MoveTo, must move in
inc MoveFrom<MoveTo, must move in
.HS B0 BCS
.2 dec MoveFrom<MoveTo, must move out
.2 dec MoveFrom>MoveTo, must move out
sta MoveFrom
jsr D2.PhaseOn
lda #40
lda #60
jsr D2.Wait100msA Trash X
jsr D2.AllPhaseOff
* lda #10
* jsr D2.Wait100msA Trash X
ldx Slotn0
lda IO.D2.Ph0Off,x make sure all motor phases are off
lda IO.D2.Ph1Off,x
lda IO.D2.Ph2Off,x
lda IO.D2.Ph3Off,x
bra .1
.3 tya
@ -65,34 +66,39 @@ D2MoveHead >PULLB MoveTo
.8 clc
.9 rts
*--------------------------------------
D2.PhaseOn pha
D2.PhaseOn bit #1 1,3,5,7 ?
beq .7
pha
bcs .1 move out,start by+1
jsr .7
pla
.1 inc 2,4,6,0
bit #1 1,3,5,7 ?
beq .8
jsr .7
inc 2,4,6,0
bcc .8
pla
.7 and #6 mask for 0,2,4,6
.7 php
and #6 mask for 0,2,4,6
ora Slotn0
tax
lda IO.D2.Ph0On,x turn on one phase
lda #1
jsr D2.Wait100msA
plp
.8 rts
*--------------------------------------
D2.AllPhaseOff ldx Slotn0
lda IO.D2.Ph0Off,x make sure all motor phases are off.
nop
lda IO.D2.Ph1Off,x
nop
lda IO.D2.Ph2Off,x
nop
lda IO.D2.Ph3Off,x
rts
*--------------------------------------
D2.Wait100msA sec
.1 ldx #17
.1 ldx #19
.2 dex
bne .2

View File

@ -118,7 +118,7 @@ L5362 lda IO.D2.DrvSel1,x
plp indicate drive off by setting z-flag.
lda #6 6x256 -> 1500ms delay before stepping.
lda #150 150 ms delay before stepping.
jsr XRW.Wait100msA
@ -750,56 +750,64 @@ XRW.Seek ldx XRW.UnitIndex
bcs .2
inc CurrentQTrack>TargetQTrack, must move in
inc CC, CurrentQTrack>TargetQTrack, must move in
.HS B0 BCS
.2 dec CurrentQTrack<TargetQTrack, must move out
.2 dec CS, CurrentQTrack<TargetQTrack, must move out
sta XRW.CurrentQTrack
jsr XRW.PhaseOn
lda #40
lda #90 wait 9.000 usec
jsr XRW.Wait100msA Trash X
jsr XRW.AllPhaseOff
* lda #10
* jsr XRW.Wait100msA Trash X
bra .1
.3 tya
beq .8
lda #0
lda #0 wait 25.500 usec
jmp XRW.Wait100msA Trash X
.8 rts
*--------------------------------------
XRW.PhaseOn pha
XRW.PhaseOn bit #1 1,3,5,7 ?
beq .7
pha
bcs .1 move out,start by+1
jsr .7
pla
bit #1 1,3,5,7 ?
beq .8
.1 inc 2,4,6,0
jsr .7
inc 2,4,6,0
bcc .8
pla
.7 and #6 mask for 0,2,4,6
.7 php
and #6 mask for 0,2,4,6
ora A2L Slot $n0
tax
lda IO.D2.Ph0On,x turn on one phase
jsr XRW.Wait100ms wait 100 usec
plp
.8 rts
*--------------------------------------
XRW.AllPhaseOff ldx A2L
lda IO.D2.Ph0Off,x
nop
lda IO.D2.Ph1Off,x
nop
lda IO.D2.Ph2Off,x
nop
lda IO.D2.Ph3Off,x
rts
*--------------------------------------