Scott Tunstall

Reverse engineering Robotron 2084

July 2014- About me: I’m 41 years old, married to Sheena, and live in Paisley, Scotland. I work as a C# Developer/ Sharepoint developer for an international company based in Glasgow.

I remember many years ago (I think about 1980) my parents gave me an Atari 2600 for Xmas and I sat playing Combat and Pac-man with my sister Catherine for hours.

Like so many other people, the Atari sparked my love for video games – I couldn’t get enough! For birthdays and Xmases I’d ask for and receive games of some kind: Grandstand’s “Astro Wars”, CGL’s Earth Invaders, Tomy’s Caveman, even a Space Invaders calculator, game and watch.

I’d be taken on holidays up North to the likes of Arbroath, Aviemore and Nairn and I’d harass my dad to take me to the local leisure complexes or amusement arcades. I have no idea how much money we spent every visit but I was there for hours playing the latest video games of the time. I loved Asteroids, Gorf, Spy Hunter, Zaxxon and Pac man. I’d go into the arcade dry and come out covered in sweat and shaking with adrenaline.

I’d discover Robotron a wee bit later.

In 1984 I was 12 years old and my parents wanted me to do more than just play games. They bought me a Commodore 64 which came with the Jupiter Lander cartridge and a Datasette cassette peripheral. Jupiter lander was OK, but I swiftly got bored with it. I had a notion to program the C64, to write my own games. The C64 manual was lousy but explained BASIC and some rudimentary graphics and sound. I wasn’t even aware, at that time, that there was a Commodore 64 Programmer’s Reference Guide which delved into the really techie stuff. I remember feeling excited getting a blocky sprite on screen…

It was only when my sister started buying me Marshall Cavendish’s INPUT magazines every month (or was it week?) that I started really applying myself to programming the 64. She bought me all of the magazines, never missed a single one. In one instalment there was a listing for an assembler. I knew to get the best out of the C64 you needed assembly, and this was my chance to write my own. I spent the best part of 2 days typing in the assembler listing, and some time fixing typos. The assembler worked! Enthusiastically I learned 6510 assembly language – not 6502, the C64’s CPU was a derivative –knowledge of that flavour of assembler was to come in handy nearly 30 years later for 2 Robotron-related projects.

I think it was about 1985 or 1986 I discovered Robotron. I was in a dingy amusement arcade in the seaside town of Burntisland, Scotland, standing amongst much older boys in a fug of cigarette smoke, watching average to decent players blast robots to smithereens. I liked the ideas of killer robots versus humans, the game was loud, and it packed a lot of sprites on screen – far more than the 8 that the C64 could manage without multiplexing. I most especially liked the noise Robotron made when a wave was cleared – and I still do.

Playing it for the first time I remember two things. Firstly, I was nervous, and secondly that the 2-joystick setup of Robotron was alien to me. End result: I did badly, sweated profusely, wasted all the money my dad gave me and exited the arcade stinking of cigarette smoke. But did I enjoy it? YES! I was seriously buzzing.

On subsequent visits to the arcade, the Robotron machine was still there and I’d spend any money I had on it. I’d persevere and one day I remember getting on the high score board. Was that a sound of “whoo, whee, whoo” coming from the machine?

Double Dragon appeared and I’d divide my time between it and Robotron .

Enthusiastic about writing my own games I returned from the arcade and wondered if I could program a Robotron type game. Or indeed a Double Dragon one. Whenever I saw a game I liked I wanted to create it at home. Unfortunately I found the C64 BASIC to be too slow for any game like Robotron, and I didn’t have the necessary knowledge of the C64 guts to do anything like multiplexing. Ah, if only the internet existed back then! Double Dragon – forget it.

I had a stab at writing something like Berzerk on a BBC B computer in my high school (Queen Anne in Dunfermline), where asterisks would chase the player (a letter O) and you could shoot them. That’s about as far as I got to Robotron. I was easily pleased.

I became the proud owner of an Amstrad CPC 464, discovered “Renegade” and practically spent the year playing karate games of all kinds. I learned Z80 assembler as well.

As soon as I turned 17 I entered the world of the working man and arcade games were forgotten for a while. I considered becoming a computer programmer but thought it was too boring. Those were the days of amber-coloured screens and 5 ¼ inch disks on PCs. In a parallel universe somewhere, I’m a labourer, bricklayer or a postman.

