*DONKEY RACER*

A handheld revival of Bill Gates' masterpiece

Contents:

What is DONKEY RACER?

DONKEY RACER harks back to a simpler time with simpler pleasures. The year was 1981, and Bill Gates and Neil Konzen were sweating late at night in a cupboard somewhere, struggling to turn out some decent demo programs for the soon to be released IBM PC. I can only imagine their conversation

Bill... we should probably include some kind of game with the IBM...

You know what Neil? I think you're right. Let's make something that absolutely does not show off the capabilities of CGA graphics in any way, and which has less playabiliy than pong. That'll show them!

Yes sir!

Anyway, the end result was a particularly horrible little game where you raced a tiny car up a thin road and avoided crashing in to donkeys. Control was achieved by pressing spacebar to swap to the other lane, and points were awarded for... not hitting donkeys. As the game progressed, the car moved further towards the point where the donkeys appeared, reducing the reaction time given to the player. The game wasn't fun, it wasn't addictive, it didn't even have colour. Yet, for those reasons alone, it has achieved a certain immortality in the minds of many. I first played it on my 286, loaded from a copy of the original IBM demo disk. At the time, I found it boring and probably only spent a few minutes playing with it... only years later finding out that Bill Gates himself had had a hand in creating one of the first, and also one of the worst, games for the IBM PC.

Fast forward a few (not many) years and here I am on school holiday, playing with an Hitachi LCD and a PIC. For some reason I decided I wanted to re-implement DONKEY.BAS in handheld portable form, and see if I could perhaps improve on it a little. To find out more about the history of DONKEY.BAS, have a look at the relevant page on Wikipedia.

The hardware

The display is simply a 16x2 character LCD (Hitachi 44780 clone) recycled out of an old Samsung PABX phone. The processor is a PICAXE 28-X (a pre-programmed PIC with built in bootstrap and BASIC interpreter) microcontroller. The sound is provided by a piezo element out of a VCR, and the whole thing runs at 4mhz provided by a little crystal oscillator. Input is achieved via a small switch possibly out of the same VCR.

The LCD is wired up more or less the same way as in the reference implementation, with the exception that the power for the LCD is supplied via an IO pin (it only needs a couple of milliamps) so that I can power the whole LCD down from software. The single input button is connected to input 1, and the piezo speaker is on output 1. There's a lot of unused I/O so I plan to migrate the design to an 18-X which has less but still enough IO pins.


The software

The software that makes it go is a very very very poorly written PICAXE BASIC program which compiles to ~ 980 bytes, necessitating the use of the higher capacity -X model microcontroller. I'm not used to working with a language as limited as PICAXE BASIC (it's a bit like programming for a turing machine...)

The source code is here: donkey.bas for those who dare.

Conclusion

I've added some features, like a slow speed increase, which I think make the game a lot more interesting to play. It's worth noting that I've only completed it once, and I scored 5/6 (I ran over one donkey). Total time from conception of idea to completed prototype mark 1 was about 3 days mostly working late at night, a testament to the versatility of the PICAXE range. (The I.C I used cost only about $15 NZ). Future expansions might include a complete code rewrite (the redraw mechanism is less than optimal and the whole thing is horible to maintain) and hopefully a case and or battery power.

Video


The 5x7 Donkey!
The car isn't worth showcasing.

Here's a WMV video (profuse apologies for the format... I only had Windows Movie Maker at hand... suggest VLC or MPlayer for those using civilised OSes) showing me starting the game and playing it fairly poorly. It's designed to be played portrait orientation, thus the "flip it!" message. The intro you see briefly scrolls a couple of messages until you hit start, but I happened to catch the "Hot Plate Labs" one.


racer.wmv (1.5mb WMV, 20 seconds, 320x240, 10fps)

Links

The Picaxe website.
The wikipedia page about the original DONKEY.BAS
The Happy Hippy site with information about PICAXEs and LCD interfacing.

Made with the assistance of the Ghostbusters theme song in 2006 by ex-parrot. any questions?