You are visitor #

Web Analytics Made Easy -

This is the ZXSimulator, a ZX81 ROM emulator for the Sinclair QL. If you want to know what a ROM emulator is, read below. If you want to see how the page was created, watch this video (from my YouTube channel).

Type %-key for inverted and \-key for graphics / Chrome may remap "-key to |-key / Use browser zoom to enlarge ZX81 window

Note that as the QL boots, the screen updates a bit slower due to DOSBox. The ZXSimulator will start after boot up and once running will work normally with some screen stuff slowed in DOSBox. On an unexpanded QL, the ZXSimulator runs about 15-20% faster than the ZX81/TS1000. Use Ctrl-C to switch between ZXSimulator and QL console. Also note that, as of July 2020, ZXSimulator is almost complete, only lacking floating point support and the accompanying functions which shouldn't be too difficult to add. Other than that it just needs to weed out bugs that crop up over time.

The ZXSimulator is being run within QLAY, a Sinclair QL emulator, which in turn is being run in DOSBox, a DOS emulator. So three nested emulators, it's like the movie Inception for computers. Since QLAY's files live within DOSBox and with DOS having an 8-character name limitation, a shorthand had to be used to accomodate the QL's use of '_' in place of the '.' since "_bas" takes up half of those 8 characters. Below is a list of BASIC programs included (with their orignal names specified for clarity).

Simply type: LOAD "WIN1_????_BAS" where ???? is the 4-letter name of the program you want to run.

ROM Emulator

A ROM emulator only emulates the software of a computer and not the hardware. It means you won't be able to run programs written in Z80 machine code, only ZX81 BASIC ones. It also means it can run BASIC faster, plus the keyword entry mechanism has been skipped to be able to touch-type programs into ZXSimulator, a much more pleasant experience. Note that the ZXSimulator uses the same text format for graphics characters used by zxtext2p.exe (bottom of that page) so its programs can easily be converted into .p files which in turn can be converted to an audio file to be loaded into an actual ZX81/TS1000.

Presently a web page with releases doesn't yet exist, but you can find the latest Sinclair QL version of the ZXSimulator on the qlforum.

Additionally, there are a couple of videos of the ZXSimulator on my 8-Bit Retro Journal YouTube channel (you can also find other interesting videos on the Sinclair line of computers on that channel):


Why was ZXSimulator created? During the COVID-19 pandemic, as we all required to social distance to avoid getting sick, I found more time on my hands at home. I had just gotten back into retro-computing the previous year and found this old BASIC interpreter that I had prototyped in the early 90's on the Sinclair QL, eventually porting it to the Mac to create a command shell with scripting language. Since the interpreter's BASIC was a mix between ZX81 BASIC and QL SuperBASIC, more of the former, I thought it would be fun to fully match the ZX81 BASIC and so the ZXSimulator was born. It was developed on a QL using Digital 'C' SE, with the protoptype actually being compiled on microdrives. The source code is included with each distribution, if you want to see how an interpreter is written.

My first hurdle was the graphics character set and how to print them quickly. I eventually figured out that instead of drawing them pixel by pixel, I could draw them with 4 to 6 line commands which reduced the time it took to display them. Since then, I've had a goal of having the ZXSimulator being able to run at realtime ZX81 speed on an unexpanded QL. The two machines were about 3 years apart and I wanted to see if the 4th generation of the Sinclair line of computers could run the 2nd generation one without help. So I had to focus on keeping the executable code size small to leave enough RAM to be able to run 16K programs and to have the speed of the interpreter running efficiently. Presently I have about 30K of RAM available and it is running slightly faster than the original.

When I saw this JavaScript version of DOSBox running on a web browser I instantly thought how cool it would be to get ZXSimulator running under QLAY under DOSBox. It would make it much easier for anyone who hasn't worked with the Sinclair QL, but has played with a ZX81/TS1000, to give ZXSimulator a try, and perhaps also the QL eventually :-)

Feel free to email me comments at: (that's an L not a 1)

Free Web Hosting