Browse Source

Update BPBIOS Disk Reference Lookup

- Modified BPBIOS to implement proper physical/logical disk unit lookups.
pull/389/head
Wayne Warthen 2 years ago
parent
commit
0bac6f32ea
  1. BIN
      Doc/RomWBW Applications.pdf
  2. BIN
      Doc/RomWBW Disk Catalog.pdf
  3. BIN
      Doc/RomWBW Errata.pdf
  4. BIN
      Doc/RomWBW ROM Applications.pdf
  5. BIN
      Doc/RomWBW System Guide.pdf
  6. BIN
      Doc/RomWBW User Guide.pdf
  7. 4
      ReadMe.md
  8. 2
      ReadMe.txt
  9. 5
      Source/Apps/format.asm
  10. 6
      Source/BPBIOS/@WBW Z3ENV.txt
  11. 6
      Source/BPBIOS/bpbio-ww.z80
  12. 14
      Source/BPBIOS/cboot-ww.z80
  13. 2
      Source/BPBIOS/def-ww-z33.lib
  14. 2
      Source/BPBIOS/def-ww-z33bnk.lib
  15. 2
      Source/BPBIOS/def-ww-z34.lib
  16. 2
      Source/BPBIOS/def-ww-z34bnk.lib
  17. 2
      Source/BPBIOS/def-ww-z41bnk.lib
  18. 37
      Source/BPBIOS/dphhd.lib
  19. 111
      Source/BPBIOS/hard-ww.z80
  20. 5
      Source/BPBIOS/hbios.z80
  21. 79
      Source/BPBIOS/ramd-ww.z80
  22. 6
      Source/BPBIOS/romwbw.lib
  23. 22
      Source/BPBIOS/selrwd.z80
  24. 2
      Source/Doc/Basic.h
  25. 2
      Source/Images/Build.cmd
  26. 2
      Source/Images/Makefile
  27. 4
      Source/ver.inc
  28. 4
      Source/ver.lib

BIN
Doc/RomWBW Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW Disk Catalog.pdf

Binary file not shown.

BIN
Doc/RomWBW Errata.pdf

Binary file not shown.

BIN
Doc/RomWBW ROM Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW System Guide.pdf

Binary file not shown.

BIN
Doc/RomWBW User Guide.pdf

Binary file not shown.

4
ReadMe.md

@ -1,9 +1,9 @@
**RomWBW ReadMe** \ **RomWBW ReadMe** \
Version 3.4 \
Version 3.5 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \ Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
09 Jan 2024
12 Jan 2024
# Overview # Overview

2
ReadMe.txt

@ -1,6 +1,6 @@
RomWBW ReadMe RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com) Wayne Warthen (wwarthen@gmail.com)
09 Jan 2024
12 Jan 2024

5
Source/Apps/format.asm

@ -19,6 +19,8 @@
; 1) Actually implement this ; 1) Actually implement this
;_______________________________________________________________________________ ;_______________________________________________________________________________
; ;
#include "../ver.inc"
;
;=============================================================================== ;===============================================================================
; Definitions ; Definitions
;=============================================================================== ;===============================================================================
@ -30,9 +32,6 @@ bdos .equ $0005 ; BDOS invocation vector
;; ;;
;stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp ;stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp
; ;
rmj .equ 3 ; CBIOS version - major
rmn .equ 0 ; CBIOS version - minor
;
;=============================================================================== ;===============================================================================
; Code Section ; Code Section
;=============================================================================== ;===============================================================================

6
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 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 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 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. adjusts the ZCPR environment configuration.
BPBUILD is designed to be run interactively. However, it can be started with an 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 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. 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 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 relocatable binaries. Note that only certain version combinations of ZSDOS and ZCPR are

6
Source/BPBIOS/bpbio-ww.z80

@ -421,6 +421,12 @@ DRVTBL: LD HL,DPHTBL ; Point to DPH table
PAGE PAGE
ENDIF ;HARDDSK ENDIF ;HARDDSK
IF RAMDSK ; << ****** Hardware Specific ****** >>
INCLUDE RAMD-WW.Z80 ; << This Driver is for HBIOS >>
PAGE
ENDIF ;RAMDSK
; << ****** Hardware Specific ****** >> ; << ****** Hardware Specific ****** >>
; << Enter Warm Boot routines in >> ; << Enter Warm Boot routines in >>

