Starting the emulator

The emulator will work on any PC with at least 512K memory, with a VGA, EGA, Hercules, CGA or Plantronics video adapter. If available, it will also use EMS memory, an Adlib compatible soundcard, and an analogue or digital joystick.

The emulator will first read in the switches that are given in the Z80.INI file. You can enter switches there in the same way you would on the command line. Lines starting with a % sign will be ignored.

After any switches, you may specify a snapshot file on the command line. This file will then be loaded and executed directly. The extension .Z80 is not necessary. The emulator will also read .SNA files (the snapshot format of, amongst others, Arnt Gulbrandsen's JPP); you don't have to convert them to .Z80 files (but you may want to to save disk space).

The emulator tries to figure out what hardware is available, and uses things as it finds it. Most of the time this will work without you having to tell it anything, but if you have to you can override the defaults by putting switches on the command line. Switches that you use often can be put in the Z80.INI file. If you give a switch a second time, for instance if it is also in the Z80.INI file, it will disable it again.

If you are using Hercules, try starting the emulator with -xh on the command line. The emulator will use a non-standard Hercules mode to display a full-screen Spectrum picture. You may need to calibrate your monitor to make the image steady.

If you're using Plantronics, try -p and -q to see which gives the best result.

Some black-and-white VGA monitors only display one of the three RGB colours (green most of the times), resulting in several Spectrum colours becoming indistinguishable. Use -xb to use grey tones instead of colours.

If you're using a Trident VGA with version 3 BIOS, you may see the picture compressed at the top of the screen, while the bottom half contains vertical white lines. This is due to a bug in the Trident VGA Bios. Start the emulator with the switch -xv to get a full picture.

If you haven't got EMS memory, the page swapping of the Spectrum 128 cannot be emulated exactly. Most programs will work - although quite slowly because page swapping will take much time without EMS - but some may crash. On 386 and 486 machines you can emulate EMS by software, using EMM386 for instance. Of all the EMS emulators I've tried (that's three or four) QEMM was by far the fastest, but the EMM386 supplied with the new DOS 6 seems to be about as fast. A slow EMS emulator can degrade the performance of the '128 emulation significantly! Some computers have hardware EMS capabilities, some '286 boards for instance. Refer to your own documentation for details.

And don't use hard disk based EMS emulators: the Spectrum emulator will drive your hard disk nuts!

There are a few Spectrum programs that have an odd stack pointer, and run over the ram/rom boundary, for instance Deep Strike. This crashed version 1.45 of the emulator. The bug has been removed in version 2: if the emulator tries to read a word at FFFF, the processor generates an INT 0D interrupt and the emulator will handle it correctly. However, this won't work when an EMS emulator is installed that puts the 386 or 486 processor in virtual 8086 mode. You can test all this by typing
 CLEAR 65535:POKE 65535,0: RETURN
in Basic, and the emulator will lock up if it runs in virtual mode. There is no simple solution to this problem, but luckily it doesn't happen often. If it does, the easiest way to to solve it is to change the Spectrum program so that it uses an even SP — this is always possible, but not always easy!

A very few programs (the only examples known to me are Fireman and Thing) are quite sensitive to the relative actual execution speed of emulated Z80 instructions, and crash if it isn't exactly right. If you slow down the emulator, these program will run fine, because then individual instructions are more carefully timed.

The Spectrum 128 has a built-in sound chip. If you have an Adlib compatible soundcard installed, the Spectrum 128 sound will be played through the Adlib card. If you haven't, the loudest of the three sound channels will be played through the internal PC speaker. Sometimes the effect is quite nice, sometimes it is horrible, but it's all I can do on a standard PC. If you don't want to have the Spectrum 128 sound played through the internal speaker, use the switch -xi. If you don't want the Adlib card to be used (for instance to hear the sound through the internal speaker) use -xa.

If you're using the Pro-Audio Spectrum 16 sound card, do not install the resident FM.EXE program; it causes problems with the emulator. Do make sure that MVSOUND.SYS is installed in your CONFIG.SYS file, to make the Pro-Audio Spectrum 16 Adlib compatible.

The noise channels of the Spectrum 128 sound chip can work on different frequencies, whereas the FM chips of the Adlib card cannot. However, if your Soundblaster is equipped with CMS chips, the noise frequency can be programmed. Specify -xc to use the CMS chips. (These chips are not available on Soundblaster Pro cards, and neither on most Soundblaster clones).

If you're living in Belgium or France, you are probably using an AZERTY keyboard. Specifying -xz on the command line will make all letter keys and many punctuation keys work in the right way.

If the emulator erroneously detects an analogue or digital joystick, use the switch -kk.

It may be annoying to have to press Num-Lock every time you use the Spectrum 128 (because otherwise you'll have to use Shift with the cursor keys to move the menu bar). To make the emulator press shift by default every time you use the PC cursor keys in '128 mode, use the switch -xs. If you press Num-Lock now (in '128 mode), the shift-key won't be pressed. The 48K modes are not affected by this switch.

The emulator can now also be run under Windows 3.1! However, you cannot use the tape interface, Real mode doesn't work anymore, and the keyboard is not emulated as well as usual, because I have to scan it using BIOS calls. Be sure not to set the keyboard repeat rate too low; an initial delay of 250 ms followed by 10 keys a second will do, but don't make it slower. Some key combinations may not work, such as ALT 4 for $. So if you want to use the emulator seriously then you shouldn't run it under Windows, but it's nice to see three Spectrums run simultaneously...If you let the emulator run full-screen you may use EGA or VGA, if you want to run it windowed you'll probably have to use CGA, because the virtual video display driver of Windows cannot handle the VGA mode I use (although it's only a standard text mode!). You'll probably want other default settings of some parameters (such as the video mode) if you run the emulator under Windows; the emulator will always use the .INI file in the directory of the Z80.EXE file so the other switches must be put on the command line, in a .PIF file. An example .PIF file (which runs the emulator in windowed CGA mode) is supplied.

Since the execution speed of a program running under Windows heavily depends on other processes, the emulator doesn't try to measure how fast it is running under Windows. It says it runs at 100%, and you can slow it down in the usual way, but the percentage is now relative to the maximum speed, and has nothing to do with the actual execution speed.

The emulator will automatically detect whether Windows is running, and act appropriately. To run the emulator in Windows compatibility mode in a normal DOS environment, use -xw.

When running the emulator under Desqview, use -e for EGA mode display.

To run the emulator with a different rom than the standard one, you can specify a rom image file on the command line. Use the switch -xr file, where `file' is the name of the image file. This file should be exactly 16384 bytes long. It will of course not be used in Spectrum 128 or SamRam mode.

The emulator `ZX' by Rindt and Bruckner comes with several roms, stored in their tape format. You can convert these files to .TAP files, and then load them in the normal way, but to run the emulator with these roms you need the bare 16K binary image file. To extract it from the rom files, type the following at the DOS prompt:

C:\debug rom.000 (or other rom file (of 16406 bytes))
-m 115 L 4000,100 (move the rom down, overwrite header)
-rcx (new length of exactly 16K bytes)
CX 4016  
4000  
-n rom000.bin (or some other name)
-w (write it)
Writing 04000 bytes  
-q (and quit)

Then start the emulator with -xr rom000.bin on the command line to use the rom. It will only affect the normal 48K modes; the SamRam and 128K modes will always use their own roms.

These are the most important switches that you have to specify when you start the emulator. Most of the other switches are used to select default values for various things which can also be changed when the emulator is started. Some useful things to select are default directories for .Z80, .TAP and .MDR files; these will be explained below.