Emulation of the Keyboard, Screen and Beeper

The keyboard. Letter keys are mapped to the Spectrum's letter keys. The ALT and CTRL keys can both be used for Symbol Shift. Then, there are a lot of keys on the PC keyboard which don't exist on the Spectrum keyboard. Many of them are used, to make things easier:

If you're running the emulator on a slow computer, try selecting double interrupt frequency. Most programs poll the keyboard by interrupt, in any case the ROM does, and doubling the frequency with which this happens will make the emulated Spectrum react much more quickly on your keystrokes.

If you've got an AZERTY keyboard, the standard mappings of the keys won't work at all properly. Include the switch -xz in your Z80.INI file in this case; many punctuation keys will now also work properly. There is no support for other non-US keyboard layouts; sorry!

Now about the screen emulation. Fifty times an (emulated) second, the screen is checked for changes. If anything has changed, the change is displayed on the PC screen. It turned out that this was the fastest method of updating the screen.

I tried to update the screen at about the same time the real Spectrum shows it on the TV screen, relative to the 50 Hz interrupt. There is a problem; the Spectrum takes about 1/100th of a second to generate the whole picture, while I stop the emulator at some point in the 1/50th- of-a-second cycle and display the whole screen at once. Usually this makes little difference, but with some programs it does: characters may flicker heavily or disappear entirely (see for instance BC's Quest for Tires). By selecting the `video synchronisation mode', you have some control over the exact point of the cycle at which the screen is updated.

In the Hercules, CGA and Plantronics modes, not all colours can be displayed. In the EGA mode, all colours can be displayed, but some colours have the same intensity in bright 1 as in bright 0. In VGA mode, all colours closely resemble the original Spectrum colours, and furthermore in this mode the screen updating is the fastest of all modes.

The border updated every 1/50th of a second, so you cannot see the familiar stripes when saving. However, in real mode the emulator uses the overscan of EGA to display the border, and you can see some stripes there, and in VGA mode the border can be shown full-size. The only drawback of the border emulation in real mode is that there appears some `snow' on the screen at each OUT - I don't know a way around this.

Finally, the sound emulation. The Spectrum beeper is emulated by the PC's internal beeper. Because every 1/50th of a second the screen has to be updated, and this takes a little time even if there are no changes, the sound is a bit harsh. If you select real mode, the emulator won't update the screen anymore and the sound will sound better.

The sound of the Spectrum 128's sound chip is played through the Adlib card; if you haven't got such a card some notes are played through the internal speaker. That sound will be turned off, however, as soon as the program makes a sound through the normal speaker of the Spectrum. Some Spectrum 128 programs use the sound chip and the beeper at the same time, and this won't work properly without an Adlib card.