Ocarina of Time
Player States
State flags
Data primarily compiled by Exodus
Link's actor code keeps track of 72 flags which are referred to as "state flags"; for the most part, these flags represent various states in which Link can be (such as climbing a ledge or being underwater). These flags are, by convention, divided into three sets (stateFlags1 and stateFlags2, which are both 4 bytes / 32 bits, and stateFlags3 which only has 8 bits), although there is no apparent order or logic to the flags. There is a spreadsheet by Exodus documenting the state flags here. The table shows the addresses for the original NTSC versions, but on any version they are located at Link + 0x66C, Link + 0x670, and Link + 0x682 respectively.
| Addresses | NTSC 1.0 | NTSC 1.1 | NTSC 1.2 |
|---|---|---|---|
| stateFlags1 | 801DB09C | 801DB25C | 801DB95C |
| stateFlags2 | 801DB0A0 | 801DB260 | 801DB960 |
| stateFlags3 | 801DB0B2 | 801DB272 | 801DB972 |
Several glitches in Ocarina of Time work by preserving a state flag after it is supposed to be unset or by unsetting a state flag when it is supposed to be set. These are called here Player State Glitches, specific articles on which can be found on this site. The remainder of this page will document the player state flags.
stateFlags1
| index | decomp name | description |
|---|---|---|
| 0 | PLAYER_STATE1_0 | 0x1 = Loading a new area |
| 1 | PLAYER_STATE1_SWINGING_BOTTLE | 0x2 = Swinging Bottle |
| 2 | PLAYER_STATE1_2 | 0x4 = Reached Hookshot target |
| 3 | PLAYER_STATE1_3 | 0x8 = First Person Item in Hand |
| 4 | PLAYER_STATE1_HOSTILE_LOCK_ON | 0x10 = Z-Targeting an Enemy |
| 5 | PLAYER_STATE1_5 | 0x20 = Disable inputs player actor is seeing, can still pause (only used during Bongo Bongo intro cutscene) |
| 6 | PLAYER_STATE1_TALKING | 0x40 = Talking/ checking/ showing item with text box |
| 7 | PLAYER_STATE1_DEAD | 0x80 = Death (Zombie Walking, ignore loading zone in MM) |
| 8 | PLAYER_STATE1_START_CHANGING_HELD_ITEM | 0x100 = Putting Away Item |
| 9 | PLAYER_STATE1_9 | 0x200 = First Person Item Loaded |
| 10 | PLAYER_STATE1_10 | 0x400 = Receiving Item / Get Item Manipulation |
| 11 | PLAYER_STATE1_CARRYING_ACTOR | 0x800 = Holding something over your head / Ground Jump |
| 12 | PLAYER_STATE1_CHARGING_SPIN_ATTACK | 0x1000 = Charging Sword |
| 13 | PLAYER_STATE1_13 | 0x2000 = Hanging from a ledge / Ledge Cancel (with Down on A) |
| 14 | PLAYER_STATE1_14 | 0x4000 = Climbing to higher ground (or out of water) / Ledge Cancel |
| 15 | PLAYER_STATE1_Z_TARGETING | 0x8000 = Z-Targeting |
| 16 | PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS | 0x10000 = Z-Targeting something (or checking/ speaking to it) |
| 17 | PLAYER_STATE1_PARALLEL | 0x20000 = Z-Targeting |
| 18 | PLAYER_STATE1_18 | 0x40000 = Jumping/Hopping |
| 19 | PLAYER_STATE1_19 | 0x80000 = Fell off a ledge without jumping? |
| 20 | PLAYER_STATE1_20 | 0x100000 = First person view (C-up) / Return A |
| 21 | PLAYER_STATE1_21 | 0x200000 = Climbing a ladder or vines / Down A |
| 22 | PLAYER_STATE1_SHIELDING | 0x400000 = Shielding |
| 23 | PLAYER_STATE1_23 | 0x800000 = Riding Epona |
| 24 | PLAYER_STATE1_USING_BOOMERANG | 0x1000000 = Boomerang in hand |
| 25 | PLAYER_STATE1_BOOMERANG_THROWN | 0x2000000 = Threw Boomerang (Fixed Camera) |
| 26 | PLAYER_STATE1_26 | 0x4000000 = Blinking Red (took damage) |
| 27 | PLAYER_STATE1_27 | 0x8000000 = Swimming |
| 28 | PLAYER_STATE1_28 | 0x10000000 = Using Cutscene Item (beans, trade item, ocarina, bottle, etc.) |
| 29 | PLAYER_STATE1_29 | 0x20000000 = Freeze all Actors (including Link) / (Unset this when a text box is on screen to cause "Walking While Talking" or crawlspace GID or fairy revival GID) |
| 30 | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE | 0x40000000 = unknown (messes up z-targeting when locked) |
| 31 | PLAYER_STATE1_31 | 0x80000000 = Entering grotto (disable ground collision) |
stateFlags2
| index | decomp name | description |
|---|---|---|
| 0 | PLAYER_STATE2_0 | 0x1 = Grab on A (for grabbing a pushable object) |
| 1 | PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER | 0x2 = Speak/Check on A |
| 2 | PLAYER_STATE2_2 | 0x4 = Climb on A (for climbing a block that you can also grab) |
| 3 | PLAYER_STATE2_3 | 0x8 = Set on various actions (running around, pulling items/masks, pulling/slashing sword) to decrement Link's burning timers |
| 4 | PLAYER_STATE2_4 | 0x10 = Pushing/pulling a block |
| 5 | PLAYER_STATE2_5 | 0x20 = Almost everything that moves you |
| 6 | PLAYER_STATE2_6 | 0x40 = Hanging from Ledge / Climbing from hanging from ledge / Crawling in crawlspace / Leaving Crawlspace / Climbing Ladder / Climbing off ladder / Riding Epona / Dismounting Epona / grabbing something, etc |
| 7 | PLAYER_STATE2_7 | 0x80 = Grabbed by Enemy (Like Like, Redead, Gibdo, Moblin, etc.) |
| 8 | PLAYER_STATE2_8 | 0x100 = Holding a pushable block |
| 9 | PLAYER_STATE2_FORCE_SAND_FLOOR_SOUND | 0x200 = force sand floor sound |
| 10 | PLAYER_STATE2_10 | 0x400 = Underwater / Get Item Delay |
| 11 | PLAYER_STATE2_11 | 0x800 = Dive Meter on A |
| 12 | PLAYER_STATE2_12 | 0x1000 = Grabbing ladder/vines but not moving |
| 13 | PLAYER_STATE2_LOCK_ON_WITH_SWITCH | 0x2000 = Switch Targeting something |
| 14 | PLAYER_STATE2_14 | 0x4000 = Frozen in Ice |
| 15 | PLAYER_STATE2_15 | 0x8000 = Completely freezes Link |
| 16 | PLAYER_STATE2_DO_ACTION_ENTER | 0x10000 = Enter on A (for crawlspaces) |
| 17 | PLAYER_STATE2_17 | 0x20000 = Spin Attacking |
| 18 | PLAYER_STATE2_CRAWLING | 0x40000 = In crawlspace / Blank A |
| 19 | PLAYER_STATE2_19 | 0x80000 = Sidehopping / Backflipping |
| 20 | PLAYER_STATE2_NAVI_ACTIVE | 0x100000 = Navi is flying around |
| 21 | PLAYER_STATE2_21 | 0x200000 = Navi is flashing on c-up |
| 22 | PLAYER_STATE2_22 | 0x400000 = Down on A (while on Epona) |
| 23 | PLAYER_STATE2_23 | 0x800000 = Green Navi |
| 24 | PLAYER_STATE2_24 | 0x1000000 = Set when you pull ocarina in special places (lullaby spots, gossip stone, river frogs, etc.) |
| 25 | PLAYER_STATE2_25 | 0x2000000 = Ocarina play spot music staff activated / Walking around with music staff (from timestop) |
| 26 | PLAYER_STATE2_26 | 0x4000000 = Draw Link's reflection (used in Dark Link's room) |
| 27 | PLAYER_STATE2_USING_OCARINA | 0x8000000 = Playing Ocarina (Freezes all actors except Link) |
| 28 | PLAYER_STATE2_IDLE_FIDGET | 0x10000000 = Idle Animation |
| 29 | PLAYER_STATE2_29 | 0x20000000 = Invisible (might be related to the invisibility glitches) |
| 30 | PLAYER_STATE2_30 | 0x40000000 = Lunge (storage) |
| 31 | PLAYER_STATE2_31 | 0x80000000 = Voiding out / Crushed |
stateFlags3
| index | decomp name | description |
|---|---|---|
| 0 | PLAYER_STATE3_0 | 0x1 = Link ignores floor, water, and ceiling collision (used for dark link falling through the floor when damage is dealt) |
| 1 | PLAYER_STATE3_1 | 0x2 = used for collision detection and correction. set by start of jumpslash, aerial damage, and some cutscene command |
| 2 | PLAYER_STATE3_2 | 0x4 = Dark Link jumping on Link's sword? (UNSET BY PLAYER, used for dark link?) |
| 3 | PLAYER_STATE3_3 | 0x8 = Set when you slash sword, but have not moved since |
| 4 | PLAYER_STATE3_4 | 0x10 = some collision flag thing (UNUSED???) |
| 5 | PLAYER_STATE3_5 | 0x20 = will pull ocarina for memory game |
| 6 | PLAYER_STATE3_RESTORE_NAYRUS_LOVE | 0x40 = Set by ocarina effects actors when destroyed to signal Nayru's Love may be restored |
| 7 | PLAYER_STATE3_FLYING_WITH_HOOKSHOT | 0x80 = Flying in the air with the hookshot as it pulls Player toward its destination |
