Skip to Content
The Alchemy Project

Debug Mode

Retail cartridges of Golden Sun: The Lost Age still contain Camelot's built-in developer toolkit behind a single global flag, along with four hidden boot starts and twelve test rooms across five scene overlays.

How DebugMode is gated

Inside syInit() in games/tla/src/system/system_start_up.c, boot code clears one global byte before the main routine starts:

DebugMode = 0;

No normal gameplay path ever sets DebugMode to a non-zero value; only an unreachable sprite viewer writes to it. When DebugMode is non-zero in memory, the retail cartridge activates Camelot's developer hooks across the field engine, the battle engine, the main routine, and the sound driver:

  • 325-scene selector (Start + B on the field): Lists all 325 scenes by internal code (DELY00, WORLD, SHOPTEST, YAMTEST2) and entrance ID (mnDebugSceneSelectRun in window/).
  • 4,096-flag editor (Select + B on the field): Inspects and toggles every bit in GameFlags (mnDebugFlagEditorRun in window/).
  • Live palette editor (Start + L on the field): Edits GBA hardware palettes directly (fdPaletteEditorRun in field/).
  • Movement, boot, and battle tools: Walk-through-walls (L), single-tick freeze and step (Start + Select via DebugPaused), four hidden gmMainRoutineRun boot starts, battle instant victory, an enemy status inspector, a sound test, and 12 test rooms.

Code reference