Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-07-17 17:18:31 +02:00
parent 238dacc597
commit 88a56a14a3
11 changed files with 158 additions and 141 deletions

Binary file not shown.

Binary file not shown.

View File

@ -514,7 +514,7 @@ findfcb ldy #$01 index to ref#
cmp FCBs,y
bne errnoref
fndfcbuf lda FCBs+11,y get page address of file buffer.
fndfcbuf lda FCBs+FCB.BUFID,y get page address of file buffer.
jsr getbufadr get file's address into bufaddrl,h
ldx bufaddrh (y=fcbptr preserved)
beq fcbdead fcb corrupted
@ -523,7 +523,7 @@ fndfcbuf lda FCBs+11,y get page address of file buffer.
inx
inx index block always 2 pages after data
stx zpt+1
lda FCBs+1,y also set up device #
lda FCBs+FCB.DEVID,y also set up device #
sta devnum
lda bufaddrl
sta datptr index and data buffers always on
@ -531,7 +531,7 @@ fndfcbuf lda FCBs+11,y get page address of file buffer.
fndfvol tax search for associated vcb
lda VCBs+VCB.DEV,x
cmp FCBs+1,y is this vcb the same device?
cmp FCBs+FCB.DEVID,y is this vcb the same device?
beq tstvopen if it is, make sure volume is active.
nxtfvol txa adjust index to next vcb.
@ -545,14 +545,14 @@ nxtfvol txa adjust index to next vcb.
fcbdead lda #$0B fcb error so
jsr sysdeath kill the system.
tstvopen lda VCBs,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
rts
errnoref lda #$00 put a zero into this fcb to
sta FCBs,y show free fcb.
sta FCBs,y show free fcb.
badref lda #MLI.E.BADREF requested refnum is
sec illegal (out of range)

View File

@ -412,7 +412,7 @@ L39C2 jsr XDOS.ReadGBuf read in directory (or prefix dir)
bcc L39F0 if they match, stop looking.
L39CC ldx vcbptr check if current (matched) vcb is active
lda VCBs+VCB.OFCNT,x i.e. does it have open files?
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
@ -577,7 +577,7 @@ logvcb ldx vcbptr previously logged in volume?
jsr cmpvcb does vcb match vol read?
bcc XDOS.CheckVolName.RTS yes, do not disturb.
logvcb1 ldy #$1F zero out vcb entry
logvcb1 ldy #VCB-1 zero out vcb entry
L3AB2 stz VCBs,x
inx
@ -652,7 +652,7 @@ tsterr lda #MLI.E.NOTPRODOS not tree or dir, unrecognized type
*--------------------------------------
cmpvcb lda gbuf+4 with name in directory.
and #$0F
cmp VCBs,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.
@ -686,19 +686,17 @@ L3B2C tax
jsr cmpvcb
bcs L3B41 if no match.
lda VCBs+VCB.OFCNT,x test for any open files.
lda VCBs+VCB.OFCNT,x test for any open files.
bne L3B4B cannot look at this volume.
stz VCBs,x take duplicate offline if no open files
stz VCBs,x take duplicate offline if no open files
stz VCBs+VCB.DEV,x
* clc ok to log in new volume.
rts
L3B41 txa index to next vcb
and #$E0 strip odd stuff.
* sec
adc #$1F inc to next entry.
adc #VCB-1
bcc L3B2C branch if more to check
L3B49 clc

View File