14
Source/BPBIOS/cboot-ww.z80

@ -120,14 +120,14 @@ DYNLP: LD E,(HL)
DEC DE ; Else back up Ptr to Driver DEC DE ; Else back up Ptr to Driver
DEC DE DEC DE
LD A,(DE) ; Get driver # 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)? CP 2 ; Hard Disk (Driver 2)?
; ENDIF ; Ramdsk
ENDIF ; Ramdsk
JR NZ,DYNCHK ; ..jump to end if Not JR NZ,DYNCHK ; ..jump to end if Not
ADDSIZ: PUSH BC ; Save loop counter ADDSIZ: PUSH BC ; Save loop counter
PUSH HL ; and ptr to DPH PUSH HL ; and ptr to DPH

2
Source/BPBIOS/def-ww-z33.lib

@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats?
;;--- RAM Disk Section --- ;;--- 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 --- ;--- Hard Disk Section ---

2
Source/BPBIOS/def-ww-z33bnk.lib

@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats?
;;--- RAM Disk Section --- ;;--- 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 --- ;--- Hard Disk Section ---

2
Source/BPBIOS/def-ww-z34.lib

@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats?
;;--- RAM Disk Section --- ;;--- 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 --- ;--- Hard Disk Section ---

2
Source/BPBIOS/def-ww-z34bnk.lib

@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats?
;;--- RAM Disk Section --- ;;--- 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 --- ;--- Hard Disk Section ---

2
Source/BPBIOS/def-ww-z41bnk.lib

@ -74,7 +74,7 @@ MORDPB EQU NO ; Include additional Floppy DPB Formats?
;;--- RAM Disk Section --- ;;--- 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 --- ;--- Hard Disk Section ---

37
Source/BPBIOS/dphhd.lib

@ -9,10 +9,11 @@
; 1.0 - 31 Aug 92 - General Release. HFB ; 1.0 - 31 Aug 92 - General Release. HFB
; 0.1 - 3 Jan 92 - Initial 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. ; and a flag bit to specify whether or not the drive is physically present.
; See ICFG-xx.Z80 for a definition of the data. ; See ICFG-xx.Z80 for a definition of the data.
@ -21,7 +22,7 @@
XDPH90: DEFB TRUE ; Format lock flag (Lock RAM Drive) XDPH90: DEFB TRUE ; Format lock flag (Lock RAM Drive)
DEFB FIXDSK ; Disk Drive Type 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 DEFB HB_MDRAM ; Physical Drive Number
DPH$90: DEFW 0 ; Skew Table pointer DPH$90: DEFW 0 ; Skew Table pointer
DEFW 0,0,0 ; Scratch area 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) XDPH91: DEFB TRUE ; Format lock flag (Lock ROM Drive)
DEFB FIXDSK ; Disk Drive Type 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 DEFB HB_MDROM ; Physical Drive Number
DPH$91: DEFW 0 ; Skew Table pointer DPH$91: DEFW 0 ; Skew Table pointer
DEFW 0,0,0 ; Scratch area 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) XDPH50: DEFB TRUE ; Format lock flag (Lock First Hard Drive)
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$50: DEFW 0 ; Skew table pointer
DEFW 0,0,0 ; Scratch area DEFW 0,0,0 ; Scratch area
DEFW DIRBUF ; Directory buffer pointer DEFW DIRBUF ; Directory buffer pointer
@ -61,7 +62,7 @@ DPH$50: DEFW 0 ; Skew table pointer
XDPH51: DEFB TRUE ; --- Second Hard Drive/Partition XDPH51: DEFB TRUE ; --- Second Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$51: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -74,7 +75,7 @@ DPH$51: DEFW 0
XDPH52: DEFB TRUE ; --- Third Hard Drive/Partition XDPH52: DEFB TRUE ; --- Third Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$52: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -87,7 +88,7 @@ DPH$52: DEFW 0
XDPH53: DEFB TRUE ; --- Fourth Hard Drive/Partition XDPH53: DEFB TRUE ; --- Fourth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$53: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -100,7 +101,7 @@ DPH$53: DEFW 0
XDPH54: DEFB TRUE ; --- Fifth Hard Drive/Partition XDPH54: DEFB TRUE ; --- Fifth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$54: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -113,7 +114,7 @@ DPH$54: DEFW 0
XDPH55: DEFB TRUE ; --- Sixth Hard Drive/Partition XDPH55: DEFB TRUE ; --- Sixth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$55: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -126,7 +127,7 @@ DPH$55: DEFW 0
XDPH56: DEFB TRUE ; --- Seventh Hard Drive/Partition XDPH56: DEFB TRUE ; --- Seventh Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$56: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -139,7 +140,7 @@ DPH$56: DEFW 0
XDPH57: DEFB TRUE ; --- Eighth Hard Drive/Partition XDPH57: DEFB TRUE ; --- Eighth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$57: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -152,7 +153,7 @@ DPH$57: DEFW 0
XDPH58: DEFB TRUE ; --- Ninth Hard Drive/Partition XDPH58: DEFB TRUE ; --- Ninth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$58: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -165,7 +166,7 @@ DPH$58: DEFW 0
XDPH59: DEFB TRUE ; --- Tenth Hard Drive/Partition XDPH59: DEFB TRUE ; --- Tenth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$59: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -178,7 +179,7 @@ DPH$59: DEFW 0
XDPH60: DEFB TRUE ; --- Eleventh Hard Drive/Partition XDPH60: DEFB TRUE ; --- Eleventh Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$60: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF
@ -191,7 +192,7 @@ DPH$60: DEFW 0
XDPH61: DEFB TRUE ; --- Twelveth Hard Drive/Partition XDPH61: DEFB TRUE ; --- Twelveth Hard Drive/Partition
DEFB FIXDSK ; Disk drive type DEFB FIXDSK ; Disk drive type
DEFB 2 ; Driver ID - 2=hard drive 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 DPH$61: DEFW 0
DEFW 0,0,0 DEFW 0,0,0
DEFW DIRBUF DEFW DIRBUF

