Usage

This section covers day to day usage of REMEMOrizer, and covers common hints and tips.

Power-on

Upon power on, the FPGA on the GODIL on the REMEMOrizer takes two seconds to initialise, and in that time, the MTX will not see any of the ROM images it provides. As a result, the MTX will almost certainly not boot CP/M. Two red LEDs are lit during initialisation, and when complete, then they turn off and a green LED lights instead. Just press the Reset keys after this has happened, and the MTX should see the ROMs and boot fine.

Reset

Pressing SW1 makes the CP/M boot ROM vanish from the memory map. So if you do this whilst resetting, the MTX will boot directly to MTX BASIC, not to CP/M. SW1 is the button on the GODIL marked "No CP/M" on the Setup page.

The same effect can be acheived with REMEMOrizer r2 by pressing both Shift keys during resetting.

RAM Disc

The sample SD Card contains a script which sets up the RAM Disc the first time. To use :-

A>SUB RAMDISC

After running it, reset to boot from RAM Disc.

SD Card

Each SD Card can have upto 8 8MB partitions. Each of these would contain a CP/M 2.2 filesystem.

A green LED lights up when REMEMOrizer is reading or writing the SD Card. Then it flickers and turns off. Wait for it to turn off before removing or changing the SD Card.

Accessing SD Cards from CP/M

You'll need to use RECONFIG.COM to configure a drive (or drives) to access partitions on the SD Card. Type codes 18..1F correspond to 8MB partitions 0 to 7 on the card. eg: To access partitions 0, 1 and 2 :-

A>RECONFIG B:18,C:19,D:1A

Accessing SD Cards from MTX BASIC

You can switch to MTX BASIC, and use ROM 5 to gain access to disk via USER commands.

A>MTXL
ROM 5
USER DIR
USER RUN "TOADO.RUN"

Accessing SD Cards on Linux

On my Linux, my SD Card appears as /dev/sde (although this may be different for you), and so I can work directly with that, or I can use dd to copy between the device and a file containing a specific partition, or all 8 partitions.

To read all 8 partitions, or a specific partition, from the SD Card to file(s) :-

$ dd if=/dev/sde of=partitions.dat bs=8M        count=8
$ dd if=/dev/sde of=partition3.dat bs=8M skip=3 count=1

To copy back all 8 partitions, or just a specific partition, from file(s) back to the SD Card :-

$ dd if=partitions.dat of=/dev/sde bs=8M        count=8
$ dd if=partition3.dat of=/dev/sde bs=8M seek=3 count=1

You can use cpmtools (delivered or packaged for most modern Linux distros) to manipulate a partition on the SD Card directly, or a present in a file.

You need a cpmtools diskdefs file which includes definitions of the Memotech CP/M filesystem types. This is included and needs to be in the current directory, or in /usr/share/cpmtools/diskdefs.

This file has definitions for memotech-type18, memotech-type19 and similar formats. These are identical, except they have different starting offsets. So if you are working with a device with all 8 partitions or a file with all 8 partitions, you simply pick the right format to address the desired partition. But if you're working with a file containing just a single partition, you always use memotech-type18, as it has an offset of 0.

Some examples :-

$ cpmls -f memotech-type18 /dev/sde
$ cpmcp -f memotech-type18 /dev/sde 0:readme.txt /tmp
$ cpmcp -f memotech-type19 /dev/sde /tmp/readme.txt 0:

The 0: notation reflects the CP/M user number.

Alternatively, you can use cpmfuse, which is based on cpmtools and also uses the same diskdefs file.

With cpmfuse you can mount a partition from the SD Card or a file, and directly manipulate it using normal Linux commands :-