@ -280,7 +280,7 @@ XDOS.GetMark ldx fcbptr index to open fcb.
ldy #$02 index to user's mark parmeter.
.1 lda FCBs+18,x transfer current position
.1 lda FCBs+FCB.MARK,x transfer current position
sta (A3L),y to user's parameter list
inx
iny
@ -304,7 +304,7 @@ XDOS.SetMark ldy #$04 index to user's desired position.
sta tposll-2,y
bcc .2 branch if mark < eof
cmp FCBs+21,x
cmp FCBs+FCB.EOF,x
bcc .2 branch if mark qualifies.
bne L3DFD branch if mark > eof (invalid position)
@ -317,7 +317,7 @@ XDOS.SetMark ldy #$04 index to user's desired position.
bne .1 branch if more.
rdposn ldy fcbptr test to see if new position is
lda FCBs+19,y within the same (current) data block.
lda FCBs+FCB.MARK+1,y within the same (current) data block.
and #$FE
sta scrtch
lda tposlh middle byte of new position
@ -330,12 +330,12 @@ rdposn ldy fcbptr test to see if new position is
bcs L3E44 of current position.
lda tposhi make sure within the same 64k.
cmp FCBs+20,y
cmp FCBs+FCB.MARK+2,y
bne L3E44 branch if not.
jmp svmark if so, adj fcb, position ptr and return.
L3E44 lda FCBs+7,y determine file type for positioning.
L3E44 lda FCBs+FCB.STYPE,y determine file type for positioning.
beq L3E50 0 = invalid file type.
cmp #$04 tree class file?
@ -345,13 +345,13 @@ L3E44 lda FCBs+7,y determine file type for positioning.
L3E50 ldy #$A4 clear illegal filetype entry in fcb
sta FCBs,y
lda #$43 and report error
lda #MLI.E.BADREF and report error
sec
rts
L3E59 lda FCBs+7,y use storage type as # of index levels
L3E59 lda FCBs+FCB.STYPE,y use storage type as # of index levels
sta levels since 1=seed, 2=sapling, 3=tree.
lda FCBs+8,y
lda FCBs+FCB.F,y
and #$40 if previous data was modified then
beq L3E6B disk must be updated.
@ -360,7 +360,7 @@ L3E59 lda FCBs+7,y use storage type as # of index levels
bcs L3ED4 if error.
L3E6B ldy fcbptr test to see if current index block
lda FCBs+20,y is usable by checking if new
lda FCBs+FCB.MARK+2,y is usable by checking if new
and #$FE position is within 128k of the
sta scrtch beginning of current sapling level
lda tposhi chunk.
@ -380,13 +380,13 @@ L3E89 lda tposlh is new position < 512 ?
ora tposhi
bne L3EEF no, mark both data and index block as
lda FCBs+12,y unallocated. 1st block is only block
lda FCBs+FCB.1stBLK,y unallocated. 1st block is only block
sta bloknml and it's data.
lda FCBs+13,y high block address.
lda FCBs+FCB.1stBLK+1,y high block address.
jmp rnewpos go read in block and set statuses.
L3E9D lda FCBs+8,y check to see if previous index block
and #$80 was modified.
L3E9D lda FCBs+FCB.F,y check to see if previous index block
and #FCB.F.IBLKMOD was modified.
beq L3EA9 read in over it if current up to date.
jsr wfcbidx go update index on disk (fcb block addr)
@ -413,9 +413,9 @@ L3EA9 ldx levels be sure there is a top index
ldy fcbptr save newly loaded index block's address.
lda bloknml
sta FCBs+14,y
sta FCBs+FCB.IBLK,y
lda bloknml+1
sta FCBs+15,y
sta FCBs+FCB.IBLK+1,y
bcc datlevel branch always
L3ED4 rts
@ -464,8 +464,8 @@ datlevel lda tposhi get block address of data block
dec zpt+1
L3F18 ldy fcbptr set status to show what's missing
ora FCBs+8,y
sta FCBs+8,y
ora FCBs+FCB.F,y
sta FCBs+FCB.F,y
lsr discard bit that says data block
lsr unallocated because carry indicates if
jsr zipdata index block is invalid and needs to be
@ -518,10 +518,10 @@ svmark ldy fcbptr update position in fcb
iny
iny
ldx #$02
L3F68 lda FCBs+18,y save old mark in case calling routine
L3F68 lda FCBs+FCB.MARK,y save old mark in case calling routine
sta oldmark,x fails later.
lda tposll,x
sta FCBs+18,y
sta FCBs+FCB.MARK,y
dey
dex move 3 byte position marker
bpl L3F68
@ -536,9 +536,9 @@ L3F68 lda FCBs+18,y save old mark in case calling routine
L3F86 rts carry set if error
clrstats ldy fcbptr clear allocation states for data block
lda FCBs+8,y and both levels of indexes/
lda FCBs+FCB.F,y and both levels of indexes/
and #$F8
sta FCBs+8,y indicates that either they exist now
sta FCBs+FCB.F,y indicates that either they exist now
rts or unnecessary for current position.
dirmark cmp #$0D is it a directory ?
@ -550,7 +550,7 @@ dirmark cmp #$0D is it a directory ?
L3F9C lda scrtch recover results of previous subtraction.
lsr use difference as counter for how many
sta cntent blocks must be read to get to new pos'n.
lda FCBs+19,y test for positive direction
lda FCBs+FCB.MARK+1,y test for positive direction
cmp tposlh indicated by carry.
bcc L3FB9 if set, position forward. otherwise,
@ -597,23 +597,25 @@ rfcbdat lda #$01 read command
ldy fcbptr
lda bloknml
sta FCBs+16,y save block # just read in fcb.
sta FCBs+FCB.DBLK,y save block # just read in fcb.
lda bloknml+1
sta FCBs+17,y
sta FCBs+FCB.DBLK+1,y
L3FF2 rts
rfcbidx lda #$01 prepare to read index block : read command
sta A4L
ldx #$48 address of current index buffer.
jsr fileio1 go read index block.
bcs L400C error
bcs L400C error
ldy fcbptr
lda bloknml
sta FCBs+14,y save block address of this index in fcb
sta FCBs+FCB.IBLK,y save block address of this index in fcb
lda bloknml+1
sta FCBs+15,y
clc
sta FCBs+FCB.IBLK+1,y
* clc
L400C rts
wfcbfst jsr upbmap update the bitmap and write file's 1st block.
@ -631,9 +633,9 @@ rfcbfst lda #$01 read command.
ldx #$48 rd block into index portion of file buf
dofileio sta A4L command
lda FCBs,y get disk block address from fcb.
lda FCBs,y get disk block address from fcb.
sta bloknml block 0 not legal
cmp FCBs+1,y
cmp FCBs+FCB.DEVID,y
bne L4031
cmp #$00 are both bytes 0 ?
bne L4031 no, continue request
@ -641,17 +643,18 @@ dofileio sta A4L command
lda #$0C otherwise, allocation error.
jsr sysdeath doesn't return...
L4031 lda FCBs+1,y high address of disk block
L4031 lda FCBs+FCB.DEVID,y high address of disk block
sta bloknml+1
fileio1 php no interrupts
sei
lda $00,x get memory address of buffer from
sta buf page zero pointed to by x register
lda $01,x
sta buf+1 and pass address to device handler
ldy fcbptr
lda FCBs+1,y
lda FCBs+FCB.DEVID,y
sta devnum along with device #.
lda #$FF also, set to indicate reg call made to
sta ioaccess device handler.
@ -687,10 +690,12 @@ wfcbidx jsr upbmap update bitmap.
lda #$02
jsr dofileio go write out index block.
bcs L4096 if errors.
lda #$7F mark index status as current.
L408D ldy fcbptr change status byte to reflect
and FCBs+8,y successful disk file update.
sta FCBs+8,y (carry is unaffected)
and FCBs+FCB.F,y successful disk file update.
sta FCBs+FCB.F,y (carry is unaffected)
L4096 rts
*--------------------------------------
XDOS.Open jsr findfile look up the file.
@ -718,7 +723,7 @@ L40B9 ldx #$1F assign fcb,
lda #0
L40BD sta FCBs,y but clean it first.
L40BD sta FCBs,y but clean it first.
iny
dex
bpl L40BD
@ -729,7 +734,7 @@ L40BD sta FCBs,y but clean it first.
tay
L40CB lda d_dev-1,x move ownership info.
sta FCBs,y note: this code depends upon the defined
sta FCBs,y note: this code depends upon the defined
dey order of both the fcb and directory
dex entry buffer.
bne L40CB
@ -740,7 +745,7 @@ L40CB lda d_dev-1,x move ownership info.
lsr
lsr
tax save in x for later comparison
sta FCBs+7,y and in fcb for future access.
sta FCBs+FCB.STYPE,y and in fcb for future access.
lda d_attr get file's attributes and use it
and #$03 as a default access request.
cpx #$0D if directory, don't allow write enable.
@ -748,7 +753,7 @@ L40CB lda d_dev-1,x move ownership info.
and #$01 read enabled bit
L40EB sta FCBs+9,y
L40EB sta FCBs+FCB.ACCESS,y
and #$02 check for write enabled request.
beq L40F7 branch for open as read-only
@ -781,12 +786,12 @@ L4101 sta bloknml+1 of file and current usage count.
jsr fndfcbuf rtn addr of bufs in data & index ptrs.
lda flevel mark level at which
sta FCBs+27,y file was opened.
lda FCBs+7,y file must be positioned at beginning.
sta FCBs+FCB.FLEVEL,y file was opened.
lda FCBs+FCB.STYPE,y file must be positioned at beginning.
cmp #$04 is it a tree file ?
bcs L415E no, assume a directory.
lda #$FF fool the position routine into giving
sta FCBs+20,y a valid position with preloaded data,
sta FCBs+FCB.MARK+2,y a valid position with preloaded data,
ldy #$02 etc. set desired position to 0.
lda #$00
@ -800,7 +805,7 @@ L413C sta tposll,y
L4147 pha save error code.
ldy fcbptr free buffer space.
lda FCBs+11,y
lda FCBs+FCB.BUFID,y
beq L4156 if no bufnum, ok because never alloc'd.
jsr relbuffr go release buffer.
@ -864,7 +869,7 @@ L41A9 lda FCBs,y all bytes must match to say that it's
bne L41A9 loop to check all owner info.
inc totent file is already open, now see
lda FCBs+9,y if it's already opened for write. and #$02 if so report file busy (with carry set).
lda FCBs+FCB.ACCESS,y if it's already opened for write. and #$02 if so report file busy (with carry set).
and #$02 if so report file busy (with carry set).
beq L41C1 branch if this file is read access only.
sec

