Journal Contact Me Tools Comments

free web page hit counter
free web page counter
Latest

3/20/2011
Working on the "Game Programming on Everything" book. I am back to the Atari2600. I deployed the Missile Command initial disassembly.

1/26/2011
I bumped into FROTZ for iPod/iPhone/iPad. I began translating Madness and the Minotaur into zcode for play on my iPod touch. See the "Madness and the Minotaur" section for the source and zcode. Like so many things here it is a work in progress.

Journal


Contents

Some Assembly Required

After decades of evolution computers still only understand the myopic language of opcodes. Their moment-by-moment life is simple: read a value from memory, subtract five from it, store it back to memory, and jump to another part of the program if the new value is zero. They see only the next instruction or two. They have no concern over “where this is going”.

We rarely program in assembly anymore. Now we have (arguably) human-friendly languages to speak in. The compiler takes over the mundane tasks of assembly programming: decomposing algebraic expressions into pieces, managing complex memory organization, and producing tedious jump code for flow constructs like IF, DO, and WHILE.

If the computer can read it, you can too! The binary form of a program has lost its human-given naming, but it is still a list of opcodes. A disassembler will turn the binary sequence of bytes into a human readable list of opcodes.

And that is where the computer-archeologist comes in! His job is to trace through the program and figure out what it is doing. He gives symbolic names to memory and code routines and begins unraveling how and what the program does.

This is not piracy! The goal of the archeologist is to find the original programmer’s spirit, ideas, and ingenuity in the code … the programmer’s “flavor”. There are code gems and idea nuggets in the old programs buried in the ancient (decades past) ROMs of old. The computer archeologist digs these out and dusts them off and puts them on display in a museum for all to share.

I am Christopher Cantrell, a nerdy Indiana Jones. Welcome to my museum!

One Quarter at a Time

There is a famous bug in the arcade game Galaga. Shoot everything in the game except the lower left bee. Then dodge it for fifteen minutes. Eventually it will stop firing, and none of the bees will fire at you again for the rest of the game. Let me lead you into the tomb of Z80 opcodes and show you the mistake in Galaga.

Space Invaders was one of (if not the) first arcade games. The 8080 code is littered with “questionable code design”. There is a hidden message Easter egg in the code, and I found a subtle bug. Check it out here in Space Invaders.

Many early video games used vector-graphics. The display hardware reads a long list of lines from memory and then drives the electron gun from point to point. The technology is all but lost today. Check out the line-list programming in Asteroids and in Omega Race.

Sounds of the 80s

Remember the songs of Frogger? There is actually a snippet of hidden music buried until now. See and hear it here in Frogger.

I grew up with the AY38910 sound chip. I still have a couple dozen of them! They were used in several arcade games, and it is fun to see how different sound boards scheduled long-running effects over multiple channel resources. Check out the sound-board disassemblies of Moon Patrol and Time Pilot and Forgger. The running base line in Moon Patrol is a nugget in itself. You can see the beginnings of Domain Specific Languages in these boards that define their own sound-script languages.

Adventures in Text

The TRS-80 Color Computer hosted a series of text adventure games from Robert Arnstein. Follow the fascinating evolution of his adventure engine from Pyramid to Raaka Tu to Bedlam.

Spectral Associates produced a complex text adventure game with real-time features in Madness and the Minotaur. It is not impossible to solve the game, but it is extremely difficult without knowing the secrets. They are all described here.

TV Console Systems

If you were a child in the 70s chances are you had an Atari2600. The hardware seems designed with the included game Combat in mind. But game developers squeezed out ingenious games using the simple hardware objects. In Missile Command the player-duplication feature creates the parallel falling missiles.

The 2600 was limited to a direct access of 4K bytes in the cartridge. Many games included several banks of ROM that were swapped in and out through cartridge circuitry. See bank switching in action in Asteroids.

The Chess cartridge is a complete chess playing program for the Atari2600 with multiple difficulty levels. The entire game fits in a 4K cartridge and uses only the system’s 128 bytes of memory.

Zelda

The Legend of Zelda for the NES started a long series of wonderful Zelda games spanning all the different Nintendo game systems.

Viruses

Computer viruses are an intriguing part of our computer culture. Let me take you into the assembly workings of two famous but defunct viruses. First I’ll show you the Morris Worm VAX assembly snippet written into a buffer overrun to forge a root shell. Then we’ll look at the PC Stoned boot sector infector. As tiny and efficient as it is, there is always room for improvement. Let me show you!

Tools

Rather than learn the syntax of several different tool chains, I built my own tools for my archeology work. The source code is all here for you to enhance: assemblers, disassemblers, tools to transform code into web pages.

Each processor family used on this site has an XML file that defines its opcodes and mnemonics. See Processors.

There is also a directory of tools specific to each dig site. These tools extract data and generated formatted data sections for disassembly and such.

Other Archeologists

If you like Computer Archeology you must visit Don Hodges amazing site. He has a series of digs into Pac Man, Ms Pac Man, Dig Dug, Donkey Kong, and Defender to name a few. Visit his Archive for most of the series.

Vecoven Frederic has disassembled the Galaga sound processor. See his awesome work here: Vecoven Frederic – Galaga Sound. Hopefully he will tackle the entire code base!

 


Powered by Disqus blog comments powered by Disqus