Browse Source

Dev (#108)

* added hack to handle tunes

* quiet clean

* added chmod for execution

* suppress warnings

* Multi-boot fixes

* the windows build somehow thinks that these filesystems are cpm3.

* credit and primitive instructions

* Update sd.asm

Cosmetic fix.

* make compile shut up about conditionals

* Add bin2asm for linus and update build to process font files under linix

* fixed quoted double quote bug, added tests

* added tests

* added bin2asm for font file source creation

* Revert linux bin2asm font stuff

* added rule for font source generation

* build fonts

* added directory mapping cache.  if the same directory is being hit
as last run, we don't need to rebuild the map.  will likely break if
you are running more than one at a time, in that the cache will be
ineffective.  also, if the directory contents change, this will also break.

* removed strip.  breaks osx

* added directory tag so . isn't matched all over the place

* added real cache validation

* fixed build

* this file is copied from optdsk.lib or optcmd.lib

* install to ../HBIOS

* prerequisite verbosity

* diff soft failure and casefn speedup

* added lzsa

* added lzsa

* removed strip. breaks on osx

* added clobber

* added code to handle multiple platform rom builds with rom size override

* added align and 0x55 hex syntax

* default to hd64180

* added N8 capability

* added SBC_std.rom to default build

* added support for binary diff

* diff fixes

* clean, identical build.  font source generator emitted .align.  this does not match the windows build

* Upgrade NZCOM to latest

* Misc. Cleanup

* fixed expression parser bug : ~(1|2) returned 0xfe

* added diff build option

* Update Makefile

Makefile enhancement to better handle ncurses library from Bob Dunlop.

* Update sd.asm

Back out hack for uz80as now that Curt fixed it.

* Misc. Cleanup

* UNA Catchup

UNA support was lacking some of the more recent behavior changes.  This corrects most of it.

* Add github action for building RomWBW

* Bump Pre-release Version

* Update build.yml

Added "make clean" which will remove temporary files without removing final binary outputs.

* Update Makefile

Build all ROM variants by default in Linux/Mac build.

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update for GitHub Build

Case issue in TASM includes showing up in GitHub build.  This should correct that.

* Added an gitignore files to exclude generated files

* Removed Tunes/clean.cmd and Tunes/ReadMe.txt - as make clean removes them

* Build.sh: marked as executable

chmod +x Build.sh

* Fix to HBIOS/build.sh

When adding files to rom disk, if files were missing, it would error out.

It appears the intent is to skip non-existing files.

Updated to log out correctly for missing files - and continue operation.

* Update Microsoft NASCOM BASIC.docx

Nascom manual, text version by Jan S (full name unknown)

* Fix issue with Apps/Tune not making

If dest directory does not exist, fails to make Apps

* Create ReadMe.txt

* Update Makefile

* Update Build.sh

* Make .gitignores for Tools/unix more specific

* cpmtools Update

Updated cpmtools applications (Windows only).  Removed hack in diskdefs that is no longer required.

* HBIOS Proxy Temp Stack Enhancement

Reuse the bounce buffer area as the temporary stack space required briefly in HBX_INVOKE when transitioning banks.  Increases size of temporary stack space to 64 bytes.

* Update ReadMe.txt

* HBIOS - clean up TMPSTK

* Update hbios.asm

Minor cosmetic changes.

* Build Process Updates

Minor udpates to build process to improve consistency between Windows and Mac/Linux builds.

* Update hbios.asm

Add improved interrupt protection to HBIOS PEEK, POKE, and BNKCPY functions.

* hbios - wrap hbx_bnkcpy

* hbios - adjust hbx_peek hbx_poke guards

* Update hbios.asm

Adjusted used of DI/EI for PEEK and POKE to regain a bit of INTSTK space.  Added code so that HB_INVBNK can be used as a flag indicating if HBIOS is active, $FF is inactive, anything else means active.

* Add HBIOS MuTex

* Initial Nascom basic ecb-vdu graphics

set and reset for 80x25b screen with 256 character mod

* Finalize Pre-release 34

Final support for FreeRTOS

* Update nascom.asm

Optimization, cleanup, tabs and white spaces

* IDE & PPIDE Cleanup

* Clean up

Make version include files common.

* Update Makefile

* Update Makefile

* Build Test

* Build Test

* Build Fixes

* Update nascom.asm

Cleanup

* Update nascom.asm

Optimization

* hbios - temp stack tweak

* Update hbios.asm

Comments on HBX_BUF usage.

* Update nascom.asm

Optimization

* Update nascom.asm

Setup ECB-VDU build option, remove debug code

* Update nascom.asm

Set default build. update initialization

* Update nascom.asm

Make CLS clear vdu screen

* Update nascom.asm

Fixup top screen line not showing

* Add SC131 Support

Also cleaned up some ReadMe files.

* HBIOS SCZ180 - remove mutex special files

* HBIOS SCZ180 - adjust mutex comment

* Misc. Cleanup

Includes some minor improvements to contents in some disk images.

* Delete FAT.COM

Changing case of FAT.COM extension to lowercase.

* Create FAT.com

Completing change of case in extension of FAT.com.

* Update Makefile

Remove ROM variants that just have the HBIOS MUTEX enabled.  Users can easily enable this in a custom build.

* Cleanup

Removed hack from Images Makefile.  Fixed use of DEFSERCFG in various places.

* GitHub CI Updates

Adds automation of build and release assets upon release.

* Prerelease 36

General cleanup

* Build Script Cleanups

* Config File Cleanups

* Update RomWBW Architecture

General refresh for v2.9.2

* Update vdu.asm

Removed a hack in VDU driver that has existed for 8 years.  :-)

* Fix CONSOLE Constant

Rename CIODEV_CONSOLE constant to CIO_CONSOLE because it is a unit code, not a device type code.

Retabify TastyBasic.

* Minor Bug Fixes

- Disk assignment edge case
- CP/M 3 accidental fall thru
- Cosmetic updates

* Update util.z80

* Documentation Cleanup

* Documentation Update

* Documentation Update

* Documentation Updates

* Documentation Updates

* Create Common.inc

* Documentation Updates

* Documentation Updates

* doc - a few random fixes

* Documentation Cleanup

* Fix IM 0 Build Error in ACIA

* Documentation Updates

* Documentation Cleanup

* Remove OSLDR

The OSLDR application was badly broken and almost impossible to fix with new expanded OS support.

* Bug Fixes

- Init RAM disk at boot under CP/M 3
- Fix ACR activation in TUNE

* FD Motor Timeout

- Made FDC motor timeout smaller and more consistent across different speed CPUs
- Added "boot" messaging to RTC

* Cleanup

* Cleanup

- Fix SuperZAP to work under NZCOM and ZPM3
- Finalize standard config files

* Minor Changes

- Slight change to ZAP configuration
- Added ZSDOS.ZRL to NZCOM image

* ZDE Upgrade

- Upgraded ZDE 1.6 -> 1.6a

* Config File Tuning

* Pre-release for Testing

* cfg - mutex consistent config language

* Bump to Version 3.0

* Update SD Card How-To

Thanks David!

* update ReadMe.md