Fast forward to the age of 20, I realised my mistake and started an electronics course at Lauder College in Dunfermline, where I learned 80×86 assembly as part of the course. I wrote a Centipede clone in 100% assembly using the A86 assembler on a 286 system – it was quite easy, to my surprise. I then started a Diploma computing course at the college and used the PCs there to write video games in my spare time. 320 x 200 x 256 colours! I wrote various games using a mix of Turbo Pascal and Assembler, which you can all find on the internet if you search my name. My sense of humour in my 20’s was very dry, so you’ll see a lot of piss-taking and insults to friends of the time (who I no longer to– could it be related?).

All these skills I learned and the hours put into learning them came in handy many years later with Robotron.

Come 1996 I’m 23 years old and I’ve graduated from the University of Abertay Dundee with a degree in computing. I was meant to graduate in 1997 but all the stuff I learned before gave me the confidence to ask to move up a year, and as luck would have it I graduated a year early. I’d been writing a lot of graphics utils (such as KOJAKVGA) and games to demo the utils’ capabilities, mostly just to get my name “out there” on the internet which was new to me. Good for CVs (resumes) and so on.

Let’s cut to the chase, 3 years later I’m living in Glasgow with my girlfriend (now my wife), I’ve got a top-end 1Ghz Athlon PC with more fans than your average Facebook server (look up “OCUK Tornado” case and see for yourself!) MAME comes along and I find games from my youth are available to play for free (*cough*) and I’m in love with video games all over again.

I’m watching MAME releases intently to see what’s new in each release. Along comes a build that supports Robotron and that’s it – it’s taken over as my number one game. I don’t just mean number one classic game, I mean game in general! Big screen + surround sound + keyboard control + alcohol in the fridge = WIN.

But I don’t consider doing anything with Robotron except play it. Which I do, regularly. I don’t write any games for years – I just don’t have the time to learn DirectX, which all the cool kids are using.

Fast forward to 2007 and I’m “between jobs”. I thought, as I have spare time on my hands, why don’t I spend the time writing something *I* want to write. This time I had Dark BASIC, the Dark GDK for C++, and the .NET version that supported C#, I didn’t need DirectX knowledge, so I could write whatever I liked.

I wanted to create a clone of Robotron that supported 2 player simultaneous mode in C# – my favourite language.

I didn’t just want to create a derivative; I wanted to recreate the real thing. I didn’t like the 2 player Robotron sequels like Smash TV or Total Carnage much, but Robotron? I just KNOW that’d be a different matter.

So I got down to work.

I have to confess, I spent hours studying Robotron. I recorded hours of game play in MAME with FRAPS, and every pixel, every palette change was scrutinised. I used VirtualDub and a colour picker utility to get the RGB values of each palette colour change, that’s how “intense” I was. I studied the behaviour of each entity in the game, modelling it in C# as best as I could.

Grunts were easy – they just moved towards the player. Hulks? They just did their own thing – or so I thought back then. I know now I was wrong. Tanks? They gravitate towards the player and occasionally go the wrong way. But the spheroid or enforcer’s behaviour? No, they were an enigma. As for the sparks, I don’t remember even trying to reproduce them.

I did some reverse engineering of the actual game code to try to find how the enforcers worked, but to be honest I couldn’t find the code involved. I can tell you now, you won’t find the actual code unless you know how the system is constructed.

I got a new job and decided to focus my efforts on that. As a result the Robotron work was on the back burner.

It’s 2013 and I have an itch that needs to be scratched. I want to write a Robotron clone and I’m not getting any younger. I find on Atari Museum that an early, incomplete version of the Robotron source code has been dumped in a skip, so what better place to start than there?

Using my 6502 knowledge and games development experience, I used MESS to disassemble Atari 7800 Robotron to a fair extent, but could not quite complete it. Click HERE for Atari 7800 Source Code info.

In 2014 I find the mother lode -Sean Riddle’s website (http://seanriddle.com/willy3.html). Sean not only had the hardware information for Williams Robotron – including some blitter flags that are not documented in Williams.c in MAME – but he also had some preliminary investigation into the code such as where the lives and the current number of each type of object in the game were stored.