Under the Microscope: Heir of Zendor

If you put the disc for the Saturn game Heir of Zendor into your PC’s CD-ROM drive, you’ll see a file called 99README.TXT. It contains messages from the game’s development staff, including one from “AZY” — the main planner and programmer.

Source: Sega Retro

Translated, this says something like:

Finally, here is a cheat code for the last game, GOTHA (the code for GOTHA 2 is slightly different).

  1. First, complete three playthroughs to produce a 100% complete save.
  2. From the title menu, select “Continue” and load your 100% save.
  3. When the “Yes/No” confirmation prompt appears, hover the cursor over “Yes.”
  4. Hold down A + Z + Y, then press the C button. (This is the “AZY Code.”)
  5. Keep them held down for three seconds, then let go. (Don’t drop the controller!)

(English version via Google Translate)

Indeed, this works — if you follow those steps in the first game, you get a debug menu.

But AZY’s message also alludes to a code for Gotha 2, a.k.a. Heir of Zendor. What is it? Let’s check the game data to find out.


Accessing cheat mode

The function at 060383dc handles input for the main menu screen. When you select Start New Game, the function returns and execution resumes in the game’s outermost loop.

The main menu screen

That outermost loop has a section that looks like this in Ghidra’s decompiler — I’ve added some labels.

    selected_item = title_menu_handler_060383dc(title_arg_1);
    if (selected_item == 2) {
      init_new_game_06012920();
    }
    if ((unknown_cause_06080770 == 0xfbcf) || (unknown_cause_06080770 == 0xf9cf)) {
      unknown_effect_0608a06a = 1;
    }

What is this code checking? A look in Mednafen’s memory debugger holds the answer — the address at 06080770 changes when controller buttons are held down. By default, its value is 0xffff.

Mednafen’s debugger interface. The highlighted address changes with controller input.

Each controller button clears a different bit on that value. To produce 0xfbcf, we need to AND it with A (0x400), Z (0x10), and Y (0x20). For 0xf9cf, the C (0x200) needs to be included.

Hmm, another AZY code? Let’s try it. The procedure is:

  • On the main menu, highlight Start New Game.
  • Hold down A+Z+Y and then add in C.
  • Keep the four buttons held down while the main menu disappears.

If you got it right, you’ll be presented with a black screen with a 1 in the top-right corner. Pressing A and C changes the value (the range is 1 through 51).

The cheat screen

This is a stage select interface. Adjust the number to your liking and press Start to begin playing the corresponding stage.

When the AZY code is enabled, you’ll have a full set of ships to choose from by default — it unlocks all of them.

Left: The default ship selection screen. Right: The cheat-enhanced ship selection screen.

AZY was right — the code for the second game is only slightly different. It doesn’t have as many effects — it only enables a stage select and some cheats, rather than a multi-featured debug menu. But it is easier to use, since you don’t need to clear the game before entering it.


Outro

Many thanks for reading. I’ll be back with another exploration of a Saturn game next week. While you wait, why not check out my blog for more retro game reverse engineering articles?


Discover more from SEGA SATURN, SHIRO!

Subscribe to get the latest posts sent to your email.

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.


*