2016-12-02 16:09:24 +00:00
|
|
|
|
NEW
|
2020-05-04 20:46:21 +00:00
|
|
|
|
AUTO 3,1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2019-12-04 13:46:58 +00:00
|
|
|
|
.TF bin/format
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2020-05-28 21:13:52 +00:00
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
|
|
|
|
.INB inc/mli.e.i
|
|
|
|
|
.INB inc/libblkdev.i
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
|
|
|
|
ZPPtr1 .BS 2
|
2019-02-13 06:50:10 +00:00
|
|
|
|
ZPPtrFD .BS 2
|
|
|
|
|
ZPPtrDevName .BS 2
|
2019-10-08 12:47:47 +00:00
|
|
|
|
hDevID .BS 1
|
2020-04-23 15:36:51 +00:00
|
|
|
|
hCatBuf .BS 1
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
|
|
|
|
ArgIndex .BS 1
|
2020-04-27 06:14:39 +00:00
|
|
|
|
hTrackBuf .BS 1
|
|
|
|
|
DSSS0000 .BS 1
|
|
|
|
|
CurTrack .BS 1
|
|
|
|
|
CurQTrack .BS 1
|
2021-03-26 17:30:56 +00:00
|
|
|
|
TCounter .BS 1
|
|
|
|
|
CurHead .BS 1
|
|
|
|
|
HCounter .BS 1
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-04-29 06:10:49 +00:00
|
|
|
|
BlkCnt .BS 2
|
|
|
|
|
TrkCnt .BS 1
|
|
|
|
|
Stepping .BS 1
|
2020-05-04 20:46:21 +00:00
|
|
|
|
VolNum .BS 1
|
2020-06-11 21:04:56 +00:00
|
|
|
|
AltBB .BS 1
|
2021-03-26 17:30:56 +00:00
|
|
|
|
HeadCnt .BS 1
|
2021-03-26 18:45:46 +00:00
|
|
|
|
|
|
|
|
|
TimeOut .BS 1
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CatSize .BS 1
|
|
|
|
|
CatBlkCnt .BS 1
|
2020-04-29 06:10:49 +00:00
|
|
|
|
bLL .BS 1
|
|
|
|
|
bCustomBlkSize .BS 1
|
|
|
|
|
bHighDensity .BS 1
|
2020-05-04 20:46:21 +00:00
|
|
|
|
bExtraTrack .BS 1
|
2021-03-26 18:45:46 +00:00
|
|
|
|
bDS .BS 1
|
2020-05-10 16:03:51 +00:00
|
|
|
|
bVerify .BS 1
|
2018-12-18 14:37:07 +00:00
|
|
|
|
ZS.END
|
|
|
|
|
.ED
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* File Header (16 Bytes)
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
.DA #S.PS.F.EVENT
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DA #0
|
|
|
|
|
.DA CS.END-CS.START Code Size (without Constants)
|
|
|
|
|
.DA DS.END-DS.START Data SegmentSize
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #64 Stack Size
|
2018-12-18 14:37:07 +00:00
|
|
|
|
.DA #ZS.END-ZS.START Zero Page Size
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
2019-08-26 06:29:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
2019-08-26 06:29:18 +00:00
|
|
|
|
.DA CS.DOEVENT
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA CS.QUIT
|
|
|
|
|
L.LIBBLKDEV .DA LIBBLKDEV
|
2020-06-05 19:26:34 +00:00
|
|
|
|
L.MSG.USAGE1 .DA MSG.USAGE1
|
|
|
|
|
L.MSG.USAGE2 .DA MSG.USAGE2
|
2017-03-30 16:11:31 +00:00
|
|
|
|
L.MSG.OK .DA MSG.OK
|
|
|
|
|
L.MSG.ERR .DA MSG.ERR
|
2020-01-06 07:03:37 +00:00
|
|
|
|
L.MSG.CRLF .DA MSG.CRLF
|
2019-08-26 06:29:18 +00:00
|
|
|
|
L.MSG.NOSIZE .DA MSG.NOSIZE
|
|
|
|
|
L.MSG.INIT .DA MSG.INIT
|
2020-01-06 07:03:37 +00:00
|
|
|
|
L.MSG.LL .DA MSG.LL
|
2020-05-10 16:03:51 +00:00
|
|
|
|
L.MSG.LLDISK2 .DA MSG.LLDISK2
|
|
|
|
|
L.MSG.VERIFY .DA MSG.VERIFY
|
2020-01-06 07:03:37 +00:00
|
|
|
|
L.MSG.WRITECAT .DA MSG.WRITECAT
|
2019-08-26 06:29:18 +00:00
|
|
|
|
L.FMT.BLANK .DA FMT.BLANK
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CS.INIT >LDYA L.LIBBLKDEV
|
|
|
|
|
>SYSCALL LoadLib
|
|
|
|
|
bcs .9
|
|
|
|
|
sta hLIBBLKDEV
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN ldy #S.PS.ARGC
|
2020-02-28 07:21:46 +00:00
|
|
|
|
lda (pPS),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
beq .99
|
2018-11-05 16:28:40 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.1 inc ArgIndex
|
|
|
|
|
lda ArgIndex
|
2018-10-16 15:48:03 +00:00
|
|
|
|
>SYSCALL ArgV
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bcc .11
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jmp .8
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.11 >STYA ZPPtr1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .4
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2021-02-11 22:08:22 +00:00
|
|
|
|
ldy #1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
beq .99
|
2016-12-02 16:09:24 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
cmp #'0'
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcc .2
|
2018-04-19 12:06:21 +00:00
|
|
|
|
cmp #'9'+1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcs .2
|
2018-04-19 12:06:21 +00:00
|
|
|
|
and #$0F
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta CatSize
|
|
|
|
|
.10 bra .1
|
|
|
|
|
|
|
|
|
|
.2 jsr CS.RUN.CheckOpt
|
|
|
|
|
bcs .99
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
cpy #bCustomBlkSize
|
|
|
|
|
bne .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
inc ArgIndex
|
|
|
|
|
lda ArgIndex
|
2019-10-08 12:47:47 +00:00
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
bcs .99
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-17 20:47:31 +00:00
|
|
|
|
>SYSCALL AToI
|
2020-04-29 06:10:49 +00:00
|
|
|
|
>STYA BlkCnt
|
2016-12-02 16:09:24 +00:00
|
|
|
|
bra .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2022-11-02 06:54:30 +00:00
|
|
|
|
.99 >LDYA L.MSG.USAGE1
|
|
|
|
|
>SYSCALL PutS
|
|
|
|
|
>LDYA L.MSG.USAGE2
|
|
|
|
|
>SYSCALL Puts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
2021-02-11 22:08:22 +00:00
|
|
|
|
.9 rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
|
|
|
|
.4 lda hDevID
|
2018-08-11 10:57:57 +00:00
|
|
|
|
bne .5 Already have a dev...go get VolName
|
|
|
|
|
|
2017-03-30 16:11:31 +00:00
|
|
|
|
>LDYA ZPPtr1
|
2018-08-11 10:57:57 +00:00
|
|
|
|
>SYSCALL GetDevByName
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
|
|
|
|
stx hDevID
|
2020-04-23 15:36:51 +00:00
|
|
|
|
>STYA ZPPtrFD
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2019-02-13 06:50:10 +00:00
|
|
|
|
>LDYA ZPPtr1
|
|
|
|
|
>STYA ZPPtrDevName
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bra .10
|
|
|
|
|
|
2017-10-03 15:33:30 +00:00
|
|
|
|
.5 ldy #$ff
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2017-10-03 15:33:30 +00:00
|
|
|
|
.6 iny
|
2017-10-04 15:12:03 +00:00
|
|
|
|
lda (ZPPtr1),y
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta (pData),y VolName
|
|
|
|
|
beq .10
|
2017-10-03 15:33:30 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
cpy #16
|
|
|
|
|
bcc .6
|
|
|
|
|
bra .99 VolName too long
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
.8 lda hDevID
|
|
|
|
|
beq .99
|
2018-04-19 12:06:21 +00:00
|
|
|
|
*--------------------------------------
|
2021-08-10 10:20:41 +00:00
|
|
|
|
CS.RUN.Format jsr CS.RUN.GetDevDIB
|
2020-07-07 13:44:28 +00:00
|
|
|
|
bcs .99
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.INIT
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHW ZPPtrDevName
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHEA.G VolName
|
2020-05-10 16:03:51 +00:00
|
|
|
|
>PUSHBI 4
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-07-07 13:44:28 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.GET.DSSS0000
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
|
|
|
|
bit bLL
|
|
|
|
|
bpl .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
jsr CS.RUN.LL
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.1 jsr CS.RUN.InitCat
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr CS.RUN.BuildCat
|
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr CS.RUN.WriteCat
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2020-07-07 13:44:28 +00:00
|
|
|
|
.99 bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
>LDYA L.MSG.OK
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2020-06-22 05:59:53 +00:00
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-07-07 13:44:28 +00:00
|
|
|
|
.8 >PUSHB DSSS0000
|
|
|
|
|
>PUSHW pData
|
|
|
|
|
>SYSCALL Online
|
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-07-07 13:44:28 +00:00
|
|
|
|
lda #0
|
2018-04-19 12:06:21 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.9 pha
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHW L.MSG.ERR
|
|
|
|
|
pla
|
|
|
|
|
pha
|
2018-04-19 12:06:21 +00:00
|
|
|
|
>PUSHA
|
2018-08-22 15:23:27 +00:00
|
|
|
|
>PUSHBI 1
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2018-04-19 12:06:21 +00:00
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-08-10 10:20:41 +00:00
|
|
|
|
CS.RUN.GetDevDIB
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda bCustomBlkSize
|
|
|
|
|
bmi .8
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-08-10 10:20:41 +00:00
|
|
|
|
>LEA.G DIB
|
|
|
|
|
>STYA.G IOCTL+S.IOCTL.BUFPTR
|
|
|
|
|
|
|
|
|
|
lda #S.IOCTL.S.GETDIB
|
|
|
|
|
>STA.G IOCTL+S.IOCTL.S
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-08-10 10:20:41 +00:00
|
|
|
|
>PUSHB hDevID
|
|
|
|
|
>PUSHBI IOCTL.STATUS
|
|
|
|
|
>PUSHEA.G IOCTL
|
|
|
|
|
>SYSCALL IOCTL
|
2019-10-08 12:47:47 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>LDA.G DIB+S.DIB.SIZE
|
|
|
|
|
tax
|
|
|
|
|
iny
|
|
|
|
|
ora (pData),y
|
|
|
|
|
beq .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda (pData),y
|
2020-04-29 06:10:49 +00:00
|
|
|
|
sta BlkCnt+1
|
|
|
|
|
stx BlkCnt
|
2020-05-10 16:03:51 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 >LDYA L.MSG.NOSIZE
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda #MLI.E.IO
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-07-07 13:44:28 +00:00
|
|
|
|
CS.RUN.GET.DSSS0000
|
2020-04-23 15:36:51 +00:00
|
|
|
|
ldy #S.FD.DEV.BUSID
|
|
|
|
|
lda (ZPPtrFD),y 00000SSS
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-04-23 15:36:51 +00:00
|
|
|
|
lsr
|
|
|
|
|
ror
|
|
|
|
|
ror
|
|
|
|
|
ror
|
|
|
|
|
pha SSS00000
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-04-23 15:36:51 +00:00
|
|
|
|
iny S.FD.DEV.DEVID
|
|
|
|
|
|
|
|
|
|
lda (ZPPtrFD),y
|
|
|
|
|
dec 0/1
|
|
|
|
|
ror in C
|
|
|
|
|
pla
|
2021-02-11 22:08:22 +00:00
|
|
|
|
ror
|
2020-04-27 06:14:39 +00:00
|
|
|
|
sta DSSS0000
|
|
|
|
|
|
2020-07-07 13:44:28 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.LL >LDA.G DIB+S.DIB.T
|
|
|
|
|
cmp #S.DIB.T.DISKII
|
|
|
|
|
bne .1
|
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
lda #0
|
|
|
|
|
bit bExtraTrack
|
2020-04-29 06:10:49 +00:00
|
|
|
|
bpl .10
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
ora #8
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
.10 bit bHighDensity
|
|
|
|
|
bpl .11
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
ora #16
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-03-26 18:45:46 +00:00
|
|
|
|
.11 bit bDS
|
|
|
|
|
bpl .12
|
|
|
|
|
|
|
|
|
|
ora #32
|
|
|
|
|
|
|
|
|
|
.12 tay
|
2020-05-04 20:46:21 +00:00
|
|
|
|
ldx #0
|
|
|
|
|
|
2021-03-26 18:45:46 +00:00
|
|
|
|
.13 lda Disk2.Default,y
|
2020-05-04 20:46:21 +00:00
|
|
|
|
sta BlkCnt,x
|
2020-04-29 06:10:49 +00:00
|
|
|
|
iny
|
2020-05-04 20:46:21 +00:00
|
|
|
|
inx
|
2021-03-26 17:30:56 +00:00
|
|
|
|
cpx #7
|
2021-03-26 18:45:46 +00:00
|
|
|
|
bne .13
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
.1 >PUSHW L.MSG.LL
|
|
|
|
|
>PUSHW BlkCnt
|
|
|
|
|
>PUSHBI 2
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
>LDA.G DIB+S.DIB.T
|
|
|
|
|
cmp #S.DIB.T.DISKII
|
|
|
|
|
beq CS.RUN.LL.DISKII
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
>PUSHB hDevID
|
|
|
|
|
>PUSHBI IOCTL.FORMAT
|
|
|
|
|
>PUSHEA.G IOCTL
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
.9
|
|
|
|
|
CS.RUN.LL.RTS rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.LL.DISKII
|
2021-01-12 21:14:13 +00:00
|
|
|
|
jsr CS.RUN.MotorOn
|
|
|
|
|
bcs CS.RUN.LL.RTS
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
|
|
|
|
lda #20
|
|
|
|
|
jsr CS.RUN.Wait
|
|
|
|
|
bcs CS.RUN.LL.RTS
|
|
|
|
|
|
|
|
|
|
>PUSHB DSSS0000
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2Recalibrate
|
|
|
|
|
|
|
|
|
|
lda #20
|
|
|
|
|
jsr CS.RUN.Wait
|
|
|
|
|
bcs CS.RUN.LL.RTS
|
|
|
|
|
|
2020-05-28 21:13:52 +00:00
|
|
|
|
stz CurTrack
|
2020-11-19 15:34:02 +00:00
|
|
|
|
stz CurQTrack
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-04 20:46:21 +00:00
|
|
|
|
lda TrkCnt
|
2021-03-26 17:30:56 +00:00
|
|
|
|
sta TCounter
|
2020-08-02 12:19:43 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.1 lda HeadCnt
|
|
|
|
|
sta HCounter
|
|
|
|
|
|
|
|
|
|
stz CurHead
|
|
|
|
|
|
|
|
|
|
.2 jsr CS.RUN.CheckCtrlC
|
2020-06-27 18:30:09 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
jsr CS.RUN.LL.DISKII.P
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
jsr CS.RUN.LL.DISKII.FT
|
2020-04-23 06:02:25 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
inc CurTrack
|
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
inc CurHead
|
|
|
|
|
dec HCounter
|
2022-05-25 18:46:02 +00:00
|
|
|
|
beq .3
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
>PUSHB DSSS0000
|
|
|
|
|
>PUSHBI 1
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2HeadSelect
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.LL.DISKII.FT
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
>PUSHB DSSS0000
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2HeadSelect
|
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-05 19:26:34 +00:00
|
|
|
|
inc CurTrack
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.3 dec TCounter
|
|
|
|
|
beq .8
|
|
|
|
|
|
2020-04-27 06:14:39 +00:00
|
|
|
|
lda CurQTrack
|
|
|
|
|
* clc
|
2020-04-29 06:10:49 +00:00
|
|
|
|
adc Stepping
|
2020-04-27 06:14:39 +00:00
|
|
|
|
tax
|
2020-11-19 15:34:02 +00:00
|
|
|
|
|
|
|
|
|
jsr CS.RUN.SeekToX
|
2021-03-26 17:30:56 +00:00
|
|
|
|
jmp .1
|
2020-04-27 06:14:39 +00:00
|
|
|
|
|
2020-05-26 14:23:09 +00:00
|
|
|
|
.9 pha
|
|
|
|
|
jsr CS.RUN.MotorOff
|
|
|
|
|
pla
|
|
|
|
|
sec
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.99 rts
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2021-02-17 16:15:43 +00:00
|
|
|
|
.8 ldx #0
|
|
|
|
|
jsr CS.RUN.SeekToX
|
|
|
|
|
|
|
|
|
|
>PUSHW L.MSG.CRLF
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>PUSHBI 0
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-05-10 16:03:51 +00:00
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
|
|
|
|
jsr CS.RUN.CheckCtrlC
|
|
|
|
|
bcs .9
|
2020-05-10 16:03:51 +00:00
|
|
|
|
|
|
|
|
|
bit bVerify
|
2020-06-11 21:04:56 +00:00
|
|
|
|
bpl .80
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-11 21:04:56 +00:00
|
|
|
|
jsr CS.RUN.LL.DISKII.V
|
2021-02-11 22:08:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.80 rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.LL.DISKII.P
|
|
|
|
|
>PUSHW L.MSG.LLDISK2
|
|
|
|
|
>PUSHB CurHead
|
|
|
|
|
>PUSHB CurTrack
|
|
|
|
|
inc
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHB TrkCnt
|
|
|
|
|
>PUSHBI 4
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.LL.DISKII.FT
|
|
|
|
|
>PUSHB DSSS0000
|
|
|
|
|
>PUSHB VolNum
|
|
|
|
|
>PUSHB CurTrack
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2TrkFmt16s
|
2021-03-26 17:30:56 +00:00
|
|
|
|
rts
|
2020-01-06 07:03:37 +00:00
|
|
|
|
*--------------------------------------
|
2020-05-10 16:03:51 +00:00
|
|
|
|
CS.RUN.LL.DISKII.V
|
|
|
|
|
lda hTrackBuf
|
2020-08-04 07:10:48 +00:00
|
|
|
|
bne .10
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
>LDYAI 512
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcs .99
|
2020-11-23 22:05:27 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
stx hTrackBuf
|
|
|
|
|
bra .11
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
.10 >SYSCALL GetMemPtr
|
|
|
|
|
.11 >STYA.G IOCTL+S.IOCTL.BUFPTR
|
2020-05-10 16:03:51 +00:00
|
|
|
|
|
2020-06-09 13:40:21 +00:00
|
|
|
|
>LDYA BlkCnt
|
|
|
|
|
>STYA.G IOCTL+S.IOCTL.BLKNUM
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-11 21:04:56 +00:00
|
|
|
|
>STZ.G IOCTL+S.IOCTL.BLKNUM
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-11 21:04:56 +00:00
|
|
|
|
stz CurTrack
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
lda TrkCnt
|
2021-03-26 17:30:56 +00:00
|
|
|
|
sta TCounter
|
|
|
|
|
|
|
|
|
|
.12 lda HeadCnt
|
|
|
|
|
sta HCounter
|
|
|
|
|
|
|
|
|
|
stz CurHead
|
2020-05-10 16:03:51 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
.1 ldx #0
|
2020-05-10 16:03:51 +00:00
|
|
|
|
|
2020-08-02 12:19:43 +00:00
|
|
|
|
.2 jsr CS.RUN.CheckCtrlC
|
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
jsr CS.RUN.LL.DISKII.VBLK
|
|
|
|
|
.99 bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-11 21:04:56 +00:00
|
|
|
|
>INCW.G IOCTL+S.IOCTL.BLKNUM
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
inx
|
|
|
|
|
cpx #8
|
2020-05-10 16:03:51 +00:00
|
|
|
|
bne .2
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
inc CurHead
|
|
|
|
|
dec HCounter
|
2020-05-10 16:03:51 +00:00
|
|
|
|
bne .1
|
2020-06-17 19:05:36 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
inc CurTrack
|
|
|
|
|
dec TCounter
|
|
|
|
|
bne .12
|
|
|
|
|
|
2020-06-17 19:05:36 +00:00
|
|
|
|
lda TrkCnt
|
2021-03-26 17:30:56 +00:00
|
|
|
|
sta TCounter
|
|
|
|
|
|
|
|
|
|
.13 lda HeadCnt
|
|
|
|
|
sta HCounter
|
|
|
|
|
|
|
|
|
|
stz CurHead
|
2020-06-17 19:05:36 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
.3 ldx #7
|
2020-06-17 19:05:36 +00:00
|
|
|
|
|
|
|
|
|
dec CurTrack
|
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
.4 jsr CS.RUN.CheckCtrlC
|
2020-06-17 19:05:36 +00:00
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
>DECW.G IOCTL+S.IOCTL.BLKNUM
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-04 07:10:48 +00:00
|
|
|
|
jsr CS.RUN.LL.DISKII.VBLK
|
2020-06-17 19:05:36 +00:00
|
|
|
|
bcs .9
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-06-17 19:05:36 +00:00
|
|
|
|
dex
|
2020-08-04 07:10:48 +00:00
|
|
|
|
bpl .4
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2021-03-26 17:30:56 +00:00
|
|
|
|
inc CurHead
|
|
|
|
|
dec HCounter
|
2020-06-17 19:05:36 +00:00
|
|
|
|
bne .3
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
|
|
|
|
dec TCounter
|
|
|
|
|
bne .13
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
>LDYA L.MSG.OK
|
|
|
|
|
>SYSCALL PutS
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2020-08-04 07:10:48 +00:00
|
|
|
|
CS.RUN.LL.DISKII.VBLK
|
|
|
|
|
phx
|
2020-06-17 19:05:36 +00:00
|
|
|
|
>PUSHW L.MSG.VERIFY
|
2021-03-26 17:30:56 +00:00
|
|
|
|
>PUSHB CurHead
|
2020-06-17 19:05:36 +00:00
|
|
|
|
>PUSHB CurTrack
|
2020-08-04 07:10:48 +00:00
|
|
|
|
pla
|
|
|
|
|
pha
|
|
|
|
|
>PUSHA
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
2020-06-17 19:05:36 +00:00
|
|
|
|
>PUSHW.G IOCTL+S.IOCTL.BLKNUM
|
2021-03-26 17:30:56 +00:00
|
|
|
|
>PUSHBI 5
|
2020-06-17 19:05:36 +00:00
|
|
|
|
>SYSCALL PrintF
|
2020-08-04 07:10:48 +00:00
|
|
|
|
|
2020-06-17 19:05:36 +00:00
|
|
|
|
>PUSHB hDevID
|
|
|
|
|
>PUSHBI IOCTL.READBLOCK
|
|
|
|
|
>PUSHEA.G IOCTL
|
|
|
|
|
>SYSCALL IOCTL
|
2020-07-03 20:55:40 +00:00
|
|
|
|
bcc .8
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-07-03 20:55:40 +00:00
|
|
|
|
pha
|
|
|
|
|
>PUSHW L.MSG.ERR
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHBI 1
|
|
|
|
|
>SYSCALL PrintF
|
2020-11-19 15:34:02 +00:00
|
|
|
|
|
|
|
|
|
.8 plx
|
2020-08-04 07:10:48 +00:00
|
|
|
|
rts
|
2020-06-17 19:05:36 +00:00
|
|
|
|
*--------------------------------------
|
2020-04-27 06:14:39 +00:00
|
|
|
|
CS.RUN.MotorOn sec
|
|
|
|
|
.HS 90 BCC
|
|
|
|
|
CS.RUN.MotorOff clc
|
|
|
|
|
>PUSHB DSSS0000
|
|
|
|
|
ror
|
|
|
|
|
>PUSHA
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2MotorControl
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.SeekToX >PUSHB DSSS0000
|
|
|
|
|
>PUSHB CurQTrack
|
|
|
|
|
txa
|
|
|
|
|
sta CurQTrack
|
|
|
|
|
>PUSHA
|
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.D2MoveHead
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-11-19 15:34:02 +00:00
|
|
|
|
CS.RUN.ZeroPtr1 lda ZPPtr1+1
|
|
|
|
|
pha
|
|
|
|
|
|
|
|
|
|
lda #0
|
2020-04-27 06:14:39 +00:00
|
|
|
|
tay
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
.1 sta (ZPPtr1),y
|
2020-04-27 06:14:39 +00:00
|
|
|
|
iny
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bne .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
inc ZPPtr1+1
|
2020-04-27 06:14:39 +00:00
|
|
|
|
dex
|
2020-11-19 15:34:02 +00:00
|
|
|
|
bne .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
pla
|
|
|
|
|
sta ZPPtr1+1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-04-27 06:14:39 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2019-10-08 12:47:47 +00:00
|
|
|
|
CS.RUN.InitCat lda CatSize
|
2018-04-19 12:06:21 +00:00
|
|
|
|
bne .1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
lda #4
|
2019-10-08 12:47:47 +00:00
|
|
|
|
sta CatSize
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
|
|
|
|
.1 >LDA.G VolName
|
2016-12-02 16:09:24 +00:00
|
|
|
|
bne .8 Volume name ok
|
2017-10-04 06:16:39 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHEA.G VolName
|
|
|
|
|
>PUSHW L.FMT.BLANK
|
2019-08-26 06:29:18 +00:00
|
|
|
|
>PUSHW A2osX.TIMER16
|
|
|
|
|
>PUSHW A2osX.RANDOM16
|
|
|
|
|
>PUSHBI 4
|
2020-08-17 20:47:31 +00:00
|
|
|
|
>SYSCALL SPrintF
|
2019-08-26 06:29:18 +00:00
|
|
|
|
rts
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
.8 clc
|
2016-12-02 16:09:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-06 07:03:37 +00:00
|
|
|
|
CS.RUN.BuildCat jsr .7
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2021-02-11 22:08:22 +00:00
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.GetProDOSCatSize
|
2017-10-04 06:16:39 +00:00
|
|
|
|
bcs .9
|
2017-10-04 15:12:03 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
stx CatBlkCnt
|
|
|
|
|
|
2020-01-30 14:59:40 +00:00
|
|
|
|
>SYSCALL GetMem BufferSize
|
2017-03-30 16:11:31 +00:00
|
|
|
|
bcs .9
|
2020-01-30 21:55:41 +00:00
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>STYA.G IOCTL+S.IOCTL.BUFPTR
|
2020-04-23 15:36:51 +00:00
|
|
|
|
stx hCatBuf
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-01-30 21:55:41 +00:00
|
|
|
|
lda CatBlkCnt
|
|
|
|
|
asl
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
|
tay
|
|
|
|
|
|
|
|
|
|
.1 sta (ZPPtr1),y
|
|
|
|
|
iny
|
|
|
|
|
bne .1
|
2021-01-17 21:48:54 +00:00
|
|
|
|
|
2020-01-30 21:55:41 +00:00
|
|
|
|
inc ZPPtr1+1
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
2018-04-19 12:06:21 +00:00
|
|
|
|
jsr .7
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2017-10-04 06:16:39 +00:00
|
|
|
|
>PUSHEA.G VolName
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>PUSHW.G IOCTL+S.IOCTL.BUFPTR
|
2017-03-30 16:11:31 +00:00
|
|
|
|
>LIBCALL hLIBBLKDEV,LIBBLKDEV.BuildProDOSCat
|
|
|
|
|
.9 rts
|
2018-04-19 12:06:21 +00:00
|
|
|
|
|
2020-04-29 06:10:49 +00:00
|
|
|
|
.7 >PUSHW BlkCnt
|
2019-10-08 12:47:47 +00:00
|
|
|
|
>PUSHB CatSize
|
2020-06-11 21:04:56 +00:00
|
|
|
|
>PUSHB AltBB
|
2018-04-19 12:06:21 +00:00
|
|
|
|
rts
|
2017-03-30 16:11:31 +00:00
|
|
|
|
*--------------------------------------
|
2022-11-02 06:54:30 +00:00
|
|
|
|
CS.RUN.WriteCat >LDYA L.MSG.WRITECAT
|
|
|
|
|
>SYSCALL PutS
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-05-10 16:03:51 +00:00
|
|
|
|
>STZ.G IOCTL+S.IOCTL.BLKNUM
|
|
|
|
|
iny
|
|
|
|
|
sta (pData),y
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2020-02-29 14:06:28 +00:00
|
|
|
|
.1 >PUSHB hDevID
|
|
|
|
|
>PUSHBI IOCTL.WRITEBLOCK
|
|
|
|
|
>PUSHEA.G IOCTL
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SYSCALL IOCTL
|
2017-03-30 16:11:31 +00:00
|
|
|
|
bcs .9
|
2020-01-06 07:03:37 +00:00
|
|
|
|
|
2017-10-04 15:12:03 +00:00
|
|
|
|
lda #'.'
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL PutChar
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>LDA.G IOCTL+S.IOCTL.BUFPTR+1
|
|
|
|
|
inc
|
|
|
|
|
inc
|
2017-10-04 06:16:39 +00:00
|
|
|
|
sta (pData),y
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>INC.G IOCTL+S.IOCTL.BLKNUM
|
2018-04-16 15:25:39 +00:00
|
|
|
|
>SLEEP
|
2019-10-08 12:47:47 +00:00
|
|
|
|
dec CatBlkCnt
|
2020-01-06 07:03:37 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
clc
|
2017-03-30 16:11:31 +00:00
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2021-02-11 22:08:22 +00:00
|
|
|
|
CS.DOEVENT lda (pEvent)
|
|
|
|
|
bpl .9 is it a TIMER event?
|
|
|
|
|
|
|
|
|
|
lda TimeOut
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
dec TimeOut
|
|
|
|
|
.9 sec do not discard TIMER event
|
2016-12-02 16:09:24 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-04-23 15:36:51 +00:00
|
|
|
|
CS.QUIT lda hCatBuf
|
2017-03-30 16:11:31 +00:00
|
|
|
|
beq .1
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-04-27 06:14:39 +00:00
|
|
|
|
.1 lda hTrackBuf
|
2020-01-06 07:03:37 +00:00
|
|
|
|
beq .2
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2018-07-18 15:30:42 +00:00
|
|
|
|
>SYSCALL FreeMem
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-01-06 07:03:37 +00:00
|
|
|
|
.2 lda hLIBBLKDEV
|
2016-12-02 16:09:24 +00:00
|
|
|
|
beq .8
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
>SYSCALL UnloadLib
|
2016-12-02 16:09:24 +00:00
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-02-11 22:08:22 +00:00
|
|
|
|
CS.RUN.CheckOpt ldy #1
|
2019-10-08 12:47:47 +00:00
|
|
|
|
lda (ZPPtr1),y
|
|
|
|
|
|
|
|
|
|
ldx #OptionVars-OptionList-1
|
|
|
|
|
|
|
|
|
|
.2 cmp OptionList,x
|
|
|
|
|
beq .3
|
2021-03-26 17:30:56 +00:00
|
|
|
|
|
2019-10-08 12:47:47 +00:00
|
|
|
|
dex
|
|
|
|
|
bpl .2
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldy OptionVars,x
|
|
|
|
|
ldx #$ff
|
|
|
|
|
stx 0,y
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-02-11 22:08:22 +00:00
|
|
|
|
CS.RUN.Wait sta TimeOut
|
|
|
|
|
|
|
|
|
|
.1 jsr CS.RUN.CheckCtrlC
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
lda TimeOut
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2020-08-02 12:19:43 +00:00
|
|
|
|
CS.RUN.CheckCtrlC
|
|
|
|
|
phx
|
|
|
|
|
phy
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-11-19 15:34:02 +00:00
|
|
|
|
>SLEEP
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-02 12:19:43 +00:00
|
|
|
|
ldy #S.PS.hStdIn
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>SYSCALL FEOF
|
|
|
|
|
bcs .9
|
|
|
|
|
tay
|
|
|
|
|
bne .9 CC
|
|
|
|
|
|
|
|
|
|
>SYSCALL GetChar
|
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
cmp #$03 Ctrl-C
|
|
|
|
|
beq .9 CS
|
|
|
|
|
|
|
|
|
|
clc
|
2021-02-11 22:08:22 +00:00
|
|
|
|
|
2020-08-02 12:19:43 +00:00
|
|
|
|
.9 ply
|
|
|
|
|
plx
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2016-12-02 16:09:24 +00:00
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
2019-12-04 13:46:58 +00:00
|
|
|
|
LIBBLKDEV .AZ "libblkdev"
|
2019-08-26 06:29:18 +00:00
|
|
|
|
hLIBBLKDEV .BS 1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2022-11-02 06:54:30 +00:00
|
|
|
|
MSG.USAGE1 .CS "Usage : FORMAT <BLOCKDEV> [VOL.NAME]\r\n"
|
|
|
|
|
.CS " -L : Low-Level Format\r\n"
|
|
|
|
|
.CS "-L -V : Verify After LLF\r\n"
|
|
|
|
|
.CS " -B xxxx : Smrtprt, Override Device block size\r\n"
|
|
|
|
|
.CZ " -1-9 : Catalog Size (Blocks)\r\n"
|
|
|
|
|
MSG.USAGE2 .CS "------- ProDOS.FX only ------\r\n"
|
|
|
|
|
.CS " -H : 35trk drives, High Density: 48 tracks, 384 Blocks\r\n"
|
|
|
|
|
.CS " -X : 40trk drives, 320 Blocks\r\n"
|
|
|
|
|
.CS "-H -X : 40trk drives, 432 Blocks\r\n"
|
|
|
|
|
.CS " -D : Rana Elite II 640 Blocks, 2 Sides\r\n"
|
|
|
|
|
.CZ "-H -D : Rana Elite III 1280 Blocks, 2 Sides\r\n"
|
|
|
|
|
MSG.OK .CZ "[OK]"
|
|
|
|
|
MSG.ERR .CS "[%h]"
|
|
|
|
|
MSG.CRLF .CZ "\r\n"
|
|
|
|
|
MSG.NOSIZE .CZ "Unable to get media size."
|
|
|
|
|
MSG.INIT .CZ "Formatting %s, Volname:%s\r\n"
|
|
|
|
|
MSG.LL .CZ "Low Level Format %D Blks\r\n"
|
|
|
|
|
MSG.LLDISK2 .CZ "\rWriting Head %d/Track %02d (%02d/%02d)..."
|
|
|
|
|
MSG.VERIFY .CZ "\rVerifying Head %d/Track %02d/Block %d (%05D)..."
|
|
|
|
|
MSG.WRITECAT .CZ "Writing Catalog..."
|
|
|
|
|
FMT.BLANK .CZ "BLANK%H%H"
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
2021-03-26 18:45:46 +00:00
|
|
|
|
OptionList .AS "LlBbHhXxDdVv"
|
2020-05-10 16:03:51 +00:00
|
|
|
|
OptionVars .DA #bLL,#bLL,#bCustomBlkSize,#bCustomBlkSize
|
|
|
|
|
.DA #bHighDensity,#bHighDensity,#bExtraTrack,#bExtraTrack
|
2021-03-26 18:45:46 +00:00
|
|
|
|
.DA #bDS,#bDS
|
2020-05-10 16:03:51 +00:00
|
|
|
|
.DA #bVerify,#bVerify
|
2020-04-29 06:10:49 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
Disk2.Default .DA 280 BlkCnt
|
|
|
|
|
.DA #35 TrkCnt
|
2020-05-04 20:46:21 +00:00
|
|
|
|
.DA #4 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$00 VolNum
|
2020-06-11 21:04:56 +00:00
|
|
|
|
.DA #0 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #1 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
2020-05-04 20:46:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
Disk2.X .DA 320 BlkCnt
|
|
|
|
|
.DA #40 TrkCnt
|
2020-04-29 06:10:49 +00:00
|
|
|
|
.DA #4 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$00 VolNum
|
2020-06-11 21:04:56 +00:00
|
|
|
|
.DA #0 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #1 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
2020-04-29 06:10:49 +00:00
|
|
|
|
*--------------------------------------
|
2020-09-20 18:35:54 +00:00
|
|
|
|
Disk2.H .DA 384 BlkCnt
|
|
|
|
|
.DA #48 TrkCnt
|
2020-04-29 06:10:49 +00:00
|
|
|
|
.DA #3 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$03 VolNum
|
2020-06-11 21:04:56 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #1 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
2020-05-04 20:46:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
Disk2.HX .DA 432 BlkCnt
|
|
|
|
|
.DA #54 TrkCnt
|
|
|
|
|
.DA #3 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$03 VolNum
|
2020-06-11 21:04:56 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #1 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
*-------------------------------------- RANA Elite 2
|
|
|
|
|
Disk2.DefaultD .DA 640 BlkCnt
|
|
|
|
|
.DA #40 TrkCnt
|
2021-01-12 21:14:13 +00:00
|
|
|
|
.DA #4 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$84 VolNum
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #2 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Disk2.XD .DA 640 BlkCnt
|
|
|
|
|
.DA #40 TrkCnt
|
2021-01-12 21:14:13 +00:00
|
|
|
|
.DA #4 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #84 VolNum
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #2 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
*-------------------------------------- RANA Elite 3
|
|
|
|
|
Disk2.HD .DA 1280 BlkCnt
|
|
|
|
|
.DA #80 TrkCnt
|
|
|
|
|
.DA #2 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$82 VolNum
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #2 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
Disk2.HXD .DA 1280 BlkCnt
|
|
|
|
|
.DA #80 TrkCnt
|
|
|
|
|
.DA #2 Stepping
|
2022-05-25 18:46:02 +00:00
|
|
|
|
.DA #$82 VolNum
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.DA #$80 AltBB
|
2021-03-26 17:30:56 +00:00
|
|
|
|
.DA #2 HeadCnt
|
2020-12-02 15:22:57 +00:00
|
|
|
|
.BS 1
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
|
|
|
|
VolName .BS 16
|
2019-10-08 12:47:47 +00:00
|
|
|
|
|
2018-07-20 14:10:10 +00:00
|
|
|
|
IOCTL .BS S.IOCTL
|
|
|
|
|
DIB .BS S.DIB
|
2017-10-09 05:51:32 +00:00
|
|
|
|
DS.END .ED
|
2016-12-02 16:09:24 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2020-05-28 21:13:52 +00:00
|
|
|
|
SAVE usr/src/bin/format.s
|
2016-12-02 16:09:24 +00:00
|
|
|
|
ASM
|