This repository holds the commented disassembly of Konami's Circus Charlie for the MSX (RC-712, 1984). It does not hold the cartridge: the ROM image is not distributed.
pasmo — the assembler that rebuilds the ROMz80dasm — the disassembler that generates the listingpython3 — the tools in tools/makecircus.romIt is exactly 16,384 bytes and its fingerprint is:
sha256 89e1badac10e65886590d55e735ed794e5ca3c41142e6637b3e7ac6b25d042c0
To check it:
make comprueba
| command | what it does | what it proves |
|---|---|---|
make listado |
traces the flow and generates src/circus.asm with the notes |
that the listing comes from the cartridge and src/circus.notes, not hand edits |
make verify |
reassembles with pasmo and compares |
that the listing IS the ROM, byte for byte |
make sanity |
splits the 16,384 bytes into code and data | that not one byte is left unassigned |
make test |
49 tests | that the numbers on this site are the listing's |
make imagenes |
draws everything in docs/imagenes/ from the ROM |
that the formats are read right |
make coteja_montaje / make coteja_arranque / make coteja_pista |
compare against openMSX dumps | zero bytes different |
All three comparisons need the emulator dumps first: tools/omsx_montaje.tcl
and tools/omsx_arranque.tcl (the ring one uses the same dumps as the start),
each with its usage line in the header. See
In the emulator.
16 KB in page 1 (0x4000-0x7FFF), an AB header with INIT at 0x407B and no
BASIC. The screen is SCREEN 2.
The game's whole RAM is 1 KB: 0xE000-0xE3FF, cleared by INIT with the
ldir over itself. The stack sits at 0xE500.
| area | what is there |
|---|---|
0xE000 |
the current scene |
0xE003 |
the frame counter |
0xE005 |
the interrupt re-entry lock |
0xE052 |
the act type, 0 to 4 |
0xE0B0 |
the buffer for the 32 sprites, copied whole to 0x3B00 every frame |
0xE130 |
the player: position, position and pose |
0xE150 / 0xE170 / 0xE1B0 |
the moving objects, the pick-ups and the loose one |
0xE280 |
the second decompressor's buffer |
It uses seven routines: RDVDP, SETRD, SETWRT, WRTVDP, WRTPSG, RDPSG and SNSMAT.
And it reads two bytes of its table, (0x0006) and (0x0007), which are the
VDP ports.
They are not the same one: the company screen (the KONAMI logo and "- VIDEO CARTRIDGE -") and the title screen. They share their scenery byte for byte; only the name table changes. Both are drawn from the ROM and checked down to zero bytes.


INIT sets mode 1, hooks H.KEYI (0xFD9A) with a jp 0x402C, clears the RAM
and then sits forever on the jr $ at 0x40A9. Everything else happens in the
hook, once per frame: sound first, then the controls, then the scene. The lock
at 0xE005 counts overlapping interrupts: if a frame runs long, the next one
is served on the way out, without going back through the stack.
calldespacha_por_tabla (0x404E) takes its own return address with pop hl,
and that is where the table starts. That is how the scenes are dispatched, and
the five set-ups (0x5FEF), the five starts (0x60B6) and the five frames
(0x4C93).
Rewritten in Python in tools/:
rle.py, the decompressor at 0x45C9: 0nnnnnnn b repeats and
1nnnnnnn b… copies; 0x80 changes the destination and 0x00 ends. A
second decompressor with the same language writes to RAM (0x6A51 →
0xE280), and a third one (0x7567) reads the bits backwards.guiones.py, the text-script interpreter at 0x4062: [destination]
[indices…], 0xFE jumps and 0xFF ends. With the mask at 0x00, the
same script erases what it drew.escenas.py: decompresses into the buffer and copies it out through
eight-bit masks, one bit per pattern, so it can repaint half the screen
without touching the other half. 0x4647 mirrors the patterns and 0x467B
makes three copies shifted by 2, 4 and 6 pixels.tools/pista.py is the game frame routine by routine: it starts from the
state left by 0x604C and each act's start-up (0x60B6), and every frame it
moves and draws what the game moves and draws. Against 43 openMSX dumps: 0
bytes different (make coteja_pista). tools/corre_circus.py, which runs
the cartridge on the Z80 in tools/z80run.py, stays as a second check (make
coteja_arranque), not as the source of the pictures.
With openMSX and the Philips_VG_8020 machine:
openmsx -machine Philips_VG_8020 -cart circus.rom -script tools/omsx_montaje.tcl
There are three scripts:
omsx_montaje.tcl dumps the VRAM at 0x4C3C, with the scenery just built.
It forces the type at 0x4C39 before the first set-up, because forcing
it later leaves remains of the previous act behind.omsx_arranque.tcl carries on and dumps VRAM and RAM at frames 1 to 200,
with a breakpoint at 0x4CA9, the sprite copy.omsx_cuadro.tcl, the burst of frames around a picture, because
screenshot does not give the frame at the instant the VRAM was read.The whole game happens in the hook at 0x402C: a breakpoint there stops once
per frame.
This disassembly has been compared, instruction by instruction, with
every other Konami one in the series. A block counts when the same
instructions, at least six of them from a label to its ret or its
unconditional jump, are in both cartridges; the addresses are left
aside, because they change from one cartridge to the next. Of the
other 57, 46 have at least one block in common with this one;
these are the ones that share the most:
| Cartridge | Blocks | Instructions | For example (here = there) |
|---|---|---|---|
| Magical Tree | 41 | 565 | atiende_el_menu (0x477D) |
| Comic Bakery | 27 | 392 | atiende_el_menu (0x477D) |
| Cabbage Patch Kids | 23 | 255 | lee_el_teclado (0x4758) = LEE_EL_TECLADO |
| Hyper Sports 1 | 21 | 276 | atiende_el_menu (0x477D) = MANEJADOR_DEMO |
| Konami’s Mahjong Dojo | 19 | 183 | limpia_la_pantalla (0x4558) = limpia_la_pantalla_entera |
| Super Cobra | 18 | 242 | mira_la_vida_extra (0x4416) = MIRA_VIDA_EXTRA |
| Athletic Land | 10 | 87 | copia_vram_a_vram (0x458F) = COPIA_VRAM_A_VRAM |
| Konami's Ping Pong | 8 | 102 | lee_el_teclado (0x4758) = lee_teclado_1 |
| Yie Ar Kung-Fu | 8 | 120 | lee_el_teclado (0x4758) |
| Konami’s Billiards | 7 | 67 | pinta_rotulo (0x4066) = pinta_lista_formato_a |
The whole matrix, the 58 cartridges against each other, is on The routines in the series database, along with the method and the program that measures it.