View File

@ -12,11 +12,11 @@ XDOS.Read jsr mvdbufr xfer buffer address and request count
bcc L4205 branch if result mark < eof. adjust
ldy fcbptr request to read until just before eof.
lda FCBs+21,y result = (eof-1) - position
lda FCBs+FCB.EOF,y result = (eof-1) - position
sbc tposll
sta cbytes
sta rwreql
lda FCBs+22,y
lda FCBs+FCB.EOF+1,y
sbc tposlh
sta cbytes+1
sta rwreqh
@ -158,12 +158,13 @@ preprw ldy fcbptr adj pointer to user's buffer to make
sta usrbuf
bcs L42E9 if no adjustment to hi address needed
dec usrbuf+1
L42E9 lda FCBs+31,y test for new line enabled.
L42E9 lda FCBs+FCB.NLMASK,y test for new line enabled.
clc
beq L42F9 if new line not enabled.
sec carry indicates new line enabled
sta nlmask
lda FCBs+10,y move newline character to more
lda FCBs+FCB.NLBYTE,y move newline character to more
sta nlchar accesible spot.
L42F9 ldy tposll index to 1st data.
lda datptr reset low order of position pointer to
@ -279,10 +280,10 @@ dread jsr rdposn
ldy #$00 provide dummy back pointer for future
ldx fcbptr re-position. x = hi byte of last block
L43A6 lda FCBs+16,x
L43A6 lda FCBs+FCB.DBLK,x
sta (datptr),y
stz FCBs+16,x mark current block as impossible
stz FCBs+FCB.DBLK,x mark current block as impossible
inx
iny inc indexes to do both hi and low bytes
cpy #$02
@ -302,7 +303,7 @@ mvcbytes ldy #$04 move request count to a more accessable location
sta cbytes+1
sta rwreqh
ldy fcbptr return y = val(fcbptr),
lda FCBs+9,y a = attributes
lda FCBs+FCB.ACCESS,y a = attributes
clc and carry clear...
rts
@ -314,7 +315,7 @@ mvdbufr ldy #$02 move the pointer to user's buffer
sta usrbuf+1
gfcbstyp ldy fcbptr return storage type
lda FCBs+7,y
lda FCBs+FCB.STYPE,y
rts
* this subroutine adds the requested byte count to mark and returns sum
@ -327,7 +328,7 @@ gfcbstyp ldy fcbptr return storage type
calcmrk ldx #$00
ldy fcbptr
clc
L43EE lda FCBs+18,y
L43EE lda FCBs+FCB.MARK,y
sta tposll,x
sta oldmark,x
adc cbytes,x
@ -341,7 +342,7 @@ L43EE lda FCBs+18,y
bne L43EE always.
eoftest lda scrtch,x new mark in scrtch.
cmp FCBs+21,y is new position > eof ?
cmp FCBs+FCB.EOF,y is new position > eof ?
bcc L4414 no, proceed.
bne L4414 yes, adjust 'cbytes' request
@ -354,9 +355,9 @@ L4414 rts
werreof jsr plus2fcb reset eof to pre-error position.
L4418 lda oldeof,x place oldeof back into fcb
sta FCBs+21,y
sta FCBs+FCB.EOF,y
lda oldmark,x also reset mark to last best
sta FCBs+18,y write position
sta FCBs+FCB.MARK,y write position
sta scrtch,x and copy mark to scrtch for test of
dey eof less than mark.
dex
@ -369,12 +370,12 @@ L4418 lda oldeof,x place oldeof back into fcb
wadjeof jsr plus2fcb get y=fcbptr+2, x=2, a=y.
L4434 lda FCBs+21,y copy eof to old eof
L4434 lda FCBs+FCB.EOF,y copy eof to old eof
sta oldeof,x
bcc L4442 and if carry set...
lda scrtch,x then copy scrtch to fcb's eof.
sta FCBs+21,y
sta FCBs+FCB.EOF,y
L4442 dey
dex copy all 3 bytes
@ -457,7 +458,7 @@ L44B8 jsr alcwblk go allocate for data block.
jsr gfcbstat clear allocation required bits in status
ora #$80 but first indicate index block is dirty.
and #$F8
sta FCBs+8,y
sta FCBs+FCB.F,y
lda tposhi calculate position within index block.
lsr
lda tposlh
@ -471,9 +472,9 @@ L44B8 jsr alcwblk go allocate for data block.
lda scrtch block. get low block address.
sta (zpt),y store low address.
ldy fcbptr update fcb to indicate that this block
sta FCBs+16,y is allocated.
sta FCBs+FCB.DBLK,y is allocated.
txa get high address again.
sta FCBs+17,y
sta FCBs+FCB.DBLK+1,y
L44E9 jsr preprw
jsr wrtpart
@ -541,7 +542,7 @@ L4549 sty tposll save low position
php save statuses
jsr gfcbstat
ora #$50
sta FCBs+8,y
sta FCBs+FCB.F,y
clc adjust user's low buffer address
lda tposll
adc usrbuf
@ -583,9 +584,9 @@ L457A jsr alcwblk get another block address for the sap
sta (zpt),y save hi address
dec zpt+1
ldy fcbptr make newly allocated block the current
sta FCBs+15,y index block.
sta FCBs+FCB.IBLK+1,y index block.
txa
sta FCBs+14,y
sta FCBs+FCB.IBLK,y
jsr wfcbfst save new top of tree
bcs L45B1
@ -604,18 +605,18 @@ swapdown jsr alcwblk make current seed into a sapling, allocate a block befo
bcs L45F6 return errors.
ldy fcbptr get previous first block
lda FCBs+12,y address into index block.
lda FCBs+FCB.1stBLK,y address into index block.
pha save temporarily while swapping in new
lda scrtch top index. get new block address (low)
tax
sta FCBs+12,y
lda FCBs+13,y
sta FCBs+FCB.1stBLK,y
lda FCBs+FCB.1stBLK+1,y
pha
lda scrtch+1 and high address too
sta FCBs+13,y
sta FCBs+15,y make new top also the current index in
sta FCBs+FCB.1stBLK+1,y
sta FCBs+FCB.IBLK+1,y make new top also the current index in
txa memory. get low address again.
sta FCBs+14,y
sta FCBs+FCB.IBLK,y
inc zpt+1 make previous the 1st entry in sub index
pla
sta (zpt)
@ -626,11 +627,12 @@ swapdown jsr alcwblk make current seed into a sapling, allocate a block befo
bcs L45F6 if error.
jsr gfcbstyp now adjust storage type by adding 1
adc #$01 (seed becomes sapling becomes tree)
sta FCBs+7,y
lda FCBs+8,y mark storage type modified
ora #$08
sta FCBs+8,y
* adc #$01 (seed becomes sapling becomes tree)
inc
sta FCBs+FCB.STYPE,y
lda FCBs+FCB.F,y mark storage type modified
ora #FCB.F.STMOD
sta FCBs+FCB.F,y
clc no error
L45F6 rts
@ -640,15 +642,17 @@ alcwblk jsr alc1blk
jsr gfcbstat mark usage as modified
ora #$10
sta FCBs+8,y
lda FCBs+24,y inc current usage count by 1
clc
adc #$01
sta FCBs+24,y
lda FCBs+25,y
adc #$00
sta FCBs+25,y
ora #FCB.F.UMOD
sta FCBs+FCB.F,y
lda FCBs+FCB.UBLK,y inc current usage count by 1
inc
sta FCBs+FCB.UBLK,y
bne L4615
lda FCBs+FCB.UBLK+1,y
inc
sta FCBs+FCB.UBLK+1,y
L4615 clc no error
L4616 rts
@ -657,7 +661,7 @@ tstwprot jsr gfcbstat check for 'never been modified' condition
and #$F0
bne L4615 ordinary rts if known write ok.
lda FCBs+1,y get file's dev #.
lda FCBs+FCB.DEVID,y get file's dev #.
sta devnum get current status of block device.
twrprot1 sta unitnum make the device status call

