Programming for the Pac-Man or Pengo arcade platforms

|| The Basics || Memory maps || Reference || Tools || Romsets || Acknowledgment ||

|| More about the original software... ||

T h e   B a s i c s

Hardware Doc
My all-encompassing documentation about the Pengo and Pac-Man hardware

NEW (2003 Mar 05): Added: complete sound information!
NEW (2003 Feb 27): Added: sound rom layout information!
Here are the waveforms stored in the hardware...
Waves 0 and 1 Pac-Man Pengo
Waves 2 and 3 Pac-Man Pengo
Waves 4 and 5 Pac-Man Pengo
Waves 6 and 7 Pac-Man Pengo

NEW (2003 Feb 26): Added: preliminary sound information!
NEW (2001 Feb 12): Added: Info about Interrupt Modes (opcode "im")
NEW (2001 Feb 11): Added: Timing, Initialization, Collision Detection
How to code for this platform, limitations to consider.
Game Design
How to design a game for this platform, limitations to consider.

M e m o r y   M a p s

Pac-Man Memory map. (Same for Ms. Pac-Man).
Information gleaned from the MAME source.
NEW (2001 Feb 12): Added more information about which roms are which
Pengo Memory map.
Information gleaned from the MAME source.
NEW (2001 Feb 12): Added more information about which roms are which
Screen Info
Pac and Pengo Screen hardware memory map. (values shown are for Pac-Man)
This was written by David Caldwell, and his original page is here
Screen offsets
A similar memory map to the above, showing offset values for each position on the screen. Handy for when you're writing video routines.
This was written by Alessandro Scotti, who has a really cool Pac Emulator

R e f e r e n c e

Ms. Pac-Man disassembly
Commenting is a work in progress, but this is good reference anyway.
Updated June 2008 - Sound and music docs added from Frederic Vecoven
Z80 Home
Tom Scherrer's Awesome Z-80 Support page.
Arcade Z80
Z80 instruction set reference.
Amit's Game Programming Information
Lots of good links to reference materials for programming games.

T o o l s

Edits graphics in romsets (MS-DOS)
Generates rom files from the assembler's Intel Hex File output (.IHX) (source)
C Compilers
I use ZCC myself, which is a Small C variant. Source code available from that site, or you can just download my tweaked version, which compiles cleanly, and has a few helpful targets, placing binaries in a 'bin' directory. Or you can download the unmodified (source)
Z80 Assemblers
I'd like to recommend 'Tasm'. it seems to work really well.
(Although, to be honest, the ZCC package above comes with a good Z80 assembler as well.
Text editor, also edits files in HEX. (type ":dis hex") Useful for trying tweaks or editing palettes.
Dev Tools
Tom Scherrer
Various assemblers, compilers, etc for the Z80.
MAME (alt.)
MAME is a tool? Yup. It emulates the target hardware that we are building for! So it's worth more than just to play games. ;) There are links to downloads for all sorts of systems. I personally took the unix source, and compiled it with the debugger active. (Read MAME's docs for how to do this.) So that I can look at the registers and RAM and such to see if my programs are doing what they're supposed to.

R o m s e t s

All screengrabs were generated with the emulator MAME
Unless otherwise noted, all source code is FREEWARE.
Alpaca: Pac/Pengo Tiny OS
Sequencer and Music Player
Pengo Roms
Pac-Man Roms
Source Code
Browse Source
This includes the below sequencer code, but also adds a music playing aglorithm, vaguely based on an old Mod tracker. Use up and down on the joystick to change the waveform used.
(source to come soon)

You may have to flip the 'service' switch for this to start.
16 Step Simple Sequencer
Pengo Roms
Pac-Man Roms
Source Code
Browse Source
This is my first major entrance into sound programming for Pac hardware. It will step through 16 steps on the screen, displaying the current one on the top of the screen. The columns are:
Green: Waveform select (0..7)
Red: Frequency select (0000..ffff)
Blue: Volume (0..f)
Joystick moves the white cursor.
P1 and P2 start change the value.
P1 and P2 coins change the speed.
moving with 'service' on copies the value around.
The current copy character next to the 'C'.
The speed is next to the 'S'