Remove some odd `\`.

* Update ReadMe.txt

* Update ReadMe.md

* Update Generated Doc Files

* Improve XModem Startup

- Extended startup timeout for XM.COM so that it doesn't timeout so quickly while host is selecing a file to send.
- Updated SD Card How-To from David Reese.

* XModem Timing Refinements

* TMS Driver Z180 Improvements

- TMS driver udpated to insert Z180 I/O waitstates internally so other code can run at full speed.
- Updated How-To documents from David.
- Fixed TUNE app to properly restore Z180 I/O waitstates after manipulating them.

* CLRDIR and ZDE updates

- CLRDIR has been updated by Max Scane for CP/M 3 compatibility.
- A minor issue in the preconfigured ZDE VT100 terminal escape sequences was corrected.

* Fix Auto CRT Console Switch on CP/M 3

* Handle lack of RTC better

DSRTC driver now correctly returns an error if there is no RTC present.

* Minor RTC Updates

* Finalize v3.0.1

Cleanup release for v3.0

* New ROMLDR and INTRTC driver

- Refactored romldr.asm
- Added new periodic timer based RTC driver

* CP/M 3 Date Hack

- Hack to allow INTRTC to increment time without destroying the date

* Update romldr.asm

Work around minor Linux build inconsistency

* Update Apps for New Version

* Revert "Update Apps for New Version"

This reverts commit ad80432252.

* Revert "Update romldr.asm"

This reverts commit 4a9825cd57.

* Revert "CP/M 3 Date Hack"

This reverts commit 153b494e61.

* Revert "New ROMLDR and INTRTC driver"

This reverts commit d9bed4563e.

* Start v3.1 Development

* Update FDISK80.COM

Updated FDISK80 to allow reserving up to 256 slices.

* Update sd.asm

For Z180 CSIO, ensure that xmit is finished, before asserting CS for next transaction.

* Add RC2014 UART, Improve SD protocol fix

- RC2014 and related platforms will autodetect a UART at 0xA0 and 0xA8
- Ensure that CS fully brackets all SD I/O

* ROMLDR Improvements

.com files can now be started from CP/M and size of .com files has been reduced so they always fit.

* Update commit.yml

Run commit build in all branches

* Update commit.yml

Run commit build for master and dev branches

* Improved clock driver auto-detect/fallback

* SIO driver now CTC aware

The SIO driver can now use a CTC (if available) to provide much more flexible baud rate programming.

* CTC driver fine tuning

* Update xmdm125.asm

Fixed a small issue in core XM125 code that caused a file write error message to not be displayed when it should be.

* CF Card compatibility improvement

Older CF Cards did not reset IDE registers to defaults values when reset.  Implemented a work around.

* Update ACIA detection

ACIA should no longer be detected if there is also a UART module in the system.

* Handle CTC anomaly

Small update to accommodate CTC behavior that occurs when the CTC trigger is more than half the CTC clock.

* Update acia.asm

Updated ACIA detection to use primary ACIA port instead of phantom port.

* Update acia.asm

Fix bug in ACIA detection.

Thanks Alan!

* MacOS Build Improvement

Build script updated to improve compatibility with MacOS.

Credit to Fredrik Axtelius for this.

* HBIOS Makefile - use env vars for target

Allow build ROM targets to be restricted to just one platform thru use of ENV vars:

ROM_PLATFORM - if defined to a known platform, only this platform is build - defaults to std config
ROM_CONFIG - sets the desired platform config - defaults to std

if the above ENVs are not defined, builds all ROMs

* Added some more gitignores

* Whitespace changes (crlf)

* HBIOS: Force the assembly to fail for vdu drivers if function table count is not correct

* Whitespace: trailing whitespaces

* makefile: updated some make scripts to use  when calling subdir makefiles

* linux build: update to Build.sh fix for some platforms

The initialization of the Rom dat file used the pipe (|) operator to build an initial empty file.

But the pipe operator | may sometimes return a non-zero exit code for some linux platforms, if the
the streams are closed before dd has fully processed the stream.

This issue occured on a travis linux ubuntu image.

Solution was to change to redirection.

* Bump version

* Enhance CTC periodic timer

Add ability to use TIMER mode in CTC driver to generate priodic interrupts.

* HBIOS: Added support for sound drivers

New sound driver support with initial support for the SN76489 chip

New build configuration entry:
* SN76489ENABLE

Ports are currently locked in with:
* SN76489_PORT_LEFT       .EQU    $FC     ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT)
* SN76489_PORT_RIGHT      .EQU    $F8     ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT)

* Miscellaneous Cleanup

No functional changes.

Co-authored-by: curt mayer <curt@zen-room.org>
Co-authored-by: Wayne Warthen <wwarthen@gmail.com>
Co-authored-by: ed <linux@maidavale.org>
Co-authored-by: Dean Netherton <dnetherton@dius.com.au>
Co-authored-by: ed <ed@maidavale.org>
Co-authored-by: Phillip Stevens <phillip.stevens@gmail.com>
Co-authored-by: Dean Netherton <dean.netherton@gmail.com>
pull/117/head
b1ackmai1er 6 years ago
committed by GitHub
parent
commit
78f65522b7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      .github/workflows/commit.yml
  2. 51
      .github/workflows/release.yml
  3. 102
      .gitignore
  4. 4
      Binary/Apps/Clean.cmd
  5. 10
      Binary/Apps/Makefile
  6. 4
      Binary/Apps/Tunes/Clean.cmd
  7. BIN
      Binary/Apps/Tunes/Demo.mym
  8. BIN
      Binary/Apps/Tunes/Demo1.mym
  9. BIN
      Binary/Apps/Tunes/Demo3.mym
  10. BIN
      Binary/Apps/Tunes/Demo3mix.mym
  11. BIN
      Binary/Apps/Tunes/Demo4.mym
  12. 167
      Binary/DiskList.txt
  13. 8
      Binary/Makefile
  14. 60
      Binary/ReadMe.txt
  15. 116
      Binary/RomList.txt
  16. BIN
      Doc/CPM Manual.pdf
  17. BIN
      Doc/CPM3 Command Summary.pdf
  18. BIN
      Doc/CPM3 Programmers Guide.pdf
  19. BIN
      Doc/CPM3 System Guide.pdf
  20. BIN
      Doc/CPM3 Users Guide.pdf
  21. 93
      Doc/ChangeLog.txt
  22. 429
      Doc/Contrib/FdTst.txt
  23. 45
      Doc/Contrib/LinuxBuild.txt
  24. BIN
      Doc/Contrib/Microsoft NASCOM BASIC.docx
  25. BIN
      Doc/Contrib/SC126_How-To_No_1_Serial_Comms_Using_Minicom_v.1.1.pdf
  26. BIN
      Doc/Contrib/SC126_How-To_No_2_Preparing_an_SD_Card_for_Use_with_SC126_v1.5.3.pdf
  27. BIN
      Doc/Contrib/SC126_How-To_No_3_Updating_RomWBW_Using_a_Hybrid_SD_Card_v1.1.pdf
  28. 19
      Doc/Contrib/Z180 Clocking.txt
  29. 2
      Doc/Contrib/ZSystem.txt
  30. 564
      Doc/DDTZ.doc
  31. 13
      Doc/FDU.txt
  32. BIN
      Doc/Hard Disk Anatomy.pdf
  33. BIN
      Doc/NZCOM Users Manual.pdf
  34. 63
      Doc/ReadMe.txt
  35. BIN
      Doc/RomWBW Applications.pdf
  36. BIN
      Doc/RomWBW Architecture.pdf
  37. BIN
      Doc/RomWBW Getting Started.pdf
  38. BIN
      Doc/Z180 ASCI Baud Rate Options.pdf
  39. BIN
      Doc/ZCPR Manual.pdf
  40. 19
      Makefile
  41. 1167
      ReadMe.md
  42. 1370
      ReadMe.txt
  43. 75
      Readme.unix
  44. 233
      Source/Apps/Assign.asm
  45. 2
      Source/Apps/Build.cmd
  46. 1
      Source/Apps/Clean.cmd
  47. 7
      Source/Apps/FAT/Build.cmd
  48. 5
      Source/Apps/FAT/Clean.cmd
  49. BIN
      Source/Apps/FAT/FAT.com
  50. 674
      Source/Apps/FAT/LICENSE.txt
  51. 6
      Source/Apps/FAT/Makefile
  52. 101
      Source/Apps/FAT/ReadMe.txt
  53. 92
      Source/Apps/FDU/FDU.asm
  54. 13
      Source/Apps/FDU/FDU.txt
  55. 8
      Source/Apps/FDU/Makefile
  56. 4
      Source/Apps/Format.asm
  57. 209
      Source/Apps/IntTest.asm
  58. 14
      Source/Apps/Makefile
  59. 4
      Source/Apps/Mode.asm
  60. 1014
      Source/Apps/OSLdr.asm
  61. 95
      Source/Apps/RTC.asm
  62. 139
      Source/Apps/SysCopy.asm
  63. 29
      Source/Apps/Timer.asm
  64. 12
      Source/Apps/Tune/Makefile
  65. 336
      Source/Apps/Tune/Tune.asm
  66. 3
      Source/Apps/XM/Build.cmd
  67. 13
      Source/Apps/XM/Makefile
  68. 24
      Source/Apps/XM/xmdm125.asm
  69. 639
      Source/Apps/XM/xmhb.180
  70. 331
      Source/Apps/XM/xmuf.180
  71. 15
      Source/BPBIOS/@WBW Issues.txt
  72. 2
      Source/BPBIOS/@WBW Z3ENV.txt
  73. 36
      Source/BPBIOS/Build.cmd
  74. 3
      Source/BPBIOS/Clean.cmd
  75. 47
      Source/BPBIOS/Makefile
  76. 11
      Source/BPBIOS/NZFCP13/Build.cmd
  77. 7
      Source/BPBIOS/NZFCP13/Clean.cmd
  78. 5
      Source/BPBIOS/NZFCP13/Makefile
  79. BIN
      Source/BPBIOS/NZFCP13/fcp-4.zrl
  80. BIN
      Source/BPBIOS/NZFCP13/fcp-4t.zrl
  81. BIN
      Source/BPBIOS/NZFCP13/fcp-5.zrl
  82. BIN
      Source/BPBIOS/NZFCP13/fcp-5t.zrl
  83. BIN
      Source/BPBIOS/NZFCP13/fcp-6.zrl
  84. BIN
      Source/BPBIOS/NZFCP13/fcp-6t.zrl
  85. BIN
      Source/BPBIOS/NZFCP13/fcp-7t.zrl
  86. 89
      Source/BPBIOS/NZFCP13/nzfcp.doc
  87. 161
      Source/BPBIOS/NZFCP13/nzfcp.lib
  88. 161
      Source/BPBIOS/NZFCP13/nzfcp.lib.sav
  89. 9
      Source/BPBIOS/NZFCP13/nzfcp13.for
  90. 1424
      Source/BPBIOS/NZFCP13/nzfcp13.z80
  91. 105
      Source/BPBIOS/NZFCP13/z34cmn.lib
  92. 122
      Source/BPBIOS/NZFCP13/z34mac.lib
  93. 0
      Source/BPBIOS/WW.Z3T
  94. 11
      Source/BPBIOS/Z34RCP11/Build.cmd
  95. 7
      Source/BPBIOS/Z34RCP11/Clean.cmd
  96. 5
      Source/BPBIOS/Z34RCP11/Makefile
  97. BIN
      Source/BPBIOS/Z34RCP11/cledinst.com
  98. BIN
      Source/BPBIOS/Z34RCP11/cledsave.com
  99. 3010
      Source/BPBIOS/Z34RCP11/nzrcp.z80
  100. 33
      Source/BPBIOS/Z34RCP11/rcpbase.lib

32
.github/workflows/commit.yml

@ -0,0 +1,32 @@
name: Commit Build
on:
push:
branches:
- master
- dev
tags-ignore:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: rlespinasse/github-slug-action@1.1.0
- uses: actions/checkout@v2
- name: Build
run: |
sudo apt-get install libncurses-dev
make
make clean
rm -rf .git*
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: RomWBW-${{env.GITHUB_REF_SLUG}}-${{env.GITHUB_SHA_SHORT}}
path: .

51
.github/workflows/release.yml

@ -0,0 +1,51 @@
name: Release Build
on:
release:
types: published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create Package Label
run: |
LABEL=`echo "$GITHUB_REF" | sed "s|^refs/tags/||"`
echo "::set-env name=PKGLBL::$LABEL"
- name: Display Diagnostics
run: |
echo PKGLBL: "$PKGLBL"
echo Upload URL: "${{github.event.release.upload_url}}"
echo GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
- name: Build
run: |
sudo apt-get install libncurses-dev
make
make clean
rm -rf .git*
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: RomWBW-${{env.PKGLBL}}-Package
path: .
- name: Create Package Archive
run: |
zip -r Package.zip .
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{github.event.release.upload_url}}
asset_path: Package.zip
asset_name: RomWBW-${{env.PKGLBL}}-Package.zip
asset_content_type: application/zip

102
.gitignore

@ -0,0 +1,102 @@
# Not sure what patterns to apply
# So ignoring all generated files explicitly
**/*.[Bb][Ii][Nn]
**/*.[Cc][Oo][Mm]
**/*.[Rr][Oo][Mm]
**/*.com
**/*.eeprom
**/*.hex
**/*.img
**/*.lib
**/*.lst
**/*.o
**/*.prn
**/*.rel
**/*.sym
**/*.sys
**/*.tmp
**/*/font*.asm
Binary/**/*.mym
Binary/**/*.pt3
Source/**/eeprom
Source/Apps/Assign.com
Source/Apps/FDU/FDU.COM
Source/Apps/Format.com
Source/Apps/IntTest.com
Source/Apps/Mode.com
Source/Apps/OSLdr.com
Source/Apps/RTC.com
Source/Apps/SysCopy.com
Source/Apps/SysGen.com
Source/Apps/Talk.com
Source/Apps/Timer.com
Source/Apps/Tune/Tune.com
Source/BPBIOS/bpsys.bak
Source/BPBIOS/bpsys.dat
Source/BPBIOS/def-ww.lib
Source/CPM3/bios3.spr
Source/CPM3/bnkbios3.spr
Source/CPM3/gencpm.dat
Source/CPM3/options.lib
Source/CPM3/zpmbios3.spr
Source/HBIOS/Blank512KB.dat
Source/HBIOS/build.inc
Source/Images/blank144
Source/Images/blankhd
Source/Prop/Spin/ParPortProp.list
Source/Prop/Spin/PropIO.list
Source/Prop/Spin/PropIO2.list
Source/Prop/ParPortProp.list
Source/Prop/PropIO.list
Source/Prop/PropIO2.list
Source/ZPM3/bnkbios3.spr
Source/ZPM3/gencpm.com
Source/ZPM3/gencpm.com
Source/ZPM3/gencpm.dat
Tools/Linux
Tools/Darwin
Tools/unix/bin2asm/bin2asm
Tools/unix/cpmtools/cpmchattr
Tools/unix/cpmtools/cpmchmod
Tools/unix/cpmtools/cpmcp
Tools/unix/cpmtools/cpmls
Tools/unix/cpmtools/cpmrm
Tools/unix/cpmtools/fsck.cpm
Tools/unix/cpmtools/fsed.cpm
Tools/unix/cpmtools/mkfs.cpm
Tools/unix/lzsa/lzsa
Tools/unix/uz80as/uz80as
Tools/unix/zx/config.h
Tools/unix/zx/zx
!Source/ver.lib
!Source/Apps/FAT/FAT.COM
!Source/BPBIOS/bpbuild.com
!Source/BPBIOS/movp112.com
!Source/BPBIOS/Z34RCP11/cledinst.com
!Source/BPBIOS/Z34RCP11/cledsave.com
!Source/Fonts
!Source/Images/**/*.[Cc][Oo][Mm]
!Source/RomDsk/**/*.[Cc][Oo][Mm]
!Source/UBIOS/FSFAT.BIN
!Source/UBIOS/UNA-BIOS.BIN
!Source/ZCCP/*.[Cc][Oo][Mm]
!Source/ZCPR-DJ/*.[Cc][Oo][Mm]
!Source/ZPM3/*.[Cc][Oo][Mm]
!Source/ZSDOS/*.[Cc][Oo][Mm]
!Tools/cpm/bin
!Tools/unix/zx
!Tools/zx
Source/ZPM3/gencpm.com
Source/ZPM3/startzpm.com
Source/ZPM3/zccp.com
Source/ZPM3/zpmldr.com
Source/ZPM3/genbnk.dat
Source/ZSDOS/zsdos.err

4
Binary/Apps/Clean.cmd

@ -2,5 +2,5 @@
setlocal
if exist *.com del *.com
setlocal & cd Tunes && call Clean || exit /b 1 & endlocal
if exist Tunes\*.pt? del Tunes\*.pt?
if exist Tunes\*.mym del Tunes\*.mym

10
Binary/Apps/Makefile

@ -0,0 +1,10 @@
TOOLS = ../../Tools
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com Tunes/*)
include $(TOOLS)/Makefile.inc
all::
mkdir -p Tunes
clobber::
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt?

4
Binary/Apps/Tunes/Clean.cmd

@ -1,4 +0,0 @@
@echo off
setlocal
if exist *.pt? del *.pt?

BIN
Binary/Apps/Tunes/Demo.mym

Binary file not shown.

BIN
Binary/Apps/Tunes/Demo1.mym

Binary file not shown.

BIN
Binary/Apps/Tunes/Demo3.mym

Binary file not shown.

BIN
Binary/Apps/Tunes/Demo3mix.mym

Binary file not shown.

BIN
Binary/Apps/Tunes/Demo4.mym

Binary file not shown.

167
Binary/DiskList.txt

@ -0,0 +1,167 @@
***********************************************************************
*** ***
*** R o m W B W ***
*** ***
*** Z80/Z180 System Software ***
*** ***
***********************************************************************
This directory ("Binary") is part of the RomWBW System Software
distribution archive. Refer to the ReadMe.txt file in this
directory for more information on the overall contents of the
directory.
RomWBW includes a set of disk images that are ready to copy onto
a floppy or hard/CF/SD disk. You can use your modern computer
(Windows/Linux/Mac) to copy the disk image file onto your disk
media. The disk media will then be ready to use in your RomWBW
System.
A description of the disk images is provided later in this file.
For more information on the creatioin of these images including
instructions for customizing them or creating your own, refer to
the ReadMe.txt file in the Source\Images directory.
Installing Images
-----------------
The following instructions apply to Windows computers. Alternatively,
you can use the "dd" command on Linux or Mac.
First of all, a MAJOR WARNING!!!! The tools described below are
quite capable of obliterating your running Windows system drive. Use
with extreme caution and make sure you have backups.
To install a floppy image on floppy media, you can use the tool
called RaWriteWin. This tool is included in the Tools directory of
the distribution. This tool will write your floppy image (fd_xxx.img)
to a floppy disk using a raw block transfer. The tool is GUI based
and it's operation is self explanatory.
To install a hard disk image on a CF card or SD card, you must have
the appropriate media card slot on your computer. If you do, you can
use the tool called Win32DiskImager. This tool is also included in
the Tools directory of the distribution. It will write your
hard disk image (hd_xxx.img) to the designated media card. This tool
is also GUI based and self explanatory.
The use of the SIMH emulator is outside of the scope of this document.
However, if you use SIMH, you will find that you can attach the hard
disk images to the emulator with lines such as the following in your
SIMH configuration file:
| attach hdsk0 hd_cpm22.img
| set hdsk0 format=HDSK
| set hdsk0 geom=T:2048/N:256/S:512
| set hdsk0 wrtenb
Making Disk Images Bootable
---------------------------
The Operating System disk images below are ready to boot by the
RomWBW Boot Loader. However, if you update your RomWBW ROM, then
you should also update the system tracks of your bootable disk
images. You would use SYSCOPY to do this. SYSCOPY can also be
used to make a disk bootable if it is not already bootable.
You would use a command like the following to make drive C bootable:
| B>SYSCOPY C:=CPM.SYS
The system file to use depends on the operating system you are trying
to boot from the slice you are initializing with SYSCOPY:
CP/M 2.2 - cpm.sys
ZSDOS 1.1 - zsys.sys
CP/M 3 - cpmldr.sys
ZPM3 - cpmldr.sys
Slices
------
A RomWBW CP/M filesystem is fixed at 8MB. This is because it is the
largest size filesystem supported by all common CP/M variants. Since
all modern hard disks (including SD Cards and CF Cards) are much
larger than 8MB, RomWBW supports the concept of "slices". This
simply means that you can concatenate multiple CP/M filesystems (up
to 256 of them) on a single physical hard disk and RomWBW will allow
you to assign drive letters to them and treat them as multiple
independent CP/M drives.
With the exception of the hd_combo image, each of the disk images
includes a single CP/M file system (i.e., a single slice). However,
you can easily create a multi-slice disk image by merely concatenating
multiple images together. For example, if you wanted to create a 2
slice disk image that has ZSDOS in the first slice and Wordstar in
the second slice, you could use the following command from a Windows
command prompt:
| C:\RomWBW\Binary>copy /b hd_zsdos.img + hd_ws.img hd_multi.img
You can now write hd_multi.img onto your SD or CF Card and you will
have ZSDOS in the first slice and Wordstar in the second slice.
The hd_combo disk image is an example of this. It contains several
slices in one image file. The contents of this special disk image
are described below.
The concept of slices applies ONLY to hard disks. Floppy disks are
not large enough to support multiple slices.
Disk Image Contents
-------------------
What follows is a brief description of the contents of the
disk images automatically provided in the RomWBW distribution.
Note that all of the OS images include the RomWBW custom
support apps.
cpm22 - DRI CP/M 2.2 (Bootable Floppy and Hard Disk)
Standard DRI CP/M 2.2 distribution files along with a few commonly
used utilities.
zsdos - ZCPR1 + ZSDOS 1.1 (Bootable Floppy and Hard Disk)
Contains ZCPR1 and ZSDOS 1.1. This is roughly equivalent to the
ROM boot contents, but provides a full set of the applications
and related files that would not all fit on the ROM drive.
nzcom - NZCOM (Bootable Floppy and Hard Disk)
Standard NZCOM distribution. Note that you will need to run the
NZCOM setup before this will run properly. You will need
to refer to the NZCOM documentation.
cpm3 - DRI CP/M3 (Bootable Floppy and Hard Disk)
Standard DRI CP/M 3 adaptation for RomWBW that is ready to run.
It can be started by running CPMLDR.
zpm3 - ZPM3 (Bootable Floppy and Hard Disk)
Simeon Cran's ZCPR 3 compatible OS for CP/M 3 adapted for RomWBW and
ready to run. It can be started by running CPMLDR (which seems
wrong, but ZPMLDR is somewhat broken).
ws4 - WordStar 4 (Floppy and Hard Disk)
Micropro Wordstar 4 full distribution. This image is not bootable
and is intended to be added as an additional slice to an OS image.
bp - BPBIOS (Hard Disk only)
Adaptation of BPBIOS for RomWBW. This is NOT complete and NOT
useable in it's current state.
combo - Multi-Boot Combination (Bootable Hard Disk)
A pre-created combo image that contains the following slices. The
slices are identical to the individual images listed above.
Slice 0: cpm22 (bootable)
Slice 1: zsdos (bootable)
Slice 2: nzcom (bootable)
Slice 3: cpm3 (bootable)
Slice 4: zpm3 (bootable)
Slice 5: ws4 (not bootable)

8
Binary/Makefile

@ -0,0 +1,8 @@
TOOLS = ../Tools
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.img *.rom *.com *.eeprom)
SUBDIRS = Apps
include $(TOOLS)/Makefile.inc
clobber::
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom

60
Binary/ReadMe.txt

@ -17,15 +17,14 @@ released the directory is populated with the default output files.
However, the output of custom builds will be placed in this directory
as well.
If you only see a few files in this directory, then you downloaded just
the source from GitHub. To retrieve the full release download package,
go to https://github.com/wwarthen/RomWBW. On this page, look for the
text "XX releases" where XX is a number. Click on this text to go to the
releases page. On this page, you will see the latest releases listed.
For each release, you will see a package file called something like
"RomWBW-2.9.0-Package.zip". Click on the package file for the release
you want to download.
If you only see a few files in this directory, then you downloaded
just the source from GitHub. To retrieve the full release download
package, go to https://github.com/wwarthen/RomWBW. On this page,
look for the text "XX releases" where XX is a number. Click on this
text to go to the releases page. On this page, you will see the
latest releases listed. For each release, you will see a package
file called something like "RomWBW-2.9.0-Package.zip". Click on the
package file for the release you want to download.
ROM Firmware Images (<plt>_<cfg>.rom)
-------------------------------------
@ -33,15 +32,15 @@ ROM Firmware Images (<plt>_<cfg>.rom)
The files with a ".rom" extension are binary images ready to program
into an appropriate PROM. These files are named with the format
<plt>_<cfg>.rom. <plt> refers to the primary platform such as Zeta,
N8, Mark IV, etc. <cfg> refers to the specific configuration. When
released, there will be a standard configuration ("std") for each
N8, Mark IV, etc. <cfg> refers to the specific configuration. In
general, there will be a standard configuration ("std") for each
platform. So, for example, the file called MK4_std.rom is a ROM
image for the Mark IV with the standard configuration. If a custom
configuration called "custom" is created and built, a new file called
MK4_custom.rom will be added to this directory.
Documentation of the pre-built ROM Images is contained in the
RomList.txt file.
RomList.txt file in this directory.
ROM Executable Images (<plt>_<cfg>.com)
---------------------------------------
@ -49,22 +48,16 @@ ROM Executable Images (<plt>_<cfg>.com)
When a ROM image (".rom") is created, an executable version of the
ROM is also created. These files have the same naming convention as
the ROM Image files, but have the extension ".com". These files can
be copied to a working system and run like a normal application.
be copied to a working system and run like a normal CP/M application.
When run on the target system, they install in RAM just like they had
been programmed into the ROM. This allows a new ROM build to be
tested without reprogramming the actual ROM.
ROM Binary Images (<plt>_<cfg>.img)
-----------------------------------
been loaded from ROM. This allows a new ROM build to be tested
without reprogramming the actual ROM.
Also when a ROM image is created, a third variation of the ROM is
created again with the same naming convention, but with the extension
of .img. These files are similar to the .com files in that they can
be used to test a ROM build without actually programming a new ROM.
The .img files are specifically for loading via UNA from a FAT file
system. The functionality of the UNA FAT file system loader is
beyond the scope of this document.
WARNING: In a few cases the .com file is too big to load. If you get
a message like "Full" or "BAD LOAD" when trying to load one of the
.com files, it is too big. In these cases, you will not be able to
test the ROM prior to programming it.
VDU ROM Image (vdu.rom)
-----------------------
@ -73,7 +66,7 @@ The VDU video board requires a dedicated onboard ROM containing the
font data. The "vdu.rom" file contains the binary data to program
onto that chip.
Disk Images (fd*.img, hd*.img)
Disk Images (fd_*.img, hd_*.img)
------------------------------
RomWBW includes a mechanism for generating floppy disk and hard disk
@ -84,23 +77,28 @@ RomWBW-based system.
Essentially, these files contain prepared floppy and hard disk images
with a large set of programs and related files. By copying the
contents of these files to appropriate media as described below, you
can quickly create ready-to-use media.
can quickly create ready-to-use media. Win32DiskImager or
RawWriteWin can be used to copy images directly to media. These
programs are included in the RomWBW Tools directory.
The fd*.img files are floppy disk images. They are sized for 1.44MB
The fd_*.img files are floppy disk images. They are sized for 1.44MB
floppy media and can be copied to actual floppy disks using
RawWriteWin (as long as you have access to a floppy drive on your
Windows computer). The resulting floppy disks will be usable on any
RomWBW-based system with floppy drive(s).
Likewise, the hd*.img files are hard disk images. Each file is
Likewise, the hd_*.img files are hard disk images. Each file is
intended to be copied to the start of any type of hard disk media
(typically a CF Card or SD Card). The resulting media will be usable
on any RomWBW-based system that accepts the corresponding media type.
Note that the contents of the floppy/hard disk images are created by
Documentation of the pre-built disk images is contained in the
DiskList.txt file in this directory.
The contents of the floppy/hard disk images are created by
the BuildImages.cmd script in the Source directory. Additional
information on how to generate custom disk images is found in the
Source\Images directory.
Source\Images ReadMe.txt file.
Propeller ROM Images (*.eeprom)
-------------------------------

116
Binary/RomList.txt

@ -26,12 +26,17 @@ platform being used. The table below indicates the correct ROM
image to use for each platform:
SBC V1/V2 SBC_std.rom
SBC SimH SBC_simh.rom
Zeta V1 ZETA_std.rom
Zeta V2 ZETA2_std.rom
N8 N8_std.rom
Mark IV MK4_std.rom
RC2014 RC_std.rom
RC2014 w/ Z180 RC180_std.rom
RC2014 w/ Z80 RCZ80_std.rom
RC2014 w/ Z180 RCZ180_nat.rom (native Z180 memory addressing)
RC2014 w/ Z180 RCZ180_ext.rom (external 512K RAM/ROM module)
SC-series SC126, SC130
Easy Z80 EZZ180_std.rom
Dyno DYNO_std.rom
You will find there is one additional ROM image called
"UNA_std.rom". This ROM image is an UNA-based RomWBW ROM image. As
@ -47,12 +52,19 @@ ROM on-the-fly. It is an excellent way to test a ROM Image before
actually burning it. Similarly, the .img files can be loaded using
the UNA FAT loader for testing.
All of the standard ROM Images are configured with:
WARNING: In a few cases the .com file is too big to load. If you get
a message like "Full" or "BAD LOAD" when trying to load one of the
.com files, it is too big. In these cases, you will not be able to
test the ROM prior to programming it.
All of the standard ROM Images are configured for:
- 512KB ROM Disk
- 512KB RAM Disk
- 38.4Kbps baud serial console (RC2014 is determined by hardware)
- 38.4Kbps baud serial console (*)
- Auto-discovery of all serial ports
* RC2014 and Stephen Cousins' kits run at 115,200Kbps baud
All hard disk type devices (IDE, PPIDE, CF Card, SD Card) will be
automatically assigned two drive letters per device. The drive
letters will refer to the first 2 slices of the device. The ASSIGN
@ -68,7 +80,9 @@ each platform as documented below. If the device or peripheral is
not detected at boot, the ROM will simply bypass support
appropriately.
SBC:
SBC (SBC_std.rom):
- CPU speed is detected at startup
- Console on onboard UART serial port at 38400 baud
- Includes support for PPIDE/CF Card(s) connected to on-board
parallel port.
- Includes support for CVDU and VGA3 boards. If detected at
@ -85,7 +99,14 @@ SBC:
circuit which is likely to cause system instability. SBC
V2 does not have this issue.
ZETA/ZETA2:
SBC (SBC_simh.rom):
- SBC variant customized to run under SimH
- Implments two emulated SimH hard disk images
- Uses SimH RTC
ZETA (ZETA_std.rom):
- CPU speed is detected at startup
- Console on onboard UART serial port at 38400 baud
- Includes support for on-board floppy disk controller and
two attached floppy disks.
- Auto-detects ParPortProp and includes support for it if it
@ -95,7 +116,22 @@ ZETA/ZETA2:
on-board serial port, if JP1 is open, console will go to
ParPortProp video and keyboard ports.
N8:
ZETA2 (ZETA2_std.rom):
- CPU speed is detected at startup
- Console on onboard UART serial port at 38400 baud
- Includes support for on-board floppy disk controller and
two attached floppy disks.
- Auto-detects ParPortProp and includes support for it if it
is attached.
- Uses CTC to generate periodic timer interrupts.
- If ParPortProp is installed, initial console output is
determined by JP1. If JP1 is shorted, console will go to
on-board serial port, if JP1 is open, console will go to
ParPortProp video and keyboard ports.
N8 (N8_std.rom):
- CPU speed is detected at startup
- Console on Z180 onboard primary ASCI serial port at 38400 baud
- Includes support for on-board floppy disk controller and
two attached floppy disks.
- Includes support for on-board TMS9918 video and keyboard
@ -103,7 +139,9 @@ N8:
- Includes support for on-board SD Card as hard disk and
assumes a production level N8 board (date code >= 2312).
MK4:
MK4 (MK4_std.rom):
- CPU speed is detected at startup
- Console on Z180 onboard primary ASCI serial port at 38400 baud
- Includes support for on-board IDE port (CF Card via adapter).
- Includes support for on-board SD Card port.
- Auto-detects PropIO or PropIO V2 and installs associated
@ -112,21 +150,69 @@ MK4:
startup, support for video and keyboard is installed
including VT-100/ANSI terminal emulation.
RC2014:
RCZ80 (RCZ80_std.rom):
- Assumes CPU oscillator of 7.3728 MHz
- Requires 512K RAM/ROM module
- Auto detects Serial I/O Module (ACIA) and Dual Serial
Module (SIO/2). Either one may be used.
- Includes support for Compact Flash Module
- Support for PPIDE Module may be enabled in config
- Console on whichever serial module is installed,
but will use the SIO/2 if both are installed. Baud
rate is determined by hardware, but normally 115200.
- Includes support for RC2014 Compact Flash Module
- Support for RC2014 PPIDE Module may be enabled in config
- Support for Scott Baker SIO board may be enabled in config
- Support for Scott Baker floppy controllers (SMC & WDC) may
be enabled in config
RC2014 w/ Z180:
RCZ80 w/ KIO (RCZ80_kio.rom):
- Assumes CPU oscillator of 7.3728 MHz
- Requires 512K RAM/ROM module
- Console attached to Z180 onboard serial ports at 38400 baud
- Includes support for Compact Flash Module
- Support for PPIDE Module may be enabled in config
- Requires KIO module
- Console on KIO primary serial port at 115200 baud
- Includes support for RC2014 Compact Flash Module
- Includes support for RC2014 PPIDE Module
- Support for Scott Baker SIO board may be enabled in config
- Support for Scott Baker floppy controllers (SMC & WDC) may
be enabled in config
RCZ180 (RCZ180_nat.rom & RCZ180_ext.rom):
- Assumes CPU oscillator of 18.432 MHz
- Console on Z180 onboard primary ASCI serial port at 115200 baud
- Includes support for RC2014 Compact Flash Module
- Includes support for RC2014 PPIDE Module
- Support for alternative serial modules may be enabled in config
- Support for Scott Baker floppy controllers (SMC & WDC) may
be enabled in config
- You must pick the _nat or _ext variant depending on which
memory module you are using:
- RCZ180_nat.rom uses the built-in Z180 memory manager
for use with memory modules allow direct physical
addressing of memory, such as the SC119
- RCZ180_ext.rom uses external bank management to access
memory, such as the 512K RAM/ROM module.
SCZ180 (SCZ180_126.rom, SCZ180_130.rom, SCZ180_131.rom):
- Assumes CPU oscillator of 18.432 MHz
- Console on Z180 onboard primary ASCI serial port at 115200 baud
- Includes support for RC2014 Compact Flash Module
- Includes support for RC2014 PPIDE Module
- Support for alternative serial modules may be enabled in config
- Support for Scott Baker floppy controllers (SMC & WDC) may
be enabled in config
- The 3 different variants of SCZ180 are provided to match the
3 corresponding systems (SC126, SC130, and SC131) designed by
Stephen Cousins.
EZZ80 (EZZ80_std.rom):
- Assumes CPU oscillator of 10.000 MHz
- Console on primary SIO serial port at 115200 baud
- Includes support for on-board SIO
- Includes support for RC2014 Compact Flash Module
- Includes support for RC2014 PPIDE Module
DYNO (DYNO_std.rom):
- Assumes CPU oscillator of 18.432 MHz
- Console on Z180 onboard serial ports at 38400 baud
- Includes support for BQ4842 RTC
- Includes support for onboard PPIDE
- Support for Dyno floppy controllers may be enabled in config

BIN
Doc/CPM Manual.pdf

Binary file not shown.

BIN
Doc/CPM3 Command Summary.pdf

Binary file not shown.

BIN
Doc/CPM3 Programmers Guide.pdf

Binary file not shown.

BIN
Doc/CPM3 System Guide.pdf

Binary file not shown.

BIN
Doc/CPM3 Users Guide.pdf

Binary file not shown.

93
Doc/ChangeLog.txt

@ -1,10 +1,92 @@
Version 3.1
-----------
- WBW: Refactored ROM Loader
- WBW: INTRTC periodic timer based clock
- WBW: FDISK80 updated to allow reserving up to 256 slices
- WBW: Added support dual 16C550 UART on RC2014 platform
- WBW: Made .com images smaller (contain only Z-System now)
- WBW: Support automatic clock hardware detection and fallback
- WBW: Support use of CTC for SIO baud rate divisors
- WBW: Updated IDE and PPIDE drivers to improve old CF Card compatibility
- WBW: Support TIMER mode in CTC driver
- D?N: Added sound driver support
- D?N: Added SN76489 sound chip driver
Version 3.0.1
-------------
- WBW: Increase XModem timeout waiting for host to start sending
- WBW: Update TMS driver to dynamically increase Z180 I/O W/S inside driver
- MJS: Update CLRDIR for CP/M 3 compatibility
- WBW: Corrected cursor on/off esc sequence in pre-configured ZDE
- WBW: Fix automatic CRT console switching under CP/M 3 and ZPM3
- WBW: DSRTC driver now correctly returns an error if there is no RTC present
Version 3.0.0
-------------
- WBW: v2.9.2 -> 3.0 version upgrade due to scope of changes
Version 2.9.2
-------------
- PMS: Fixed DS1210-related issue resulting in "Invalid BIOS" errors
- SCC: Support for SC126 motherboard
- WBW: Enable Auto-CTS/DCD in SIO driver for pacing output data
- WBW: Support missing pull-up resistors on SPI SD adapter boards (common)
- WBW: Support two SIO modules w/ auto-detection
- PMS: Support ECB USB-FIFO board
- WBW: Fixed ASSIGN issue with incorrect DPB selection
- WBW: Add RC2014 Z180 AY sound support to TUNE app
- WBW: Add RC2014 AY sound support to AY driver
- WBW: Add SC126 platform
- WBW: Config files cleanup
- WBW: Add interrupt support to ASCI driver
- WBW: Refactored XModem overlay, merged USB-FIFO support
- PMS: Added DS1210 low battery detection/message
- PMS: Added note playing ability to SPK driver
- WBW: Support disk I/O to any memory bank
- WBW: Fix floppy I/O error on slow CPUs w/ ints active (credit Jorge Rodrigues)
- WBW: Support for KIO chip (based on board by Tom Szolyga)
- N?B: Made ZCAL Y2K compliant
- WBW: Show disk activity on diagnostic LEDs
- WBW: DSRTC now detects DS-1302 presence dynamically
- WBW: SC126 platform renamed to SCZ180 w/ configs for SC126, SC130
- WBW: Add status LED support
- WBW: Add support for secondry SPI (SD Card) on SC126
- PMS: Add sound support to NASCOM BASIC
- WBW: Updated FAT to add MD and FORMAT commands
- WBW: Add CP/M 3 (experimental)
- M?T: Support Shift register SPI WIZNET for RC2014
- PLS: Added seconds register in HBIOS
- WBW: More flexible table-driven config in TUNE.COM
- PMS: Added timer support for Zilog Peripherals ECB Board
- PLS: Enhanced Intel Hex Load in dbgmon
- WBW: Overhaul disk image creation
- WBW: Added support for Dyno platform (based on work by Steve Garcia)
- SLG: Added support for BQ4845 RTC (bqrtc.asm)
- PMS: Added 80x30 video mode to VGA3 driver
- PMS: Added 80x43 video mode
- PMS: Added font compression option
- PMS: Added a "safe mode" startup w/ minimal device support
- WBW: Switch RC/SC Z180 platforms to 115,200 default baud rate
- PMS: Enhanced PPIDE driver to handle multiple PPI interfaces
- PMS: Added a ROM based game
- WBW: Only assign drive letters to hard disk devices with media
- WBW: Enhanced IDE driver to handle multiple IDE interfaces
- D?R: Contributed SC126 How-To: Preparing a MicroSD Card to Transfer Files to/from a Linux System
- PMS: Updated romldr to handle more than 9 drives
- PMS: Added "user" rom module template
- PMS: Added CP/M 3 manuals
- WBW: Boot from any slice
- C?M: Added Unix build process
- PLS: FreeRTOS compatibility
- WWB: Removed OSLDR application (can't handle new OSes)
Version 2.9.1
-------------
- E?B: Added support for RC2014 RTC
- WBW: Converted PTXPLAY to TUNE (now plays PT2/PT3/MYM sounds files)
- WBW: Updated Win32DiskImager to v1.0
- WBW: Implemented character attributes on Propeller based consoles
- M?S: Added support for BEL function in Propeller based consoles
- MS: Added support for BEL function in Propeller based consoles
- WBW: Support additional escape sequences in Propeller console ANSI emulation
- WBW: Map LPT: to second serial port, UL1: to third serial port
- WBW: Update default IOBYTE so that LST:=LPT: by default
@ -22,8 +104,15 @@ Version 2.9.1
- PMS: Added Forth, Nascom BASIC, and Tasty BASIC to ROM
- PMS: Refactored ROM Loader to support more ROM images, now table driven
- WBW: Refactored DSKY code
- S?K: Initial support for Easy Z80
- SK: Initial support for Easy Z80
- PMS: Enhance VDU driver to support alternative screen dimensions
- WBW: DDT and DDTZ modified to use RST 30 instead of RST 38 to avoid conflicts with IM 1 interrupts
- WBW: Added timer interrupt support for CTC under Zeta 2 and Easy Z80
- WBW: Support LBA style access in floppy driver
- WBW: Added beta version of FAT filesystem utility (copy, dir, del, ren)
- SCC: Added support for native memory addressing on Z180-based RC2014
- PMS: Dynamically discover and display processor type at boot
- J?L: Added German keyboard support to PPK and KBD drivers
Version 2.9.0
-------------

429
Doc/Contrib/FdTst.txt

@ -1,429 +0,0 @@
================================================================
FDTST v3.1 for N8VEM DISKIO / DISKIO V3 / ZETA / DIDE / N8
================================================================
Updated JuLY 1, 2012
by Wayne Warthen (wwarthen@gmail.com)
Application to test the hardware functionality of the Floppy Disk
Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA SBC,
Dual IDE w/ Floppy, or N8 board.
The intent is to provide a testbed that allows direct testing
of all possible media types and modes of access. The application
supports read, write, and format by sector, track, and disk as
well as a random read/write test.
The application supports access modes of polling, interrupt,
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at DD (720KB) and
HD (1.44MB) capacities. It also now supports 5.25" media (720KB and 1.2MB)
and 8" media (1.11MB) as well. Additonal media will be added when I have
time and access to required hardware. Not all modes are supported
on all platforms and some modes are experimental in all cases.
In many ways this application is merely reinventing the wheel and
performs functionality similer to existing applications, but I have
not seen any other applications for DISK I/O that provide this range
of functionality.
While the application is now almost entirely new code, I would like to
acknowledge that much was derived from the previous work of Andrew Lynch
and Dan Werner. I also want to credit Sergio Gimenez with testing the 5.25"
drive support and Jim Harre with testing the 8" drive support. Thanks!
General Usage
-------------
In general, usage is self explanatory. The main menu allows you to set
the unit, media, and mode to test. These settings MUST match your
situation. Read, write, format, and verify functions are provided. A sub-menu
will allow you to choose sector, track, disk, or random tests.
The verify function requires a little explanation. It will take the contents
of the buffer, save it, and compare it to the selected sectors. So, you
must ensure that the sectors to be verified already have been written
with the same pattern as the buffer contains. I typically init the buffer
to a pattern, write the pattern to the entire disk, then verify the entire
disk.
Another submenu is provided for FDC commands. This sub-menu allows you to
send low-level commands directly to FDC. You MUST know what you are doing
to use this sub-menu. For example, in order to read a sector using this
sub-menu, you will need to perform specify, seek, sense int, and read
commands specifying correct values (nothing is value checked in this menu).
Required Hardware/BIOS
----------------------
Of course, the starting point is one of the support hardware platforms.
You need to start with either an N8VEM SBC, backplane, and ECB DISK I/O
card or a Zeta SBC. Additionally, a floppy drive connected via an
appropriate cable:
DISKIO - no twist in cable, drive unit 0/1 must be selected by jumper on drive
ZETA - cable with twist, unit 0 after twist, unit 1 before twist
DIDE/N8 - cable with twist, unit 0 before twist, unit 1 after twist
It is preferable that the BIOS you use does not have DISK I/O support
enabled since the application assumes it has complete control of the
DISK I/O hardware.
The DISK I/O should be jumpered as follows:
J1: depends on use of interrupt modes (see interrupt modes below)
J2: pins 1-2, & 3-4 jumpered
J3: hardware dependent timing for DMA mode (see DMA modes below)
J4: pins 2-3 jumpered
J5: off
J6: pins 2-3 jumpered
J7: pins 2-3 jumpered
J8: off
J9: off
J10: off
J11: off
J12: off
Note that J1 can be left on even when not using interrupt modes. As
long as the BIOS is OK with it, that is fine. Note also that J3 is
only relevant for DMA modes, but also can be left in place when
using other modes.
The DISK I/O V3 should be jumpered at the default settings:
JP2: 3-4
JP3: 1-2 for int mode support, otherwise no jumper
JP4: 1-2, 3-4
JP5: 1-2
JP6: 1-2
JP7: 1-2, 3-4
Zeta does not have any relevant jumper settings.
DIDE should be jumpered as follows:
K3 (DT/R or /RD): /RD
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range)
There are no specific N8 jumper settings, but the default
I/O range starting at $80 is assumed in the published code.
Modes of Operation
------------------
You can select the following test modes. Please refer to the chart
that follows to determine which modes should work with combinations
of Z80 CPU speed and media format.
Polling: Traditional polled input/output. Works well and very reliable
including timeouts and good error recovery. Also, the slowest performance
which precludes it from being used with 1.44MB floppy on a 4MHz Z80.
This is definitely the mode you want to get working before any others.
It does not require J1 (interrupt enable) on DISK I/O and does not care about
the setting of J3.
Interrupt: Input/output is interrupt driven. Works pretty well, but
is not able to recover from some errors. For example, if there is
no disk in the drive, this mode will just hang until a disk is inserted.
This mode REQUIRES that interrupts be enabled on the DISK I/O via
jumper at J1. On Zeta it requires the INT/NMI jumper be set for
INT. Mode not supported on DIDE or N8. Some BIOS variants will not
handle interrupts during boot.
Fast Interrupt: As above, but sacrifices additional reliability for
faster operation. This mode will allow a 1.44MB floppy to work
with a 4MHz Z80 CPU. However, if any errors occur (even a transient
read error which is not unusual), this mode will hang. As above
you MUST have the appropriate jumpers for DISKIO and Zeta. DIDE
does not support this mode.
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of
actual interrupt. Subject to all the same issues as Fast
Interrupt, but does not need J1 shorted. J3 is irrelevant.
This mode is available on only on DISKIO (and not DISKIO V3).
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not require that
interrupts (J1) be enabled on the DISK I/O. However, it is subject to
all of the same reliability issues as "Fast Interrupt". This
mode is known to not work on N8VEM DISKIO!!! It is included
for testing only. It is dependent on setting of J3. This
mode is NOT available on Zeta, DIDE, N8, or DISKIO V3.
The chart below attempts to describe the combinations that
work for me. By far, the most reliable mode is Polling,
but it requires 8MHz CPU for HD disks.
DRQ/WAIT --------------------------------+
INT/WAIT -----------------------------+ |
Fast Interrupt --------------------+ | |
Interrupt ----------------------+ | | |
Polling ---------------------+ | | | |
| | | | |
CPU Speed --------------+ | | | | |
| | | | | |
| | | | | |
3.5" DD (720K) ------ 4MHz Y Y Y Y X
8MHz+ Y Y Y Y X
3.5" HD (1.44M) ----- 4MHz N N Y Y X
8MHz+ Y Y Y Y X
5.25" DD (360K) ----- 4MHz Y Y Y Y X
8MHz+ Y Y Y Y X
5.25" HD (1.2M) ----- 4MHz N N Y Y X
8MHz+ Y Y Y Y X
8" DD (1.11M) ------- 4MHz N N Y Y X
8MHz+ Y Y Y Y X
Y = Yes, works
N = No, does not work
X = Experimental, probably won't work
Tracing
-------
Command/result activity to/from the FDC will be written out
if the trace setting is changed from '00' to '01' in setup.
Additionally, if a command failure is detected on any
command, that specific comand and results are written
regardless of the trace setting.
The format of the line written is:
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>]
For example, this is the output of a normal read operation:
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK]
Please refer to the i8272 data sheet for information on the
command and result bytes.
Note that the sense interrupt command can return a non-OK
result. This is completely normal in some cases. It is
necessary to "poll" the drive for seek status using
sense interrupt. If there is nothing to report, then
the result will be INVALID COMMAND. Additionally,
during a recalibrate operation, it may be necessary to
issue the command twice because the command will only step
the drive 77 times looking for track 0, but the head may be
up to 80 tracks away. In this case, the first recalibrate
fails, but the second should succeed. Here is what this
would look like if trace is turned on:
RECALIBRATE: 07 01 --> <EMPTY> [OK]
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
...
...
...
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION]
RECALIBRATE: 07 01 --> <EMPTY> [OK]
SENSE INTERRUPT: 08 --> 21 00 [OK]
Another example is when the FDC has just been reset. In
this case, you will see up to 4 disk change errors. Again
these are not a real problem and to be expected.
When tracing is turned off, the application tries to be
intelligent about error reporting. The specific errors
from sense interrupt documented above will be suppressed
because they are not a real problem. All other
errors will be displayed.
Error Handling
--------------
There is no automated error retry logic. This is very
intentional since the point is to expose the controller
and drive activity. Any error detected will result in
a prompt to abort, retry, or continue. Note that some
number of errors is considered normal for this
technology. An occasional error would not necessarily
be considered a problem.
CPU Speed
---------
I distribute the binary version of the application optimized for
20MHz CPUs. There is a configuration variable called CPUFREQ
at the top of the source file. Ideally, you should build
with that set appropriately. However, I have found that the
default build setting of 20MHz seems to work for 4-20MHz CPUs.
Interleave
----------
The format command now allows the specification of a sector
interleave. It is almost always the case that the optimal
interleave will be 2 (meaning 2:1).
360K Media
----------
The 360K media definition should work well for true 360K
drives. However, it will generally not work
with 1.2M drives. This is because these drives spin at 360RPM
instead of the 300RPM speed of true 360K drives. Additionally,
1.2M drives are 80 tracks and 360K drives are 40 tracks and, so
far, there is no mechanism in FDTST to "double step" as a way
to use 40 track media in 80 track drives.
With this said, it is possible to configure some 1.2M 5.25" drives
to automatically spin down to 300RPM based on a density select
signal (DENSEL). This signal is asserted by FDTST for 360K
media, so IF you have configured your drive to react to this
signal correctly, you will be able to use the 360K media defintion.
Most 1.2M 5.25" drives are NOT configured this way by default.
TEAC drives are generally easy to modify and have been tested by
the author and do work in this manner. Note that this does not
address the issue of double stepping above; you will just be
using the first 40 of 80 tracks.
Support
-------
I am happy to answer questions as fast and well as I am able.
Best contact is wwarthen@gmail.com or post something on the
N8VEM Google Group https://groups.google.com/forum/#!forum/n8vem.
Changes
-------
WW 8/12/2011
Removed call to pulse TC in the FDC initialization
after determining that it periodically caused the FDC to write
bad sectors. I am mystified by this, but definitely found it
to be true. Will revisit at some point -- probably a timing
issue between puslsing TC and whatever happens next.
Non-DMA mode was being set incorrectly for FAST-DMA mode.
It was set for non-DMA even though we were doing DMA. It is
interesting that it worked fine anyway. Fixed it anyway.
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed.
WW 8/26/2011: v1.1
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are
not available on Zeta. Note that Zeta provides the ability
to perform a reset of the FDC independent of a full CPU
reset. This is VERY useful and the FDC is reset anytime
a drive reset is required.
Added INT/WAIT support.
WW 8/28/2011: V1.2
All changes in this version are Zeta specific. Fixed FDC reset
logic and motor status display for Zeta (code from Sergey).
Modified Zeta disk change display to include it in the
command output line. This makes more sense because a command
must be issued to select the desired drive first. You can
use the SENSE INT command id you want to check the disk
change value at any time. It will also be displayed with
any other command output display.
WW 9/1/2011: V1.3
Added CPUFREQ configuration setting to tune
delays based on cpu speed. The build app
is set for 8MHz which also seems to work well
for 4MHz CPU's. Faster CPU speeds will
probably require tuning this setting.
WW 9/5/2011: V1.4
Changed the polling execution routines to utilize CPUFREQ
variable to optimize timeout counter. Most importantly,
this should allow the use of faster CPUs (like 20MHz).
WW 9/19/2011: V1.5
Zeta changes only. Added a call to FDC RESET after any
command failure. This solves an issue where the drive
remains selected if a command error occurs. Also
added FDC RESET to FDC CONTROL menu.
WW 10/7/2011: V2.0
Added support for DIDE. Only supports polling IO and it
does not appear any other modes are possible given the
hardware constraints.
WW 10/13/2011: V2.1
Modified to support N8. N8 is essentially identical to
Dual IDE. The only real change is the IO addresses. In
theory, I should be able to support true DMA on N8 and
will work on that.
WW 10/20/2011: v2.2
I had some problems with the results being read were
sometimes missing a byte. Fixed this by taking a more
strict approach to watching the MSR for the exact
bits that are expected.
WW 10/22/2011: V2.3
After spending a few days trying to track down an
intermittent data corruption issue with my Dual IDE
board, I added a verify function. This helped
me isolate the problem very nicely (turned out to
be interference from the bus monitor).
WW 11/25/2011: V2.4
Preliminary support for DISKIO V3. Basically just
assumed that it operates just like the Zeta. Needs
to be verified with real hardware as soon as I can.
WW 1/9/2012: V2.5
Modified program termination to use CP/M reset
call so that a warm start is done and all
drives are logged out. This is important
because media may have been formatted during
the program execution.
WW 2/6/2012: v2.6
Added support for 5.25" drives as tested by
Sergio.
WW 4/5/2012: v2.7
Added support for 8" drives as tested by
Jim Harre.
WW 4/6/2012: v2.7a
Fixed issue with media selection menu to remove
duplicate entries.
WW 4/8/2012: v2.7b
Corrected the handling of the density select
signal.
WW 5/22/2012: v2.8
Added new media definitions (5.25", 320K)
WW 6/1/2012: v2.9
Added interleave capability on format
WW 6/5/2012: v3.0
Documentation cleanup
WW 7/1/2012: v3.1
Modified head load time (HLT) for 8" media based on
YD-180 spec. Now set to 50ms.

45
Doc/Contrib/LinuxBuild.txt

@ -1,45 +0,0 @@
Assembling the RomWBW firmware under Linux.
Note: Updated on 6/25/2013 to eliminate the need for the separate Linux
makefile. The standard makefile now has conditionals to allow it to be
used under Windows or Linux (I hope) --WW
This method has been used under Ubuntu Linux and may have to be adapted for
other distributions. It is a bit more involved than the Windows procedure.
What you need
You will need the TASM assembler, make, dos2unix and cpmtools.
The TASM assembler is shareware and the Linux version is only available as
source code from the Author. I found one bug during compiling version 3.2 for
Ubuntu. In /src/tasm.c change the reference CLK_TIC to CLOCKS_PER_SEC.
After compiling install the tasm executable to /usr/local/bin and the table
files to /usr/local/lib. If you choose to place them somewhere else you will
have to edit the "makefile.linux" file to suit.
The make, dos2unix and cpmtools packages are found in the Linux repository and
installed as for any other package.
Before assembly
Some changes need to be made to cater for the differences between Linux and the
DOS/Windows environments. The examples below refer to the /RomWBW/current
directory, you'll have to allow for the stable or branches directories if used.
These are all done from a terminal. (: is end of the command prompt)
1. Go to the RomWBW Source directory.e.g.
:cd /n8vem/RomWBW/current/Source
2. The Linux version of TASM can't handle the CR-LF line endings. So from the
command prompt use dos2unix to convert all the source files.
:~/RomWBW/current/Source dos2unix -f *.asm *.inc *.z80 *.lib diskdefs
3. You'll have to alter the disk definitions for the cpmtools package to cater
for the new roms. Easiest way is to copy the one given in the source over the
old. This must be done as superuser.
:~/RomWBW/current/Source sudo cp diskdefs /etc/cpmtools/diskdefs
4. From now on it's the same as using the DOS/Windows instructions in Build.txt.
Make any last changes, go to the Source directory and make
:~/RomWBW/current/Source make clean ; make
DGG

BIN
Doc/Contrib/Microsoft NASCOM BASIC.docx

Binary file not shown.

BIN
Doc/Contrib/SC126_How-To_No_1_Serial_Comms_Using_Minicom_v.1.1.pdf

Binary file not shown.

BIN
Doc/Contrib/SC126_How-To_No_2_Preparing_an_SD_Card_for_Use_with_SC126_v1.5.3.pdf

Binary file not shown.

BIN
Doc/Contrib/SC126_How-To_No_3_Updating_RomWBW_Using_a_Hybrid_SD_Card_v1.1.pdf

Binary file not shown.

19
Doc/Contrib/Z180 Clocking.txt

@ -1,19 +0,0 @@
The table below can be used to determine the correct value for CLKDIV AND CNTLB
in an Z180 (N8) configuration file. OSC Freq refers to the hardware clock
oscillator frequency you are using. You can then choose a CLKDIV value which
will result in the CPU speed (frequency) shown below the oscillator frequency.
Using your oscillator frequency (OSC) and chosen value for CLKDIV, you can
use the appropriate column to derive values to use for CNTLB for different
baud rates.
----- CLKDIV = 0 ----- ----- CLKDIV = 1 -----
OSC Freq (MHz) 6.144 12.288 18.432 6.144 12.288 18.432
CPU Freq (MHz) 3.072 6.144 9.216 6.144 12.288 18.432
1200 baud 04H 05H 24H 05H 06H 25H
2400 baud 03H 04H 23H 04H 05H 24H
4800 baud 02H 03H 22H 03H 04H 23H
9600 baud 01H 02H 21H 02H 03H 22H
19200 baud 00H 01H 20H 01H 02H 21H
38400 baud --- 00H --- 00H 01H 20H

2
Doc/Contrib/ZSystem.txt

@ -32,6 +32,8 @@ The remainder of this document details the changes I made as I went along. In a
6. Updated FILEATTR to v1.6A. Original FILEATTR.CFG was invalid. FILEATTR.CFG replaced with FA16.CFG. Added associated files FA16.DOC, FA16A.FOR, FA16CFG.TXT.
7. ZCAL patched to be Y2K compliant. Contributed by Nick Brok.
Usage Notes
-----------

564
Doc/DDTZ.doc

@ -0,0 +1,564 @@
DDTZ v2.7
by C.B. Falconer
edited by George A. Havach
Introduction:
============
DDTZ v2.7 is a complete replacement for DDT, Digital Research's
famous Dynamic Debugging Tool, with improved functionality, bug
extermination, and full Z80 support. In general, DDTZ is fully
compatible with the original utility, but it has extra and
extended commands and many fewer quirks. All Z80-specific
instructions can be (dis)assembled, though in Intel rather then
Zilog format. Furthermore, DDTZ will correctly trace ('T' and 'U'
commands) both 8080 and Z80 instructions, depending on which CPU
is operating. On startup, the program announces which CPU it is
running on.
DDTZ v2.7 now handles the 64180 added opcodes. It does NOT test
for a 64180 CPU, since this cannot be done without executing
illegal Z80 instructions, which in turn will crash some
simulators. However v2.7 does not execute any 64180 instructions
internally, only in the subject program.
This issue supplies the "M" version assembled, to avoid errors
when switching between MSDOS and CPM systems. The command table
is updated accordingly. Most CPM users are also MSDOS users, but
not vice-versa.
The program is invoked by typing
ddtz<ret>
or
ddtz [d:]filespec<ret>
In the second form, DDTZ will load the specified file into
memory starting at 0100H, unless it's a .HEX file that sets its
own load address. Besides reporting the NEXT free address and
the PC (program counter) after a successful load, DDTZ also shows
the number of memory pages needed for a SAVE. Instead of having
to write all this down, just use the 'X' command at any time to
redisplay these three values for the current application.
NOTE: loading more code above the NEXT pointer revises these
values.
As in DDT, when a program is loaded above the area holding the
'A' and 'U' (and now 'W') command code, these commands are
disabled, and the extra memory is released to the user. Thus,
DDTZ can occupy as little as 3K total memory space. Unlike DDT,
however, DDTZ will not overwrite itself or the system on program
loads (except .HEX files).
At initialization, the stack pointer (SP) points to a return to
DDTZ, just like for the CCP. Thus, programs that normally return
to the CCP will be returned to DDTZ. The 'B' command
reinitializes this condition.
The intercept vector copies the BDOS version number, etc., so
an object program does not know that DDTZ is running (except
for BIOS-BDOS vector size). Thus, programs that check the version
number should execute correctly under DDTZ.
All input parameters can now be entered in any of three formats:
(1) hexadecimal (as in DDT),
(2) decimal, by adding a leading '#' character,
(3) ASCII, by enclosing between either single or double
quotes; either one or two characters are allowed.
Leading blanks in command lines and parameters are absorbed.
Either a comma or a (single) space is a valid delimiter.
Either uppercase or lowercase input is accepted.
The default command (for anything not otherwise recognizable)
is 'H'. This allows convenient calculation, along with the other
features described below. So, to convert a number, just enter
it!
As in DDT, the prompt character is '-', and the only error
message is the query ('?'), which generally kicks you back to
command mode.
New Commands (Over DDT):
=======================
NOTE: letters in parenthesis, e.g. "(U)", show the equivalent
command for DDTZM version (compatible with MSDOS debug).
@ Sets or shows (with no parameter) the internally stored
"base" value. Also used with the 'S' and 'D' commands as
an optional parameter (though without the '@') to display
memory from an arbitrary base marker (offset). When set to
zero (the default), it does not affect any screen displays.
B B)egin: resets the USER stack pointer to its initial value,
such that any program that exits by an RET will return to
DDTZ. DDTZ provides a default stack space of
approximately 24 bytes for user programs.
C C)ompare first_address,last_address,against_address: shows
all the byte differences between two memory areas, in the
format
XXXX aa YYYY bb
where XXXX and YYYY are the comparative memory addresses,
and aa and bb are the corresponding byte values. Can be
used to verify the identity of two files by first
loading them into different memory areas with the 'R'
command (see below).
W Write: stores the modified memory area to disk under the
(K) filename specified by the 'I' command, overwriting the
original file from which it was loaded (the user is queried
before doing so). By default, the image of memory from
0100H through the "NEXT" value -1 is saved. "K first_addr,
last_address" overrides this and allows writing ANY memory
area to a file. Almost a necessity for CPM 3.0 (no SAVE!).
K)eep on DDTZ
X eXamine: redisplays the "NEXT PC SAVE" report at any time.
(Q) Q)uery size on DDTZ.
S S)earch first_address, last_addr, value: searches the
(W) specified memory area for the value (a 16-bit word, not a
byte) and shows the locations of all such. Very useful for
finding CALL's or JMP's to a particular address, etc.
W)here on DDTZ
Y Y)our_option parm1,parm2,address: executes an arbitrary
routine at the specified address, with the BC and DE
registers set to parm1 and parm2, respectively.
Z Displays (but does not alter) the Z80's alternate register
set, including the index registers (disabled if running on
an 8080). On Z80's, automatically included as the last
part of the display by the 'X' command.
Based (Offset) Displays:
=======================
The 'D' and 'E' commands can use a stored base value (offset),
as set by the '@' command. The current @ value may be
overridden for a single execution of these commands by adding the
base as an extra parameter in the command line. The effect is
to add this value to the first/last address and display
accordingly. The address listing on the left becomes XXXX:YYYY,
where XXXX is the offset address and YYYY is the actual memory
address being displayed. For example, if you have a data area
located at 42B7H and wish to preserve easy access, just enter
"@42b7". Now, "d0,3f" will dump memory starting at 4237H.
Further Changes from DDT:
========================
A A)ssemble now accepts the full Z80 as well as 8080
instruction set, although it expects them in Intel rather
than Zilog format (see notes below under the 'L'
command). When in doubt, see the mnemnonic list below.
D D)isplay or D)ump will accept an optional third parameter
to set the base value for a single execution only. Format
has been cleaned up.
H H)ex_arithmetic on two values also shows their
difference in decimal. With only one value, converts to
hexadecimal, decimal, and ASCII (low-order byte only).
N N)ame now allows drive specification (d:...) and sets up
(I) the complete command line, including both FCB's (at
addresses 005CH and 006CH). The tail (stored at 0081H up)
is NOT upshifted.
I)nput on DDTZ
U U)nassemble now displays the raw hexcode, especially handy
(L) when examining non-code areas. Intel (8080 style) mnemonics
are used, so some disassembled instructions may look
strange. E.g., the Z80's 'IN B,(C)' and 'OUT (C),B' become
'INP B' and 'OUTP B', respectively; 'LD (nnnn),BC' becomes
'SBCD nnnn', 'ADD IX, BC' becomes 'DADX B', and 'JP (IX)'
becomes 'PCIX'.
L)ist on DDTZ
L L)oad now permits loading a file into memory with an
(R) offset, which is added to the default load address of
0100H. When reading in a .HEX file with a preset bias,
the 'R' command will not transfer control to an invalid
execution point. Another execution of the 'R' command will
reread the input file, e.g.:
n blah<ret>
l<ret>
...modify the code and generally mess about...
l<ret>
The original file is reloaded, and the modifications are
removed.
R)ead on DDTZ
E E)nter, like D)isplay, now accepts an optional second
(S) parameter to set the base value for a single execution
only.
S)ubstitute or S)et on DDTZ
T T)rap/trace on termination now shows the complete CPU
state. Traps and traces no longer lock up when a user RST
7 instruction is executed. Tracing of BDOS/BIOS calls is
heavily trun cated, avoiding clutter and preventing system
crashes.
NOTE: Most of the UNDOCUMENTED Z80 op-codes are handled. Others
can crash the system.
R R)egisters also shows what two-byte values the HL and SP
(X) registers are actually pointing to. On Z80's, displays the
alternate register set.
eX)amine on DDTZ
NOTE: Any use of the 'W' or 'L' command resets the system DMA
transfer address to the standard default value of 0080H.
; This is the output of DDTZ when disassembling OPTYPE.TRY
NOP LDA 06A4 MOV M,H
LXI B,06A4 DCX SP MOV M,L
STAX B INR A HLT
INX B DCR A MOV M,A
INR B MVI A,20 MOV A,B
DCR B CMC MOV A,C
MVI B,20 MOV B,B MOV A,D
RLC MOV B,C MOV A,E
EXAF MOV B,D MOV A,H
DAD B MOV B,E MOV A,L
LDAX B MOV B,H MOV A,M
DCX B MOV B,L MOV A,A
INR C MOV B,M ADD B
DCR C MOV B,A ADD C
MVI C,20 MOV C,B ADD D
RRC MOV C,C ADD E
DJNZ 0134 MOV C,D ADD H
LXI D,06A4 MOV C,E ADD L
STAX D MOV C,H ADD M
INX D MOV C,L ADD A
INR D MOV C,M ADC B
DCR D MOV C,A ADC C
MVI D,20 MOV D,B ADC D
RAL MOV D,C ADC E
JR 0134 MOV D,D ADC H
DAD D MOV D,E ADC L
LDAX D MOV D,H ADC M
DCX D MOV D,L ADC A
INR E MOV D,M SUB B
DCR E MOV D,A SUB C
MVI E,20 MOV E,B SUB D
RAR MOV E,C SUB E
JRNZ 0134 MOV E,D SUB H
LXI H,06A4 MOV E,E SUB L
SHLD 06A4 MOV E,H SUB M
INX H MOV E,L SUB A
INR H MOV E,M SBB B
DCR H MOV E,A SBB C
MVI H,20 MOV H,B SBB D
DAA MOV H,C SBB E
JRZ 0134 MOV H,D SBB H
DAD H MOV H,E SBB L
LHLD 06A4 MOV H,H SBB M
DCX H MOV H,L SBB A
INR L MOV H,M ANA B
DCR L MOV H,A ANA C
MVI L,20 MOV L,B ANA D
CMA MOV L,C ANA E
JRNC 0134 MOV L,D ANA H
LXI SP,06A4 MOV L,E ANA L
STA 06A4 MOV L,H ANA M
INX SP MOV L,L ANA A
INR M MOV L,M XRA B
DCR M MOV L,A XRA C
MVI M,20 MOV M,B XRA D
STC MOV M,C XRA E
JRC 0134 MOV M,D XRA H
DAD SP MOV M,E XRA L
XRA M JPE 06A4 SLAR M
XRA A XCHG SLAR A
ORA B CPE 06A4 SRAR B
ORA C XRI 20 SRAR C
ORA D RST 5 SRAR D
ORA E RP SRAR E
ORA H POP PSW SRAR H
ORA L JP 06A4 SRAR L
ORA M DI SRAR M
ORA A CP 06A4 SRAR A
CMP B PUSH PSW SLLR B
CMP C ORI 20 SLLR C
CMP D RST 6 SLLR D
CMP E RM SLLR E
CMP H SPHL SLLR H
CMP L JM 06A4 SLLR L
CMP M EI SLLR M
CMP A CM 06A4 SLLR A
RNZ CPI 20 SRLR B
POP B RST 7 SRLR C
JNZ 06A4 RLCR B SRLR D
JMP 06A4 RLCR C SRLR E
CNZ 06A4 RLCR D SRLR H
PUSH B RLCR E SRLR L
ADI 20 RLCR H SRLR M
RST 0 RLCR L SRLR A
RZ RLCR M BIT 0,B
RET RLCR A BIT 0,C
JZ 06A4 RRCR B BIT 0,D
CZ 06A4 RRCR C BIT 0,E
CALL 06A4 RRCR D BIT 0,H
ACI 20 RRCR E BIT 0,L
RST 1 RRCR H BIT 0,M
RNC RRCR L BIT 0,A
POP D RRCR M BIT 1,B
JNC 06A4 RRCR A BIT 1,C
OUT 20 RALR B BIT 1,D
CNC 06A4 RALR C BIT 1,E
PUSH D RALR D BIT 1,H
SUI 20 RALR E BIT 1,L
RST 2 RALR H BIT 1,M
RC RALR L BIT 1,A
EXX RALR M BIT 2,B
JC 06A4 RALR A BIT 2,C
IN 20 RARR B BIT 2,D
CC 06A4 RARR C BIT 2,E
SBI 20 RARR D BIT 2,H
RST 3 RARR E BIT 2,L
RPO RARR H BIT 2,M
POP H RARR L BIT 2,A
JPO 06A4 RARR M BIT 3,B
XTHL RARR A BIT 3,C
CPO 06A4 SLAR B BIT 3,D
PUSH H SLAR C BIT 3,E
ANI 20 SLAR D BIT 3,H
RST 4 SLAR E BIT 3,L
RPE SLAR H BIT 3,M
PCHL SLAR L BIT 3,A
BIT 4,B RES 3,D SET 2,H
BIT 4,C RES 3,E SET 2,L
BIT 4,D RES 3,H SET 2,M
BIT 4,E RES 3,L SET 2,A
BIT 4,H RES 3,M SET 3,B
BIT 4,L RES 3,A SET 3,C
BIT 4,M RES 4,B SET 3,D
BIT 4,A RES 4,C SET 3,E
BIT 5,B RES 4,D SET 3,H
BIT 5,C RES 4,E SET 3,L
BIT 5,D RES 4,H SET 3,M
BIT 5,E RES 4,L SET 3,A
BIT 5,H RES 4,M SET 4,B
BIT 5,L RES 4,A SET 4,C
BIT 5,M RES 5,B SET 4,D
BIT 5,A RES 5,C SET 4,E
BIT 6,B RES 5,D SET 4,H
BIT 6,C RES 5,E SET 4,L
BIT 6,D RES 5,H SET 4,M
BIT 6,E RES 5,L SET 4,A
BIT 6,H RES 5,M SET 5,B
BIT 6,L RES 5,A SET 5,C
BIT 6,M RES 6,B SET 5,D
BIT 6,A RES 6,C SET 5,E
BIT 7,B RES 6,D SET 5,H
BIT 7,C RES 6,E SET 5,L
BIT 7,D RES 6,H SET 5,M
BIT 7,E RES 6,L SET 5,A
BIT 7,H RES 6,M SET 6,B
BIT 7,L RES 6,A SET 6,C
BIT 7,M RES 7,B SET 6,D
BIT 7,A RES 7,C SET 6,E
RES 0,B RES 7,D SET 6,H
RES 0,C RES 7,E SET 6,L
RES 0,D RES 7,H SET 6,M
RES 0,E RES 7,L SET 6,A
RES 0,H RES 7,M SET 7,B
RES 0,L RES 7,A SET 7,C
RES 0,M SET 0,B SET 7,D
RES 0,A SET 0,C SET 7,E
RES 1,B SET 0,D SET 7,H
RES 1,C SET 0,E SET 7,L
RES 1,D SET 0,H SET 7,M
RES 1,E SET 0,L SET 7,A
RES 1,H SET 0,M DADX B
RES 1,L SET 0,A DADX D
RES 1,M SET 1,B LXI X,06A4
RES 1,A SET 1,C SIXD 06A4
RES 2,B SET 1,D INX X
RES 2,C SET 1,E DADX X
RES 2,D SET 1,H LIXD 06A4
RES 2,E SET 1,L DCX X
RES 2,H SET 1,M INR [X+05]
RES 2,L SET 1,A DCR [X+05]
RES 2,M SET 2,B MVI [X+05],20
RES 2,A SET 2,C DADX SP
RES 3,B SET 2,D MOV B,[X+05]
RES 3,C SET 2,E MOV C,[X+05]
MOV D,[X+05] DSBC B DADY B
MOV E,[X+05] SBCD 06A4 DADY D
MOV H,[X+05] NEG LXI Y,06A4
MOV L,[X+05] RETN SIYD 06A4
MOV [X+05],B IM0 INX Y
MOV [X+05],C LDIA DADY Y
MOV [X+05],D INP C LIYD 06A4
MOV [X+05],E OUTP C DCX Y
MOV [X+05],H DADC B INR [Y+05]
MOV [X+05],L LBCD 06A4 DCR [Y+05]
MOV [X+05],A RETI MVI [Y+05],2
MOV A,[X+05] LDRA DADY SP
ADD [X+05] INP D MOV B,[Y+05]
ADC [X+05] OUTP D MOV C,[Y+05]
SUB [X+05] DSBC D MOV D,[Y+05]
SBB [X+05] SDED 06A4 MOV E,[Y+05]
ANA [X+05] IM1 MOV H,[Y+05]
XRA [X+05] LDAI MOV L,[Y+05]
ORA [X+05] INP E MOV [Y+05],B
CMP [X+05] OUTP E MOV [Y+05],C
POP X DADC D MOV [Y+05],D
XTIX LDED 06A4 MOV [Y+05],E
PUSH X IM2 MOV [Y+05],H
PCIX LDAR MOV [Y+05],L
SPIX INP H MOV [Y+05],A
RLCR [X+05] OUTP H MOV A,[Y+05]
RRCR [X+05] DSBC H ADD [Y+05]
RALR [X+05] shld 06A4 ADC [Y+05]
RARR [X+05] RRD SUB [Y+05]
SLAR [X+05] INP L SBB [Y+05]
SRAR [X+05] OUTP L ANA [Y+05]
SRLR [X+05] DADC H XRA [Y+05]
BIT 0,[X+05] lhld 06A4 ORA [Y+05]
BIT 1,[X+05] RLD CMP [Y+05]
BIT 2,[X+05] INP M POP Y
BIT 3,[X+05] OUTP M XTIY
BIT 4,[X+05] DSBC SP PUSH Y
BIT 5,[X+05] SSPD 06A4 PCIY
BIT 6,[X+05] INP A SPIY
BIT 7,[X+05] OUTP A RLCR [Y+05]
RES 0,[X+05] DADC SP RRCR [Y+05]
RES 1,[X+05] LSPD 06A4 RALR [Y+05]
RES 2,[X+05] LDI RARR [Y+05]
RES 3,[X+05] CCI SLAR [Y+05]
RES 4,[X+05] INI SRAR [Y+05]
RES 5,[X+05] OTI SRLR [Y+05]
RES 6,[X+05] LDD BIT 0,[Y+05]
RES 7,[X+05] CCD BIT 1,[Y+05]
SET 0,[X+05] IND BIT 2,[Y+05]
SET 1,[X+05] OTD BIT 3,[Y+05]
SET 2,[X+05] LDIR BIT 4,[Y+05]
SET 3,[X+05] CCIR BIT 5,[Y+05]
SET 4,[X+05] INIR BIT 6,[Y+05]
SET 5,[X+05] OTIR BIT 7,[Y+05]
SET 6,[X+05] LDDR RES 0,[Y+05]
SET 7,[X+05] CCDR RES 1,[Y+05]
INP B INDR RES 2,[Y+05]
OUTP B OTDR RES 3,[Y+05]
RES 4,[Y+05] SET 0,[Y+05] SET 4,[Y+05]
RES 5,[Y+05] SET 1,[Y+05] SET 5,[Y+05]
RES 6,[Y+05] SET 2,[Y+05] SET 6,[Y+05]
RES 7,[Y+05] SET 3,[Y+05] SET 7,[Y+05]
; These are the result of disassembling 64180OPS.TRY
; These opcodes are available ONLY on the 64180 CPU
; DDTZ will both assemble and disassemble these.
IN0 B,20 TST E MLT B
OUT0 20,B IN0 H,20 MLT D
TST B OUT0 20,H TSTI 20
IN0 C,20 TST H MLT H
OUT0 20,C IN0 L,20 TSIO 20
TST C OUT0 20,L SLP
IN0 D,20 TST L MLT SP
OUT0 20,D TST M OTIM
TST D IN0 A,20 OTDM
IN0 E,20 OUT0 20,A OIMR
OUT0 20,E TST A ODMR
; The following are UNDOCUMENTED z80 opcodes from XTDOPS.TRY.
; DDTZ will disassemble these, but will not assemble them.
; They use xh/xl (or yh/yl) as separate byte registers.
; Use these at your own risk.
INRX H ACXR H MOVY H,B
DCRX H ACXR L MOVY H,C
MVIX H,20 SUXR H MOVY H,D
INRX L SUXR L MOVY H,E
DCRX L SBXR H MOVY H,A
MVIX L,20 SBXR L MOVY L,B
MOVX B,H NDXR H MOVY L,C
MOVX B,L NDXR L MOVY L,D
MOVX C,H XRXR H MOVY L,E
MOVX C,L XRXR L MOVY L,A
MOVX D,H ORXR H MOVY A,H
MOVX D,L ORXR L MOVY A,L
MOVX E,H CPXR H ADYR H
MOVX E,L CPXR L ADYR L
MOVX H,B INRY H ACYR H
MOVX H,C DCRY H ACYR L
MOVX H,D MVIY H,20 SUYR H
MOVX H,E INRY L SUYR L
MOVX H,A DCRY L SBYR H
MOVX L,B MVIY L,20 SBYR L
MOVX L,C MOVY B,H NDYR H
MOVX L,D MOVY B,L NDYR L
MOVX L,E MOVY C,H XRYR H
MOVX L,A MOVY C,L XRYR L
MOVX A,H MOVY D,H ORYR H
MOVX A,L MOVY D,L ORYR L
ADXR H MOVY E,H CPYR H
ADXR L MOVY E,L CPYR L
Command Summary:
===============
DDTZM command DDTZ command
============= ============
@ (base)
A)ssemble first_address A
B)egin {i.e., initialize stack and return} B
C)ompare first_address,last_address,against_address C
D)ump first_address[,last_address[,base]] D
E)nter_in_memory first_address[,base] S)ubstitute
F)ill first_address,last_address,value F
G)o_to [address][,trap1[,trap2]] G
H)ex_arithmetic value1(,value2) H
L)oad_file (offset) R)ead
M)ove first_address,last_address,destination M
N)nput FCBs_command_line I)nput
Q)uit (not avail)
R)egister examine/change [register|flag] X)amine
S)earch first_address,last_address,word W)hereis
T)race_execution [count] T
Untrace_execution [count] (i.e. do count instr) U)ntrace
U)nassemble_code first_address[,last_address] L)ist code
W)rite [first_address,last_address] K)eep
X)amine {i.e. display memory parameters for application} Q)uery
Y)our_option BC:=parm1,DE:=parm2,call_address Y
Z)80_register_display Z
If you find this program useful, contributions will be gratefully
accepted and will encourage further development and release of
useful CPM programs. My practice is to include source.
C.B. Falconer
680 Hartford Turnpike,
Hamden, Conn. 06517 (203) 281-1438
DDTZ and its associated documentation and other files are
copyright (c) 1980-1988 by C.B. Falconer. They may be freely
copied and used for non-commercial purposes ONLY.
ôÙ

13
Doc/FDU.txt

@ -1,9 +1,9 @@
================================================================
Floppy Disk Utility (FDU) v5.3 for RetroBrew Computers
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80 / Dyno
================================================================
Updated September 5, 2018
Updated January 5, 2020
by Wayne Warthen (wwarthen@gmail.com)
Application to test the hardware functionality of the Floppy
@ -77,6 +77,7 @@ supported:
- RC2014 w/ SMC
- RC2014 w/ WDC
- SmallZ80
- Dyno
You must be using either a RomWBW or UBA based OS version.
@ -95,7 +96,7 @@ Finally, you will need a floppy drive connected via an
appropriate cable:
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive
DISK IO 3, Zeta, Zeta 2, RC2014 - cable with twist, unit 0 after twist, unit 1 before twist
DISK IO 3, Zeta, Zeta 2, RC2014, Dyno - cable with twist, unit 0 after twist, unit 1 before twist
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist
Note that FDU does not utilize your systems ROM or OS to
@ -154,6 +155,9 @@ JP2 (TC): 2-3.
SmallZ80 does not have any relevant jumper settings. The
hardwired I/O ranges are assumed in the code.
Dyno does not have any relevant jumper settings. The
hardwired I/O ranges are assumed in the code.
Modes of Operation
------------------
@ -505,3 +509,6 @@ WW 9/5/2018: v5.3
condition is no longer considered an error, but a successful end of
operation.
- Added support for SmallZ80
WW 5/1/2020: v5.4
- Added support for Dyno (based on work by Steve Garcia)

BIN
Doc/Hard Disk Anatomy.pdf

Binary file not shown.

BIN
Doc/NZCOM Users Manual.pdf

Binary file not shown.

63
Doc/ReadMe.txt

@ -10,31 +10,84 @@ This directory ("Doc") is part of the RomWBW System Software
distribution archive. It contains documentation for components of
the system.
CPM Manual:
CPM Manual ("CPM Manual.pdf")
-----------------------------
The original DRI CP/M 2.x Operating System Manual. This should be
considered the primary reference for system operation. The section
on CP/M 2 Alteration can be ignored since this work has already been
completed as part of the RomWBW distribution.
FDisk Manual:
CPM3 Command Summary ("CPM3 Command Summary.pdf")
CPM3 Programmer's Guide ("CPM3 Programmers Guide.pdf")
CPM3 System Guide ("CPM3 System Guide.pdf")
CPM3 User's Guide ("CPM3 Users Guide.pdf")
------------------------------------------------------
The original DRI CP/M 3.0 Operating System Documentation Set. This
should be considered the primary reference for CP/M 3 system operation.
DDTZ Manual ("DDTZ.doc")
------------------------
Manual for the DDTZ v2.7 debug tool included on the ROM drive.
FDisk Manual ("FDisk Manual.pdf")
---------------------------------
The operational manual for John Coffman's hard disk partitioning
program. This program is included in RomWBW as FDISK80.
RomWBW Architecture:
Floppy Disk Utility Documentation ("FDU.tst")
---------------------------------------------
Operational documentation for the RomWBW FDU application.
Hard Disk Anatomy ("Hard Disk Anatomy.pdf")
-------------------------------------------
Diagram of a CP/M & MS-DOS (FAT) hybrid hard disk layout.
NZCOM User's Manual ("NZCOM Users Manual.pdf")
----------------------------------------------
NZCOM operating system operation manual.
RomWBW Architecture ("RomWBW Architecture.pdf")
-----------------------------------------------
Document describing the architecture of the RomWBW HBIOS. It
includes reference information for the HBIOS calls.
ZCPR Manual:
Z180 ASCI Baud Rate Options ("Z180 ASCI Baud Rate Options.pdf")
---------------------------------------------------------------
The Z180 processor's ASCI serial ports have a limited set of
baud rate divisors. These divisors are relative to the CPU
clock rate. This document provides a list of the possible
baud rates for typical CPU clock rates.
ZCPR Manual ("ZCPR Manual.pdf")
-------------------------------
ZCPR is the command proccessor portion of Z-System. This is the
manual for ZCPR 1.x as included in RomWBW. The installation
instructions can be ignored since that work has already been
completed as part of the RomWBW distribution.
ZSDOS Manual:
ZSDOS Manual ("ZSDOS Manual.pdf")
---------------------------------
ZSDOS is the DOS portion of Z-System. This is the manual fo ZSDOS
1.x as included in RomWBW. The installation instructions can be

BIN
Doc/RomWBW Applications.pdf

Binary file not shown.

BIN
Doc/RomWBW Architecture.pdf

Binary file not shown.

BIN
Doc/RomWBW Getting Started.pdf

Binary file not shown.

BIN
Doc/Z180 ASCI Baud Rate Options.pdf

Binary file not shown.

BIN
Doc/ZCPR Manual.pdf

Binary file not shown.

19
Makefile

@ -0,0 +1,19 @@
all:
$(MAKE) --directory Tools/unix
$(MAKE) --directory Source
$(MAKE) --directory Source/Images
clean:
$(MAKE) --directory Tools/unix clean
$(MAKE) --directory Source clean
$(MAKE) --directory Binary clean
clobber:
$(MAKE) --directory Tools/unix clobber
$(MAKE) --directory Source clobber
$(MAKE) --directory Binary clobber
rm -f typescript
diff:
$(MAKE) --directory diff

1167
ReadMe.md

File diff suppressed because it is too large

1370
ReadMe.txt

File diff suppressed because it is too large

75
Readme.unix

@ -0,0 +1,75 @@
This tree now contains makefiles and tools to build on Linux and
MacosX Linux is rather more thoroughly tested compared to os-x.
To get here, TASM and the propeller generation tools needed to be
replaced, and since the unix filesystem is usually case-sensitive,
and CP/M and windows are not, the cpm tools were made case-insensitive.
TASM was replaced with uz80as, which implements a subset of TASM and
fixes some bugs. however, I needed to add some functionality to make
it build the sources as they exist in this tree. in particular, one
thing to be very careful of is that TASM is not entirely consistent
with respect to the .DS directive. it's usually a bad idea to mix
.DS, .FILL, .DB with .ORG.
.DS n is best thought of as .ORG $ + n
.ORG changes the memory pointer, but does not change the file
output point. It works a lot more like M80, SLR* .PHASE
It assumes that you have some standard system tools and libraries
installed specifically: gcc, gnu make, libncurses
To build:
cd to the top directory and type "make".
By default, this will generate all of the standard configurations of
RomWBW for all platforms. If you want to customize the process to
only build one (or a subset) of the configurations, edit the "makefile"
in the HBIOS directory. If you create your own, custom configuration,
you can add it there as well.
For MacOS users, you may encounter a failure reading or writing files.
This is caused by protection features in MacOS (at least, in Catalina)
that prevent programs built on your local system (unsigned) from
running. To disable this feature:
1) Make sure you exit System Preferences.
2) Open a terminal session and type the following. You will need to
authenticate with an admin account. sudo spctl --master-disable
3) Exit terminal
4) Go into System Preferences and choose Security and Privacy
5) Select the General tab if it isn't already selected
6) You should now see a third selection under
"Allow apps downloaded from:" of Anywhere - select this.
7) Now you can run the build successfully.
DISCLAIMER: You do this at your own risk. I highly recommend that you
return the settings back to normal immediately after doing a build.
Heavy use is made of make's include facility and pattern rules. the
master rule set is in Tools/Makefile.inc. changes here will affect
almost every Makefile, and where exceptions are needed, the overrides
are applied in the lower Makefiles.
These tools can run a windows-linux regression test, where all the
binaries are compared to a baseline windows build.
Credit:
uz80as was written by Jorge Giner Cordero, jorge.giner@hotmail.com,
and the original source can be found at https://github.com/jorgicor/uz80as
the propeller tools use bstc and openspin, parallax tools from
http://www.fnarfbargle.com/bst.html https://github.com/parallaxinc/OpenSpin
note that bst is not open source or even currently maintained, so I could
not generate a version for 64 bit osx.
cpmtools were the most current I could find, and it has been hacked to do
case-insensitivity. these are not marked, and are not extensive.
zx is from distributed version, and also has local hacks for case insensitivity.
both zx and cpmtools ship with an overly complicated makefile generation system
and this is ignored.
This whole linux build framework is the work of Curt Mayer, curt@zen-room.org.
use it for whatever you like; this is not my day job.

233
Source/Apps/Assign.asm

@ -20,6 +20,9 @@
; Change Log:
; 2016-03-21 [WBW] Updated for HBIOS 2.8
; 2016-04-08 [WBW] Determine key memory addresses dynamically
; 2019-08-07 [WBW] Fixed DPB selection error
; 2019-11-17 [WBW] Added preliminary CP/M 3 support
; 2019-12-24 [WBW] Fixed location of BIOS save area
;_______________________________________________________________________________
;
; ToDo:
@ -38,14 +41,27 @@ bdos .equ $0005 ; BDOS invocation vector
;
stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp
;
rmj .equ 2 ; CBIOS version - major
rmn .equ 9 ; CBIOS version - minor
rmj .equ 3 ; CBIOS version - major
rmn .equ 1 ; CBIOS version - minor
;
;===============================================================================
; Code Section
;===============================================================================
;
.org $100
;
; relocate to high memory
ld hl,image
ld de,$8000
ld bc,modsize
ldir
jp start
;
image .equ $
;
.org $8000
;
start:
;
; setup stack (save old value)
ld (stksav),sp ; save stack
@ -83,6 +99,13 @@ init:
ld de,-3 ; adjustment for start of table
add hl,de ; HL now has start of table
ld (bioloc),hl ; save it
;
; get CP/M version and save it
ld c,$0C ; function number
call bdos ; do it, HL := version
ld (cpmver),hl ; save it
ld a,l ; low byte
cp $30 ; CP/M 3.0?
;
; get location of config data and verify integrity
ld hl,stamp ; HL := adr or RomWBW zero page stamp
@ -122,6 +145,11 @@ init:
inc hl ; ... into DE to get
ld d,(hl) ; ... DPB map pointer
ld (dpbloc),de ; and save it
;
; test for CP/M 3 and branch if so
ld a,(cpmver) ; low byte of cpm version
cp $30 ; CP/M 3.0?
jp nc,initcpm3 ; handle CP/M 3.0 or greater
;
; make a local working copy of the drive map
ld hl,(maploc) ; copy from CBIOS drive map
@ -192,6 +220,66 @@ initx:
xor a ; signal success
ret ; return
;
; CP/M 3 initialization
;
initcpm3:
ld hl,(bioloc)
ld de,22*3 ; offset of DRVTBL func
add hl,de ; HL := DRVTBL func
call jphl ; do it, HL := DRVTBL adr
ld (drvtbl),hl ; save it
;
; switch to sysbnk
ld hl,(bioloc)
ld de,27*3 ; offset of SELMEM func
add hl,de ; HL := SELMEM func
ld a,0 ; bank 0 is system bank
call jphl
;
; copy CP/M 3 drvtbl to drvmap working copy
ld hl,(drvtbl) ; get drive table in HL
ld de,mapwrk ; DE := working drive map
ld b,16
initc2:
push hl ; save drvtbl entry adr
ld a,(hl) ; deref HL to get DPH adr
inc hl ; ...
ld h,(hl) ; ...
ld l,a ; ...
ld a,l ; check for
or h ; ... zero
jr nz,initc3 ; if not zero, copy entry
inc de ; ... else bump past unit field
jr initc4 ; ... and continue without copying
initc3:
dec hl ; back up to
dec hl ; ... unit
ld a,(hl) ; get unit from drvtbl
ld (de),a ; save unit to drvmap
inc hl ; bump to slice
inc de ; bump to slice
ld a,(hl) ; get slice from drvtbl
ld (de),a ; save slice to drvmap
initc4:
inc de ; bump past slice
inc de ; skip
inc de ; ... dph
pop hl ; back to drvtbl entry
inc hl ; bump to
inc hl ; ... next drvtbl entry
djnz initc2
;
; switch back to tpabnk
ld hl,(bioloc)
ld de,27*3 ; offset of SELMEM func
add hl,de ; HL := SELMEM func
ld a,1 ; bank 1 is tpa bank
call jphl
;
; return success
xor a ; signal success
ret ; return
;
; Process command line
;
process:
@ -373,9 +461,13 @@ devlstu1:
; Install the new drive map into CBIOS
;
install:
ld a,(cpmver) ; low byte of CP/M version
cp $30 ; CP/M 3.0?
jp nc,instcpm3 ; handle CP/M 3.0 or greater
;
; capture CBIOS snapshot and stack frame for error recovery
ld hl,(bioloc) ; start of CBIOS
ld de,$8000 ; save it here
ld de,$1000 ; save it here
ld bc,(biosiz) ; size of CBIOS
ldir ; save it
ld (xstksav),sp ; save stack frame
@ -529,15 +621,21 @@ makdphuna1: ; handle ram/rom
ld e,2 ; otherwise, must be ram drive
jr makdph0 ; continue
;
makdphwbw: ; determine appropriate dpb (WBW mode)
makdphwbw: ; determine appropriate dpb (WBW mode, unit number in A)
;
ld c,a ; unit number to C
ld b,$17 ; HBIOS: Report Device Info
rst 08 ; call HBIOS, return w/ device type in D, physical unit in E
ld a,d ; device type to A
cp $00 ; ram/rom?
jr nz,makdph00 ; if not, skip ahead to other types
ld a,e ; physical unit number to A
ld e,1 ; assume rom
cp $00+0 ; rom?
jr z,makdph0 ; yes, jump ahead
ld e,2 ; assume ram
cp $00+1 ; ram?
cp $00 ; rom?
jr z,makdph0 ; yes, jump ahead
and $F0 ; ignore unit nibble now
ld e,2 ; otherwise ram
jr makdph0 ; jump ahead
makdph00:
ld e,6 ; assume floppy
cp $10 ; floppy?
jr z,makdph0 ; yes, jump ahead
@ -580,27 +678,7 @@ makdph1:
dec de ; ... prefix data (cks & als buf sizes)
call makdph2 ; handle cks buf, then fall thru for als buf
ret nz ; bail out on error
;makdph2:
; ex de,hl ; point hl to cks/als size adr
; ld c,(hl) ; bc := cks/als size
; inc hl ; ... and bump
; ld b,(hl) ; ... past
; inc hl ; ... cks/als size
; ex de,hl ; bc and hl roles restored
; ld a,b ; check to see
; or c ; ... if bc is zero
; jr z,makdph3 ; if zero, bypass alloc, use zero for address
; call alloc ; alloc bc bytes, address returned in bc
; jp nz,instovf ; handle overflow error
;makdph3:
; ld (hl),c ; save cks/als buf
; inc hl ; ... address in
; ld (hl),b ; ... dph and bump
; inc hl ; ... to next dph entry
; xor a ; signal success
; ret
;
makdph2:
; DE = address of CKS or ALS buf to allocate
; HL = address of field in DPH to get allocated address
@ -638,12 +716,96 @@ makdph3:
xor a ; signal success
ret
;
;
;
instcpm3:
;
; switch to sysbnk
ld hl,(bioloc)
ld de,27*3 ; offset of SELMEM func
add hl,de ; HL := SELMEM func
ld a,0 ; bank 0 is system bank
call jphl
;
; copy drvmap working copy to CP/M 3 drvtbl
ld hl,(drvtbl) ; get drvtbl address
ld a,(hl) ; deref HL to get DPH0 adr
inc hl ; ...
ld h,(hl) ; ...
ld l,a ; ...
ld (dphadr),hl ; save starting dphadr
ld hl,(drvtbl) ; get drive table in HL
ld de,mapwrk ; DE := working drive map
ld b,16
instc1:
ld a,(de) ; get unit field of mapwrk
inc a ; test for $FF
jr nz,instc2 ; if used, do copy
xor a ; zero accum
ld (hl),a ; zero lsb of drvtbl entry adr
inc hl ; move to msb
ld (hl),a ; zero msb of drvtbl entry adr
inc hl ; bump to start of next drvtbl entry
inc de ; bump to next mapwrk entry
inc de ; ...
inc de ; ...
inc de ; ...
jr instc3 ; resume loop without copy
;
instc2:
push hl ; save drvtbl entry adr
push de ; save mapwrk entry adr
ld de,(dphadr) ; get cur dph adr
ld (hl),e ; save dph adr to drvtbl
inc hl ; ...
ld (hl),d ; ...
ex de,hl ; dph adr to HL
pop de ; restore mapwrk entry adr
dec hl ; backup to unit
dec hl ; ...
ld a,(de) ; get unit from mapwrk
ld (hl),a ; put unit into DPH field
inc de ; bump to slice field of mapwrk
inc hl ; bump to slice field of DPH field
ld a,(de) ; get slice from mapwrk
ld (hl),a ; put slice into DPH field
inc de ; bump to next mapwrk entry
inc de ; ...
inc de ; ...
pop hl ; back to drvtbl entry
inc hl ; bump to
inc hl ; ... next drvtbl entry
instc3:
push hl ; save drvtbl entry adr
push de ; save mapwrk entry adr
ld hl,(dphadr) ; get cur dph address
ld de,$23 ; size of xdph
add hl,de ; bump to next dph
ld (dphadr),hl ; save it
pop de ; recover mapwrk entry adr
pop hl ; recover drvtbl entry adr
djnz instc1
;
; switch back to tpabnk
ld hl,(bioloc)
ld de,27*3 ; offset of SELMEM func
add hl,de ; HL := SELMEM func
ld a,1 ; bank 1 is tpa bank
call jphl
;
call drvrst ; perform BDOS drive reset
;
xor a ; signal success
ret
;
; Handle overflow error in installation
;
instovf:
; restore stack frame and CBIOS image
ld sp,(xstksav) ; restore stack frame
ld hl,$8000 ; start of CBIOS image buffer
ld hl,$1000 ; start of CBIOS image buffer
ld de,(bioloc) ; start of CBIOS
ld bc,(biosiz) ; size of CBIOS
ldir ; restore it
@ -1636,6 +1798,9 @@ bioend .dw 0 ; CBIOS ending address
biosiz .dw 0 ; CBIOS size (in bytes)
maploc .dw 0 ; location of CBIOS drive map table
dpbloc .dw 0 ; location of CBIOS DPB map table
cpmver .dw 0 ; CP/M version
drvtbl .dw 0 ; CP/M 3 drive table address
dphadr .dw 0 ; CP/M 3 working value for DPH
;
drives:
dstdrv .db 0 ; destination drive
@ -1701,10 +1866,10 @@ stack .equ $ ; stack top
; Messages
;
indent .db " ",0
msgban1 .db "ASSIGN v1.0c for RomWBW CP/M 2.2, 21-Apr-2016",0
msgban1 .db "ASSIGN v1.1a for RomWBW CP/M, 24-Dec-2019",0
msghb .db " (HBIOS Mode)",0
msgub .db " (UBIOS Mode)",0
msgban2 .db "Copyright 2016, Wayne Warthen, GNU GPL v3",0
msgban2 .db "Copyright 2019, Wayne Warthen, GNU GPL v3",0
msguse .db "Usage: ASSIGN D:[=[{D:|<device>[<unitnum>]:[<slicenum>]}]][,...]",13,10
.db " ex. ASSIGN (display all active assignments)",13,10
.db " ASSIGN /? (display version and usage)",13,10
@ -1728,5 +1893,7 @@ msgint .db "Multiple drive letters reference one filesystem, aborting!",0
msgnoa .db "Drive A: is unassigned, aborting!",0
msgdos .db "DOS error, return code=0x",0
msgmem .db " Disk Buffer Bytes Free",0
;
modsize .equ $ - start
;
.end

2
Source/Apps/Build.cmd

@ -16,7 +16,6 @@ call :asm SysCopy || goto :eof
call :asm Assign || goto :eof
call :asm Format || goto :eof
call :asm Talk || goto :eof
call :asm OSLdr || goto :eof
call :asm Mode || goto :eof
call :asm RTC || goto :eof
call :asm Timer || goto :eof
@ -30,6 +29,7 @@ zx MLOAD25 -SURVEY.COM=SURVEY.HEX
setlocal & cd XM && call Build || exit /b 1 & endlocal
setlocal & cd FDU && call Build || exit /b 1 & endlocal
setlocal & cd Tune && call Build || exit /b 1 & endlocal
setlocal & cd FAT && call Build || exit /b 1 & endlocal
copy *.com %APPBIN%\

1
Source/Apps/Clean.cmd

@ -10,3 +10,4 @@ if exist *.prn del *.prn
setlocal & cd XM && call Clean || exit /b 1 & endlocal
setlocal & cd FDU && call Clean || exit /b 1 & endlocal
setlocal & cd Tune && call Clean || exit /b 1 & endlocal
setlocal & cd FAT && call Clean || exit /b 1 & endlocal

7
Source/Apps/FAT/Build.cmd

@ -0,0 +1,7 @@
@echo off
setlocal
REM FAT.com is currently distributed as a binary application, so
REM it is not built here.
copy /Y FAT.com ..\..\..\Binary\Apps\

5
Source/Apps/FAT/Clean.cmd

@ -0,0 +1,5 @@
@echo off
setlocal
REM FAT.com is currently distributed as a binary application, so
REM we do not delete the .COM file.

BIN
Source/Apps/FAT/FAT.com

Binary file not shown.

674
Source/Apps/FAT/LICENSE.txt

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

6
Source/Apps/FAT/Makefile

@ -0,0 +1,6 @@
OBJECTS = FAT.com
NODELETE = FAT.com
DEST = ../../../Binary/Apps
TOOLS=../../../Tools
include $(TOOLS)/Makefile.inc

101
Source/Apps/FAT/ReadMe.txt

@ -0,0 +1,101 @@
RomWBW HBIOS CP/M FAT Utility ("FAT.COM")
Author: Wayne Warthen
Updated: 11-Oct-2019
Application to manipulate and exchange files with a FAT (DOS)
filesystem. Runs on any HBIOS hosted CP/M implementation.
USAGE:
FAT DIR <path>
FAT COPY <src> <dst>
FAT REN <from> <to>
FAT DEL <path>[<file>|<dir>]
FAT MD <path>
FAT FORMAT <drv>
CP/M filespec: <d>:FILENAME.EXT (<d> is CP/M drive letter A-P)
FAT filespec: <u>:/DIR/FILENAME.EXT (<u> is disk unit #)
LICENSE:
GNU GPLv3 (see file LICENSE.txt)
NOTES:
- Partitioned or non-partitioned media is handled automatically.
A floppy drive is a good example of a non-partitioned FAT
filesystem and will be recognized. Larger media will typically
have a partition table which will be recognized by the
application to find the FAT filesystem.
- Although RomWBW-style CP/M media does not know anything about
partition tables, it is entirely possible to have media that
has both CP/M and FAT file systems on it. This is accomplished
by creating a FAT filesystem on the media that starts on a track
beyond the last track used by CP/M. Each CP/M slice on a
media will occupy a little over 8MB. So, make sure to start
your FAT partition beyond (slice count) * 8MB.
- The application infers whether you are attempting to reference
a FAT or CP/M filesystem via the drive specifier (char before ':').
A numeric drive character specifies the HBIOS disk unit number
for FAT access. An alpha (A-P) character indicates a CP/M
file system access targeting the specified drive letter. If there
is no drive character specified, the current CP/M filesystem and
current CP/M drive is assumed. For example:
"2:README.TXT" refers to FAT file README.TXT on disk unit #2
"C:README.TXT" refers to CP/M file README.TXT on CP/M drive C
"README.TXT" refers to CP/M file README.TXT on current CP/M drive
- Files with SYS, HIDDEN, or R/O only attributes are not given
any special treatment. Such files are found and processed
like any other file. However, any attempt to write to a
read-only file will fail and the application will abort.
- It is not currently possible to reference CP/M user areas other
than the current user. To copy files to alternate user areas,
you must switch to the desired user number first or use an
additional step to copy the file to the desired user area.
- Accessing FAT filesystems on a floppy requires the use of
RomWBW HBIOS v2.9.1-pre.13 or greater.
- Files written are not verified.
- Wildcard matching in FAT filesystems is a bit unusual as
implemented by FatFs. See FatFs documentation.
BUILD NOTES:
- Source is maintained on GitHub at https://github.com/wwarthen/FAT
- Application is based on FatFs. FatFs source is included.
- SDCC compiler is required to build (v3.9.0 known working).
- ZX CP/M emulator is required to build (from RomWBW distribution).
- See Build.cmd for sample build script under Windows. References
to SDCC and ZX must be updated for your environment.
- Note that ff.c (core FatFs code) generates quite a few compiler
warnings (all appear to be benign).
TO DO:
- Allow ^C to abort any operation in progress.
- Handle wildcards in destination, e.g.:
"FAT REN 2:/*.TXT 2:/*.BAK"
- Do something intelligent with R/O and SYS files on FAT
HISTORY:
2-May-2019: v0.9 (beta) initial release
7-May-2019: v0.9.1 (beta) added REN and DEL
8-May-2019: v0.9.2 (beta) handle file collisions w/ user prompt
8-Oct-2019: v0.9.3 (beta) fixed incorrect filename buffer size (MAX_FN)
10-Oct-2019: v0.9.4 (beta) upgraded to FatFs R0.13c
10-Oct-2019: v0.9.5 (beta) added MD (make directory)
10-Oct-2019: v0.9.6 (beta) added FORMAT
11-Oct-2019: v0.9.7 (beta) fix FORMAT to use existing partition table entries
add attributes to directory listing

92
Source/Apps/FDU/FDU.asm

@ -44,6 +44,7 @@
; 2018-09-05: v5.3 ADDED SUPPORT FOR SMALLZ80
; - USE EOT=R TO END R/W AFTER ONE SECTOR INSTEAD
; OF USING PULSE TC
; 2020-01-05: V5.4 ADDED SUPPORT FOR DYNO FDC
;
;_______________________________________________________________________________
;
@ -77,6 +78,7 @@ FDC_N8 .EQU 5
FDC_RCSMC .EQU 6
FDC_RCWDC .EQU 7
FDC_SMZ80 .EQU 8
FDC_DYNO .EQU 9
;
; FDC MODE
;
@ -211,8 +213,8 @@ INIT5:
XOR A
RET
STR_BANNER .DB "Floppy Disk Utility (FDU) v5.3, 28-Sep-2018$"
STR_BANNER2 .DB "Copyright (C) 2018, Wayne Warthen, GNU GPL v3","$"
STR_BANNER .DB "Floppy Disk Utility (FDU) v5.4, 05-jAN-2020$"
STR_BANNER2 .DB "Copyright (C) 2020, Wayne Warthen, GNU GPL v3","$"
STR_HBIOS .DB " [HBIOS]$"
STR_UBIOS .DB " [UBIOS]$"
;
@ -232,19 +234,18 @@ FDCSEL:
CALL WRITESTR
;
FDCSEL1:
CALL GETKEY
SUB '0' ; ASCII -> BINARY
CP FDCCNT + 1 ; TOO HIGH?
JR NC,FDCSEL1 ; IF SO, TRY AGAIN
;
OR A ; SET FLAGS
JR NZ,FDCSEL2 ; NOT ZERO, KEEP GOING
OR 0FFH ; SET NZ FOR EXIT REQUEST
CALL GETKEYUC
CP 'X' ; EXIT?
JR NZ,FDCSEL2 ; IF NOT, CONTINUE
OR 0FFH ; ELSE SET NZ FOR EXIT REQUEST
RET ; AND RETURN
;
FDCSEL2:
SUB 'A' ; ASCII -> BINARY
CP FDCCNT ; TOO HIGH?
JR NC,FDCSEL1 ; IF SO, TRY AGAIN
;
; SAVE SELECTED FDC IDENTIFIER
DEC A ; CONVERT TO ZERO-BASED FDC ID
LD (FDCID),A ; RECORD THE FDC ID
RLCA ; TIMES 4
RLCA ; ... FOR 4 BYTE ENTRIES
@ -282,6 +283,7 @@ FDCTBL: ; LABEL CONFIG DATA
.DW STR_RCSMC, CFG_RCSMC
.DW STR_RCWDC, CFG_RCWDC
.DW STR_SMZ80, CFG_SMZ80
.DW STR_DYNO, CFG_DYNO
FDCCNT .EQU ($-FDCTBL)/4 ; FD CONTROLLER COUNT
;
; FDC LABEL STRINGS
@ -295,6 +297,7 @@ STR_N8 .TEXT "N8$"
STR_RCSMC .TEXT "RC-SMC$"
STR_RCWDC .TEXT "RC-WDC$"
STR_SMZ80 .TEXT "SMZ80$"
STR_DYNO .TEXT "DYNO$"
;
; FDC CONFIGURATION BLOCKS
;
@ -405,6 +408,17 @@ CFG_SMZ80:
.DB 0FFH ; PSEUDO DMA DATA PORT
.DB _PCAT ; MODE=
;
CFG_DYNO:
.DB 084H ; FDC MAIN STATUS REGISTER
.DB 085H ; FDC DATA PORT
.DB 0FFH ; DATA INPUT REGISTER
.DB 086H ; DIGITAL OUTPUT REGISTER (LATCH)
.DB 087H ; DCR
.DB 0FFH ; DACK
.DB 086H ; TERMINAL COUNT (W/ DACK)
.DB 0FFH ; PSEUDO DMA DATA PORT
.DB _PCAT ; MODE=
;
FDCID .DB 0 ; FDC IDENTIFIER (0 INDEXED)
FDCBM .DB 0 ; FDC ID BITMAP
FDCLBL .DW 0 ; POINTER TO ACTIVE FDC LABEL STRING
@ -413,16 +427,17 @@ FDCCFG .DW 0 ; POINTER TO ACTIVE CFG DATA
FSS_MENU:
.TEXT "\r\n"
.TEXT "SELECT FLOPPY DISK CONTROLLER:\r\n"
.TEXT " (0) Exit\r\n"
.TEXT " (1) Disk IO ECB Board\r\n"
.TEXT " (2) Disk IO 3 ECB Board\r\n"
.TEXT " (3) Zeta SBC Onboard FDC\r\n"
.TEXT " (4) Zeta 2 SBC Onboard FDC\r\n"
.TEXT " (5) Dual IDE ECB Board\r\n"
.TEXT " (6) N8 Onboard FDC\r\n"
.TEXT " (7) RC2014 SMC (SMB)\r\n"
.TEXT " (8) RC2014 WDC (SMB)\r\n"
.TEXT " (9) SmallZ80 Expansion\r\n"
.TEXT " (A) Disk IO ECB Board\r\n"
.TEXT " (B) Disk IO 3 ECB Board\r\n"
.TEXT " (C) Zeta SBC Onboard FDC\r\n"
.TEXT " (D) Zeta 2 SBC Onboard FDC\r\n"
.TEXT " (E) Dual IDE ECB Board\r\n"
.TEXT " (F) N8 Onboard FDC\r\n"
.TEXT " (G) RC2014 SMC (SMB)\r\n"
.TEXT " (H) RC2014 WDC (SMB)\r\n"
.TEXT " (I) SmallZ80 Expansion\r\n"
.TEXT " (J) Dyno-Card FDC, D1030\r\n"
.TEXT " (X) Exit\r\n"
.TEXT "=== OPTION ===> $\r\n"
;
;===============================================================================
@ -1499,8 +1514,9 @@ MD_MAP:
.DB %00000001 ; DIDE POLL
.DB %00000001 ; N8 POLL
.DB %00000001 ; RCSMC POLL
; .DB %00000001 ; RCWDC POLL
.DB %00000001 ; RCWDC POLL
.DB %00000001 ; SMZ80 POLL
.DB %00000001 ; DYNO POLL
;
; MEDIA DESCRIPTION BLOCK
;
@ -1861,7 +1877,7 @@ FM_DRAW0B: ; ZETA, DIO3
LD A,(FST_DOR)
AND 00000010B
JR FM_DRAW1
FM_DRAW0C: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FM_DRAW0C: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD A,(FST_DOR)
AND 11110000B
JR FM_DRAW1
@ -2014,7 +2030,7 @@ FM_MOTOR0B: ; ZETA, DIO3
LD A,(FST_DOR)
AND 00000010B
JR FM_MOTOR1
FM_MOTOR0C: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FM_MOTOR0C: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD A,(FST_DOR)
AND 11110000B
JR FM_MOTOR1
@ -2152,7 +2168,7 @@ FSST_COUNT .EQU (($ - FSST) / FSST_ENTSIZ) ; # ENTRIES IN TABLE
;
FCP_CMD .DB 000H ; INPUT: COMMAND CODE
FCP_BUFLEN .DB 00H
FCP_BUF .DS 10H
FCP_BUF .FILL 10H
FCP_BUFSIZ .EQU $-FCP_BUF
FCP_XFRCNT .DW 00H ; BYTES TRANSFERRED DURING COMMAND PHASE
;
@ -2166,7 +2182,7 @@ FXP_BC .DW 00H ; LAST VALUE OF REG BC RECORDED DURING EXECUTION
FXP_DE .DW 00H ; LAST VALUE OF REG DE RECORDED DURING EXECUTION
FXP_HL .DW 00H ; LAST VALUE OF REG HL RECORDED DURING EXECUTION
FXP_BUFLEN .DB 00H
FXP_BUF .DS 50H ; USED FOR CERTAIN EXEC ROUTINES (FORMAT TRACK)
FXP_BUF .FILL 50H ; USED FOR CERTAIN EXEC ROUTINES (FORMAT TRACK)
FXP_BUFSIZ .EQU $-FXP_BUF
;
; FDC STATUS
@ -2753,7 +2769,7 @@ FC_INIT1: ; DIO
FC_INIT2: ; ZETA, DIO3
LD A,(FCD_DORB)
JR FC_INIT5
FC_INIT3: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FC_INIT3: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD A,(FCD_DORC)
JR FC_INIT5
FC_INIT4: ; WDSMC
@ -2797,7 +2813,7 @@ FC_RESETFDC1: ; ZETA, DIO3, RCSMC
POP AF
OUT (C),A
JR FC_RESETFDC3
FC_RESETFDC2: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FC_RESETFDC2: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD A,0
OUT (C),A
LD A,(FST_DOR)
@ -2824,7 +2840,7 @@ FC_PULSETC:
;RES 0,A
;OUT (C),A
;JR FC_PULSETC2
;FC_PULSETC1: ; DIDE, N8, ZETA2, RCWDC, SMZ80
;FC_PULSETC1: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
;LD C,(IY+CFG_TC)
;IN A,(C)
;JR FC_PULSETC2
@ -2856,7 +2872,7 @@ FC_MOTORON2: ; ZETA, DIO3
LD HL,FST_DOR ; POINT TO FDC_DOR
SET 1,(HL)
JR FC_MOTORON5
FC_MOTORON3: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FC_MOTORON3: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD HL,FST_DOR ; POINT TO FDC_DOR
LD A,(HL) ; START WITH CURRENT DOR
AND 11111100B ; GET RID OF ANY ACTIVE DS BITS
@ -2920,7 +2936,7 @@ FC_MOTOROFF2: ; ZETA, DIO3
LD HL,FST_DOR ; POINT TO FDC_DOR
RES 1,(HL)
JR FC_MOTOROFF5
FC_MOTOROFF3: ; DIDE, N8, ZETA2, RCWDC, SMZ80
FC_MOTOROFF3: ; DIDE, N8, ZETA2, RCWDC, SMZ80, DYNO
LD HL,FST_DOR ; POINT TO FDC_DOR
LD A,DORC_INIT
LD (HL),A
@ -3330,7 +3346,8 @@ FXRR5: INC C ; [04] POINT TO DATA PORT
;
; AVOID RETURN FROM HALT IN PROBLEMATIC ADDRESS RANGE XX30-XX3F!!!
.IF ((($ & 0F0H) == 20H) | (($ & 0F0H) == 30H))
.ORG (($ & 0FF00H) + 40H)
.FILL (($ & 0FF00H) + 40H) - $
; .ORG (($ & 0FF00H) + 40H)
.ENDIF
;
IFXRR:
@ -3358,7 +3375,8 @@ IFXRRX .EQU $ - IFXRR
;
; AVOID RETURN FROM HALT IN PROBLEMATIC ADDRESS RANGE XX30-XX3F!!!
.IF ((($ & 0F0H) == 20H) | (($ & 0F0H) == 30H))
.ORG (($ & 0FF00H) + 40H)
.FILL (($ & 0FF00H) + 40H) - $
; .ORG (($ & 0FF00H) + 40H)
.ENDIF
;
FFXRR:
@ -3436,7 +3454,8 @@ FXRW5: INC C ; [04] POINT TO DATA PORT
;
; AVOID RETURN FROM HALT IN PROBLEMATIC ADDRESS RANGE XX30-XX3F!!!
.IF ((($ & 0F0H) == 20H) | (($ & 0F0H) == 30H))
.ORG (($ & 0FF00H) + 40H)
.FILL (($ & 0FF00H) + 40H) - $
; .ORG (($ & 0FF00H) + 40H)
.ENDIF
;
IFXRW:
@ -3462,7 +3481,8 @@ IFXRW2: EI
;
; AVOID RETURN FROM HALT IN PROBLEMATIC ADDRESS RANGE XX30-XX3F!!!
.IF ((($ & 0F0H) == 20H) | (($ & 0F0H) == 30H))
.ORG (($ & 0FF00H) + 40H)
.FILL (($ & 0FF00H) + 40H) - $
; .ORG (($ & 0FF00H) + 40H)
.ENDIF
;
FFXRW:
@ -3786,7 +3806,7 @@ DORB_BR500 .EQU 10100000B ; 500KBPS
;
DORB_INIT .EQU DORB_BR250
;
; *** DIDE/N8/ZETA2/RCWDC/SMZ80 ***
; *** DIDE/N8/ZETA2/RCWDC/SMZ80/DYNO ***
;
DORC_INIT .EQU 00001100B ; SOFT RESET INACTIVE, DMA ENABLED
;

13
Source/Apps/FDU/FDU.txt

@ -1,9 +1,9 @@
================================================================
Floppy Disk Utility (FDU) v5.3 for RetroBrew Computers
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80 / Dyno
================================================================
Updated September 5, 2018
Updated January 5, 2020
by Wayne Warthen (wwarthen@gmail.com)
Application to test the hardware functionality of the Floppy
@ -77,6 +77,7 @@ supported:
- RC2014 w/ SMC
- RC2014 w/ WDC
- SmallZ80
- Dyno
You must be using either a RomWBW or UBA based OS version.
@ -95,7 +96,7 @@ Finally, you will need a floppy drive connected via an
appropriate cable:
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive
DISK IO 3, Zeta, Zeta 2, RC2014 - cable with twist, unit 0 after twist, unit 1 before twist
DISK IO 3, Zeta, Zeta 2, RC2014, Dyno - cable with twist, unit 0 after twist, unit 1 before twist
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist
Note that FDU does not utilize your systems ROM or OS to
@ -154,6 +155,9 @@ JP2 (TC): 2-3.
SmallZ80 does not have any relevant jumper settings. The
hardwired I/O ranges are assumed in the code.
Dyno does not have any relevant jumper settings. The
hardwired I/O ranges are assumed in the code.
Modes of Operation
------------------
@ -505,3 +509,6 @@ WW 9/5/2018: v5.3
condition is no longer considered an error, but a successful end of
operation.
- Added support for SmallZ80
WW 5/1/2020: v5.4
- Added support for Dyno (based on work by Steve Garcia)

8
Source/Apps/FDU/Makefile

@ -0,0 +1,8 @@
OBJECTS = FDU.com
DOCS = FDU.txt
DEST = ../../../Binary/Apps
DOCDEST = ../../../Doc
TOOLS = ../../../Tools
include $(TOOLS)/Makefile.inc
%.com: USETASM=1

4
Source/Apps/Format.asm

@ -30,8 +30,8 @@ bdos .equ $0005 ; BDOS invocation vector
;;
;stamp .equ $40 ; loc of RomWBW CBIOS zero page stamp
;
rmj .equ 2 ; CBIOS version - major
rmn .equ 9 ; CBIOS version - minor
rmj .equ 3 ; CBIOS version - major
rmn .equ 0 ; CBIOS version - minor
;
;===============================================================================
; Code Section

209
Source/Apps/IntTest.asm

@ -1,4 +1,5 @@
;===============================================================================
;
; INTTEST - Test HBIOS interrupt API functions
;
;===============================================================================
@ -24,11 +25,6 @@ bf_sysint .equ $FC ; INT function
bf_sysintinfo .equ $00 ; INT INFO subfunction
bf_sysintget .equ $10 ; INT GET subfunction
bf_sysintset .equ $20 ; INT SET subfunction
;
z180_base .equ $40 ; i/o base address for internal z180 registers
z180_tcr .equ z180_base + $10 ; timer control
z180_tmdr0l .equ z180_base + $0C ; timer 0 data lo
;
;===============================================================================
; Code Section
@ -146,38 +142,46 @@ lstlp:
; Establish interrupt vector index to hook
;
estidx:
ld a,(intmod)
ld c,0
cp 1
jr z,setidx
ld c,2 ; assume timer in entry 2 if im2
cp 2
jr z,setidx
ret ; neither im1 or im2, bail out
setidx:
ld a,c
call crlf2
ld de,msgvec
call prtstr
call getbuf
ld hl,lnbuf+1
ld a,(hl) ; get line length
or a ; set flags
jr z,estidx ; nothing entered
ld b,a ; set b to line length
inc hl
call hexbyt
jr c,estidx
ld (vecidx),a
ld hl,veccnt ; check index against valid range
cp (hl)
jr nc,estidx ; vector index out of bounds
;
; Hook vector
;
call crlf2
ld de,msghook
ld de,msghk1
call prtstr
ld a,(vecidx)
call prthex
ld de,msghk2
call prtstr
call crlf2
ld a,$ff
ld (count),a ; set counter to max value
;
ld a,(intmod)
cp 1
jr z,hkim1
jr z,hkim
cp 2
jr z,hkim2
jr z,hkim
ret
;
; IM1 specific code
; Setup interrupt handler
;
hkim1:
ld hl,m1int ; pointer to my interrupt handler
hkim:
ld hl,int ; pointer to my interrupt handler
ld b,bf_sysint
ld c,bf_sysintset ; set new vector
ld a,(vecidx) ; get vector idx
@ -188,45 +192,38 @@ hkim1:
ei ; interrupts back on
jr start
;
; IM2 specific code
;
hkim2:
ld hl,m2stub ; pointer to my interrupt stub
ld b,bf_sysint
ld c,bf_sysintset ; set new vector
ld a,(vecidx) ; get vector idx
ld e,a ; put in E
di
rst 08 ; do it
ld (chain),hl ; save the chain address
ld (engadr),de ; insert the int routing engine address
ei ; interrupts back on
jr start
;
; Wait for counter to countdown to zero
;
start:
call crlf2
ld de,msgrun ; message
call prtstr
call crlf2
ld a,(count)
ld e,a
call prthex ; print it
ld a,13
call prtchr
loop:
call getchr ; check console
cp $1B ; <esc> to exit
jr z,unhook ; if so, bail out
ld a,(count) ; get current count value
cp e
jr z,loop
ld e,a
push af
call prthex ; print it
ld a,13
call prtchr
pop af
or a ; set flags
jr z,loop1 ; done
jr z,unhook ; done
jr loop ; and loop
loop1:
;
; Unhook
;
unhook:
call crlf2
ld de,msgunhk
call prtstr
@ -242,6 +239,35 @@ loop1:
xor a ; signal success
ret ; done
;
; Get a character from console, return in A
; returs zero if nothing available
;
getchr:
push bc ; save registers
push de
push hl
ld e,$FF ; read a character
ld c,$06 ; BDOS direct i/o function
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Get console buffer
;
getbuf:
push bc
push de
push hl
ld de,lnbuf
ld c,$0A
call bdos
pop hl
pop de
pop bc
ret
;
; Print character in A without destroying any registers
;
prtchr:
@ -450,6 +476,59 @@ addhl:
jphl:
jp (hl)
;
; Convert hex chars to a byte value.
; Enter with HL pointing to buffer with chars to convert
; and B containing number of chars. Returns value in A.
; CF set to indicate error (overflow or invalid char).
;
hexbyt:
ld c,0 ; working value starts at zero
hexbyt1:
sla c ; rotate low nibble to high
ret c
sla c
ret c
sla c
ret c
sla c
ret c
ld a,(hl) ; load next char
call hexnibl ; convert to binary
ret c ; abort on error
or c ; combine w/ working value
ld c,a ; and put back in c
inc hl ; next position
djnz hexbyt1 ; next character
ld a,c ; ret val to a
or a ; clear carry
ret
;
; Convert hex character at (HL) to binary value
; Set CF to indicate invalid character
;
hexnibl:
; handle '0'-'9'
cp '0'
jr c,hexnibl1 ; if < '0', out of range
cp '9'+1
jr nc,hexnibl1 ; if > '9', out of range
and $0F ; convert to binary value
ret ; and done
hexnibl1:
; handle 'A'-'F'
call ucase ; force upper case
cp 'A'
jr c,hexnibl2 ; if < 'A', out of range
cp 'F'+1
jr nc,hexnibl2 ; if > 'F', out of range
and $0F ; convert to binary value
add a,9 ;
ret ; and done
hexnibl2:
; invalid character
scf ; signal error
ret
;
;===============================================================================
; Storage Section
;===============================================================================
@ -457,6 +536,8 @@ jphl:
intmod .db 0 ; active interrupt mode
veccnt .db 0 ; count of ingterrupt vectors
vecidx .db 0 ; vector index to hook
lnbuf .db 10,0 ; 10 char BDOS line input buffer
.fill 10
;
stksav .dw 0 ; stack pointer saved at start
.fill stksiz,0 ; stack
@ -464,14 +545,17 @@ stack .equ $ ; stack top
;
; Messages
;
msgban .db "INTTEST v1.0, 27-Aug-2018",13,10
.db "Copyright (C) 2018, Wayne Warthen, GNU GPL v3",0
msgban .db "INTTEST v1.2, 15-May-2019",13,10
.db "Copyright (C) 2019, Wayne Warthen, GNU GPL v3",0
msginfo .db "Interrupt information request...",0
msgmode .db " Active interrupt mode: ",0
msgcnt .db " Vector entries in use: ",0
msglst .db "Interrupt vector address list:",0
msghook .db "Hooking vector...",0
msghk1 .db "Hooking vector ",0
msghk2 .db "...",0
msgunhk .db "Unhooking vector...",0
msgrun .db "Interrupt countdown (press <esc> to exit)...",0
msgvec .db "Enter vector to hook (hex): ",0
;
;===============================================================================
; Interrupt Handler
@ -481,39 +565,22 @@ reladr .equ $ ; relocation start adr
;
.org $8000 ; code will run here
;
m1int:
int:
; count down to zero
ld a,(count)
or a
jr z,m1int1
dec a
ld (count),a
m1int1:
ld a,(count) ; get current count value
or a ; test for zero
jr z,int1 ; if zero, leave it alone
dec a ; decrement
ld (count),a ; and save
int1:
xor a ; signal int has NOT been handled
; follow the chain...
ld hl,(chain)
jp (hl)
;
m2stub:
push hl
ld hl,m2int
jp $0000
engadr .equ $ - 2
;
m2int:
; count down to zero
ld a,(count)
or a
jr z,m2int1
dec a
ld (count),a
m2int1:
; ack/reset z180 timer interrupt
in0 a,(z180_tcr)
in0 a,(z180_tmdr0l)
ret
ld hl,(chain) ; get chain adr
jp (hl) ; go there
; ret
;
chain .dw $0000 ; chain address
count .db 0 ; counter
;
hsiz .equ $ - $8000 ; size of handler to relocate
.end

14
Source/Apps/Makefile

@ -0,0 +1,14 @@
OBJECTS = SysGen.com Survey.com \
SysCopy.com Assign.com Format.com Talk.com Mode.com RTC.com \
Timer.com IntTest.com
OTHERS = *.hex *.com
SUBDIRS = XM FDU FAT Tune
DEST = ../../Binary/Apps
TOOLS =../../Tools
include $(TOOLS)/Makefile.inc
USETASM = 1
Survey.com: USETASM=0

4
Source/Apps/Mode.asm

@ -48,8 +48,8 @@ bdos .equ $0005 ; BDOS invocation vector
;
ident .equ $FFFE ; loc of RomWBW HBIOS ident ptr
;
rmj .equ 2 ; intended CBIOS version - major
rmn .equ 9 ; intended CBIOS version - minor
rmj .equ 3 ; intended CBIOS version - major
rmn .equ 1 ; intended CBIOS version - minor
;
bf_cioinit .equ $04 ; HBIOS: CIOINIT function
bf_cioquery .equ $05 ; HBIOS: CIOQUERY function

1014
Source/Apps/OSLdr.asm

File diff suppressed because it is too large

95
Source/Apps/RTC.asm

@ -19,6 +19,11 @@
;
;[2018/11/8] v1.2 PMS Add boot option. Code optimization.
;
;[2019/06/21] v1.3 Finalized RC2014 Z180 support.
;
;[2019/08/11] v1.4 Support SCZ180 platform.
;
;[2020/02/02] v1.5 PMS Basic command line support
;
; Constants
;
@ -30,9 +35,13 @@ mask_rst .EQU %00010000 ; De-activate RTC reset line
PORT_SBC .EQU $70 ; RTC port for SBC/ZETA
PORT_N8 .EQU $88 ; RTC port for N8
PORT_MK4 .EQU $8A ; RTC port for MK4
PORT_RC .EQU $C0 ; RTC port for RC2014
PORT_RCZ80 .EQU $C0 ; RTC port for RC2014
PORT_RCZ180 .EQU $0C ; RTC port for RC2014
PORT_SCZ180 .EQU $0C ; RTC port for SBCZ180
PORT_EZZ80 .EQU $C0 ; RTC port for EZZ80 (actually does not have one!!!)
BDOS .EQU 5 ; BDOS invocation vector
FCB .EQU 05CH ; Start of command line
BID_BOOT .EQU $00
HB_BNKCALL .EQU $FFF9
@ -66,7 +75,7 @@ LOOP:
; uses BC
;
; based on following algorithm:
:
;
; const
; hextab : string = ('0','1','2','3','4','5','6','7','8',
; '9','A','B','C','D','E','F');
@ -1066,10 +1075,22 @@ HINIT:
LD DE,PLT_MK4
CP $05 ; Mark IV
JR Z,RTC_INIT2
LD C,PORT_RC
LD DE,PLT_RC
CP $07 ; RC2014
LD C,PORT_RCZ80
LD DE,PLT_RCZ80
CP $07 ; RC2014 w/ Z80
JR Z,RTC_INIT2
LD C,PORT_RCZ180
LD DE,PLT_RCZ180
CP $08 ; RC2014 w/ Z180
JR Z,RTC_INIT2
LD C,PORT_SCZ180
LD DE,PLT_SCZ180
CP $0A ; SCZ180
JR Z,RTC_INIT2
;LD C,PORT_EZZ80
;LD DE,PLT_EZZ80
;CP $09 ; Easy Z80
;JR Z,RTC_INIT2
;
; Unknown platform
LD DE,PLTERR ; BIOS error message
@ -1201,18 +1222,22 @@ IDBIO2:
; Note:above code is not fully in sync with current menu code
RTC_TOP_LOOP:
CALL RTC_RESET_ON
CALL RTC_BIT_DELAY
CALL RTC_BIT_DELAY
CALL RTC_BIT_DELAY
LD A,(FCB+1) ; If there a command line tail
CP '/' ; get the command and feed it
LD A,(FCB+2) ; into the input stream
JR Z,RTC_UCL
LD DE,CRLF_MSG
LD C,09H ; CP/M write string to console call
CALL 0005H
CALL RTC_HELP
CALL RTC_RESET_ON
CALL RTC_BIT_DELAY
CALL RTC_BIT_DELAY
CALL RTC_BIT_DELAY
RTC_TOP_LOOP_1:
LD DE,RTC_TOP_LOOP1_PROMPT
LD C,09H ; CP/M write string to console call
@ -1220,7 +1245,7 @@ RTC_TOP_LOOP_1:
LD C,01H ; CP/M console input call
CALL 0005H
RTC_UCL:
AND %01011111 ; handle lower case responses to menu
CP 'L'
@ -1240,31 +1265,31 @@ RTC_TOP_LOOP_1:
RET Z
CP 'H'
JR Z,RTC_TOP_LOOP_HELP
JP Z,RTC_TOP_LOOP_HELP
CP 'D'
JR Z,RTC_TOP_LOOP_DELAY
JP Z,RTC_TOP_LOOP_DELAY
CP 'B'
JR Z,RTC_TOP_LOOP_BOOT
JP Z,RTC_TOP_LOOP_BOOT
CP 'C'
JR Z,RTC_TOP_LOOP_CHARGE
JP Z,RTC_TOP_LOOP_CHARGE
CP 'N'
JR Z,RTC_TOP_LOOP_NOCHARGE
JP Z,RTC_TOP_LOOP_NOCHARGE
CP 'A'
JR Z,RTC_TOP_LOOP_START
JP Z,RTC_TOP_LOOP_START
CP 'S'
JP Z,RTC_TOP_LOOP_SET
CP 'I'
JR Z,RTC_TOP_LOOP_INIT
JP Z,RTC_TOP_LOOP_INIT
CP 'T'
JR Z,RTC_TOP_LOOP_TIME
JP Z,RTC_TOP_LOOP_TIME
LD DE,CRLF_MSG
LD C,09H ; CP/M write string to console call
@ -1284,6 +1309,17 @@ RTC_TOP_LOOP_DELAY:
JP RTC_TOP_LOOP_1
RTC_TOP_LOOP_BOOT:
LD DE,BOOTMSG ; BOOT message
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
; WAIT FOR MESSAGE TO BE DISPLAYED
LD HL,10000
DELAY_LOOP: ; LOOP IS 26TS
DEC HL ; 6TS
LD A,H ; 4TS
OR L ; 4TS
JR NZ,DELAY_LOOP ; 12TS
; RESTART SYSTEM FROM ROM BANK 0, ADDRESS $0000
LD A,BID_BOOT ; BOOT BANK
LD HL,0 ; ADDRESS ZERO
CALL HB_BNKCALL ; DOES NOT RETURN
@ -1293,6 +1329,9 @@ RTC_TOP_LOOP_CHARGE:
LD C,09H ; CP/M write string to console call
CALL 0005H
CALL RTC_CHARGE_ENABLE
LD A,(FCB+1) ; If we came from the
CP '/' ; command line
RET Z ; exit back to CP/M
JP RTC_TOP_LOOP_1
RTC_TOP_LOOP_NOCHARGE:
@ -1300,6 +1339,9 @@ RTC_TOP_LOOP_NOCHARGE:
LD C,09H ; CP/M write string to console call
CALL 0005H
CALL RTC_CHARGE_DISABLE
LD A,(FCB+1) ; If we came from the
CP '/' ; command line
RET Z ; exit back to CP/M
JP RTC_TOP_LOOP_1
RTC_TOP_LOOP_START:
@ -1331,6 +1373,9 @@ RTC_TOP_LOOP_TIME:
LD DE,RTC_PRINT_BUFFER
LD C,09H ; CP/M write string to console call
CALL 0005H
LD A,(FCB+1) ; If we came from the
CP '/' ; command line
RET Z ; exit back to CP/M
JP RTC_TOP_LOOP_1
RTC_TOP_LOOP_RAW:
@ -1533,7 +1578,7 @@ TESTING_BIT_DELAY_OVER:
RTC_HELP_MSG:
.DB 0Ah, 0Dh ; line feed and carriage return
.TEXT "RTC: Version 1.2"
.TEXT "RTC: Version 1.5"
.DB 0Ah, 0Dh ; line feed and carriage return
.TEXT "Commands: E)xit T)ime st(A)rt S)et R)aw L)oop C)harge N)ocharge D)elay I)nit G)et P)ut B)oot H)elp"
.DB 0Ah, 0Dh ; line feed and carriage return
@ -1647,14 +1692,18 @@ RTC_GET_BUFFER:
.DB "$" ; line terminator
BIOERR .TEXT "\r\nUnknown BIOS, aborting...\r\n$"
PLTERR .TEXT "\r\n\r\nUnknown hardware platform, aborting...\r\n$"
PLTERR .TEXT "\r\n\r\nUnknown/unsupported hardware platform, aborting...\r\n$"
UBERR .TEXT "\r\nUNA UBIOS is not currently supported, aborting...\r\n$"
HBTAG .TEXT "RomWBW HBIOS$"
UBTAG .TEXT "UNA UBIOS"
BOOTMSG .TEXT "\r\n\r\nRebooting...$"
PLT_SBC .TEXT ", SBC/Zeta RTC Latch Port 0x70\r\n$"
PLT_N8 .TEXT ", N8 RTC Latch Port 0x88\r\n$"
PLT_MK4 .TEXT ", Mark 4 RTC Latch Port 0x8A\r\n$"
PLT_RC .TEXT ", RC2014 RTC Latch Port 0xC0\r\n$"
PLT_RCZ80 .TEXT ", RC2014 Z80 RTC Module Latch Port 0xC0\r\n$"
PLT_RCZ180 .TEXT ", RC2014 Z180 RTC Module Latch Port 0x0C\r\n$"
PLT_SCZ180 .TEXT ", SC Z180 RTC Module Latch Port 0x0C\r\n$"
PLT_EZZ80 .TEXT ", Easy Z80 RTC Module Latch Port 0xC0\r\n$"
;
; Generic FOR-NEXT loop algorithm

139
Source/Apps/SysCopy.asm

@ -1,6 +1,6 @@
;===============================================================================
; SysCopy - Copy System Image to/from reserved tracks of disk for RomWBW
; adaptation of CP/M 2.2
; adaptation of CP/M 2.2 & CP/M 3
;===============================================================================
;
; Author: Wayne Warthen (wwarthen@gmail.com)
@ -16,6 +16,7 @@
;
; Change Log:
; 2016-04-24 [WBW] Updated to preserve MBR partition table
; 2020-02-17 [WBW] Updated for CP/M 3
;_______________________________________________________________________________
;
; ToDo:
@ -27,6 +28,9 @@
; Definitions
;===============================================================================
;
false .equ 0 ; define true
true .equ ~false ; define false
;
stksiz .equ $40 ; we are a stack pig
;
restart .equ $0000 ; CP/M restart vector
@ -86,6 +90,18 @@ main:
init:
; add check for RomWBW?
;
; get OS version
ld c,12 ; BDOS get os version
call bdos ; do it, L=version
cp $30 ; Test for v3.0
jr c,init1 ; if <, pre v3.0
ld a,true ; OS v3.0 or above
ld (v3os),a ; save it
jr init2
init1:
ld a,false ; OS < v3.0
ld (v3os),a ; save it
init2:
; locate cbios function table address
ld hl,(restart+1) ; load address of CP/M restart vector
ld de,-3 ; adjustment for start of table
@ -96,6 +112,20 @@ init:
call bdos ; invoke BDOS function
inc a ; 1-based index for fcb
ld (defdrv),a ; save it
; print version banner
call crlf ; formatting
ld de,msgban1 ; point to version message part 1
call prtstr ; print it
ld a,(v3os) ; get OS version flag
or a ; set flags
ld de,msgv2 ; point to V2 mode message
call z,prtstr ; if V2, say so
ld de,msgv3 ; point to V3 mode message
call nz,prtstr ; if V3, say so
call crlf ; formatting
ld de,msgban2 ; point to version message part 2
call prtstr ; print it
call crlf ; formatting
; return success
xor a
ret
@ -237,7 +267,7 @@ wrfil1: ; create target file
; write the image
ld a,$15 ; setup for bdos write sequential
ld (rwfun),a ; save bdos function
ld a,(imgsiz) ; number of records to read
ld a,(imgsiz) ; number of records to write
ld (reccnt),a ; init record counter
ld hl,imgbuf ; start of buffer
ld (bufptr),hl ; init buffer pointer
@ -292,10 +322,8 @@ rddsk:
call setdsk ; setup disk
ret nz ; abort on error
; set function to read
ld hl,(cbftbl) ; get address of CBIOS function table
ld a,$27 ; $27 is CBIOS READ entry offset
call addhl ; set HL to resultant entry point
ld (actfnc),hl ; save it
ld a,13 ; CBIOS func 13: Read
ld (actfnc),a ; save it
; read the header
ld a,12 ; start with 1536 byte header (12 records)
ld (reccnt),a ; initialize record counter
@ -339,11 +367,10 @@ wrdsk:
ld hl,mbrbuf ; override to read
ld (bufptr),hl ; ... into MBR buffer
ld a,4 ; 4 records = 1 512 byte sector
ld (reccnt),a ; initialize record counter
; set function to read
ld hl,(cbftbl) ; get address of CBIOS function table
ld a,$27 ; $27 is CBIOS READ entry offset
call addhl ; set HL to resultant entry point
ld (actfnc),hl ; save it
ld a,13 ; CBIOS func 13: Read
ld (actfnc),a ; save it
; read the existing MBR into memory
call rwdsk ; read the sector
ret nz ; abort on error
@ -366,10 +393,8 @@ wrdsk1: ; setup to write the image from memory to disk
call setdsk ; setup disk
ret nz ; abort on error
; set function to write
ld hl,(cbftbl) ; get address of CBIOS function table
ld a,$2A ; $2A is CBIOS WRITE entry offset
call addhl ; set HL to resultant entry point
ld (actfnc),hl ; save it
ld a,14 ; CBIOS func 14: Write
ld (actfnc),a ; save it
; setup the record count to write
ld a,(imgsiz) ; get previously recorded image size
ld (reccnt),a ; save it as pending record count
@ -399,7 +424,8 @@ setdsk:
ld c,a ; move to c
ld e,0 ; treat as first select
call cbios ; invoke cbios with...
.db $1B ; SELDSK entry offset
;.db $1B ; SELDSK entry offset
.db 9 ; SELDSK entry offset
; check return (sets HL to DPH address)
ld a,h
or l
@ -436,29 +462,47 @@ setdsk:
; Read or write (reccnt) sectors to/from disk via CBIOS
;
rwdsk:
ld hl,128 ; assume rec len for < CP/M 3
ld (reclen),hl ; and save it
ld a,(v3os) ; CP/M 3 or greater?
or a ; set flags
jr z,rwdsk0 ; if not, continue
; adjust reccnt, logical (128) to physical (512)
ld a,(reccnt) ; get pending rec cnt
add a,3 ; round up
srl a ; shift to
srl a ; ... divide by 4
ld (reccnt),a ; and resave it
ld hl,512 ; use physical rec len
ld (reclen),hl ; and save it
rwdsk0:
; setup to read/write a sector
ld bc,(acttrk) ; get active track
call cbios ; invoke cbios with...
.db $1E ; SETTRK entry offset
;.db $1E ; SETTRK entry offset
.db 10 ; SETTRK entry offset
ld bc,(actsec) ; get active sector
call cbios ; invoke cbios with...
.db $21 ; SETSEC entry offset
;.db $21 ; SETSEC entry offset
.db 11 ; SETSEC entry offset
ld bc,(bufptr) ; get active buffer pointer
call cbios ; invoke cbios with...
.db $24 ; SETDMA entry offset
;.db $24 ; SETDMA entry offset
.db 12 ; SETDMA entry offset
; read/write sector
ld a,(reccnt) ; get the pending record count
dec a ; last record?
ld c,2 ; allow cached writes by default
jr nz,rwdsk1 ; not last record, continue
ld c,1 ; last record, no caching please
rwdsk1: ld hl,(actfnc) ; load the CBIOS function vector
call jphl ; indirect call (read or write)
rwdsk1:
ld a,(actfnc)
call cbiosfn
or a ; set flags on return code
jp nz,errio ; if not zero, error abort
; adjust buffer pointer
ld hl,(bufptr) ; get buffer pointer
ld de,128 ; record length is 128 bytes
ld de,(reclen) ; get rec len
add hl,de ; adjust buffer ptr for next record
ld (bufptr),hl ; save it
; next sector
@ -479,7 +523,7 @@ rwdsk1: ld hl,(actfnc) ; load the CBIOS function vector
rwdsk2: ld hl,reccnt
dec (hl) ; decrement pending record count
ret z ; if zero, done, return with Z set
jr rwdsk ; otherwise, loop
jr rwdsk0 ; otherwise, loop
;
jphl: jp (hl) ; indirect jump
;
@ -656,6 +700,15 @@ chkfcb4:
or a ; set flags
ret
;
; Print dot
;
prtdot:
push af
ld a,'.'
call prtchr
pop af
ret
;
; Print character in A without destroying any registers
;
prtchr:
@ -775,13 +828,37 @@ delim1:
;
cbios:
ex (sp),hl
ld a,(hl) ; get the function offset
ld a,(hl) ; get the function number
inc hl ; point past value following call instruction
ex (sp),hl ; put address back at top of stack and recover HL
cbiosfn:
; enter here if function already in reg A
ld (bpb_fn),a ; save function
;
ld a,(v3os) ; CP/M 3 or greater?
or a ; set flags
jr nz,cbios2 ; if >= V3, handle it
;
; CBIOS call for CP/M < v3
ld a,(bpb_fn) ; get pending function number
ld l,a ; function number to L
add a,l ; ... and multiply by 3 for
add a,l ; ... jump table offset
ld hl,(cbftbl) ; address of CBIOS function table to HL
call addhl ; determine specific function address
jp (hl) ; invoke CBIOS
;
cbios2:
; CBIOS call for CP/M v3 or greater
ld (bpb_bc),bc
ld (bpb_de),de
ld (bpb_hl),hl
ld c,50 ; direct bios call function number
ld de,bpb ; BIOS parameter block
jp bdos ; return via BDOS call
;
; Add the value in A to HL (HL := HL + A)
;
addhl:
@ -862,10 +939,24 @@ actdsk .db 0 ; active disk no
acttrk .dw 0 ; active track
actsec .dw 0 ; active sector
actspt .dw 0 ; active sectors per track
actfnc .dw 0 ; active function (read or write)
actfnc .db 0 ; active cbios i/o function (read or write)
v3os .db 0 ; true ($FF) if OS v3.0 or greater
reclen .dw 0 ; active record length
;
bpb: ; BIOS parameter block for CP/M 3 BIOS calls
bpb_fn .db 0 ; function
bpb_a .db 0 ; reg A
bpb_bc .dw 0 ; reg BC
bpb_de .dw 0 ; reg DE
bpb_hl .dw 0 ; reg HL
;
; Messages
;
msgban1 .db "SYSCOPY v2.0 for RomWBW CP/M, 17-Feb-2020$"
msgv2 .db " (CP/M 2 Mode)$"
msgv3 .db " (CP/M 3 Mode)$"
msgban2 .db "Copyright 2020, Wayne Warthen, GNU GPL v3$"
msguse .db "Usage: SYSCOPY <dest>[=<source>]$"
msgamb .db "Ambiguous file specification not allowed$"
msgdlm .db "Invalid delimiter$"

29
Source/Apps/Timer.asm

@ -19,6 +19,7 @@
; Change Log:
; 2018-01-14 [WBW] Initial release
; 2018-01-17 [WBW] Add HBIOS check
; 2019-11-08 [WBW] Add seconds support
;_______________________________________________________________________________
;
; ToDo:
@ -35,12 +36,13 @@ bdos .equ $0005 ; BDOS invocation vector
;
ident .equ $FFFE ; loc of RomWBW HBIOS ident ptr
;
rmj .equ 2 ; intended CBIOS version - major
rmn .equ 9 ; intended CBIOS version - minor
rmj .equ 3 ; intended CBIOS version - major
rmn .equ 1 ; intended CBIOS version - minor
;
bf_sysver .equ $F1 ; BIOS: VER function
bf_sysget .equ $F8 ; HBIOS: SYSGET function
bf_sysgettimer .equ $D0 ; TIMER subfunction
bf_sysgetsecs .equ $D1 ; SECONDS subfunction
;
;===============================================================================
; Code Section
@ -127,7 +129,22 @@ process1a:
ld a,l ; new LSB value to A
ld (last),a ; save as last value
call prtcr ; back to start of line
call nz,prthex32 ; display it
;call nz,prthex32 ; display it
call prthex32 ; display it
ld de,strtick ; tag
call prtstr ; display it
; get and print seconds value
ld b,bf_sysget ; HBIOS SYSGET function
ld c,bf_sysgetsecs ; SECONDS subfunction
rst 08 ; call HBIOS, DE:HL := seconds value
call prthex32 ; display it
ld a,'.' ; fraction separator
call prtchr ; print it
ld a,c ; get fractional component
call prthex ; print it
ld de,strsec ; tag
call prtstr ; display it
;
process2:
ld a,(cont) ; continuous display?
@ -463,8 +480,8 @@ stack .equ $ ; stack top
;
; Messages
;
msgban .db "TIMER v1.0, 14-Jan-2018",13,10
.db "Copyright (C) 2018, Wayne Warthen, GNU GPL v3",0
msgban .db "TIMER v1.1, 10-Nov-2019",13,10
.db "Copyright (C) 2019, Wayne Warthen, GNU GPL v3",0
msguse .db "Usage: TIMER [/C] [/?]",13,10
.db " ex. TIMER (display current timer value)",13,10
.db " TIMER /? (display version and usage)",13,10
@ -472,5 +489,7 @@ msguse .db "Usage: TIMER [/C] [/?]",13,10
msgprm .db "Parameter error (TIMER /? for usage)",0
msgbio .db "Incompatible BIOS or version, "
.db "HBIOS v", '0' + rmj, ".", '0' + rmn, " required",0
strtick .db " Ticks, ",0
strsec .db " Seconds",0
;
.end

12
Source/Apps/Tune/Makefile

@ -0,0 +1,12 @@
OBJECTS = Tune.com
DEST = ../../../Binary/Apps
TOOLS = ../../../Tools
include $(TOOLS)/Makefile.inc
Tune.com: Tune.asm
$(TASM) Tune.asm Tune.com
all::
mkdir -p $(DEST)/Tunes
cp Tunes/* $(DEST)/Tunes

336
Source/Apps/Tune/Tune.asm

@ -23,16 +23,22 @@
; - Max Z80 CPU clock is about 8MHz or sound chip will not handle speed.
; - Higher CPU clock speeds are possible on Z180 because extra I/O
; wait states are added during I/O to sound chip.
; - Uses hardware timer support on Z180 processors. Otherwise, a delay
; loop calibrated to CPU speed is used.
; - Uses hardware timer support on systems that support a timer. Otherwise,
; a delay loop calibrated to CPU speed is used.
; - Delay loop is calibrated to CPU speed, but it does not compensate for
; time variations in each quark loop resulting from data decompression.
; An average quark processing time is assumed in each loop.
; - Most sound files originally targeted MSX or ZX Spectrum which used
; 1.7897725 MHz and 1.773400 MHz respectively for the PSG clock. For best
; sound playback, PSG should be run at approx. this clock rate.
;_______________________________________________________________________________
;
; Change Log:
; 2018-01-26 [WBW] Initial release
; 2018-01-28 [WBW] Added support for MYM sound files
; 2019-11-21 [WBW] Added table-driven configuration
; 2020-02-11 [WBW] Made hardware config & detection more flexible
; 2020-03-29 [WBW] Fix error in Z180 I/O W/S bracketing
;_______________________________________________________________________________
;
; ToDo:
@ -48,14 +54,12 @@ BDOS .EQU $0005 ; BDOS invocation vector
;
IDENT .EQU $FFFE ; loc of RomWBW HBIOS ident ptr
;
RMJ .EQU 2 ; intended CBIOS version - major
RMN .EQU 9 ; intended CBIOS version - minor
RMJ .EQU 3 ; intended CBIOS version - major
RMN .EQU 1 ; intended CBIOS version - minor
;
BF_SYSVER .EQU $F1 ; BIOS: VER function
BF_SYSGET .EQU $F8 ; HBIOS: SYSGET function
;
DCNTL .EQU $72 ; Z180 DCNTL PORT
;
FCB .EQU $5C ; Location of default FCB
;
HEAPEND .EQU $C000 ; End of heap storage
@ -79,37 +83,74 @@ TYPMYM .EQU 3 ; FILTYP value for MYM sound file
LD A,RMJ << 4 | RMN ; Expected HBIOS ver
CP D ; Compare with result above
JP NZ,ERRBIO ; Handle BIOS error
LD A,L ; Platform id to A
LD (CURPLT),A ; Save as current platform id
;
; Use platform id to derive port addresses
LD A,L ; Platform ID is still in L from above
LD C,L ; Save platform id in C for now
LD HL,$D0D8 ; For RC2014, RSEL=D8, RDAT=D0
LD DE,MSGRC ; Message for RC2014 platform
CP 7 ; RC2014?
JR Z,_SETP ; If so, set ports
LD HL,$9D9C ; For N8, RSEL=9C, RDAT=9D
LD DE,MSGN8 ; Message for N8 platform
CP 4 ; N8?
JR Z,_SETP ; If so, set ports
LD HL,$9B9A ; Otherwise SCG, RSEL=9A, RDAT=9B
LD DE,MSGSCG ; Message for SCG platform
LD A,$FF ; Write $FF to the
OUT ($9C),A ; ... SCG ACR register to activate card
_SETP LD (PORTS),HL ; Save port values
LD HL,CFGTBL ; Point to start of config table
CFGSEL:
LD A,$FF ; End of table marker
CP (HL) ; Compare
JP Z,ERRHW ; Bail out if no more configs to try
;
LD BC,CFGSIZ ; Size of one entry
LD DE,CFG ; Active config structure
LDIR ; Update active config structure
;
LD A,(CURPLT) ; Get current running platform id
LD E,A ; Put in E
LD A,(PLT) ; Get platform id of loaded config
CP E ; Equal?
JR NZ,CFGSEL ; If no match keep trying
;
; Activate card if applicable
CALL SLOWIO ; Slow down I/O now
LD A,(ACR) ; Get ACR port address (if any)
INC A ; $FF -> $00 & set flags
JR Z,PROBE ; Skip ahead to probe if no ACR
DEC A ; Restore real ACR port address
LD C,A ; Put in C for I/O
LD A,$FF ; Value to activate card
OUT (C),A ; Write value to ACR
;
PROBE:
; Test for hardware (sound chip detection)
LD DE,(PORTS) ; D := RDAT, E := RSEL
LD C,E ; Port = RSEL
LD A,2 ; Register 2
OUT (C),A ; Select register 2
LD C,D ; Port = RDAT
LD A,$AA ; Value = $AA
OUT (C),A ; Write $AA to register 2
LD A,(RIN) ; Port = RIN
LD C,A ; ... to C
IN A,(C) ; Read back value in register 2
CP $AA ; Value as written?
PUSH AF ; Save AF
CALL NORMIO ; Back to normal I/O speeds
POP AF ; Recover AF
JR Z,MAT ; Hardware matched!
JR CFGSEL ; And keep trying
;
MAT:
; Hardware matched!
CALL CRLF ; Formatting
CALL PRTSTR ; Display platform string
;
; Choose quark wait mode based on platform
LD A,C ; Recover platform id
LD B,1 ; Assume timer mode
LD DE,MSGTIM ; Corresponding display string
CP 4 ; N8?
JR Z,_SETM ; If so, commit timer mode
CP 5 ; MK4?
JR Z,_SETM ; If so, commit timer mode
LD B,0 ; Otherwise, delay mode
LD DE,MSGDLY ; Corresponding display string
_SETM LD A,B ; Mode flag value to A
LD DE,(DESC) ; Load hardware description pointer
CALL PRTSTR ; Print description
;
; Test for timer running to determine if it can be used for delay
LD B,BF_SYSGET ; HBIOS: GET function
LD C,$D0 ; TIMER subfunction
RST 08 ; DE:HL := current tick count
LD A,L ; DE:HL == 0?
OR H
OR E
OR D
LD A,0 ; Assume no timer
LD DE,MSGDLY ; Delay mode msg
JR Z,SETDLY ; If tick count is zero, no timer active
LD A,$FF ; Value for timer active
LD DE,MSGTIM ; Timer mode msg
SETDLY:
LD (WMOD),A ; Save wait mode
CALL PRTSTR ; Print it
;
@ -121,20 +162,6 @@ _SETM LD A,B ; Mode flag value to A
RR E ; ... for delay factor
EX DE,HL ; Move result to HL
LD (QDLY),HL ; Save result as quark delay factor
;
; Test for hardware (sound chip detection)
LD DE,(PORTS) ; D := RDAT, E := RSEL
LD C,E ; Port = RSEL
LD A,2 ; Register 2
OUT (C),A ; Select register 2
LD C,D ; Port = RDAT
LD A,$AA ; Value = $AA
OUT (C),A ; Write $AA to register 2
LD C,E ; Port = RSEL
IN A,(C) ; Read back value in register 2
;CALL PRTHEX ; *debug*
CP $AA ; Value as written?
JP NZ,ERRHW ; If not, handle hardware error
;
; Clear heap storage
LD HL,HEAP ; Point to heap start
@ -148,7 +175,18 @@ _SETM LD A,B ; Mode flag value to A
LD A,(FCB+1) ; Get first char of filename
CP ' ' ; Compare to blank
JP Z,ERRCMD ; If so, missing filename
LD A,(FCB+9) ; Extension char 1
LD A,(FCB+9) ; If the filetype
CP ' ' ; is blanks
JR NZ,HASEXT ; then assume
LD A,'P' ; type PT3.
LD (FCB+9),A
LD A,'T' ; Fill in
LD (FCB+10),A ; the file
LD A,'3' ; extension
LD (FCB+11),A ; and the
LD C,TYPPT3 ; file type
JR _SET
HASEXT LD A,(FCB+9) ; Extension char 1
CP 'P' ; Check for 'P'
JP NZ,CHKMYM ; If not, check for MYM extension
LD A,(FCB+10) ; Extension char 2
@ -219,7 +257,7 @@ _LDX LD C,16 ; CPM Close File function
LD DE,MSGPLY ; Playing message
CALL PRTSTR ; Print message
;CALL CRLF2 ; Formatting
;CALL SLOWCPU
LD A,(FILTYP) ; Get file type
CP TYPPT2 ; PT2?
JR Z,GOPT2 ; If so, do it
@ -283,6 +321,7 @@ waitvb call WAITQ
jr mymlp
;
EXIT CALL START+8 ; Mute audio
;CALL NORMCPU
;CALL CRLF2 ; Formatting
LD DE,MSGEND ; Completion message
CALL PRTSTR ; Print message
@ -380,6 +419,70 @@ IDBIO2:
XOR A ; Setup return value of 0
RET ; and done
;
;
;
SLOWCPU:
LD A,(Z180) ; Z180 base I/O port
CP $FF ; Check for no value
RET Z ; Bail out if no value
ADD A,$1E ; Apply offset of CMR register
LD C,A ; And put it in C
LD B,0 ; MSB for 16-bit I/O
IN A,(C) ; Get current value
LD (CMRSAV),A ; Save it to restore later
XOR A ; Go slow
OUT (C),A ; And update CMR
INC C ; Now point to CCR register
IN A,(C) ; Get current value
LD (CCRSAV),A ; Save it to restore later
XOR A ; Go slow
OUT (C),A ; And update CCR
RET
;
;
;
NORMCPU:
LD A,(Z180) ; Z180 base I/O port
CP $FF ; Check for no value
RET Z ; Bail out if no value
ADD A,$1E ; Apply offset of CMR register
LD C,A ; And put it in C
LD B,0 ; MSB for 16-bit I/O
LD A,(CMRSAV) ; Get original CMR value
OUT (C),A ; And update CMR
INC C ; Now point to CCR register
LD A,(CCRSAV) ; Get original CCR value
OUT (C),A ; And update CCR
RET
;
;
;
SLOWIO:
LD A,(Z180) ; Z180 base I/O port
CP $FF ; Check for no value
RET Z ; Bail out if no value
ADD A,$32 ; Apply offset of DCNTL register
LD C,A ; And put it in C
LD B,0 ; MSB for 16-bit I/O
IN A,(C) ; Get current value
LD (DCSAV),A ; Save it to restore later
OR %00110000 ; Force slow operation (I/O W/S=3)
OUT (C),A ; And update DCNTL
RET
;
;
;
NORMIO:
LD A,(Z180) ; Z180 base I/O port
CP $FF ; Check for no value
RET Z ; Bail out if no value
ADD A,$32 ; Apply offset of DCNTL register
LD C,A ; And put it in C
LD B,0 ; MSB for 16-bit I/O
LD A,(DCSAV) ; Get saved DCNTL value
OUT (C),A ; And restore it
RET
;
; Print character in A without destroying any registers
;
PRTCHR:
@ -553,10 +656,25 @@ CRLF:
POP AF ; restore AF
RET
;
; ADD HL,A
;
; A REGISTER IS DESTROYED!
;
ADDHLA:
ADD A,L
LD L,A
RET NC
INC H
RET
;
ERRBIO: ; Invalid BIOS or version
LD DE,MSGBIO
JR ERR
;
ERRPLT: ; Invalid BIOS or version
LD DE,MSGPLT
JR ERR
;
ERRHW: ; Hardware error, sound chip not detected
LD DE,MSGHW
JR ERR
@ -586,38 +704,93 @@ ERR1: ; without the leading crlf
ERR2: ; without the string
CALL CRLF ; print newline
JP 0 ; fast exit
;
; CONFIG TABLE, ENTRY ORDER MATCHES HBIOS PLATFORM ID
;
CFGSIZ .EQU 8
;
CFGTBL: ; PLT RSEL RDAT RIN Z180 ACR
; DESC
.DB $01, $9A, $9B, $9A, $FF, $9C ; SBC W/ SCG
.DW HWSTR_SCG
;
.DB $04, $9C, $9D, $9C, $40, $FF ; N8 W/ ONBOARD PSG
.DW HWSTR_N8
;
.DB $05, $9A, $9B, $9A, $40, $9C ; MK4 W/ SCG
.DW HWSTR_SCG
;
.DB $07, $D8, $D0, $D8, $FF, $FF ; RCZ80 W/ RC SOUND MODULE (EB)
.DW HWSTR_RCEB
;
.DB $07, $D1, $D0, $D0, $FF, $FF ; RCZ80 W/ RC SOUND MODULE (MF)
.DW HWSTR_RCMF
;
.DB $08, $68, $60, $68, $C0, $FF ; RCZ180 W/ RC SOUND MODULE (EB)
.DW HWSTR_RCEB
;
.DB $08, $61, $60, $60, $C0, $FF ; RCZ180 W/ RC SOUND MODULE (MF)
.DW HWSTR_RCMF
;
.DB $09, $D8, $D0, $D8, $FF, $FF ; EZZ80 W/ RC SOUND MODULE (EB)
.DW HWSTR_RCEB
;
.DB $09, $D1, $D0, $D0, $FF, $FF ; EZZ80 W/ RC SOUND MODULE (EB)
.DW HWSTR_RCMF
;
.DB $0A, $68, $60, $68, $C0, $FF ; SCZ180 W/ RC SOUND MODULE (EB)
.DW HWSTR_RCEB
;
.DB $0A, $61, $60, $60, $C0, $FF ; SCZ180 W/ RC SOUND MODULE (MF)
.DW HWSTR_RCMF
;
.DB $FF ; END OF TABLE MARKER
;
CFG: ; ACTIVE CONFIG VALUES (FROM SELECTED CFGTBL ENTRY)
PLT .DB 0 ; RomWBW HBIOS platform id
PORTS:
RSEL .DB 0 ; Register selection port
RDAT .DB 0 ; Register data port
RIN .DB 0 ; Register input port
Z180 .DB 0 ; Z180 base I/O port
ACR .DB 0 ; Aux Ctrl Reg I/O port on SCG
DESC .DW 0 ; Hardware description string adr
;
CURPLT .DB 0 ; Current platform id reported by HBIOS
QDLY .DW 0 ; quark delay factor
WMOD .DB 0 ; delay mode, non-zero to use timer
DCSAV .DB 0 ; for saving Z180 DCNTL value
DCSAV .DB 0 ; for saving original Z180 DCNTL value
CCRSAV .DB 0 ; for saving original Z180 CCR value
CMRSAV .DB 0 ; for saving original Z180 CMR value
;
DMA .DW 0 ; Working DMA
FILTYP .DB 0 ; Sound file type (TYPPT2, TYPPT3, TYPMYM)
;
TMP .DB 0 ; work around use of undocumented Z80
;
PORTS:
RSEL .DB 0 ; Register selection port
RDAT .DB 0 ; Register data port
MSGBAN .DB "Tune Player for RomWBW v2.0, 28-Jan-2018",0
MSGUSE .DB "Copyright (C) 2018, Wayne Warthen, GNU GPL v3",13,10
MSGBAN .DB "Tune Player for RomWBW v2.5, 29-Mar-2020",0
MSGUSE .DB "Copyright (C) 2020, Wayne Warthen, GNU GPL v3",13,10
.DB "PTxPlayer Copyright (C) 2004-2007 S.V.Bulba",13,10
.DB "MYMPlay by Marq/Lieves!Tuore",13,10,13,10
.DB "Usage: TUNE <filename>.[PT2|PT3|MYM]",0
MSGBIO .DB "Incompatible BIOS or version, "
.DB "HBIOS v", '0' + RMJ, ".", '0' + RMN, " required",0
MSGPLT .DB "Hardware error, system not supported!",0
MSGHW .DB "Hardware error, sound chip not detected!",0
MSGNAM .DB "Sound filename invalid (must be .PT2, .PT3, or .MYM)",0
MSGFIL .DB "Sound file not found!",0
MSGSIZ .DB "Sound file too large to load!",0
MSGRC .DB "RC2014 Ed Brindley Sound Module",0
MSGN8 .DB "RetroBrew N8 Onboard Sound System",0
MSGSCG .DB "RetroBrew SCG ECB Adapter",0
MSGTIM .DB ", timer mode",0
MSGDLY .DB ", delay mode",0
MSGPLY .DB "Playing...",0
MSGEND .DB " Done",0
;
HWSTR_SCG .DB "SCG ECB Board",0
HWSTR_N8 .DB "N8 Onboard Sound",0
HWSTR_RCEB .DB "RC2014 Sound Module (EB)",0
HWSTR_RCMF .DB "RC2014 Sound Module (MF)",0
;
;===============================================================================
; PTx Player Routines
;===============================================================================
@ -2000,15 +2173,9 @@ LOUT OUT (C),A
#ENDIF
#IF WBW
LD A,(WMOD) ; If WMOD = 1, CPU is Z180
OR A ; Set flags
JR Z,LOUT0 ; Skip Z180 stuff
DI
IN0 A,(DCNTL) ; Get wait states
LD (DCSAV),A ; Save value
OR %00110000 ; Force slow operation (I/O W/S=3)
OUT0 (DCNTL),A ; And update DCNTL
LOUT0 LD DE,(PORTS) ; D := RDAT, E := RSEL
CALL SLOWIO
LD DE,(PORTS) ; D := RDAT, E := RSEL
XOR A ; start with reg 0
LD C,E ; point to address port
LD HL,AYREGS ; start of value list
@ -2025,11 +2192,8 @@ LOUT OUT (C),A ; select register
JP M,LOUT2 ; if bit 7 set, return w/o writing value
LD C,D ; select data port
OUT (C),A ; write value to register 13
LOUT2 LD A,(WMOD) ; If WMOD = 1, CPU is Z180
OR A ; Set flags
RET Z ; Skip Z180 stuff
LD A,(DCSAV) ; Get saved DCNTL value
OUT0 (DCNTL),A ; And restore it
LOUT2
CALL NORMIO
EI
RET ; And done
#ENDIF
@ -2175,7 +2339,7 @@ T_PACK .DB $06EC*2/256,$06EC*2
;
; MYMPLAY - Player for MYM-tunes
; MSX-version by Marq/Lieves!Tuore & Fit 30.1.2000
:
;
; 1.2.2000 - Added the disk loader. Thanks to Yzi & Plaque for examples.
; 7.2.2000 - Removed one unpack window -> freed 1.7kB memory
;
@ -2393,10 +2557,7 @@ upsg: ld a,(WMOD) ; if WMOD = 1, CPU is z180
or a ; set flags
jr z,upsg1 ; skip z180 stuff
di
in0 a,(DCNTL) ; get wait states
ld (DCSAV),a ; save value
or %00110000 ; force slow operation (i/o w/s=3)
out0 (DCNTL),a ; and update DCNTL
call SLOWIO
upsg1: ld hl,(psource)
ld de,(PORTS) ; E := RSEL, D := RDAT
@ -2431,11 +2592,7 @@ notrig: ld hl,(psource)
dec a
ld (played),a
endint: ld a,(WMOD) ; If WMOD = 1, CPU is Z180
or a ; Set flags
ret z ; Skip Z180 stuff
ld a,(DCSAV) ; Get saved DCNTL value
out0 (DCNTL),a ; And restore it
endint: call NORMIO
ei
ret ; And done
;
@ -2506,7 +2663,7 @@ T_NEW_3 .EQU T_OLD_3
PT2EMPTYORN .EQU VT_+31 ;1,0,0 sequence
NT_ .FILL 192 ;CreatedNoteTableAddress
NT_ .DS 192 ;CreatedNoteTableAddress
;local var
Ampl .EQU AYREGS+AmplC
@ -2524,10 +2681,11 @@ MDLADDR .EQU $
.ORG HEAP
; Reserve room for uncompressed data
uncomp:
.org $+(3*FRAG*REGS)
.DS (3*FRAG*REGS)
; The tune is stored here
rows: .dw 0
rows:
.DS 2 ; WORD value
data:
;
;===============================================================================

3
Source/Apps/XM/Build.cmd

@ -11,9 +11,12 @@ set ZXINCDIR=%TOOLS%\cpm\include\
zx mac xmdm125.asm $PO
zx slr180 -xmhb/HF
rem zx slr180 -xmuf/HF
zx mload25 XM=xmdm125,xmhb
rem zx mload25 XMUF=xmdm125,xmuf
rem set PROMPT=[Build] %PROMPT%
rem %comspec%
copy /Y XM.com ..\..\..\Binary\Apps\
rem copy /Y XMUF.com ..\..\..\Binary\Apps\

13
Source/Apps/XM/Makefile

@ -0,0 +1,13 @@
#OBJECTS = xm.com xmuf.com
OBJECTS = xm.com
DEST = ../../../Binary/Apps
TOOLS = ../../../Tools
OTHERS = *.hex
include $(TOOLS)/Makefile.inc
xm.com: xmdm125.hex xmhb.hex
$(ZXCC) $(CPM)/MLOAD25 XM=xmdm125,xmhb
#xmuf.com: xmdm125.hex xmuf.hex
# $(ZXCC) $(CPM)/MLOAD25 XMUF=xmdm125,xmuf

24
Source/Apps/XM/xmdm125.asm

@ -2214,6 +2214,14 @@ ILLDU: CALL ERXIT
RCVRECD:XRA A ; Initialize error count to zero
STA ERRCT
;
;WBW BEGIN: Be more patient waiting for host to start sending file
LDA FRSTIM ; WBW: Get first time flag
ORA A ; WBW: Set CPU flags
JNZ RCVRPT ; WBW: If not first time, bypass
MVI A,-10 ; WBW: Else increase error limit
STA ERRCT ; WBW: Save error new limit
;WBW END
;
RCVRPT: IF CONFUN ; Check for function key?
CALL FUNCHK ; Yeah, why not?
ENDIF
@ -2224,7 +2232,8 @@ RCVRPT: IF CONFUN ; Check for function key?
JNZ RCVSABT ; If so, bail out now...
ENDIF
;
MVI B,10-1 ; 10-second timeout
;MVI B,10-1 ; 10-second timeout
MVI B,5-1 ; WBW: 5-second timeout
CALL RECV ; Get any character received
JC RCVSTOT ; Timeout
;
@ -3448,9 +3457,18 @@ RSDMA: LXI D,TBUF ; Reset DMA address
WRERR: CALL RSDMA ; Reset DMA to normal
MVI C,CAN ; Cancel
CALL SEND ; Sender
; WBW BEGIN: RCVSABT does not return, so file write error
; message was never being displayed. Swapped things around
; to fix this.
; CALL RCVSABT ; Kill receive file
; CALL ERXIT ; Exit with msg:
; DB '++ Error writing file ++$'
; WBW: -----
CALL ILPRT ; Dispaly error msg
DB CR,LF,'++ Error writing file ++',CR,LF,0
CALL RCVSABT ; Kill receive file
CALL ERXIT ; Exit with msg:
DB '++ Error writing file ++$'
; WBW END
;
; Receive a character - timeout time is in 'B' in seconds. Entry via
; 'RECVDG' deletes garbage characters on the line. For example, having

639
Source/Apps/XM/xmhb.180

@ -1,19 +1,15 @@
;=======================================================================
;
; XMHB.Z80 - XMODEMXX PATCH FILE FOR ROMWBW HBIOS
; XMHB.Z80 - XMODEM12 PATCH FILE FOR ROMWBW HBIOS
;
; Wayne Warthen - wwarthen@gmail.com
; Updated: 2018-06-06
;
; 2018-06-06 WBW Added support for RC2014 w/ Z180
; 2019-08-17 WBW Refactored and merged Phil's ECB-FIFO support
; 2019-08-28 WBW Refactored ASCI support
;
;=======================================================================
;
; Overlay file is Z80, build with M80:
; M80 =XMHB
; L80 XMHB,XMHB/N/X/E
;
.Z80
ASEG
;
NO EQU 0
@ -31,22 +27,22 @@ BDOS EQU 00005H ; BDOS function dispatch vector
; one in XMODEM. Note the ORG of 103H - This jump table has no jump to
; 'BEGIN'.
;
ORG BASE + 3 ;start after 'JMP BEGIN'
ORG BASE + 3 ; start after 'JMP BEGIN'
;
JP CONOUT ;must be 00000h if not used, see below
JP MINIT ;initialization routine (if needed)
JP UNINIT ;undo whatever 'MINIT' did (or return)
JP CONOUT ; must be 00000h if not used, see below
JP MINIT ; initialization routine (if needed)
JP UNINIT ; undo whatever 'MINIT' did (or return)
JPTBL:
JP SENDR ;send character (via pop psw)
JP CAROK ;test for carrier
JP MDIN ;receive data byte
JP GETCHR ;get character from modem
JP RCVRDY ;check receive ready
JP SNDRDY ;check send ready
JP SPEED ;get speed value for file transfer time
JP EXTRA1 ;extra for custom routine
JP EXTRA2 ;extra for custom routine
JP EXTRA3 ;extra for custom routine
JP SENDR ; send character (via pop psw)
JP CAROK ; test for carrier
JP MDIN ; receive data byte
JP GETCHR ; get character from modem
JP RCVRDY ; check receive ready
JP SNDRDY ; check send ready
JP SPEED ; get speed value for file transfer time
JP EXTRA1 ; extra for custom routine
JP EXTRA2 ; extra for custom routine
JP EXTRA3 ; extra for custom routine
;
;-----------------------------------------------------------------------
;
@ -63,7 +59,6 @@ CONOUT EQU 0 ; not used
; entries as appropriate.
;
MINIT:
;
; Announce
LD DE,RBC ; RetroBrew Computers
LD C,9 ; BDOS string display function
@ -78,24 +73,39 @@ MINIT:
JR Z,UINIT ; Do UBIOS setup
;
; Neither UNA nor RomWBW
LD DE,BIOERR ; BIOS error message
LD DE,ERR_BIO ; BIOS error message
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
JP 0 ; Bail out!
;
HINIT:
MINIT_RET:
PUSH HL ; Save HL (JP table adr)
; Display port notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Newline
LD C,9 ; BDOS string display function
LD DE,CRLF ; Newline
CALL BDOS ; Do it
;
; Copy real vectors into active jump table
POP HL ; Recover HL
LD DE,JPTBL ; Real jump table is destination
LD BC,7 * 3 ; Copy 7 3-byte entries
LDIR ; Do the copy
;
; Return with CPU speed in A
LD A,(CPUSPD) ; A := CPU speed in MHz
LD HL,(RCVSCL) ; HL := receive scalar
RET ; and return
;
HINIT:
; Display RomWBW notification string
LD DE,HBTAG ; BIOS notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Get platform id from RomWBW HBIOS and save it
LD B,0F1H ; HBIOS VER function 0xF1
LD C,0 ; Required reserved value
RST 08 ; Do it, L := Platform ID
LD A,L ; Move to A
LD (PLTID),A ; Save it
;
; Get CPU speed from RomWBW HBIOS and save it
LD B,0F8H ; HBIOS SYSGET function 0xF8
@ -103,10 +113,21 @@ HINIT:
RST 08 ; Do it, L := CPU speed in MHz
LD A,L ; Move it to A
LD (CPUSPD),A ; Save it
JR MINIT1 ; Continue general initialization
;
UINIT:
; Get HBIOS character 0 device type
LD B,006H ; HBIOS DEVICE function 0x06
LD C,000H ; HBIOS char 0 device
RST 08 ; Do it, D=device type
LD A,D ; Put result in A
CP 000H ; UART?
JP Z,U_INIT ; If so, do UART init
CP 010H ; ASCI?
JP Z,A_INIT ; If so, do ASCI init
CP 080H ; USB-FIFO?
JP Z,UF_INIT ; If so, do USB-FIFO init
JP H_INIT ; Otherwise, use HBIOS I/O
;
UINIT:
; Display UNA notification string
LD DE,UBTAG ; BIOS notification string
LD C,9 ; BDOS string display function
@ -123,68 +144,20 @@ UINIT1:
INC E ; Fix up for value truncation
LD A,E ; Put in A
LD (CPUSPD),A ; Save it
JR MINIT1 ; Continue general initialization
;
MINIT1:
; NOTE: PLTID is only set if RomWBW HBIOS is active. This is OK
; because RC2014 is only supported by RomWBW HBIOS at this point.
LD A,(PLTID) ; Get the platform id
CP 7 ; Check for RC2014
JR Z,RCINIT ; Handle RC2014 special
CP 8 ; Check for RC2014 w/ Z180
JR Z,ARCINIT ; Handle RC2014 w/ Z180
;
; Check for Z180 which implies ASCI serial port
;
; Check CPU, Z80=UART, Z180=ASCI
LD DE,00202H ; D := 2, E := 2
MLT DE ; DE := D * E == 4
BIT 2,E ; Bit 2 wil be set if mlt happend
JR Z,MINIT2 ; Not Z180 (ASCI), look for others
LD HL,ASCI_JPTBL ; Point to Z180 (ASCI) jump table
LD DE,ASCI ; ASCI port notification string
JR MINIT3 ; Complete the initialization
;
MINIT2:
; Not a Z180, so assume RBC standard UART serial port
LD HL,UART_JPTBL ; Assume Z80 (UART)
LD DE,UART ; UART port notification string
JR MINIT3 ; Complete the initialization
;
RCINIT:
; RC2014, use HBIOS calls
LD HL,1250 ; Smaller receive loop tiemout scalar
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
LD HL,HBIOS_JPTBL ; HBIOS jump table address
LD DE,COMX ; HBIOS console notification string
JR MINIT3 ; Complete the initialization
;
ARCINIT:
; RC2014 running Z180
LD HL,ARC_JPTBL ; ASCI RC2014 jump table address
LD DE,ASCIRC ; ASCI RC2014 console notification string
JR MINIT3 ; Complete the initialization
;
MINIT3:
PUSH HL ; Save HL
; Display port notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
JP Z,U_INIT ; UART initialization
JP A_INIT ; otherwise, ASCI
;
; Newline
HWERR:
; Failed to identify target comm hardware
LD DE,ERR_HW ; Hardware error message
LD C,9 ; BDOS string display function
LD DE,CRLF ; Newline
CALL BDOS ; Do it
;
; Copy real vectors into active jump table
POP HL ; Recover HL
LD DE,JPTBL ; Real jump table is destination
LD BC,7 * 3 ; Copy 7 3-byte entries
LDIR ; Do the copy
;
; Return with CPU speed in A
LD A,(CPUSPD) ; A := CPU speed in MHz
LD HL,(RCVSCL) ; HL := receive scalar
RET ; and return
JP 0 ; Bail out!
;
; Identify active BIOS. RomWBW HBIOS=1, UNA UBIOS=2, else 0
;
@ -223,32 +196,32 @@ IDBIO2:
XOR A ; Setup return value of 0
RET ; and done
;
;
;
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
PLTID DB 0 ; Platform ID
CPUSPD DB 10 ; CPU speed in MHz
RCVSCL DW 2800 ; RECV loop timeout scalar
;
RBC DB "RBC, 06-Jun-2018$"
;
UART DB ", UART0$"
ASCI DB ", ASCI0$"
ASCIRC DB ", ASCI0 (RC2014)$"
COMX DB ", COM0$"
;
UBTAG DB " [UNA]$"
HBTAG DB " [WBW]$"
;
CRLF DB 13, 10, "$"
;
BIOERR DB 13, 10, 13, 10, "++ Unknown BIOS ++", 13, 10, "$"
;
;-----------------------------------------------------------------------
;
; Uninitialize modem
;
UNINIT:
LD A,(BIOID)
CP 1 ; Is HBIOS?
JR Z,H_UNINIT ; Handle HBIOS
CP 2 ; Is UBIOS?
JR Z,U_UNINIT ; Handle UBIOS
RET ; Just return
;
H_UNINIT:
; HBIOS: Reset character device 0
LD B,04H ; HBIOS CIOINIT function 0x04
LD C,0 ; Unit = 0
LD DE,-1 ; Reset w/ current settings
RST 08 ; Do it
RET ; not initialized, so no 'UN-INITIALIZE'
;
U_UNINIT:
; UBIOS: Reset character device 0
LD C,10H ; UNA INIT function 0x10
LD B,0 ; Unit = 0
LD DE,-1 ; Reset w/ current settings
RST 08 ; Do it
RET ; not initialized, so no 'UN-INITIALIZE'
;
;-----------------------------------------------------------------------
@ -268,12 +241,30 @@ EXTRA2:
EXTRA3:
RET
;
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
CPUSPD DB 10 ; CPU speed in MHz
RCVSCL DW 6600 ; RECV loop timeout scalar
;
RBC DB "RBC, 28-Aug-2019$"
;
U_LBL DB ", UART$"
A_LBL DB ", ASCI$"
S_LBL DB ", SIO$"
H_LBL DB ", COM$"
UF_LBL DB ", USB-FIFO$"
;
UBTAG DB " [UNA]$"
HBTAG DB " [WBW]$"
;
CRLF DB 13, 10, "$"
;
ERR_BIO DB 13, 10, 13, 10, "++ Unknown BIOS ++", 13, 10, "$"
ERR_HW DB 13, 10, 13, 10, "++ Unknown Hardware ++", 13, 10, "$"
;
;=======================================================================
;=======================================================================
;
; Standard RBC Projects 8250-like UART port @ 68H
;
; Will be used for all RBC Z80 systems.
; 8250-like UART @ Port 68H
;
;=======================================================================
;=======================================================================
@ -291,12 +282,13 @@ U_RCVR EQU 01H ; value when ready to receive
U_PARE EQU 04H ; bit for parity error
U_OVRE EQU 02H ; bit for overrun error
U_FRME EQU 08H ; bit for framing error
U_ERRS EQU U_FRME | U_OVRE | U_PARE
;
; Following jump table is dynamically patched into real jump
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
UART_JPTBL:
U_JPTBL:
JP U_SENDR ; send character (via pop psw)
JP U_CAROK ; test for carrier
JP U_MDIN ; receive data byte
@ -307,6 +299,18 @@ UART_JPTBL:
;
;-----------------------------------------------------------------------
;
; UART initialization
;
U_INIT:
LD HL,13000 ; Receive loop timeout scalar
LD (RCVSCL),HL ; ... for UART RCVRDY timing
;
LD HL,U_JPTBL
LD DE,U_LBL
JP MINIT_RET
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
U_SENDR:
@ -316,7 +320,7 @@ U_SENDR:
;
;-----------------------------------------------------------------------
;
; Test and rep;ort carrier status, Z set if carrier present
; Test and report carrier status, Z set if carrier present
;
U_CAROK:
XOR A ; not used, always indicate present
@ -345,7 +349,7 @@ U_RCVRDY:
; With error detection (slower)
PUSH BC ; save scratch register
PUSH AF ; save full status on stack
AND U_FRME | U_OVRE | U_PARE ; isolate line err bits
AND U_ERRS ; isolate line err bits
LD B,A ; save err status in B
POP AF ; get full status back
AND U_RCVB ; isolate ready bit
@ -385,53 +389,98 @@ U_SPEED:
;=======================================================================
;=======================================================================
;
; Standard RBC Projects Z180 primary ASCI port
; Z180 Primary ASCI
;
; Will be used for all RBC Z180 systems.
; - Port is determined dynamically in A_INIT
;
;=======================================================================
;=======================================================================
;
; ASCI port constants
;
A_DATP EQU 48H ;Z180 TSR - ASCI receive data port
A_DATO EQU 46H ;Z180 TDR - ASCI transmit data port
A_CTLP EQU 44H ;Z180 STAT - ASCI status port
A_CTL2 EQU 40H ;Z180 CNTLA - ASCI control port
A_DATP EQU 08H ; Z180 TSR - ASCI receive data port
A_DATO EQU 06H ; Z180 TDR - ASCI transmit data port
A_CTLP EQU 04H ; Z180 STAT - ASCI status port
A_CTL2 EQU 00H ; Z180 CNTLA - ASCI control port
;
A_SNDB EQU 02H ; Z180 STAT:TDRE - xmit data reg empty bit
A_SNDR EQU 02H ; Z180 STAT:TDRE - xmit data reg empty value
A_RCVB EQU 80H ; Z180 STAT:RDRF - rcv data reg full bit
A_RCVR EQU 80H ; Z180 STAT:RDRF - rcv data reg full value
A_PARE EQU 20H ; Z180 STAT:PE - parity error bit
A_OVRE EQU 40H ; Z180 STAT:OVRN - overrun error bit
A_FRME EQU 10H ; Z180 STAT:FE - framing error bit
A_ERRS EQU A_FRME | A_OVRE | A_PARE
;
A_SNDB EQU 02H ;Z180 STAT:TDRE - xmit data reg empty bit
A_SNDR EQU 02H ;Z180 STAT:TDRE - xmit data reg empty value
A_RCVB EQU 80H ;Z180 STAT:RDRF - rcv data reg full bit
A_RCVR EQU 80H ;Z180 STAT:RDRF - rcv data reg full value
A_PARE EQU 20H ;Z180 STAT:PE - parity error bit
A_OVRE EQU 40H ;Z180 STAT:OVRN - overrun error bit
A_FRME EQU 10H ;Z180 STAT:FE - framing error bit
A_BASE DB 00H ; internal IO base address for Z180
;
; Following jump table is dynamically patched over initial jump
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
ASCI_JPTBL:
JP A_SENDR ;send character (via pop psw)
JP A_CAROK ;test for carrier
JP A_MDIN ;receive data byte
JP A_GETCHR ;get character from modem
JP A_RCVRDY ;check receive ready
JP A_SNDRDY ;check send ready
JP A_SPEED ;get speed value for file transfer time
A_JPTBL:
JP A_SENDR ; send character (via pop psw)
JP A_CAROK ; test for carrier
JP A_MDIN ; receive data byte
JP A_GETCHR ; get character from modem
JP A_RCVRDY ; check receive ready
JP A_SNDRDY ; check send ready
JP A_SPEED ; get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
; ASCI initialization
;
A_INIT:
LD HL,7500 ; Receive loop timeout scalar
LD (RCVSCL),HL ; ... for ASCI RCVRDY timing
;
; Test for location of Z180 internal registers
; and use appropriate I/O address.
LD B,0 ; set MSB for 16 bit I/O
LD C,040H|3FH ; internal registers @ 40H?
IN A,(C) ; read
CP 040H|01FH ; same value except for bit 5?
JR Z,A_INIT1 ; do ASCI init (port in C)
LD C,0C0H|3FH ; internal registers @ C0H?
IN A,(C) ; read
CP 0C0H|1FH ; same value except for bit 5?
JR Z,A_INIT1 ; do ASCI init (port in C)
JP HWERR ; unknown hardware error
;
A_INIT1:
LD A,C ; test port value to A
AND 0C0H ; only top two bits relevant
LD (A_BASE),A ; save it
ADD A,A_CTLP ; status port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
XOR A ; clear interrupt enable flags
OUT (C),A ; do it
;
LD HL,A_JPTBL
LD DE,A_LBL
JP MINIT_RET
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
A_SENDR:
POP AF ; get character to send from stack
OUT0 (A_DATO),A ; send to port
RET
EX (SP),HL ; save HL, HL := char to send
PUSH BC ; save scratch register
LD A,(A_BASE) ; IO base address
ADD A,A_DATO ; data out port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
OUT (C),H ; send to port
POP BC ; restore scratch reg
POP HL ; restore HL
RET ; done
;
;-----------------------------------------------------------------------
;
; Test and rep;ort carrier status, Z set if carrier present
; Test and report carrier status, Z set if carrier present
;
A_CAROK:
XOR A ; not used, always indicate present
@ -443,7 +492,13 @@ A_CAROK:
;
A_MDIN:
A_GETCHR:
IN0 A,(A_DATP) ; read character from port
PUSH BC ; save scratch register
LD A,(A_BASE) ; IO base address
ADD A,A_DATP ; data in port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
IN A,(C) ; read character from port
POP BC ; restore scratch reg
RET
;
;-----------------------------------------------------------------------
@ -453,10 +508,14 @@ A_GETCHR:
; *** Error code does not seem to be used ***
;
A_RCVRDY:
IN0 A,(A_CTLP) ; get modem status
PUSH BC ; save scratch register
LD A,(A_BASE) ; IO base address
ADD A,A_CTLP ; status port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
IN A,(C) ; get modem status
PUSH AF ; save full status on stack
AND A_FRME | A_OVRE | A_PARE ; isolate line err bits
AND A_ERRS ; isolate line err bits
LD B,A ; save err status in B
; Z180 ASCI ports will stall if there are errors.
@ -464,11 +523,17 @@ A_RCVRDY:
; the status register. Below, bit 3 of ASCI
; control register is written with a zero to
; clear error(s) if needed.
JP Z,A_RCVRDY2 ; if no errs, continue
IN0 A,(A_CTL2) ; get current control register
JR Z,A_RCVRDY2 ; if no errs, continue
PUSH BC ; save scratch reg
LD A,(A_BASE) ; IO base address
ADD A,A_CTL2 ; status port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
IN A,(C) ; get current control reg value
AND 0F7H ; force err reset bit to zero
OUT0 (A_CTL2),A ; write control register
OUT (C),A ; write control register
POP BC ; restore scratch reg
;
A_RCVRDY2:
POP AF ; get full status back
AND A_RCVB ; isolate ready bit
@ -482,9 +547,15 @@ A_RCVRDY2:
; Test for ready to send a character, Z = ready
;
A_SNDRDY:
IN A,(A_CTLP) ; get status
PUSH BC ; save scratch register
LD A,(A_BASE) ; IO base address
ADD A,A_CTLP ; status port offset
LD C,A ; put in C for I/O
LD B,0 ; MSB for 16 bit I/O
IN A,(C) ; get modem status
AND A_SNDB ; isolate transmit ready bit
CP A_SNDR ; test for ready value
POP BC ; restore scratch register
RET
;
;-----------------------------------------------------------------------
@ -498,47 +569,71 @@ A_SPEED:
;=======================================================================
;=======================================================================
;
; RC2014 Z180 primary ASCI port
;
; Will be used for all RC2014 Z180 systems.
; Zilog SIO @ Port 80H
;
;=======================================================================
;=======================================================================
;
; ASCI port constants for RC2014
; Currently assumes the port address and ordering conventions of the
; official RC2014 SIO module. Will not work with others such as EZZ80
; or ZP.
;
AR_DATP EQU 0C8H ;Z180 TSR - ASCI receive data port
AR_DATO EQU 0C6H ;Z180 TDR - ASCI transmit data port
AR_CTLP EQU 0C4H ;Z180 STAT - ASCI status port
AR_CTL2 EQU 0C0H ;Z180 CNTLA - ASCI control port
; SIO port constants
;
; Following jump table is dynamically patched over initial jump
S_BASE EQU 80H ; SIO base port
S_DATP EQU S_BASE + 1 ; data in port
S_DATO EQU S_BASE + 1 ; data out port
S_CTLP EQU S_BASE + 0 ; control/status port
S_SNDB EQU 04H ; bit to test for send ready
S_SNDR EQU 04H ; value when ready to send
S_RCVB EQU 01H ; bit to test for receive ready
S_RCVR EQU 01H ; value when ready to receive
;
; Following jump table is dynamically patched into real jump
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
ARC_JPTBL:
JP AR_SENDR ;send character (via pop psw)
JP AR_CAROK ;test for carrier
JP AR_MDIN ;receive data byte
JP AR_GETCHR ;get character from modem
JP AR_RCVRDY ;check receive ready
JP AR_SNDRDY ;check send ready
JP AR_SPEED ;get speed value for file transfer time
S_JPTBL:
JP S_SENDR ; send character (via pop psw)
JP S_CAROK ; test for carrier
JP S_MDIN ; receive data byte
JP S_GETCHR ; get character from modem
JP S_RCVRDY ; check receive ready
JP S_SNDRDY ; check send ready
JP S_SPEED ; get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
; SIO initialization
;
S_INIT:
LD HL,12000 ; Receive loop timeout scalar
LD (RCVSCL),HL ; ... for UART RCVRDY timing
;
; Suppress interrupts
LD A,01H ; WR1
OUT (S_CTLP),A ; Select WR1
XOR A ; No interrupts
OUT (S_CTLP),A ; Do it
;
LD HL,S_JPTBL
LD DE,S_LBL
JP MINIT_RET
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
AR_SENDR:
S_SENDR:
POP AF ; get character to send from stack
OUT0 (AR_DATO),A ; send to port
OUT (S_DATO),A ; send to port
RET
;
;-----------------------------------------------------------------------
;
; Test and rep;ort carrier status, Z set if carrier present
; Test and report carrier status, Z set if carrier present
;
AR_CAROK:
S_CAROK:
XOR A ; not used, always indicate present
RET
;
@ -546,9 +641,9 @@ AR_CAROK:
;
; Get a character (assume character ready has already been tested)
;
AR_MDIN:
AR_GETCHR:
IN0 A,(AR_DATP) ; read character from port
S_MDIN:
S_GETCHR:
IN A,(S_DATP) ; read character from port
RET
;
;-----------------------------------------------------------------------
@ -557,55 +652,40 @@ AR_GETCHR:
; Error code returned in A register
; *** Error code does not seem to be used ***
;
AR_RCVRDY:
IN0 A,(AR_CTLP) ; get modem status
PUSH BC ; save scratch register
PUSH AF ; save full status on stack
AND A_FRME | A_OVRE | A_PARE ; isolate line err bits
LD B,A ; save err status in B
; Z180 ASCI ports will stall if there are errors.
; Error bits are NOT cleared by merely reading
; the status register. Below, bit 3 of ASCI
; control register is written with a zero to
; clear error(s) if needed.
JP Z,A_RCVRDY2 ; if no errs, continue
IN0 A,(AR_CTL2) ; get current control register
AND 0F7H ; force err reset bit to zero
OUT0 (AR_CTL2),A ; write control register
AR_RCVRDY2:
POP AF ; get full status back
AND A_RCVB ; isolate ready bit
CP A_RCVR ; test it (set flags)
LD A,B ; get the error code back
POP BC ; restore scratch register
S_RCVRDY:
;XOR A
;OUT (S_CTLP),A ; select WR0
IN A,(S_CTLP) ; get status
AND S_RCVB ; isolate ready bit
CP S_RCVR ; test it (set flags)
LD A,0 ; report no line errors
RET
;
;-----------------------------------------------------------------------
;
; Test for ready to send a character, Z = ready
;
AR_SNDRDY:
IN A,(AR_CTLP) ; get status
AND A_SNDB ; isolate transmit ready bit
CP A_SNDR ; test for ready value
S_SNDRDY:
;XOR A
;OUT (S_CTLP),A ; select WR0
IN A,(S_CTLP) ; get status
AND S_SNDB ; isolate ready bit
CP S_SNDR ; test it (set flags)
LD A,0 ; report no line errors
RET
;
;-----------------------------------------------------------------------
;
; Report baud rate (index into SPTBL returned in register A)
;
AR_SPEED:
S_SPEED:
LD A,8 ; arbitrarily return 9600 baud
RET
;
;=======================================================================
;=======================================================================
;
; HBIOS CONSOLE (COM0:)
;
; Will be used for all RC2014 systems
; HBIOS Console (COM0:)
;
;=======================================================================
;=======================================================================
@ -614,20 +694,32 @@ AR_SPEED:
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
HBIOS_JPTBL:
JP HB_SENDR ;send character (via pop psw)
JP HB_CAROK ;test for carrier
JP HB_MDIN ;receive data byte
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
H_JPTBL:
JP H_SENDR ; send character (via pop psw)
JP H_CAROK ; test for carrier
JP H_MDIN ; receive data byte
JP H_GETCHR ; get character from modem
JP H_RCVRDY ; check receive ready
JP H_SNDRDY ; check send ready
JP H_SPEED ; get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
; HBIOS initialization
;
H_INIT:
LD HL,1250 ; Smaller receive loop timeout scalar
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
;
LD HL,H_JPTBL
LD DE,H_LBL
JP MINIT_RET
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
HB_SENDR:
H_SENDR:
POP AF ; get character to send from stack
PUSH BC
PUSH DE
@ -643,9 +735,9 @@ HB_SENDR:
;
;-----------------------------------------------------------------------
;
; Test and rep;ort carrier status, Z set if carrier present
; Test and report carrier status, Z set if carrier present
;
HB_CAROK:
H_CAROK:
XOR A ; not used, always indicate present
RET
;
@ -655,23 +747,23 @@ HB_CAROK:
;
; This routine must NOT block.
;
HB_MDIN:
HB_GETCHR:
H_MDIN:
H_GETCHR:
PUSH BC
PUSH DE
PUSH HL
LD B,02H ; HBIOS IST function
LD C,0 ; console is unit 0 by fiat
RST 08 ; HBIOS call, A := bytes pending
JR NZ,HB_MDIN1 ; If char(s) waiting, go get it
JR NZ,H_MDIN1 ; If char(s) waiting, go get it
XOR A ; otherwise, return null
JR HB_MDIN2 ; and done
HB_MDIN1:
JR H_MDIN2 ; and done
H_MDIN1:
LD B,00H ; HBIOS IN function
LD C,0 ; console is unit 0 by fiat
RST 08 ; HBIOS call
LD A,E ; byte received to A
HB_MDIN2:
H_MDIN2:
POP HL
POP DE
POP BC
@ -683,7 +775,7 @@ HB_MDIN2:
; Error code returned in A register
; *** Error code does not seem to be used ***
;
HB_RCVRDY:
H_RCVRDY:
PUSH BC
PUSH DE
PUSH HL
@ -703,7 +795,7 @@ HB_RCVRDY:
;
; Test for ready to send a character, Z = ready
;
HB_SNDRDY:
H_SNDRDY:
PUSH BC
PUSH DE
PUSH HL
@ -722,7 +814,106 @@ HB_SNDRDY:
;
; Report baud rate (index into SPTBL returned in register A)
;
HB_SPEED:
H_SPEED:
LD A,8 ; arbitrarily return 9600 baud
RET
;
;
;=======================================================================
;=======================================================================
;
; WILL SOWERBUTTS ECB USB-FIFO
;
;=======================================================================
;=======================================================================
;
UF_BASE EQU 0CH
UF_DATA EQU (UF_BASE+0)
UF_STATUS EQU (UF_BASE+1)
UF_SEND_IMM EQU (UF_BASE+2)
;
; Following jump table is dynamically patched over initial jump
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
UF_JPTBL:
JP UF_SENDR ; send character (via pop psw)
JP UF_CAROK ; test for carrier
JP UF_MDIN ; receive data byte
JP UF_GETCHR ; get character from modem
JP UF_RCVRDY ; check receive ready
JP UF_SNDRDY ; check send ready
JP UF_SPEED ; get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
; USB-FIFO initialization
;
UF_INIT:
LD HL,12000 ; Receive loop timeout scalar
LD (RCVSCL),HL ; ... for UART RCVRDY timing
;
LD HL,UF_JPTBL
LD DE,UF_LBL
JP MINIT_RET
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
UF_SENDR:
POP AF ; get character to send from stack
OUT (UF_DATA),A ; WRITE TO FIFO
OUT (UF_SEND_IMM),A ; SEND IMMEDIATE
RET
;
;-----------------------------------------------------------------------
;
; Test and report carrier status, Z set if carrier present
;
UF_CAROK:
XOR A ; not used, always indicate present
RET
;
;-----------------------------------------------------------------------
;
; Get a character (assume character ready has already been tested)
;
; This routine must NOT block.
;
UF_MDIN:
UF_GETCHR:
IN A,(UF_DATA) ; GET CHAR
RET
;
;-----------------------------------------------------------------------
;
; Test for character ready to receive, Z = ready
; Error code returned in A register
; *** Error code does not seem to be used ***
;
UF_RCVRDY:
IN A,(UF_STATUS) ; B7=0 IF CHAR AVAIL, =1 IF NO CHAR.
RLCA ; B0=0 IF CHAR AVAIL, =1 IF NO CHAR.
AND 00000001B ; A=0, ZF=1 IF NO CHAR, A=1, ZF=0 IF CHAR AVAIL,
LD A,0
RET
;
;-----------------------------------------------------------------------
;
; Test for ready to send a character, Z = ready
;
UF_SNDRDY:
IN A,(UF_STATUS) ; Bit 0=0 IF SPACE AVAIL, =1 IF FULL
AND 00000001B ; A=0, ZF=1 IF SPACE AVAIL, A=1, ZF=0 IF FULL.
RET
;
;-----------------------------------------------------------------------
;
; Report baud rate (index into SPTBL returned in register A)
;
UF_SPEED:
LD A,8 ; arbitrarily return 9600 baud
RET
;

331
Source/Apps/XM/xmuf.180

@ -0,0 +1,331 @@
;=======================================================================
;
; XMUF.Z80 - XMODEMXX PATCH FILE FOR ECB USB-FIFO
;
; Phil Summers - difficultylevelhigh@gmail.com
; Updated: 2019-08-16
;
;=======================================================================
;
; Overlay file is Z80, build with M80:
; M80 =XMHB
; L80 XMHB,XMHB/N/X/E
;
.Z80
ASEG
;
NO EQU 0
YES EQU NOT NO
;
ERRDET EQU NO ; detect parity/framing/overrun errs
;
BASE EQU 100H ; start of cp/m normal program area
;
BDOS EQU 00005H ; BDOS function dispatch vector
;
;=======================================================================
;
; Jump table: The jump table must be in exactly the same sequence as the
; one in XMODEM. Note the ORG of 103H - This jump table has no jump to
; 'BEGIN'.
;
ORG BASE + 3 ;start after 'JMP BEGIN'
;
JP CONOUT ;must be 00000h if not used, see below
JP MINIT ;initialization routine (if needed)
JP UNINIT ;undo whatever 'MINIT' did (or return)
JPTBL:
JP SENDR ;send character (via pop psw)
JP CAROK ;test for carrier
JP MDIN ;receive data byte
JP GETCHR ;get character from modem
JP RCVRDY ;check receive ready
JP SNDRDY ;check send ready
JP SPEED ;get speed value for file transfer time
JP EXTRA1 ;extra for custom routine
JP EXTRA2 ;extra for custom routine
JP EXTRA3 ;extra for custom routine
;
;-----------------------------------------------------------------------
;
; Output character to console
;
CONOUT EQU 0 ; not used
;
;-----------------------------------------------------------------------
;
; Initialize modem
;
; This procedure has been usurped to dynamically detect the type
; of system we are running on and install the *real* jump table
; entries as appropriate.
;
MINIT:
;
; Announce
LD DE,RBC ; RetroBrew Computers
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Identify BIOS (RomWBW HBIOS or UNA UBIOS)
CALL IDBIO ; 1=HBIOS, 2=UBIOS
LD (BIOID),A ; Save it
DEC A ; Test for HBIOS
JR Z,HINIT ; Do HBIOS setup
DEC A ; Test for UBIOS
JR Z,UINIT ; Do UBIOS setup
;
; Neither UNA nor RomWBW
LD DE,BIOERR ; BIOS error message
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
JP 0 ; Bail out!
;
HINIT:
;
; Display RomWBW notification string
LD DE,HBTAG ; BIOS notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Get platform id from RomWBW HBIOS and save it
LD B,0F1H ; HBIOS VER function 0xF1
LD C,0 ; Required reserved value
RST 08 ; Do it, L := Platform ID
LD A,L ; Move to A
LD (PLTID),A ; Save it
;
; Get CPU speed from RomWBW HBIOS and save it
LD B,0F8H ; HBIOS SYSGET function 0xF8
LD C,0F0H ; CPUINFO subfunction 0xF0
RST 08 ; Do it, L := CPU speed in MHz
LD A,L ; Move it to A
LD (CPUSPD),A ; Save it
JR MINIT1 ; Continue general initialization
;
UINIT:
;
; Display UNA notification string
LD DE,UBTAG ; BIOS notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Get CPU speed from UNA and save it
LD C,0F8H ; UNA BIOS Get PHI function
RST 08 ; Returns speed in Hz in DE:HL
LD B,4 ; Divide MHz in DE:HL by 100000H
UINIT1:
SRL D ; ... to get approx CPU speed in
RR E ; ...MHz. Throw away HL, and
DJNZ UINIT1 ; ...right shift DE by 4.
INC E ; Fix up for value truncation
LD A,E ; Put in A
LD (CPUSPD),A ; Save it
JR MINIT1 ; Continue general initialization
;
MINIT1:
LD HL,1250 ; Smaller receive loop timeout scalar
LD (RCVSCL),HL ; ... to compensate for BIOS overhead
LD HL,UF_JPTBL ; HBIOS jump table address
LD DE,USB_FIFO ; HBIOS console notification string
JR MINIT3 ; Complete the initialization
;
MINIT3:
PUSH HL ; Save HL
; Display port notification string
LD C,9 ; BDOS string display function
CALL BDOS ; Do it
;
; Newline
LD C,9 ; BDOS string display function
LD DE,CRLF ; Newline
CALL BDOS ; Do it
;
; Copy real vectors into active jump table
POP HL ; Recover HL
LD DE,JPTBL ; Real jump table is destination
LD BC,7 * 3 ; Copy 7 3-byte entries
LDIR ; Do the copy
;
; Return with CPU speed in A
LD A,(CPUSPD) ; A := CPU speed in MHz
LD HL,(RCVSCL) ; HL := receive scalar
RET ; and return
;
; Identify active BIOS. RomWBW HBIOS=1, UNA UBIOS=2, else 0
;
IDBIO:
;
; Check for UNA (UBIOS)
LD A,(0FFFDH) ; fixed location of UNA API vector
CP 0C3H ; jp instruction?
JR NZ,IDBIO1 ; if not, not UNA
LD HL,(0FFFEH) ; get jp address
LD A,(HL) ; get byte at target address
CP 0FDH ; first byte of UNA push ix instruction
JR NZ,IDBIO1 ; if not, not UNA
INC HL ; point to next byte
LD A,(HL) ; get next byte
CP 0E5H ; second byte of UNA push ix instruction
JR NZ,IDBIO1 ; if not, not UNA, check others
LD A,2 ; UNA BIOS id = 2
RET ; and done
;
IDBIO1:
; Check for RomWBW (HBIOS)
LD HL,(0FFFEH) ; HL := HBIOS ident location
LD A,'W' ; First byte of ident
CP (HL) ; Compare
JR NZ,IDBIO2 ; Not HBIOS
INC HL ; Next byte of ident
LD A,~'W' ; Second byte of ident
CP (HL) ; Compare
JR NZ,IDBIO2 ; Not HBIOS
LD A,1 ; HBIOS BIOS id = 1
RET ; and done
;
IDBIO2:
; No idea what this is
XOR A ; Setup return value of 0
RET ; and done
;
;
;
BIOID DB 0 ; BIOS ID, 1=HBIOS, 2=UBIOS
PLTID DB 0 ; Platform ID
CPUSPD DB 10 ; CPU speed in MHz
RCVSCL DW 2800 ; RECV loop timeout scalar
;
RBC DB "RBC, 16-Aug-2018$"
;
USB_FIFO DB ", USB-FIFO$"
;
UBTAG DB " [UNA]$"
HBTAG DB " [WBW]$"
;
CRLF DB 13, 10, "$"
;
BIOERR DB 13, 10, 13, 10, "++ Unknown BIOS ++", 13, 10, "$"
;
;-----------------------------------------------------------------------
;
; Uninitialize modem
;
UNINIT:
LD A,(BIOID)
CP 1 ; Is HBIOS?
RET NZ ; If not, just return
; Reset character device 0
LD B,04H ; HBIOS CIOINIT function 0x04
LD C,0 ; Unit = 0
LD DE,-1 ; Reset w/ current settings
RST 08 ; Do it
RET ; not initialized, so no 'UN-INITIALIZE'
;
;-----------------------------------------------------------------------
;
; The following are all dummy routines that are unused because MINIT
; dynamically installs the real jump table.
;
SENDR:
CAROK:
MDIN:
GETCHR:
RCVRDY:
SNDRDY:
SPEED:
EXTRA1:
EXTRA2:
EXTRA3:
RET
;
;=======================================================================
;=======================================================================
;
; WILL SOWERBUTTS ECB USB-FIFO
;
;=======================================================================
;=======================================================================
;
FIFO_BASE EQU 0CH
FIFO_DATA EQU (FIFO_BASE+0)
FIFO_STATUS EQU (FIFO_BASE+1)
FIFO_SEND_IMM EQU (FIFO_BASE+2)
;
; Following jump table is dynamically patched over initial jump
; table at program startup. See MINIT above. Note that only a
; subset of the jump table is overlaid (SENDR to SPEED).
;
UF_JPTBL:
JP UF_SENDR ;send character (via pop psw)
JP UF_CAROK ;test for carrier
JP UF_MDIN ;receive data byte
JP UF_GETCHR ;get character from modem
JP UF_RCVRDY ;check receive ready
JP UF_SNDRDY ;check send ready
JP UF_SPEED ;get speed value for file transfer time
;
;-----------------------------------------------------------------------
;
; Send character on top of stack
;
UF_SENDR:
POP AF ; get character to send from stack
OUT (FIFO_DATA),A ; WRITE TO FIFO
OUT (FIFO_SEND_IMM),A ; SEND IMMEDIATE
RET
;
;-----------------------------------------------------------------------
;
; Test and report carrier status, Z set if carrier present
;
UF_CAROK:
XOR A ; not used, always indicate present
RET
;
;-----------------------------------------------------------------------
;
; Get a character (assume character ready has already been tested)
;
; This routine must NOT block.
;
UF_MDIN:
UF_GETCHR:
IN A,(FIFO_DATA) ; GET CHAR
RET
;
;-----------------------------------------------------------------------
;
; Test for character ready to receive, Z = ready
; Error code returned in A register
; *** Error code does not seem to be used ***
;
UF_RCVRDY:
IN A,(FIFO_STATUS) ; B7=0 IF CHAR AVAIL, =1 IF NO CHAR.
RLCA ; B0=0 IF CHAR AVAIL, =1 IF NO CHAR.
AND 00000001B ; A=0, ZF=1 IF NO CHAR, A=1, ZF=0 IF CHAR AVAIL,
LD A,0
RET
;
;-----------------------------------------------------------------------
;
; Test for ready to send a character, Z = ready
;
UF_SNDRDY:
IN A,(FIFO_STATUS) ; Bit 0=0 IF SPACE AVAIL, =1 IF FULL
AND 00000001B ; A=0, ZF=1 IF SPACE AVAIL, A=1, ZF=0 IF FULL.
RET
;
;-----------------------------------------------------------------------
;
; Report baud rate (index into SPTBL returned in register A)
;
UF_SPEED:
LD A,8 ; arbitrarily return 9600 baud
RET
;
END

15
Source/BPBIOS/@WBW Issues.txt

@ -0,0 +1,15 @@
Loader uses CBIOS Disk I/O prior to CBOOT/WBOOT being run. As a
result, DIOBUF is not properly initialized. At present, it is
initialized to $7C00 which will work unless the location of the
physical disk buffer in HBIOS ever changes!
The clock drivers supplied with BPBIOS (LDDS, LDP2D, and LDNZT)
load into ZSYS user memory. If the user segment is not at the
same location as the original BPBIOS ($E900), then the clock
driver will just overlay other code. At present, the N config
is OK because it does not relocate the user segment, but the T
config fails because it uses a user segment at $E700. Note that
this does not affect ZSDOS2 variants because they do not require
a loadable clock driver.
BPBIOS needs to assign disk units dynamically via discovery of disk type

2
Source/BPBIOS/@WBW Z3ENV.txt

@ -75,7 +75,7 @@ should be consulted to understand these. The build process used here
produces several different configurations which can be loaded at runtime.
The original distributed memory segment configuration occupies the top
of memory which, unfortunately, conflicts with the RomWBW HBIOS need to
occupt this space.
occupy this space.
Although RomWBW HBIOS is implemented in it's own dedicated memory bank, it
requires a small proxy at the top of memory which acts as a mechansim to

36
Source/BPBIOS/Build.cmd

@ -3,6 +3,8 @@
setlocal
setlocal & cd ZCPR33 && call Build || exit /b 1 & endlocal
setlocal & cd Z34RCP11 && call Build || exit /b 1 & endlocal
setlocal & cd NZFCP13 && call Build || exit /b 1 & endlocal
set PATH=%PATH%;..\..\Tools\zx;..\..\Tools\cpmtools;
@ -26,22 +28,22 @@ call :makebp 41nbnk
rem pause
cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:ws*.*
cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:*.img
cpmcp.exe -f wbw_hd0 ../../Binary/hd0.img *.img 0:
cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:*.rel
cpmcp.exe -f wbw_hd0 ../../Binary/hd0.img *.rel 0:
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:*.dat
rem cpmcp.exe -f wbw_hd0 ../../Binary/hd0.img *.dat 0:
cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:*.zex
cpmcp.exe -f wbw_hd0 ../../Binary/hd0.img *.zex 0:
cpmrm.exe -f wbw_hd0 ../../Binary/hd0.img 0:myterm.z3t
cpmcp.exe -f wbw_hd0 ../../Binary/hd0.img myterm.z3t 0:myterm.z3t
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:ws*.*
rem
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.img
rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.img 0:
rem
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.rel
rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.rel 0:
rem
rem rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.dat
rem rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.dat 0:
rem
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:*.zex
rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img *.zex 0:
rem
rem cpmrm.exe -f wbw_hd0 ../../Binary/hd_bp.img 0:myterm.z3t
rem cpmcp.exe -f wbw_hd0 ../../Binary/hd_bp.img myterm.z3t 0:myterm.z3t
goto :eof
@ -57,6 +59,8 @@ rem if exist bpbio-ww.rel del bpbio-ww.rel
zx ZMAC -BPBIO-WW -/P
if exist bp%VER%.prn del bp%VER%.prn
ren bpbio-ww.prn bp%VER%.prn
ren bpbio-ww.err bp%VER%.err
copy bpbio-ww.rel bp%VER%.rel
rem pause

3
Source/BPBIOS/Clean.cmd

@ -8,5 +8,8 @@ if exist *.img del *.img
if exist bp*.rel del bp*.rel
if exist zcpr33*.rel del zcpr33*.rel
if exist *.bak del *.bak
if exist def-ww.lib del def-ww.lib
setlocal & cd ZCPR33 && call Clean.cmd & endlocal
setlocal & cd Z34RCP11 && call Clean.cmd & endlocal
setlocal & cd NZFCP13 && call Clean.cmd & endlocal

47
Source/BPBIOS/Makefile

@ -0,0 +1,47 @@
VERSIONS = \
33t 33tbnk \
33n 33nbnk \
34t 34tbnk \
34n 34nbnk \
41tbnk 41nbnk
HD0IMG = ../../Binary/hd_bp.img
IMGFILES = $(foreach ver,$(VERSIONS),bp$(ver).img)
DISTFILES = *.zex *.rel myterm.z3t
OTHERS = zcpr33n.rel zcpr33t.rel \
bpbio-ww.rel bpsys.dat bpsys.bak bpbio-ww.err def-ww.lib *.img
TOOLS = ../../Tools
SUBDIRS = ZCPR33 NZFCP13 Z34RCP11
include $(TOOLS)/Makefile.inc
$(HD0IMG): $(IMGFILES)
if [ -f $(HD0IMG) ] ; then \
for f in $(IMGFILES) $(DISTFILES) ; do \
$(BINDIR)/cpmrm -f wbw_hd0 $(HD0IMG) 0:$$f ; \
done ; \
$(CPMCP) -f wbw_hd0 $(HD0IMG) $(IMGFILES) $(DISTFILES) 0: ; \
fi
zcpr33n.rel zcpr33t.rel:
(cd ZCPR33 ; make)
all:: $(HD0IMG)
clobber::
@rm -f $(HD0IMG)
%.img: zcpr33n.rel zcpr33t.rel
$(eval VER := $(subst .img,,$(subst bp,,$@)))
cp def-ww-z$(VER).lib def-ww.lib
rm -f bpbio-ww.rel
$(ZXCC) $(CPM)/ZMAC -BPBIO-WW -/P
mv bpbio-ww.prn bp$(VER).prn
cp bp$(VER).dat bpsys.dat
$(ZXCC) ./bpbuild.com -bpsys.dat 0 < bpbld1.rsp
cp bpsys.img bpsys.dat
$(ZXCC) ./bpbuild.com -bpsys.dat 0 < bpbld2.rsp
mv bpsys.img bp$(VER).img

11
Source/BPBIOS/NZFCP13/Build.cmd

@ -0,0 +1,11 @@
@echo off
setlocal
set PATH=%PATH%;..\..\..\Tools\zx;..\..\..\Tools\cpmtools;
set ZXBINDIR=../../../tools/cpm/bin/
set ZXLIBDIR=../../../tools/cpm/lib/
set ZXINCDIR=../../../tools/cpm/include/
zx Z80ASM -nzfcp13/MF
rem zx ZMAC -nzfcp13.z80 -/P

7
Source/BPBIOS/NZFCP13/Clean.cmd

@ -0,0 +1,7 @@
@echo off
setlocal
if exist *.prn del *.prn
if exist *.lst del *.lst
if exist *.err del *.err
if exist *.rel del *.rel

5
Source/BPBIOS/NZFCP13/Makefile

@ -0,0 +1,5 @@
OBJECTS = nzfcp13.rel
OTHERS =
TOOLS = ../../../Tools
include $(TOOLS)/Makefile.inc

BIN
Source/BPBIOS/NZFCP13/fcp-4.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-4t.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-5.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-5t.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-6.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-6t.zrl

Binary file not shown.

BIN
Source/BPBIOS/NZFCP13/fcp-7t.zrl

Binary file not shown.

89
Source/BPBIOS/NZFCP13/nzfcp.doc

@ -0,0 +1,89 @@
Z-Relocatable Flow Control Packages
11 October 89 by Carson Wilson
The seven pre-compiled Flow Control Packages (FCP's) in this library may be
loaded directly to Z System with NZ-COM, Z3PLUS, or JetLDR, provided
sufficient space has been allocated to the FCP segment. The FCP's come in two
flavors. Files named FCP-nT.ZRL implement extended flow control processing
when needed using a program named IF.COM at the root of your path, or at
directory A0 if there is no path. Files named simply FCP-n.ZRL rely
exclusively on memory-based processing. The "n" in the filename indicates the
total number of records required by each package. The standard number of
records for both NZ-COM and Z3PLUS is currently 5, so if you wish to load a
larger FCP you must reconfigure your system with MKZCM or by editing your .Z3P
file. For general help with flow control commands, see the file IF.HLP, or
section 3.2.2 of your NZ-COM or Z3PLUS manual.
While IF.COM allows options not available in memory-resident flow-control
processing, fully resident versions free the user from the requirement that
IF.COM be present during flow control processing. Resident processing is also
somewhat faster due to the need to load IF.COM from disk for each flow control
command. Finally, the ability to locate and load the transient IF.COM
requires considerable code space in the resident code itself. Generally,
IF.COM is best used on fixed-disk systems, while resident processing is more
suited to floppy-based systems.
The options included in fully resident versions were selected somewhat
differently than those of those using IF.COM. Criteria, in order of
precedence, were as follows:
Transient Versions Resident Versions
------------------ -----------------
1. Is the feature available in 1. How useful is the feature?
IF.COM? 2. How much memory does the feature
2. Does the feature require disk require?
access?
3. How useful is the feature?
4. How much memory does the feature
require?
The tables below summarize the size and features of each flavor of FCP. Each
package includes only the features appearing above it. For example,
FCP-5T.ZRL (the default FCP for both NZ-COM and Z3PLUS) contains only ZIF,
IFQ, OR, AND, negation, ERROR, and NULL. Size is expressed as records plus
remaining bytes required by the FCP. As FCP space is allocated in record
units only, I have attempted to include only combinations which leave as
little remaining space possible. Sizes without corresponding filenames are
included for reference purposes only.
FEATURES OF TRANSIENT (IF.COM) FCPS SIZE(RECS+BYTES) FILE NAME
-----------------------------------------------------------------------------
ZIF - unconditionally clear IF states?
IFQ - show current if status? 3+124 FCP-4T.ZRL
OR - set state at current level? 4+25
AND - reset state at current level?
Allow negation of conditions?
ERROR - test program error flag?
NULL - test for no file name? 4+84 FCP-5T.ZRL
REG - test register values? 5+16
AMBIG - test for "?" in file spec?
COMPR - test for compressed filespec?
= - test tokens for equality? 5+92 FCP-6T.ZRL
INPUT - test user input? 6+25
Allow "IF T" and "IF F" forms?
WHEEL - test wheel byte?
TCAP - test whether TCAP loaded?
EXIST - test for file existence? 6+106 FCP-7T.ZRL
EMPTY - test files for contents? 7+10
FEATURES OF RESIDENT FCPS SIZE(RECS+BYTES) FILE NAME
-----------------------------------------------------------------------------
ZIF - unconditionally clear IF states?
IFQ - show current if status?
OR - set state at current level?
AND - reset state at current level?
Allow negation of conditions?
NULL - test for no file name?
INPUT - test user input?
= - test tokens for equality?
ERROR - test program error flag?
Allow "IF T" and "IF F" forms?
EXIST - test for file existence? 3+123 FCP-4.ZRL
AMBIG - test for "?" in file spec?
COMPR - test for compressed filespec?
REG - test register values?
WHEEL - test wheel byte?
TCAP - test whether TCAP loaded? 4+113 FCP-5.ZRL
EMPTY - test files for contents? 5+17 FCP-6.ZRL


161
Source/BPBIOS/NZFCP13/nzfcp.lib

@ -0,0 +1,161 @@
; Module: NZFCP.LIB
; Author: Carson Wilson
; Version: 1.3
; Date: 9 Oct 89
; Changes: Prompts for options if SLR true.
; This module is a set of configuration options for the flow control package
; code in NZFCP.Z80. The options are not fully commented here; see
; "ZCPR3, The Manual" for a detailed discussion of most of them.
; * * * * * * N O T I C E * * * * * *
;
; The main code in Z33FCP.Z80 has been written with relative jump instructions
; for minimum code size. If the options below are changed, then some of the
; jumps may become out-of-range. You will then have to change the code based
; on the error messages you get from your assembler. I cannot think of any
; way to handle the jumps automatically (macros fail because the jump distances
; cannot be resolved fully even in two passes of the assembler). If you want
; to play things really safe, you can do a global search and replace to change
; all occurrences of the JR instruction to JP (but note that this change is
; irreversible). I prefer to live with this nuisance so that I can get the
; most out of the code.
;
; Another possible way to clear up a problem with a relative jump that is out
; of range is to take the block of code with the labels IFCTRUE and IFCFALSE
; and move it up or down in the code. It is placed somewhere in the middle of
; the resident options, so that the options can reach those entry points with
; a relative jump. You should try to place that code near the middle of the
; options which you have enabled.
;
; Jay Sage (May 17, 1987)
;=============================================================================
;
; M A C R O S
;
;=============================================================================
; SLR assemblers allow selection of options during assembly.
SLR equ no
if SLR
y equ yes
n equ no
select macro option default comment
.accept comment,option ; Prompt user for selection
endm
.printx
.printx Answer "Y" to include, "N" to exclude commands:
.printx
else
select macro option default comment
option equ default ; Use selections from file
endm
endif ; SLR
; -------------------------------------------------------------------------
; Command names
; The CTABLE macro, which constructs the command dispatch table, includes a
; line for each command, the first parameter of which is the name of the
; command. These names may be changed if you wish. But make sure that you
; do not use a name that is longer than the maximum allowed length. If you
; do, the name will be truncated and a nonfatal error will occur during
; assembly. DO NOT CHANGE ANY PARAMETER OTHER THAN THE COMMAND NAME. Lower
; case letters will be converted to upper case. The macro COMMAND is defined
; in Z34MAC.LIB.
cmdsize equ 4 ; Maximum length of command names
; Command table name, enable, wheel, jump_addr
; [ DO NOT CHANGE THESE PARAMETERS ]
ctable macro
ifcmd: command if, yes, no, ifstart
command and, andopt, no, andstart
command or, oropt, no, orstart
command else, yes, no, ifelse
command fi, yes, no, ifend
command ifq, ifqopt, no, ifstat0
command xif, yes, no, ifexit
command zif, zifopt, no, ifzero
endm
;-----------------------------------------------------------------------------
; General configuration options
NOISE equ no ; Don't display if-state messages
select COMIF no 'Enable transient IF processing? '
PATHROOT equ yes ; Find transient IF in root of path
ifdrv equ 'A' ; Drive to use if PATHROOT is off or
; ..if the path is empty
ifusr equ 0 ; User to use if PATHROOT is off or
; ..if the path is empty
; ---------------------------------------------------------------------
; Command inclusion options
select ZIFOPT yes 'ZIF - unconditionally clear IF states? '
select IFQOPT yes 'IFQ - show current if status? '
select OROPT yes 'OR - set state at current level? '
select ANDOPT yes 'AND - reset state at current level? '
;-----------------------------------------------------------------------------
; If Condition Options
if COMIF ; Different precedence if transient IF available.
select IFONEG yes 'Allow negation of conditions? '
negchar equ '~' ; Character to use if negation allowed
select IFOERROR yes 'ERROR - test program error flag? '
select IFONULL yes 'NULL - test for no file name? '
select IFOREG yes 'REG - test register values? '
select IFAMBIG yes 'AMBIG - test for "?" in file spec? '
select IFCOMPR yes 'COMPR - test for compressed filespec? '
select IFOEQ yes '= - test tokens for equality? '
select IFOINPUT yes 'INPUT - test user input? '
XEQOPT equ yes ; Test only first token for equal sign
select IFOTRUE yes 'Allow "IF T" and "IF F" forms? '
select IFOWHEEL no 'WHEEL - test wheel byte? '
select IFOTCAP no 'TCAP - test whether TCAP loaded? '
select IFOEXIST yes 'EXIST - test for file existence? '
select IFOEMPTY yes 'EMPTY - test files for contents? '
else
select IFONEG yes 'Allow negation of conditions? '
negchar equ '~' ; Character to use if negation allowed
select IFONULL yes 'NULL - test for no file name? '
select IFOINPUT yes 'INPUT - test user input? '
select IFOEQ yes '= - test tokens for equality? '
XEQOPT equ yes ; Test only first token for equal sign
select IFOERROR yes 'ERROR - test program error flag? '
select IFOTRUE yes 'Allow "IF T" and "IF F" forms? '
select IFOEXIST yes 'EXIST - test for file existence? '
select IFAMBIG no 'AMBIG - test for "?" in file spec? '
select IFCOMPR no 'COMPR - test for compressed filespec? '
select IFOREG no 'REG - test register values? '
select IFOWHEEL no 'WHEEL - test wheel byte? '
select IFOTCAP no 'TCAP - test whether TCAP loaded? '
select IFOEMPTY no 'EMPTY - test files for contents? '
endif ; COMIF
; Miscellaneous configuration information
curusr equ z3msg+2eh ; Current logged user address
curdr equ z3msg+2fh ; Current logged drive address
curint equ '$' ; Path symbol for current drive/user
; END of NZFCP.LIB


161
Source/BPBIOS/NZFCP13/nzfcp.lib.sav

@ -0,0 +1,161 @@
; Module: NZFCP.LIB
; Author: Carson Wilson
; Version: 1.3
; Date: 9 Oct 89
; Changes: Prompts for options if SLR true.
; This module is a set of configuration options for the flow control package
; code in NZFCP.Z80. The options are not fully commented here; see
; "ZCPR3, The Manual" for a detailed discussion of most of them.
; * * * * * * N O T I C E * * * * * *
;
; The main code in Z33FCP.Z80 has been written with relative jump instructions
; for minimum code size. If the options below are changed, then some of the
; jumps may become out-of-range. You will then have to change the code based
; on the error messages you get from your assembler. I cannot think of any
; way to handle the jumps automatically (macros fail because the jump distances
; cannot be resolved fully even in two passes of the assembler). If you want
; to play things really safe, you can do a global search and replace to change
; all occurrences of the JR instruction to JP (but note that this change is
; irreversible). I prefer to live with this nuisance so that I can get the
; most out of the code.
;
; Another possible way to clear up a problem with a relative jump that is out
; of range is to take the block of code with the labels IFCTRUE and IFCFALSE
; and move it up or down in the code. It is placed somewhere in the middle of
; the resident options, so that the options can reach those entry points with
; a relative jump. You should try to place that code near the middle of the
; options which you have enabled.
;
; Jay Sage (May 17, 1987)
;=============================================================================
;
; M A C R O S
;
;=============================================================================
; SLR assemblers allow selection of options during assembly.
SLR equ yes
if SLR
y equ yes
n equ no
select macro option default comment
.accept comment,option ; Prompt user for selection
endm
.printx
.printx Answer "Y" to include, "N" to exclude commands:
.printx
else
select macro option default comment
option equ default ; Use selections from file
endm
endif ; SLR
; -------------------------------------------------------------------------
; Command names
; The CTABLE macro, which constructs the command dispatch table, includes a
; line for each command, the first parameter of which is the name of the
; command. These names may be changed if you wish. But make sure that you
; do not use a name that is longer than the maximum allowed length. If you
; do, the name will be truncated and a nonfatal error will occur during
; assembly. DO NOT CHANGE ANY PARAMETER OTHER THAN THE COMMAND NAME. Lower
; case letters will be converted to upper case. The macro COMMAND is defined
; in Z34MAC.LIB.
cmdsize equ 4 ; Maximum length of command names
; Command table name, enable, wheel, jump_addr
; [ DO NOT CHANGE THESE PARAMETERS ]
ctable macro
ifcmd: command if, yes, no, ifstart
command and, andopt, no, andstart
command or, oropt, no, orstart
command else, yes, no, ifelse
command fi, yes, no, ifend
command ifq, ifqopt, no, ifstat0
command xif, yes, no, ifexit
command zif, zifopt, no, ifzero
endm
;-----------------------------------------------------------------------------
; General configuration options
NOISE equ no ; Don't display if-state messages
select COMIF no 'Enable transient IF processing? '
PATHROOT equ yes ; Find transient IF in root of path
ifdrv equ 'A' ; Drive to use if PATHROOT is off or
; ..if the path is empty
ifusr equ 0 ; User to use if PATHROOT is off or
; ..if the path is empty
; ---------------------------------------------------------------------
; Command inclusion options
select ZIFOPT yes 'ZIF - unconditionally clear IF states? '
select IFQOPT yes 'IFQ - show current if status? '
select OROPT yes 'OR - set state at current level? '
select ANDOPT yes 'AND - reset state at current level? '
;-----------------------------------------------------------------------------
; If Condition Options
if COMIF ; Different precedence if transient IF available.
select IFONEG yes 'Allow negation of conditions? '
negchar equ '~' ; Character to use if negation allowed
select IFOERROR yes 'ERROR - test program error flag? '
select IFONULL yes 'NULL - test for no file name? '
select IFOREG yes 'REG - test register values? '
select IFAMBIG yes 'AMBIG - test for "?" in file spec? '
select IFCOMPR yes 'COMPR - test for compressed filespec? '
select IFOEQ yes '= - test tokens for equality? '
select IFOINPUT yes 'INPUT - test user input? '
XEQOPT equ yes ; Test only first token for equal sign
select IFOTRUE yes 'Allow "IF T" and "IF F" forms? '
select IFOWHEEL no 'WHEEL - test wheel byte? '
select IFOTCAP no 'TCAP - test whether TCAP loaded? '
select IFOEXIST yes 'EXIST - test for file existence? '
select IFOEMPTY yes 'EMPTY - test files for contents? '
else
select IFONEG yes 'Allow negation of conditions? '
negchar equ '~' ; Character to use if negation allowed
select IFONULL yes 'NULL - test for no file name? '
select IFOINPUT yes 'INPUT - test user input? '
select IFOEQ yes '= - test tokens for equality? '
XEQOPT equ yes ; Test only first token for equal sign
select IFOERROR yes 'ERROR - test program error flag? '
select IFOTRUE yes 'Allow "IF T" and "IF F" forms? '
select IFOEXIST yes 'EXIST - test for file existence? '
select IFAMBIG yes 'AMBIG - test for "?" in file spec? '
select IFCOMPR yes 'COMPR - test for compressed filespec? '
select IFOREG yes 'REG - test register values? '
select IFOWHEEL no 'WHEEL - test wheel byte? '
select IFOTCAP no 'TCAP - test whether TCAP loaded? '
select IFOEMPTY yes 'EMPTY - test files for contents? '
endif ; COMIF
; Miscellaneous configuration information
curusr equ z3msg+2eh ; Current logged user address
curdr equ z3msg+2fh ; Current logged drive address
curint equ '$' ; Path symbol for current drive/user
; END of NZFCP.LIB


9
Source/BPBIOS/NZFCP13/nzfcp13.for

@ -0,0 +1,9 @@
Source code plus the compiled Flow Control Packages (FCP's)
distributed in FCP.LBR as part of the Z System. The precompiled
modules are in Z-Relocatable form, and must be loaded with JetLDR,
NZCOM, or Z3PLUS. Now features interactive assembly of code
a-la-Z34RCP11 under the SLR or ZMAC assemblers. Macro now reports
length of resulting FCP in records and bytes following assembly.
JetLDR signons also automatically generated. 9/15/90 Carson Wilson


1424
Source/BPBIOS/NZFCP13/nzfcp13.z80

File diff suppressed because it is too large

105
Source/BPBIOS/NZFCP13/z34cmn.lib

@ -0,0 +1,105 @@
;
; Library: Z34CMN.LIB
; Author: Carson Wilson <crw>
; Version: 1.2
; Date: 16 June 1988
; Changes: Renamed CRT0 to LINS for NZCOM compatibility.
; Added CUSR " " "
; Author: Carson Wilson <crw>
; Version: 1.1
; Date: 12 June 1988
; Changes: Added CDRV for various Z34RCP commands.
; Added CRT0 for Z34RCP TYPE command.
; Added Z3TCAP and CLRSCR for Z34RCP CLS command.
; Added QUIET for ZCPR34 time in prompt.
; Added RSDMSG for ZCPR34 time in prompt.
; Library: Z34CMN.LIB
; Author: Joe Wright
; Date: 23 March 1988
; As a replacement for Z3BASE.LIB, some usual equates.
base equ 0 ; Base Page
false equ 0
true equ not false
no equ false
yes equ true
off equ false
on equ true
; Named COMMON declarations start here. For compatibility, these
; are the same names used by Bridger Mitchell's JetLDR.
common /_ENV_/
z3env: ; Z3 Environment descriptor
z3envs equ yes ; There is one
expath equ z3env+9 ; Address of External Path
expaths equ 10 ; Maximum 10 elements for MPATH
rcp equ z3env+0ch ; Address of RCP
rcps equ yes ; Used as existence test, not size
fcp equ z3env+12h ; Address of FCB
fcps equ yes ; Used as existence test, not size
z3ndir equ z3env+15h ; Address of NDR
z3ndirs equ yes ; Used as existence test, not size
quiet equ z3env+28h ; Quiet flag address <crw>
z3whl equ z3env+29h ; Wheel byte address
z3whls equ yes ; There is a wheel
lins equ z3env+33h ; CRT text lines address <crw>
ccp equ z3env+3fh ; CCP entry
ccps equ z3env+41h ; Size
dos equ z3env+42h ; DOS entry (+6)
doss equ z3env+44h ; Size
bio equ z3env+45h ; BIO entry
z3tcap equ z3env+80h ; TCAP address <crw>
clrscr equ z3env+97h ; Clear screen string address <crw>
common /_SSTK_/
shstk: ; Top of Shell stack
shstks equ yes ; There is a shell stack
common /_MSG_/
z3msg: ; Message buffer
z3msgs equ yes ; There is one
cusr equ z3msg+2eh ; Current user
cdrv equ z3msg+2fh ; Current drive <crw>
rsdmsg equ z3msg+3ah ; Reserved bytes <crw>
common /_FCB_/
extfcb: ; External file control block
extfcbs equ yes ; There is one
common /_MCL_/
z3cl: ; Multiple command line
z3cls equ yes ; There is one
common /_XSTK_/
extstk: ; External stack
extstks equ yes ; There is one
common /_BIOS_/
bios:
cseg ; Select Code Segment
; End of Z34CMN.LIB


122
Source/BPBIOS/NZFCP13/z34mac.lib

@ -0,0 +1,122 @@
; Z33MAC.LIB : Macros for use with ZCPR33
; General purpose macros
putreg macro
push hl ; Save registers in order
push de
push bc
endm
getreg macro
pop bc ; Restore registers in order
pop de
pop hl
endm
swap macro
rrca ; Exchange nibbles
rrca
rrca
rrca
endm
;----------------------------------------
; Macro for forming option bytes
; This macro generates a byte with bits corresponding to up to 8 option
; flags. The bits are filled in the order of the parameters and are right
; justified in the byte.
optflag macro f1,f2,f3,f4,f5,f6,f7,f8
flag defl 0 ;; initial value
irp temp,<f1,f2,f3,f4,f5,f6,f7,f8>
if not nul temp
flag defl flag shl 1
if temp
flag defl flag or 1
endif ;;temp
endif ;;not nul temp
endm ;; irp
defb low flag
endm ;; optflag
;-----------------------------------------------------------------------------
; Command table entry definition macro
; Macro to form an entry for one command in the table. The first parameter is
; the name to be used for the command (no quotes); the second parameter is the
; flag that indicates whether or not the command is to be enabled; the third
; parameter is the wheel control flag; and the last parameter is the jump
; address to the code that carries out the command. The command names are
; automatically padded out to the correct length (they will be truncated and
; an error message will result if a command name is too long). The characters
; in the command name are automatically converted to upper case.
command macro cmdname,enableflag,wheelflag,address
if enableflag ;; Generate command only if enabled
whlmask defl wheelflag ;; Initialize variables
count defl cmdsize ;; Initialize to size of each command name
irpc char,cmdname ;; Repeat over letters in command name
count defl count - 1 ;; Count down characters in name
if [ count lt cmdsize ]
;; If character is lower case, convert to upper case
if [ '&char' ge 'a' ] and [ '&char' le 'z' ]
if whlmask
defb [ '&char' and 5fh ] + 80h
else ;;not whlmask
defb [ '&char' and 5fh ]
endif ;;whlmask
else ;;not lower case
if whlmask
defb '&char' + 80h ;; If controlled by wheel, set high bit
else ;;not whlmask
defb '&char' ;; If not restricted, leave high bit clear
endif ;;whlmask
endif ;;lower case
endif ;;[ count lt cmdsize ]
whlmask defl false ;; Turn off high-bit setting after first char
endm ;irpc
;; Pad command name with blanks
if [ count gt cmdsize ] ;; If we underflowed
*** Command name "&cmdname" is too long / truncated ***
else
rept count
defb ' '
endm
endif ;[ count gt cmdsize ]
dw address ;; Dispatch address for command
endif ;enable
endm ;command
; End Z33MAC.LIB


0
Source/Images/hd0/s0/u0/WW.Z3T → Source/BPBIOS/WW.Z3T

11
Source/BPBIOS/Z34RCP11/Build.cmd

@ -0,0 +1,11 @@
@echo off
setlocal
set PATH=%PATH%;..\..\..\Tools\zx;..\..\..\Tools\cpmtools;
set ZXBINDIR=../../../tools/cpm/bin/
set ZXLIBDIR=../../../tools/cpm/lib/
set ZXINCDIR=../../../tools/cpm/include/
rem zx Z80ASM -z34rcp11/MF
zx ZMAC -z34rcp11.z80 -/P

7
Source/BPBIOS/Z34RCP11/Clean.cmd

@ -0,0 +1,7 @@
@echo off
setlocal
if exist *.prn del *.prn
if exist *.lst del *.lst
if exist *.err del *.err
if exist *.rel del *.rel

5
Source/BPBIOS/Z34RCP11/Makefile

@ -0,0 +1,5 @@
OBJECTS = z34rcp11.rel
TOOLS = ../../../Tools
DEST =
include $(TOOLS)/Makefile.inc

BIN
Source/BPBIOS/Z34RCP11/cledinst.com

Binary file not shown.

BIN
Source/BPBIOS/Z34RCP11/cledsave.com

Binary file not shown.

3010
Source/BPBIOS/Z34RCP11/nzrcp.z80

File diff suppressed because it is too large

33
Source/BPBIOS/Z34RCP11/rcpbase.lib

@ -0,0 +1,33 @@
page
;
; Library: RCPBASE for Z34RCP
; Author: Carson Wilson
; Version: 1.0
; Date: June 15, 1988
; Comments: Use instead of Z34CMN.LIB to produce absolute RCP's.
; An absolute RCP will only load to one address, and requires
; that the message buffer and the environment descriptor
; remain constant within the environment.
; You must modify the next three addresses to match your system:
z3rcp equ 0ee80h ; RCP address
z3env equ 0fd00h ; Environment descriptor address
z3msg equ 0fe30h ; Message buffer address
; The rest of this file should not be changed.
fcp equ z3env+18 ; Address of FCB
quiet equ z3env+28h ; Quiet flag address
z3whl equ z3env+29h ; Wheel byte address
crt0 equ z3env+33h ; CRT 0 text lines address
ccp equ z3env+63 ; CCP entry
z3tcap equ z3env+80h ; TCAP address
clrscr equ z3env+97h ; Clear screen string address
cdrv equ z3msg+2fh ; Current drive
; End RCPBASE.LIB


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save