View File

@ -10,7 +10,7 @@ XDOS.Close ldy #$01 close all ?
L4654 sta fcbptr save current low byte of pointer.
tay get the level at which the file
lda FCBs+27,y was opened.
lda FCBs+FCB.FLEVEL,y was opened.
cmp flevel if file's level is < global level
bcc L4675 then don't close.
@ -40,14 +40,14 @@ L4683 jsr flush1 flush file 1st (including updating
bcs L46B6 bitmap). branch if errors.
close2 ldy fcbptr
lda FCBs+11,y release file buffer
lda FCBs+FCB.BUFID,y release file buffer
jsr relbuffr
bcs L46B6
lda #$00
ldy fcbptr
sta FCBs,y free fcb too
lda FCBs+1,y
lda FCBs+FCB.DEVID,y
sta devnum go look for associated vcb
jsr fnddvcb
@ -98,11 +98,11 @@ flush1 stz cferr for normal refnum flush, clear global error.
jsr findfcb setup pointer to fcb user references.
bcs L46E6 return any errors.
L46F1 lda FCBs+9,y test to see if file is modified.
L46F1 lda FCBs+FCB.ACCESS,y test to see if file is modified.
and #$02 is it write enabled ?
beq L46D9 branch if 'read only'
lda FCBs+28,y has eof been modified ?
lda FCBs+FCB.DIRTY,y has eof been modified ?
bmi L4704 if yes.
jsr gfcbstat has data been modified ?
@ -156,13 +156,14 @@ L4755 jsr entcalc buffer. set up pointer to entry.
jsr moventry move entry to temp entry buffer in
ldy fcbptr 'work space'. update 'blocks used' count
lda FCBs+24,y
lda FCBs+FCB.UBLK,y
sta d_usage
lda FCBs+25,y
lda FCBs+FCB.UBLK+1,y
sta d_usage+1
ldx #$00 and move in end of file mark whether
L476C lda FCBs+21,y needed or not.
L476C lda FCBs+FCB.EOF,y needed or not.
sta d_eof,x
inx
cpx #$03 move all 3 bytes
@ -173,7 +174,7 @@ L476C lda FCBs+21,y needed or not.
iny since the file first opened.
bne L476C branch always.
L4780 lda FCBs+5,y the last thing to update is storage
L4780 lda FCBs+FCB.STYPE-2,y the last thing to update is storage
asl type (y=fcbptr+2). shift into high
asl nibble.
asl
@ -187,9 +188,9 @@ L4780 lda FCBs+5,y the last thing to update is storage
bcs glberr error.
ldy fcbptr mark
lda FCBs+28,y fcb/directory
lda FCBs+FCB.DIRTY,y fcb/directory
and #$7F as
sta FCBs+28,y undirty.
sta FCBs+FCB.DIRTY,y undirty.
lda d_dev see if bitmap should be written.
cmp bmadev is it in same as current file ?
bne L47B2 yes, put it on the disk if necessary.
@ -217,7 +218,7 @@ L47C1 pla
rts
gfcbstat ldy fcbptr index to fcb.
lda FCBs+8,y return status byte.
lda FCBs+FCB.F,y return status byte.
rts
L47CA lda #MLI.E.LOCKED access error
@ -233,7 +234,7 @@ XDOS.SetEOF jsr gfcbstyp can only move end of tree, sapling or seed.
asl
asl
sta stortyp may be used later.
lda FCBs+9,y
lda FCBs+FCB.ACCESS,y
and #$02 is write enabled to set new eof ?
beq L47CA no, access error.
@ -245,7 +246,7 @@ XDOS.SetEOF jsr gfcbstyp can only move end of tree, sapling or seed.
iny upon contraction.
ldx #$02 all 3 bytes of the eof
L47EF lda FCBs+21,y
L47EF lda FCBs+FCB.EOF,y
sta oldeof,x
dey
dex
@ -276,7 +277,7 @@ eofset ldy #$04
inx
L481C lda (A3L),y
sta FCBs+21,x
sta FCBs+FCB.EOF,x
dex
dey
cpy #$02 all 3 bytes moved ?
@ -298,7 +299,7 @@ purge jsr flush1 make sure file is current
iny
ldx #$02
L4840 lda FCBs+18,y
L4840 lda FCBs+FCB.MARK,y
cmp tposll,x compare until not equal or carry clear.
bcc L485F branch if eof > mark.
@ -312,7 +313,7 @@ L484E ldy fcbptr
ldx #$00
L4853 lda tposll,x fake position, correct position will
sta FCBs+18,y be made below...
sta FCBs+FCB.MARK,y be made below...
iny
inx
cpx #$03 move all 3 bytes
@ -349,9 +350,9 @@ L485F jsr tkfrecnt force free block count before releasing
L489F sta dseed+1
L48A2 ldy fcbptr also must pass file's 1st block address.
lda FCBs+12,y
lda FCBs+FCB.1stBLK,y
sta firstbl
lda FCBs+13,y
lda FCBs+FCB.1stBLK+1,y
sta firstbh
stz deblock lastly, initialize # of blocks to
stz deblock+1 be free'd.
@ -363,10 +364,10 @@ L48A2 ldy fcbptr also must pass file's 1st block address.
ldx #$00
L48C2 lda firstbl,x
sta FCBs+12,y move in possible new first file block
lda FCBs+24,y address. adjust usage count also
sta FCBs+FCB.1stBLK,y move in possible new first file block
lda FCBs+FCB.UBLK,y address. adjust usage count also
sbc deblock,x
sta FCBs+24,y
sta FCBs+FCB.UBLK,y
iny
inx
txa
@ -379,18 +380,19 @@ L48C2 lda firstbl,x
lsr
lsr
ldy fcbptr and save it in fcb.
sta FCBs+7,y
sta FCBs+FCB.STYPE,y
jsr clrstats make it look as though position has
jsr dvcbrev nothing allocated, update total blocks
ldy fcbptr in fcb and correct position.
iny
iny
ldx #$02
L48F2 lda FCBs+18,y tell 'rdposn' to go to correct
L48F2 lda FCBs+FCB.MARK,y tell 'rdposn' to go to correct
sta tposll,x
eor #$80 position from incorrect place.
sta FCBs+18,y
sta FCBs+FCB.MARK,y
dey
dex
bpl L48F2
@ -428,7 +430,7 @@ XDOS.GetEOF ldx fcbptr index to end of file mark
ldy #$02 and index to user's call parameters
L4924 lda FCBs+21,x
L4924 lda FCBs+FCB.EOF,x
sta (A3L),y
inx
iny
@ -442,11 +444,11 @@ XDOS.NewLine ldy #$02 adjust newline status for open file.
lda (A3L),y on or off ?
ldx fcbptr it will be 0 if off.
sta FCBs+31,x set new line mask
sta FCBs+FCB.NLMASK,x set new line mask
iny
lda (A3L),y and move in 'new-line' byte
sta FCBs+10,x
sta FCBs+FCB.NLBYTE,x
clc no error possible
rts
@ -537,10 +539,9 @@ L49CF rts
L49D0 ldy #$0B
lda (A3L),y was clock null input ?
beq L49D9 if yes.
bne XDOS.SetFileInfoEx.8
jmp drevise1 end by updating directory.
L49D9 jmp drevise update with clock also...
jmp drevise update with clock also...
*--------------------------------------
XDOS.SetFileInfoEx
jsr findfile
@ -554,7 +555,7 @@ XDOS.SetFileInfoEx
dey
dex
bpl .2
XDOS.SetFileInfoEx.8
jmp drevise1
*--------------------------------------
XDOS.GetFileInfoEx

