Falsebound Archive
4 Secrets & leftovers 4.6

A Konami code on the map

While a map is being played, the game watches controller 1 for a button sequence: Up, Up, Down, Down, Left, Right, Left, Right, B, A. When the last button is pressed, it plays one voice clip of the common sound bank and adds 573 gold. 573 reads Ko-na-mi (5 ko, 7 na, 3 mi).

Where
main.dol, map input handler map_input; sequence check hud_konami_step
Reachable in the retail game
Yes, on any map, as often as it is entered
Buttons
Up, Up, Down, Down, Left, Right, Left, Right on the D-pad, then B, A, on controller 1
Effect
Plays voice clip 33, 43 or 58 by story and adds 573 gold
Shortest entry
12 frames of input, under half a second
Final A
Also acts on whatever the pointer is on
Story Voice clip Sound id
Yugi 33 0x9021
Seto Kaiba 43 0x902B
Joey 58 0x903A

The check then starts over, so the code can be entered again for more gold, without limit. These three are the only voice clips the game plays; the 27 stored next to them are never played (see the unused voice clips, which also has the three played clips).

Entering it

The check runs only while the map is in its normal command state, with the pointer free and no menu or window open, and not on the frames while a window or the cursor is still moving. Each step wants exactly one newly pressed button and nothing else; a wrong button starts it over. A second Up or Down needs a frame with the button released before it, so the shortest entry takes 12 frames of input, a little under half a second at the game’s 30 frames a second.

The last A is not taken away from the map: on the same frame it also does what A does on whatever the pointer is over, so on a base it opens the base menu. Entered with the pointer on empty ground, it only adds the gold. The gold is a signed 32-bit number, so it would take some 3.7 million entries to overflow it.

Evidence

The map’s input handler (map_input), in map mode 0 and phase 0, calls hud_konami_step, a ten-step check of newly pressed buttons on controller 1 with the masks for D-pad Up, Up, Down, Down, Left, Right, Left, Right, B and A. It looks only at the four D-pad directions and A, B, X, Y, Z, L, R and START; the sticks are ignored, so moving a stick does not break a sequence. When it reports the full sequence, the update plays sound 0x9021, 0x902B or 0x903A by the current story, adds 0x23D (573) to the gold and resets the sequence. It does not end the input handling for that frame, so the A goes on to the pointer’s usual action. The whole input handler is skipped while its input guard is set (while a cursor or window is moving). No other code, script or cue names these three sounds.