Circuit Cellar article on Galaga no-shots bug

From: Christopher X. Candreva <chris_at_westnet.com>
Date: Thu Nov 03 2005 - 20:38:30 EST

The November 2005 issue of Circuit Cellar has an article on the bug in
Galaga, where if you kill all the bees except the one on the bottom left and
wait 15 minutes, no enemy will ever shoot again.

They treat it as en excerise in finding bugs in embedded code, so here's the
spoiler space -- if you get the magazine, stop reading now, 'cause I'm about
to sumarize where it comes from.

Great reading -- if Z80 opcodes are your idea of a bedtime story. :-)

OK. Galaga has three CPUs. The jobs of starting a new shot and moving an
existing shot are handled by two different CPUs. The problem is, each uses a
different method to determine if a shot is active or not -- one checks to
see if X=0, the other uses a specific status byte. There are a total of 8
shot slots that can be active or not at any time,

When you leave that last bee, it circles off and on the screen. If it shoots
while off the screen, the shot is made active, but -- X= 0 ! It never
moves. When this happens 8 times, no more shots, ever.

-Chris

==========================================================
Chris Candreva -- chris@westnet.com -- (914) 967-7816
WestNet Internet Services of Westchester
http://www.westnet.com/
---------------------------------------------------------------------------
** Unsubscribe, subscribe, or view the archives at http://www.vectorlist.org
** Please direct other questions, comments, or problems to chris@westnet.com
Received on Thu Nov 3 20:38:32 2005

This archive was generated by hypermail 2.1.8 : Thu Nov 03 2005 - 22:50:00 EST