I’ve been a computer owner for the past 35 years. It began as a currious kid reading an article in a danish Hifi magazine about something called the Sinclair ZX-81 – a home computer.
I managed to get hold of a book that explained the whole concept of the ZX-81 computer from the local library – only been seen computers in movies, so quite abstract thoughts for a 9 year old kid.
So, this book was read during a summer vacation in Portugal with my family – on the beach and at the pool. I didn’t realize the importance, but that formed the foundation of my future years to come: the ongoing interest of computing and later: software development.
As this “home-computer thing” quickly caught my attention I soon upgraded to the more colorful Sinclair ZX Spectrum.
A computer with 48 times more RAM than the ZX-81, capable of showing colors and even play sound (and a little more decent keyboard).
So playing around with programming – a school mate Morten and I, one afternoon, wrote a little game together (I guess very early peer-programming). We recorded it on tape and send it to the danish magazine “Soft” (a bi-monthly magazine with lots of source code listings for various programs).
Our game was accepted for publication and we were rewarded with the whopping cash award of app. USD $30 (which was split between us).
Nothing that in any way made us rich, but on the other hand – it made me stop and think: “Hey I can get paid for doing something that is actually funny!”.
Now the other day I just stumbled upon the magazine, dated may/june 1985 and thought it would be funny to make it run again – today you can run many old computers using emulators, including the ZX Spectrum … even directly in a browser. Quite impressive.
The source material is the magazine page below. Obviously some refactorings could have been performed 🙂
Getting it up and running
So what I have is an image containing the actual source code in text format. What I need is to have it converted to a text file, if only I had an OCR (Optical Character Recognition) tool. Then I remembered – the tool: SnagIt from Techsmith has in the newer versions built in OCR capability – and even better I have a license for the tool. If you don’t know it – try it! It is an absolutely outstanding tool.
From image to characters
Using SnagIt it was quite easy to come from image to characters. In SnagIt I just chose Start Capture, to capture a part of the screen and I selected the 6 first lines, capturing the image of those:
As you can see nearly quite good recognition (or at least more fun than typing it yourself), though I obviously needed to manually do some minor corrections.
Do this for the rest of the file, I ended up with a textual source file.
From characters to ZX Spectrum tape file
Next challenge: Get the code into an emulator.
I tried several emulators, online and offline versions. None of which supported loading text files – nor pasting from clipboard. So the only way around this was to find some way to convert the text file to a supported emulator file format.
After some Googling, I found the tool: zmakebas and even in a version compiled for Windows. So just passing it the text file I then had the new .tap file.
Loading the .tap file in the emulator
Loading the file into an emulator, quickly made it obvious that I’d not found all errors in the OCR result. E.g. there was some errors in the binary data, that needed to be corrected and when running the program, the graphics was not correct. The ship was shown as “abc” which was not correct:
This is due to the fact, that these characters need to be entered using Graphics mode on the ZX Spectrum.
The end result
Funny feeling to see 35 year old code comming to life in your browser. Below is the result as a screen capture and converted to an animated GIF (also using SnagIt). Amazing radar animation isn’t it 🙂