Background
Like the majority of home computers of its
day, the original MTX used
compact cassette tape for offline storage, however, it
was not a viable, nor indeed desirable, option for MTXPlus+.
There are a number of formats that could
have been considered for use as the removable media system,
including
SD
card like
Andy's REMEMORizer, but, given that Lez had included
Compact
Flash readers in the
parts kits that he donated, this was the logical choice.
In addition, Lez had also included a number of
8255 PPI
(Programmable Peripheral Interface) chips in the kit and
there were proven instances of using the PPI with CF
available on the internet.
Media Format
FAT32 is supported by
Operating Systems such as Windows 7, but, as I discovered when
creating test media for MTXPlus+, under some versions
of Windows 7,
media cannot be formatted to FAT32 using the Windows GUI, unless
additional tools are used. However, FAT32 formatting is
supported from the Windows 7 command line as described below:-
Open a windows command prompt with
Administrator privileges, and at the command prompt,
enter : |
format <drive letter>:
/FS:FAT32
|
For a full list of format options,
enter : |
help format, or, format /?
|
File Formats
The majority of Memotech MTX software is already available in a
number of different formats, including tape files (".mtx"), sound files (".wav",
".mp3) etc. Andy has a good
explanation of the various file formats on his site, but in
brief, the files are predominantly available in the following types :-
Type |
Description |
.mtx |
a binary copy of an MTX tape file |
.run |
games for the SDX disk system to be
run from MTX Disc BASIC |
.bas |
games for the FDX or SDX disk systems, to
be run from the associated BASIC program |
.com |
games for the FDX or SDX disk CP/M systems to
be run from CP/M |
It was logical that MTXPlus+
would be able to take advantage of the existing files that
were available. Since the tape I/O interfaces were not going
to be used in MTXPlus+ and CP/M was not going to
be available in the base system, the most appropriate file
formats for implementation in the system were .run
and .mtx. Martin had already written software
to load .run files in
MAGROM,
so this was the first file type used for testing the CF
interface.
MTX ROM Modification
The most convenient way to have MTX BASIC
use the CF interface for file loading and saving was to
modify the existing BASIC tape commands, "LOAD", "SAVE" and
"VERIFY". Martin patched the
existing ROM and added new code in the MTXPlus+
support ROM to control the CF interface from MTX BASIC.
Some compromises had to be made to enable
the CF media to be used from both MTXPlus+ and other CF
hosts such as PCs running Windows.
File Naming Convention
The default filename format under FAT32 is
the same as the original FAT format, i.e., 8.3. FAT32
volumes can also use long filenames that can be fully
utilised under, for example, Windows 7. MTX BASIC allocated
up to 16 characters for tape filenames, we decided that
MTXPlus+ would use the 8.3 naming convention and
throw away the additional 4 characters available to MTX
BASIC.
Subdirectories
MTXPlus+ supports directories on the CF
card, there isn't a hard limit on the number of files that
can be read or written to the root or other directories on
the card from MTXPlus+, but I can't see the value in having
lots of files in a single directory. To make directory
listings easier to read, when the user lists the files in a
directory, they are sorted alphabetically before being
displayed.
The directory sorting code uses a fixed size
(32k) RAM buffer that has been allocated for the CF card,
the size of the buffer allows ~1000 files in a single
directory to be sorted - this should be more than adequate.
However, if the number of files is greater than this, only
the first 1000 or so will be sorted.
To simplify the ROM changes required to
support subdirectories, FAT entries containing only a
filename with no suffix, e.g., "RUN", are deemed to be
subdirectories.
MTX BASIC CF Commands
The MTX ROM has been patched such that the MTX BASIC LOAD
"<filename.ext>" command loads a file from the CF card. Currently supported
file types are .run and .mtx, the file
extension must be
specified so that the ROM knows how to handle the loaded data.
To provide the ability to list the contents of the CF card, the
LOAD "" command has been modified such that it lists the contents of the CF
card, rather than loading the first file found on the media as the standard MTX
would. The default directory listing is a sorted list of the files & directory
names in 8.3 format.
An extended directory listing, showing,
filename, modification date & time and size is available by
using the SAVE "" command.
MTXPlus+ BASIC Compact Flash Commands
Command |
Argument |
Function |
Example |
LOAD |
"" |
Directory listing |
|
SAVE |
"" |
Extended directory listing |
|
|
|
|
|
LOAD |
"filename.mtx" |
Load .mtx File from CF |
LOAD "REVERSI.RUN" |
LOAD |
"filename.run" |
Load .run File from CF |
LOAD ALICEI~1.MTX" |
LOAD |
"dirname" |
Change to "dirname" |
LOAD "MTX" |
|
|
|
|
SAVE |
"dirname" |
Create "dirname" in the current
directory |
SAVE "NEWDIR" |
SAVE |
"filename.mtx" |
Save current program to CF |
SAVE "PROGRAM.MTX" |
|
|
|
|
Status Update
The FAT32 filing stucture was eventually
dropped and MTXPlus+ now uses the CP/M file structure used
in the original Memotech disk drives and in Andy Key's
REMEMOTECH and
REMEMOrizer systems.