page ; Library: RCPR for Z34RCP ; Author: Carson Wilson ; Version: 1.5 ; Date: August 30, 1989 ; Changes: Minor bug fix as suggested by Howard Goldstein. ; ; Version: 1.4 ; Date: August 26, 1989 ; Changes: Now performs reset 37 for ALL drives under CP/M 2.2 or ZRDOS ; to ensure that fast fixed disks are reset under ZRDOS, then ; exits with reset 13 to compensate for bugs in ZRDOS/CP/M 2.2 ; reset 37. Still resets individual drives selectively under ; CP/M Plus and ZS/ZDDOS. ; Version: 1.3 ; Date: August 11, 1989 ; Changes: Now responds dynamically to QUIET flag, eliminating "noise." ; Now performs reset 37 in ALL cases, reset 13 as well if not ; CP/M Plus or ZSDOS (per suggestion by Howard Goldstein). ; Version: 1.2 ; Date: December 30, 1988 ; Changes: Now resets single drives under Z3PLUS. ; Version: 1.1 ; Date: September 11, 1988 ; Changes: Fixed bug which failed to detect ZRDOS. ZRDOS' function ; 37, like CP/M's, is not reliable. ; Author: Carson Wilson ; Version: 1.0 ; Date: June 15, 1988 ; ; Command: RESET ; Function: Reset the disk system ; Forms: R [d: or dir:] - ZSDOS or CP/M Plus ; R - CP/M 2.2 or ZRDOS ; Comments: ZRDOS does not require a disk system reset when disks are ; changed, but directory programs will not show the correct ; size if this is not done. It is also good practice. Since ; no warm boot is performed, the disk in drive A need not have ; the operating system on it. ; ; Under ZSDOS or CP/M Plus, individual drives may be reset, and ; if RESETSP is true, space remaining is also given. If ; the fast hard disk reset capability is enabled under ZSDOS, ; any "fast" fixed disks are also reset at this time. ; ; NOTE: It is necessary to reset a legal directory or DU when there are ; protected directories. reset: ld a,(quiet) or a ; Skip message if quiet jr nz,QReset call print ; Report action db ' Rese','t'+80h QReset: call cpmver ; CP/M Plus? jr nc,reset0 ; Yes ld c,48 call bdos ; ZRDOS or CP/M? ld a,h or a jr nz,reset0 ; No, assume bug-free F37 ld de,0ffffh ; Yes, reset ALL drives, both ways ld c,37 call bdos ld c,13 jp bdos ; Yes, do regular reset ; Reset individual drive(s) reset0: call dirchek ; Abort with error if illegal drivespec ld a,(fcb1) ; Use default drive? or a jr nz,reset1 ; No, use drive from FCB1 ld a,(cdrv) ; Yes, get ZCPR 3.3 current drive byte inc a ; Shift range to 1..16 reset1: ld hl,1 ; Map drive "A:" reset2: dec a ; Done yet? jr z,reset3 ; Yes add hl,hl ; No, shift vector to next drive jr reset2 ; Check for fixed disks reset3: push hl ; Save current or specified vector ld c,39 call bdos ; ZSDOS return fixed disks in HL pop de ; Restore vector ld a,d or h ; Add any fixed disks ld d,a ld a,e or l ld e,a ld c,37 ; Reset individual drive(s) if spaceon and resetsp call bdos jp crspace ; Show space remaining (QUIET sensitive) else jp bdos ; Do reset and return endif ; End RCPR.LIB