mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-06 14:11:48 -06:00
76 lines
2.1 KiB
Plaintext
76 lines
2.1 KiB
Plaintext
page
|
||
|
||
; Library: RCPERA for Z34RCP
|
||
; Author: Carson Wilson
|
||
; Version: 1.2
|
||
; Date: Sept. 15, 1989
|
||
; Changes: Chains to error handler with flag set to invoke transient ERA
|
||
; if a read only file is encountered. Propose error code
|
||
; 17 decimal for "file read only" error.
|
||
;
|
||
; Version: 1.1
|
||
; Date: August 12, 1989
|
||
; Changes: Now responds dynamically to QUIET flag, eliminating "noise".
|
||
; NOTE: if QUIET is active, using the inspect option or trying
|
||
; to erase R/O files will give meaningless messages. Use
|
||
; the PROT command to set R/O files to R/W first in order to
|
||
; erase them quietly.
|
||
;
|
||
; Author: Carson Wilson
|
||
; Version: 1.0
|
||
; Date: June 15, 1988
|
||
;
|
||
; Command: ERA
|
||
; Function: Erase files
|
||
; Forms:
|
||
; ERA <afn> Erase Specified files and print their names
|
||
; ERA <afn> o Erase Specified files and print their names, but ask
|
||
; for verification before Erase is done
|
||
|
||
era:
|
||
call retsave
|
||
ld a,(fcb2+1) ; Get eraflg if it's there
|
||
ld (eraflg),a ; Save it as a flag
|
||
ld a,1 ; Dir files only
|
||
call getdir ; Load directory of files
|
||
jp z,prfnf ; Abort if no files
|
||
;
|
||
; Main erase loop
|
||
;
|
||
era1: call break ; See if user wants to stop
|
||
call qplug ; Turn of output if quiet
|
||
push hl ; Save ptr to file
|
||
call prfn ; Print its name
|
||
ld (nxtfile),hl ; Save ptr to next file
|
||
pop hl ; Get ptr to this file
|
||
call unplug ; Turn output on
|
||
call rotest ; Test file pted to by hl for r/o
|
||
ld a,17 ; Proposed file R/O error code
|
||
ld b,00010000b ; EH flag to invoke transient
|
||
jp nz,errex1 ; Chain to transient if R/O
|
||
eraflg equ $+1 ; Address of flag
|
||
ld a,0 ; 2nd byte is flag
|
||
cp ' ' ; Is it an inspect option?
|
||
jr z,era2 ; Skip prompt if it is not
|
||
call eraq ; Erase?
|
||
jr nz,era3 ; Skip if not
|
||
era2: ld de,fcb1+1 ; Copy into fcb1
|
||
ld b,11 ; 11 bytes
|
||
call blkmov
|
||
call initfcb1 ; Init fcb
|
||
ld c,19 ; Delete file
|
||
call bdos
|
||
era3: ld hl,(nxtfile) ; Hl pts to next file
|
||
ld a,(hl) ; Get char
|
||
or a ; Done?
|
||
if erasp and spaceon
|
||
jp z,spaexit
|
||
else
|
||
jp z,exit
|
||
endif ; Erasp and spaceon
|
||
call crlf ; New line
|
||
jr era1
|
||
|
||
; End RCPERA.LIB
|
||
|
||
|