Kernel 0.94+

This commit is contained in:
Rémy GIBERT 2021-03-17 20:49:39 +01:00
parent f77498a457
commit 931dec0a29
11 changed files with 137 additions and 127 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,8 +13,8 @@ A2osX.QC.Start .EQ *
A2osX.QC cld A2osX.QC cld
jmp A2osX.QC.Start1 jmp A2osX.QC.Start1
A2osX.QC.BOOT .BS 32 A2osX.QC.BOOT .BS 64
A2osX.QC.ROOT .BS 32 A2osX.QC.ROOT .BS 64
A2osX.QC.Start1 sei A2osX.QC.Start1 sei
ldx #$FF ldx #$FF
@ -169,6 +169,7 @@ A2osX.QC.PrintYA
beq .9 beq .9
ldy #1 ldy #1
.1 lda (TmpPtr1),y .1 lda (TmpPtr1),y
ora #$80 ora #$80
jsr COUT jsr COUT
@ -178,7 +179,9 @@ A2osX.QC.PrintYA
.9 plp .9 plp
bcc .99 bcc .99
jsr CROUT jsr CROUT
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
MLISETPREFIX03 .DA #1 MLISETPREFIX03 .DA #1

View File

@ -106,6 +106,7 @@ A2osX.Init1.128 jsr MLI
adc #$01 adc #$01
cld cld
bpl .2 if minus, BUG!, we have 6502 bpl .2 if minus, BUG!, we have 6502
>LDYAI MSG.CPU.KO >LDYAI MSG.CPU.KO
jsr PrintFYA jsr PrintFYA
bra * bra *
@ -128,14 +129,16 @@ A2osX.RamDrv >LDYAI MSG.RAMDRV
tax tax
bne .1 bne .1
>LDYAI MSG.RAMDRV.KO0 >LDYAI MSG.RAMDRV.KO0
jsr PrintFYA bra .8
bra A2osX.SetupQC
.1 >LDYAI MSG.RAMDRV.KO1 .1 >LDYAI MSG.RAMDRV.KO1
jsr PrintFYA bra .8
bra A2osX.SetupQC
.2 >LDYAI MSG.RAMDRV.OK .2 >LDYAI MSG.RAMDRV.OK
jsr PrintFYA
.8 jsr PrintFYA
*-------------------------------------- *--------------------------------------
A2osX.EnumKM >LDYAI MSG.KMENUM A2osX.EnumKM >LDYAI MSG.KMENUM
jsr PrintFYA jsr PrintFYA
@ -672,7 +675,7 @@ PALETTE.AUX .HS 00.01.02.03.04.05.06.07
*-------------------------------------- *--------------------------------------
A2osX.QC.B.Start A2osX.QC.B.Start
A2osX.QC.B.BOOT .EQ *+4 A2osX.QC.B.BOOT .EQ *+4
A2osX.QC.B.ROOT .EQ *+4+32 A2osX.QC.B.ROOT .EQ *+4+64
.INB usr/src/a2osx.s.qc .INB usr/src/a2osx.s.qc
.LIST ON .LIST ON
SYSTEM.END .EQ * SYSTEM.END .EQ *

View File

@ -391,17 +391,17 @@ CS.RUN.LL.DISKII
jsr CS.RUN.LL.DISKII.V jsr CS.RUN.LL.DISKII.V
bcs .99 bcs .99
* jsr CS.RUN.MotorOn jsr CS.RUN.MotorOn
* lda #10 lda #20
* jsr CS.RUN.Wait jsr CS.RUN.Wait
.80 .80
* >PUSHB DSSS0000 >PUSHB DSSS0000
* >LIBCALL hLIBBLKDEV,LIBBLKDEV.D2Recalibrate >LIBCALL hLIBBLKDEV,LIBBLKDEV.D2Recalibrate
* lda #10 lda #20
* jsr CS.RUN.Wait jsr CS.RUN.Wait
clc clc
.99 rts .99 rts

View File

