Cam's Pac-Man Hacking Page
This page is under construction at this time. Sorry for the inconvenience. Pac-Man and Ms. Pac-Man are trademarks of Namco and the following game modifications below are the work of a hobbyist. Please don't sue me.
For a fun page on Pac-Man trivia, click here. For a mirror of the Mowerman Pac-Man page, an invaluable page packed with Pac-Man info, click here.
Pictured above: Jesus talking to his disciples
To begin hacking Pac-Man you're going to need a few things. I'm going to list the requirements below with links to download each (except for the unmodified MAME ROMs, sorry). Please note that you can substitute HxD with any other hex editor of your choice.
I will write an article about how to use A.G.E., DOSBox and more on modern Windows PCs in the future. Stay tuned or email me directly if you're struggling and need help.
Alright, so this is sort of a complicated one, but it's worth figuring out so you're not limited by the original tunnel positions. Pac-Man and Ms. Pac-Man handle tunnels completely differently, but there's some key similarities between the two. Just know beforehand that the tunnel system implemented in Ms. Pac actually introduces some weird bugs way late into the game, so you might wanna check out this page by Don Hodges that explains how to fix it. I'm gonna start off by explaining Pac-Man's tunnel system first.
This shouldn't come as much of a surprise, but tunnels in Pac-Man are hardcoded to set locations. Let's start off by opening pacman.6h (from an unzipped "pacman.zip" MAME ROM) in our hex editor of choice. The relevant code for "moving" the tunnels (or moving the ghost slowdown locations, really) is located at address 50C in the 6H ROM. Right above this (starting at address 4F7) is similar code for a different effect that "paints" the perimeter of the ghost house with a palette that prevents the ghosts from changing directions. If you want to learn more about the palettes used for these effects, check out the dedicated palette article.
Alright, so let's take a quick look at Scott Lawrence's Ms. Pac-Man disassembly. Ms. Pac-Man and Pac-Man share much of the same code, with Ms. Pac only rarely modifying the actual Pac-Man game code- more often than not it just adds hooks to patches contained in the additional roms, but retains all the original unused Pac code.
250c 3e1b ld a,#1b ; load A with color code to slow down ghosts in tunnel 250e 0605 ld b,#05 ; for B = 1 to 5 2510 dd214044 ld ix,#4440 ; load IX with start of color memory 2514 dd770e ld (ix+#0e),a ; paint tunnel with slowdown color 2517 dd770f ld (ix+#0f),a ; paint tunnel with slowdown color 251a dd7710 ld (ix+#10),a ; paint tunnel with slowdown color 251d dd19 add ix,de ; add offset for next column 251f 10f3 djnz #2514 ; loop until done 2521 0605 ld b,#05 ; for B = 1 to 5 2523 dd212047 ld ix,#4720 ; load IX with start of color memory for left side of screen 2527 dd770e ld (ix+#0e),a ; paint tunnel with slowdown color 252a dd770f ld (ix+#0f),a ; paint tunnel with slowdown color 252d dd7710 ld (ix+#10),a ; paint tunnel with slowdown color 2530 dd19 add ix,de ; add offset for next column 2532 10f3 djnz #2527 ; loop until done
This is where stuff gets complicated, but it's also simpler than it seems. The game first loads the slowdown palette code into the accumulator, and then loads the length of the tunnel immediately following. Keep in mind this is done right to left- I'm not sure if that's because the game is Japanese or not, but on that note, not only is it right to left, but the color memory assigns hex values to each 8x8 tile in a vertically descending order. So yeah, it's really Japanese. But I'm getting ahead of myself here since I haven't explained any of that yet.
Check out this image from the Don Hodges site I linked above. This overlays the Pac-Man color memory grid on top of a gameplay screenshot from Ms. Pac-Man. In fact, the entire Don Hodges site I linked basically explains everything I'm trying to explain, but for the sake of this page I'm trying to water it down a bit into something more noob friendly, while also focusing on OG Pac instead of Ms., for now.
Take a look at the upper right corner, right above the last bit of maze before the screen cuts off- that's tile 4440, which our tunnel code is referencing. That tile is being loaded into IX, so for all intents and purposes IX currently equals 4440. I'm describing it this way especially because we're about to do some math. Hooray.
Right now we're at tile 4440 in the color memory grid, and with each following instruction we're going to be adding a value that will take us to the next tile and paint it with the slowdown paint. Starting with address 514 in the 6H ROM, we begin calculating and painting our tunnels using addition to find our tiles. 4440 + 0E is 444E, 4440 + 0F is 444F, and 4440 + 10 is 4450. Those three tiles- 444E, 444F, and 4450- are our "tunnel tiles". Each one is now painted with slowdown paint. 20 is added to 4440 (which, if you remember, is still stashed away as our IX value) and the process repeats in order to fill the full width of the tunnel with paint. Our tunnel is five 8x8 tiles wide, and once all five of those tile groups are painted the process is completed. Here's a visualization that might make it easier to understand:
You might notice above the lefthand tunnel isn't symmetrical like you might expect- this is because the color memory map is handled from right to left, like I mentioned earlier. The process for the lefthand tunnel is largely the same, the only difference is that the starting value is 4720 instead of 4440.
With all this in mind, you should now (hopefully) have a basic understanding of how the tunnels are "painted" in Pac-Man. Modifying these values and "pointing" to different tiles will move your tunnels to different locations, with whatever width you set as variable B.
This is a little more complicated than regular Pac, and the Don Hodges site I linked above is already a good resource for this information. The tunnel system works largely the same but doesn't rely on a set palette this time, and the routine overall is handled a little differently. It requires some math once again and basically "jumps" from tile to tile through addition, not totally dissimilar to the Pac code but also not the same, either. You'll understand once you check out Don's page.
Pac-Man handles energizers in a way that's fairly straightforward but also sorta tedious. Three sets of data must be altered- the first set uses values from the color memory table to create the flashing effect in the four different energizer locations. The second set is the actual energizer placements and the third set must be altered to prevent the energizers from vanishing when Pac-Man dies. I'll try to write something up about what values need altered and how to calculate the new values hopefully sometime in the near future. Please check back later for more details.
This section is currently under construction, please check back later.
Pac-Man contains a bug at location 700 in the 6F ROM that causes one of the frames of animation for Pac-Man moving up to display a single pixel lower than intended. This was patched in later revisions of Puckman. The following code is the patch:
1E 30 C3 0B 17
The code it replaces is as following:
DD 36 0A 30 C9
Before I get into a more detailed explanation of palette editing, let me mention that after drafting up an article on hacking the colors I actually came across this page that does a pretty good job of explaining the ins and outs of palettes and color proms. It doesn't quite go into the same detail I intend to when it comes to altering the colors specifically used in Pac-Man (since the page itself isn't dedicated to that) but it's very good supplemental material and I highly recommend giving it a read over.
A "recreation" I made of a hack from the late 90s. The original hack has been available for over 20 years now, I take zero credit for the idea or concept, but I made a few additional tweaks and redid all the graphics. In this hack the entire game has been refinished in a thin neon glow with a blacked out maze, forcing the player to either follow the dots or memorize the motions to survive. Ghosts reward double points, leading up to a whopping 3,200 points for the fourth ghost eaten in succession (and 6,000 points total if all four ghosts are eaten). There's a good reason for this- chasing the ghosts is risky business this time around since it frequently sends the player ambling into the dark, where they're most vulnerable.
A decrypted version of Pac-Man Plus that can run on a standard Pac-Man board without the daughtercard/epoxy block. This version has been hacked to use the "Uniprom", a set of new proms to replace the original 4A and 7F color proms allowing for complete compatibility with Pac-Man, Ms. Pac-Man, and Pac-Man Plus all on a single board with only minor alterations in color. The only difference in the palette between this version of Pac-Man Plus and an actual Pac-Man Plus board with the original proms is the shade of brown used with the pancake and bread "fruits", seen above. The most important feature of this hack- accurate tunnel behavior for the ghosts! The Super ABC version unfortunately lacks this since the tunnel and ghost house behavior are tied to the palettes and Two Bit Score neglected to alter all the necessary code to fix it.
This is a slightly more intensive hack designed specifically for original hardware (it'll play fine in emulation but it's redundant, since you could just load the original Pac-Man Plus ROM in Mame instead). The original Pac-Man Plus conversion kit for Pac-Man PCBs required a new set of two unique color proms and a large daughtercard containing encrypted data and potted in a black epoxy coating as an antipiracy measure. This hack forgoes all of this by instead using roms decrypted via Mame that can be burned onto regular 2532 eproms and installed without the daughtercard. For the correct colors however the 4A and 7F color proms MUST be replaced with the two respective files from this hacked romset. The "Uniprom" color prom replacements are designed specifically to allow Pac-Man, Ms. Pac-Man, and Pac-Man Plus to "coexist" on the same board without any hangups regarding differences in color, since all the color data in this version of Pac Plus has been hacked.
To summarize, Pac-Man Plus is normally not compatible with Pac or Ms. Pac PCBs unless you have the full kit including the daughtercard and replacement color proms. This version however is compatible but still requires replaced color proms, but unlike the original proms the included hacked proms in this set do not ruin your ability to continue playing Pac-Man and Ms. Pac-Man on the same board. Hopefully that makes sense.
To use: burn all the row 5 and row 6 roms onto 2532 eproms (or whatever equivalent your board uses if bootleg). Burn 82s126.4a and 82s123.7f onto an 82s126 and 82s123 prom respectively, or purchase an adapter kit (found online) to adapt cheaper/easier to burn 27512 eproms to the respective prom pinout you need. Install your row 5 and row 6 eproms in the correct rows, and replace the proms located at 4A and 7F on the board with the new Uniprom set.
Supports freeplay with attract by default.
Let's be real- Hanglyman sucks. Hanglyman is terrible. Hanglyman is genuinely terrible and the only redeeming factor it possesses is the fact that it has a funny name. Anyways, I fixed the tunnels. The ghosts will now slow down properly when entering and exiting them like in the original maze. This doesn't account for the new "instant" tunnels the Hangly hackers added to the top and bottom of the maze. There's no slowdown for those ones, and to be honest it would be pointless to add any since there's basically no actual "travel time" in those tunnels anyways.
BONUS - "Invisible maze" effect now ends after power pellet wears off like in later revisions of Hanglyman ("Hangly-Man (set 2)" in MAME).
This is essentially the same as the above Hanglyman hack, only made for Barracuda instead. The maze color has also been modified to reflect the 4A color prom trace "modification" on the board I dumped the game from.
A hack of Newpuc2 to fix the tunnels, like the Hanglyman hack above. This hack also concatenates the original 12 EPROM setup to match the 6 EPROMs used on original non-bootleg Pac boards. It also changes the graphics for the "vulnerable" ghosts using code instead of directly replacing the blue ghost sprites like the original did, since this way is more efficient and doesn't require duplicate graphics. As a bonus this hack is available in two different flavors: "Full", which includes new row 5 (5E and 5F) EPROMS for the heart-shaped dots and the "8000" point graphic used with the ghosts, and a "Lite" version that can run on a standard Pac board with no row 5 replacement ROMs needed. The only difference in the Lite version compared to the Full version, other than the visuals, is that the fourth ghost eaten in succession rewards 1,600 points like the original Pac-Man game instead of 8,000.
Download "Full" Version or Download "Lite" Version
A "recreation" I made of a hack featured on the Two Bit Score "Super ABC" multipac kit. The original hack has been available for over 20 years now, I take zero credit for the idea or concept, but I made a few additional tweaks and redid all the graphics. The Ms. Pac-Man equivalent of the above "Pac-Man After Dark" hack, the same details and gameplay rules apply.
Marcel Silvius fixed the fruit bouncing paths for Ms. Pac Attack, available as this invaluable patch. Now the fruit correctly follows the maze instead of bouncing through the walls.
Scott Lawrence has an interesting writeup about Hanglyman available here. It details a bit of the maze alterations unique to the game.
GaryMcT released a patch several years ago that corrects the intermissions in speed-hacked versions of OG Pac to play at the correct normal speed. This patch is available for both standard romsets and the Souza 4-in-1 multipac hack.
Graphics hacks for the romantic in your life. These simple hacks change the dots into hearts, a feature sometimes found on bootlegs. Unlike most bootleg versions tho these replacement 5E files change just the dots, meaning the rest of the game remains completely stock. Great if you want something fun and unique, a slightly more feminine Ms. Pac-Man, or if you just really love Valentine's Day.
The Pac-Man heart 5E is also compatible with most bootleg romsets as long as the bootleg in question doesn't required an altered 5E rom already.
Alright, here's a hypothetical. You like the neon visual style of the After Dark hacks, but you don't like the invisible maze. What do you do? Well, you download these replacement 5E and 5F files and install them instead alongside your stock Pac-Man or Ms. Pac-Man game roms. These contain the same neon graphics seen in the above AD hacks, minus the invisible maze and the adjusted scoring, meaning these hacks are purely graphical only.
COMING EVENTUALLY ONCE TIME PERMITS - PAC-MAN PLUS VERSION
Replacement 5E and 5F files for Pac-Man that change the ghosts to the 3D design used in the NES port of Pac-Man CE.
Scucci's Pac-Man "freeplay with attract" patch applied to the original Namco Puckman romset. Replaces the original 6E rom.
Scucci's Pac-Man "freeplay with attract" patch applied to the Ms. Pac-Man "boot6" romset. Replaces the original boot1 rom.
This rom was actually dumped from a bootleg board I bought and was previously undumped. It patches the attract mode to skip over the Japanese ghost names and jump straight to the alternate English names every time instead, regardless of the dip switch settings. These alternate English names exist in the original Puckman rom but were unused when Midway licensed the game (instead opting to rename the ghosts themselves).
I modified the rom to add the Namco logo text back in but the original dump scrubbed all mention of Namco out- I've included both versions for download here.
"The Elder Gods of Pac"