Browse Source

Refactor ZMP Overlay

- ZMP was crashing in most scenarios.  This was corrected.
- Minor adjustments to ZMP usage
- Added ZMP documentation
pull/534/head
Wayne Warthen 10 months ago
parent
commit
f162081ec1
No known key found for this signature in database GPG Key ID: 8B34ED29C07EEB0A
  1. 2
      Binary/Apps/Clean.cmd
  2. 2
      Binary/Apps/Makefile
  3. 1
      Doc/ChangeLog.txt
  4. BIN
      Doc/RomWBW Applications.pdf
  5. BIN
      Doc/RomWBW Disk Catalog.pdf
  6. BIN
      Doc/RomWBW Hardware.pdf
  7. BIN
      Doc/RomWBW Introduction.pdf
  8. BIN
      Doc/RomWBW System Guide.pdf
  9. BIN
      Doc/RomWBW User Guide.pdf
  10. 2
      ReadMe.md
  11. 2
      ReadMe.txt
  12. 5
      Source/Apps/XM/xmhb.z80
  13. 43
      Source/Apps/ZMD/zmdhb.z80
  14. 7
      Source/Apps/ZMP/Build.cmd
  15. 8
      Source/Apps/ZMP/Makefile
  16. 13
      Source/Apps/ZMP/Notes.txt
  17. BIN
      Source/Apps/ZMP/zmconfig.ovr
  18. BIN
      Source/Apps/ZMP/zminit.ovr
  19. 844
      Source/Apps/ZMP/zmo-wbw.z80
  20. 5
      Source/Apps/ZMP/zmp-blnk.z80
  21. 8
      Source/Apps/ZMP/zmp15+-.new
  22. BIN
      Source/Apps/ZMP/zmterm.ovr
  23. 125
      Source/Doc/Applications.md
  24. 2
      Source/Images/d_cpm22/ReadMe.txt
  25. 2
      Source/Images/d_qpm/ReadMe.txt
  26. 2
      Source/Images/d_zsdos/ReadMe.txt
  27. 4
      Source/Images/fd_bp.txt
  28. 2
      Source/Images/fd_cpm22.txt
  29. 2
      Source/Images/fd_cpm3.txt
  30. 2
      Source/Images/fd_qpm.txt
  31. 2
      Source/Images/fd_zsdos.txt
  32. 2
      Source/Images/hd_bp.txt
  33. 2
      Source/Images/hd_cpm22.txt
  34. 2
      Source/Images/hd_cpm3.txt
  35. 2
      Source/Images/hd_nzcom.txt
  36. 2
      Source/Images/hd_qpm.txt
  37. 2
      Source/Images/hd_z3plus.txt
  38. 2
      Source/Images/hd_zpm3.txt
  39. 2
      Source/Images/hd_zsdos.txt

2
Binary/Apps/Clean.cmd

@ -9,6 +9,8 @@ if exist Tunes\*.pt? del Tunes\*.pt?
if exist Tunes\*.mym del Tunes\*.mym
if exist Tunes\*.vgm del Tunes\*.vgm
if exist bbcbasic.txt del bbcbasic.txt
if exist *.cfg del *.cfg
if exist *.fon del *.fon
pushd Test && call Clean || exit /b 1 & popd
pushd ZDE && call Clean || exit /b 1 & popd

2
Binary/Apps/Makefile

