commodore 64 · pal and ntsc · 1 mb reu · v1.0.1
Mappy
The Commodore 64 port of the 1983 Namco arcade game: sixteen houses, the trampolines, the microwave doors, the cats and Goro, with the house scrolling smoothly at 60 frames per second. Below, a video and an article explain why it needs a REU, how the game was shrunk to fit and which problems were solved.

the title screen, captured in VICE
The video
About five minutes, with charts and gameplay captured frame by frame. Video in Italian: versione italiana.
Two very different machines
The Mappy arcade board has two Motorola 6809 processors at 1.5 MHz, one for the game and one for the sound. Program and graphics take 52 KB of read-only memory; the screen is vertical, 224 × 288 pixels, and the sound chip has eight voices.
The Commodore 64 has one processor, a 6510 at about 1 MHz, and 64 KB of memory in total: the program, the data, the graphics and the screen itself must all fit in there. It has 16 colours, 8 sprites and the SID chip with three voices.
64 KB are not enough
To scroll the house without stutter the game needs two graphic screens: while one is shown, the other is being prepared, and when it is ready they swap. That is the only way to reach 60 frames per second without ever showing a half-drawn picture. The two screens, with their colours and sprites, take about 22 KB. The program that always stays in memory takes about 30, the system and the chips' registers another 4.
Only a few kilobytes are left. Still outside: the sixteen houses, the music, the title and high-score screens, the bonus round and the full image of the house used for scrolling. More than 200 KB.
The REU: a storeroom and a copier
The REU (RAM Expansion Unit) is an extra memory cartridge made by Commodore. Mappy uses it in two ways.
As a storeroom. It holds about 250 KB of data and pieces of program, spread over sixteen banks of 64 KB: that is why a 1 MB REU is needed, even though it is not filled. On the disk this data travels compressed: about 165 KB that become less than 30.
As a copier. The REU has a circuit that moves memory by itself, one byte per clock cycle: about ten times faster than the processor. The whole house is drawn inside the REU, and when the screen scrolls the new rows arrive ready, instead of being redrawn piece by piece.
The program is split into pieces too. Title and high scores, bonus round, level set-up, the house's enemies and doors take turns in the same memory area, and come in from the REU in a fraction of a second when needed.
Shrinking to fit
- The screen. The arcade is vertical, the C64 is wide and short: every floor of the house went from 32 to 24 pixels high, and the house scrolls sideways as in the original.
- The colours. The C64 has 16 fixed colours and, in the mode used for the house, only four in each 4 × 8 pixel block. Many objects, from the radio to the safe, were redrawn by hand within these limits.
- The music. Written for eight voices, it was rearranged for the SID's three.
Why sprites blink
Sprites are the moving characters, and the C64's video chip handles eight of them. It draws the screen line by line, from top to bottom, and on each line it can show at most eight sprites. In Mappy two are taken by the hero, who is made of two overlapping sprites; six are left for everyone else.
To get more characters on screen the program reuses the same sprites: as soon as the beam has finished drawing a character near the top, its sprite is moved lower down, ready for the next one. That way eight sprites are enough for a house full of cats, as long as they are not all at the same height.
So, most of the time, nothing blinks. Only when one band of lines holds more characters than free sprites can they not all be shown in the same frame: then the program takes turns, one frame shows some characters and the next one the others, and the extra ones blink. It happens rarely and only for a few moments, mostly in the bonus round when many balloons are at the same height; as soon as they move apart, the blinking stops. It is a hardware limit, shared by many Commodore 64 games.
A hand from artificial intelligence
The hero's first pose was made by hand, by overlaying and tracing the original graphics, to get a version that looks right in the game. At first it was made of three overlapping sprites; then it went down to two, the grey body in high resolution in front and the colours behind, because one more sprite was needed for the other characters.
The in-between poses, dozens of them, were generated by artificial intelligence, following that model: the walks, the jumps, the bounces in both directions, and also the poses of the cats and Goro, on a single sprite and with their eyes adjusted so they stay readable with the wide multicolour pixels. Drawing them all by hand would have been far too much work.
The arcade's screens were also captured with the MAME emulator, run from the command line, which can save them automatically while the game runs. Then the AI compared them with the ones captured in VICE, the Commodore emulator, to find the differences between the original and the port.
MAME was also used to capture long plays, complete games, and the arcade's autoplay. By studying them, the AI was key to mapping the enemies' behaviour: how the cats and Goro move, when they change floor, how they use the trampolines and the doors.
Seventeen thousand cycles
At 60 frames per second the processor has about 17,000 cycles per frame. The game engine, which follows the arcade's rules, uses about half of them; the rest goes to scrolling, sprite handling, interrupts and music. In the later levels, with nine cats on screen, the sums sometimes do not add up and a frame holds for an instant. On European PAL machines, which show 50 frames per second, each frame has a little more time.
True to the original
To make sure the game behaves like the arcade, the engine was checked against more than a thousand recordings of the original, made in the MAME emulator: the positions and moves of Mappy and the cats must match step by step. And every bug the testers reported was hunted down frame by frame in the VICE emulator, looking at the pictures the screen really shows: that is how even faults lasting a sixtieth of a second came to light.
What you need to play
- a Commodore 64 or 64C, PAL or NTSC: the game detects the machine by itself
- a 1 MB REU, real or emulated, for example in VICE
- the disk (.d64) or the cartridge (.crt)
- a joystick in port 2, or W A S D and the space bar
The download will be available in a few days, on this page.
Thanks to AlexNinja71 for the testing.
Free, unofficial fan port. MAPPY™ & © Bandai Namco Entertainment Inc. Not affiliated with Bandai Namco. The video's music is original, made for the video.