ZX Dream - online emulator ZX Spectrum in JavaScript

ZX Spectrum is an 8-bit home computer developed by British company Sinclair Research in 1982. Thanks to various factors, among of which are implementation simpicity, low cost, the ability to connect to a TV-set and to load programs and games from tape, the computer became widespread in subsequent years, both the original implementation and numerous clones and modifications, which often had additional hardware and software features such as extended emmory, loading programs from diskettes, program sound generator and many others. Thousands of programs and games have been written for ZX Spectrum, and a great library of musical and graphical works has been created, which is still being replenished.

ZX Dream emulates a set of devices of the original ZX Spectrum and its modifications. Thanks to it, you can open numerios programs and execute them right in a browser, using a standard keyboard, mouse, display and speakers. Also, it is possible to load programs from plenty formats of diskette and tape images, as well as snapshots.

Next hardware has been implemented:

Other features:

Control

Virtual keyboard

A 40-key virtual keybord located in the workspace provides control over the emulator similar to a real ZX Spectrum keyboard. The left mouse button click over a virtual key makes it pressed. With the help of the mouse wheel a virtual key can be held in the pressed state, either till any next virtual key is pressed (wheel up) or till the explicit repeated press on the same pushed key (wheel down). The virtual keyboard itself (as like as display though) can be draged to any location in the workspace.

Every key (as well as the original one) serves several purposes. The current one depends as on the mode the emulator shell in, as the extra keys Caps Shift (CS) and Sysmbol Shift (SS) pushed at the moment:

The control described earlier usually is used in the standard system shell only. The most of programs and games keyboard keywords and modes don't have any meaning. The table shows the frequently used keys and their typical actions in games:

Command/Action Typical key
Up Q, K, CS + 7
Down A, M, CS + 6
Left O, Z, CS + 5
Right P, X, CS + 8
Fire M, BR, CS + 0

IBM PC Keyboard

Everything which has been said before can be applied to the physical IBM PC keyboard. Press on the physical key triggers press on one or a few virtual keys (they can be seen by highlight).

The most of IBM PC keys correspond eponymous ZX Spectrum virtual keys. The following table displays the full key mapping:

IBM PC key ZX Spectrum keys
0 ... 9 0 ... 9
A ... Z A ... Z
Space Break
Left Ctrl, Right Shift Symbol Shift
Left Shift, Right Ctrl Caps Shift
Caps Lock Caps Shift + 2
Left arrow Caps Shift + 5
Down arrow Caps Shift + 6
Up arrow Caps Shift + 7
Right arrow Caps Shift + 8
Backspace Caps Shift + 0
, Sysmbol Shift + N
, with right shift Sysmbol Shift + R
. Symbol Shift + M
. with right shift Symbol Shift + T
/ Symbol Shift + V
/ with right shift Symbol Shift + C
: Symbol Shift + O
: with right shift Symbol Shift + Z
' Symbol Shift + 7
' with right shift Symbol Shift + P
- Symbol Shift + J
- with right shift Symbol Shift + 0
= Symbol Shift + L
= with right shift Symbol Shift + K

Virtual Kempston mouse

A ball and three buttons over it, placed to the right of the virtual keyboard, represent virtaul Kempston mouse (or trackball?). The ball can be pulled with the left PC mouse button at the different directions, sending the corresponsing commands to the emulator. The purpose of the buttons is obvious. A short PC mouse button click on the ball emulates a virtual mouse button click as well.

IBM PC mouse

If your browser supports Pointer Lock API, it's possible to click on the virtual display by the left mouse button in order to control virtual pointer inside the emulator by moving the IBM PC mouse. It is worth to remeber, however, that each virtual coordinate is stored as byte. Therefore, fast pointer movements (especially with high DPI) can lead to impossibility of programs to detect valid virtual pointer offset. The virtual pointer will jump over the screen. To exit the pointer lock mode you should usually press Escape button on the keyboard.

Gamepads

Connected gamepads (joysticks) can be mapped to Kempston-joystick interface, as well as to popular key sets often used in ZX Spectrum soft: Sinclair, Cursor, QAOPM, QAOPSpace. The mapping of an already connected controller can be changed in the Properties dialog box.

Where to begin?

Insert the disk of your choice in the virtual drive A. Using arrows, select TR-DOS menu item and press Enter. Next, press R key (RUN command will appear) and then press Enter. Good luck! ;)