@ -236,8 +236,7 @@ CS.RUN jsr CL.Init
bcs .9 bcs .9
>PUSHW L.MSG.GREETINGS >PUSHW L.MSG.GREETINGS
>PUSHB #K.VER >PUSHW A2osX.KVER
>PUSHB /K.VER
>PUSHBI 2 >PUSHBI 2
>SYSCALL PrintF >SYSCALL PrintF
bcs .9 bcs .9
@ -258,17 +257,23 @@ CS.RUN.LOOP >SLEEP
lda (pPS),y lda (pPS),y
>SYSCALL FEOF >SYSCALL FEOF
bcs .9 bcs .9
tay tay
bne CS.RUN.LOOP bne CS.RUN.LOOP
>SYSCALL GetChar >SYSCALL GetChar
bcs .9 I/O err bcs .9 I/O err
cmp #3 Ctrl-C cmp #3 Ctrl-C
bne .11 bne .11
lda (pData) batch mode ? lda (pData) batch mode ?
beq CS.RUN.LOOP beq CS.RUN.LOOP
>LDA.G bSET.C >LDA.G bSET.C
beq .8 beq .8
bra CS.RUN.LOOP bra CS.RUN.LOOP
.11 cmp #19 test Ctrl-s .11 cmp #19 test Ctrl-s
bne CS.RUN.LOOP bne CS.RUN.LOOP
@ -318,12 +323,14 @@ CS.RUN.INTERACTIVE
jsr CL.PrintPrompt jsr CL.PrintPrompt
bcs CS.RUN.CMDLINE.9 bcs CS.RUN.CMDLINE.9
>STZ.G bREAD.S >STZ.G bREAD.S
dec dec
>STA.G READ.N >STA.G READ.N
.1 >SYSCALL GetChar .1 >SYSCALL GetChar
bcs CS.RUN.CMDLINE.9 I/O error bcs CS.RUN.CMDLINE.9 I/O error
.2 cmp #C.EOF ....or Ctrl-D .2 cmp #C.EOF ....or Ctrl-D
beq CS.RUN.CMDLINE.9 CS beq CS.RUN.CMDLINE.9 CS
@ -336,15 +343,16 @@ CS.RUN.INTERACTIVE
>PUSHBI 0 >PUSHBI 0
>SYSCALL PrintF >SYSCALL PrintF
bcs CS.RUN.CMDLINE.9 bcs CS.RUN.CMDLINE.9
lda (ZPCLBuf) lda (ZPCLBuf)
beq CS.RUN.CMDLINE.8 Empty line beq CS.RUN.LOOP.END Empty line
jsr HIS.Add jsr HIS.Add
>LDYA ZPCLBuf >LDYA ZPCLBuf
CS.RUN.CMDLINE >SYSCALL StrDup CS.RUN.CMDLINE >SYSCALL StrDup
bcs CS.RUN.CMDLINE.8 bcs CS.RUN.CMDLINE.9
phx phx
jsr GetArgV jsr GetArgV
@ -352,19 +360,17 @@ CS.RUN.CMDLINE >SYSCALL StrDup
jsr CORE.Load.YAX Exec CL jsr CORE.Load.YAX Exec CL
bcs CS.RUN.CMDLINE.9 bcs CS.RUN.CMDLINE.9
lda #$C0+C.CLEXEC lda #$C0+C.CLEXEC
jsr CORE.StkPush jsr CORE.StkPush
jsr CORE.Run bra CS.RUN.LOOP.RUN
CS.RUN.CMDLINE.8
jmp CS.RUN.LOOP.END
CS.RUN.CMDLINE.9 CS.RUN.CMDLINE.9
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN.BATCH >LDA.G bSET.X CS.RUN.BATCH >LDA.G bSET.X
beq .5 beq CS.RUN.LOOP.RUN
ldy #$ff ldy #$ff
@ -384,7 +390,7 @@ CS.RUN.BATCH >LDA.G bSET.X
>SYSCALL PrintF >SYSCALL PrintF
bcs CS.RUN.LOOP.RTS bcs CS.RUN.LOOP.RTS
.5 jsr CORE.Run CS.RUN.LOOP.RUN jsr CORE.Run
CS.RUN.LOOP.END ldy #S.PS.RC CS.RUN.LOOP.END ldy #S.PS.RC
sta (pPS),y sta (pPS),y

