MS. PAC-MAN (NES, TENGEN VERSION) MAZE DATA FORMAT - v1.1 - 8/11/01 ------------------------------------------------------------------- deciphered by Scoutboy & BMF54123 documentation by BMF54123 ------------------------- New in this version ------------------- Err, not much...I just decided to fix a few things that should've been changed a long time ago, like our e-mail addresses and website URLs. No new hacking info, sorry...we haven't touched this game in a long time. Quick note: before you start hacking the mazes, you might want to print out a list of all the maze wall/dot tiles and their associated hex values. It'll help, trust me. Data locations & byte values ---------------------------- In the .NES file, the maze data starts at $2F08 (byte value is 45), and ends at $5F0F (byte value is FF). Each byte in between will be one of the following values: 00-0F (maze walls, dots) 40-7F (maze walls) 82-8C (repeat byte) FF (end of maze - REQUIRED!) In-game maze layout ------------------- In the game itself, every maze is 28 tiles wide. The height of the maze will vary depending on which maze type you choose in the main menu (ARCADE, MINI, BIG, or STRANGE). Every maze is mirrored left-right. Data compression ---------------- The game's programmers used two simple forms of compression to store the mazes efficiently (although it makes hacking a pain in the you-know-where)... Compression, part 1 -------------------- In the ROM, each line of the maze is actually 14 tiles wide. The game program mirrors each line of tiles left-right, except: 1. tile values 40-5F will be changed to 60-7F, and vice versa 2. tile values 00-0F will be left as-is (they work on either side) Compression, part 2 ------------------- To save even more space, strings of identical tiles (the bottom of the maze, long horizontal rows of dots) are stored as two bytes. The first byte (ranging from 82-8D) defines how many times the next byte (tile) will be repeated (82 = 3 times, 83 = 4 times, 84 = 5 times, etc). Example: 01 01 01 01 01 01 would be stored as 85 01 (draw tile #01 6 times) A bigger example: 46 02 02 02 02 4A 6A 02 02 02 02 02 02 02 would be stored as 46 83 02 4A 6A 86 02 (Using both compression methods, that's 28 on-screen tiles compressed into 7 bytes! Wow!) Putting the data together ------------------------- Let's review what we've learned, shall we? The following is the first row of the first maze of ARCADE mode: 45 85 01 68 48 84 01 We decipher it into: tile 45, tile 01 repeated 6x, tile 68, tile 48, tile 01 repeated 5x or, a bad ASCII example: ______ _____ / ][ Mirrored left-right, we get the top row of maze 1: ______ __________ ______ / ][ ][ \ Easy, no? When hacking the maze data, remember that there is no break between the lines of data for each line of the maze (each maze is stored as one L O N G string). You could easily corrupt the maze by accidentally crossing the invisible line into the next line of data, so be careful! Assorted things --------------- From start to end, a maze's uncompressed size MUST be divisible by 14. Every time you change a repeat byte, you must be able to compensate for the change. For example, let's say you have two repeat bytes in the same line, one is 6, the other is 3. If you wanted to change the 6 to a 4, you'd need to change the 3 to a 5. This will keep the line the same length when it's uncompressed, keeping the maze engine happy. Moving the FF's around to change maze sizes is NOT recommended (see point #1). If you want to shrink a maze, replace the last (or first) few lines of walls/dots with 00's (but leave the repeat bytes intact). We currently don't know how to enlarge a maze without messing it up. You can't really rearrange the mazes a lot, because of the limited space (due to compression). After hacking a maze, sometimes ghosts will be able to move through a wall that the Mrs. can't. Not sure why this happens. If you discover anything important that we left out, please tell us. =) Contact us ---------- BMF54123 -------- -bmf54123@mail.com -http://www.icehouse.net/flory Scoutboy -------- -magick_ink@mail.com -http://www.icehouse.net/triplett END --- Keep on munchin'! < . . . . .