Rom Filing System
Overview
* prompt, all original commands intact and a comprehensive set of new commands for SD card and ROM filing, CP/M boot, BASIC load and much more.
The firmware supports four hardware platforms, each selected at compile time via a flag in rfs_definitions.asm:
- RomDisk card — the original target. Up to 4×512 KB Flash RAMs, 512 KB Static RAM and an SDXC card reader. Monitor and User ROMs are bank-switched across the Flash RAM.
- SFD-700 — the Sharp Floppy Disk Interface board. RFS occupies the CPLD/ROM space of the SFD-700 and provides monitor, BASIC load and floppy boot.
- tranZPUter FusionX — the FPGA-based Z80 enhancement board. RFS runs within its Flash ROM space.
- picoZ80 — the Raspberry Pi Pico based Z80 replacement/emulator board. On the picoZ80, RFS runs under the machine persona presented to the host — in addition to the MZ-80A this now includes the Sharp MZ-80K, which can use the same Sharp interface cards as the MZ-80A (RFS, MZ80AFI, MZ-1E14/E19, MZ-1R12/R18/R37, PIO-3034) as well as its own native MZ-80FD (T3444M) floppy controller.
RFS Monitor
+ RFS" when the filing system has initialised successfully. The original SA-1510 command set is fully available alongside a set of extended commands. Some extended commands (SD card operations, drive selection) are only present in the RomDisk / picoZ80 build. A built-in Z80 assembler and disassembler is available on all builds.
The full command set is listed below. Commands marked (R) are present only in the RomDisk / picoZ80 build.
| Command | Parameters | Description |
|---|---|---|
| 0 .. 9 (R) | — | Select the active RFS SD card drive (0–9). |
| 40 (R) | — | Switch to 40‑column display mode (requires Kuma 40/80 upgrade or Video Module). |
| 80 (R) | — | Switch to 80‑column display mode (requires Kuma 40/80 upgrade or Video Module). |
| ASM | <address> | Interactive Z80 assembler. Enter assembly mnemonics directly into memory starting at the given address. |
| B | — | Toggle the keyboard bell. |
| BASIC | — | Locate BASIC SA-5510 on the active SD drive or ROM, load and execute it. |
| C | [<8‑bit value>] | Clear (initialise) memory from 0x1200 to top of RAM with 0x00 or the supplied byte value. |
| CP | <src> <dst> <size> | Copy a block of memory. All three arguments are 4‑digit hex: source address, destination address, byte count. |
| CPM | — | Locate CP/M 2.2 on the active SD drive or ROM, load and boot it. |
| D | <addr> [<addr2>] | Dump memory from <addr> to <addr2> (or 20 lines) in hex and ASCII. Output pauses at each screenful; press a key to continue, ‘U’ to page up, ‘X’ to exit. Repeating ‘D’ without an address continues from the last displayed location. |
| DASM | <addr> [<addr2>] | Disassemble Z80 machine code from <addr> to <addr2>. |
| DUC (R) | [H|T] <name> or <file no.> | Dump an SD card file’s contents. Default: hex dump. DUCH: hex dump with MZF header info (load address, exec address, size). DUCT: text dump (printable ASCII only). |
| EC (R) | <name> or <file no.> | Erase a file from the active SD card drive by name or file number. |
| F / FL | [<drive>] | Boot from the specified floppy drive. If omitted, you are prompted to enter a drive number. |
| FD | [<drive>] | Display the directory listing of a floppy disk. The optional drive number selects drive 1–4 (default: 1). |
| FC | <start> <end> <exec> | Save a memory range to a floppy disk file. |
| FD2T | <name> or <file no.> | Copy a file from floppy disk to tape. |
| T2FD | — | Load from tape and save to floppy disk. |
| f | — | Execute the original floppy AFI boot code at 0xF000. |
| H | — | Display the command help screen (paginated, press Space to continue). |
| IC (R) | — | Paged directory listing of files on the active SD card drive. Each entry shows a hex file number and filename. |
| IN | <port>[,<port>…] | Read one or more I/O ports. Each port is a 2 or 4 hex digit address. Values are printed as 2‑digit hex, space‑separated. |
| IR | — | Paged directory listing of programs stored in the Flash ROM drives. |
| J | <address> | Jump to (execute from) the given address. |
| L | LT | [<filename>] | Load a file from tape (CMT) and execute it. |
| LTNX | [<filename>] | Load a file from tape (CMT) without executing. |
| LR | <name> or <file no.> | Load a program from ROM by name or file number and execute it. |
| LRNX | <name> or <file no.> | Load a program from ROM by name or file number without executing. |
| LC (R) | <name> or <file no.> | Load a program from the SD card and execute it. |
| LCNX (R) | <name> or <file no.> | Load a program from the SD card without executing. |
| M | <address> | Interactive memory editor starting at <address>. |
| OUT | <port>:<value>[,<port>:<value>…] | Write to one or more I/O ports. Each port is a 2 or 4 hex digit address followed by a colon and a 2‑digit hex value. |
| P | — | Run a test on the connected printer. |
| R | — | Run a DRAM memory test. |
| S | ST | <start> <end> <exec> | Save a memory range to tape (CMT). You are prompted for a filename. Example: S120020001203 saves from 0x1200 to 0x2000 with execution at 0x1203. |
| SC (R) | <start> <end> <exec> | Save a memory range to the active SD card drive. You are prompted for a filename. |
| SD2T (R) | <name> or <file no.> | Copy a file from the SD card to tape in the CMT. |
| T | — | Test the 8253 timer. |
| T2SD (R) | — | Load a program from tape and write it to the active SD card drive. |
| V | — | Verify a tape save against the data currently in memory. |
| X (R) | — | Exchange to the hi‑load ROM variant so DRAM spans 0x0000–0xCFFF. |
If the Kuma 40/80 column upgrade or the Video Module is installed, typing 4 switches to 40‑column display and 8 switches to 80‑column display. In 80‑column mode the directory listing commands (IC / IR) display four columns.
Upgraded Applications
Sharp BASIC SA-5510
| Command | Parameter | Description |
|---|---|---|
| LOAD | "TEST" |
Search the active drive for a program named TEST, load and run it. |
| LOAD | Load the next sequential file from the active drive. If file 5 was last loaded, this loads file 6. | |
| LOAD | "3:TEST" |
Load TEST from RFS drive 3, making drive 3 active. |
| LOAD | "C:TEST" |
Load TEST from the internal cassette (CMT), making CMT the active drive. |
| SAVE | "TEST" |
Overwrite an existing file named TEST on the active drive, or create it if absent. On CMT, writes immediately at the current tape position. |
| SAVE | Save the current program under an auto-generated name DEFAULT<n>, where <n> is the current sequence number. |
|
| SAVE | "3:TEST" |
Save/create TEST on RFS drive 3 and make drive 3 active. |
| SAVE | "C:TEST" |
Save to CMT with the name TEST and make CMT active. |
| DIR | List the SD card directory for the active drive in RFS format (file number + filename). | |
| DIR | "3:" |
List the directory on drive 3 and make drive 3 active. |
See SD Card Organisation below for the default drive layout.
Microsoft BASIC
- MS-BASIC(MZ-80A) — for original MZ-80A hardware, cassette storage only.
- MS-BASIC(RFS40) — RFS with 40‑column display; adds SD card, CLOAD, CSAVE, DIR.
- MS-BASIC(RFS80) — RFS with 80‑column display; adds SD card, CLOAD, CSAVE, DIR.
Each variant appears on the RFS ROM drive and SD drive. Consult the NASCOM Basic Manual for the full standard command set. The table below lists the extensions added for RFS.
| Command | Parameters | Version | Description |
|---|---|---|---|
| CLOAD | "<filename>" |
MZ-80A | Load a tokenised BASIC program from cassette. |
| CSAVE | "<filename>" |
MZ-80A | Save the current BASIC program to cassette in tokenised format. |
| CLOAD | "[<drive>:]<filename>" |
RFS40, RFS80 | Load from tape or SD card. <drive> is 0–9; <filename> is a 17-character MZ name or 2-digit RFS hex number. Example: CLOAD "8:13" or CLOAD "8:othello". |
| CSAVE | "[<drive>:]<filename>" |
RFS40, RFS80 | Save to tape or SD card with optional drive qualifier. |
| DIR | "[<drive>:]" |
RFS40, RFS80 | Display the active or specified RFS drive contents. |
| ANSITERM | 0 = Off, 1 = On |
All | Enable or disable (default on) the built-in ANSI terminal processor. This translates ANSI escape sequences into screen actions, allowing portable BASIC programs to run unchanged. (The Star Trek V2 BASIC program uses ANSI escape sequences.) |
NASCOM Cassette Image Converter
nasconv tool strips the tape framing and rebuilds the BASIC code in a format loadable on the MZ-80A under RFS. It also remaps token values automatically, since the RFS MS-BASIC extension adds new tokens that shift the table.
nasconv v1.0
Required:
-i | --image <file> Cassette image file to convert.
-o | --output <file> Output file for converted BASIC data.
Options:
-l | --loadaddr <addr> MZ-80A BASIC start address.
-n | --nasaddr <addr> Original NASCOM BASIC start address.
-h | --help Show this help.
-v | --verbose Verbose output.
Example:
nasconv --image 3dnc.cas --output 3dnc.bas \
--nasaddr 0x10fa --loadaddr 0x4341
BASIC MZ-5Z008 (Quick Disk)
BASIC 5Z-008BRFS". This BASIC also runs on the MZ-1500 via the picoZ80 MZ-1500 persona, providing the same device support including NETx: network access. Programs can be loaded, saved and listed across all supported devices using a device prefix in the filename.
| Command | Parameter | Description |
|---|---|---|
| LOAD | "RFSx:filename" |
Load a BASIC program from RFS SD card drive x (1–7, mapped to SD drives 4–10). |
| SAVE | "RFSx:filename" |
Save the current BASIC program to the specified RFS SD card drive. |
| DIR | RFSx: |
Display the directory listing of the specified RFS SD card drive. |
| LOAD | "FDx:filename" |
Load a BASIC program from floppy disk drive x. |
| SAVE | "FDx:filename" |
Save the current BASIC program to floppy disk drive x. |
| DIR | FDx: |
Display the floppy disk directory listing. |
| LOAD | "QDx:filename" |
Load a BASIC program from Quick Disk drive x. |
| SAVE | "QDx:filename" |
Save the current BASIC program to Quick Disk drive x. |
| DIR | QDx: |
Display the Quick Disk directory listing. |
| LOAD | "NETx:filename" |
Load a BASIC program from network file server unit x (1–7). Requires a Celestite board and netfs.py running on a PC. |
| SAVE | "NETx:filename" |
Save the current BASIC program to network file server unit x. |
| DIR | NETx: |
Display the directory listing from network file server unit x. |
| LOAD | "CMT:filename" |
Load a BASIC program from cassette tape. |
| SAVE | "CMT:filename" |
Save the current BASIC program to cassette tape. |
BASIC MZ-2Z009E (Floppy Disk)
BASIC 2Z-009ERFS". Programs can be loaded, saved and listed across all supported devices using a device prefix in the filename.
| Command | Parameter | Description |
|---|---|---|
| LOAD | "RFSx:filename" |
Load a BASIC program from RFS SD card drive x (1–7, mapped to SD drives 4–10). |
| SAVE | "RFSx:filename" |
Save the current BASIC program to the specified RFS SD card drive. |
| DIR | RFSx: |
Display the directory listing of the specified RFS SD card drive. |
| LOAD | "FDx:filename" |
Load a BASIC program from floppy disk drive x. |
| SAVE | "FDx:filename" |
Save the current BASIC program to floppy disk drive x. |
| DIR | FDx: |
Display the floppy disk directory listing. |
| LOAD | "QDx:filename" |
Load a BASIC program from Quick Disk drive x. |
| SAVE | "QDx:filename" |
Save the current BASIC program to Quick Disk drive x. |
| DIR | QDx: |
Display the Quick Disk directory listing. |
Software Architecture
| Module | Target ROM | Size | Bank | Description |
|---|---|---|---|---|
| rfs.asm | User | 2 KB | 0 | Primary RFS entry point, command dispatcher and command table. Contains the bank-switching infrastructure shared by all banks. |
| rfs_bank1.asm | User | 2 KB | 1 | Floppy disk controller (FDC) functions. Handles drive selection, boot, floppy copy (FC), floppy-to-tape (FD2T) and tape-to-floppy (T2FD). |
| rfs_bank2.asm | User | 2 KB | 2 | SD card controller. SPI driver, SD card initialisation, SDCFS directory and file read/write. |
| rfs_bank3.asm | User | 2 KB | 3 | Monitor memory utilities: hex dump, memory edit, memory copy, SD card file dump (DUC), I/O port read/write (IN / OUT), tape↔SD copy (T2SD / SD2T), printer test. |
| rfs_bank4.asm | User | 2 KB | 4 | CMT (cassette) controller: tape load, save and verify. |
| rfs_bank5.asm | User | 2 KB | 5 | General utility functions: formatted print, string routines and shared helper code. |
| rfs_bank6.asm | User | 2 KB | 6 | Z80 assembler/disassembler opcode table 1, PRINTMSG function and message string infrastructure. |
| rfs_bank7.asm | User | 2 KB | 7 | Z80 assembler/disassembler opcode table 2, Z80 disassembler (DASM), DRAM memory test and 8253 timer test. |
| rfs_bank8.asm | User | 2 KB | 8 | Z80 interactive assembler (ASM). |
| rfs_bank9.asm | User | 2 KB | 9 | ROM directory, file find, load and print functions (moved from bank 0 to free space). |
| rfs_bank10.asm | User | 2 KB | 10 | Reserved / free. |
| rfs_bank11.asm | User | 2 KB | 11 | Help screen. |
| cbios_bank1.asm | User | 2 KB | 12 | CP/M CBIOS: audio functions, RTC, keyboard and low-level utilities. |
| cbios_bank2.asm | User | 2 KB | 13 | CP/M CBIOS: screen driver and ANSI terminal emulation. |
| cbios_bank3.asm | User | 2 KB | 14 | CP/M CBIOS: SD card driver (provides CP/M drive A:–G:). |
| cbios_bank4.asm | User | 2 KB | 15 | CP/M CBIOS: floppy disk controller. |
| monitor_sa1510.asm | Monitor | 4 KB | 0 | Original SA-1510 monitor ROM (40-column). |
| monitor_80c_sa1510.asm | Monitor | 4 KB | 1 | SA-1510 monitor patched for 80-column display. |
| cbios.asm | Monitor | 4 KB | 2 | CP/M 2.2 CBIOS kernel (loaded to 0xC000–0xCFFF). |
| rfs_mrom.asm | Monitor | 4 KB | 3 | RFS Monitor ROM utilities. Because code executing from the User ROM cannot page itself out to scan the remaining ROM, these routines run from Monitor ROM bank 3 to scan and load MZF files stored in the User ROM Flash RAM. |
| monitor_1z-013a.asm | Monitor | 4 KB | 4 | MZ-1Z-013A monitor ROM (MZ-700 / MZ-1200 variant). |
| monitor_80c_1z-013a.asm | Monitor | 4 KB | 5 | MZ-1Z-013A monitor patched for 80-column display. |
| rfs_mrom_bank6.asm | Monitor | 4 KB | 6 | Z80 assembler/disassembler opcode table 1 (MROM copy). |
| rfs_mrom_bank7.asm | Monitor | 4 KB | 7 | Z80 assembler/disassembler opcode table 2 (MROM copy). |
| ipl.asm | Monitor | 4 KB | 8 | Initial Program Loader. |
| rfs_mrom_bank9.asm | Monitor | 4 KB | 9 | RFS message strings repository. |
CP/M 2.2 is supported with 47 KB of usable program RAM. Only the CCP and BDOS reside in RAM (and can be overwritten by applications); the CBIOS itself lives in Monitor ROM bank 2 and User ROM banks 12–15, consuming no program RAM at all.
The Monitor ROM also provides several variant monitor images built at the same time: a standard SA-1510, an 80-column SA-1510, a Kuma-80 version (selected via the
KUMA80_ENA flag in rfs_definitions.asm), and hi-load variants of both SA-1510 and 80-column SA-1510 used when DRAM needs to fill the full 0x0000–0xCFFF range.
Build System
The recommended way to build RFS is the automated setup script for your platform (see Automated setup and build below) — it installs the few external tools needed, fetches the content, prepares the environment and can run the first build for you, with no in-depth knowledge of the tools or configuration required. The manual steps further down are for advanced users and partial rebuilds.
Prerequisites
| Tool | Notes |
|---|---|
| Java (JRE 8+) | Required to run the GLASS Z80 assembler. java must be on PATH. |
| bash | All build scripts are bash. |
| perl | Required by mzftool.pl. |
| gcc / make | Required to compile cpmtools from source (done automatically on first build). |
| dd, cat, stat | Standard Linux utilities used by the packaging scripts. |
The GLASS Z80 assembler (glass.jar) is bundled in the tools/ directory — no separate installation is needed.
Automated setup and build (recommended)
macOS / Linux / WSL — setup_RFS.sh
chmod +x setup_RFS.sh
./setup_RFS.sh
Windows 10 / 11 — setup_RFS_windows_native.ps1 (recommended — native, no WSL). From a PowerShell prompt:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\setup_RFS_windows_native.ps1
The native script uses winget to install Git for Windows (which provides bash, coreutils, perl and curl) and a Temurin JRE (Java, for the GLASS assembler), clones the repo, fetches the content bundle, and runs ./build.sh through Git Bash — with no WSL, Docker or reboot required. The RFS build needs no C compiler on Windows because two prebuilt host tools (tools/cpmcp.exe and tools/sdtool.exe) are bundled.
Windows 10 / 11 — setup_RFS_windows.ps1 (alternative — builds inside WSL2 / Ubuntu). From an Administrator PowerShell:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\setup_RFS_windows.ps1
This WSL variant installs WSL2 + Ubuntu if they are not already present (a one-time reboot is needed — reboot, launch Ubuntu once from the Start Menu to create your Linux username/password, then re-run the script), then runs setup_RFS.sh inside Ubuntu. Prefer the native script above unless you specifically want a WSL environment.
Questions the setup asks, and what to do
Every prompt has a safe default shown in brackets — the capital letter is the default, so pressing Enter accepts it. The prompts appear in this order:
Windows only (in PowerShell, before the Linux setup runs):
| Prompt | Default | What to do |
|---|---|---|
Continue anyway? [y/N] (only if not started as Administrator) |
No | Answer N, re-open PowerShell with Run as Administrator, and start again — installing WSL needs admin rights. |
Install WSL2 + Ubuntu now? [y/N] (only if WSL / Ubuntu is missing) |
No | Answer y. Windows installs WSL2 + Ubuntu, then asks you to reboot. After rebooting, launch Ubuntu once to create your Linux user, then re-run the script. |
Repo URL [https://git.eaw.app/eaw/RFS.git] |
public repo | Press Enter for the public RFS repository, or paste a different URL (e.g. the private development repo). |
macOS / Linux / WSL (in the Linux / Ubuntu shell):
| Prompt | Default | What to do |
|---|---|---|
Install now? [Y/n] (only if tools are missing) |
Yes | Press Enter. The script installs the missing tools with your package manager (apt / dnf / pacman, or Homebrew on macOS); you may be asked for your sudo password. On macOS it first triggers the Xcode Command Line Tools installer and requires Homebrew. |
Repo URL [https://git.eaw.app/eaw/RFS.git]: (only when not already inside a checkout) |
public repo | Press Enter for the public repo, or paste the private repo URL. (Skipped on Windows — the PowerShell step already passed your choice.) |
Install directory [~/RFS]: (only when cloning) |
~/RFS |
Press Enter to clone into ~/RFS, or type another path. |
Remove <dir> and re-clone …? [y/N] (only if that directory already holds a different repo) |
No | Answer y only if you are sure you want to delete that directory and re-clone; otherwise N and choose a different install directory. |
Download and install them now? [Y/n] (content images, ~110 MB) |
Yes | Press Enter to download the MZF / disk / CP/M / BASIC content from RFS_Files.zip — required for a full build. Answer n only if you already have them via a sibling SharpSoft checkout. |
Run the first build now (./build.sh -m …)? [Y/n] |
Yes | Press Enter to build straight away — this verifies the whole environment. The first build uses -m to process the MZF sources into MZB/ and is slower than later builds. |
You may also be prompted for your sudo password (package install) and your git credentials if you chose a private repository.
After setup — building again
When setup finishes it prints the checkout path. To rebuild later:
cd ~/RFS # or the directory you chose
source ./rfs_env.sh # macOS only (adds GNU coreutils + the JRE to PATH); harmless elsewhere
./build.sh -m # FIRST build: process MZF -> MZB, then build everything
./build.sh # subsequent builds (re-run -m only when MZF sources change)
./build.sh -h # list variants and options
On Windows, open the Ubuntu terminal (Start Menu → “Ubuntu”, or type wsl in PowerShell) and run the same commands inside ~/RFS. The ROM images appear in ~/RFS/roms.
build.sh builds all hardware variants by default; pass one or more variant names (sfd700, romdisk_mz80a, picoz80_mz80a, picoz80_kuma, picoz80_mz700, picoz80_mz1500, picoz80_mz80k, or all) to build only those. Selecting a variant configures everything automatically — no source edits needed. Options: -m (process MZF), -s (skip shared assembly), -c (clean), -v (verbose), -h (help).
Advanced: build target flags
For most builds you do not need this section — selecting a variant with build.sh (above) configures everything automatically. The underlying mechanism is a set of flags in asm/include/rfs_definitions.asm; exactly one of the following is set to 1 (all others 0) for a given target, which build.sh does for you per variant. Edit them by hand only for a custom configuration:
| Flag | Target | Description |
|---|---|---|
BUILD_ROMDISK |
RomDisk card | MZ-80A with 4×512 KB Flash RAM + SDXC card expansion. |
BUILD_SFD700 |
SFD-700 | Sharp floppy disk interface board. No SD card. |
BUILD_PICOZ80 |
picoZ80 | Raspberry Pi Pico based Z80 replacement board. |
Additional optional flags in the same file:
| Flag | Default | Description |
|---|---|---|
KUMA80_ENA |
0 | Set to 1 if the Kuma 40/80 column upgrade is installed. |
VIDEOMODULE_ENA |
0 | Set to 1 if the 40/80 column colour Video Module is installed. |
FUSIONX_ENA |
0 | Set to 1 when running RFS on the tranZPUter FusionX board. |
HW_SPI_ENA |
1 | Hardware SPI (RomDisk v2+ PCB). Leave at 1 for all current boards. |
ENADEBUG |
0 | Enable assembly-time debug logging. |
Manual build and what build.sh does
If you prefer not to use the setup script (or are scripting a CI build), you can clone and build directly — you must still have the prerequisites installed and, on a fresh standalone clone, fetch the content images yourself (or run setup_RFS.sh, which does it for you):
git clone --recurse-submodules https://git.eaw.app/eaw/RFS.git
cd RFS
# Full build (assembles all ROMs, packages ROM images, builds SD card image):
./build.sh
# Full build including re-processing all MZF application files
# (only needed when MZF source files in MZF/ have changed):
./build.sh -m
build.sh performs the following steps in order:
- Compiles
cpmtoolsfrom source (first run only) and adds the result toPATH. tools/assemble_rfs.sh— assemblesrfs.asmandrfs_mrom.asmintoroms/rfs.romandroms/rfs_mrom.rom.tools/assemble_cpm.sh— assembles the CP/M 2.2 CBIOS (cbios.asm,cbios_bank1–4.asm,cpm22.asm) intoroms/*.rom.tools/assemble_roms.sh— assembles all monitor variants (SA-1510, 80c SA-1510, 1Z-013A, hi-load variants, Kuma version, IPL) and MZF application files (SA-5510, MS-BASIC variants, etc.) intoroms/andMZB/.tools/make_roms.sh— packages the assembled ROMs and MZF applications into Flash ROM images (see Output Files below).tools/make_cpmdisks.sh— builds CP/M disk images in RAW and CPC Extended Disk Format for each of the pre-populated CP/M drive sets.tools/make_sdcard.sh— assembles the final SD card image combining 10 RFS drive images and 7 CP/M disk images.
The individual scripts can also be run directly from within the tools/ directory for partial rebuilds.
Output Files
After a successful build the roms/ directory contains:
| File | Flash chip | Description |
|---|---|---|
MROM_ROMDISK_256.bin |
SST39SF040 (Monitor ROM) | Monitor ROM image for the RomDisk build. Contains SA-1510, 80c SA-1510, CP/M CBIOS, RFS mrom utilities, 1Z-013A monitors, assembler/disassembler opcode tables, IPL and message strings across 16×4 KB pages. |
MROM_PICOZ80_256.bin |
SST39SF040 (Monitor ROM) | Monitor ROM image for the picoZ80 build (bank order differs from ROMDISK). |
USER_ROM_256.bin |
SST39SF040 (User ROM 1) | User ROM 1: RFS banks 0–11, CP/M CBIOS banks 12–15, CP/M 2.2 image and a packed set of MZF applications. |
USER_ROM_II_256.bin |
SST39SF040 (User ROM 2) | User ROM 2: additional MZF applications. |
USER_ROM_III_256.bin |
SST39SF040 (User ROM 3) | User ROM 3: additional MZF applications. |
SFD700_256.bin |
SST39SF040 | SFD-700 ROM: MZ-80A AFI floppy ROM (0x00000–0x00FFF), MZ-700 floppy ROM (0x01000–0x01FFF), RFS firmware (0x02000–0x0BFFF), then ROM file system. |
SHARP_MZ80A_RFS_IMAGE_0–9.img |
SD card | Ten RFS drive images (one per 0–9 drive). |
SHARP_MZ80A_RFS_CPM_IMAGE_1.img |
SD card | Combined SD card image: 10 RFS drives followed by 7 CP/M disk images. Copy this directly to an SD card. |
Programming the Flash ROMs
The ROM images are written to SST39SF040 (512 KB) Flash RAM chips using a TL866 or compatible programmer:
# Monitor ROM (RomDisk build):
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/MROM_ROMDISK_256.bin
# User ROM 1:
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/USER_ROM_256.bin
# SFD-700:
minipro --infoic /path/to/minipro/infoic.xml -p SST39SF040 -s -w roms/SFD700_256.bin
Writing the SD Card Image
Write the combined SD card image directly to the SD card using dd:
# Replace /dev/sdX with your SD card device:
dd if=roms/SHARP_MZ80A_RFS_CPM_IMAGE_1.img of=/dev/sdX bs=512
sync
No partitioning is required. The SDCFS image begins at sector 0. Insert the SD card into the reader on the RomDisk board.
Adding Applications to the ROM Drives
Applications stored in the Flash ROM drives must first be converted from MZF format into sector-padded binary images. Place the MZF files in the appropriate subdirectory under MZF/ and run:
tools/processMZFfiles.sh
This converts all MZF files into 128-byte and 256-byte sector-padded images stored in MZB/. They are then picked up automatically by make_roms.sh.
To choose which applications appear in each ROM drive, edit tools/make_roms.sh and adjust the addMZFToROMImageList calls. Each call takes four flags (include in ROMDISK build, include in SFD700 build, include in picoZ80 build, reserved) and the path to the sectored binary:
# Format:
# addMZFToROMImageList <ROMDISK> <SFD700> <picoZ80> <reserved> "<MZB path>"
#
# Example — include in all builds:
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/sa-5510_rfs.${SECTORSIZE}.bin"
# Example — RomDisk and picoZ80 only:
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/defender.${SECTORSIZE}.bin"
Applications are packed in the order listed, filling User ROM 1 first, then User ROM 2 and 3. Place applications you always want available at the top of the list.
Build Tools Reference
| Script / Tool | Description |
|---|---|
build.sh |
Top-level build script. Runs all steps below in order. Pass -m to also reprocess MZF application files. |
tools/assemble_rfs.sh |
Assembles rfs.asm and rfs_mrom.asm → roms/rfs.rom, roms/rfs_mrom.rom. |
tools/assemble_cpm.sh |
Assembles the CP/M 2.2 CBIOS and kernel → roms/*.rom. |
tools/assemble_roms.sh |
Assembles all monitor ROM variants and MZF application binaries. Handles the four MS-BASIC build variants via a BUILD_VERSION EQU written to include/msbasic_buildversion.asm before each pass. |
tools/make_roms.sh |
Packages ROM and MZF binaries into Flash ROM images for ROMDISK, SFD700 and picoZ80 targets. |
tools/make_cpmdisks.sh |
Creates CP/M disk images in RAW format (for SD card) and CPC Extended Disk Format (for floppy emulators or physical copying). |
tools/make_sdcard.sh |
Combines RFS drive images and CP/M disk images into a single SD card image. |
tools/processMZFfiles.sh |
Converts MZF application files into 128-byte and 256-byte sector-padded images in MZB/. |
tools/mzftool.pl |
Perl script to create, extract and inspect MZF format images. |
tools/sdtool |
Binary tool that builds the RFS SD card directory structure and populates it with MZF / binary applications. |
tools/nasconv |
Converts NASCOM cassette image files to MZ-80A loadable format, remapping MS-BASIC token values as needed. |
tools/glass.jar |
Bundled GLASS Z80 assembler (Java). Used by all three assembly scripts. |
tools/MZFD/MZFDTool |
Creates and manages raw floppy disk images for the MZ-700 FDC. Commands: format (create blank image), dir (list directory), add (add MZF file), extract (extract file to MZF), boot (set boot program). Default image: MZ700.img. |
tools/MZQD/MZQDTool |
Creates and manages Quick Disk (QD) images for the MZ-700. Commands: format (create blank image), dir (list directory), add (add MZF file). Default image: MZ700.qd. |
cpmtools/ |
cpmtools source (cpmcp, cpmls, cpmrm, etc.). Compiled automatically on first build and installed into tools/. |
SD Card Filing System
SDCFS Structure
| FLAG1 | FLAG2 | FILE NAME | START SECTOR | SIZE | LOAD ADDR | EXEC ADDR | RESERVED |
|---|---|---|---|---|---|---|---|
| 1 Byte | 1 Byte | 17 Bytes | 4 Bytes | 2 Bytes | 2 Bytes | 2 Bytes | 3 Bytes |
| Field | Description |
|---|---|
| FLAG1 | Bit 7 = 1: valid entry. Bit 7 = 0: inactive / deleted. |
| FLAG2 | MZF execution type (0x01 = binary). |
| FILE NAME | Standard 17-character MZF filename. |
| START SECTOR | First sector within this drive image where the file data begins. |
| SIZE | Actual byte count of the file data. |
| LOAD ADDR | RAM address to load the file data to. |
| EXEC ADDR | Auto-execution address for binary files. |
| RESERVED | Not currently used. |
Each file block is a fixed 64 KB, matching the maximum CMT (tape) block size. This keeps the layout simple and allows files to be read or written exactly as if they were on tape, enabling transparent SD↔CMT copy operations.
SD Card Layout
ADDRESS SECTOR CONTENT
00000000 00000 ┌─────────────────────────────────────────────────────────────┐
│ RFS DRIVE 0 │
00000000 00000 │ Directory entry 000 (32 bytes) │
│ ... │
00001FE0 0000F │ Directory entry 255 (32 bytes) │
00002000 00010 │ File block 0 (64 KB) │
│ ... │
00FF2000 7FF90 │ File block 255 (64 KB) │
01001FFF 8000F └─────────────────────────────────────────────────────────────┘
... (RFS drives 1–8 follow the same pattern)
09012000 48090 ┌─────────────────────────────────────────────────────────────┐
│ RFS DRIVE 9 │
0A013FFF 5009F └─────────────────────────────────────────────────────────────┘
... padding to 256 MB boundary ...
10000000 80000 ┌─────────────────────────────────────────────────────────────┐
│ CP/M DISK IMAGE 0 (16 MB, 32 sectors × 1024 tracks) │
11000000 88000 ├─────────────────────────────────────────────────────────────┤
│ CP/M DISK IMAGE 1 │
│ ... │
XX000000 │ CP/M DISK IMAGE n │
└─────────────────────────────────────────────────────────────┘
SD Card Organisation
The SD card image built by the repository tools is pre-populated as follows:
| RFS Drive | Contents |
|---|---|
| 0 | Common and MZ-80A machine code programs. |
| 1 | MZ-80K machine code programs. |
| 2 | MZ-700 machine code programs. |
| 3 | MZ-800 / MZ-1500 machine code programs. |
| 4 | MZ-80B / MZ-2000 machine code programs. |
| 5 | BASIC programs, type 2 (MZ-80A). |
| 6 | BASIC programs, type 2 (MZ-80K). |
| 7 | BASIC programs, type 5 (MZ-700 / MZ-800). |
| 8 | Other / miscellaneous programs. |
| 9 | Other / miscellaneous programs. |
| CP/M Drive | User# | Disk image | Contents |
|---|---|---|---|
| 0 | 0 | CPM00_SYSTEM | CP/M system programs |
| 1 | CPM01_TURBOP | Turbo Pascal | |
| 2 | CPM02_HI_C | Hi-Soft C | |
| 3 | CPM03_FORTRAN80 | Fortran 80 | |
| 4 | CPM04_MBASIC | Microsoft BASIC 80/85 | |
| 5–7 | CPM05–07_COBOL80 | Cobol v1.3, v2.0, Cobol 80 | |
| 8 | CPM08_Z80FORTH | Z80 Forth | |
| 9 | CPM09_CPMTEX | CP/M TeX | |
| 10 | CPM10_DISKUTILFUNC5 | Disk utilities | |
| 11 | CPM11_MAC80 | Macro Assembler 80 | |
| 12 | CPM29_ZSID_v14 | ZSID Debugger | |
| 13–14 | CPM32–33_ZCPR3 | ZCPR3 CCP enhancement | |
| 1 | 0 | CPM12_PASCALMTP_v561 | Pascal v5.61 |
| 1 | CPM26_TPASCAL_v300a | Turbo Pascal v3.00a | |
| 2–11 | CPM13–22_MTPUG_01–10 | Pascal User Group Disks 01–10 | |
| 2 | 0–2 | CPM23–25_PLI / PLI80 | PLI Compiler, PLI 80 v1.3, v1.4 |
| 3 | CPM28_PLM80 | PLM 80 | |
| 4–6 | CPM27,30,31_WORDSTAR | WordStar v3.0, v3.3, v4.0 | |
| 3–6 | 0–9 | CPM_MC_C0–F9 | Grant Searle CP/M collection disks C0–F9 |
Manuals
| Manual | Description |
|---|---|
| User Manual | Getting RFS, monitor command reference, using SD drives, BASIC, CP/M, and troubleshooting |
| Technical Guide | Hardware platforms, memory architecture, bank switching, SDCFS design, CP/M CBIOS, and full build system reference |
| Developer’s Guide | Z80 assembly primer, full source module walkthroughs (including bank-switching internals), and guides for adding new commands and hardware targets |
Credits
Licenses
No commercial use to be made of this design or any hardware/firmware component without express permission from the author. This condition overrides any rights afforded by the GNU GPL 3 license.
The Gnu Public License v3
The source files are distributed in the hope that they 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/.