Update README from eaw.app website content

This commit is contained in:
eaw
2026-03-14 10:06:46 +00:00
parent 6dbb5c4b1f
commit ae69830dc4

587
README.md
View File

@@ -1,357 +1,386 @@
## Overview
# MZ80A_RFS
**Website:** [engineers@work](https://eaw.app) | **Repository:** [git.eaw.app/eaw/MZ80A_RFS](https://git.eaw.app/eaw/MZ80A_RFS)
---
## <font style="color: yellow;" size="6">Overview</font>
<div style="text-align: justify">
The Sharp MZ80A came with 48K RAM and 4K ROM and apart from the option to add a 2K User RAM/ROM and a 4K Floppy Drive ROM, there was no further possibility to expand the machine memory
capabilities at the hardware level and thus no additional firmware could be added for use at power-on. Add-ons had to rely on loading control firmware into RAM via tape or floppy, thus depleting valuable application space. Some machines of the same era
utilised a scheme called 'banking' whereby much larger memories would occupy a smaller block within the CPU address space and be selected according to features required and hardware attached. The
BBC Micro was such a machine with upto 16 banks of 16Kb, it made the machine much more useable.
BBC Micro was such a machine with up to 16 banks of 16Kb, it made the machine much more useable.
<br><br>
One of the seperate projects I've been working on was a 40/80 Column switchable display and colour output. This upgrade requires different software, either a complete rewrite of the original
One of the separate projects I've been working on was a 40/80 Column switchable display and colour output. This upgrade requires different software, either a complete rewrite of the original
monitor or a patched copy for 80 column mode. Wanting to keep the machine as original as possible, using a rewritten ROM is out of the question thus I would need 2 ROMS, original for 40Column
and a patched one for 80Column.
<br><br>
Thus was born the need for Rom Paging in the Sharp MZ80A, ie. Use a modern Flash RAM to house multiple 4K Roms which can be *switched in* to the 4K Monitor ROM address space according to the
hardware upgrade being used.
<br><br>
It was also seen when using large Flash RAM's it was possible to store programs that would normally be present on tape or floppy and load at much higher speed making use of the computer that
It was also seen when using large Flash RAM's that it was possible to store programs that would normally be present on tape or floppy and load at much higher speed making use of the computer that
much easier.
<br><br>
This upgrade goes a bit further and uses the 4K Monitor ROM and 2K User ROM space to map in 2x512Kbyte Flash RAM's providing multiple paged roms (theoretical 256 x 2K slots and 128 x 4K slots)
and the required custom software to control the banking called the Rom Filing System.
This upgrade goes a bit further and uses the 4K Monitor ROM and 2K User ROM space to map in up to 4x512Kbyte Flash RAMs and/or 1x512Kbyte Static RAM which provides multiple paged roms (theoretical 1024 x 2K slots and 128 x 4K slots) and/or
a paged RAM (256 x 2K slots) along with the required custom software to control the banking which I've termed the '<i>Rom Filing System</i>'.
</div>
This page along with the [CP/M](/sharpmz-upgrades-cpm) page forms the start of the RFS documentation which is still in its infancy. Within this repository are the schematics, PCB Gerber files and the software to implement the Rom Filing
System hardware and software.
This document along with the [Rom Filing System](/sharpmz-upgrades-rfs) and [CP/M](/sharpmz-upgrades-cpm) document form the start of the Rom Disk documentation. Within this repository are the schematics, PCB Gerber files and the Gitea repository sub-modules implement the Rom Disk hardware, the Rom Filing System and CP/M software.
## Rom Filing System
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="6">Rom Disk Hardware</font>
The Rom Filing System is a hardware and software upgrade for the Sharp MZ80A. The hardware replaces the Monitor and User ROM's on the motherboard by a daughter card with lifter sockets where 2x512Kbyte Flash RAM's are sited.
One of the Flash RAM's is paged into the Monitor ROM socket and the other into the User ROM socket. The first 32Kbytes (8 slots x 4K) of the Monitor Flash RAM and the first 24Kybtes (12 slots of 2K) of the User Flash RAM is
dedicated to paged ROMs with the remainder being used to store Sharp MZF format binary images compacted within 256byte sectors. (*NB. This may change to 128 byte sectors as the original reason for choosing 256 byte
sectors no longer exists*).
<div style="text-align: justify">
It is quite easy to make upgrades for older tech these days by using one of the plethora of ready made development boards such as the Raspberry Pi or standalone microcontrollers such as the STM32 series and the rich libraries of ready made software.
<br><br>
### RFS Hardware
I did consider using an STM32F series microcontroller as a ROM emulator as they have the price, performance and packaging advantages but then the goal of this project and the goals of the other Sharp MZ80A upgrades (excluding the tranZPUter) was to use old tech and keep the machine
original.
<br><br>
It is quite easy to make upgrades for older tech these days by using one of the plethora of ready made development boards such as the Raspberry Pi or standalone microcontrollers such as the STM32 series. I did consider using an STM32F series
microcontroller as a ROM emulator as they have the price, performance and packaging advantages but then the goal of this project and the goals of the other Sharp MZ80A upgrades (excluding the Tranzputer) was to use old tech and keep the machine
original. Unlike a commercial project where part choice to provide the required functionality is imperative to keep costs low, with this project the focus is on the learning journey using parts such as the 74 series which were available at the
Unlike a commercial project where part choice to provide the required functionality is imperative to keep costs low, with this project the focus is on the learning journey using parts such as the 74 series which were available at the
time of the Sharp, excepting of course the larger Flash RAM and Static RAMs which came a few years later but necessary for the functionality.
<br><br>
![image](../images/MZ80A_RFS_v2_0-2.png)
The sub-sections below outline the hardware design and pcb, including all versions for comparison.
</div>
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">v1.1 Combined Schematic</font>
![image](../images/MZ80A_RFS_v1_1.png)
<div style="text-align: justify">
Version 1.1 of the Rom Disk was relatively simplistic, adding a 512K Flash RAM in each of the Monitor and User ROM sockets. A latch was added to select the correct 4K/2K page within the Flash RAM under program control.
</div>
#### <font style="color: yellow;" size="5">v1.1 PCB</font>
<div style="text-align: justify"><br>
Version 1.0 PCB (which became v1.1 with minor changes). Originally I planned to use skinny dip memory devices but changed to PDIP and had to adapt the board accordingly.
</div>
![Assembled PCB](../images/IMG_9625.jpg)
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">v2.0</font>
<div style="text-align: justify">
Version 2.0 took the developments of v1.1 and addressed the short comings, ie. more Flash RAM space required, addition of an SD Card and additional Static RAM.
<br><br>
The SD card started off as a bigbang development using a Sharp Parallel printer card, which enabled the software and basic framework to be developed. The design
then went further by adding a hardware SPI circuit. The hardware circuit is almost as quick as the Flash RAM devices whereas the software SPI circuit is faster than a floppy disk but noticeably slower than ROM.
<br><br>
Having ported CP/M (by writing a custom CBIOS) to run under the Rom Filing System on the Rom Disk, I noticed the shortfalls in lack of RAM, where even with ROM banking I could only make 46K available to CP/M and programs such as the venerable Star Trek V2 failed to run. In order to address this issue
an additional 512K RAM device was added which could be paged in 2K segments. This RAM would make available storage space for CP/M structures such as control blocks and variables in order to free up more space.
<br><br>
All the above came together as the v2.0 design and the schematics/pcb details are in the sub-section below.
</div>
### <font style="color: yellow;" size="5">v2.0 Memory Schematic</font>
![image](../images/MZ80A_RFS_v2_0a-2.png)
<div style="text-align: justify">
Version 2 of the hardware builds on the experiences learnt making version 1. It adds a coded latch (a programmable number of reads required in the 0xEFF8-0xEFFF region) in order to enable access to the control registers and I/O otherwise
both read and write access is performed on memory. It also adds two additional (optional) memories for increased storage and RAM. The additional two devices can be both Flash RAM or 1 Flash RAM and 1 Static RAM. The Static RAM is to
increase the capability of CP/M, such as number of SD drives available and the memory available to TPA applications.
<br><br>
The schematic has been split into two distinct functions, Memory and Control logic. Above is the new Memory schematic which retains the single 512K Flash RAM which replaces the Monitor ROM, write access is not possible as the underlying
Sharp hardware blocks write on Monitor ROM select. In the User ROM socket are 3 devices, the 512K Flash RAM from version 1 but with write access and an additional 2 devices.
</div>
![image](../images/MZ80A_RFS_v2_0-3.png)
### <font style="color: yellow;" size="5">v2.0 Control Logic Schematic</font>
![image](../images/MZ80A_RFS_v2_0a-3.png)
<div style="text-align: justify">
The second schematic is the control logic. This creates the needed memory select lines from the main board in combination with address decoding and programmable latches for the upper address lines.
<br><br>
A coded latch is added (74HCT191) which only enables I/O when a read is made to the region 0xEFF8-0xEFFF for a programmable number of times, set by the latch U14 bits 3:5. At start up these bits will be 0 and to enable the I/O a read
will be needed in the region 0xE800-exEFF7 to reset the 74HCT191 which must then be followed by 16 reads to the range 0xEFF8-0xEFFF. Once the I/O is enabled, the latch value can be changed along with other registers. As soon as a read is made
into the region 0xE800-0xEFF7 then the I/O control is disabled and reads/writes are sent to the selected memory device.
A coded latch is added (74HCT191) which only enables I/O when a read is made to the region 0xEFF8-0xEFFF for a programmable number of times. The latch U14 bits 5:3 control the number of read operations needed to active the
74HCT191. At start up U14 bits 5:3 will be 0 and to enable I/O you need to perform 16 read operations in the region 0xEFF8-0xEFFF to activate the 74HCT191 TC (terminal count) which in turn will enable the I/O control registers in the region,
ie. 0xEFF8-0xEFFF. When the control registers are active the memory region 0xE800-0xEFF7 still accesses the selected Flash RAM/RAM device. A read from the location 0xEFF9 will reset the 74HCT191 and the control registers will be deactivated,
the region 0xEFF8-0xEFFF now access the selected Flash RAM/RAM.
<br><br>
In addition it adds 2 SPI circuits, only one of which will be assembled on the PCB according to choice. The first is a software bitbang SPI using the Z80 to form the correct serial and clock signals in order to talk to an SD Card.
This method uses few hardware components but is much slower. The second is a hardware SPI running at 8MHz which is capable of transferring/receiving a byte in less time that the Z80 takes to perform a read, this allows for performance
similar to the Flash RAM storage. On the hardware SPI it is possible via U14 bit 0 to manually clock the SPI logic, this is intentional as initial connections with an SD Card should begin at 100KHz or less, once established and parameters
set then the 8MHz hardware clock is used.
similar to the Flash RAM storage.
</div>
### RFS Software
#### <font style="color: yellow;" size="5"> v2.0 PCB</font>
In order to use the RFS Hardware, a comprehensive set of Z80 assembler methods needed to be written to allow bank paging and with it came the option, which was taken, to upgrade the machines monitor functionality. This Z80
software forms the Rom Filing System which can be found in the repository within the \<software\> directory.
<div style="text-align: justify"><br>
As per previous schematics and PCB boards, this project has been designed with KiCad Schematic Capture and PCB Layout. Below are the finished boards awaiting components and assembly.
</div>
The following table describes each major file which forms the Rom Filing System:
![PCB TopSide](../images/RFS_v2_PCB_TopSide.jpg)
| Module | Target ROM | Size | Bank | Description |
|------------------------|------------|------|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| rfs.asm | User | 2K | 0 | Primary Rom Filing System and MZ700/MZ800 Monitor tools. |
| rfs_bank1.asm | User | 2K | 1 | Floppy disk controller functions. |
| rfs_bank2.asm | User | 2K | 2 | SD Card controller functions. |
| rfs_bank3.asm | User | 2K | 3 | Memory monitor utility functions and tape/SD copy utilities. |
| rfs_bank4.asm | User | 2K | 4 | CMT functions. |
| rfs_bank5.asm | User | 2K | 5 | Unused. |
| rfs_bank6.asm | User | 2K | 6 | Message printing routines, static messages, ascii conversion and help screen. |
| rfs_bank7.asm | User | 2K | 7 | Memory Test utility and 8253 Timer test. |
| cbios_bank1.asm | User | 2K | 8 | CPM CBIOS Utilities and Audio functions. |
| cbios_bank2.asm | User | 2K | 9 | CPM CBIOS Screen and ANSI Terminal functions. |
| cbios_bank3.asm | User | 2K | 10 | CPM CBIOS SD Card Controller functions. |
| cbios_bank4.asm | User | 2K | 11 | CPM CBIOS Floppy Disk Controller functions. |
| monitor_SA1510.asm | Monitor | 4K | 0 | Original SA1510 Monitor for 40 character display. |
| monitor_80c_SA1510.asm | Monitor | 4K | 1 | Original SA1510 Monitor patched for 80 character display. |
| cbios.asm | Monitor | 4K | 2 | CPM CBIOS (exec location 0xC000:0xCFFFF). |
| rfs_mrom.asm | Monitor | 4K | 3 | Rom Filing System helper functions located in the Monitor ROM space in Bank 3. These functions are used to scan and process MZF files stored within the User ROM space. |
| unassigned | Monitor | 4K | 4 | Unused slot. |
| unassigned | Monitor | 4K | 5 | Unused slot. |
| unassigned | Monitor | 4K | 6 | Unused slot. |
| unassigned | Monitor | 4K | 7 | Unused slot. |
![PCB UnderSide](../images/RFS_V2_PCB_UnderSide.jpg)
![Assembled PCB](../images/IMG_1242.jpg)
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">v2.1</font>
<div style="text-align: justify">
Version 2.1 is a tidy up and bug fix version. In version 2.0 I noticed an error (due to the Sharp MZ decoder always creating User ROM Chip Select pulses even when not addressing the User ROM, this was determined to be the refresh address logic decode) and it interfered
with the control latch reset. I thus added a wire AND gate and changed the select line which reset the coded latch.
<br><br>
The chance was also taken to tidy up the PCB silk screen to orient the markings as per the Sharp MZ motherboard and can be seen in the sub-section below.
</div>
In the User ROM, the rfs.asm module and all the rfs_bank\<x\>.asm modules form the Rom Filing System and are invoked by the original SA-1510 monitor on startup of the MZ80A (or reset). The functionality in these files provides
the Rom Filing System and additional MZ700/800 style monitor utilities. The way the code is structured, a call can be made from one bank to another without issue (stack and execution point manipulation is taken care of) thus
providing almost 16K program space in the User ROM slot.
### <font style="color: yellow;" size="5">v2.1 Memory Schematic</font>
Sharing the User ROM banks are the cbios_bank\<x\>.asm modules which form part of the CP/M Custom BIOS. They extend the functionality of the CBIOS without impacting RAM usage which is crucial within CP/M in order
to run as many applications as possible.
In the Monitor ROM, the rfs_mrom.asm module is located within the 4th bank (bank 3, bank 0 = original SA1510 ROM, bank 1 = 80 column modified SA1510 ROM) and provides utilities needed by the Rom Filing
System. These utilities are specifically needed for scanning and loading MZF files stored in the User ROM Flash RAM (because code executing in the User ROM cant page itself out to scan the
remainder of the ROM).
![image](../images/MZ80A_RFS_v2_1-2.png)
CPM v2.2 has been added with the CBIOS (Custom BIOS) being implemented within an MROM Bank (bank 2) along with User ROM Banks 8-11 mentioned above. This saves valuable RAM leaving only the CPM CCP and BDOS in RAM which can
be overwritten by programs, this gives a feasible 47K of useable program RAM. An intention is to include a paged RAM chip in the next release of the RFS Hardware which will allow upto 52K of program RAM.
<div style="text-align: justify">
Version 2.1 is a bug/shortcoming fix of v2.0. The circuit diagrams of v2.0 have already been updated with the changes but the physical board relied on component additions and wires. Hence this circuit is identical to v2.0 (in hindsight I should
not have updated the v2.0 schematic but created v2.1 at the point of change).
<br><br>
Nothing has changed on the memory schematic between the original v2.0 and v2.1 designs.
</div>
There are several rapidly written shell scripts to aid in the building of the RFS software (which in all honesty need to be written into a single Python or Java tool). These can be seen in the following table along with their purpose:
### <font style="color: yellow;" size="5">v2.1 Control Logic Schematic</font>
| Script | Description |
|------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| assemble_cpm.sh | A shell script to build the CPM binary, the CPM MZF format application for loading via RFS and the CPM ROM Drives 0 & 1 |
| assemble_rfs.sh | A bash script to build the Rom Filing System ROM images. |
| assemble_roms.sh | A bash script to build all the standard MZ80A ROMS, such as the SA-1510 monitor ROM. |
| make_roms.sh | A bash script to build the RFS ROMS suitable for programming in the 512KByte Flash RAMS. These images contain the banked RFS ROMS, the various system ROMS such as SA-1510 and all the MZF programs to be loaded by the RFS. |
| make_cpmdisks.sh | A bash script to build a set of CPM disks, for use as Raw images in the SD Card or Rom drives and as CPC Extended Disk Formats for use in a Floppy disk emulator or copying to physical medium. |
| make_sdcard.sh | A bash script to create an SD card image combining the RFS Image and several CPM disk drives. This image is then binary copied onto the SD card and installed into the RFS SD Card reader. |
| mzftool.pl | A perl script to create/extract and manipulate MZF images. |
| processMZFfiles.sh| A bash script to convert a set of MZF programs into sectored images suitable for use in the Rom Filing System ROMS. |
| sdtool | A binary created from the src/tools repository which builds the RFS SD Card image, creating a directory and adding MZF/Binary applications into the drive image. |
To build the software, the assemble_\<name\> shell scripts are used. These scripts requires the [GLASS Z80 Assembler](https://bitbucket.org/grauw/glass/src/default/) which is freely downloadable.
The procedure to build a ROM is:-<br/>
1. Take a set of MZF files and convert them into correct sector padded binary files. The proc_mzf.sh file takes a directory and processes all files within it, transforming originalfile.mzf to originalfile.mzf.\<sector size>.bin<br/>
2. Build the Z80 code using \<tools\>/assemble_rfs.sh for the RFS components, \<tools\>/assemble_roms.sh for assembling all original ROM source including the SA1510 monitor ROM, \<tools\>/assemble_cpm.sh for
assembling the CPM binaries and dependencies.<br/>
3. Build the ROM using the \<tools\>/make_roms.sh script - before using this you need to create your own selection of MZF files by listing the files with ls -l then converting them into a set of ROM_INCLUDE variables for programs that
will go into the User and Monitor Flash RAM's.<br/>
### RFS Monitor
Upon boot, the typical SA-1510 monitor signon banner will appear and be appended with "+ RFS" if all works well. The usual '\* ' prompt appears and you can then issue any of the original SA-1510 commands along with a set of enhanced
commands, some of which were seen on the MZ700/ MZ800 range and others are custom. The full set of commands are listed in the table below:
![image](../images/MZ80A_RFS_v2_1-3.png)
| Command | Parameters | Description |
|---------|-------------------------------------|------------------------------------------------------------------------------------|
| 4 | n/a | Switch to 40 Character mode if the 40/80 Column display upgrade has been added\. |
| 8 | n/a | Switch to 80 Character mode if the 40/80 Column display upgrade has been added\. |
| B | n/a | Enable/Disable key entry beep\. |
| C | \[\<8 bit value\>\] | Initialise memory from 0x1200 \- Top of RAM with 0x00 or provided value\. |
| D | \<address>\[\<address2>\] | Dump memory from \<address> to \<address2> (or 20 lines) in hex and ascii. When a screen is full, the output is paused until a key is pressed\. <br><br>Subsequent 'D' commands without an address value continue on from last displayed address\.<br><br> Recognised keys during paging are:<br> 'D' - page down, 'U' - page up, 'X' - exit, all other keys list another screen of data\.|
| EC | \<name> or <br>\<file number> | Erase file from SD Card\. The SD Card is searched for a file with \<name> or \<file number> and if found, erased\. |
| F | \[\<drive number\>\] | Boot from the given Floppy Disk, if no disk number is given, you will be prompted to enter one\. |
| f | n/a | Execute the original Floppy Disk AFI code @ 0xF000 |
| H | n/a | Help screen of all these commands\. |
| IR | n/a | Paged directory listing of the files stored in ROM\. Each file title is preceded with a hex number which can be used to identify the file\. |
| IC | n/a/ | Paged directory listing of the files stored on the SD Card\. Each file title is preceded with a hex number which can be used to identify the file\. |
| J | \<address> | Jump \(start execution\) at location \<address>\. |
| L \| LT | n/a | Load file into memory from Tape and execute\. |
| LTNX | n/a | Load file into memory from Tape, dont execute\. |
| LR | \<name> or <br>\<file number> | Load file into memory from ROM\. The ROM is searched for a file with \<name> or \<file number> and if found, loaded and executed\. |
| LRNX | \<name> or <br>\<file number> | Load file into memory from ROM\. The ROM is searched for a file with \<name> or \<file number> and if found, loaded and not executed\. |
| LC | \<name> or <br>\<file number> | Load file into memory from SD Card\. The SD Card is searched for a file with \<name> or \<file number> and if found, loaded and executed\. |
| LCNX | \<name> or <br>\<file number> | Load file into memory from SD Card\. The SD Card is searched for a file with \<name> or \<file number> and if found, loaded and not executed\. |
| M | \<address> | Edit and change memory locations starting at \<address>\. |
| P | n/a | Run a test on connected printer\. |
| R | n/a | Run a memory test on main mmemory\. |
| S | \<start addr> \<end addr> \<exec addr> | Save a block of memory to tape\. You will be prompted to enter the filename\. <br><br>Ie\. S120020001203 - Save starting at 0x1200 up until 0x2000 and set execution address to 0x1203\. |
| SC | \<start addr> \<end addr> \<exec addr> | Save a block of memory to SD Card\. You will be prompted to enter the filename\. |
| SD2T | \<name> or <br>\<file number> | Copy a file from SD Card to Tape\. The SD Card is searched for a file with \<name> or \<file number> and if found, copied to a tape in the CMT\. |
| T | n/a | Test the 8253 timer\. |
| T2SD | n/a | Copy a file from Tape onto the SD Card. A program is loaded from Tape and written to a free position in the SD Card\. |
| V | n/a | Verify a file just written to tape with the original data stored in memory |
<div style="text-align: justify">
The second schematic is the control logic. The changes made between v2.0 and v2.1 were the addtion of an and gate, created with diodes and the rewiring of 0xEFF9 as the coded latch clear signal.
</div>
#### <font style="color: yellow;" size="5">v2.1 PCB</font>
<div style="text-align: justify"><br>
As per previous schematics and PCB boards, this project has been designed with KiCad Schematic Capture and PCB Layout. Below are the assembled PCB's along with installation in an MZ-80A.
</div>
![PCB TopSide](../images/RFS_v2.1_Topside.png)
![PCB UnderSide](../images/RFS_v2.1_Underside.png)
![Installation](../images/RFS_v2.1_Installation1.png)
If the 40/80 column card is installed, typing '4' switches to 40 Column display, typing '8' switches to 80 Column display. For the directory listing commands, 4 columns of output will be shown when in 80 column mode.
--------------------------------------------------------------------------------------------------------
## Building RFS
### <font style="color: yellow;" size="5">Installation</font>
Building the Rom Filing System involves assembling the Z80 Assembly language source into a machine code binary and packaging it into an image suitable for writing onto a 512Kbyte Flash RAM. You may also want to include MZF applications
in the ROMS for rapid exection via the RFS system. If you intend to use CPM, see also the CPM documentation.
<div style="text-align: justify">
Installing the Rom Disk requires opening the Sharp MZ-80A and locating the Monitor ROM and User ROM chips on the motherboard.
<div style="padding-top: 0.8em;"></div>
<b>Steps:</b>
<ol style="line-height: 1.6em;"><font size="3">
<li>Power off the machine and disconnect the mains cable.</li>
<li>Remove the two screws on the underside of the case and lift the top cover.</li>
<li>Locate IC2 (Monitor ROM, 24-pin DIP near the Z80) and IC3 (User ROM, 24-pin DIP). Carefully remove both chips using a chip puller or flat-bladed screwdriver, levering from both ends equally to avoid bending pins.</li>
<li>Insert the Rom Disk PCB — the two DIP lifter pin arrays plug directly into the vacated ROM sockets. Orient the board so the pin 1 markers align. Press firmly until fully seated.</li>
<li>Route the SD card socket cable to an accessible position. Many builders use the existing CMT opening or cut a small slot in the rear panel.</li>
<li>Close the case.</li>
</font></ol>
</div>
<div style="padding-top: 0.8em;"></div>
To accomplish it you need several tools and at the moment it is quite a manual process.
--------------------------------------------------------------------------------------------------------
## Paths
### <font style="color: yellow;" size="5">Programming the Flash ROMs</font>
For ease of reading, the following shortnames refer to the corresponding path in this chapter.
<div style="text-align: justify">
The Flash ROM chips (SST39SF040, 512 KB each) must be programmed before installation. Pre-built ROM images are available in the <code>releases/</code> directory of the <a href="https://git.eaw.app/eaw/RFS">RFS Gitea repository</a>. A TL866 II+ or compatible programmer with the <code>minipro</code> utility is required.
</div>
<div style="padding-top: 0.8em;"></div>
| Short Name | |
|------------------|----------------------------------------------------------------------------|
| \[\<ABS PATH>\] | The path where this repository was extracted on your system. |
| \<software\> | \[\<ABS PATH>\]/MZ80A_RFS/software |
| \<roms\> | \[\<ABS PATH>\]/MZ80A_RFS/software/roms |
| \<CPM\> | \[\<ABS PATH>\]/MZ80A_RFS/software/CPM |
| \<tools\> | \[\<ABS PATH>\]/MZ80A_RFS/software/tools |
| \<src\> | \[\<ABS PATH>\]/MZ80A_RFS/software/src |
| \<MZF\> | \[\<ABS PATH>\]/MZ80A_RFS/software/MZF |
| \<MZB\> | \[\<ABS PATH>\]/MZ80A_RFS/software/MZB |
| Image File | Flash Chip | Description |
|------------|------------|-------------|
| `MROM_ROMDISK_256.bin` | U1 (Monitor ROM socket) | Monitor ROM banks: SA-1510, 80-col SA-1510, CP/M CBIOS, RFS MROM utilities, 1Z-013A monitors, IPL |
| `USER_ROM_256.bin` | U4 (User ROM socket, chip 1) | RFS banks 07, CP/M CBIOS banks 811, packed MZF applications |
| `USER_ROM_II_256.bin` | U5 (User ROM socket, chip 2) | Additional MZF applications (optional) |
| `USER_ROM_III_256.bin` | U6 (User ROM socket, chip 3) | Additional MZF applications (optional) |
<pre style="font-size: 0.70em; line-height: 1.4em; background: #1a1a1a; padding: 1em; border-radius: 4px; overflow-x: auto;"># Program each chip outside the board (remove from socket, program, re-insert):
minipro -p SST39SF040 -w MROM_ROMDISK_256.bin # Monitor ROM chip (U1)
minipro -p SST39SF040 -w USER_ROM_256.bin # User ROM chip 1 (U4)
minipro -p SST39SF040 -w USER_ROM_II_256.bin # User ROM chip 2 (U5, if fitted)
minipro -p SST39SF040 -w USER_ROM_III_256.bin # User ROM chip 3 (U6, if fitted)</pre>
<div style="text-align: justify">
The Monitor ROM chip (U1) cannot be written in-circuit — the Sharp MZ-80A hardware blocks write access to the Monitor ROM address space. All Flash chips must be programmed before insertion.
</div>
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">Writing the SD Card Image</font>
<div style="text-align: justify">
The pre-built SD card image combines 10 RFS drives (09) and 7 CP/M disk images into a single raw binary. It is written directly to the SD card with no partition table.
</div>
<pre style="font-size: 0.70em; line-height: 1.4em; background: #1a1a1a; padding: 1em; border-radius: 4px; overflow-x: auto;"># Linux / macOS — replace /dev/sdX with your SD card device (check with lsblk or diskutil):
dd if=SHARP_MZ80A_RFS_CPM_IMAGE_1.img of=/dev/sdX bs=4M status=progress
sync</pre>
<div style="text-align: justify">
Any FAT-formatted micro SD card of 2 GB or larger is suitable. The image occupies approximately 500 MB (10 RFS drives + 7 CP/M disk images). Any remaining space on the card beyond the image is unused.
</div>
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">Rom Disk Software</font>
<div style="text-align: justify">
In order to use the Rom Disk Hardware, a comprehensive set of Z80 assembler methods needed to be written to allow bank paging and with it came the ability to upgrade the machines monitor (BIOS) functionality. This Z80
software forms the Rom Filing System which can be found in the Gitea repository under <a href="https://git.eaw.app/eaw/RFS">RFS Repository</a>.
</div>
<font style="color: yellow;" size="5">Rom Filing System</font>
<div style="text-align: justify">
The Rom Filing System (RFS) is a software upgrade for the Sharp MZ-80A primarily intended for use with the MZ-80A Rom Disk but has now been ported to the tranZPUter<sup>FusionX</sup> platform as well. The software replaces the Monitor and User ROMs on the motherboard via the Rom Disk daughter card with lifter sockets where up to 4×512 Kbyte Flash RAMs and 1×512 Kbyte Static RAM are sited.
<div style="padding-top: 0.8em;"></div>
One of the Flash RAMs is paged into the Monitor ROM socket and the other Flash RAM/Static RAM into the User ROM socket. The first 32 Kbytes (8 slots × 4K) of the Monitor Flash RAM and the first 24 Kbytes (12 slots × 2K) of the User Flash RAM is dedicated to paged ROMs, with the remainder used to store Sharp MZF format binary images packed within 256-byte sectors.
<div style="padding-top: 0.8em;"></div>
On boot the Monitor ROM detects the RFS firmware at address 0xE800 and executes it. RFS initialises and appends <code>+ RFS vx.xx</code> to the SA-1510 sign-on banner — this appears regardless of SD card status. The SD card is then initialised separately; if not found or unable to initialise, an error code is printed to indicate the failure. The original <code>* </code> prompt is shown and all original SA-1510 commands remain available alongside the full RFS command set. Please refer to the <a href="/sharpmz-upgrades-rfs-usermanual/">RFS User Manual</a>, <a href="/sharpmz-upgrades-rfs-technicalguide/">Technical Guide</a> and <a href="/sharpmz-upgrades-rfs-developersguide/">Developer's Guide</a> for full details.
</div>
--------------------------------------------------------------------------------------------------------
### <font style="color: yellow;" size="5">Sharp MZ-700 Mode</font>
<div style="text-align: justify">
The tranZPUter SW Version 2.1 board has now been developed and RFS software updated to coexist with this board without a K64F processor (the processor can be present but no use of its services will be made under RFS). This board adds Sharp MZ-700 hardware level
compatibility logic, both memory management and keyboard remapping are made within hardware.
<br><br>
In order to cater for this upgrade, RFS has been updated to include the MZ-700 1Z-013A monitor ROM and a command to enable it. When enabled, the machine is set to compatibility mode, the 1Z-013A ROM loaded as the primary monitor and reset. The keyboard
is remapped real time and so is the memory. Loading S-BASIC, read/write cassette etc works as expected on an MZ-700 whilst phyically running in an MZ-80A.
</div>
## Tools
--------------------------------------------------------------------------------------------------------
All development has been made under Linux, specifically Debian/Ubuntu. I use Windows for flashing the RAM's and using the GUI version of CP/M Tools but havent dedicated any time into building the RFS under Windows. I will in due course
create a Docker image with all necessary tools installed, but in the meantime, in order to assemble the Z80 code, the C programs and work with the CP/M software andCP/M disk images, you will need to obtain and install the following tools.
## <font style="color: yellow;" size="6">Obtaining a Rom Disk</font>
[Z80 Glass Assembler](http://www.grauw.nl/blog/entry/740/) - A Z80 Assembler for converting Assembly files into machine code.<br>
[samdisk](https://simonowen.com/samdisk/) - A multi-os command line based low level disk manipulation tool.<br>
[cpmtools](https://www.cpm8680.com/cpmtools/) - A multi-os command line CP/M disk manipulation tool.<br>
[CPMToolsGUI](http://star.gmobb.jp/koji/cgi/wiki.cgi?page=CpmtoolsGUI) - A Windows based GUI CP/M disk manipulation tool.<br>
[z88dk](https://www.z88dk.org/forum/) - An excellent C development kit for the Z80 CPU.<br>
[sdcc](http://sdcc.sourceforge.net/) - Another excellent Small Device C compiler, the Z80 being one of its targets. z88dk provides an enhanced (for the Z80) version of this tool within its package.<br>
An MZ-80A Rom Disk can be sourced on <a href="https://www.tindie.com/products/pdsmart/sharp-mz-80a-rom-disk/">Tindie</a> fully built or as a kit of parts (with the Flash ROMS pre-programmed).
Alternatively, use the bill of materials below to purchase the parts from your local suppliers/Ebay.
## <font style="color: yellow;" size="5">Required Skill Level</font>
Assembly of the PCB requires good SMD soldering skills and a proven technique is as follows:
- Using a nano-solder paste in a syringe, inject a little solder onto each pad.
- Place components onto the pads, smudging or bridges are not so critical (so long as you don't place excessive solder onto the pad) as the solder consolidates around the source of heat so bridges don't tend to be an issue.
- Using a 0.5mm solder bit at approx 350'c, touch each IC and component pin. If a bridge does form, use a needle, whilst applying heat, to draw out the bridge.
- Alternatively, use a heat gun at 350'c with fine nozzle and low fan speed, heat up a small section of components until the solder flows and bonds.
- On completion, wash the assembled board in Isopropyl Alcohol to remove any surplus nano-solder or flux.
Variations on the above can be made using an IR oven (or even a kitchen oven if it reaches 350'c), placing the board complete with solder and components into the oven, watching and waiting
until the solder melts then remove and cool. You may need to make some slight corrections to any part which has bridged or not bonded well.
## Software
## <font style="color: yellow;" size="5">Bill Of Materials</font>
Building the software and final ROM images can be done by cloning the [repository](https://github.com/pdsmart/MZ80A_RFS.git) and running some of the shell scripts and binaries provided.
The cost to make a Rom Disk v2.1 can be seen in the table below. This excludes consumables such as solder paste and flux. Please scroll right to see the full table details.
Source: MZ80-ROMPG\_v2\_1.sch<br>
Component Count: 68<br>
| Ref | Qty | Price (Unit) | Price (10) | Price (100) | Price Ea (5 Off Sum) | Price Ea (10 Off) | Value | Cmp name | Footprint | Description | Vendor | | |
| ----------------------------------------------------------------------------------------------- | -------------------------------------------------- | ------------ | ---------- | ----------- | ----------------- | -------------- | -------------- | -------------------------- | ----------------------------------------------------------------- |
| C2, C1, C3, C4, C6, C5, C12, C8, C9, C7, C15, C18, C10, C22, C20, C19, C11, C21, C13, C14, C16, | 21 | 0.2232 | 0.2232 | 0.1117 | 4.6872 | 2.3457 | 100nF | C\_Small | Capacitor\_SMD:C\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Unpolarized capacitor, small symbol | https://uk.farnell.com/multicomp/mc0805f104m500ct/cap-0-1-f-50v-20-y5v-0805/dp/2627484 |
| C17, | 1 | 0.0641 | 0.0641 | | 0.0641 | 0.0641 | 100pF | C\_Small | Capacitor\_SMD:C\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Unpolarized capacitor, small symbol | https://uk.farnell.com/vishay/tmcma0j107mtrf/cap-100-f-6-3v-20/dp/2491474 |
| C23, | 1 | 0.7116 | 0.7116 | | 0.7116 | 0.7116 | 100uF | CP\_Small | Capacitor\_SMD:C\_1206\_3216Metric\_Pad1.42x1.75mm\_HandSolder | Polarized capacitor, small symbol | https://uk.farnell.com/kemet/c0805c101j1gactu/cap-100pf-100v-5-c0g-np0-0805/dp/1414655 |
| D2, D1, | 2 | 0.358 | 0.213 | | 0.716 | 0.426 | 1N5817 | 1N5817 | Diode\_SMD:D\_SOD-123 | 20V 1A Schottky Barrier Rectifier Diode, DO-41 | https://www.mouser.co.uk/ProductDetail/821-B0520LWRHG |
| J1, | 1 | 0.582 | 0.582 | | 0.582 | 0.582 | SD CARD | Conn\_01x06 | Connector\_PinSocket\_2.54mm:PinSocket\_1x06\_P2.54mm\_Horizontal | Generic connector, single row, 01x06, script generated (kicad-library-utils/schlib/autogen/connector/) | https://uk.farnell.com/wurth-elektronik/613006143121/connector-rcpt-6pos-1row-2-54mm/dp/2827951 |
| JP1, | 1 | 0.2652 | 0.22 | | 0.2652 | 0.22 | A15/A14 | Jumper\_NC\_Dual | Connector\_PinHeader\_2.00mm:PinHeader\_1x03\_P2.00mm\_Vertical | Dual jumper, normally closed | https://uk.farnell.com/te-connectivity/2355045-3/connector-header-3pos-1row-2mm/dp/3289742 |
| JP2, | 1 | 0.2652 | 0.22 | | 0.2652 | 0.22 | A15/~WE~ | Jumper\_NC\_Dual | Connector\_PinHeader\_2.00mm:PinHeader\_1x03\_P2.00mm\_Vertical | Dual jumper, normally closed | https://uk.farnell.com/te-connectivity/2355045-3/connector-header-3pos-1row-2mm/dp/3289742 |
| JP3, | 1 | 0.2652 | 0.22 | | 0.2652 | 0.22 | A14/~WE~ | Jumper\_NC\_Dual | Connector\_PinHeader\_2.00mm:PinHeader\_1x03\_P2.00mm\_Vertical | Dual jumper, normally closed | https://uk.farnell.com/te-connectivity/2355045-3/connector-header-3pos-1row-2mm/dp/3289742 |
| Jumper, JP1-3 | 3 | 0.057 | 0.057 | | 0.171 | 0.171 | | | 2 pin jumper | | https://uk.farnell.com/multicomp/mc-2205bg/mini-shunt-jumper-2way-2mm-pbt/dp/2834677 |
| JP4, | 1 | 0 | 0 | | 0 | 0 | ~LTCHRST~ | SolderJumper\_2\_Open | Jumper:SolderJumper-2\_P1.3mm\_Bridged\_Pad1.0x1.5mm | Solder Jumper, 2-pole, open | | | |
| JP6, | 1 | 0 | 0 | | 0 | 0 | MOSI SEL | SolderJumper\_3\_Bridged12 | Jumper:SolderJumper-3\_P1.3mm\_Bridged2Bar12\_Pad1.0x1.5mm | 3-pole Solder Jumper, pins 1+2 closed/bridged | | | |
| JP7, | 1 | 0 | 0 | | 0 | 0 | UD1 | SolderJumper\_2\_Bridged | Jumper:SolderJumper-2\_P1.3mm\_Bridged\_Pad1.0x1.5mm | Solder Jumper, 2-pole, closed/bridged | | | |
| JP8, | 1 | 0 | 0 | | 0 | 0 | UD2 | SolderJumper\_2\_Bridged | Jumper:SolderJumper-2\_P1.3mm\_Bridged\_Pad1.0x1.5mm | Solder Jumper, 2-pole, closed/bridged | | | |
| JP9, | 1 | 0 | 0 | | 0 | 0 | UD3 | SolderJumper\_2\_Bridged | Jumper:SolderJumper-2\_P1.3mm\_Bridged\_Pad1.0x1.5mm | Solder Jumper, 2-pole, closed/bridged | | | |
| LG1, | 1 | 0 | 0 | | 0 | 0 | Argo Logo | MountingHole | Graphic:Argo | Mounting Hole without connection | | | |
| R3, R2, R1, | 3 | 0.122 | 0.045 | | 0.366 | 0.135 | 560R | R\_Small\_US | Resistor\_SMD:R\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Resistor, small US symbol | https://www.mouser.co.uk/ProductDetail/71-CRCW0805560RFKEAC |
| R4, | 1 | 0.0106 | 0.0106 | | 0.0106 | 0.0106 | 220R | R\_Small\_US | Resistor\_SMD:R\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Resistor, small US symbol | https://uk.farnell.com/walsin/wr08x2200ftl/res-220r-1-150v-0805-thick-film/dp/2502698 |
| R5, R10, | 2 | 0.077 | 0.017 | | 0.154 | 0.034 | 1K8 | R\_Small\_US | Resistor\_SMD:R\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Resistor, small US symbol | https://www.mouser.co.uk/ProductDetail/652-CR0805JW-182ELF |
| R8, R7, R6, | 3 | 0.077 | 0.018 | | 0.231 | 0.054 | 1K2 | R\_Small\_US | Resistor\_SMD:R\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Resistor, small US symbol | https://www.mouser.co.uk/ProductDetail/652-CR0805FX-1151ELF |
| R9, | 1 | 0.077 | 0.045 | | 0.077 | 0.045 | 10K | R\_Small\_US | Resistor\_SMD:R\_0805\_2012Metric\_Pad1.15x1.40mm\_HandSolder | Resistor, small US symbol | https://www.mouser.co.uk/ProductDetail/71-CRCW080510K0FKEAC |
| U2, | 2 | 2.22 | 1.87 | | 4.44 | 3.74 | (Monitor ROM) | 2732\_Socket | Package\_DIP:DIP-24\_W15.24mm\_Socket | REPROM 4 Ko | https://uk.rs-online.com/web/p/pcb-sockets/1981590/?relevancy-data=7365617263685F636173636164655F6F726465723D31267365617263685F696E746572666163655F6E616D653D4931384E53656172636847656E65726963267365617263685F6C616E67756167655F757365643D656E267365617263685F6D617463685F6D6F64653D6D61746368616C6C7061727469616C267365617263685F7061747465726E5F6D6174636865643D5E5B5C707B4C7D5C707B4E647D2D2C2F255C2E5D2B24267365617263685F7061747465726E5F6F726465723D313333267365617263685F73745F6E6F726D616C697365643D59267365617263685F726573706F6E73655F616374696F6E3D267365617263685F747970653D4B4559574F52445F53494E474C455F414C5048415F4E554D45524943267365617263685F7370656C6C5F636F72726563745F6170706C6965643D59267365617263685F77696C645F63617264696E675F6D6F64653D4E4F4E45267365617263685F6B6579776F72643D5353512D3131322D30332D472D53267365617263685F6B6579776F72645F6170703D5353512D3131322D30332D472D53267365617263685F636F6E6669673D3026&searchHistory=%7B%22enabled%22%3Atrue%7D |
| U3, | 2 | 2.22 | 1.87 | | 4.44 | 3.74 | (User ROM) | 2716\_Socket | Package\_DIP:DIP-24\_W15.24mm\_Socket | REPROM 2KO | https://uk.rs-online.com/web/p/pcb-sockets/1981590/?relevancy-data=7365617263685F636173636164655F6F726465723D31267365617263685F696E746572666163655F6E616D653D4931384E53656172636847656E65726963267365617263685F6C616E67756167655F757365643D656E267365617263685F6D617463685F6D6F64653D6D61746368616C6C7061727469616C267365617263685F7061747465726E5F6D6174636865643D5E5B5C707B4C7D5C707B4E647D2D2C2F255C2E5D2B24267365617263685F7061747465726E5F6F726465723D313333267365617263685F73745F6E6F726D616C697365643D59267365617263685F726573706F6E73655F616374696F6E3D267365617263685F747970653D4B4559574F52445F53494E474C455F414C5048415F4E554D45524943267365617263685F7370656C6C5F636F72726563745F6170706C6965643D59267365617263685F77696C645F63617264696E675F6D6F64653D4E4F4E45267365617263685F6B6579776F72643D5353512D3131322D30332D472D53267365617263685F6B6579776F72645F6170703D5353512D3131322D30332D472D53267365617263685F636F6E6669673D3026&searchHistory=%7B%22enabled%22%3Atrue%7D |
| U2/U3 Straight Pin Header | 4 | 1.504 | 1.504 | | 6.016 | 6.016 | | | | | https://uk.rs-online.com/web/p/pcb-headers/6742309/?relevancy-data=7365617263685F636173636164655F6F726465723D31267365617263685F696E746572666163655F6E616D653D4931384E525353746F636B4E756D626572267365617263685F6C616E67756167655F757365643D656E267365617263685F6D617463685F6D6F64653D6D61746368616C6C267365617263685F7061747465726E5F6D6174636865643D5E2828282872737C5253295B205D3F293F285C647B337D5B5C2D5C735D3F5C647B332C347D5B705061415D3F29297C283235285C647B387D7C5C647B317D5C2D5C647B377D29292924267365617263685F7061747465726E5F6F726465723D31267365617263685F73745F6E6F726D616C697365643D59267365617263685F726573706F6E73655F616374696F6E3D267365617263685F747970653D52535F53544F434B5F4E554D424552267365617263685F77696C645F63617264696E675F6D6F64653D4E4F4E45267365617263685F6B6579776F72643D3637342D32333039267365617263685F6B6579776F72645F6170703D36373432333039267365617263685F636F6E6669673D3026&searchHistory=%7B%22enabled%22%3Atrue%7D |
| U1,U4,U5,U6 32pin Turned Pin Socket | 4 | 0.774 | 0.774 | | 3.096 | 3.096 | | | | | https://uk.rs-online.com/web/p/dil-sockets/1974081/?relevancy-data=7365617263685F636173636164655F6F726465723D31267365617263685F696E746572666163655F6E616D653D4931384E525353746F636B4E756D626572267365617263685F6C616E67756167655F757365643D656E267365617263685F6D617463685F6D6F64653D6D61746368616C6C267365617263685F7061747465726E5F6D6174636865643D5E2828282872737C5253295B205D3F293F285C647B337D5B5C2D5C735D3F5C647B332C347D5B705061415D3F29297C283235285C647B387D7C5C647B317D5C2D5C647B377D29292924267365617263685F7061747465726E5F6F726465723D31267365617263685F73745F6E6F726D616C697365643D59267365617263685F726573706F6E73655F616374696F6E3D267365617263685F747970653D52535F53544F434B5F4E554D424552267365617263685F77696C645F63617264696E675F6D6F64653D4E4F4E45267365617263685F6B6579776F72643D3139372D34303831267365617263685F6B6579776F72645F6170703D31393734303831267365617263685F636F6E6669673D3026&searchHistory=%7B%22enabled%22%3Atrue%7D |
| U5, U4, U1, | 2 | 1.4 | 1.34 | | 2.8 | 2.68 | SST39SF040 | SST39SF040-Memory\_Flash | Package\_DIP:DIP-32\_W15.24mm\_Socket | | https://www.mouser.co.uk/ProductDetail/804-39SF0407CPHE |
| U6, | 1 | 4.04 | 3.52 | | 4.04 | 3.52 | AS6C4008-55PCN | AS6C4008-55PCN-Memory\_RAM | Package\_DIP:DIP-32\_W15.24mm\_Socket | | https://uk.rs-online.com/web/p/sram/7444561/?cm_mmc=UK-PPC-DS3A-_-google-_-DSA_UK_EN_Semiconductors_Index-_-SRAM%7C+Products-_-DYNAMIC+SEARCH+ADS&matchtype=b&aud-826607888587:dsa-1212641595354&s_kwcid=AL!7457!3!504893415565!b!!g!!&gclid=Cj0KCQjw4cOEBhDMARIsAA3XDRh4TCTF_wYFuxNMcgRPi_SnsWjU6rH-V_O0fBiKy5KjJ19J3uHoBHIaAuSTEALw_wcB&gclsrc=aw.ds | | |
| U7, | 1 | 0.374 | 0.286 | | 0.374 | 0.286 | 74HCT30 | 74LS30 | Package\_SO:SOIC-14\_3.9x8.7mm\_P1.27mm | 8-input NAND | https://www.mouser.co.uk/ProductDetail/771-HCT30D653 |
| U8, U16, | 2 | 0.343 | 0.257 | | 0.686 | 0.514 | 74HCT32 | 74LS32 | Package\_SO:SOIC-14\_3.9x8.7mm\_P1.27mm | Quad 2-input OR | https://www.mouser.co.uk/ProductDetail/771-74HCT32D-T |
| U9, | 1 | 0.58 | 0.479 | | 0.58 | 0.479 | 74LS04 | 74LS04 | Package\_SO:SOIC-14\_3.9x8.7mm\_P1.27mm | Hex Inverter | https://www.mouser.co.uk/ProductDetail/595-SN74LS04DR |
| U10, | 1 | 0.328 | 0.274 | | 0.328 | 0.274 | 74HCT139 | 74LS139 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | Dual Decoder 1 of 4, Active low outputs | https://www.mouser.co.uk/ProductDetail/771-74HCT139D-Q100J |
| U11, | 1 | 0.252 | 0.207 | | 0.252 | 0.207 | 74HCT125 | 74LS125 | Package\_SO:SOIC-14\_3.9x8.7mm\_P1.27mm | Quad buffer 3-State outputs | https://www.mouser.co.uk/ProductDetail/771-74HCT125D-T |
| U12, U14, U13, | 3 | 0.374 | 0.319 | | 1.122 | 0.957 | 74HCT273 | 74HCT273 | Package\_SO:SOIC-20W\_7.5x12.8mm\_P1.27mm | 8-bit D Flip-Flop, reset | https://www.mouser.co.uk/ProductDetail/771-74HCT273D-T |
| U15, U18, | 2 | 0.343 | 0.257 | | 0.686 | 0.514 | 74HCT00 | 74LS00 | Package\_SO:SOIC-14\_3.9x8.7mm\_P1.27mm | quad 2-input NAND gate | https://www.mouser.co.uk/ProductDetail/771-74HCT00D-T |
| U17, | 1 | 0.282 | 0.232 | | 0.282 | 0.232 | 74HCT138 | 74LS138 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | Decoder 3 to 8 active low outputs | https://www.mouser.co.uk/ProductDetail/Nexperia/74HCT138D653?qs=P62ublwmbi8MKahyK7iY6g%3D%3D |
| U19, | 1 | 0.694 | 0.572 | | 0.694 | 0.572 | 74HCT191 | 74LS191 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | 4-bit Synchronous Up/Down binary Counter | https://www.mouser.co.uk/ProductDetail/595-CD74HCT191M |
| U20, | 1 | 0.343 | 0.281 | | 0.343 | 0.281 | 74HCT595 | 74LS595 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | 8-bit serial in/out Shift Register 3-State Outputs | https://www.mouser.co.uk/ProductDetail/771-74HCT595DQ100118 |
| U21, | 1 | 0.411 | 0.361 | | 0.411 | 0.361 | 74HCT163 | 74LS163 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | Synchronous 4-bit programmable binary Counter | https://www.mouser.co.uk/ProductDetail/771-HCT163D653 |
| U22, | 1 | 0.442 | 0.376 | | 0.442 | 0.376 | 74HCT165 | 74LS165 | Package\_SO:SOIC-16\_3.9x9.9mm\_P1.27mm | Shift Register 8-bit, parallel load | https://www.mouser.co.uk/ProductDetail/771-74HCT165D-T |
| Y1, | 1 | 0.442 | 0.418 | | 0.442 | 0.418 | 16MHz | Crystal\_Small | Crystal:Crystal\_SMD\_Abracon\_ABM3-2Pin\_5.0x3.2mm | Two pin crystal, small symbol | https://www.mouser.co.uk/ProductDetail/815-ABM3-16-B2-T |
| SD Card Adaptor | 1 | 2.77 | 2.6 | | 2.77 | 2.6 | | | | | https://www.ebay.co.uk/itm/233362415633?hash=item36557be011:g:-xwAAOSwXk1dmxM7 |
| PCB - PCBWay | 1 | 3.7635 | 3.7635 | | 3.7635 | 3.7635 | | | | | | | |
| | | | | | | | | | | | | | |
| Sub Total | | | | | 46.5736 | 39.8655 | | | | | | | |
| P&P | | | | | 5 | 5 | | | | | | | |
| VAT @ 20% | | | | | 10.315 | 8.9731 | | | | | | | |
| Total (GBP) | | | | | 61.89 | 53.84 | | | | | | | |
<div style="text-align: justify">
The price for one off is not really representative as some components have to be bought in multiples of 10/50/100, ie. the PCB alone cost USD80 (inc taxes) for 10 and the extra cost of buying multiples amortized over the number of boards built.
</div>
The RFS is built as follows:
1. Make the RFS binary using \<tools\>/assemble_rfs.sh, this creates \<roms\>/rfs.rom for the User Bank Flash RAM and \<roms\>/rfs_mrom.rom for the Monitor Bank Flash RAM.
2. Make the original MZ80A monitor roms using \<tools\>/assemble_roms.sh, this creates \<roms\>/monitor_SA1510.rom and \<roms\>/monitor_80c_SA1510.rom for the Monitor Bank Flash RAM.
3. Make the rom images using \<tools\>/make_roms.sh, this creates \<roms\>/USER_ROM_256.bin for the User Bank Flash RAM and \<roms\>/MROM_256.bin for the Monitor Bank Flash RAM.
The rom images also contain a packed set of MZF applications found in the \<MZF\> directory. Edit the script \<tools\>/make_roms.sh to add or remove applications from the rom images.
The above procedure has been encoded in a set of shell scripts and C tools, which at the simplest level, is to run these commands:
````bash
cd <software>
tools/assemble_cpm.sh
tools/assemble_rfs.sh
tools/assemble_roms.sh
tools/make_cpmdisks.sh
tools/make_roms.sh
tools/make_sdcard.sh
````
The output of the above commands are ROM images \<roms\>/MROM_256.bin and \<roms\>/USER_ROM.256.bin which must be flashed into 512Kbyte Flash RAMS and inserted into the sockets on the
RFS adapter.
The applications which can be stored in the Flash RAMS are located in the \<MZF\> directory. In order to use them within the Flash RAM's, the applications need to be converted into sector rounded binary images and stored in the
\<MZB\> directory. The tool \<tool\>/processMZFiles.sh has been created for this purpose. Simply copy any MZF application into the \<MZF\> directory and run this tool:
````bash
cd <software>
tools/processMZFfiles.sh
````
The files will be converted and stored in the \<MZB\> directory and then used by the \<tools\>/make_roms.sh script when creating the ROM images. The \<tools\>/make_roms.sh script lists all the applications to be added into the
Flash RAM's and it will pack as many as space permits. To ensure your application appears in the Flash RAM, add it to the top of the list (just the filename not the .MZF extension), ie:
````bash
Edit the file <tools>/make_roms.sh
Locate the line: ROM_INCLUDE=
Below this line, add your application in the format: ROM_INCLUDE+="${MZBPATH}/<YOUR APPLICATION>.${SECTORSIZE}.bin"
ie. ROM_INCLUDE+="${MZB_PATH}/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
Save the file and run the commands above to build the MonitorROM and USERROM's.
````
The SD Card image is created by the \<tools\>/make_sdcard.sh script and in its basic form creates an image which can be directly copied onto an SD Card. This image contains the SD Card Filing System which is populated with
MZF applications from the \<MZF\> directory. Edit the \<tools\>/make_sdcard.sh script to add/remove MZF applications which are installed into the SDCFS. CP/M images are also added to the SD Card and this is covered in the
[CP/M](sharpmz-upgrades-cpm/) section.
## SD Card
A recent addition to the Rom Filing System is an SD Card. In hardware it is implemented using the bitbang technique and provides performance comparable with a floppy disk without the seek overhead or interleave
times, but in all honesty, this would be better catered for by dedicated shift registers in order to gain performance on par with the ROM drives.
I worked on using the [Petit FatFS by El CHaN](http://elm-chan.org/fsw/ff/00index_p.html) for the SD Card filing system, which is excellent having previously used the full Fat version with my ZPU project, but the Z80 isnt the best
architecture for code size when using C. In the repository in \<src\>/tools is my developments along this line with a C program called 'sdtest' and a modularized PetitFS along with manually coded Z80 assembler to handle the bitbang
algorithm and SD Card initialisation and communications. The program compiles into an MZF application and when run performs flawlessly. The only issue as mentioned is size and when your limited to 2K and 4K banked roms with a 12K
filing system you have an immediate storage issue. It is feasible to build PetitFS into a set of ROM banks using the z88dk C Compiler which supports banked targets and __far constructs but it would be a lot of effort for something
which really isnt required.
I thus took a step back and decided to create my own simple filing system which is described below. This filing system is used for Sharp MZ80A MZF applications and is for both read and write operations.
### SD Card Filing System
The SD Card Filing System resides at the beginning of the SD Card and is followed by several CPM disk drive images. The SDCFS image is constructed of a directory plus 256 file blocks. The directory can contain upto 256 entries,
each entry being 32 bytes long. The SDCFS directory entry is based on the MZF Header format and is as follows:
| 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 |
| Parameter | Description |
| ------------- | --------------------------------------------------------------------------------------------- |
| FLAG1 | BIT 7 = 1, Valid directory entry, 0 = inactive. |
| FLAG2 | MZF Execution Code, 0x01 = Binary |
| FILENAME | Standard MZF format filename. |
| START SECTOR | Sector in the SD card where the program starts. It always starts at position 0 of the sector. |
| SIZE | Size in bytes of the program. Each file block occupies 64Kbyte space (as per a tape) and this parameter provides the actual space occupied by the program at the current time. |
| LOAD ADDR | Start address in memory where data should be loaded. |
| EXEC ADDR | If a binary then this parameter specifies the location to auto execute once loaded. |
| RESERVED | Not used at the moment. |
Each file block, 1 per directory entry, is 64K long which is intentional as it keeps a fixed size which is in line
with the maximum tape (CMT) length and can be freely read/written to just as if it were a tape. This allows for easy
use within tape based applications such as Basic SA-1510 or for copying SD Card \<-\> CMT.
The remainder of the SD Card is filled with 16MByte CPM Disk drive images. Each image is organised as 32 (512byte) Sectors x 1024 tracks
and 1 head. Each image will be mounted in CPM under its own drive letter.
Visually, the SD Card is organised as follows:
```
SECTOR FUNCTION
00000000 ---------------------------------------------------------------------------
| ROM FILING SYSTEM IMAGE |
| |
00000000 | RFS DIRECTORY ENTRY 000 (32BYTE) |
| .. |
| .. |
00001FE0 | RFS DIRECTORY ENTRY 255 (32BYTE) |
00002000 ---------------------------------------------------------------------------
| RFS FILE BLOCK 0 |
00003000 ---------------------------------------------------------------------------
...
00FF0000 ---------------------------------------------------------------------------
| RFS FILE BLOCK 255 |
01000000 ---------------------------------------------------------------------------
01000000 ---------------------------------------------------------------------------
| |
| CP/M DISK IMAGE 0 |
| |
02000000 ---------------------------------------------------------------------------
| |
| CP/M DISK IMAGE 1 |
| |
03000000 ---------------------------------------------------------------------------
| |
| CP/M DISK IMAGE 2 |
| |
XX000000 ---------------------------------------------------------------------------
| |
| CP/M DISK IMAGE <n> |
| |
---------------------------------------------------------------------------
```
#### To Do
1) Update Basic SA-5510 so that it loads/saves from SD Card.<br/>
## Credits
## <font style="color: yellow;" size="6">Credits</font>
<div style="text-align: justify">
Where I have used or based any component on a 3rd parties design I have included the original authors copyright notice within the headers or given due credit. All 3rd party software, to my knowledge and research, is open source and freely useable, if there is found to be any component with licensing restrictions, it will be removed from this repository and a suitable link/config provided.
</div>
## Licenses
## <font style="color: yellow;" size="6">Licenses</font>
<div style="text-align: justify">
This design, hardware and software, is licensed under the GNU Public Licence v3.
</div>
### The Gnu Public License v3
### <font style="color: yellow;" size="5">The Gnu Public License v3</font>
<div style="text-align: justify">
The source and binary files in this project marked as GPL v3 are 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.
<br><br>
The source files are 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.
<br><br>
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
</div>