View File

@ -1,11 +1,11 @@
NEW NEW
AUTO 3,1 AUTO 3,1
*-------------------------------------- *--------------------------------------
IO.D2.SeekTimeR .EQ 45 LIBBLKDEV Recalibration IO.D2.SeekTimeR .EQ 35 LIBBLKDEV Recalibration
IO.D2.SeekTimeF .EQ 45 LIBBLKDEV Track Formatter IO.D2.SeekTimeF .EQ 45 LIBBLKDEV Track Formatter
IO.D2.SeekTimeB .EQ 45 LIBBLKDEV Boot Block IO.D2.SeekTimeB .EQ 45 LIBBLKDEV Boot Block
IO.D2.SeekTimeP .EQ 15 ProDOS.FX initial IO.D2.SeekTimeP .EQ 15 ProDOS.FX initial
IO.D2.SeekTimeI .EQ 10 ProDOS.FX increment -> until > 128 IO.D2.SeekTimeI .EQ 5 ProDOS.FX increment -> until > 128
*-------------------------------------- *--------------------------------------
IO.D2.Ph0Off .EQ $C080 IO.D2.Ph0Off .EQ $C080
IO.D2.Ph0On .EQ $C081 IO.D2.Ph0On .EQ $C081

View File

@ -128,13 +128,15 @@ D2MoveHead.SEI lda Slotn0
.3 and #6 .3 and #6
ora Slotn0 ora Slotn0
bcs .30 bcs .30
phx phx
tax tax
pla pla
.30 tay .30
tay
lda IO.D2.Ph0On,x lda IO.D2.Ph0On,x
.4 lda IO.D2.RData SELF MODIFIED .4 lda IO.D2.RData SELF MODIFIED
@ -175,7 +177,6 @@ D2TrkRead16s >PULLW ZPPtr1
jsr CheckDiskII jsr CheckDiskII
bcs .9 bcs .9
lda VolNum lda VolNum
clc clc
.9 .9

View File