111
Source/BPBIOS/hard-ww.z80

@ -104,33 +104,55 @@ SELHD: ; SET DEVICE
; Writes from HSTBUF using HSTTRK and HSTSEC to build Block Number. ; Writes from HSTBUF using HSTTRK and HSTSEC to build Block Number.
; NOTE: This routine uses physical drive characteristics from ICFG-xx. ; NOTE: This routine uses physical drive characteristics from ICFG-xx.
HDWRIT:
HDWRIT:
; CALL PRTSTRD
; DEFB '[HD WRITE]$'
XOR A XOR A
LD (HSTWRT),A ; Show no active writes pending 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 > ; Read from Hard Disk Drive < Internal BIOS Routine >
; Reads to HSTBUF using HSTTRK and HSTSEC to build Block Number. ; 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: 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 IF BANKED
COMMON /BANK2/ COMMON /BANK2/
@ -142,28 +164,25 @@ HDREAD:
; HBIOS Disk Driver Interface ; 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 PUSH BC ; SAVE FUNCTION AND DEVICE FOR LATER
LD HL,(HSTTRK) ; GET TRACK VALUE LD HL,(HSTTRK) ; GET TRACK VALUE
LD A,L ; LSB OF TRACK TO A LD A,L ; LSB OF TRACK TO A
@ -172,10 +191,10 @@ HDSK_RW:
LD A,(HSTSEC) ; GET SECTOR LD A,(HSTSEC) ; GET SECTOR
LD E,A ; STUFF IT IN E LD E,A ; STUFF IT IN E
LD B,4 ; PREPARE TO SHIFT OUT 4 BIT HEAD VALUE LD B,4 ; PREPARE TO SHIFT OUT 4 BIT HEAD VALUE
HDSK_RW1:
HB_DSKIO1:
SRL H ; SHIFT ONE BIT OUT SRL H ; SHIFT ONE BIT OUT
RR L ; ... OF HL RR L ; ... OF HL
DJNZ HDSK_RW1 ; DO ALL 4 BITS
DJNZ HB_DSKIO1 ; DO ALL 4 BITS
POP BC ; RECOVER FUNCTION AND DEVICE POP BC ; RECOVER FUNCTION AND DEVICE
PUSH BC ; SAVE INCOMING FUNCTION, DEVICE/UNIT PUSH BC ; SAVE INCOMING FUNCTION, DEVICE/UNIT
LD B,12H ; SETUP FOR NEW SEEK CALL LD B,12H ; SETUP FOR NEW SEEK CALL
@ -192,17 +211,3 @@ HDSK_RW1:
OR 0FFH ; A=$FF TO SIGNAL ERROR OR 0FFH ; A=$FF TO SIGNAL ERROR
RET ; AND DONE W/ ERROR RET ; AND DONE W/ ERROR
;
;==================================================================================================
; HDSK DISK DRIVER - DATA
;==================================================================================================
;
IF BANKED
COMMON /B2RAM/
ELSE
DSEG
ENDIF
HDSK_PDN DEFS 1 ; PHYSICAL DEVICE


