This commit is contained in:
Rémy GIBERT 2020-05-23 20:45:32 +02:00
parent 27d1615e95
commit 74d854c22b
18 changed files with 292 additions and 322 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -621,28 +621,28 @@ OptionVars .DA #bLL,#bLL,#bCustomBlkSize,#bCustomBlkSize
Disk2.Default .DA 280 BlkCnt
.DA #35 TrkCnt
.DA #4 Stepping
.DA #254 VolNum
.DA #1 VolNum
* .DA #140 QTrkCnt
.BS 3
*--------------------------------------
Disk2.X .DA 320 BlkCnt
.DA #40 TrkCnt
.DA #4 Stepping
.DA #253 VolNum
.DA #2 VolNum
* .DA #160 QTrkCnt
.BS 3
*--------------------------------------
Disk2.H .DA 376 BlkCnt
.DA #47 TrkCnt
.DA #3 Stepping
.DA #126 VolNum
.DA #129 VolNum
* .DA #141 QTrkCnt
.BS 3
*--------------------------------------
Disk2.HX .DA 432 BlkCnt
.DA #54 TrkCnt
.DA #3 Stepping
.DA #125 VolNum
.DA #130 VolNum
* .DA #162 QTrkCnt
.BS 3
*--------------------------------------

View File

@ -5,13 +5,13 @@ NEW
.OR $2000
.TF drv/uther2.ai.drv
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MLI.E.I
.INB INC/NIC.I
.INB INC/NIC.W5100.I
.INB INC/ETH.I
.INB INC/LIBTCPIP.I
.INB inc/macros.i
.INB inc/a2osx.i
.INB inc/mli.e.i
.INB inc/nic.i
.INB inc/nic.w5100.i
.INB inc/eth.i
.INB inc/libtcpip.i
*--------------------------------------
ZPArgPtr .EQ ZPBIN
DEVSLOT0x .EQ ZPBIN+2
@ -411,7 +411,9 @@ READ php
jmp READWRITE.NODATA
.1 lda Sn.RX.BASE,y
.1 lda Sn.IP.PROTOCOL,y
sta .15+1
lda Sn.RX.BASE,y
sta Sn.BASE
lda Sn.RXTX.MASK,y
sta Sn.MASK
@ -483,6 +485,10 @@ READ php
pla
sta (ZPIOCTL),y
.15 lda #$ff SELF MODIFIED
ldy #S.IP.PROTOCOL
sta (ZPBufPtr),y
ldx #3
ldy #S.IP.SRC+3
@ -532,11 +538,6 @@ READ php
pla
sta W5100.DR,x write LO
>AR.Sn.SELECT S0.PROTO
lda W5100.DR,x
ldy #S.IP.PROTOCOL
sta (ZPBufPtr),y
>AR.Sn.SELECT S0.CR
lda #W5100.AR.Sn.CR.RCVD
sta W5100.DR,x
@ -613,8 +614,7 @@ WRITE php
ldy #S.IP.DST
.1 lda #$ff
* lda (ZPBufPtr),y
.1 lda (ZPBufPtr),y
sta W5100.DR,x
iny
cpy #S.IP.DST+4
@ -702,5 +702,5 @@ DCB .DA #S.DCB.T.NIC
*--------------------------------------
DRV.END
MAN
SAVE USR/SRC/DRV/UTHER2.AI.DRV.S
SAVE usr/src/drv/uther2.ai.drv.s
ASM

View File

@ -254,9 +254,9 @@ endcode ldx slotz
clc
rts
jmp seek
jmp BB.Read
*--------------------------------------
BB.MSG.ERR .AS -"ERROR"
BB.MSG.ERR .AS -"ERR"
BB.MSG.ERR.Len .EQ *-BB.MSG.ERR
BB.ProDOS .DA #$26 $20 = storage type + 6 = "PRODOS" len
.AS "PRODOS"
@ -288,28 +288,26 @@ d2io lda blok figure out track & sector.
ldx slotz
lda IO.D2.DrvOn,x
jsr rdsector go read sector.
jsr BB.Read go read sector.
inc dbuf+1 bump address
inc sector
inc sector and sector #
bcs quitrd branch if error.
jsr rdsector
jsr BB.Read
quitrd ldy IO.D2.DrvOff,x
erretrn rts return error status in carry.
*--------------------------------------
rdsector .EQ * do seek then read sector.
*
seek lda BB.HdrTrk get track we're on
BB.Read lda BB.HdrTrk get track we're on
jsr BB.Trk2Qtrk
sta BB.CurQTrk
.1 lda BB.CurQTrk
cmp BB.TargetQTrk
beq seekend
beq .3
bcs .2 move out, not in
@ -320,46 +318,43 @@ seek lda BB.HdrTrk get track we're on
.2 dec
sta BB.CurQTrk
jsr BB.AllPhaseOff
jsr BB.PhaseOn
lda #35
lda #115 11.5 ms
jsr BB.MSWait Trash X
ldx slotz
lda IO.D2.Ph0Off,x
lda IO.D2.Ph1Off,x
lda IO.D2.Ph2Off,x
lda IO.D2.Ph3Off,x
bra .1 65c02
bcs .1 ALWAYS
.3 lda #0 wait 25.5 ms
jsr BB.MSWait Trash X
jsr BB.AllPhaseOff
bcs seekend ALWAYS
*--------------------------------------
BB.AllPhaseOff ldx slotz
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph1Off,x
rts
*--------------------------------------
BB.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
jsr .7
bcc BB.MSWait.RTS
pla
inc 2,4,6,0
.7 and #6 mask for 0,2,4,6
ora slotz Slot $n0
tax
lda IO.D2.Ph0On,x turn on one phase
lda #1
rts
*--------------------------------------
BB.MSWait php
sec (6) JSR (2)
BB.MSWait sec (6) JSR (2)
.1 ldx #19 (2)
@ -369,15 +364,13 @@ BB.MSWait php
sbc #1 (2) done 'n' intervals?
bne .1 (2+) a-reg counts
plp
BB.MSWait.RTS rts (6)
*--------------------------------------
BB.Trk2Qtrk asl x2
sta .1+1
bit BB.HdrVol
bmi .1 x4
bpl .1 x4
lsr x3
@ -531,7 +524,7 @@ zzzend ldx slotz
rts
chg5 .EQ *-chg5a
goseek jmp seek
goseek jmp BB.Read
.ED
*--------------------------------------
.LIST ON