$ mkdir mnt
$ cpmfuse mnt -f memotech-type18 -i /dev/sde -v
$ ls mnt/*.TXT
mnt/README.TXT
$ fusermount -u mnt

Accessing SD Cards on Windows

If you must use Windows, then these ports of dd and cpmtools are useful. I put dd.exe in a directory on the PATH, and I unzip cpmtools so that it ends up in the C:\cpmtools directory.

The following command adds cpmtools to your PATH :-

C:\ak\tmp>\cpmtools\cpmtools

The diskdefs supplied with it doesn't understand Memotech disk formats. So save it away, and replace with the file supplied :-

C:\ak\tmp>copy \cpmtools\diskdefs \cpmtools\diskdefs.saved
    1 file(s) copied.

C:\ak\tmp>copy diskdefs \cpmtools\diskdefs
Overwrite \cpmtools\diskdefs? (Yes/No/All): Y
    1 file(s) copied.

Warning: Don't be tempted to edit the diskdefs file. The Windows version of the cpmtools package expects each line to end with just a line-feed character (as in UNIX), and most Windows text editors will terminate each line with carriage-return and line-feed (as in DOS and Windows). As a result, cpmtools will complain it doesn't recognise disk formats, even though they are in the diskdefs file. This is probably an unintentional consequence of how the code was built on Windows.

The first thing to do is to determine which block device is your SD Card. You don't want to accidentally write to your hard disk. Insert the SD Card and type :-

C:\ak\tmp>dd --filter=removable --list
rawwrite dd for windows version 0.5.
Written by John Newbigin <jn@it.swin.edu.au>
This program is covered by the GPL.  See copying.txt for details

NT Block Device Objects
\\?\Device\Harddisk2\Partition0
link to \\?\Device\Harddisk2\DR7
\\?\Device\Harddisk3\Partition0
link to \\?\Device\Harddisk3\DR8
\\?\Device\Harddisk4\Partition0
link to \\?\Device\Harddisk4\DR13
Removable media other than floppy. Block size = 512
size is 1015808000 bytes

The --filter=removable ensures the list returned only includes removable devices. You're looking for the one around the right size. In this case, as I'm using a 1GB SD Card, its clearly \\?\Device\Harddisk4\Partition0.

As with Linux, you can use dd to copy all 8 partitions, or a single partition, between the SD Card and file(s). Same syntax as above, except the device name is a Windows style name. However, when copying back, I strongly recommend you use the --filter=removable command line option, which double checks that you are targetting a removable device (ie: hopefully your SD Card, rather than your hard disk).

As with Linux, you can use cpmtools command line programs to list partition contents and copy files in or out. I have not been able to get the Windows build of cpmtools to work with windows block devices.

Alternatively, you can use cpmcbfs, which is based on cpmtools and also uses the same diskdefs file.

With cpmcbfs you can map a drive letter to an image of a CP/M filesystem, and directly manipulate it using normal Windows commands. Assuming you've already installed it :-

c:\cpmcbfs>cpmcbfs -f memotech-type18 -i sddisc.bin -v
Drive Z: should exist until you press Enter

In another Window :-

c:\>dir z:

If you run as Administrator, you can also enumerate block devices and map drive letters to them.

If the dd program doesn't work for you (it doesn't work on my Windows 10 system), you can consider using RAWIO instead.

Loading virtual tapes

Prior to switching to MTX BASIC, you can use REZTAPE to prime virtual cassette tapes with the contents of .MTX files. From CP/M :-

A>REZTAPE QUAZZIA.MTX 0
A>REZTAPE SNAPPO.MTX 1
A>MTXL

Then the usual MTX BASIC LOAD command can be used to load it :-

LOAD "QUAZZIA"

Running REZTAPE with no arguments lists bytes 1-15 of the virtual cassette in each slot, which is handy, as these are the names you will need to LOAD from MTX BASIC. These names do not necessarily agree with the names of the .MTX files they were loaded from.

If you are interested in real cassette tapes, then the Tape support section of the Software page describes a handy mechanism to toggle between virtual and real tape modes.

Virtual tapes can be used to hold ZX Spectrum .TAP tapes and used with REZSPEC too :-

A>RECONFIG C:19
A>REZTAPE C:GRIDRUN.TAP 0
A>REZSPEC
LOAD ""

They can also hold ZX Spectrum .SNA snapshot files :-

A>REZTAPE C:MANIC.SNA 0
A>REZSPEC
F8

Remember if you rewind a tape and save to it, or if you snapshot to it, you may wish to reboot and use REZTAPE to save from virtual tape to a CP/M file afterwards. Snapshot and restore operations always auto-rewind, but when using BASIC LOAD and SAVE you may need to remember to do this yourself.