You may have to flip the 'service' switch for this to start.

If this interests you, be sure to check out my page of inappropriate use of technology, as well as Paul Slocum's Atari 2600 Synth
Hello, World!
Pengo Roms
Pac-Man Roms
Source Code
Browse Source
The first test rom I made from scratch. This is my "Hello, World!" rom, to prove to myself that I had a basic understanding of the tools and the hardware. I've been constantly updating it, and using it as a test platform to understand the hardware and techniques. Watch the red ghost's eyes as you drive him around with the joystick.

You may have to flip the 'service' switch for this to start.
Matrix effect
Pengo Roms
Pac-Man Roms
Source Code
Browse Source
All that has to be done is a simple toggle in the makefile to build this same program for either Pac-Man or Pengo hardware. It simulates the green text waterfall, as seen in the movie "The Matrix".

THESE ROMS SHOULD WORK ON REAL HARDWARE! You may have to flip the 'service' switch for this to work.

NOTE: These romsets might contain some modified graphics from an original Pac-Man or Pengo romset. This graphics rom modification is not endorsed by NAMCO or SEGA in any way. The likenesses of the ghosts and pac man are trademarked by NAMCO. The likenesses of Pengo and the Sno-Bees are trademaeked by SEGA.

Turaco Hacks
Some hacks I made with Turaco.

A c k n o w l e d g m e n t

First of all, I need to say that the arcade collecting community on RGVAC have been very helpful and friendly... even those people with products that might be competition with projects I'm working on. You guys/gals really rock. Thanks alot for being so extremely cool about everything.
I guess we all have a common goal... to keep this old hardware preserved, working, and in circulation, providing pleasure to whomever uses it. :D
Clay Cowgill
Clay has supplied me with a lot of practical information about writing programs that can actually be run on real hardware. It was from some sample source that he sent me that I was able to better understand the Watchdog Timer, as well as the VBLANK IRQ information. Thanks muchly, Clay!
Kev "Mowerman"
Kev has offered a lot of information on more of the hardware side of things. He sent me two Pac boards for testing. Rock on!
Dave Widel
Dave helped me out a lot with getting an understanding about the sound hardware, and let me peek at some of his sound generation code. He's got kickass games that run on pac hardware on his site. very cool.
David Caldwell
David got me started on the map editor back in the old "AGE" days. His character ram layout template, and maze decoding routines really helped out a lot back then.
Marcel "The Sil" Silvius
An awesome hacker of the pac. Made "Pac Name" which was inspriation for AGE early on, and provided much information about the pac software structures and such.
Computer Science House
I've been involved with CSH since I was a frosh in college, and I've kept in contact with everyone there... some years more than others, but everyone there has always been open for "the old folk" to get back involved with stuff. When I asked to borrow one of the EPROM programmers, no one told me no. (Granted, no one really told me yes either... but still.) I'm still trying to get the damned thing working, but the fact that I could borrow it at all is way cool.
I soon will have a seminar at CSH about doing all of the stuff listed in the docs and such above.
Tom Scherrer
Tom has THE single best resource on the net for Z80 development. The effort he's put into maintaining the amount of information that his pages contains is just stunning. Cheers, Tom!
Alessandro Scotti
Alessandro has done a lot to document the Pac hardware on his own, while working on his Pacman Instructional Emulator (AKA "PIE") It's very refreshing to see a new emulator that isn't MAME.
my friends
Many of my friends have been very supportive of this effort, and just their simple "that's pretty cool" or "you are such a geek" comments have helped motivate me to push onwards with this effort.
Granted this link doesn't go to most of them, but it's a start. ;)

If you're looking to hack Pac-Man the game, you might be better off at starting over here, although there's a lot of good information here as well.