From a8d2f3bd39eab619547b819df174720824842fe6 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Sun, 15 Mar 2020 13:45:32 -0700 Subject: [PATCH] Minor Bug Fixes - Disk assignment edge case - CP/M 3 accidental fall thru - Cosmetic updates --- ReadMe.txt | 2 +- Source/CBIOS/cbios.asm | 72 ++++------------------------------- Source/CPM3/boot.z80 | 86 ++++-------------------------------------- Source/CPM3/util.z80 | 18 ++++++++- Source/HBIOS/hbios.asm | 6 ++- Source/HBIOS/ppp.asm | 2 +- Source/HBIOS/prp.asm | 4 +- Source/ver.inc | 2 +- Source/ver.lib | 2 +- 9 files changed, 41 insertions(+), 153 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index 81fe8ff0..4675bfcb 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -7,7 +7,7 @@ *********************************************************************** Wayne Warthen (wwarthen@gmail.com) -Version 2.9.2-pre.36, 2020-03-14 +Version 2.9.2-pre.37, 2020-03-15 https://www.retrobrewcomputers.org/ RomWBW is a ROM-based implementation of CP/M-80 2.2 and Z-System for diff --git a/Source/CBIOS/cbios.asm b/Source/CBIOS/cbios.asm index c3a0b49a..5482cbc1 100644 --- a/Source/CBIOS/cbios.asm +++ b/Source/CBIOS/cbios.asm @@ -2009,45 +2009,24 @@ AUTOSUB: ; ; SETUP AUTO SUBMIT COMMAND (IF REQUIRED FILES EXIST) LD A,(DEFDRIVE) ; GET DEFAULT DRIVE - - ;CALL PRTHEXBYTE - - PUSH AF - + PUSH AF ; SAVE DEFAULT DRIVE INC A ; CONVERT FROM DRIVE NUM TO FCB DRIVE CODE LD (FCB_SUB),A ; SET DRIVE OF SUBMIT.COM FCB LD (FCB_PRO),A ; SET DRIVE OF PROFILE.SUB FCB ; LD C,13 ; RESET DISK SYSTEM - CALL BDOS - - ;CALL PC_PERIOD - - POP AF -; - ;DEC A ; BACK TO ZERO INDEX - - ;LD E,A ; PUT IN E - ;LD C,14 ; SELECT DISK FUNCTION - ;CALL BDOS ; DO IT - - ;CALL PC_PERIOD + CALL BDOS ; DO IT + POP AF ; RESTORE DEFAULT DRIVE ; LD C,17 ; BDOS FUNCTION: FIND FIRST LD DE,FCB_SUB ; CHECK FOR SUBMIT.COM CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE - - ;CALL PRTHEXBYTE - INC A ; CHECK FOR ERR, $FF --> $00 RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT ; LD C,17 ; BDOS FUNCTION: FIND FIRST LD DE,FCB_PRO ; CHECK FOR PROFILE.SUB CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE - - ;CALL PRTHEXBYTE - INC A ; CHECK FOR ERR, $FF --> $00 RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT ; @@ -2423,7 +2402,8 @@ DRV_INIT8: CP E ; COMPARE TO CUR SLICE JR NZ,DRV_INIT8A ; IF NE, OK TO CONTINUE INC E ; IS BOOT DU/SLICE, SKIP IT - JR DRV_INIT8 ; AND RESTART LOOP + DJNZ DRV_INIT8 ; LOOP AS NEEDED + RET ; DONE ; DRV_INIT8A: ; ENTRY POINT TO SKIP BOOT DISK/LU CHECK ; @@ -2541,22 +2521,6 @@ DRV_INIT3A: RET ; AND RETURN ; DRV_INIT4: ; SET SLICES PER VOLUME (HDSPV) BASED ON HARD DISK VOLUME COUNT - -; ; *** DEBUG *** -; CALL NEWLINE2 -; LD A,(DRVLSTC) -; LD B,A -; CALL PRTHEXBYTE -; LD A,' ' -; CALL COUT -; LD HL,DRVLST -;TEMP1: -; LD A,(HL) -; INC HL -; CALL PRTHEXBYTE -; DJNZ TEMP1 -; ; *** DEBUG *** - LD A,E ; HARD DISK VOLUME COUNT TO A LD E,8 ; ASSUME 8 SLICES PER VOLUME DEC A ; DEC ACCUM TO CHECK FOR COUNT = 1 @@ -2569,14 +2533,6 @@ DRV_INIT4: ; SET SLICES PER VOLUME (HDSPV) BASED ON HARD DISK VOLUME COUNT DRV_INIT5: LD A,E ; SLICES PER VOLUME VALUE TO ACCUM LD (HDSPV),A ; SAVE IT -; -; ; SETUP TO ENUMERATE DEVICES TO BUILD DRVMAP -; LD B,BF_SYSGET -; LD C,BF_SYSGET_DIOCNT -; RST 08 ; E := DISK UNIT COUNT -; LD B,E ; COUNT TO B -; LD C,0 ; USE C AS DEVICE LIST INDEX -; LD DE,(BOOTVOL) ; BOOT VOLUME (UNIT, SLICE) LD A,1 ; ROM DISK UNIT? CP D ; CHECK IT @@ -2627,7 +2583,8 @@ DRV_INIT8: CP E ; COMPARE TO CUR SLICE JR NZ,DRV_INIT8A ; IF NE, OK TO CONTINUE INC E ; IS BOOT DU/SLICE, SKIP IT - JR DRV_INIT8 ; AND RESTART LOOP + DJNZ DRV_INIT8 ; LOOP AS NEEDED + RET ; DONE ; DRV_INIT8A: ; ENTRY POINT TO SKIP BOOT DISK/LU CHECK ; @@ -2712,20 +2669,7 @@ DPH_INIT1: CALL PRTDRV ; PRINT DRIVE INFO LD A,D ; A := UNIT PUSH HL ; SAVE DRIVE MAP POINTER - ;PUSH AF ; SAVE UNIT - ;; MATCH AND SAVE DEFAULT DRIVE BASED ON BOOT UNIT/SLICE - ;LD HL,BOOTVOL + 1 ; POINT TO BOOT UNIT - ;LD A,D ; LOAD CURRENT UNIT - ;CP (HL) ; MATCH? - ;JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT UNIT - ;DEC HL ; POINT TO BOOT SLICE - ;LD A,E ; LOAD CURRENT SLICE - ;CP (HL) ; MATCH? - ;JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT SLICE - ;LD A,C ; LOAD THE CURRENT DRIVE NUM - ;LD (DEFDRIVE),A ; SAVE AS DEFAULT DPH_INIT1A: - ;POP AF ; RESTORE UNIT LD DE,(DPHTOP) ; GET ADDRESS OF NEXT DPH PUSH DE ; ... AND SAVE IT ; INVOKE THE DPH BUILD ROUTINE @@ -2857,7 +2801,6 @@ MAKDPH2: PUSH HL ; MOVE ALLOC RESULT PTR POP BC ; ... TO BC POP HL ; RECOVER DPH PTR TO HL - ;JR NZ,ERR_HEAPOVF ; HANDLE POSSIBLE ALLOC OVERFLOW HERE JR C,ERR_HEAPOVF ; HANDLE POSSIBLE ALLOC OVERFLOW HERE LD (HL),C ; SAVE CKS/ALS BUF INC HL ; ... ADDRESS IN @@ -2876,7 +2819,6 @@ ALLOC: PUSH DE ; AND SAVE FOR RETURN VALUE ADD HL,DE ; ADD REQUESTED SPACE, HL := NEW HEAP TOP JR C,ALLOCX ; TEST FOR CPU MEMORY SPACE OVERFLOW - ;LD DE,(HEAPLIM) ; LOAD DE WITH HEAP LIMIT LD DE,HEAPEND ; LOAD DE WITH HEAP LIMIT EX DE,HL ; DE=NEW HEAPTOP, HL=HEAPLIM SBC HL,DE ; HEAPLIM - HEAPTOP diff --git a/Source/CPM3/boot.z80 b/Source/CPM3/boot.z80 index 38418b3a..a252faff 100644 --- a/Source/CPM3/boot.z80 +++ b/Source/CPM3/boot.z80 @@ -14,7 +14,7 @@ extrn @date,@hour,@min,@sec extrn @srch1 extrn addhla, bcd2bin, bin2bcd - ;extrn cout, phex8 + extrn cout, phex8, phex16, crlf, crlf2 include c:ver.lib @@ -85,7 +85,6 @@ cinit$1: rr l ; ... into correct vector position djnz cinit$1 ; loop as needed - ;ld hl,8000H ; device 0 ld (@civec),hl ; assign to console input ld (@covec),hl ; assign to console output @@ -100,8 +99,7 @@ cinit$1: ld hl,4000h ; assume aux on second char device jr nz,cinit$2 ; if console on unit 0, assumption good ld hl,8000h ; otherwise, aux goes to first char device -cinit$2: - ;ld hl,4000H ; device 1 +cinit$2: ld (@aivec),hl ; assign to aux input ld (@aovec),hl ; assign to aux output cinit$3: @@ -113,6 +111,7 @@ cinit$3: call addhla ; Skip used entries xor a ; Zero to accum ld (hl),0 ; Set table terminator + ret ; done dinit: ; loop through all disk devices to count hard disk units @@ -178,24 +177,7 @@ dinit3a: inc e ; increment hard disk count ret ; and return - dinit4: ; set slices per volume (hdspv) based on hard disk volume count - -; ; *** debug *** -; ;call newline2 -; ld a,(drvlstc) -; ld b,a -; call phex8 -; ld a,' ' -; call cout -; ld hl,drvlst -;temp1: -; ld a,(hl) -; inc hl -; call phex8 -; djnz temp1 -; ; *** debug *** - ld a,e ; hard disk volume count to a ld e,8 ; assume 8 slices per volume dec a ; dec accum to check for count = 1 @@ -250,6 +232,7 @@ dinit6: rlca ; *2 for word entry ld hl,@dtbl ; start of dtbl call addhla ; hl now points to entry + dinit6a: xor a ; zero accum ld (hl),a ; zero lsb @@ -277,7 +260,8 @@ dinit8: ; test to avoid reallocating boot disk unit/slice cp e ; compare to cur slice jr nz,dinit8a ; if ne, ok to continue inc e ; is boot du/slice, skip it - jr dinit8 ; and restart loop + djnz dinit8 ; loop till done with unit + ret dinit8a: ; d=unit, e=slice, l=dph#, b=slice cnt @@ -320,27 +304,6 @@ stpsiz equ $ - stpimg ; called CCP.COM on the system drive. ?ldccp: - - ;if zpm - ; - ;; Swap A: and system drive (make A: the system drive) - ;ld bc,(@dtbl) ; get drive A DPH - ;ld hl,@dtbl ; point to boot drive DPH - ;ld a,(@sysdr) - ;rlca - ;call addhla - ;ld e,(hl) ; set boot drive to drive A DPH - ;ld (hl),c ; ... and save boot drive DPH - ;inc hl - ;ld d,(hl) - ;ld (hl),b - ;ld (@dtbl),de ; set drive a DPH to boot drive - ; - ;xor a ; update @sysdr - ;ld (@sysdr),a - ; - ;endif - ; Force CCP to use system boot drive as initial default ld a,(@sysdr) ; get system boot drive ld (@ccpdr),a ; set CCP current drive @@ -369,22 +332,6 @@ stpsiz equ $ - stpimg if banked -; ; now, -; ; copy CCP to bank 0 for reloading -; lxi h,0100h ! lxi b,0C80h ; clone 3K, just in case -; lda @cbnk ! push psw ; save current bank -;ld$1: -; mvi a,tpa$bank ! call ?bnksl ; select TPA -; mov a,m ! push psw ; get a byte -; mvi a,2 ! call ?bnksl ; select extra bank -; pop psw ! mov m,a ; save the byte -; inx h ! dcx b ; bump pointer, drop count -; mov a,b ! ora c ; test for done -; jnz ld$1 -; pop psw ! call ?bnksl ; restore original bank - -; ; now, -; ; copy CCP to bank 0 for reloading ld hl,0100h ; clone 3K, just in case ld bc,0C80h ld a,(@cbnk) ; save current bank @@ -408,17 +355,9 @@ ld$1: endif - ;; Set first search path to system boot drive - ;inc a - ;ld (@srch1),a - - ;ld e,a - ;ld c,14 - ;call bdos - ret -no$CCP: ; here if we couldn't find the file +no$CCP: ; here if we couldn't find the file ld hl,ccp$msg call ?pmsg call ?conin @@ -429,17 +368,6 @@ no$CCP: ; here if we couldn't find the file if banked -; lxi h,0100h ! lxi b,0C00h ; clone 3K -;rl$1: -; mvi a,2 ! call ?bnksl ; select extra bank -; mov a,m ! push psw ; get a byte -; mvi a,tpa$bank ! call ?bnksl ; select TPA -; pop psw ! mov m,a ; save the byte -; inx h ! dcx b ; bump pointer, drop count -; mov a,b ! ora c ; test for done -; jnz rl$1 -; ret - ld hl,0100h ; clone 3K ld bc,0C80h rl$1: diff --git a/Source/CPM3/util.z80 b/Source/CPM3/util.z80 index affa7ade..639c3312 100644 --- a/Source/CPM3/util.z80 +++ b/Source/CPM3/util.z80 @@ -3,7 +3,7 @@ maclib options.lib public addhla, bcd2bin, bin2bcd - public phex16, phex8, cout + public phex16, phex8, cout, crlf, crlf2 cseg @@ -120,12 +120,28 @@ cout: pop bc pop af ret +; +; output 1 or 2 newlines +; +crlf2: + call crlf +crlf: + ; save all incoming registers + push af + ld a,13 + call cout + ld a,10 + call cout + pop af + ret else phex16: phex8: cout: +newline2: +newline: halt endif diff --git a/Source/HBIOS/hbios.asm b/Source/HBIOS/hbios.asm index 2fb9e56b..6e696cb6 100644 --- a/Source/HBIOS/hbios.asm +++ b/Source/HBIOS/hbios.asm @@ -3423,8 +3423,10 @@ PS_DISK: ; UNIT COLUMN PRTS("Disk $") LD A,C ; MOVE UNIT NUM TO A - CALL PRTDECB ; PRINT IT, ASSUME SINGLE DIGIT - PRTS(" $") ; PAD TO NEXT COLUMN + CALL PRTDECB ; PRINT IT + CP 10 ; CHECK FOR MULTIPLE DIGITS + CALL C,PC_SPACE ; EXTRA SPACE IF NEEDED + PRTS(" $") ; PAD TO NEXT COLUMN ; ; DEVICE COLUMN LD B,BF_DIODEVICE ; FUNC=GET DEVICE INFO, UNIT NUM STILL IN C diff --git a/Source/HBIOS/ppp.asm b/Source/HBIOS/ppp.asm index 2f0cbf1d..0b45b1eb 100644 --- a/Source/HBIOS/ppp.asm +++ b/Source/HBIOS/ppp.asm @@ -691,7 +691,7 @@ PPPSD_DEVICE: PPPSD_MEDIA: ; REINITIALIZE THE CARD HERE TO DETERMINE PRESENCE CALL PPPSD_INITCARD -#IF (PPPSDTRACE == 1) +#IF (PPPSDTRACE >= 3) CALL PPPSD_PRTERR ; PRINT ANY ERRORS #ENDIF LD E,MID_HD ; ASSUME WE ARE OK diff --git a/Source/HBIOS/prp.asm b/Source/HBIOS/prp.asm index 9bd1de1b..bb95606f 100644 --- a/Source/HBIOS/prp.asm +++ b/Source/HBIOS/prp.asm @@ -126,7 +126,7 @@ PRPCON_COLS .EQU 80 ; PROPELLER VGA DISPLAY COLS PRPCON_INIT: ; CALL NEWLINE - PRTS("PRPCON: $") + PRTS("PRPCON:$") ; ; DISPLAY CONSOLE DIMENSIONS CALL PC_SPACE @@ -547,7 +547,7 @@ PRPSD_DEVICE: PRPSD_MEDIA: ; REINITIALIZE THE CARD HERE CALL PRPSD_INITCARD -#IF (PRPSDTRACE == 1) +#IF (PRPSDTRACE >= 3) CALL PRPSD_PRTERR ; PRINT ANY ERRORS #ENDIF LD E,MID_HD ; ASSUME WE ARE OK diff --git a/Source/ver.inc b/Source/ver.inc index 8b15729e..02742296 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -2,4 +2,4 @@ #DEFINE RMN 9 #DEFINE RUP 2 #DEFINE RTP 0 -#DEFINE BIOSVER "2.9.2-pre.36" +#DEFINE BIOSVER "2.9.2-pre.37" diff --git a/Source/ver.lib b/Source/ver.lib index 69815624..a1c3667c 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -3,5 +3,5 @@ rmn equ 9 rup equ 2 rtp equ 0 biosver macro - db "2.9.2-pre.36" + db "2.9.2-pre.37" endm