SMBX Player Offsets

From PGE Wiki
Jump to: navigation, search

This is the memory map for the player struct. This struct is not fully analysed. Any help is appreciated! Please note that the data may not be fully 100% accurate.

PC Memory (0x184 bytes)
Name Memory address Memory type Description
SMBX PC+0x00 PC+0x00 FIELD_BOOL Toad doublejump ready (FFFF true)
SMBX PC+0x02 PC+0x02 FIELD_WORD Star sparkling effect on player
SMBX PC+0x04 PC+0x04 FIELD_WORD Horizontal and ducking disabled (?)
SMBX PC+0x06 PC+0x06 FIELD_BOOL Ducking enabled?
SMBX PC+0x08 PC+0x08 FIELD_WORD # of bomb Link has in his inventory
SMBX PC+0x0A PC+0x0A FIELD_BOOL Is on slippery ground
Link Content Below N/A N/A N/A
SMBX PC+0x0C PC+0x0C FIELD_BOOL Is a fairy
SMBX PC+0x0E PC+0x0E FIELD_BOOL Fairy already used this jump
SMBX PC+0x10 PC+0x10 FIELD_WORD Frames until fairy runs out
SMBX PC+0x12 PC+0x12 FIELD_BOOL Link has a key
SMBX PC+0x14 PC+0x14 FIELD_WORD Link slash cooldown timer
SMBX PC+0x16 PC+0x16 FIELD_WORD # of hearts (all characters)
Peach Content Below N/A N/A N/A
SMBX PC+0x18 PC+0x18 FIELD_BOOL Princess hover is available
SMBX PC+0x1A PC+0x1A FIELD_BOOL Holding jump button
SMBX PC+0x1C PC+0x1C FIELD_WORD Princess hover timer
SMBX PC+0x1E PC+0x1E FIELD_WORD Unused (not cleared on level load)
SMBX PC+0x20 PC+0x20 FIELD_FLOAT Princess hover Y tremble speed
SMBX PC+0x24 PC+0x24 FIELD_WORD Princess hover Y tremble direction
Misc Content Below N/A N/A N/A
SMBX PC+0x26 PC+0x26 FIELD_WORD Ground item pull-up timer
SMBX PC+0x28 PC+0x28 FIELD_FLOAT Ground item pull-up momentum save
SMBX PC+0x2A PC+0x2A FIELD_WORD Unused (not cleared on level load)
Climbing Content Below N/A N/A N/A
SMBX PC+0x2C PC+0x2C FIELD_DFLOAT Index of NPC currently climbed on (-1 if climbing on a net bgo)
Water Content Below N/A N/A N/A
SMBX PC+0x34 PC+0x34 FIELD_WORD 2 when in water or quicksand; can be used to force the player into an underwater state
SMBX PC+0x36 PC+0x36 FIELD_BOOL Is underwater
SMBX PC+0x38 PC+0x38 FIELD_WORD Water stroke timer (can't stroke again until 0)
Misc Content Below N/A N/A N/A
SMBX PC+0x3A PC+0x3A FIELD_WORD Unknown hover timer
SMBX PC+0x3C PC+0x3C FIELD_BOOL Is sliding
SMBX PC+0x3E PC+0x3E FIELD_BOOL Is generating sliding smoke puffs
SMBX PC+0x40 PC+0x40 FIELD_WORD Climbing state (3 climbing, 2 pushed up against edge of climbable area)
SMBX PC+0x42 PC+0x42 FIELD_WORD Unknown timer42
SMBX PC+0x44 PC+0x44 FIELD_BOOL Flag for riding a rainbow shell
SMBX PC+0x46 PC+0x46 FIELD_WORD Unknown46 (powerup pickup related)
SMBX PC+0x48 PC+0x48 FIELD_WORD Slope modifier
Tanooki Suit Content Below N/A N/A N/A
SMBX PC+0x4A PC+0x4A FIELD_BOOL Tanooki suit statue flag
SMBX PC+0x4C PC+0x4C FIELD_WORD Statue transform cooldown frame timer
SMBX PC+0x4E PC+0x4E FIELD_WORD Frames spent as statue
Spin jump Content Below N/A N/A N/A
SMBX PC+0x50 PC+0x50 FIELD_BOOL Spinjump flag
SMBX PC+0x52 PC+0x52 FIELD_WORD Spinjump state counter
SMBX PC+0x54 PC+0x54 FIELD_WORD Spinjump land direction (will face this direction when landing)
State Content Below N/A N/A N/A
SMBX PC+0x56 PC+0x56 FIELD_WORD Current enemy kill combo count
SMBX PC+0x58 PC+0x58 FIELD_WORD Ground sliding smoke puffs state
SMBX PC+0x5A PC+0x5A FIELD_WORD Index/id of intersecting warp entrance
SMBX PC+0x60 PC+0x60 FIELD_BOOL Has jumped
Unknown Content Below N/A N/A N/A
SMBX PC+0x62 PC+0x62 FIELD_WORD Unknown62
Yoshi Content Below N/A N/A N/A
SMBX PC+0x64 PC+0x64 FIELD_BOOL Yoshi has earthquake(yellow shell)
SMBX PC+0x66 PC+0x66 FIELD_BOOL Yoshi has flight (blue shell)
SMBX PC+0x68 PC+0x68 FIELD_BOOL Yoshi has fire breath (red shell)
SMBX PC+0x6A PC+0x6A FIELD_WORD Unknown/Unused?
SMBX PC+0x6C PC+0x6C FIELD_WORD Unknown/Unused?
SMBX PC+0x6E PC+0x6E FIELD_WORD Yoshi Head X-Offset
SMBX PC+0x70 PC+0x70 FIELD_WORD Yoshi Head Y-Offset
SMBX PC+0x72 PC+0x72 FIELD_WORD Yoshi's head animation frame(0-4 is left, 5-9 is right)
SMBX PC+0x74 PC+0x74 FIELD_WORD Yoshi swallow timer
SMBX PC+0x76 PC+0x76 FIELD_WORD Unknown/Unused? (Seems to be a constant -4)
SMBX PC+0x78 PC+0x78 FIELD_WORD Yoshi-related offset value
SMBX PC+0x7A PC+0x7A FIELD_WORD Yoshi's body animation frame (0-6 is left, 7-13 is right)
SMBX PC+0x7C PC+0x7C FIELD_WORD Yoshi animation frame timer (rapidly increments from 0 to 31, freezes in the air, resets to 0 when pressing down; probably used to to move body and head with the animation)
SMBX PC+0x7E PC+0x7E FIELD_WORD Unknown/Unused?
SMBX PC+0x80 PC+0x80 FIELD_DFLOAT Tongue X-Position
SMBX PC+0x88 PC+0x88 FIELD_DFLOAT Tongue Y-Position
SMBX PC+0x90 PC+0x90 FIELD_DFLOAT Tongue Width
SMBX PC+0x98 PC+0x98 FIELD_DFLOAT Tongue Height
SMBX PC+0xA0 PC+0xA0 FIELD_WORD Unknown/Unused?
SMBX PC+0xA8 PC+0xA8 FIELD_WORD Unknown/Unused?
SMBX PC+0xB0 PC+0xB0 FIELD_FLOAT Tongue X-Start/End Position
SMBX PC+0xB4 PC+0xB4 FIELD_WORD Tongue X-Offset from Start/End
SMBX PC+0xB6 PC+0xB6 FIELD_BOOL Whether Tongue is retracting
SMBX PC+0xB8 PC+0xB8 FIELD_WORD Index of NPC currently on the tongue (0 if no NPC)
Unknown Content Below N/A N/A N/A
SMBX PC+0xBA PC+0xBA FIELD_WORD Unknown/Unused?
SMBX PC+0xBC PC+0xBC FIELD_WORD Unknown timer after exiting the clown car.
SMBX PC+0xBE PC+0xBE FIELD_WORD Unknown/Unused?
Position Content Below N/A N/A N/A
SMBX PC+0xC0 PC+0xC0 FIELD_DFLOAT Player X position (absolute coordinates within level)
SMBX PC+0xC8 PC+0xC8 FIELD_DFLOAT Player Y position (absolute coordinates within level)
SMBX PC+0xD0 PC+0xD0 FIELD_DFLOAT Player height or hitbox related
SMBX PC+0xD8 PC+0xD8 FIELD_DFLOAT Player width or hitbox related
SMBX PC+0xE0 PC+0xE0 FIELD_DFLOAT Player X speed
SMBX PC+0xE8 PC+0xE8 FIELD_DFLOAT Player Y speed
SMBX PC+0xF0 PC+0xF0 FIELD_WORD Player identity index (0 Nothing! Don't use, 1 Mario/Demo, 2 Luigi/Iris, 3 Peach/Princess, 4 Toad, 5 Link/Sheath)
Input Content Below N/A N/A N/A
SMBX PC+0xF2 PC+0xF2 FIELD_BOOL U key pressing
SMBX PC+0xF4 PC+0xF4 FIELD_BOOL D key pressing
SMBX PC+0xF6 PC+0xF6 FIELD_BOOL L key pressing
SMBX PC+0xF8 PC+0xF8 FIELD_BOOL R key pressing
SMBX PC+0xFA PC+0xFA FIELD_BOOL J key pressing
SMBX PC+0xFC PC+0xFC FIELD_BOOL SJ key pressing
SMBX PC+0xFE PC+0xFE FIELD_BOOL X key pressing
SMBX PC+0x100 PC+0x100 FIELD_BOOL RN key pressing
SMBX PC+0x102 PC+0x102 FIELD_BOOL SEL key pressing
SMBX PC+0x104 PC+0x104 FIELD_BOOL STR key pressing
SMBX PC+0x106 PC+0x106 FIELD_WORD Direction faced (-1 left)
Mount Content Below N/A N/A N/A
SMBX PC+0x108 PC+0x108 FIELD_WORD Mount identity (0 no mount,1 boot, 2 clowncar, 3 yoshi)
SMBX PC+0x10A PC+0x10A FIELD_WORD Mount color
SMBX PC+0x10C PC+0x10C FIELD_WORD Mount state
SMBX PC+0x10E PC+0x10E FIELD_WORD Mount sprite Y offset
SMBX PC+0x110 PC+0x110 FIELD_WORD Mount gfx index
State Content Below N/A N/A N/A
SMBX PC+0x112 PC+0x112 FIELD_WORD Current powerup
SMBX PC+0x114 PC+0x114 FIELD_WORD Current player sprite index being displayed. Chart for values
SMBX PC+0x116 PC+0x116 FIELD_WORD Unused
SMBX PC+0x118 PC+0x118 FIELD_FLOAT X momentum assumption (used when determining how to draw the sprite)
SMBX PC+0x11C PC+0x11C FIELD_WORD Current upward jumping force (2 byte integer representation)
SMBX PC+0x11E PC+0x11E FIELD_WORD Holding jump button (-1 is Can Jump. 1 is Can't Jump)
SMBX PC+0x120 PC+0x120 FIELD_BOOL Holding spinjump button
SMBX PC+0x122 PC+0x122 FIELD_WORD Forced animation state:
1: Powering up to "Big" state
2: Powering down
3: Entering a pipe
4: Powering up to "Fire Flower" state
5: Powering up to "Leaf" state
6: Respawning in 2-Player mode (Careful with this one)
7: Entering a door
8: Invisible/Immobile/Intangible state (Turning into a fairy or a different character)
9: On another player's Yoshi's tongue
10: In another player's Yoshi's mouth
11: Powering up to "Tanooki" state
12: Powering up to "Hammer" state
41: Powering up to "Ice Flower" state
500: Tanooki Statue poof state
WARNING! BE CAREFUL WHEN SETTING THESE VALUES. SMBX will sometimes crash depending on which values are set or if certain values are set on the same tick as others.
SMBX PC+0x124 PC+0x124 FIELD_DFLOAT Forced animation timer
SMBX PC+0x12C PC+0x12C FIELD_BOOL Down button mirror (redundant?)
SMBX PC+0x12E PC+0x12E FIELD_BOOL In ducking state
SMBX PC+0x130 PC+0x130 FIELD_BOOL Select button mirror (redundant?)
SMBX PC+0x132 PC+0x132 FIELD_BOOL True when the collected-powerup invincibility animation ends.
SMBX PC+0x134 PC+0x134 FIELD_BOOL Down button pressed this frame (reset next frame)
SMBX PC+0x136 PC+0x136 FIELD_BOOL Was spit out of Yoshi's mouth
SMBX PC+0x138 PC+0x138 FIELD_FLOAT X momentum push (eg. pushed by a bully)
SMBX PC+0x13C PC+0x13C FIELD_BOOL Player death state
SMBX PC+0x13E PC+0x13E FIELD_WORD Player death animation timer
SMBX PC+0x140 PC+0x140 FIELD_WORD Powerup blinking timer (Decrements from 50 (powerup) or 150 (hurt) back to 0, player is invulnerable when this is nonzero)
SMBX PC+0x142 PC+0x142 FIELD_BOOL Powerup blinking state (flickers between true and false)
SMBX PC+0x144 PC+0x144 FIELD_WORD Unknown144
Layer Content Below N/A N/A N/A
SMBX PC+0x146 PC+0x146 FIELD_WORD Bottom state (0 not on the ground, standing on sprite, during power-up/power-down and foot contact with a slope, 2 foot contact with a solid layer)
SMBX PC+0x148 PC+0x148 FIELD_WORD Left state (0 no left contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
SMBX PC+0x14A PC+0x14A FIELD_WORD Top state (0 no top contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
SMBX PC+0x14C PC+0x14C FIELD_WORD Right state (0 no right contact, 1 half or pushed back by a solid layer, 2 pushing against layer)
SMBX PC+0x14E PC+0x14E FIELD_WORD Pushed by a moving layer (0 not pushed by any, 2 being pushed to the left or right)
SMBX PC+0x150 PC+0x150 FIELD_WORD Unused150
SMBX PC+0x152 PC+0x152 FIELD_WORD Unused152
Misc Content Below N/A N/A N/A
SMBX PC+0x154 PC+0x154 FIELD_WORD Index of sprite being held (index to a specific sprite object that was generated only, -1 can't carry anything)
SMBX PC+0x156 PC+0x156 FIELD_BOOL Whether or not the player can grab anything
SMBX PC+0x158 PC+0x158 FIELD_WORD Powerup box contents (0 no item)
Section Content Below N/A N/A N/A
SMBX PC+0x15A PC+0x15A FIELD_WORD Current section
SMBX PC+0x15C PC+0x15C FIELD_WORD Warp cooldown timer (can't warp / pipe until 0)
SMBX PC+0x15E PC+0x15E FIELD_WORD Target warp exit index/id (not reset after finished warping)
Projectile Content Below N/A N/A N/A
SMBX PC+0x160 PC+0x160 FIELD_WORD Projectile timer (fireballs, hammers, link slash..)
SMBX PC+0x162 PC+0x162 FIELD_WORD Projectile timer 2 (link projectiles)
SMBX PC+0x164 PC+0x164 FIELD_WORD Tail swipe timer
SMBX PC+0x166 PC+0x166 FIELD_WORD Unknown166
Flight Content Below N/A N/A N/A
SMBX PC+0x168 PC+0x168 FIELD_FLOAT Run speed aggregate until flight achieveable
SMBX PC+0x16C PC+0x16C FIELD_BOOL Can fly
SMBX PC+0x16E PC+0x16E FIELD_BOOL Is flying
SMBX PC+0x170 PC+0x170 FIELD_WORD Flight time remaining
SMBX PC+0x172 PC+0x172 FIELD_BOOL Holding flight run button
SMBX PC+0x174 PC+0x174 FIELD_BOOL Holding flight button
Misc Content Below N/A N/A N/A
SMBX PC+0x176 PC+0x176 FIELD_WORD Index of sprite being stood on (stores the index into the NPC array + 1. 0 when not standing on an NPC)
SMBX PC+0x178 PC+0x178 FIELD_WORD Unknown X momentum with sprites
SMBX PC+0x17A PC+0x17A FIELD_BOOL Usually forced to true
Unused Content Below N/A N/A N/A
SMBX PC+0x17C PC+0x17C FIELD_WORD Unused17C
SMBX PC+0x17E PC+0x17E FIELD_WORD Unused17E
SMBX PC+0x180 PC+0x180 FIELD_WORD Unused180
SMBX PC+0x182 PC+0x182 FIELD_WORD Unused182
SMBX PC+0x184 PC+0x184 FIELD_WORD Unused184