View File

@ -19,14 +19,16 @@ D2MotorControl >PULLB MotorOn
* clc
.9 rts
.9
D2MotorControl.RTS
rts
*/--------------------------------------
*\--------------------------------------
D2MoveHead >PULLB MoveTo
>PULLB MoveFrom
>PULLB DrvSlt
jsr CheckDiskII
bcs .9
bcs D2MotorControl.RTS
ldy #0
@ -34,8 +36,6 @@ D2MoveHead >PULLB MoveTo
cmp MoveTo
beq .3
iny
bcs .2
inc MoveFrom<MoveTo, must move in
@ -45,68 +45,47 @@ D2MoveHead >PULLB MoveTo
.2 dec MoveFrom>MoveTo, must move out
sta MoveFrom
jsr D2.AllPhaseOff
jsr D2.PhaseOn
lda #0
lda #115 11.5 ms
jsr D2.Wait100msA Trash X
iny
jsr D2.PhaseOff
bra .1
.3 tya
beq .8
* lda #0
* jsr D2.Wait100msA Trash X
.8 clc
.9 rts
beq D2.AllPahseOff.8
lda #0 wait 25.5 ms
jsr D2.Wait100msA Trash X
*--------------------------------------
D2.AllPhaseOff ldx Slotn0
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph1Off,x
D2.AllPahseOff.8
clc
rts
*--------------------------------------
D2.PhaseOn bit #1 1,3,5,7 ?
beq .7
pha
bcc .1 move out,start by+1
jsr .7
pla
.1 inc 2,4,6,0
jsr .7
bcs .8
pla
inc 2,4,6,0
.7 and #6 mask for 0,2,4,6
ora Slotn0
tax
lda IO.D2.Ph0On,x turn on one phase
php
lda #1
jsr D2.Wait100msA
plp
.8 rts
*--------------------------------------
D2.PhaseOff lda MoveFrom
bit #1 1,3,5,7 ?
beq .1
pha
inc
jsr .1
pla
.1 and #6
ora Slotn0
tax
lda IO.D2.Ph0Off,x
rts
*--------------------------------------
D2.Wait100msA sec
.1 ldx #19

View File

@ -178,7 +178,7 @@ m128k sta idapple Save MACHID in temp location
.1
* stz $D700,x
stz fcbbuf,x
stz vcbbuf,x
stz VCBs,x
* stz $DA00,x
* stz $DB00,x
* stz $DC00,x

View File

