ZX Spectrum flies simulated spacecraft using BASIC, Python, and serial — Kerbal Space Program Lunar lander powered by 1980s hardware

ZX Spectrum in space
(Image credit: Tom's Hardware / Pexels)

Another day, and another Z80-based news story showing that there is life in the old microprocessor. Internet rocket scientist, gamer, astronomer, and YouTuber Scott Manley has taken the venerable Sinclair ZX Spectrum to another world. Well, virtually!

The ZX Spectrum did not come with a dedicated serial port, but there were first and third-party offerings, such as the ZX Interface 1, that could provide up to 19,200 Bits per second (19.2 KB/s). Using a little BASIC code to read the serial port, Manley can see real-time numbers and control his planetary descent. Manley confesses that the BASIC code on the ZX Spectrum is inefficient, largely down to the speed of the serial interface and how overworked the CPU will be, but you have to admire the approach.

The project appears to be all running on one PC, and this is where emulation comes into its own. In the top right of the video, we can see what appears to be the Fuse ZX Spectrum emulator running the BASIC code, and a virtual ZX Interface 1 is being used to send and receive the serial data to a Python script, which uses kRPC — it enables external control of Kerbal Space Program via programming scripts — to interact with the simulation. That is a lot of work, but we love the final result.

Could this be done for real? Yes! At a hardware level, it would require a USB to RS-232 adapter (I use something similar to connect a Psion 3A to my Windows XP virtual machine) to connect the ZX Interface 1 to the PC. Then it would require telling a Python script which serial port and speed to communicate with the ZX Spectrum. After that, it's "just" a matter of getting the data between the two machines. Formatting / sanitizing the data so that the two machines can communicate. Could it be done with another 1980s home computer? Yes! The Commodore 64's User Port had a serial interface, so with some clever BASIC coding, the same project could be created for the MOS 6510 microprocessor.

Manley's project is simply sublime and shows that the Z80 and the 1980s home computer era are still firmly in the public zeitgeist.

Google Preferred Source

Follow Tom's Hardware on Google News, or add us as a preferred source, to get our latest news, analysis, & reviews in your feeds.

Les Pounder

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

  • edzieba
    Without the plastic case of the spectrum around it, the Z80 already ran a real spacecraft: the STS orbiter ('Space Shuttle') had several Z80s running various systems, as well as 8086s.
    Reply