@ -153,13 +153,21 @@ L538E lda A4L get command #
*-------------------------------------- *--------------------------------------
.2 sei DISABLE IRQ .2 sei DISABLE IRQ
jsr XRW.TrackSelect lda #2
sta XRW.RecalibrateCnt
.3 jsr XRW.TrackSelect
bcs XRW.E.IO bcs XRW.E.IO
jsr XRW.SectorIO jsr XRW.SectorIO
bcc .4
jsr XRW.Recalibrate
bcc .3
bcs XRW.E.IO bcs XRW.E.IO
inc buf+1 .4 inc buf+1
inc XRW.ReqSector inc XRW.ReqSector
inc XRW.ReqSector inc XRW.ReqSector
@ -188,31 +196,21 @@ XRW.E.EXIT ldx A2L
rts rts
*-------------------------------------- *--------------------------------------
XRW.TrackSelect lda #2 XRW.TrackSelect lda #2
sta XRW.RecalibrateCnt
sta XRW.BadSeek sta XRW.BadSeek
.1 stz XRW.RetryCnt .1 lda #32
sta XRW.RetryCnt
.2 jsr XRW.ReadAddr read next address field. .2 jsr XRW.ReadAddr read next address field.
bcc .4 if CC, A = current track bcc .4 if CC, A = current track
.3 inc XRW.RetryCnt one less chance. .3 dec XRW.RetryCnt one less chance.
bpl .2 branch if < 128 bne .2 branch if < 128
dec XRW.RecalibrateCnt jsr XRW.Recalibrate
sec bcc .1
beq .9
ldy XRW.UnitIndex rts
lda #41
sta XRW.D2Trk-1,y
lda #0
sta XRW.D2VolNum-1,y reset volnum for seeking 41 Qtracks
jsr XRW.Seek Seek from Track 41 -> 0
bra .1
.4 ldy XRW.UnitIndex (4) .4 ldy XRW.UnitIndex (4)
lda XRW.AddrField.V (4) lda XRW.AddrField.V (4)
@ -226,10 +224,10 @@ XRW.TrackSelect lda #2
beq .5 2 bad seeks, already beq .5 2 bad seeks, already
dec XRW.BadSeek dec XRW.BadSeek
bne .6 bne .7
.5 lda XRW.SeekTime .5 lda XRW.SeekTime
bmi .6 seektime already > 128 bmi .7 seektime already > 128
clc clc
adc #IO.D2.SeekTimeI adc #IO.D2.SeekTimeI
@ -237,19 +235,11 @@ XRW.TrackSelect lda #2
sta XRW.D2SeekTime-1,y sta XRW.D2SeekTime-1,y
.6 lda XRW.ReqTrack .7 lda XRW.ReqTrack
jsr XRW.Seek jsr XRW.Seek
bra .3 bra .3
.8 .8 clc
* jsr XRW.SEEK2T
* lda #1
* jsr XRW.Wait100usecA
* jsr XRW.SEEKOFF
clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
.LIST ON .LIST ON
@ -325,7 +315,23 @@ XRW.ReadAddr.RTS
rts rts
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
* A = target track XRW.Recalibrate dec XRW.RecalibrateCnt
bne .1
sec
rts
.1 ldy XRW.UnitIndex
lda #41
sta XRW.D2Trk-1,y
lda #0
sta XRW.D2VolNum-1,y reset volnum for seeking 41 Qtracks
jsr XRW.Seek
clc
rts
*-------------------------------------- *--------------------------------------
XRW.Seek ldx XRW.UnitIndex XRW.Seek ldx XRW.UnitIndex
pha save target track pha save target track
@ -348,9 +354,10 @@ XRW.Seek ldx XRW.UnitIndex
lda #1 lda #1
bra .4 bra .4
.1 pha .1 jsr XRW.SEEKOFF
pha
jsr XRW.SEEKOFF
bcs .2 bcs .2
* Current < Target, must move in * Current < Target, must move in
@ -380,13 +387,14 @@ XRW.Seek ldx XRW.UnitIndex
.3 and #6 .3 and #6
ora A2L ora A2L
* bcs .30
* phx bcs .30
* tax
* pla
*.30 phx
tax
pla
.30
tay tay
jsr XRW.SEEK2QT jsr XRW.SEEK2QT
@ -403,47 +411,19 @@ XRW.Seek ldx XRW.UnitIndex
XRW.SEEKOFF XRW.SEEKOFF
pha pha
* lda A2L lda A2L
* ora #IO.D2.RData ora #IO.D2.RData
* sta .1+1 sta .1+1
* sta .2+1 sta .2+1
lda IO.D2.Ph0Off,x lda IO.D2.Ph0Off,x
*.1 lda IO.D2.RData SELF MODIFIED .1 lda IO.D2.RData SELF MODIFIED
nop
nop
lda IO.D2.Ph0Off,y lda IO.D2.Ph0Off,y
*.2 lda IO.D2.RData SELF MODIFIED .2 lda IO.D2.RData SELF MODIFIED
pla pla
rts rts
*-------------------------------------- *--------------------------------------
XRW.CheckMotorOn
ldx A2L
XRW.CheckMotorOnX
ldy #0 init loop counter.
.1 lda IO.D2.RData,x read the shift register.
jsr .9 delay
pha
pla more delay.
cmp IO.D2.RData,x has shift reg changed ?
bne .9 yes, motor is moving.
dey no, dec retry counter
bne .1 and try 256 times.
.9 rts Z if motor OFF
*--------------------------------------
XRW.TestWP ldx A2L
lda IO.D2.ReadProt,x test for write protected
lda IO.D2.ReadMode,x
rol write protect-->carry-->bit 0=1
lda IO.D2.RData,x keep in read mode
rts
*--------------------------------------
* preniblize subroutine (16 sector format) * preniblize subroutine (16 sector format)
* *
* converts 256 bytes of user data in (buf) into 6 bit nibls in nbuf2. * converts 256 bytes of user data in (buf) into 6 bit nibls in nbuf2.
@ -568,18 +548,10 @@ L596F ldy #$FF index to last byte of data to write.
XRW.SectorIO bit XRW.bWrite XRW.SectorIO bit XRW.bWrite
bpl .1 bpl .1
* lda XRW.ReqTrack
* jsr XRW.SEEK2T
* phx
* phy
jsr XRW.PreNibble jsr XRW.PreNibble
* ply .1 lda #32
* plx sta XRW.RetryCnt
* jsr XRW.SEEKOFF
.1 stz XRW.RetryCnt
.DO XRWDBG=1 .DO XRWDBG=1
jsr XRW.DEBUG jsr XRW.DEBUG
@ -597,8 +569,8 @@ XRW.SectorIO bit XRW.bWrite
jmp XRW.Read jmp XRW.Read
.3 inc XRW.RetryCnt .3 dec XRW.RetryCnt
bpl .2 bne .2
sec sec
@ -968,17 +940,15 @@ XRW.SEEK2QTXY pha
tay tay
XRW.SEEK2QT XRW.SEEK2QT
* lda A2L lda A2L
* ora #IO.D2.RData ora #IO.D2.RData
* sta .1+1 sta .1+1
* sta .2+1 sta .2+1
lda IO.D2.Ph0On,x lda IO.D2.Ph0On,x
*.1 lda IO.D2.RData SELF MODIFIED .1 lda IO.D2.RData SELF MODIFIED
nop
nop
lda IO.D2.Ph0On,y lda IO.D2.Ph0On,y
*.2 lda IO.D2.RData SELF MODIFIED .2 lda IO.D2.RData SELF MODIFIED
rts rts
*-------------------------------------- *--------------------------------------
XRW.Trk2Qtrk asl x2 XRW.Trk2Qtrk asl x2
@ -992,6 +962,32 @@ XRW.Trk2Qtrk asl x2
.1 adc #$ff SELF MODIFIED .1 adc #$ff SELF MODIFIED
rts rts
*--------------------------------------
XRW.CheckMotorOn
ldx A2L
XRW.CheckMotorOnX
ldy #0 init loop counter.
.1 lda IO.D2.RData,x read the shift register.
jsr .9 delay
pha
pla more delay.
cmp IO.D2.RData,x has shift reg changed ?
bne .9 yes, motor is moving.
dey no, dec retry counter
bne .1 and try 256 times.
.9 rts Z if motor OFF
*--------------------------------------
XRW.TestWP ldx A2L
lda IO.D2.ReadProt,x test for write protected
lda IO.D2.ReadMode,x
rol write protect-->carry-->bit 0=1
lda IO.D2.RData,x keep in read mode
rts
*-------------------------------------- *--------------------------------------
.LIST ON .LIST ON
XRW.FREE .EQ $D540-* XRW.FREE .EQ $D540-*

View File

@ -967,9 +967,10 @@ PS.Find.5 >LDYAI K.Buf256
jsr PS.STAT.YA jsr PS.STAT.YA
bcs PS.Find.1 Failed...retry next path... bcs PS.Find.1 Failed...retry next path...
lda K.S.STAT+S.STAT.P.TYPE lda K.S.STAT+S.STAT.MODE+1
cmp #S.FI.T.DIR Dir ? cmp /S.STAT.MODE.DIR Dir ?
beq PS.Find.1 beq PS.Find.1
jsr PS.Find.98 Discard Expanded hSrch list jsr PS.Find.98 Discard Expanded hSrch list
clc clc