Enums provide named integer constants for virtually every game state tracked by Paper Mario. Rather than scattering magic numbers throughout the codebase, the decomp uses a small number of large enums — most notablyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pmret/papermario/llms.txt
Use this file to discover all available pages before exploring further.
StoryProgress, GameFlags, and GameBytes — so that every value has a human-readable name you can search for. The primary enum file is include/enums.h, which is included by include/common_structs.h and therefore transitively available everywhere.
Where enums are defined
| File | Contents |
|---|---|
include/enums.h | StoryProgress and the majority of gameplay enums |
include/saved_flag_names.h | GameFlags enum (one bit per game event) |
include/saved_byte_names.h | GameBytes enum (one byte per tracked value) |
include/evt.h | EVT opcode enum, EventGroupFlags, EventCommandResults |
assets/effects.yaml | Effect IDs (generated into C at build time) |
StoryProgress
StoryProgress is a signed integer enum stored in GB_StoryProgress (global byte 0x000). It encodes the linear chapter checkpoint that the game uses to determine which scripted events have already occurred. Values run from STORY_INTRO (-128) up through the final chapter.
STORY_CH<chapter>_<event>. Prologue events use CH0, and the eight main chapters use CH1 through CH8. A few values are labelled STORY_UNUSED_<hex> where the original code reserved a slot but never used it.
Key chapter checkpoints
Key chapter checkpoints
| Value | Constant | Meaning |
|---|---|---|
-128 | STORY_INTRO | Title-screen / intro state |
-127 | STORY_CH0_WAKE_UP | Mario wakes up at start of game |
-115 | STORY_CH0_GOOMBARIO_JOINED_PARTY | Goombario joins |
-112 | STORY_CH0_DEFEATED_GOOMBA_KING | Goomba King defeated |
-109 | STORY_CH0_OPENED_BRIDGE_TO_TOAD_TOWN | Bridge to Toad Town unlocked |
-78 | STORY_CH1_DEFEATED_KOOPA_BROS | Koopa Bros. defeated |
-77 | STORY_CH1_STAR_SPIRIT_RESCUED | Eldstar rescued |
-56 | STORY_CH2_DEFEATED_TUTANKOOPA | Tutankoopa defeated |
-55 | STORY_CH2_STAR_SPIRIT_RESCUED | Mamar rescued |
-16 | STORY_CH3_DEFEATED_TUBBA_BLUBBA | Tubba Blubba defeated |
-15 | STORY_CH3_STAR_SPIRIT_RESCUED | Skolar rescued |
4 | STORY_CH4_DEFEATED_GENERAL_GUY | General Guy defeated |
5 | STORY_CH4_STAR_SPIRIT_RESCUED | Muskular rescued |
35 | STORY_CH5_DEFEATED_LAVA_PIRANHA | Lava Piranha defeated |
56 | STORY_CH6_DEFEATED_HUFF_N_PUFF | Huff N. Puff defeated |
57 | STORY_CH6_STAR_SPIRIT_RESCUED | Klevar rescued |
GameFlags enum
GameFlags is defined in include/saved_flag_names.h and contains one entry per boolean event flag saved to the save file. Each entry wraps an index with the GameFlag() macro so that the resulting integer value encodes the EVT variable encoding directly.
Naming convention
Flag names follow the patternGF_<area>_<description>:
GF_— prefix identifying a global game flag.<area>— the four-letter map area code where the flag is relevant (e.g.KMRfor Koopa Meadows,TRDfor Koopa Fortress,KKJfor Bowser’s Castle). Global events without an area use prefixes likeEVTorNPC.<description>— a PascalCase description of the event, e.g.Met_Goombario,Defeated_KoopaBros, orItem_ShootingStar.
GF_Unused_<area>_<hex> were allocated in the original game but never written to.
GameBytes enum
GameBytes is defined in include/saved_byte_names.h. Unlike flags, each entry stores a full byte (0–255) and is accessed with GameByte(). Bytes are used for counters, multi-state values, and anything that needs more than two states.
Notable bytes
| Constant | Index | Description |
|---|---|---|
GB_StoryProgress | 0x000 | Current story checkpoint (maps to StoryProgress values) |
GB_MAC00_DojoRank | 0x01C | Player’s rank at the Toad Town Dojo |
GB_KKJ_LastPartner | 0x04E | Mario’s last active partner, stored across Peach missions |
GB_IWA00_Whacka_HitCount | 0x07B | Number of times Whacka has been struck |
GB_CompletedQuizzes | 0x160 | Count of completed Chuck Quizmo quizzes |
GB_FinalBowserHP | 0x18A | Bowser’s HP carried between Phase 1 and Phase 2 |
Finding enum values
Useripgrep or your editor’s symbol search to look up any constant:
include/enums.h is over 6,000 lines long, searching by name is more practical than scrolling. The saved_flag_names.h and saved_byte_names.h files are smaller and can be browsed directly for save-file state.
