mirror of
https://github.com/bobbimanners/Zapple-II.git
synced 2024-06-12 01:29:31 +00:00
Fixed F_DELETE so wildcards work properly
This commit is contained in:
parent
8e171c43b6
commit
bf2f2c1f2f
|
@ -19,13 +19,16 @@
|
||||||
;
|
;
|
||||||
; BDOS TODOs
|
; BDOS TODOs
|
||||||
; ----------
|
; ----------
|
||||||
; TODO: NAME2FCB needs to generate size information in some cases but not others.
|
; TODO: Need to implement the BIOS entry points and jump table (see MG's Ruby)
|
||||||
; Right now this functionality is just commented out.
|
; TODO: Needs proper boot / warm boot entry points
|
||||||
; TODO: F_DELETE is deleting only the first matching file. Should be all matching files.
|
; TODO: NAME2FCB needs to generate size information in some cases but not
|
||||||
|
; others. Right now this functionality is just commented out.
|
||||||
|
; TODO: PIP wildcards only get first file, so there must be a problem with
|
||||||
|
; F_SFIRST/F_SNEXT still
|
||||||
; TODO: Get STAT.COM to work
|
; TODO: Get STAT.COM to work
|
||||||
; TODO: F_WRITE bug turns out to be bug in ProDOS 2.5.0a7 (SET_MARK)
|
; TODO: F_WRITE bug turns out to be bug in ProDOS 2.5.0a7 (SET_MARK)
|
||||||
; TODO: Maybe I should eliminate use of "EX AF,AF'" in BDOS since CP/M apps may
|
; TODO: Maybe I should eliminate use of "EX AF,AF'" in BDOS since CP/M apps
|
||||||
; expect exclusive use of alternate register set.
|
; may expect exclusive use of alternate register set.
|
||||||
; TODO: Implement missing system calls:
|
; TODO: Implement missing system calls:
|
||||||
; - F_ATTRIB (needs to support wildcards, leave FCB at DMAADDR)
|
; - F_ATTRIB (needs to support wildcards, leave FCB at DMAADDR)
|
||||||
; - RS232 (A_READ, A_WRITE)
|
; - RS232 (A_READ, A_WRITE)
|
||||||
|
@ -556,7 +559,7 @@ BDOSINIT DI ; Make sure interrupts are off
|
||||||
XOR A ; A=0 means close all files
|
XOR A ; A=0 means close all files
|
||||||
LD (FCMLIN),A ; Store in parameter list
|
LD (FCMLIN),A ; Store in parameter list
|
||||||
LD HL,FCMLI ; Pass address of 6502 JSR instruction
|
LD HL,FCMLI ; Pass address of 6502 JSR instruction
|
||||||
CALL PRODOS ; Invoke ProDOS MLI
|
CALL PRODOS ; Invoke ProDOS MLI to close all files
|
||||||
LD (FRN1),A ; Initialize FRNs to zero
|
LD (FRN1),A ; Initialize FRNs to zero
|
||||||
LD (FRN2),A ; ...
|
LD (FRN2),A ; ...
|
||||||
LD (FRN3),A ; ...
|
LD (FRN3),A ; ...
|
||||||
|
@ -567,9 +570,9 @@ BDOSINIT DI ; Make sure interrupts are off
|
||||||
LD (LOGVEC),HL ; ...
|
LD (LOGVEC),HL ; ...
|
||||||
LD (ROVEC),HL ; ...
|
LD (ROVEC),HL ; ...
|
||||||
JP CCP ; Start the CCP
|
JP CCP ; Start the CCP
|
||||||
BDOSIMP
|
|
||||||
|
|
||||||
;;; CALL PRHEX ; Print sys call number
|
BDOSIMP
|
||||||
|
;; CALL PRHEX ; Print sys call number
|
||||||
|
|
||||||
LD A,C ; Prepare to check C is in range
|
LD A,C ; Prepare to check C is in range
|
||||||
CP 41 ; Max syscall# for CP/M 2.2 is 40
|
CP 41 ; Max syscall# for CP/M 2.2 is 40
|
||||||
|
@ -997,19 +1000,39 @@ FSNS2 LD A,0FFH ; No match
|
||||||
; Delete file
|
; Delete file
|
||||||
; DE is the address of the FCB describing the file to delete
|
; DE is the address of the FCB describing the file to delete
|
||||||
; Returns error codes in A and L:
|
; Returns error codes in A and L:
|
||||||
; TODO: This only deletes the first file ... need to do F_SNEXT too
|
F_DELETE PUSH DE ; Preserve FCB
|
||||||
F_DELETE CALL F_SFIRST ; Search for file, create FCB
|
CALL F_SFIRST ; Search for file, create FCB
|
||||||
CP 0FFH ; If not found ...
|
CP 0FFH ; If not found ...
|
||||||
JP Z,FDERR ; ... Return with error
|
JP Z,FDS2 ; ... Return with error
|
||||||
|
LD DE,FILEBUF ; FCB created by F_SFIRST is in FILEBUF
|
||||||
LD IX,PATHBUF ; Destination buffer
|
LD IX,PATHBUF ; Destination buffer
|
||||||
CALL FCB2PATH ; Populate PATHLEN and PATH
|
CALL FCB2PATH ; Populate PATHLEN and PATH
|
||||||
LD HL,FDMLI ; Pass address of 6502 JSR instruction
|
LD HL,FDMLI ; Pass address of 6502 JSR instruction
|
||||||
CALL PRODOS ; Invoke ProDOS MLI
|
CALL PRODOS ; Invoke ProDOS MLI
|
||||||
CP 0 ; See if there was an error
|
CP 0 ; See if there was an error
|
||||||
JP NZ,FDERR ; Handle error
|
JP NZ,FDS2 ; Handle error
|
||||||
LD L,A ; ... and L too
|
|
||||||
|
FDL1 POP DE ; Get the FCB back
|
||||||
|
PUSH DE ; And stash it for next time
|
||||||
|
CALL F_SNEXT ; Search for file, create FCB
|
||||||
|
CP 0FFH ; If not found ...
|
||||||
|
JP Z,FDS1 ; ... We are done
|
||||||
|
LD IX,PATHBUF ; Destination buffer
|
||||||
|
LD DE,FILEBUF ; FCB created by F_NEXT is in FILEBUF
|
||||||
|
CALL FCB2PATH ; Populate PATHLEN and PATH
|
||||||
|
LD HL,FDMLI ; Pass address of 6502 JSR instruction
|
||||||
|
CALL PRODOS ; Invoke ProDOS MLI
|
||||||
|
CP 0 ; See if there was an error
|
||||||
|
JP NZ,FDS2 ; Handle error
|
||||||
|
JP FDL1 ; Loop for all matching files
|
||||||
|
|
||||||
|
FDS1 POP DE ; Restore stack
|
||||||
|
XOR A ; Return success
|
||||||
|
LD L,A ; Return code in L also
|
||||||
RET
|
RET
|
||||||
FDERR LD A,0FFH ; 0FFH for error
|
|
||||||
|
FDS2 POP DE ; Restore stack
|
||||||
|
LD A,0FFH ; 0FFH for error
|
||||||
LD L,A ; Return code in L also
|
LD L,A ; Return code in L also
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
@ -1915,25 +1938,25 @@ N2H2 OR 0F0H ;
|
||||||
|
|
||||||
; Print value of C in HEX
|
; Print value of C in HEX
|
||||||
; Used for DEBUG only
|
; Used for DEBUG only
|
||||||
;PRHEX PUSH AF
|
PRHEX PUSH AF
|
||||||
; PUSH BC
|
PUSH BC
|
||||||
; PUSH DE
|
PUSH DE
|
||||||
; PUSH HL
|
PUSH HL
|
||||||
; LD E,'['
|
LD E,'['
|
||||||
; CALL C_WRITE
|
CALL C_WRITE
|
||||||
; LD L,C ; Copy to HL for NUM2HEX
|
LD L,C ; Copy to HL for NUM2HEX
|
||||||
; LD H,0 ; ...
|
LD H,0 ; ...
|
||||||
; LD DE,HEXBUF ; Generate hex string to HEXBUF
|
LD DE,HEXBUF ; Generate hex string to HEXBUF
|
||||||
; CALL NUM2HEX ; ...
|
CALL NUM2HEX ; ...
|
||||||
; LD DE,HEXBUF+2 ; Write hex value to console
|
LD DE,HEXBUF+2 ; Write hex value to console
|
||||||
; CALL C_WRITESTR ;
|
CALL C_WRITESTR ;
|
||||||
; LD E,']'
|
LD E,']'
|
||||||
; CALL C_WRITE
|
CALL C_WRITE
|
||||||
; POP HL
|
POP HL
|
||||||
; POP DE
|
POP DE
|
||||||
; POP BC
|
POP BC
|
||||||
; POP AF
|
POP AF
|
||||||
; RET
|
RET
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; Very simple CCP
|
; Very simple CCP
|
||||||
|
@ -1949,12 +1972,14 @@ N2H2 OR 0F0H ;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
; TODO: Sanity check / validate number of command args for builtins
|
; TODO: Sanity check / validate number of command args for builtins
|
||||||
|
; TODO: Not handling case where there are no args propertly. If PIP is started
|
||||||
|
; without arguments then it should go to interactive mode. Zeroing FILEBUF
|
||||||
|
; does the trick!
|
||||||
; TODO: Make unadorned drives expand to x:????????.??? or something so
|
; TODO: Make unadorned drives expand to x:????????.??? or something so
|
||||||
; DIR A: works. Or just special case it in DIRECT ...
|
; DIR A: works. Or just special case it in DIRECT ...
|
||||||
; Need to handle this differently for eg: ERA A: vs DIR A: !!
|
; Need to handle this differently for eg: ERA A: vs DIR A: !!
|
||||||
; TODO: Parse * wildcard and generate FCB with ?s
|
; TODO: Parse * wildcard and generate FCB with ?s
|
||||||
; TODO: Implement REN, SAVE commands
|
; TODO: Implement REN, SAVE commands
|
||||||
; TODO: Bug in TYPEFILE - shows garbage for zero length file
|
|
||||||
|
|
||||||
; Get a line of text from the console & handle it
|
; Get a line of text from the console & handle it
|
||||||
CCP
|
CCP
|
||||||
|
@ -2422,13 +2447,13 @@ DIRECT LD HL,FILEBUF ; Reset DMAADDR to 0080H
|
||||||
LD E,13 ; Carriage return
|
LD E,13 ; Carriage return
|
||||||
CALL C_WRITE ;
|
CALL C_WRITE ;
|
||||||
|
|
||||||
LD DE,FCB1 ; Default FCB address 2
|
LD DE,FCB1 ; Default FCB address 1
|
||||||
CALL F_SFIRST ; Find first dir entry
|
CALL F_SFIRST ; Find first dir entry
|
||||||
CP 0 ;
|
CP 0 ;
|
||||||
RET NZ ; If not found, we're done
|
RET NZ ; If not found, we're done
|
||||||
CALL PRDIRENT ; Print entry
|
CALL PRDIRENT ; Print entry
|
||||||
|
|
||||||
DIRL1 LD DE,FCB1 ; Default FCB address 2
|
DIRL1 LD DE,FCB1 ; Default FCB address 1
|
||||||
CALL F_SNEXT ; Find next dir entry
|
CALL F_SNEXT ; Find next dir entry
|
||||||
CP 0 ;
|
CP 0 ;
|
||||||
RET NZ ; If not found, we're done
|
RET NZ ; If not found, we're done
|
||||||
|
|
Binary file not shown.
BIN
zapple2.po
BIN
zapple2.po
Binary file not shown.
Loading…
Reference in New Issue
Block a user