diff --git a/Doc/RomWBW Applications.pdf b/Doc/RomWBW Applications.pdf index 92fb90fe..417c0466 100644 Binary files a/Doc/RomWBW Applications.pdf and b/Doc/RomWBW Applications.pdf differ diff --git a/Doc/RomWBW Disk Catalog.pdf b/Doc/RomWBW Disk Catalog.pdf index 44a2b878..f5f574a1 100644 Binary files a/Doc/RomWBW Disk Catalog.pdf and b/Doc/RomWBW Disk Catalog.pdf differ diff --git a/Doc/RomWBW Errata.pdf b/Doc/RomWBW Errata.pdf index a862db3f..4a019607 100644 Binary files a/Doc/RomWBW Errata.pdf and b/Doc/RomWBW Errata.pdf differ diff --git a/Doc/RomWBW ROM Applications.pdf b/Doc/RomWBW ROM Applications.pdf index 47f903b9..5cae7d61 100644 Binary files a/Doc/RomWBW ROM Applications.pdf and b/Doc/RomWBW ROM Applications.pdf differ diff --git a/Doc/RomWBW System Guide.pdf b/Doc/RomWBW System Guide.pdf index b4e4acad..491b01b1 100644 Binary files a/Doc/RomWBW System Guide.pdf and b/Doc/RomWBW System Guide.pdf differ diff --git a/Doc/RomWBW User Guide.pdf b/Doc/RomWBW User Guide.pdf index c552e81d..27d3b7a6 100644 Binary files a/Doc/RomWBW User Guide.pdf and b/Doc/RomWBW User Guide.pdf differ diff --git a/ReadMe.md b/ReadMe.md index 6f08dedc..fd653ed0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,9 +1,9 @@ **RomWBW ReadMe** \ -Version 3.4 \ +Version 3.5 \ Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \ -09 Jan 2024 +12 Jan 2024 # Overview diff --git a/ReadMe.txt b/ReadMe.txt index 344c7319..1f655065 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -1,6 +1,6 @@ RomWBW ReadMe Wayne Warthen (wwarthen@gmail.com) -09 Jan 2024 +12 Jan 2024 diff --git a/Source/Apps/format.asm b/Source/Apps/format.asm index 084be76f..3021b958 100644 --- a/Source/Apps/format.asm +++ b/Source/Apps/format.asm @@ -19,6 +19,8 @@ ; 1) Actually implement this ;_______________________________________________________________________________ ; +#include "../ver.inc" +; ;=============================================================================== ; Definitions ;=============================================================================== @@ -30,9 +32,6 @@ bdos .equ $0005 ; BDOS invocation vector ;; ;stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp ; -rmj .equ 3 ; CBIOS version - major -rmn .equ 0 ; CBIOS version - minor -; ;=============================================================================== ; Code Section ;=============================================================================== diff --git a/Source/BPBIOS/@WBW Z3ENV.txt b/Source/BPBIOS/@WBW Z3ENV.txt index cf57667c..0f115b92 100644 --- a/Source/BPBIOS/@WBW Z3ENV.txt +++ b/Source/BPBIOS/@WBW Z3ENV.txt @@ -12,7 +12,7 @@ Operating System (DOS), and Basic I/O System (BIOS). The CCP and DOS components are pre-built, relocatable binaries. The BIOS (BPBIOS) is assembled into a relocatable binary by the build, then the build links together all three components to form the final loadable image (.IMG) file. The linking process is performed by the custom BPBIOS -linker (BPBUILD.COM). In addition to linking the 3 components, BPBUILD also sets +linker (BPBUILD.COM). In addition to linking the 3 components, BPBUILD also adjusts the ZCPR environment configuration. BPBUILD is designed to be run interactively. However, it can be started with an @@ -24,8 +24,8 @@ running of BPBUILD. The CCP can be ZCPR 3.3 (ZCPR33?.REL), ZCPR 3.4 (Z34.REL), or ZCPR 4.1 (Z41.ZRL). ZCPR 3.3 uses static references to the ZCPR segments, so a custom version of it must be assembled. -The ZCPR33 subdirectory provides a build process for doing this. It produces a specific -version for each of the memory segment configurations (ZCPR33T.REL & ZCPR33N.REL). +The ZCPR33 subdirectory provides a build process for doing this. It produces a custom +version of ZCPR33.REL with the correct static references to the ZCPR segments. The DOS can be ZSDOS 1.1 (ZSDOS.ZRL) or ZSDOS 2.03 (ZS203.ZRL). These are both pre-built relocatable binaries. Note that only certain version combinations of ZSDOS and ZCPR are diff --git a/Source/BPBIOS/bpbio-ww.z80 b/Source/BPBIOS/bpbio-ww.z80 index 33c67a4b..c005fdb3 100644 --- a/Source/BPBIOS/bpbio-ww.z80 +++ b/Source/BPBIOS/bpbio-ww.z80 @@ -421,6 +421,12 @@ DRVTBL: LD HL,DPHTBL ; Point to DPH table PAGE ENDIF ;HARDDSK + IF RAMDSK ; << ****** Hardware Specific ****** >> + INCLUDE RAMD-WW.Z80 ; << This Driver is for HBIOS >> + + PAGE + ENDIF ;RAMDSK + ; << ****** Hardware Specific ****** >> ; << Enter Warm Boot routines in >> diff --git a/Source/BPBIOS/cboot-ww.z80 b/Source/BPBIOS/cboot-ww.z80 index d8dee6fd..1196b436 100644 --- a/Source/BPBIOS/cboot-ww.z80 +++ b/Source/BPBIOS/cboot-ww.z80 @@ -120,14 +120,14 @@ DYNLP: LD E,(HL) DEC DE ; Else back up Ptr to Driver DEC DE LD A,(DE) ; Get driver # -; IF RAMDSK -; DEC A -; DEC A ; Hard Disk (Driver 2)? -; JR Z,ADDSIZ ; ..jump if so -; DEC A ; RAM Disk (Driver 3)? -; ELSE + IF RAMDSK + DEC A + DEC A ; Hard Disk (Driver 2)? + JR Z,ADDSIZ ; ..jump if so + DEC A ; RAM Disk (Driver 3)? + ELSE CP 2 ; Hard Disk (Driver 2)? -; ENDIF ; Ramdsk + ENDIF ; Ramdsk JR NZ,DYNCHK ; ..jump to end if Not ADDSIZ: PUSH BC ; Save loop counter PUSH HL ; and ptr to DPH diff --git a/Source/BPBIOS/def-ww-z33.lib b/Source/BPBIOS/def-ww-z33.lib index a9cf430f..41a02394 100644 --- a/Source/BPBIOS/def-ww-z33.lib +++ b/Source/BPBIOS/def-ww-z33.lib @@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats? ;;--- RAM Disk Section --- ; -;RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made +RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made ;--- Hard Disk Section --- diff --git a/Source/BPBIOS/def-ww-z33bnk.lib b/Source/BPBIOS/def-ww-z33bnk.lib index 1f8a0942..b70eeed6 100644 --- a/Source/BPBIOS/def-ww-z33bnk.lib +++ b/Source/BPBIOS/def-ww-z33bnk.lib @@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats? ;;--- RAM Disk Section --- ; -;RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made +RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made ;--- Hard Disk Section --- diff --git a/Source/BPBIOS/def-ww-z34.lib b/Source/BPBIOS/def-ww-z34.lib index 262c731b..5bf9f733 100644 --- a/Source/BPBIOS/def-ww-z34.lib +++ b/Source/BPBIOS/def-ww-z34.lib @@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats? ;;--- RAM Disk Section --- ; -;RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made +RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made ;--- Hard Disk Section --- diff --git a/Source/BPBIOS/def-ww-z34bnk.lib b/Source/BPBIOS/def-ww-z34bnk.lib index 6a5a693e..e97e59f2 100644 --- a/Source/BPBIOS/def-ww-z34bnk.lib +++ b/Source/BPBIOS/def-ww-z34bnk.lib @@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats? ;;--- RAM Disk Section --- ; -;RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made +RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made ;--- Hard Disk Section --- diff --git a/Source/BPBIOS/def-ww-z41bnk.lib b/Source/BPBIOS/def-ww-z41bnk.lib index e8e28a1b..13fd4da1 100644 --- a/Source/BPBIOS/def-ww-z41bnk.lib +++ b/Source/BPBIOS/def-ww-z41bnk.lib @@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats? ;;--- RAM Disk Section --- ; -;RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made +RAMDSK EQU YES ; YES = Make RAM-Disk Code, NO = No code made ;--- Hard Disk Section --- diff --git a/Source/BPBIOS/dphhd.lib b/Source/BPBIOS/dphhd.lib index 89a22a4d..a43ceb7e 100644 --- a/Source/BPBIOS/dphhd.lib +++ b/Source/BPBIOS/dphhd.lib @@ -9,10 +9,11 @@ ; 1.0 - 31 Aug 92 - General Release. HFB ; 0.1 - 3 Jan 92 - Initial release. HFB ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -; The Physical Drive Number byte (XDPH+3) is simply an index to the Physical -; Drive as specified in the ICFG-xx.Z80 file. Up to three physical drives -; may be defined in that section, the first byte of which defines the -; Physical/Logical Unit Address (Device & LUN for SCSI, Master/Slave for IDE), +; The Logical Drive Number byte (XDPH+3) is simply an index into the +; BPBIOS physical drive table as specified in the ICFG-xx.Z80 file. +; BPBIOS supports exactly three logical drives which +; are defined in that section, the first byte of which defines the +; Physical Unit (HBIOS Disk Unit) ; and a flag bit to specify whether or not the drive is physically present. ; See ICFG-xx.Z80 for a definition of the data. @@ -21,7 +22,7 @@ XDPH90: DEFB TRUE ; Format lock flag (Lock RAM Drive) DEFB FIXDSK ; Disk Drive Type - DEFB 2 ; Driver ID = Treat as Hard Drive + DEFB 3 ; Driver ID = Treat as Hard Drive DEFB HB_MDRAM ; Physical Drive Number DPH$90: DEFW 0 ; Skew Table pointer DEFW 0,0,0 ; Scratch area @@ -34,7 +35,7 @@ DPH$90: DEFW 0 ; Skew Table pointer XDPH91: DEFB TRUE ; Format lock flag (Lock ROM Drive) DEFB FIXDSK ; Disk Drive Type - DEFB 2 ; Driver ID = Treat as Hard Drive + DEFB 3 ; Driver ID = Treat as Hard Drive DEFB HB_MDROM ; Physical Drive Number DPH$91: DEFW 0 ; Skew Table pointer DEFW 0,0,0 ; Scratch area @@ -48,7 +49,7 @@ DPH$91: DEFW 0 ; Skew Table pointer XDPH50: DEFB TRUE ; Format lock flag (Lock First Hard Drive) DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$50: DEFW 0 ; Skew table pointer DEFW 0,0,0 ; Scratch area DEFW DIRBUF ; Directory buffer pointer @@ -61,7 +62,7 @@ DPH$50: DEFW 0 ; Skew table pointer XDPH51: DEFB TRUE ; --- Second Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$51: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -74,7 +75,7 @@ DPH$51: DEFW 0 XDPH52: DEFB TRUE ; --- Third Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..2] for this Partition + DEFB 0 ; Physical drive [0..2] for this Partition DPH$52: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -87,7 +88,7 @@ DPH$52: DEFW 0 XDPH53: DEFB TRUE ; --- Fourth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$53: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -100,7 +101,7 @@ DPH$53: DEFW 0 XDPH54: DEFB TRUE ; --- Fifth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$54: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -113,7 +114,7 @@ DPH$54: DEFW 0 XDPH55: DEFB TRUE ; --- Sixth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$55: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -126,7 +127,7 @@ DPH$55: DEFW 0 XDPH56: DEFB TRUE ; --- Seventh Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$56: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -139,7 +140,7 @@ DPH$56: DEFW 0 XDPH57: DEFB TRUE ; --- Eighth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV0 ; Physical drive [0..6] for this Partition + DEFB 0 ; Logical drive [0..2] for this Partition DPH$57: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -152,7 +153,7 @@ DPH$57: DEFW 0 XDPH58: DEFB TRUE ; --- Ninth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV1 ; Physical drive [0..6] for this Partition + DEFB 1 ; Logical drive [0..2] for this Partition DPH$58: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -165,7 +166,7 @@ DPH$58: DEFW 0 XDPH59: DEFB TRUE ; --- Tenth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV1 ; Physical drive [0..6] for this Partition + DEFB 1 ; Logical drive [0..2] for this Partition DPH$59: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -178,7 +179,7 @@ DPH$59: DEFW 0 XDPH60: DEFB TRUE ; --- Eleventh Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV1 ; Physical drive [0..6] for this Partition + DEFB 1 ; Logical drive [0..2] for this Partition DPH$60: DEFW 0 DEFW 0,0,0 DEFW DIRBUF @@ -191,7 +192,7 @@ DPH$60: DEFW 0 XDPH61: DEFB TRUE ; --- Twelveth Hard Drive/Partition DEFB FIXDSK ; Disk drive type DEFB 2 ; Driver ID - 2=hard drive - DEFB HB_HDDEV1 ; Physical drive [0..6] for this Partition + DEFB 1 ; Logical drive [0..2] for this Partition DPH$61: DEFW 0 DEFW 0,0,0 DEFW DIRBUF diff --git a/Source/BPBIOS/hard-ww.z80 b/Source/BPBIOS/hard-ww.z80 index b5943ac7..f17373d5 100644 --- a/Source/BPBIOS/hard-ww.z80 +++ b/Source/BPBIOS/hard-ww.z80 @@ -104,33 +104,55 @@ SELHD: ; SET DEVICE ; Writes from HSTBUF using HSTTRK and HSTSEC to build Block Number. ; NOTE: This routine uses physical drive characteristics from ICFG-xx. -HDWRIT: +HDWRIT: +; CALL PRTSTRD +; DEFB '[HD WRITE]$' XOR A LD (HSTWRT),A ; Show no active writes pending - JP HDSK_WRITE ; ..continue + + LD B,HB_DIOWRITE ; HBIOS WRITE + JR HDIO ; ..continue ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ; Read from Hard Disk Drive < Internal BIOS Routine > ; Reads to HSTBUF using HSTTRK and HSTSEC to build Block Number. -; NOTE: This routine uses physical drive characteristics from ICFG-xx. -; The routine computes a sequential block number with the algorithm; -; Trk * 16 + Sector, HBIOS uses LBA addressing for hard drive like -; devices i.e. everything but floppies. The Track contains the most -; significant 16 bits, Head the next byte and Sector the least -; significant byte. Note, only 16 bits are needed to address 33 -; megabytes for now 24 bits will be used for the LBA address. For non- -; hard drive like devices, Head, Sector and Track can be computed -; using Physical characteristics (hdHds = Number_of_Heads, -; hdSPT = Sectors_per_Track) according to the algorithm: -; -; Sector := (Block# MOD hdSPT)+1 (* Quotient1 := Block# DIV hdSPT *) -; Head := Quotient1 MOD hdHds (* Quotient2 := Quotient1 DIV hdHds *) -; Track := Quotient2 -;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: HDREAD: - JP HDSK_READ +; CALL PRTSTRD ; DEBUG +; DEFB '[HD READ]$' ; DEBUG + + LD B,HB_DIOREAD ; HBIOS READ + JR HDIO ; ..continue + +;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +; Common read/write code for hard disk + +HDIO: + LD HL,(HSTDPH) ; GET ACTIVE DPH POINTER + DEC HL ; ADJUST TO POINT TO BPBIOS LOGICAL UNIT NUMBER + LD A,(HL) ; LOAD IT IN A +; + ; Convert logical -> physical + ; Code below is ugly brute force approach, but since there are + ; always exactly 3 logical drives in BPBIOS and the first one + ; is the most commonly used, this turns out to be reasonably + ; efficient. + LD HL,HDRV0 ; PERHAPS HDRV0 + OR A ; A == 0? + JR Z,HDSK_HDIO1 ; HANDLE IF SO + LD HL,HDRV1 ; PERHAPS HDRV1 + DEC A ; A == 1? + JR Z,HDSK_HDIO1 ; HANDLE IF SO + LD HL,HDRV2 ; PERHAPS HDRV2 + DEC A ; A == 2? + JR Z,HDSK_HDIO1 ; HANDLE IF SO + CALL PANIC ; INVALID LOGICAL UNIT NUMBER +HDSK_HDIO1: + LD A,(HL) ; LOAD PHYS UNIT NUM (HBIOS DISK UNIT) + AND 0FH ; REMOVE EXTRANEOUS BITS + LD C,A ; PUT IN C FOR BELOW + JR HB_DSKIO IF BANKED COMMON /BANK2/ @@ -142,28 +164,25 @@ HDREAD: ; HBIOS Disk Driver Interface ;================================================================================================== ; -; HBIOS disk commands -; -HB_DSKRD EQU 13H -HB_DSKWR EQU 14H +; Enter with B=HBIOS disk function code (read/write) +; C=HBIOS disk unit number ; -HDSK_READ: -; CALL PRTSTRD ; DEBUG -; DEFB '[HDSK READ]$' ; DEBUG - - LD B,HB_DSKRD ; HBIOS DISK READ (13H) - JR HDSK_RW +; NOTE: This routine uses physical drive characteristics from ICFG-xx. +; The routine computes a sequential block number with the algorithm; +; Trk * 16 + Sector, HBIOS uses LBA addressing for hard drive like +; devices i.e. everything but floppies. The Track contains the most +; significant 16 bits, Head the next byte and Sector the least +; significant byte. Note, only 16 bits are needed to address 33 +; megabytes for now 24 bits will be used for the LBA address. For non- +; hard drive like devices, Head, Sector and Track can be computed +; using Physical characteristics (hdHds = Number_of_Heads, +; hdSPT = Sectors_per_Track) according to the algorithm: ; -HDSK_WRITE: -; CALL PRTSTRD -; DEFB '[HDSK WRITE]$' +; Sector := (Block# MOD hdSPT)+1 (* Quotient1 := Block# DIV hdSPT *) +; Head := Quotient1 MOD hdHds (* Quotient2 := Quotient1 DIV hdHds *) +; Track := Quotient2 - LD B,HB_DSKWR ; HBIOS DISK WRITE (14H) -; -HDSK_RW: - LD HL,(HSTDPH) ; GET ACTIVE DPH POINTER - DEC HL ; ADJUST TO POINT TO UNIT NUMBER - LD C,(HL) ; LOAD IT IN C FOR HBIOS CALL LATER +HB_DSKIO: PUSH BC ; SAVE FUNCTION AND DEVICE FOR LATER LD HL,(HSTTRK) ; GET TRACK VALUE LD A,L ; LSB OF TRACK TO A @@ -172,10 +191,10 @@ HDSK_RW: LD A,(HSTSEC) ; GET SECTOR LD E,A ; STUFF IT IN E LD B,4 ; PREPARE TO SHIFT OUT 4 BIT HEAD VALUE -HDSK_RW1: +HB_DSKIO1: SRL H ; SHIFT ONE BIT OUT RR L ; ... OF HL - DJNZ HDSK_RW1 ; DO ALL 4 BITS + DJNZ HB_DSKIO1 ; DO ALL 4 BITS POP BC ; RECOVER FUNCTION AND DEVICE PUSH BC ; SAVE INCOMING FUNCTION, DEVICE/UNIT LD B,12H ; SETUP FOR NEW SEEK CALL @@ -192,17 +211,3 @@ HDSK_RW1: OR 0FFH ; A=$FF TO SIGNAL ERROR RET ; AND DONE W/ ERROR -; -;================================================================================================== -; HDSK DISK DRIVER - DATA -;================================================================================================== -; - IF BANKED - COMMON /B2RAM/ - ELSE - DSEG - ENDIF - -HDSK_PDN DEFS 1 ; PHYSICAL DEVICE - - \ No newline at end of file diff --git a/Source/BPBIOS/hbios.z80 b/Source/BPBIOS/hbios.z80 index 2d0acf90..c5884b96 100644 --- a/Source/BPBIOS/hbios.z80 +++ b/Source/BPBIOS/hbios.z80 @@ -27,6 +27,11 @@ HBX_SRCBNK EQU 0FFE4H HBX_DSTADR EQU 0FFE5H HBX_DSTBNK EQU 0FFE7H HBX_CPYLEN EQU 0FFE8H +; +; HBIOS disk commands +; +HB_DIOREAD EQU 13H +HB_DIOWRITE EQU 14H CSEG diff --git a/Source/BPBIOS/ramd-ww.z80 b/Source/BPBIOS/ramd-ww.z80 index 2cdc8267..a3f7dca5 100644 --- a/Source/BPBIOS/ramd-ww.z80 +++ b/Source/BPBIOS/ramd-ww.z80 @@ -11,9 +11,8 @@ COMMON /BANK2/ ENDIF -; This module creates a RAM Drive using the available memory (if available) -; above the TPA and possible System banks. For a banked system, the minimum -; needed is a 64k Main TPA and a 32k System Bank. +; This module implements the HBIOS RAM disk driver by using the +; RomWBW disk interface. ;..... ; Select the RAM Drive. This routine performs any setup required in a select. @@ -22,70 +21,28 @@ SELRAM: JP SETPARMS ; No action locally. ;..... ; Read a 128-byte logical sector from the RAM Drive to main memory. -; This routine uses the HSTxxx values from the base BIOS routines. -RAMRD: OR 0FFH ; Set Read flag (non-0) - JR RamRW ; ..go to common code +RAMRD: + LD B,HB_DIOREAD ; HBIOS READ + JR RAMIO ; READ/WRITE COMMON CODE ;..... ; Write a 128-byte logical sector from main memory to the RAM Drive. -; This routine uses the HSTxxx values from the base BIOS routines. -RAMWR: XOR A ; Set Write flag with 0, Read w/AFH +RAMWR: + XOR A ; Set Write flag with 0, Read w/AFH LD (HSTWRT),A ; clear pending write flag - ;..fall thru to common code.. - -; The following performs calculations for the proper address and bank, sets -; the DMA block and executes the Move to/from the Host Buffer. +; + LD B,HB_DIOWRITE ; HBIOS WRITE + JR RAMIO ; READ/WRITE COMMON CODE -RamRW: - PUSH AF ; Save R/W flag for later - ; BUILD TOTAL BYTE OFFSET INTO A:HL - XOR A,A ; A STARTS OUT ZERO - LD HL,(HSTTRK) ; HL STARTS WITH TRACK NUM - LD H,0 ; ONLY LSB IS NEEDED (INIRAMD PASSES INVALID MSB) - LD B,5 ; MULT BY 32 SECTORS PER TRACK -RAMWR1: - ADD HL,HL ; DOUBLE VALUE - ADC A,A ; ... INCLUDING A WITH CARRY - DJNZ RAMWR1 ; LOOP 5 TIMES FOR MULT BY 32 - LD DE,(HSTSEC) ; SECTOR VALUE TO 3 (ONE BYTE) - LD D,0 ; CLEAR MSB SINCE HSTSEC IS JUST ONE BYTE - ADD HL,DE ; ADD TO WORKING VALUE - ADC A,0 ; HANDLE POSSIBLE CARRY - LD B,7 ; MULT BY 128 BYTES PER SECTOR -RAMWR2: - ADD HL,HL ; DOUBLE VALUE - ADC A,A ; ... INCLUDING A WITH CARRY - DJNZ RAMWR2 ; LOOP 7 TIME FOR MULT BY 128 - ; CONVERT BYTE OFFSET IN A:HL TO BANK(A):OFFSET(HL) - SLA H ; ROTATE HIGH BIT OF H INTO CF - RL A ; ROTATE CF INTO LOW BIT OF A - SRL H ; FIX H (ROTATE BACK W/ ZERO INTO HIGH BIT) - ; ADJUST FOR STARTING RAM BANK - LD C,A ; BANK TO C - LD A,(RAMBNK) ; GET STARTING RAM BANK NUM - ADD A,C ; COMBINE TO GET ACTUAL SOURCE BANK NUM - ; SETUP FOR INTERBANK COPY - LD C,A ; SOURCE BANK TO C - LD B,BID_HB ; DEST BANK TO B (HSTBUF IN HBIOS) - ;LD A,(HB_BNKBIOS) ; DEST BANK (HSTBUF IN HBIOS) - ;LD B,A ; PUT IN B - LD DE,(HB_DSKBUF) ; DEST ADDRESS TO DE; HL ALREADY HAS SOURCE ADDRESS - ; REVERSE VALUES IF WRITE - POP AF ; Read or Write? - JR NZ,RAMWR3 ; ..jump if Read - EX DE,HL ; Else swap things around - LD A,C - LD C,B - LD B,A -RAMWR3: - ; PERFORM THE COPY - CALL XMOVE ; SET BANKS FOR COPY - LD BC,128 ; SET LENGTH OF COPY (ONE SECTOR) - CALL MOVE ; DO THE COPY - ; CLEAN UP AND RETURN - XOR A ; SIGNAL SUCCESS - RET ; AND RETURN +;..... +; Common code to setup RomWBW disk access +; +RAMIO: + LD HL,(HSTDPH) ; GET ACTIVE DPH PTR + DEC HL ; ADJUST TO POINT TO BPBIOS LOGICAL UNIT + LD C,(HL) ; USE AS HBIOS DISK UNIT NUMBER + JP HB_DSKIO ; DO THE REST IN HARD DISK DRIVER ;================== End of RAM Disk Code ==================== diff --git a/Source/BPBIOS/romwbw.lib b/Source/BPBIOS/romwbw.lib index dcecd53d..31d2b5e2 100644 --- a/Source/BPBIOS/romwbw.lib +++ b/Source/BPBIOS/romwbw.lib @@ -27,7 +27,11 @@ HB_IODEV EQU 80H ; 0x80 is current HBIOS console HB_MDRAM EQU 0 ; HBIOS Disk Unit #0 is usually the RAM Disk HB_MDROM EQU 1 ; HBIOS Disk Unit #1 is usually the ROM Disk ; -; Set HB_HDDEVN to appropriate HBIOS disk device numbers +; Map BPBIOS logical drive numbers (0-2) to HBIOS physical disk units +; HB_HDDEVn values map to HDRVn (see icfg-ww). +; +; The values below will be the default mapping. They can be changed +; using BPCNFG *Physical Drive* configuration. ; ; If the RomWBW system has no floppy drives, then the hard disk units ; will start right after the memory disk units. So, the first hard disk diff --git a/Source/BPBIOS/selrwd.z80 b/Source/BPBIOS/selrwd.z80 index 255878bd..b856f285 100644 --- a/Source/BPBIOS/selrwd.z80 +++ b/Source/BPBIOS/selrwd.z80 @@ -115,17 +115,17 @@ DVRVCT: DEFW SELERR ; Driver 0 Select DEFW HDREAD ; Driver 2 Read DEFW HDWRIT ; Driver 2 Write ENDIF ; harddsk -; IF [RAMDSK AND NOT HARDDSK] -; DEFW SELERR ; Driver 2 Select (Dummy if No Hard Drive) -; DEFW ISTRUE ; Driver 2 Read -; DEFW ISTRUE ; Driver 2 Write -; ENDIF ;ramdsk & not harddsk - -; IF RAMDSK -; DEFW SELHD ; Driver 3 Select (RAM Drive) -; DEFW HDREAD ; Driver 3 Read -; DEFW HDWRIT ; Driver 3 Write -; ENDIF ;ramdsk + IF [RAMDSK AND NOT HARDDSK] + DEFW SELERR ; Driver 2 Select (Dummy if No Hard Drive) + DEFW ISTRUE ; Driver 2 Read + DEFW ISTRUE ; Driver 2 Write + ENDIF ;ramdsk & not harddsk + + IF RAMDSK + DEFW SELRAM ; Driver 3 Select (RAM Drive) + DEFW RAMRD ; Driver 3 Read + DEFW RAMWR ; Driver 3 Write + ENDIF ;ramdsk SELERR: LD HL,0 ; Send null DPH pointer back to caller RET diff --git a/Source/Doc/Basic.h b/Source/Doc/Basic.h index c0601ac0..87447530 100644 --- a/Source/Doc/Basic.h +++ b/Source/Doc/Basic.h @@ -1,4 +1,4 @@ -$define{doc_ver}{Version 3.4}$ +$define{doc_ver}{Version 3.5}$ $define{doc_product}{RomWBW}$ $define{doc_root}{https://github.com/wwarthen/RomWBW/raw/dev/Doc}$ $ifndef{doc_title}$ $define{doc_title}{Document Title}$ $endif$ diff --git a/Source/Images/Build.cmd b/Source/Images/Build.cmd index b28ecc3a..d7776994 100644 --- a/Source/Images/Build.cmd +++ b/Source/Images/Build.cmd @@ -66,7 +66,7 @@ call BuildDisk.cmd bascomp hd wbw_hd1k || exit /b call BuildDisk.cmd fortran hd wbw_hd1k || exit /b call BuildDisk.cmd games hd wbw_hd1k || exit /b -if exist ..\BPBIOS\bp*.rel call BuildDisk.cmd bp hd wbw_hd1k || exit /b +if exist ..\BPBIOS\bp*.rel call BuildDisk.cmd bp hd wbw_hd1k ..\zsdos\zsys_wbw.sys || exit /b copy hd1k_prefix.dat ..\..\Binary\ || exit /b diff --git a/Source/Images/Makefile b/Source/Images/Makefile index 3c9e78c8..1a9cf1ba 100644 --- a/Source/Images/Makefile +++ b/Source/Images/Makefile @@ -81,7 +81,7 @@ blankhd1k: case $@ in \ (*cpm22*) sys=../CPM22/cpm_wbw.sys;; \ (*qpm*) sys=../QPM/qpm_wbw.sys;; \ - (*zsdos* | *nzcom* | *dos65*) sys=../ZSDOS/zsys_wbw.sys;; \ + (*zsdos* | *nzcom* | *dos65* | *bp*) sys=../ZSDOS/zsys_wbw.sys;; \ (*cpm3*) sys=../CPM3/cpmldr.sys;; \ (*zpm3*) sys=../ZPM3/zpmldr.sys;; \ esac ; \ diff --git a/Source/ver.inc b/Source/ver.inc index 4b83eb0e..0fcdcf0f 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -1,8 +1,8 @@ #DEFINE RMJ 3 -#DEFINE RMN 4 +#DEFINE RMN 5 #DEFINE RUP 0 #DEFINE RTP 0 -#DEFINE BIOSVER "3.4.0" +#DEFINE BIOSVER "3.5.0-pre.0" #define rmj RMJ #define rmn RMN #define rup RUP diff --git a/Source/ver.lib b/Source/ver.lib index 96f21a04..191c0936 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -1,7 +1,7 @@ rmj equ 3 -rmn equ 4 +rmn equ 5 rup equ 0 rtp equ 0 biosver macro - db "3.4.0" + db "3.5.0-pre.0" endm