Under the microscope: Lupin the 3rd: Sage of the Pyramid

In this edition:

  • Lupin the 3rd: Sage of the Pyramid, the 1998 game based on the Lupin III manga / anime has some bonus elements that can be unlocked if you clear the game.
  • I found a cheat code that makes these elements accessible from the get-go. It unlocks Survival Mode, the Hyper difficulty setting, and extra character skins.
  • In addition, I found an absurdly elaborate code that lets you play as the Princess of Twilight – a character that I don’t think was known to be playable!

Details on how the codes work are below…


Unlock almost everything

At the title screen, enter this sequence:

X, B, Z, A,
Right+Z, X, Y, Z,
Y, B, A, Right+Z

You’ll hear a sound effect if you got it right. Press Start to access the main menu. Press Down twice to reveal the now-unlocked Survival Mode:

Survival mode on the main menu

This code also unlocks the Hyper difficulty level. Select Option to reveal it:

Game level: Hyper

You’ll also have unlocked additional Lupin Color options. Some of these are alternate costumes for Lupin:

The “Part I” outfit

Others allow you to play as the other characters:

Left: Playing as Fujiko. Right: Playing as Jigen.

And some allow you to play as a colored shadow:

Playing as the yellow shadow

Unlock the Princess of Twilight

After entering the title screen code above, select Option from the main menu. Adjust the settings to match these:

  • Sound: Monaural
  • Camera: Type 2
  • Pad: Type 3
  • HP Display: Off
  • Lupin Color: Part III
  • Radar color: Red=2, Green=5, Blue=6
  • Back color: Red=5, Green=1, Blue=2
The cheat settings

Now highlight Back Color. Hold down L+R+Start. Keep them held and enter this sequence:

X, Y, Z, X, Y, Z,
X, Y, Z, X, Y, Z,
B, A, B, A, Z, Y,
X, Z, Y, X, X, B,
Z, A, Z, X, Y, Z,
Y, B, A, Z

You’ll hear a sound effect if you entered the first 6 buttons correctly and another effect at the end of the next 28.

Your reward is an additional Lupin Color: number 10.

Another outfit unlocked

This turns Lupin into the the Princess of Twilight, the ethereal woman who appears in the game’s cutscenes.

Playing as the Princess of Twilight

This ad for the game explains her role in the story:

Japanese: ピラミッド内にときどき幻の姿であらわれ、ルパンをピラミッドの奥へと導く謎の少女。

English: A mysterious woman who appears inside the pyramid, leading Lupin into its depths.

The fact that this character is playable doesn’t seem to have been documented previously – possibly because putting in her cheat code is so arduous. Leave a comment if you can find prior attestation!

The Princess of Twilight in one of the animated cutscenes

The reverse engineering

This game processes controller input by reading from an array of 16-bit values, each associated with a particular button. When the title screen is being displayed, the function at 060111a8 is listening for the Unlock almost everything code. The important part of its logic looks like this pseudo-Python (adapted from Ghidra’s decompilation):

if (
  (p1_pressed_x_060ad810 and (cheat_counter == 0)) or 
  (p1_pressed_b_060ad80c and (cheat_counter == 1)) or 
  (p1_pressed_z_060ad814 and (cheat_counter == 2)) or 
  (p1_pressed_a_060ad80a and (cheat_counter == 3)) or 
  ((p1_held_right_060ad828 and p1_held_z_060ad836) and (cheat_counter == 4)) or
  (p1_pressed_x_060ad810 and (cheat_counter == 5)) or
  (p1_pressed_y_060ad812 and (cheat_counter == 6)) or
  (p1_pressed_z_060ad814 and (cheat_counter == 7)) or
  (p1_pressed_y_060ad812 and (cheat_counter == 8)) or
  (p1_pressed_b_060ad80c and (cheat_counter == 9)) or 
  (p1_pressed_a_060ad80a and (cheat_counter == 10)) or 
  ((p1_held_right_060ad828 and p1_held_z_060ad836) and (cheat_counter == 11))
):
    if counter == 11:
        title_cheat_effect_01_060a9058 = 1200
        title_cheat_effect_02_2020001c = 1
        title_cheat_effect_03_202000ac = 1

With the variable labels added, you can read out the cheat sequence easily.

The Option screen’s input handling function lives at 06015710. It’s got button sequence tracking code, too. But that doesn’t get executed unless the right settings are configured:

if (
    (options_stereo_0603e50c == 0) and 
    (options_camera_0603e519 == 1) and
    (options_pad_0603e51a == 3) and
    (options_show_hp_0603e51b == 1) and
    (options_color_0603e517 == 2) and 
    (options_radar_red_0603e510 == 2) and
    (options_radar_green_0603e511 == 5) and
    (options_radar_blue_0603e512 == 6) and
    (options_back_red_0603e514 == 5) and 
    (options_back_green_0603e515 == 1) and 
    (options_back_blue_0603e516 == 2)
):
    # Check the button presses
    ...

Interestingly, the Princess of Twilight code is split into two phases. The first six button presses are tracked separately from the last 28 – this is why you hear multiple confirmation sound effects when you’re entering the code.


Outro

Many thanks to Jared for help with tracking down information about the Princess of Twilight character. She seems to be a one-off character made exclusively for this game. This page calls her Noah, for what it’s worth.

Another Saturn game goes under the microscope next week! If you like retro game reverse engineering, check out my blog at Substack.

About the author

Bo Bayles

Rings of Saturn: 32bits.substack.com

Be the first to comment

Leave a comment

Your email address will not be published.


*