mirror of
https://github.com/bobbimanners/Zapple-II.git
synced 2024-05-31 14:41:31 +00:00
More cleanup
This commit is contained in:
parent
05e5e40815
commit
bdb3192456
|
@ -1233,20 +1233,14 @@ FUNS1 LD A,(CURDRV) ; Contains user number & current drive
|
||||||
; 0 success, 1 reading unwritten data, 4 reading unwritten extent,
|
; 0 success, 1 reading unwritten data, 4 reading unwritten extent,
|
||||||
; 6 rec number out of range, 9 invalid FCB, 10 media changed, 0FFH h/w err
|
; 6 rec number out of range, 9 invalid FCB, 10 media changed, 0FFH h/w err
|
||||||
; TODO Update sequential record number & extent
|
; TODO Update sequential record number & extent
|
||||||
F_READRAND PUSH DE ; Preserve pointer to FCB
|
F_READRAND PUSH DE ; Copy pointer to FCB ...
|
||||||
LD H,D ; Pointer to FCB ...
|
POP IX ; ...
|
||||||
LD L,E ; ... into HL
|
LD A,(IX+0EH) ; Obtain file reference num from FCB S2
|
||||||
LD BC,0EH ; Offset to S2 field (reserved field)
|
|
||||||
ADD HL,BC ; Compute address
|
|
||||||
LD A,(HL) ; Obtain file reference num from FCB S2
|
|
||||||
LD (SMMLIN),A ; Store in parameter list for SET_MARK
|
LD (SMMLIN),A ; Store in parameter list for SET_MARK
|
||||||
LD (FRMLIN),A ; Store in parameter list for READ
|
LD (FRMLIN),A ; Store in parameter list for READ
|
||||||
|
|
||||||
LD BC,21H-0EH ; Skip ahead to random record num in FCB
|
LD B,(IX+21H) ; Load LSB of random record number
|
||||||
ADD HL,BC ; ...
|
LD C,(IX+22H) ; ...
|
||||||
LD B,(HL) ; Load LSB of random record number
|
|
||||||
INC HL ; Load MSB of random record number
|
|
||||||
LD C,(HL) ; ...
|
|
||||||
LD H,B ; Leave it in HL
|
LD H,B ; Leave it in HL
|
||||||
LD L,C ; ...
|
LD L,C ; ...
|
||||||
CALL RECS2LN2 ; Leaves the length in bytes in HL
|
CALL RECS2LN2 ; Leaves the length in bytes in HL
|
||||||
|
@ -1275,27 +1269,19 @@ F_READRAND PUSH DE ; Preserve pointer to FCB
|
||||||
CP 0 ; See if there was some other error
|
CP 0 ; See if there was some other error
|
||||||
JP NZ,FRRERR ; If so, return code 0FFH (h/w error)
|
JP NZ,FRRERR ; If so, return code 0FFH (h/w error)
|
||||||
|
|
||||||
POP DE ; Get pointer to FCB back
|
|
||||||
LD H,D ; Pointer to FCB ...
|
|
||||||
LD L,E ; ... into HL
|
|
||||||
LD BC,20H ; Advance to sequential rec number field
|
|
||||||
ADD HL,BC ; ...
|
|
||||||
;;;;TODO Should copy random record number to seq
|
;;;;TODO Should copy random record number to seq
|
||||||
;; INC (HL) ; Increment sequential record number
|
;; INC (IX+20H) ; Increment sequential record number
|
||||||
|
|
||||||
XOR A ; Zero for success
|
XOR A ; Zero for success
|
||||||
LD L,A ; Return code in L also
|
LD L,A ; Return code in L also
|
||||||
RET ; Done
|
RET ; Done
|
||||||
FRREOF POP DE ; Fix up stack
|
FRREOF LD A,1 ; EOF return code
|
||||||
LD A,1 ; EOF return code
|
|
||||||
LD L,A ; Return code in L also
|
LD L,A ; Return code in L also
|
||||||
RET ; Done (EOF)
|
RET ; Done (EOF)
|
||||||
FRRBFCB POP DE ; Fix up stack
|
FRRBFCB LD A,9 ; Invalid FCB return code
|
||||||
LD A,9 ; Invalid FCB return code
|
|
||||||
LD L,A ; Return code in L also
|
LD L,A ; Return code in L also
|
||||||
RET ; Done (Bad FCB)
|
RET ; Done (Bad FCB)
|
||||||
FRRERR POP DE ; Fix up stack
|
FRRERR LD A,0FFH ; All other errors are 0FFH
|
||||||
LD A,0FFH ; All other errors are 0FFH
|
|
||||||
LD L,A ; Return code in L aslo
|
LD L,A ; Return code in L aslo
|
||||||
RET ; Done (error)
|
RET ; Done (error)
|
||||||
|
|
||||||
|
|
Binary file not shown.
BIN
zapple2.po
BIN
zapple2.po
Binary file not shown.
Loading…
Reference in New Issue
Block a user