5
Source/BPBIOS/hbios.z80

@ -27,6 +27,11 @@ HBX_SRCBNK EQU 0FFE4H
HBX_DSTADR EQU 0FFE5H HBX_DSTADR EQU 0FFE5H
HBX_DSTBNK EQU 0FFE7H HBX_DSTBNK EQU 0FFE7H
HBX_CPYLEN EQU 0FFE8H HBX_CPYLEN EQU 0FFE8H
;
; HBIOS disk commands
;
HB_DIOREAD EQU 13H
HB_DIOWRITE EQU 14H
CSEG CSEG

79
Source/BPBIOS/ramd-ww.z80

@ -11,9 +11,8 @@
COMMON /BANK2/ COMMON /BANK2/
ENDIF 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. ; 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. ; 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. ; 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 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 ==================== ;================== End of RAM Disk Code ====================

6
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_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 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 ; 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 ; will start right after the memory disk units. So, the first hard disk

22
Source/BPBIOS/selrwd.z80

@ -115,17 +115,17 @@ DVRVCT: DEFW SELERR ; Driver 0 Select
DEFW HDREAD ; Driver 2 Read DEFW HDREAD ; Driver 2 Read
DEFW HDWRIT ; Driver 2 Write DEFW HDWRIT ; Driver 2 Write
ENDIF ; harddsk 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 SELERR: LD HL,0 ; Send null DPH pointer back to caller
RET RET

2
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_product}{RomWBW}$
$define{doc_root}{https://github.com/wwarthen/RomWBW/raw/dev/Doc}$ $define{doc_root}{https://github.com/wwarthen/RomWBW/raw/dev/Doc}$
$ifndef{doc_title}$ $define{doc_title}{Document Title}$ $endif$ $ifndef{doc_title}$ $define{doc_title}{Document Title}$ $endif$

2
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 fortran hd wbw_hd1k || exit /b
call BuildDisk.cmd games 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 copy hd1k_prefix.dat ..\..\Binary\ || exit /b

2
Source/Images/Makefile

@ -81,7 +81,7 @@ blankhd1k:
case $@ in \ case $@ in \
(*cpm22*) sys=../CPM22/cpm_wbw.sys;; \ (*cpm22*) sys=../CPM22/cpm_wbw.sys;; \
(*qpm*) sys=../QPM/qpm_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;; \ (*cpm3*) sys=../CPM3/cpmldr.sys;; \
(*zpm3*) sys=../ZPM3/zpmldr.sys;; \ (*zpm3*) sys=../ZPM3/zpmldr.sys;; \
esac ; \ esac ; \

4
Source/ver.inc

@ -1,8 +1,8 @@
#DEFINE RMJ 3 #DEFINE RMJ 3
#DEFINE RMN 4
#DEFINE RMN 5
#DEFINE RUP 0 #DEFINE RUP 0
#DEFINE RTP 0 #DEFINE RTP 0
#DEFINE BIOSVER "3.4.0"
#DEFINE BIOSVER "3.5.0-pre.0"
#define rmj RMJ #define rmj RMJ
#define rmn RMN #define rmn RMN
#define rup RUP #define rup RUP

4
Source/ver.lib

@ -1,7 +1,7 @@
rmj equ 3 rmj equ 3
rmn equ 4
rmn equ 5
rup equ 0 rup equ 0
rtp equ 0 rtp equ 0
biosver macro biosver macro
db "3.4.0"
db "3.5.0-pre.0"
endm endm

Loading…
Cancel
Save