Bill Brendling's version of MEMU

Introduction

Andy Key's MEMU is an extremely effective, feature rich, and flexible emulator for the Memotech MTX series of computers, without which none of the following would have been possible. One of the consequences of MEMU's flexability is that running the program requires supplying a number of command line switches to specify the details of the emulation required. A number of potential users find this offputting, this was reiterated at the last Memofest meetup. There are a number of possible solutions to this issue:

When I first started playing with MEMU one of my main objectives was to turn a Raspberry Pi computer into a "Bare Metal" emulation of the MTX. This means no operating system and therefore no command line from which to specify the required switches. Therefore I had to provide a system for setting the configuration from within MEMU. Again I went for the option of providing a few "typical" configurations rather than supporting all of the options that MEMU can provide. I therefore added the option of a configuration dialog as shown:

MEMU Configuration Dialog

While originally developed for the "bare metal" version, the dialg can also be included in Windows or Linux versions of MEMU, which may be of interest for the reasons given above.

My version of MEMU has also acquired a few other features which have not yet been included in Andy's version:

Conversely, my version can be a year (or more) behind the latest features added to Andy's version.

For convenience I have created a number of distributions:

Distributions

Microsoft Windows Runtime

This contains two 32-bit versions of MEMU:

memu.exe
This is the classic command line version of MEMU.
memu-cfg.exe
This is the version of MEMU with configuration dialog.

To install, simply unzip the distribution into a suitable location, perhaps "Program Files (x86)". It may be worth creating a desktop shortcut, pointing to "memu-cfg.exe", with the working folder set to the folder containing the program.

Linux (x86) Runtime

This distribution contains four versions of MEMU. Two are for use with X-Window displays:

memu
This is the classic command line version of MEMU.
memu-cfg
This is the version of MEMU with configuration dialog.

The other two are for use from the console, without X-Window, and display full screen. Use <Ctrl> plus the function keys to switch between VDP display and 80-column display:

memu-fb
This is the command line version of MEMU using full-screen frame buffer.
memu-cfb
This is the configuration dialog version of MEMU using full-screen frame buffer.

To install, unzip the file into s suitable location. Optionally copy the contents of the "memu" folder into a location on the path, such as "/usr/local/bin".

Raspbian Runtime

This distribution contains the same four executables as the Linux distribution, but compiled for 32-bit ARM. It also contains a fifth executable:

memu-pi
This version of MEMU is intended for use from the console, without X-Window. It displays full-screen, using the Raspberry Pi GPU. It can also use the GPIO to interface to real hardware.

Bare Metal Runtime

This distribution contains the bare metal version of MEMU (with configuration dialog), compiled for different versions of the Raspberry Pi. At present the following are NOT supported:

Source Distribution

This distribution contains the source code for all the above versions. There are build scripts in the top level folder for building all versions. The building has to be performed on the appropriate hardware (Windows, x86 Linux or Raspberry Pi) for the distribution being built. Cross-compilation is not currently supported.

To save space, none of the ROMs, disk or tape images are in this distribution, you need at least one runtime distribution. The runtime should be installed in a folder "memu" under the top level folder.

Configuration Dialog Versions

When first started, the configuration dialog versions of MEMU start in whichever emulation mode was last saved in the configuration file. To display the configuration dialog, use one of the following keys:

Different operating systems trap different key strokes for their own use, so try each of these to find one that works. Once in the dialog, use the arrow keys to navigate, and either the space bar or <Ener> key to select an item. To exit the dialog and return to the emulation select one of the options from the bottom line of the dialog. Note that "Exit" is exit the program not exit the dialog.

While the emulation is running, the following key strokes are also processed:

Within the configuration dialog, if "Audio Tapes" is turned off ("No") then only binary (*.mtx) tape files can be selected. In this mode, tape files will load very quickly. If "Audio Tapes" is turned on ("Yes"), then either binary (*.mtx) or audio (*.wav) tape files may be selected. However all files will be slow to load (realistic speed), and you will hear an approximation of the tape loading sounds. Binary files are effectivly converted back to audio in order to load them. Audio files in other formats such as *.mp3 must be converted to *.wav before they can be used.

The supplied disk images are in a number of sizes:

Typical configuration for SDX emulation

The image below shows a typical configuration for SDX emulation, with a tape file ready for loading with the command LOAD "", and a disk of games available for USER LOAD "game". Any user programs can be saved with USER SAVE "name"

SDX Selected, Keyboard: Remapped, Sound: Yes, Audio tapes: No, Overwite tapes: No, Tape file selected, Floppy drive B file selected

Typical configuration for CP/M emulation

A typical configuration for CP/M emulation, with two floppy disks, is shown below.

CP/M Colour Selected, Keyboard: Remapped, Sound: Yes, Files for floppy drives B and C selected

Typical configuration for CFX-II emulation

For the CFX-II it is necessary to open a sub-dialog to select the files to form partitions on the emulated Compact Flash cards. To open this dialog, select the Compact Flash card on the main dialog, and then use <Space> or <Enter> to open the sub-dialog.

CFX-II mode, select Compact Flash card Select partition images for Comact Flash card

Hextrain configuration

Hextrain is Andy Key's incredible MTX game with 3D graphics. To run this, set the configuration as shown and restart. Once CP/M has started type the command "hextrain" (renamed from "htsi"), and then switch to the VDP window or display.

CP/M Colour mode, Huge SiDisks, Do not save SiDisks

Fuzix configuration

Fuzix is a Unix like operating system for Z80 machines. It has been ported to the MTX with CFX-II storage add-on, and can be run in MEMU. To run it, set the configuration as shown:

Restart, then once the CFX-2 startup page is showing, reboot using the two <Alt> keys with the "C" key down, as if rebooting to CP/M. Fuzix will begin to boot. When prompted for "bootdev:", enter "hda1" (without the quotes). Enter the date and time when requested. Finally login as "root". When finished using Fuzix, enter the command "shutdown" to cleanly unmount the emulated drives and halt the system. Otherwise a lengthy check of drive integrity will be required next time Fuzix is started.

Command Line Versions

Most of the command line usage is as per Andy Key's Documentation which is repeated here.

SwitchDescription
-iobyte iobytespecify IOBYTE (initially 0x00)
-subpage subpageset ROM subpage (initially 0)
-addr addrset the address (initially 0x0000)
-mem fileload file at address
-mem-blocks nnumber of 16KB memory blocks (default 4)
-mem-mtx500equivelent to -mem-blocks 2
-n-subpages rom nset number of subpages
-romX fileload ROM X from file
-rompairX fileload ROM X and X+1 from file
-vid-winemulate VDP and TV using a graphical window
-vid-win-big,-vmake window twice as large (realistic size)
-vid-win-hw-paletteuse an alternate palette
-vid-ntscrefresh at 60Hz (instead of 50Hz)
-snd-portaudio,-semulate sound chip using portaudio
-snd-latency valueinstruct portaudio to use a given latency
-mon-winemulate 80 column card using a graphical window
-mon-win-big,-mwmake window twice as high (realistic aspect ratio)
-mon-win-monogreen screen monochrome
-mon-th,-mtemulate 80 column card using full screen text mode
-mon-console,-mcemulate 80 column card using console only
-mon-console-nokeykeyboard status shows no keys pressed
-mon-no-ignore-initdon't ignore writes to non-emulated registers
-kbd-remapremaps MTX keyboard (despite shift state)
-kbd-country nsets the country code switches to n (default 0)
-kbd-type stringauto type keys in this string
-kbd-type-file fnauto type keys in this file
-joy,-jenable joystick support
-joy-buttons stringdefine left,right,up,down and fire buttons
-joy-central npercentage off-centre to press direction
-serial1-in fnserial 1 input from file/pipe
-serial1-out fnserial 1 output to file/pipe
-serial2-in fnserial 2 input from file/pipe
-serial2-out fnserial 2 output to file/pipe
-sdx-tracks nspecify tracks of first drive (default 80)
-sdx-mfloppy filespecify .mfloppy file in SDX first drive
-sdx-tracks2 nspecify tracks of second drive (default 80)
-sdx-mfloppy2 filespecify .mfloppy file in SDX second drive
-sidisc-hugeenable Silicon Disc huge mode
-sidisc-no-savedon't save Silicon Disc content on termination
-sidisc-file n filespecify Silicon Disc content for a drive
-prn-file filespecify file to receive printer output
-tape-dir path.mtx files are in this directory
-tape-overwriteSAVE can overwrite an existing file
-tape-disabledon't patch INOUT to LOAD/SAVE/VERIFY .mtx files
-tap-file fnspecify ZX tape file (default memu.tap)
-sna-file fnspecify ZX snapshot file (default memu.sna)
-cpmemulate CP/M BDOS
-cpm-drive-a pathwhere CP/M BDOS finds A: files (default: .)
-cpm-invert-caseinvert between CP/M and host filenames
-cpm-tail tailconstruct CP/M command tail
-cpm-open-hackdon't insist on EX,S1,S2,RC being 0
-sdxSDX support in ROM 5 (or -sdx3 for ROM 3)
-fdxbFDXB CP/M support
-speed hzset CPU speed (default is 4000000, ie: 4MHz)
-fastdon't limit speed, run as fast as possible
file.com tail ...-cpm -iobyte 0x80 -addr 0x0100 -mem file.com
file.run-iobyte 0x00 -addr 0xAAAA (from header)
file.mtxsubsequent LOAD/SAVE/VERIFY "" will use this file

The additional options for my version are:

SwitchDescription
-vgaemulate Propeller VGA display
-serial1-dev devserial 1 in/out from device
-serial2-dev devserial 2 in/out from device
-cfx2 rom_fileenable CFX-II emulation and specify ROM image file
-cf-image c:p filespecify data image for partition (p) on card (c)
-cassette-inhardware emulation - MTX or WAV file to load
-cassette-outhardware emulation - MTX or WAV file to save
-mon-win-titleset title for 80 column window
-mon-win-displayset display to use for 80 column window
-vid-win-titleset title for VDP window
-vid-win-displayset display to use for VDP window
-helpdisplays list of options and exits

The configuration dialog version also uses the same swiches, storeing them in the configuration file, but they may also be given on the command line. There are a few additional switches listed below to support the operation of the dialog.

SwitchDescription
-config-file fileread configuration options from file
-no-ignore-faultsturn off permissive options enabled by -config-file
-rom-enable rom_bitsbit flags to enable (1) or disable (0) a rom
-no-cfx2 rom_filedisable CFX-II emulation but specify ROM image file
-mon-sizesets 80 col size (but does not enable it)
-disk-dirdirectory containg disk images
-tape-dirdirectory containg tape files

And finally, two further switches specific to the Raspberry Pi specific versions:

SwitchDescription
-hw-config filespecifies the GPIO interface to MEMU, documented here
-gpu-mode modecontrols the use of the GPU for screen upscaling (memu-pi only):
  • mode = 1: Upscaling by ARM processor
  • mode = 2: Upscaling by GPU with interpolation
  • mode = 3: Upscaling by GPU without interpolation (default)