@ -521,7 +521,7 @@ fndfcbuf lda fcbbuf+11,y get page address of file buffer.
sta zpt page boundaries.
fndfvol tax search for associated vcb
lda vcbbuf+16,x
lda VCBs+VCB.DEV,x
cmp fcbbuf+1,y is this vcb the same device?
beq tstvopen if it is, make sure volume is active.
@ -536,7 +536,7 @@ nxtfvol txa adjust index to next vcb.
fcbdead lda #$0B fcb error so
jsr sysdeath kill the system.
tstvopen lda vcbbuf,x make sure this vcb is open.
tstvopen lda VCBs,x make sure this vcb is open.
beq nxtfvol branch if it is not active.
stx vcbptr save ptr to good vcb.
clc no error
@ -607,20 +607,20 @@ online1 jsr fnddvcb see if it has already been logged in.
bcc volfound branch if read was ok.
tay error value.
lda vcbbuf+17,x don't take the vcb offline if
lda VCBs+VCB.OFCNT,x don't take the vcb offline if
bne rtrnerr there are active files present.
sta vcbbuf,x now take the volume offline
sta vcbbuf+16,x
sta VCBs,x now take the volume offline
sta VCBs+VCB.DEV,x
rtrnerr tya error value.
bcs olinerr1 branch if unable to read.
volfound lda vcbbuf,x has it been logged in before?
volfound lda VCBs,x has it been logged in before?
beq H349E if not.
lda vcbbuf+17,x it has, are there active files?
bmi H34AA branch if volume is currently busy.
lda VCBs+VCB.OFCNT,x it has, are there active files?
bne H34AA branch if volume is currently busy.
H349E jsr logvcb1 go log it in.
bcs olinerr1 branch if there is a problem.
@ -644,7 +644,7 @@ olinerr1 pha save error code.
iny report which other device has same name
ldx vcbentry
lda vcbbuf+16,x
lda VCBs+VCB.DEV,x
sta (usrbuf),y
stz duplflag clear duplicate flag.
@ -653,11 +653,11 @@ olinerr1 pha save error code.
H34CE sec flag error
rts
H34D0 lda vcbbuf,x get volume name count
H34D0 lda VCBs,x get volume name count
sta namcnt
ldy namptr index to user's buffer.
H34D9 lda vcbbuf,x move name to user's buffer
H34D9 lda VCBs,x move name to user's buffer
sta (usrbuf),y
inx
iny
@ -968,12 +968,10 @@ drevise1 lda d_attr mark entry as backupable
ldy h_entln now move 'd.' info to directory.
.1 lda d_stor-1,y
dey
H36CA lda d_stor,y
sta (zpt),y
dey
bpl H36CA
bpl .1
lda d_head is the entry block same as
cmp bloknml the entry's header block?
@ -1055,6 +1053,6 @@ H3770 clc no error
rts
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.A
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xdos.a
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -314,9 +314,9 @@ preproot jsr findvol search vcb's and dev's for spec'd volume
ldx vcbptr
inx
.2 lda vcbbuf+18,x misc info includes
.2 lda VCBs+VCB.TBLK,x misc info includes
sta h_tblk,y total # of blocks,
lda vcbbuf+26,x the address of the 1st bitmap,
lda VCBs+VCB.BMAP,x the address of the 1st bitmap,
sta h_bmap,y
lda bloknml,y directory's disk address,
sta d_head,y
@ -356,7 +356,7 @@ L396F sty vnptr and save.
L3975 pha acc now used as vcb lookup index.
tax index pointer to x.
lda vcbbuf,x get vcb volume name length.
lda VCBs,x get vcb volume name length.
bne L3987 branch if claimed vcb to be tested.
L397C ldy vnptr restore pointer to requested vol name.
@ -373,13 +373,13 @@ L398A cmp pathbuf,y is it the same as requested vol name?
inx
iny next character
lda vcbbuf,x
lda VCBs,x
dec namcnt last character?
bpl L398A if not.
plx restore pointer to matching vcb.
stx vcbptr save it for future reference.
lda vcbbuf+16,x get it's device #
lda VCBs+VCB.DEV,x get it's device #
sta devnum and save it.
stz bloknml+1 assume prefix is not used and
lda #$02 that root directory is to be used.
@ -407,8 +407,8 @@ L39C2 jsr rdgbuf read in directory (or prefix dir)
bcc L39F0 if they match, stop looking.
L39CC ldx vcbptr check if current (matched) vcb is active
lda vcbbuf+17,x i.e. does it have open files?
bmi L39ED report not found if active.
lda VCBs+VCB.OFCNT,x i.e. does it have open files?
bne L39ED report not found if active.
L39D4 lda vnptr make path ptr same as volume ptr
sta namptr
@ -440,10 +440,11 @@ L39FE sta devnum preserve device to be checked next.
jsr fnddvcb find vcb that claims this dev (if any).
bcs L3A29 branch if vcb full.
ldx vcbptr did fndvcb find it or return free vcb?
lda vcbbuf,x
lda VCBs,x
beq L3A16 if free vcb.
lda vcbbuf+17,x is this volume active?
bmi L39E2 if so, no need to re-log.
lda VCBs+VCB.OFCNT,x is this volume active?
bne L39E2 if so, no need to re-log.
L3A16 lda #$02 go read root dir into gbuf
ldx #$00
@ -472,14 +473,15 @@ fnddvcb lda #$00 look for vcb with this device#
ldy #$FF
L3A40 tax new index to next vcb
lda vcbbuf+16,x check all devnums
lda VCBs+VCB.DEV,x check all devnums
cmp devnum is this the vcb?
bne L3A4E if not
stx vcbptr
clc indicates found
rts
L3A4E lda vcbbuf,x is this a free vcb?
L3A4E lda VCBs,x is this a free vcb?
bne L3A57 if not
iny
@ -496,22 +498,22 @@ L3A57 txa
lda #$00 look for an entry to kick out
L3A62 tax
lda vcbbuf+17,x any open files?
bpl L3A70 no, kick this one out.
lda VCBs+VCB.OFCNT,x any open files?
beq L3A70 no, kick this one out.
txa next vcb
clc
adc #$20 (vcb entry size)
bne L3A62
beq L3A7A all vcb entries have open files
L3A70 stx vcbptr save entry index.
stz vcbbuf,x free this entry
stz vcbbuf+16,x
L3A79 clc no error.
lda #MLI.E.VCBFULL all vcb entries have open files
* sec
rts
L3A7A lda #MLI.E.VCBFULL vcb full error
* sec
L3A70 stx vcbptr save entry index.
stz VCBs,x free this entry
stz VCBs+VCB.DEV,x
L3A79 clc no error.
rts
*--------------------------------------
XDOS.CheckVolName
@ -564,7 +566,7 @@ XDOS.CheckVolName.RTS
rts
*--------------------------------------
logvcb ldx vcbptr previously logged in volume?
lda vcbbuf,x (acc = 0?)
lda VCBs,x (acc = 0?)
beq logvcb1 no, go prepare vcb.
jsr cmpvcb does vcb match vol read?
@ -572,7 +574,7 @@ logvcb ldx vcbptr previously logged in volume?
logvcb1 ldy #$1F zero out vcb entry
L3AB2 stz vcbbuf,x
L3AB2 stz VCBs,x
inx
dey
bpl L3AB2
@ -601,31 +603,40 @@ L3ACE .DO LOWERCASE=1
.ELSE
lda gbuf+4,y
.FIN
sta vcbbuf,x
sta VCBs,x
dex
dey
bne L3ACE
pla get length again
sta vcbbuf,x and save.
sta VCBs,x and save.
lda devnum last device used.
sta vcbbuf+16,x save device # and
lda gbuf+41 total # of blocks on this unit.
sta vcbbuf+18,x
lda gbuf+42
sta vcbbuf+19,x
sta VCBs+VCB.DEV,x save device # and
lda bloknml save address of root directory.
sta vcbbuf+22,x
sta VCBs+VCB.ROOT,x
lda bloknml+1
sta vcbbuf+23,x
sta VCBs+VCB.ROOT+1,x
lda gbuf+39 save address of the 1st bitmap.
sta vcbbuf+26,x
lda gbuf+40
sta vcbbuf+27,x
ldy #0
.1 lda gbuf+39,y
sta VCBs+VCB.BMAP,x
iny
inx
cpy #4
bne .1
* lda gbuf+39,y save address of the 1st bitmap.
* sta VCBs+VCB.BMAP,x
* lda gbuf+40
* sta VCBs+VCB.BMAP+1,x
* lda gbuf+41 total # of blocks on this unit.
* sta VCBs+VCB.TBLK,x
* lda gbuf+42
* sta VCBs+VCB.TBLK+1,x
L3B04 clc indicate logged if possible
rts
@ -636,7 +647,7 @@ tsterr lda #MLI.E.NOTPRODOS not tree or dir, unrecognized type
*--------------------------------------
cmpvcb lda gbuf+4 with name in directory.
and #$0F
cmp vcbbuf,x are they the same length?
cmp VCBs,x are they the same length?
stx xvcbptr (see rev note #23)
bne L3B1E if not the same.
@ -650,7 +661,7 @@ L3B18 .DO LOWERCASE=1
lda gbuf+4,y
.FIN
cmp vcbbuf,x
cmp VCBs,x
L3B1E sec anticipate different names.
bne L3B26 if not the same.
@ -670,11 +681,11 @@ L3B2C tax
jsr cmpvcb
bcs L3B41 if no match.
lda vcbbuf+17,x test for any open files.
bmi L3B4B cannot look at this volume.
lda VCBs+VCB.OFCNT,x test for any open files.
bne L3B4B cannot look at this volume.
stz vcbbuf,x take duplicate offline if no open files
stz vcbbuf+16,x
stz VCBs,x take duplicate offline if no open files
stz VCBs+VCB.DEV,x
* clc ok to log in new volume.
rts
@ -694,24 +705,26 @@ L3B4B sta duplflag duplicate has been found.
rts
*--------------------------------------
tstfrblk ldx vcbptr test if enough free blocks available for request.
lda vcbbuf+21,x check if proper count for this volume.
ora vcbbuf+20,x
lda VCBs+VCB.FBLK+1,x check if proper count for this volume.
ora VCBs+VCB.FBLK,x
bne L3BAD branch if count is non-zero.
tkfrecnt jsr cntbms get # of bitmaps
sta bmcnt and save.
stz scrtch start count at 0
stz scrtch+1
lda #$FF mark 'first free' temp as unknown
sta nofree
jsr upbmap update volume bitmap.
bcs L3BC1 if error.
ldx vcbptr get address of 1st bitmap
lda vcbbuf+26,x
lda VCBs+VCB.BMAP,x
sta bloknml
lda vcbbuf+27,x
lda VCBs+VCB.BMAP+1,x
sta bloknml+1
L3B81 jsr rdgbuf use general buffer for temp space to
@ -731,16 +744,17 @@ L3B96 ldx vcbptr mark which block had 1st free space
lda nofree
bmi L3BBE if no free space was found.
sta vcbbuf+28,x update the free count.
sta VCBs+VCB.BMAPIDX,x update the free count.
lda scrtch+1
sta vcbbuf+21,x update volume control byte.
sta VCBs+VCB.FBLK+1,x update volume control byte.
lda scrtch
sta vcbbuf+20,x
sta VCBs+VCB.FBLK,x
L3BAD lda vcbbuf+20,x compare total available free blocks
L3BAD lda VCBs+VCB.FBLK,x compare total available free blocks
sec on this volume.
sbc reql
lda vcbbuf+21,x
lda VCBs+VCB.FBLK+1,x
sbc reqh
bcc L3BBE
@ -793,8 +807,8 @@ L3BFA ora #$00
rts
cntbms ldx vcbptr
ldy vcbbuf+19,x return the # of bitmaps
lda vcbbuf+18,x possible with the total count
ldy VCBs+VCB.TBLK+1,x return the # of bitmaps
lda VCBs+VCB.TBLK,x possible with the total count
bne L3C0B found in the vcb.
dey adj for bitmap block boundary
@ -808,6 +822,6 @@ L3C0B tya
rts
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.B
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xdos.b
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -4,7 +4,7 @@ NEW
dealloc stx bmcnt high address of block.
pha save low address.
ldx vcbptr check that bitmap block address is
lda vcbbuf+19,x valid given the total # of blocks
lda VCBs+VCB.TBLK+1,x valid given the total # of blocks
cmp bmcnt on the volume.
pla
bcc L3C8C branch if invalid
@ -36,7 +36,8 @@ dealloc stx bmcnt high address of block.
lda bmcnt get map #
ldx vcbptr
sta vcbbuf+28,x and make it current.
sta VCBs+VCB.BMAPIDX,x and make it current.
lda bmadev
jsr gtbmap read it into buffer
bcs L3C8B
@ -130,38 +131,37 @@ L3CE4 lsr restore pos'n of all but left most bit.
beq L3CF7 always.
L3CF4 sta bmbuf+$100,y update to show allocated block in use.
L3CF7 lda #$80 indicate map is modified.
tsb bmastat
ldy vcbptr subtract 1 from total free vcb blocks
lda vcbbuf+20,y to account for newly allocated block.
sbc #$01 (carry is set)
sta vcbbuf+20,y
bcs L3D10 if high free count doesn't need adj.
lda vcbbuf+21,y adjust high count
dec
sta vcbbuf+21,y
L3D10 clc no errors.
ldx vcbptr subtract 1 from total free vcb blocks
lda VCBs+VCB.FBLK,x to account for newly allocated block.
bne .7
dec VCBs+VCB.FBLK+1,x
.7 dec VCBs+VCB.FBLK,x
lda scrtch return address in y,a of newly
ldy scrtch+1 allocated block.
clc no errors.
rts
*--------------------------------------
nxtbmap ldy vcbptr inc to next bitmap, but 1st make sure there is another one.
lda vcbbuf+19,y
lda VCBs+VCB.TBLK+1,y
lsr
lsr
lsr
lsr
cmp vcbbuf+28,y are there more maps ?
cmp VCBs+VCB.BMAPIDX,y are there more maps ?
beq L3D60 if no more to look at.
lda vcbbuf+28,y add 1 to current map
lda VCBs+VCB.BMAPIDX,y add 1 to current map
inc
sta vcbbuf+28,y
sta VCBs+VCB.BMAPIDX,y
jsr upbmap
fndbmap ldy vcbptr
lda vcbbuf+16,y get device #.
lda VCBs+VCB.DEV,y get device #.
cmp bmadev does this map match this device ?
beq L3D4A yes.
@ -169,7 +169,7 @@ fndbmap ldy vcbptr
bcs L3D5F
ldy vcbptr
lda vcbbuf+16,y
lda VCBs+VCB.DEV,y
sta bmadev and read in fresh bitmap for this dev.
L3D4A ldy bmastat is it already modified ?
@ -179,7 +179,7 @@ L3D4A ldy bmastat is it already modified ?
bcs L3D5F if error.
L3D54 ldy vcbptr get relative block # of bitmap.
lda vcbbuf+28,y
lda VCBs+VCB.BMAPIDX,y
asl 2 pages per block
sta basval
@ -203,12 +203,12 @@ upbmap clc
*--------------------------------------
gtbmap sta bmadev read bitmap specified by dev and vcb.
ldy vcbptr get lowest map # with free blocks in it
lda vcbbuf+28,y
lda VCBs+VCB.BMAPIDX,y
sta bmacmap associate offset with bitmap ctrl block.
clc add this # to the base address of
adc vcbbuf+26,y 1st bitmap and save in bmadadr which
adc VCBs+VCB.BMAP,y 1st bitmap and save in bmadadr which
sta bmadadr is address of bitmap to be used.
lda vcbbuf+27,y
lda VCBs+VCB.BMAP+1,y
adc #$00
sta bmadadr+1
lda #$01 read device command
@ -753,10 +753,11 @@ L415E jsr rfcbdat read in 1st block of directory file.
bcs L4147 return error after freeing buffer & fcb.
L4163 ldx vcbptr index to vcb.
inc vcbbuf+30,x add 1 to # of files currently open
lda vcbbuf+17,x and indicate that this volume has at
ora #$80 least 1 file active.
sta vcbbuf+17,x
inc VCBs+VCB.OFCNT,x add 1 to # of files currently open
* sec and indicate that this volume has at
* ror VCBs+VCB.OF,x least 1 file active.
ldy fcbptr index to fcb.
lda fcbbuf,y return ref # to user.
ldy #$05
@ -816,6 +817,6 @@ L41C1 tya calc position of next fcb.
rts
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.C
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xdos.c
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -691,6 +691,6 @@ twrprot1 sta unitnum make the device status call
rts carry is indeterminate.
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.D
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xdos.d
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -50,13 +50,14 @@ close2 ldy fcbptr
lda fcbbuf+1,y
sta devnum go look for associated vcb
jsr fnddvcb
ldx vcbptr get vcb pointer.
dec vcbbuf+30,x indicate one less file open.
bne L46B4 branch if that wasn't the last...
lda vcbbuf+17,x
and #$7F strip 'files open' bit
sta vcbbuf+17,x
ldx vcbptr get vcb pointer.
dec VCBs+VCB.OFCNT,x indicate one less file open.
* bne L46B4 branch if that wasn't the last...
* clc strip 'files open' bit
* ror VCBs+VCB.OF,x
L46B4 clc
rts
@ -488,20 +489,24 @@ XDOS.GetFileInfo
bne L49A4 if not, then error.
lda #$F0
sta d_stor for get info, report proper storage
stz reql type. forca a count of free blocks.
sta d_stor for get info, report proper storage type
stz reql force a count of free blocks.
stz reqh
ldx vcbptr
jsr tkfrecnt get a fresh count of free blocks on
ldx vcbptr this volume.
lda vcbbuf+21,x return total blocks and total in use.
lda VCBs+VCB.FBLK+1,x return total blocks and total in use.
sta reqh 1st transfer 'free' blocks to zpage
lda vcbbuf+20,x for later subtraction to determine
lda VCBs+VCB.FBLK,x for later subtraction to determine
sta reql the 'used' count.
lda vcbbuf+19,x transfer to 'd.' table as aux id
lda VCBs+VCB.TBLK+1,x transfer to 'd.' table as aux id
sta d_auxid+1 (total block count is considered aux id
pha for the volume)
lda vcbbuf+18,x
lda VCBs+VCB.TBLK,x
sta d_auxid
sec subtract and report the number of
sbc reql blocks 'in use'
@ -586,31 +591,30 @@ XDOS.RenameVol jsr XDOS.GetRenPath syntax new name.
bne L4A72 if not single name
ldx vcbptr check for open files before changing.
lda vcbbuf+17,x
bpl L49FF if volume not busy.
lda VCBs+VCB.OFCNT,x
beq L49FF if volume not busy.
lda #MLI.E.OPEN file busy error.
L49FD sec
rts
L49FF ldy #$00 get newname's length
L49FF ldy #0 get newname's length
lda pathbuf,y
ora #$F0 (root file storage type)
jsr XDOS.UpdateHdr update root directory.
bcs L4A74 rename error.
bcs .9 rename error.
ldy #$00
ldx vcbptr update vcb also.
L4A10 lda pathbuf,y move new name to vcb.
beq L4A1C
sta vcbbuf,x
iny next character
.1 iny next character
inx
bne L4A10 always.
lda pathbuf-1,y move new name to vcb.
sta VCBs-1,x
bne .1
L4A1C clc no errors
rts
* clc no errors
.9 rts
*--------------------------------------
XDOS.RenameFileDir
jsr getnamptr set y = 1st char of path, x = 0.
@ -807,6 +811,6 @@ getnamptr ldy #$00 return pointer to 1st name of path.
rts
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XDOS.E
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xdos.e
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -83,16 +83,15 @@ L4BA1 dec h_fcnt mark header with one less file.
L4BAF cmp #$01 adjust carry accordingly
rts
dvcbrev ldy vcbptr update block free count in vcb. point to vcb of correct device.
dvcbrev ldx vcbptr update block free count in vcb. point to vcb of correct device.
lda deblock get # of blocks recently freed.
adc vcbbuf+20,y
sta vcbbuf+20,y update current free block count.
adc VCBs+VCB.FBLK,x
sta VCBs+VCB.FBLK,x update current free block count.
lda deblock+1
adc vcbbuf+21,y
sta vcbbuf+21,y
adc VCBs+VCB.FBLK+1,x
sta VCBs+VCB.FBLK+1,x
lda #0
sta vcbbuf+28,y force re-scan from 1st bitmap
stz VCBs+VCB.BMAPIDX,x force re-scan from 1st bitmap
rts
L4BCD bcc L4B85 branch widened (always taken)
@ -908,7 +907,7 @@ h_fcnt .HS 0000 current # of files in this directory
h_bmap .HS 0000 address of first allocation bitmap
h_tblk .HS 0000 total number of blocks on this unit
*--------------------------------------
d_dev .HS 00 device number of this directory entry
d_head .HS 0000 address of <sub> directory header
d_entblk .HS 0000 address of block which contains entry
@ -929,7 +928,7 @@ d_auxid .HS 0000 user auxilliary identification
d_moddt .HS 0000 file's last modification date
.HS 0000 file's last modification time
d_dhdr .HS 0000 file directory header block address
*--------------------------------------
scrtch .HS 00000000 scratch area for allocation address conversion.
oldeof .HS 000000 temp used in r/w
oldmark .HS 000000
@ -1001,8 +1000,9 @@ cbytes .HS 0000
bufaddrl .HS 00
bufaddrh .HS 00
delflag .HS 00 used by 'detree' to know if called from delete (destroy).
*--------------------------------------
* variables used by SP remap & XRW Disk ][ to store last track used
*--------------------------------------
XRW.D2Trk .EQ *
XDOS.SPUnit .HS 00000000000000 14+1 for S0D2
.HS 00

View File

@ -118,9 +118,12 @@ L5362 lda IO.D2.DrvSel1,x
plp indicate drive off by setting z-flag.
lda #150 150 ms delay before stepping.
ldy #7
lda #0 150 ms delay before stepping.
jsr XRW.Wait100msA
.1 jsr XRW.Wait100msA
dey
bne .1
php now zero flag set.
@ -737,8 +740,8 @@ XRW.Seek ldx XRW.UnitIndex
sta XRW.CurrentQTrack
pla
sta XRW.CurrentTrack will be current track at the end
sta XRW.D2Trk-1,x
sta XRW.CurrentTrack
sta XRW.D2Trk-1,x will be current track at the end
ldy #0
@ -746,8 +749,6 @@ XRW.Seek ldx XRW.UnitIndex
cmp XRW.TargetQTrack
beq .3
iny
bcs .2
inc CC, CurrentQTrack>TargetQTrack, must move in
@ -757,81 +758,50 @@ XRW.Seek ldx XRW.UnitIndex
.2 dec CS, CurrentQTrack<TargetQTrack, must move out
sta XRW.CurrentQTrack
jsr XRW.AllPhaseOff
jsr XRW.PhaseOn
lda #0 wait 25.500 usec
lda #115 11.5 ms
jsr XRW.Wait100msA Trash X
jsr XRW.PhaseOff
iny
bra .1
.3 tya
beq .8
beq XRW.AllPhaseOff.8
* lda #0 wait 25.500 usec
* jmp XRW.Wait100msA Trash X
.8 rts
lda #0 wait 25.5 ms
jsr XRW.Wait100msA Trash X
*--------------------------------------
XRW.AllPhaseOff ldx A2L
bit IO.D2.Ph2Off,x
bit IO.D2.Ph0Off,x
bit IO.D2.Ph3Off,x
bit IO.D2.Ph1Off,x
XRW.AllPhaseOff.8
rts
*--------------------------------------
XRW.PhaseOn bit #1 1,3,5,7 ?
beq .7
pha
bcc .1 move out,start by+1
jsr .7
pla
.1 inc 2,4,6,0
jsr .7
bcs .8
pla
inc 2,4,6,0
.7 and #6 mask for 0,2,4,6
ora A2L Slot $n0
tax
lda IO.D2.Ph0On,x turn on one phase
php
jsr XRW.Wait100ms wait 100 usec
plp
.8 rts
*--------------------------------------
XRW.PhaseOff lda XRW.CurrentQTrack
bit #1 1,3,5,7 ?
beq .1
pha
inc
jsr .1
pla
.1 and #6
ora A2L
tax
lda IO.D2.Ph0Off,x
rts
*--------------------------------------
XRW.AllPhaseOff ldx A2L
lda IO.D2.Ph0Off,x
lda IO.D2.Ph1Off,x
lda IO.D2.Ph2Off,x
lda IO.D2.Ph3Off,x
rts
*--------------------------------------
XRW.Trk2Qtrk asl x2
sta .1+1
bit XRW.D2VolNum-1,x
bmi .1 x4
bpl .1 x4
lsr x3
@ -1078,6 +1048,6 @@ XRW.FC2Nib .HS 96
*--------------------------------------
XRW.LEN .EQ *-XRW.START
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S.XRW
LOAD USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s.xrw
LOAD usr/src/prodos.fx/prodos.s
ASM

View File

@ -10,12 +10,12 @@ ENHFILENAME .EQ 1
LOWERCASE .EQ 1
ACL .EQ 1
*--------------------------------------
.INB INC/ZP.I
.INB INC/IO.I
.INB INC/IO.D2.I
.INB INC/MONITOR.I
.INB INC/MLI.I
.INB INC/MLI.E.I
.INB inc/zp.i
.INB inc/io.i
.INB inc/io.d2.i
.INB inc/monitor.i
.INB inc/mli.i
.INB inc/mli.e.i
*--------------------------------------
MMStartUp .EQ $0202
NewHandle .EQ $0902
@ -135,8 +135,19 @@ rwts .EQ $D000 disk ii driver in bank 1
pathbuf .EQ $D700
XDOS.ClockDrv .EQ $D742
prefixbuf .EQ $D742+125
*--------------------------------------
fcbbuf .EQ $D800 fcb buffer
vcbbuf .EQ $D900 vcb buffer
VCBs .EQ $D900
VCB.DEV .EQ 16
VCB.OFCNT .EQ 17
VCB.ROOT .EQ 18
VCB.BMAP .EQ 20
VCB.TBLK .EQ 22
VCB.FBLK .EQ 24
VCB.BMAPIDX .EQ 26
*
VCB .EQ 27
*--------------------------------------
bmbuf .EQ $DA00 512 byte bitmap buffer
gbuf .EQ $DC00 general purpose 512 byte block buffer
*--------------------------------------
@ -154,14 +165,14 @@ ZPBLOfsHBits .BS 1
ZPBLLenBits .BS 1
.ED
*--------------------------------------
.INB USR/SRC/PRODOS.FX/PRODOS.S.LDR
.INB usr/src/prodos.fx/prodos.s.ldr
X.Unpak.XatYA sty ZPOutBufPtr
sta ZPOutBufPtr+1
lda PAKME.Table,x
sta ZPInBufPtr
lda PAKME.Table+1,x
sta ZPInBufPtr+1
.INB USR/SRC/SHARED/X.UNPAK.S
.INB usr/src/shared/x.unpak.s
*--------------------------------------
PAKME.Table
PAKME.ILDR .DA ILDR
@ -180,78 +191,78 @@ PAKME.SEL2 .DA SEL2
ILDR .DA #0
.DA ILDR.LEN
.PH $800
.INB USR/SRC/PRODOS.FX/PRODOS.S.ILDR
.INB usr/src/prodos.fx/prodos.s.ildr
.EP
GP .DA #0
.DA GP.LEN
.PH $BF00
.INB USR/SRC/PRODOS.FX/PRODOS.S.GP
.INB usr/src/prodos.fx/prodos.s.gp
.EP
XRW .DA #0
.DA XRW.LEN
.PH $D000
.INB USR/SRC/PRODOS.FX/PRODOS.S.XRW
.INB usr/src/prodos.fx/prodos.s.xrw
.EP
XDOS .DA #0
.DA XDOS.LEN
.PH $DE00
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.A
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.B
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.C
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.D
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.E
.INB USR/SRC/PRODOS.FX/PRODOS.S.XDOS.F
.INB usr/src/prodos.fx/prodos.s.xdos.a
.INB usr/src/prodos.fx/prodos.s.xdos.b
.INB usr/src/prodos.fx/prodos.s.xdos.c
.INB usr/src/prodos.fx/prodos.s.xdos.d
.INB usr/src/prodos.fx/prodos.s.xdos.e
.INB usr/src/prodos.fx/prodos.s.xdos.f
.EP
IRQ .DA #0
.DA IRQ.LEN
.PH $FF9B
.INB USR/SRC/PRODOS.FX/PRODOS.S.IRQ
.INB usr/src/prodos.fx/prodos.s.irq
.EP
RAM .DA #0
.DA RAM.LEN
.PH $FF00
.INB USR/SRC/PRODOS.FX/PRODOS.S.RAM
.INB usr/src/prodos.fx/prodos.s.ram
.EP
RAMX .DA #0
.DA RAMX.LEN
.PH $200
.INB USR/SRC/PRODOS.FX/PRODOS.S.RAMX
.INB usr/src/prodos.fx/prodos.s.ramx
.EP
NCLK .DA #0
.DA NCLK.LEN
.PH XDOS.ClockDrv
.INB USR/SRC/PRODOS.FX/PRODOS.S.NCLK
.INB usr/src/prodos.fx/prodos.s.nclk
.EP
TCLK .DA #0
.DA TCLK.LEN
.PH XDOS.ClockDrv
.INB USR/SRC/PRODOS.FX/PRODOS.S.TCLK
.INB usr/src/prodos.fx/prodos.s.tclk
.EP
CCLK .DA #0
.DA CCLK.LEN
.PH XDOS.ClockDrv
.INB USR/SRC/PRODOS.FX/PRODOS.S.CCLK
.INB usr/src/prodos.fx/prodos.s.cclk
.EP
SEL1 .DA #0
.DA SEL1.LEN
.PH $1000
.INB USR/SRC/PRODOS.FX/PRODOS.S.SEL1
.INB usr/src/prodos.fx/prodos.s.sel1
.EP
SEL2 .DA #0
.DA SEL2.LEN
.PH $1000
.INB USR/SRC/PRODOS.FX/PRODOS.S.SEL2
.INB usr/src/prodos.fx/prodos.s.sel2
.EP
*--------------------------------------
.AS "PAKME" TAG
@ -260,5 +271,5 @@ SEL2 .DA #0
.DA PAKME.Table Chunks
*--------------------------------------
MAN
SAVE USR/SRC/PRODOS.FX/PRODOS.S
SAVE usr/src/prodos.fx/prodos.s
ASM