View File

@ -142,9 +142,9 @@ fcbused pha mark fcb as dirty so the directory will be flushed on 'flush
tya save regs.
pha
ldy fcbptr
lda FCBs+28,y fetch current fcb dirty byte.
lda FCBs+FCB.DIRTY,y fetch current fcb dirty byte.
ora #$80 mark fcb as dirty.
sta FCBs+28,y save it back
sta FCBs+FCB.DIRTY,y save it back
pla and restore regs.
tay
pla
@ -477,7 +477,7 @@ L4DFE dex set proper bits to 1
ldy fcbptr calculate buffer number
lda FCBs,y
asl buffer number = (entnum) * 2.
sta FCBs+11,y save it in fcb.
sta FCBs+FCB.BUFID,y save it in fcb.
tax use entnum * 2 as index to global
lda datptr+1 buffer addr tables. get addr already
sta buftbl-1,x validated as good. store hi addr

View File

@ -763,6 +763,8 @@ XRW.Seek ldx XRW.UnitIndex
nop
nop
lda IO.D2.Ph0On,y
nop
nop
jsr XRW.WaitSeekTime

View File

@ -139,16 +139,24 @@ prefixbuf .EQ $D742+125
FCBs .EQ $D800
FCB.ID .EQ 0
FCB.DEVID .EQ 1
FCB.MARK .EQ 2
FCB.STYPE .EQ 7
FCB.F .EQ 8
FCB.F.STMOD .EQ 8
FCB.F.STMOD .EQ %00001000
FCB.F.UMOD .EQ %00010000
FCB.F.IBLKMOD .EQ %10000000
FCB.ACCESS .EQ 9
FCB.NLBYTE .EQ 10
FCB.BUFID .EQ 11
FCB.IBLK .EQ 14
FCB.1stBLK .EQ 12 2 bytes
FCB.IBLK .EQ 14 2 bytes
FCB.DBLK .EQ 16 2 bytes
FCB.MARK .EQ 18 3 bytes
FCB.EOF .EQ 21 3 bytes
FCB.UBLK .EQ 24 2 bytes
FCB.FLEVEL .EQ 27
FCB.DIRTY .EQ 28
FCB.NLMASK .EQ 31
*
FCB .EQ 32
@ -159,7 +167,6 @@ VCB.OFCNT .EQ 17
VCB.BMAP .EQ 18
VCB.TBLK .EQ 20
VCB.FBLK .EQ 22
*VCB.ROOT .EQ 24
VCB.BMAPIDX .EQ 24
*
VCB .EQ 32

View File

@ -33,6 +33,7 @@ RW.Init >LDYAI RW.MSG
rts
.10 jsr RW.Detect2
bcc .1
>LDYAI RW.MSG.KO1
jsr PrintFYA
@ -94,7 +95,6 @@ RW.Detect2 php
bpl .1
lda #0
.2 sta RWBankSelect
*--------------------------------------
* Added after David Finnigan from macgui.com testing sessions
*
@ -120,7 +120,6 @@ RW.Detect2 php
*
* to address possibly a timing issue with Accelerators
*--------------------------------------
cmp 0
bne .4
eor #$FF
@ -145,9 +144,11 @@ RW.Detect2 php
sta CLRALTZP
plp
lda RW.PGCNT
beq .9
bmi .9
clc
rts
.9 sec
rts
*--------------------------------------
@ -357,8 +358,7 @@ DRV.COMMAND .EQ $42
DRV.BUFF .EQ $44
DRV.BLKNUM .EQ $46
*--------------------------------------
RWDRV.B.START
.PH $FF00
RWDRV.B.START .PH $FF00
RWDRV.START cld ProDOS will check that byte!!!
ldy DRV.COMMAND 0 = Status ?
beq RMDRV.CMDSTATUS