@ -8,4 +8,4 @@ all::
mkdir -p Tunes
clean::
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.ovr *.hlp *.doc *.COM *.BIN Tunes/*.mym Tunes/*.pt? Tunes/*.vgm bbcbasic.txt
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.ovr *.hlp *.doc *.COM *.BIN Tunes/*.mym Tunes/*.pt? Tunes/*.vgm bbcbasic.txt *.cfg *.fon

1
Doc/ChangeLog.txt

@ -4,6 +4,7 @@ Version 3.5.1
- MAP: Enhanced SLR Tools Disk Image with Plus versions
- WBW: Add missing BCLOAD file to MS BASIC Compiler Disk Image (reported by Marshall Gates)
- WBW: Doc improvements (per Fraser and Rob Gowin)
- WBW: Correct ZMP application crash
Version 3.5
-----------

BIN
Doc/RomWBW Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW Disk Catalog.pdf

Binary file not shown.

BIN
Doc/RomWBW Hardware.pdf

Binary file not shown.

BIN
Doc/RomWBW Introduction.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.

2
ReadMe.md

@ -7,7 +7,7 @@
**RomWBW Introduction** \
Version 3.5 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
13 Apr 2025
17 Apr 2025
# Overview

2
ReadMe.txt

@ -1,6 +1,6 @@
RomWBW Introduction
Wayne Warthen (wwarthen@gmail.com)
13 Apr 2025
17 Apr 2025

5
Source/Apps/XM/xmhb.z80

@ -291,7 +291,7 @@ EXTRA3:
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
CPUSPD DB 10 ; CPU speed in MHz
RCVSCL DW 6600 ; RECV loop timeout scalar
UNIT DB 0 ; BIOS serial device unit number
UNIT DB 0FFH ; BIOS serial device unit number
BIOSBID DB 00H ; BIOS bank id
;
TAG DB "RomWBW, 30-May-2020$"
@ -330,7 +330,7 @@ HB_JPTBL:
JP HB_GETCHR ; get character from modem
JP HB_RCVRDY ; check receive ready
JP HB_SNDRDY ; check send ready
JP HB_SPEED ; get speed value for file transfer time
JP HB_SPEED ; get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
@ -819,7 +819,6 @@ UF_INIT:
; Send character on top of stack
;
UF_SENDR:
POP AF ; get character to send from stack
OUT (0FFH),A ; write to fifo
UF_SCDP EQU $-1 ; data port

43
Source/Apps/ZMD/zmdhb.z80

@ -81,7 +81,7 @@ MINIT1:
SUB '0' ; Got it, convert to binary
LD (UNIT),A ; Save it
LD A,' ' ; Space character to accum
LD (HL),A ; Remove numberic from FCB
LD (HL),A ; Remove numeric from FCB
JR MINIT3 ; Proceed with initialization
MINIT2:
@ -188,7 +188,6 @@ MINIT_UB1:
LD (UNIT),A ; and save it
;
MINIT_UB2:
;
JP UB_INIT ; UNA BIOS init
;
MINIT_RET:
@ -221,7 +220,6 @@ MINIT_RET:
;
; Return with CPU speed in A
LD A,(CPUSPD) ; A := CPU speed in MHz
LD HL,(RCVSCL) ; HL := receive scalar
RET ; and return
;
;-----------------------------------------------------------------------
@ -307,6 +305,22 @@ FAIL:
CALL BDOS ; Do it
JP 0 ; Bail out!
;
; Adjust CPUSPD to account for overhead of HBIOS or UBIOS. It appears
; that dividing CPU speed in MHz by 8 results in timeouts that are
; roughly correct.
;
SLOW:
LD A,(CPUSPD) ; Get true CPU speed
ADD A,4 ; Add for rounding
SRL A ; Divide by 8
SRL A
SRL A
JR NZ,SLOW1 ; If not zero, we are good
LD A,1 ; else, make it 1
SLOW1:
LD (CPUSPD),A ; Save it
RET
;
;-----------------------------------------------------------------------
;
; The following are all dummy routines that are unused because MINIT
@ -326,7 +340,6 @@ EXTRA3:
;
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
CPUSPD DB 10 ; CPU speed in MHz
RCVSCL DW 6600 ; RECV loop timeout scalar
UNIT DB 0FFH ; BIOS serial device unit number
BIOSBID DB 00H ; BIOS bank id
;
@ -373,8 +386,7 @@ HB_JPTBL:
; HBIOS initialization
;
HB_INIT:
LD HL,2150 ; Smaller receive loop timeout scalar
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
CALL SLOW ; Adjust CPUSPD for HBIOS overhead
;
; Patch SENDR w/ FastPath addresses
LD BC,0F801H ; Get CIO func/data adr
@ -412,10 +424,6 @@ HB_INIT:
RST 08
JP NZ,APIERR ; handle API error
LD (HB_SRFN),HL ; Plug in func adr
;
; Claim 1 MHz CPU to offset overhead of HBIOS
LD A,1
LD (CPUSPD),A ; Save it
;
LD HL,HB_JPTBL
LD DE,HB_LBL
@ -564,14 +572,8 @@ UB_INIT:
;
; TODO:
; - TEST!!!
; - ADJUST RCVSCL?
;
LD HL,3000 ; Smaller receive loop timeout scalar
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
;
; Claim 1 MHz CPU to offset overhead of HBIOS
LD A,1
LD (CPUSPD),A ; Save it
CALL SLOW ; Adjust CPUSPD for UBIOS overhead
;
LD HL,UB_JPTBL
LD DE,UB_LBL
@ -721,9 +723,6 @@ UA_JPTBL:
; UART initialization
;
UA_INIT:
LD DE,13000 ; receive loop timeout scalar
LD (RCVSCL),DE ; ... for UART RCVRDY timing
;
LD A,L ; get base I/O port address
LD (UA_SCP),A ; set port value in SENDR
LD (UA_GCP),A ; set port value in GETCHR
@ -842,9 +841,6 @@ UF_JPTBL:
; USB-FIFO initialization
;
UF_INIT:
LD DE,12000 ; receive loop timeout scalar
LD (RCVSCL),DE ; ... for UART RCVRDY timing
;
LD A,L ; get base I/O port address (data port)
LD (UF_SCDP),A ; set data port in SENDR
LD (UF_GCDP),A ; set data port in GETCHR/MDIN
@ -863,7 +859,6 @@ UF_INIT:
; Send character on top of stack
;
UF_SENDR:
POP AF ; get character to send from stack
OUT (0FFH),A ; write to fifo
UF_SCDP EQU $-1 ; data port

7
Source/Apps/ZMP/Build.cmd

@ -7,10 +7,13 @@ set PATH=%TOOLS%\zxcc;%PATH%
set CPMDIR80=%TOOLS%/cpm/
zxcc Z80ASM -ZMO-RW01/H || exit /b
zxcc MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-RW01 || exit /b
:: zxcc Z80ASM -ZMO-RW01/LH || exit /b
zxcc Z80ASM -ZMO-WBW/LH || exit /b
zxcc MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-WBW || exit /b
copy /Y zmp.com ..\..\..\Binary\Apps\ || exit /b
copy /Y *.ovr ..\..\..\Binary\Apps\ || exit /b
copy /Y zmp.cfg ..\..\..\Binary\Apps\ || exit /b
copy /Y zmp.fon ..\..\..\Binary\Apps\ || exit /b
copy /Y *.hlp ..\..\..\Binary\Apps\ || exit /b
copy /Y zmp.doc ..\..\..\Binary\Apps\ || exit /b

8
Source/Apps/ZMP/Makefile

@ -1,10 +1,10 @@
OBJECTS = zmp.com *.ovr *.hlp zmp.doc
OBJECTS = zmp.com *.ovr zmp.cfg zmp.fon *.hlp zmp.doc
DEST = ../../../Binary/Apps
TOOLS = ../../../Tools
OTHERS = *.hex
NODELETE = *.ovr zmp.doc *.hlp
NODELETE = *.ovr zmp.doc zmp.cfg zmp.fon *.hlp
include $(TOOLS)/Makefile.inc
zmp.com: zmo-rw01.hex
$(ZXCC) MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-RW01
zmp.com: zmo-wbw.hex
$(ZXCC) MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-WBW

13
Source/Apps/ZMP/Notes.txt

@ -27,4 +27,15 @@ as at Aug 23rd, 2021.
Untested on Ron Murrays ZMP15
- Space getting short so messages shortened.
--PMS 8/24/2021
--PMS 8/24/2021
- Refactored overlay to resolve some stack issues.
- Removed support for setport because it didn't make much sense
with ability to specify port on command line.
- Added an equate (pcfg) which controls whether port configuration
is implemented. It is set to false (no port configuration).
because ZMP it is unable to handle many RomWBW serial port settings
(notably the hard-wired 115200 baud of many RCBus systems). You
must now used MODE to configure port before starting ZMP.
--WBW 1:55 PM 4/16/2025

BIN
Source/Apps/ZMP/zmconfig.ovr

Binary file not shown.

BIN
Source/Apps/ZMP/zminit.ovr

Binary file not shown.

844
Source/Apps/ZMP/zmo-wbw.z80

@ -0,0 +1,844 @@
;-----------------------------------------------------------------------------
;
; Overlay for ZMP (Z-Modem Program)
;
; Name ZMO-WBW.Z80
;
; Dated April 14, 2025
;
; Written by -
; Phil Summers, Wayne Warthen
;
; ROMWBW version using HBIOS and https://github.com/mecparts/zmp
; version of zmodem
;
; - All modem/serial i/o is through RomWBW HBIOS.
;
; - Data bits, stop bits, and parity are determined by HBIOS.
; The ZMP settings will have no effect. Use RomWBW MODE
; command to set serial port config before starting ZMP.
;
; - Timing delay calculations based on HBIOS reported CPU speed.
;
; - The pcfg equate determines whether the overlay will
; implement port initialization. Normally, pcfg will be
; set to false because ZMP does not allow configuring
; many HBIOS speeds (notably the 115200 baud hardwired
; into many RCBus systems). In this case, you must
; configure the modem port using the RomWBW
; MODE command as desired before starting ZMP.
;
; - The modem port is assigned to an HBIOS character unit. By
; default, the modem is assigned to HBIOS character unit 1.
; An alternate HBIOS character unit may be specified as a
; parameter on the command line as a single number. For
; example, the following will assign HBIOS port 3 as the
; ZMP modem port:
;
; ZMP 3
;
; - The original version of ZMP from Ron Murray allows you to
; select from 2 logical modem ports. This overlay ignores
; any attempt to select ports from within ZMP. The desired
; modem port should be assigned using the command line
; parameter as described above.
;
; - Teraterm users may need to change the ZmodemWinSize value
; to 1024 in the teraterm.ini configuration file.
;
;-----------------------------------------------------------------------------
;
;
; System-dependent code overlay for ZMODEM
;
;
;
; Insert your own code as necessary in this file. Code contained herein
; has been written in Z80 code for use with M80 or SLR. Assemble as follows:
;
; SLR ZMO-xx01/h
; MLOAD ZMP.COM=ZMODEM.COM,ZMO-xx01.HEX
; or
; M80 =ZMO-xx01.Z80
; RELHEX ZMO-xx01
; MLOAD ZMP.COM=ZMODEM.COM,ZMO-xx01.HEX
;
;
; (Don't use L80 without changing the source for assembly as a
; cseg file.)
;
;-----------------------------------------------------------------------------
;
;
; Notes on modifying this file:
;
; C requires that functions do not change either index register (IX or IY).
; If your overlay requires either of these to be changed, ensure they are
; restored to the original values on return.
; Since collecting parameters from C functions can be tricky, only change
; the parts marked 'Insert your own code here'. Do NOT modify the jump
; table at the start. Do NOT modify the entry/exit sections of each
; function. Do NOT pass 'GO'. Do NOT collect $200.
; Apart from defining modem functions, this file also defines terminal
; characteristics. Examples provided are for ADM-3A (with a few of my own
; additions). Modify to suit your own terminal. An inline print routine
; is provided for printing strings in the usual way: usage is
;
; call print
; db 'required string',0
;
;-----------------------------------------------------------------------------
;
;
; Don't forget to set your clock speed at the clkspd variable.
;
;
; If you find your overlay exceeds the maximum size (currently 0400h),
; you will have to contact me for another version. If too many people need
; to do it, we haven't allowed enough room.
;
; Ron Murray 15/8/88
;
;
;
;---------------------------------------------------------------------------
false equ 0
true equ not false
;------------------------------------------------------------------------------
; User-set variables:
debug equ false ; to allow debugging of overlay with Z8E etc.
clkspd equ 8 ; Processor clock speed in MHz
pcfg equ false ; Allow ZMP to configure port
;
;Set the following two equates to the drive and user area which will contain
; ZMP's .OVR files, .CFG file, .FON file and .HLP file. Set both to zero
; (null) to locate them on the drive from which ZMP was invoked.
overdrive equ 0 ; Drive to find overlay files on ('A'-'P')
overuser equ 0 ; User area to find files
;------------------------------------------------------------------------------
; NOT user-set variables
userdef equ 0145h ; origin of this overlay
; This address should not change with
; subsequent revisions.
mspeed equ 03ch ; location of current baud rate.
ovsize equ 0400h ; max size of this overlay
fcb equ 05ch ; primary command line CP/M fcb
.z80 ; use z80 code
aseg ; absolute
if debug
org 100h ; so you can debug it with cebug, zsid, etc
else
org userdef
endif
esc equ 1bh
ctrlq equ 11h
cr equ 0dh
lf equ 0ah
bdos equ 5
codebgn equ $
;Jump table for the overlay: do NOT change this
jump_tab:
jp scrnpr ; screen print
jp mrd ; modem read with timeout
jp mchin ; get a character from modem
jp mchout ; send a character to the modem
jp mordy ; test for tx buffer empty
jp mirdy ; test for character received
jp sndbrk ; send break
jp cursadd ; cursor addressing
jp cls ; clear screen
jp invon ; inverse video on
jp invoff ; inverse video off
jp hide ; hide cursor
jp show ; show cursor
jp savecu ; save cursor position
jp rescu ; restore cursor position
jp mint ; service modem interrupt
jp invec ; initialise interrupt vectors
jp dinvec ; de-initialise interrupt vectors
jp mdmerr ; test uart flags for error
jp dtron ; turn DTR on
jp dtroff ; turn DTR OFF
jp init ; initialise uart
jp wait ; wait seconds
jp mswait ; wait milliseconds
jp userin ; user-defined entry routine
jp userout ; user-defined exit routine
jp getvars ; get system variables
jp setport ; set port (0 or 1)
; Spare jumps for compatibility with future versions
jp spare ; spare for later use
jp spare ; spare for later use
jp spare ; spare for later use
jp spare ; spare for later use
jp spare ; spare for later use
jp spare ; spare for later use
; Local storage
hbunit db 1 ; Active HBIOS unit for modem I/O
cpumhz db clkspd ; CPU clock speed in MHz
;
; Main code starts here
;
;Screen print function
scrnpr:
; <== Insert your own code here
call print
db 'Screen print not supported.',cr,lf,0
; <== End of your own code
spare:
ret
; User-defined entry routine: leave empty if not needed
userin:
push bc
push de
push hl
call print
db cr,lf,'ZMP Overlay for RomWBW HBIOS v1.0',cr,lf,0
; Scan and parse default FCB to initialize HBIOS unit if
; specified.
ld a,(fcb + 1) ; get parm from fcb
cp ' ' ; anything there?
jr z,userin1 ; if empty, done
sub '0' ; ASCII to binary
jr c,parmerr ; less than 0, parm error
cp 10 ; >= 10?
jr nc,parmerr ; greater than 9, parm error
ld (hbunit),a ; save it
userin1:
call showcom ; show com port info
; check that unit is actually available in HBIOS
ld bc,0f800h ; get HBIOS char unit count
rst 8 ; do it
ld a,(hbunit) ; get active modem unit
cp e ; compare to units available
jr nc,porterr ; unit too high, port error
if pcfg
; Force port initialization by setting an invalid
; baud rate (mspeed).
; speed to an arbitrary value of 8 (9600 baud).
ld a,-1
ld (mspeed),a
else
; We don't support port configuration. Here we set the modem
; speed to an arbitrary value of 8 (9600 baud).
ld a,8
ld (mspeed),a
endif
ld bc,0f8f0h ; HBIOS func get CPU info
rst 08 ; do it, l = CPU speed in MHz
ld a,l ; to accum
ld (cpumhz),a ; and save it for wait loop
ld hl,2
call waithls
pop hl
pop de
pop bc
ret
parmerr:
; Handle a bad parameter
call print ; print error message
db cr,lf,'ZMP parameter error!',cr,lf,0
rst 0 ; bail out to OS
porterr:
; Handle a bad port
call print ; print error message
db cr,lf,'Invalid HBIOS unit for ZMP Modem port!',cr,lf,0
rst 0 ; bail out to OS
showcom:
; Display the HBIOS unit to be used for the ZMP Modem
call print
db cr,lf,'ZMP Modem on HBIOS Unit #',0
ld a,(hbunit)
add a,'0'
call cout
call print
db cr,lf,0
; User-defined exit routine: leave empty if not needed
userout:
ret
;Get a character from the modem: return in HL
mchin:
push bc
; <== Insert your own code here
ld a,(hbunit)
ld c,a
ld b,00h
rst 08
ld a,e
; <== End of your own code
ld l,a ; put in HL
ld h,0
or a ; set/clear Z
pop bc
ret
;Send a character to the modem
mchout:
ld hl,2 ; get the character
add hl,sp
ld a,(hl)
; <== Insert your own code here
push bc
ld e,a
ld a,(hbunit)
ld c,a
ld b,01h
rst 08
pop bc
; <== End of your own code
ret ; done
;Test for output ready: return TRUE (1) in HL if ok
mordy:
; <== Insert your own code here
push bc
ld a,(hbunit)
ld c,a
ld b,03h
rst 08
ld h,0
ld l,a
pop bc
; <== End of your own code
ld a,l ; set/clear Z
or a
ret
;Test for character at modem: return TRUE (1) in HL if so
mirdy:
; <== Insert your own code here
push bc
ld a,(hbunit)
ld c,a
ld b,02h
rst 08
ld h,0
ld l,a
pop bc
; <== End of your own code
ld a,l ; set/clear Z
or a
ret
;Send a break to the modem: leave empty if your system can't do it
sndbrk:
; <== Insert your own code here
ld hl,300 ; wait 300 mS
call waithlms
; <== End of your own code
ret
;
;Test UART flags for error: return TRUE (1) in HL if error.
mdmerr:
; <== Insert your own code here
xor a ; not implemented
; <== End of your own code
ld a,l ; set/clear Z
or a
ret
;Turn DTR ON
dtron:
; <== Insert your own code here
; <== End of your own code
ret
;Turn DTR OFF
dtroff:
; <== Insert your own code here
; <== End of your own code
ret
;Initialise the uart
init:
ld hl,2 ; get parameters
add hl,sp
ex de,hl
call getparm ; in HL
ld (brate),hl ; baud rate
call getparm
ld (parity),hl ; parity
call getparm
ld (data),hl ; data bits (BINARY 7 or 8)
call getparm
ld (stop),hl ; stop bits (BINARY 1 or 2)
; <== Insert your own code here
; using values below
; don't forget to load mspeed with the
; current brate value if the new rate is
; valid. See table of values below.
push bc
; If pcfg is true, attempt to initialize the active
; HBIOS unit. If false, initialization if bypassed with
; the assumption that the RomWBW MODE command was used
; to initialize the port priot to running ZMP.
if pcfg
call print
db 'Initializing device: ',0
call diport
ld a,(hbunit) ; get device type
ld c,a
ld b,06h
rst 08
or a ; check if valid
jr nz,initerr
ld a,(brate) ; get baud rate to set
ld c,a
ld b,0
ld hl,baudtbl
add hl,bc
ld a,(hl) ; convert to encoded hbios
cp a,-1
jr z,initerr
push af
ld a,(hbunit) ; get line characteristics
ld c,a
ld b,05h
rst 08
ld a,d ; mask out exisitng
and 11100000b ; replace with rate
ld d,a
pop af
or d
ld d,a
ld b,04h ; set new
ld a,(hbunit) ; speed
ld c,a
rst 08
or a
jr nz,initerr
ld a,(brate) ; load mspeed with the current brate value if
ld (mspeed),a ; the new rate is valid. See table of values below.
call print
db lf,lf,'Initization completed, device: ',0
call diport
jr init_z
initerr:call print
db lf,lf,'Initization failed, device: ',0
call diport
jr init_z
diport: ld a,(hbunit) ; Display port
diport1:add a,'0'
call cout
call print
db cr,lf,0
ld hl,2
call waithls
ret
else
;call print
;db cr,lf,'Modem port initialization...',0
;ld hl,2
;call waithls
ld b,05h ; HBIOS port reset function
ld a,(hbunit) ; get active modem port
ld c,a ; and put in accum
rst 8 ; reset port
or a ; check result
jr nz,init1 ; if error, handle it
ld a,8 ; dummy value for speed
ld (mspeed),a ; save it
jr init_z ; done
init1:
; Handle error return from initialization
call print
db cr,lf,'Modem port initialization failed!',cr,lf,0
ld hl,2
call waithls
jr init_z
endif
init_z:
pop bc
; <== End of your own code
ret
;--------------------------------------------------------------------------
stop: dw 1 ; stop bits
parity: dw 'N' ; parity
data: dw 8 ; data bits
brate: dw 7 ; baud rate:
;--------------------------------------------------------------------------
;
;Values of brate for each baud rate
;
; hb encode baud rate brate
;
baudtbl:
db -1 ; 110 0 not supported
db 2 ; 300 1
db 17 ; 450 2
db 3 ; 600 3
db -1 ; 710 4 not supported
db 4 ; 1200 5
db 5 ; 2400 6
db 6 ; 4800 7
db 7 ; 9600 8
db 8 ; 19200 9
db 9 ; 38400 10
db 24 ; 57600 11
db 10 ; 76800 12
;
; Set the port. ZMP supplies either 0 or 1 as a parameter. You're on your
; own here -- your system is bound to be different from any other! You may
; implement a software switch on all the modem-dependent routines, or perhaps
; you can have one or two centralised routines for accessing the UARTs and
; modify the code from this routine to select one or the other. (Who said
; there was anything wrong with self-modifying code?). If you have only one
; UART port, or if you don't want to go through all the hassles, just have
; this routine returning with no changes made. Note that ZMP calls this
; routine with both values for the port on initialisation.
;
; Only originl ZMP calls setport. MECPARTS variant does not.
;
; We ignore this call. Since we are using a command line parameter
; to specify the desired modem port, it makes no sense.
;
setport:
ld hl,2 ; get port number
add hl,sp
ex de,hl
call getparm ; in HL (values are 0 and 1)
; <== Insert your own code here
; <== End of your own code
ret
;
;****************************************************************************
;Video terminal sequences: these are for VT-100: Modify as you wish
;Cursor addressing:
cursadd:
ld hl,2 ; get parameters
add hl,sp
ex de,hl
call getparm ; in HL
inc hl
ld (row),hl ; row
call getparm
inc hl
ld (col),hl ; column
;
push bc
call print
db esc,'[',0
ld a,(row) ; row first
call cursconv
ld a,';'
call cout
ld a,(col) ; same for column
call cursconv
ld a,'H'
call cout
pop bc
ret
;
cursconv:
ld b,a
xor a
ca1: add a,1
daa
djnz ca1
ld (num),a
and 0f0h
jr z,ca2
srl a
srl a
srl a
srl a
or '0'
call cout
ca2: ld a,(num)
and 0fh
or '0'
call cout
ret
;
row: ds 2 ; row
col: ds 2 ; column
num: ds 1
;
;Clear screen:
cls:
call print
db esc,"[H",esc,"[2J",0
ret
;
;Inverse video on:
invon:
call print
db esc,"[7m",0
ret
;
;Inverse video off:
invoff:
call print
db esc,"[m",0
ret
;
;Turn off cursor:
hide:
call print
db esc,'[?25l',0
ret
;
;Turn on cursor:
show:
call print
db esc,'[?25h',0
ret
;
;Save cursor position:
savecu:
call print
db esc,'[7',0
ret
;
;Restore cursor position:
rescu:
call print
db esc,'[8',0
ret
;****************************************************************************
;Service modem interrupt:
mint:
ret ; handled in HBIOS
;Initialise interrupt vectors:
invec:
ret ; ditto
;De-initialise interrupt vectors:
dinvec:
ret ; ditto
;****************** End of user-defined code ********************************
; Do not change anything below here.
;Modem character test for 100 ms
mrd:
push bc ; save bc
ld bc,100 ; set limit
mrd1:
call mirdy ; char at modem?
jr nz,mrd2 ; yes, exit
ld hl,1 ; else wait 1ms
call waithlms
dec bc ; loop till done
ld a,b
or c
jr nz,mrd1
ld hl,0 ; none there, result=0
xor a
mrd2:
pop bc
ret
; Inline print routine: destroys A and HL
print:
ex (sp),hl ; get address of string
ploop:
ld a,(hl) ; get next
inc hl ; bump pointer
or a ; done if zero
jr z,pdone
call cout ; else print
jr ploop ; and loop
pdone:
ex (sp),hl ; restore return address
ret ; and quit
;
;Output a character in A to the console
;
cout:
push bc ; save regs
push de
push hl
ld e,a ; character to E
ld c,2
call bdos ; print it
pop hl
pop de
pop bc
ret
;Wait seconds
wait:
ld hl,2
add hl,sp
ex de,hl ; get delay size
call getparm
; fall thru to..
;Wait seconds in HL
waithls:
push hl ; save loop control
ld hl,1000 ; 1000ms = 1 second
call waithlms
pop hl ; restore loop control
dec hl
ld a,h
or l
jr nz,waithls
ret
;Wait milliseconds
mswait:
ld hl,2
add hl,sp
ex de,hl ; get delay size
call getparm
; fall thru to..
;Wait milliseconds in HL
waithlms:
; burn 1000us (1ms)
ld a,(cpumhz)
ld e,a
hlms1:
; burn 1000 t-states
; 50 * 20 = 1000 t-states
ld d,50
hlms2:
nop ; 4
dec d ; 4
jr nz,hlms2 ; 12 20
dec e
jr nz,hlms1
dec hl
ld a,h
or l
jr nz,waithlms
ret
;Get next parameter from (de) into hl
getparm:
ex de,hl ; get address into hl
ld e,(hl) ; get lo
inc hl
ld d,(hl) ; then hi
inc hl ; bump for next
ex de,hl ; result in hl, address still in de
ret
;Get address of user-defined variables
getvars:
ld hl,uservars
ret
uservars:
dw overdrive ; .OVR etc. drive/user
dw overuser
if ($ - codebgn) gt ovsize
toobig: jp errval ; Overlay too large!
endif
end


5
Source/Apps/ZMP/zmp-blnk.z80

@ -26,11 +26,11 @@
; has been written in Z80 code for use with M80 or SLR. Assemble as follows:
;
; SLR ZMO-xx01/h
; MLOAD ZMP.COM=ZMODEM.COM,ZMO-xx01.HEX
; MLOAD ZMP.COM=ZMPX.COM,ZMO-xx01.HEX
; or
; M80 =ZMO-xx01.Z80
; RELHEX ZMO-xx01
; MLOAD ZMP.COM=ZMODEM.COM,ZMO-xx01.HEX
; MLOAD ZMP.COM=ZMPX.COM,ZMO-xx01.HEX
;
;
; (Don't use L80 without changing the source for assembly as a
@ -570,4 +570,3 @@ toobig: jp errval ; Overlay too large!
endif
end


8
Source/Apps/ZMP/zmp15+-.new

@ -12,6 +12,10 @@ awhile (some, a few decades):
* In keyboard macros, ! translates to a CR now, not CR/LF.
* \ escapes ! and ~ so those literal characters can be used in
keyboard macros.
* Waits in keyboard macros now allow characters from the modem to
be handled.
* Keys in keyboard macros now have 25ms waits between them as to
not overrun the remove system.
* Long distance access code has been removed.
* Quick dialing letters limited to A-T.
@ -23,5 +27,5 @@ version in ZMP15.LBR. So, to quote the original author,
new one with the config option. There have again been changes to
the format of this file."
June 7, 2021
August 15, 2023


BIN
Source/Apps/ZMP/zmterm.ovr

Binary file not shown.

125
Source/Doc/Applications.md

@ -2655,15 +2655,25 @@ files between systems using a serial port.
| `XM LK `*`<library> <filename>`*
| `XM R `*`<filename>`*
`S`: Send a file
`L`: Send a file from a library
`R`: Receive a file
`K`: Use 1K blocksize for transfer
The following may be added to the action codes:
| `S`: Send a file
| `L`: Send a file from a library
| `R`: Receive a file
| `K`: Use 1K blocksize (send operations)
| `C`: Force use of checksum (receive operations)
| `X`: Force 128-byte protocol (receive operations)
| `0`-`9`: Specifies HBIOS character unit for transfers
*`<filename>`* is the name of a file to send or receive
*`<library>`* is the name of a library (.lbr) to extract a file to send
For example, the following command will receive a file
using checksums on HBIOS character unit 3 and will name the
received file `MYFILE.TXT`.
`XM RC3 MYFILE.TXT`
#### Usage
To transfer a file from your host computer to your RomWBW computer, do
@ -2689,9 +2699,10 @@ emulation software for specific instructions on how to use XModem.
#### Notes
The XModem adaptation that comes with RomWBW will automatically use
the primary character device unit (character device unit 0) for the
file transfer.
The XModem adaptation that comes with RomWBW will default to using
the current HBIOS console port for transfers. Note that if you
change your console port at the OS level (e.g., STAT CON:=UC1:),
this does not change the HBIOS console.
`XM` attempts to determine the best way to drive the serial port based
on your hardware configuration. When possible, it will bypass the
@ -2732,6 +2743,9 @@ The source code is provided in the RomWBW distribution.
An adaptation of Robert Kramer's Remote CP/M File Transfer Program
with support for XModem and YModem transfers.
**NOTE**: ZMD does not do ZModem transfers. The Z in ZMD refers
to Z-System compatibility.
#### Syntax
`ZMD` *\<mode\>\<protocol\>\<unit\>* [*\<filename\>*]
@ -2755,10 +2769,43 @@ the RomWBW Character Unit to use for the file transfer.
#### Usage
To transfer a file from your host computer to your RomWBW computer, do
the following:
1. Enter one of the `ZMD` receive commands specifying the name you want
to give to the received file (no filename required for ZModem transfers).
2. On your host computer select a file to send and initiate an XModem or
YModem send operation.
To transfer a file from your RomWBW computer to your host computer, do
the following:
1. Enter one of the `ZMD` send commands specifying the name of the file
to be sent.
2. On your host computer, specify the name to assign to the received
file and initiate an XModem or YModem receive operation.
Please refer to the documentation of your host computer's terminal
emulation software for specific instructions on how to use XModem.
#### Notes
If no *\<unit\>* is specified, ZMD will use the current HBIOS
console for the file transfer.
The ZMP adaptation that comes with RomWBW will default to using
the current HBIOS console port for transfers. Note that if you
change your console port at the OS level (e.g., STAT CON:=UC1:),
this does not change the HBIOS console.
`ZMP` attempts to determine the best way to drive the serial port based
on your hardware configuration. When possible, it will bypass the
HBIOS for faster operation. However, in many cases, it will use HBIOS
so that flow control can be used.
`ZMP` is dependent on a reliable communications channel. You must
ensure that the serial port can be serviced fast enough by either
using a baud rate that is low enough or ensuring that hardware flow
control is fully functional (end to end).
#### Etymology
@ -2774,25 +2821,61 @@ uses the RomWBW HBIOS serial API.
| ROM-based |No |
| Disk-based |Yes|
#### Syntax
#### Usage
#### Notes
#### Etymology
`ZMP` is a terminal program for interacting with a modem attached to
your system. It includes X/Y/ZModem file transfer protocols. An
actual modem is not required, but you must have a port for ZMP to use
that is independent of the console running `ZMP`.
#### Syntax
`ZMD` *[\<unit\>]*
*\<unit\>* can specify a single digit (0-9) indicating
the RomWBW Character Unit to use for the modem port.
#### Usage
Refer to the file `ZMP.DOC` found on all disk images that include
the `ZMP` application.
#### Notes
`ZMP` requires access to multiple overlay and configuration files
to run. It will look for these on the default driver and user area.
Depending the operating system used, you may be able to set up a
search path and locate these files in other locations. The files
used by `ZMP` are:
- `ZMP.HLP`
- `ZMP.DOC`
- `ZMP.CFG`
- `ZMP.FON`
- `ZMXFER.OVR`
- `ZMTERM.OVR`
- `ZMINIT.OVR`
- `ZMCONFIG.OVR`
The `ZMP` console is always the active OS console.
If no *\<unit\>* is specified on the command line, `ZMP` will
default to using HBIOS Character Unit 1 as the modem port. Take care
to avoid using the same HBIOS Character Unit as both the console and
the modem or various strangeness will occur.
`ZMP` is a full screen application and is configured to use
ANSI/VT-100 screen control.
`ZMP` does not support the range of port configurations provided by
RomWBW. The RomWBW adaptation of `ZMP` ignores the port configuration
options within `ZMP`. Instead, you should configure the HBIOS Character
Unit using the RomWBW MODE command before launching `ZMP`.
`ZMP` is written in C. As a result, file transfers will be noticeably
slower than other assembly language file transfer tools.
#### Etymology
ZMP was produced by Ron Murray and was based on HMODEM II. Wayne
Hortensius updated the source to compile with the latest version
of Hi-Tech C and implemented a few enhancements.
The RomWBW overlay was developed by Phil Summers.

2
Source/Images/d_cpm22/ReadMe.txt

@ -88,6 +88,8 @@ XM.COM - XModem file transfer application
ZMP.COM - ZModem communications program (requires dedicated comm port)
ZMP.DOC - Documentation for ZMP
ZMP.HLP - Help file for ZMP
ZMP.CFG - Configuration file for ZMP
ZMP.FON - Phone book for ZMP
ZMXFER.OVR - Overlay file for ZMP
ZMTERM.OVR - Overlay file for ZMP
ZMINIT.OVR - Overlay file for ZMP

2
Source/Images/d_qpm/ReadMe.txt

@ -129,6 +129,8 @@ XM.COM - XModem file transfer application
ZMP.COM - ZModem communications program (requires dedicated comm port)
ZMP.DOC - Documentation for ZMP
ZMP.HLP - Help file for ZMP
ZMP.CFG - Configuration file for ZMP
ZMP.FON - Phone book for ZMP
ZMXFER.OVR - Overlay file for ZMP
ZMTERM.OVR - Overlay file for ZMP
ZMINIT.OVR - Overlay file for ZMP

2
Source/Images/d_zsdos/ReadMe.txt

@ -229,6 +229,8 @@ XM.COM - XModem file transfer application
ZMP.COM - ZModem communications program (requires dedicated comm port)
ZMP.DOC - Documentation for ZMP
ZMP.HLP - Help file for ZMP
ZMP.CFG - Configuration file for ZMP
ZMP.FON - Phone book for ZMP
ZMXFER.OVR - Overlay file for ZMP
ZMTERM.OVR - Overlay file for ZMP
ZMINIT.OVR - Overlay file for ZMP

4
Source/Images/fd_bp.txt

@ -32,7 +32,9 @@
../../Binary/Apps/xm.com 15:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 15:
../../Binary/Apps/zmp.doc 10:
../../Binary/Apps/zmp.cfg 15:
../../Binary/Apps/zmp.fon 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:

2
Source/Images/fd_cpm22.txt

@ -27,6 +27,8 @@ d_cpm22/ReadMe.txt 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/fd_cpm3.txt

@ -46,6 +46,8 @@ d_cpm3/ReadMe.txt 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/fd_qpm.txt

@ -31,6 +31,8 @@ d_cpm22/u0/*.* 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/fd_zsdos.txt

@ -31,6 +31,8 @@ d_cpm22/u0/*.* 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/hd_bp.txt

@ -36,6 +36,8 @@ Common/Z3/u15/ZEX.COM 0:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 10:
../../Binary/Apps/zmp.cfg 15:
../../Binary/Apps/zmp.fon 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:

2
Source/Images/hd_cpm22.txt

@ -31,6 +31,8 @@ d_cpm22/ReadMe.txt 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/hd_cpm3.txt

@ -50,6 +50,8 @@ d_cpm3/ReadMe.txt 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/hd_nzcom.txt

@ -46,6 +46,8 @@ d_zsdos/u0/*.DAT 15:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 10:
../../Binary/Apps/zmp.cfg 15:
../../Binary/Apps/zmp.fon 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:

2
Source/Images/hd_qpm.txt

@ -35,6 +35,8 @@ d_cpm22/u0/*.* 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

2
Source/Images/hd_z3plus.txt

@ -57,6 +57,8 @@ d_cpm3/u0/HELP.HLP 0:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 10:
../../Binary/Apps/zmp.cfg 15:
../../Binary/Apps/zmp.fon 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:

2
Source/Images/hd_zpm3.txt

@ -56,6 +56,8 @@ d_cpm3/u0/HELP.HLP 0:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 10:
../../Binary/Apps/zmp.cfg 15:
../../Binary/Apps/zmp.fon 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:

2
Source/Images/hd_zsdos.txt

@ -35,6 +35,8 @@ d_cpm22/u0/*.* 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmp.cfg 0:
../../Binary/Apps/zmp.fon 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:

Loading…
Cancel
Save