Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Functions | Variables
mario_actions_moving.c File Reference
#include <ultra64.h>
#include "sm64.h"
#include "mario.h"
#include "audio/external.h"
#include "engine/math_util.h"
#include "engine/surface_collision.h"
#include "mario_step.h"
#include "area.h"
#include "interaction.h"
#include "mario_actions_object.h"
#include "memory.h"
#include "behavior_data.h"

Data Structures

struct  LandingAction
 

Functions

s16 func_80263A50 (struct MarioState *m)
 
void func_80263AD4 (struct MarioState *m, s16 arg1, s16 arg2)
 
void func_80263C14 (struct MarioState *m)
 
s32 begin_walking_action (struct MarioState *m, f32 forwardVel, u32 action, u32 actionArg)
 
void check_ledge_climb_down (struct MarioState *m)
 
void slide_bonk (struct MarioState *m, u32 fastAction, u32 slowAction)
 
s32 set_triple_jump_action (struct MarioState *m, UNUSED u32 action, UNUSED u32 actionArg)
 
void update_sliding_angle (struct MarioState *m, f32 accel, f32 lossFactor)
 
s32 update_sliding (struct MarioState *m, f32 stopSpeed)
 
void apply_slope_accel (struct MarioState *m)
 
s32 apply_landing_accel (struct MarioState *m, f32 frictionFactor)
 
void update_shell_speed (struct MarioState *m)
 
s32 apply_slope_decel (struct MarioState *m, f32 decelCoef)
 
s32 update_decelerating_speed (struct MarioState *m)
 
void update_walking_speed (struct MarioState *m)
 
s32 should_begin_sliding (struct MarioState *m)
 
s32 analog_stick_held_back (struct MarioState *m)
 
s32 check_ground_dive_or_punch (struct MarioState *m)
 
s32 begin_braking_action (struct MarioState *m)
 
void func_802652F0 (struct MarioState *m)
 
void func_8026570C (struct MarioState *m)
 
void func_80265980 (struct MarioState *m)
 
void func_802659E8 (struct MarioState *m, Vec3f startPos)
 
void func_80265C28 (struct MarioState *m, s16 startYaw)
 
void func_80265DBC (struct MarioState *m, s16 startYaw)
 
s32 act_walking (struct MarioState *m)
 
s32 act_move_punching (struct MarioState *m)
 
s32 act_hold_walking (struct MarioState *m)
 
s32 act_hold_heavy_walking (struct MarioState *m)
 
s32 act_turning_around (struct MarioState *m)
 
s32 act_finish_turning_around (struct MarioState *m)
 
s32 act_braking (struct MarioState *m)
 
s32 act_decelerating (struct MarioState *m)
 
s32 act_hold_decelerating (struct MarioState *m)
 
s32 act_riding_shell_ground (struct MarioState *m)
 
s32 act_crawling (struct MarioState *m)
 
s32 act_burning_ground (struct MarioState *m)
 
void func_80267814 (struct MarioState *m)
 
void common_slide_action (struct MarioState *m, u32 endAction, u32 airAction, s32 animation)
 
s32 common_slide_action_with_jump (struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation)
 
s32 act_butt_slide (struct MarioState *m)
 
s32 act_hold_butt_slide (struct MarioState *m)
 
s32 act_crouch_slide (struct MarioState *m)
 
s32 act_slide_kick_slide (struct MarioState *m)
 
s32 stomach_slide_action (struct MarioState *m, u32 stopAction, u32 airAction, s32 animation)
 
s32 act_stomach_slide (struct MarioState *m)
 
s32 act_hold_stomach_slide (struct MarioState *m)
 
s32 act_dive_slide (struct MarioState *m)
 
s32 common_ground_knockback_action (struct MarioState *m, s32 animation, s32 arg2, s32 arg3, s32 arg4)
 
s32 act_hard_backward_ground_kb (struct MarioState *m)
 
s32 act_hard_forward_ground_kb (struct MarioState *m)
 
s32 act_backward_ground_kb (struct MarioState *m)
 
s32 act_forward_ground_kb (struct MarioState *m)
 
s32 act_soft_backward_ground_kb (struct MarioState *m)
 
s32 act_soft_forward_ground_kb (struct MarioState *m)
 
s32 act_ground_bonk (struct MarioState *m)
 
s32 act_death_exit_land (struct MarioState *m)
 
u32 common_landing_action (struct MarioState *m, s16 animation, u32 airAction)
 
s32 common_landing_cancels (struct MarioState *m, struct LandingAction *landingAction, s32(*setAPressAction)(struct MarioState *, u32, u32))
 
s32 act_jump_land (struct MarioState *m)
 
s32 act_freefall_land (struct MarioState *m)
 
s32 act_side_flip_land (struct MarioState *m)
 
s32 act_hold_jump_land (struct MarioState *m)
 
s32 act_hold_freefall_land (struct MarioState *m)
 
s32 act_long_jump_land (struct MarioState *m)
 
s32 act_double_jump_land (struct MarioState *m)
 
s32 act_triple_jump_land (struct MarioState *m)
 
s32 act_backflip_land (struct MarioState *m)
 
s32 quicksand_jump_land_action (struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, u32 airAction)
 
s32 act_quicksand_jump_land (struct MarioState *m)
 
s32 act_hold_quicksand_jump_land (struct MarioState *m)
 
s32 check_common_moving_cancels (struct MarioState *m)
 
s32 mario_execute_moving_action (struct MarioState *m)
 

Variables

struct LandingAction sJumpLandAction
 
struct LandingAction sFreefallLandAction
 
struct LandingAction sSideFlipLandAction
 
struct LandingAction sHoldJumpLandAction
 
struct LandingAction sHoldFreefallLandAction
 
struct LandingAction sLongJumpLandAction
 
struct LandingAction sDoubleJumpLandAction
 
struct LandingAction sTripleJumpLandAction
 
struct LandingAction sBackflipLandAction
 
Mat4 D_80339F50 [2]
 

Function Documentation

◆ act_backflip_land()

s32 act_backflip_land ( struct MarioState m)

◆ act_backward_ground_kb()

s32 act_backward_ground_kb ( struct MarioState m)

◆ act_braking()

s32 act_braking ( struct MarioState m)

◆ act_burning_ground()

s32 act_burning_ground ( struct MarioState m)

◆ act_butt_slide()

s32 act_butt_slide ( struct MarioState m)

◆ act_crawling()

s32 act_crawling ( struct MarioState m)

Possibly unintended missing break

◆ act_crouch_slide()

s32 act_crouch_slide ( struct MarioState m)

◆ act_death_exit_land()

s32 act_death_exit_land ( struct MarioState m)

◆ act_decelerating()

s32 act_decelerating ( struct MarioState m)

◆ act_dive_slide()

s32 act_dive_slide ( struct MarioState m)

If the dive slide ends on the same frame that we pick up on object,

◆ act_double_jump_land()

s32 act_double_jump_land ( struct MarioState m)

◆ act_finish_turning_around()

s32 act_finish_turning_around ( struct MarioState m)

◆ act_forward_ground_kb()

s32 act_forward_ground_kb ( struct MarioState m)

◆ act_freefall_land()

s32 act_freefall_land ( struct MarioState m)

◆ act_ground_bonk()

s32 act_ground_bonk ( struct MarioState m)

◆ act_hard_backward_ground_kb()

s32 act_hard_backward_ground_kb ( struct MarioState m)

◆ act_hard_forward_ground_kb()

s32 act_hard_forward_ground_kb ( struct MarioState m)

◆ act_hold_butt_slide()

s32 act_hold_butt_slide ( struct MarioState m)

◆ act_hold_decelerating()

s32 act_hold_decelerating ( struct MarioState m)

◆ act_hold_freefall_land()

s32 act_hold_freefall_land ( struct MarioState m)

◆ act_hold_heavy_walking()

s32 act_hold_heavy_walking ( struct MarioState m)

◆ act_hold_jump_land()

s32 act_hold_jump_land ( struct MarioState m)

◆ act_hold_quicksand_jump_land()

s32 act_hold_quicksand_jump_land ( struct MarioState m)

◆ act_hold_stomach_slide()

s32 act_hold_stomach_slide ( struct MarioState m)

◆ act_hold_walking()

s32 act_hold_walking ( struct MarioState m)

◆ act_jump_land()

s32 act_jump_land ( struct MarioState m)

◆ act_long_jump_land()

s32 act_long_jump_land ( struct MarioState m)

◆ act_move_punching()

s32 act_move_punching ( struct MarioState m)

◆ act_quicksand_jump_land()

s32 act_quicksand_jump_land ( struct MarioState m)

◆ act_riding_shell_ground()

s32 act_riding_shell_ground ( struct MarioState m)

◆ act_side_flip_land()

s32 act_side_flip_land ( struct MarioState m)

◆ act_slide_kick_slide()

s32 act_slide_kick_slide ( struct MarioState m)

◆ act_soft_backward_ground_kb()

s32 act_soft_backward_ground_kb ( struct MarioState m)

◆ act_soft_forward_ground_kb()

s32 act_soft_forward_ground_kb ( struct MarioState m)

◆ act_stomach_slide()

s32 act_stomach_slide ( struct MarioState m)

◆ act_triple_jump_land()

s32 act_triple_jump_land ( struct MarioState m)

◆ act_turning_around()

s32 act_turning_around ( struct MarioState m)

◆ act_walking()

s32 act_walking ( struct MarioState m)

◆ analog_stick_held_back()

s32 analog_stick_held_back ( struct MarioState m)

◆ apply_landing_accel()

s32 apply_landing_accel ( struct MarioState m,
f32  frictionFactor 
)

◆ apply_slope_accel()

void apply_slope_accel ( struct MarioState m)

◆ apply_slope_decel()

s32 apply_slope_decel ( struct MarioState m,
f32  decelCoef 
)

◆ begin_braking_action()

s32 begin_braking_action ( struct MarioState m)

◆ begin_walking_action()

s32 begin_walking_action ( struct MarioState m,
f32  forwardVel,
u32  action,
u32  actionArg 
)

◆ check_common_moving_cancels()

s32 check_common_moving_cancels ( struct MarioState m)

◆ check_ground_dive_or_punch()

s32 check_ground_dive_or_punch ( struct MarioState m)

Speed kick (shoutouts to SimpleFlips)

◆ check_ledge_climb_down()

void check_ledge_climb_down ( struct MarioState m)

◆ common_ground_knockback_action()

s32 common_ground_knockback_action ( struct MarioState m,
s32  animation,
s32  arg2,
s32  arg3,
s32  arg4 
)

◆ common_landing_action()

u32 common_landing_action ( struct MarioState m,
s16  animation,
u32  airAction 
)

◆ common_landing_cancels()

s32 common_landing_cancels ( struct MarioState m,
struct LandingAction landingAction,
s32(*)(struct MarioState *, u32, u32 setAPressAction 
)

Everything here, incuding floor steepness, is checked before checking

◆ common_slide_action()

void common_slide_action ( struct MarioState m,
u32  endAction,
u32  airAction,
s32  animation 
)

◆ common_slide_action_with_jump()

s32 common_slide_action_with_jump ( struct MarioState m,
u32  stopAction,
u32  jumpAction,
u32  airAction,
s32  animation 
)

◆ func_80263A50()

s16 func_80263A50 ( struct MarioState m)

◆ func_80263AD4()

void func_80263AD4 ( struct MarioState m,
s16  arg1,
s16  arg2 
)

◆ func_80263C14()

void func_80263C14 ( struct MarioState m)

◆ func_802652F0()

void func_802652F0 ( struct MarioState m)

◆ func_8026570C()

void func_8026570C ( struct MarioState m)

◆ func_80265980()

void func_80265980 ( struct MarioState m)

◆ func_802659E8()

void func_802659E8 ( struct MarioState m,
Vec3f  startPos 
)

◆ func_80265C28()

void func_80265C28 ( struct MarioState m,
s16  startYaw 
)

◆ func_80265DBC()

void func_80265DBC ( struct MarioState m,
s16  startYaw 
)

◆ func_80267814()

void func_80267814 ( struct MarioState m)

◆ mario_execute_moving_action()

s32 mario_execute_moving_action ( struct MarioState m)

◆ quicksand_jump_land_action()

s32 quicksand_jump_land_action ( struct MarioState m,
s32  animation1,
s32  animation2,
u32  endAction,
u32  airAction 
)

◆ set_triple_jump_action()

s32 set_triple_jump_action ( struct MarioState m,
UNUSED u32  action,
UNUSED u32  actionArg 
)

◆ should_begin_sliding()

s32 should_begin_sliding ( struct MarioState m)

◆ slide_bonk()

void slide_bonk ( struct MarioState m,
u32  fastAction,
u32  slowAction 
)

◆ stomach_slide_action()

s32 stomach_slide_action ( struct MarioState m,
u32  stopAction,
u32  airAction,
s32  animation 
)

◆ update_decelerating_speed()

s32 update_decelerating_speed ( struct MarioState m)

◆ update_shell_speed()

void update_shell_speed ( struct MarioState m)

Negative origin offset

No backward speed cap (shell hyperspeed)

◆ update_sliding()

s32 update_sliding ( struct MarioState m,
f32  stopSpeed 
)

10k glitch

This is attempting to use trig derivatives to rotate mario's speed.

◆ update_sliding_angle()

void update_sliding_angle ( struct MarioState m,
f32  accel,
f32  lossFactor 
)

-0x4000 not handled - can slide down a slope while facing perpendicular to it

Speed is capped a frame late (butt slide HSG)

◆ update_walking_speed()

void update_walking_speed ( struct MarioState m)

Variable Documentation

◆ D_80339F50

Mat4 D_80339F50[2]

◆ sBackflipLandAction

struct LandingAction sBackflipLandAction
Initial value:
= {
}
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_BACKFLIP_LAND_STOP
Definition: sm64.h:194
#define ACT_BACKFLIP
Definition: sm64.h:257
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223

◆ sDoubleJumpLandAction

struct LandingAction sDoubleJumpLandAction
Initial value:
= {
}
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223
#define ACT_DOUBLE_JUMP_LAND_STOP
Definition: sm64.h:196
#define ACT_JUMP
Definition: sm64.h:254

◆ sFreefallLandAction

struct LandingAction sFreefallLandAction
Initial value:
= {
}
#define ACT_DOUBLE_JUMP
Definition: sm64.h:255
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_FREEFALL_LAND_STOP
Definition: sm64.h:197
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223

◆ sHoldFreefallLandAction

struct LandingAction sHoldFreefallLandAction
Initial value:
= {
}
#define ACT_UNKNOWN_035
Definition: sm64.h:200
#define ACT_HOLD_JUMP
Definition: sm64.h:273
#define ACT_HOLD_FREEFALL
Definition: sm64.h:274
#define ACT_HOLD_BEGIN_SLIDING
Definition: sm64.h:224

◆ sHoldJumpLandAction

struct LandingAction sHoldJumpLandAction
Initial value:
= {
}
#define ACT_HOLD_JUMP
Definition: sm64.h:273
#define ACT_HOLD_FREEFALL
Definition: sm64.h:274
#define ACT_HOLD_BEGIN_SLIDING
Definition: sm64.h:224
#define ACT_UNKNOWN_034
Definition: sm64.h:199

◆ sJumpLandAction

struct LandingAction sJumpLandAction
Initial value:
= {
}
#define ACT_DOUBLE_JUMP
Definition: sm64.h:255
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_JUMP_LAND_STOP
Definition: sm64.h:195
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223

◆ sLongJumpLandAction

struct LandingAction sLongJumpLandAction
Initial value:
= {
}
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223
#define ACT_LONG_JUMP
Definition: sm64.h:261
#define ACT_LONG_JUMP_LAND_STOP
Definition: sm64.h:205

◆ sSideFlipLandAction

struct LandingAction sSideFlipLandAction
Initial value:
= {
}
#define ACT_DOUBLE_JUMP
Definition: sm64.h:255
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223
#define ACT_SIDE_FLIP_LAND_STOP
Definition: sm64.h:198

◆ sTripleJumpLandAction

struct LandingAction sTripleJumpLandAction
Initial value:
= {
}
#define ACT_FREEFALL
Definition: sm64.h:264
#define ACT_UNINITIALIZED
Definition: sm64.h:171
#define ACT_BEGIN_SLIDING
Definition: sm64.h:223
#define ACT_TRIPLE_JUMP_LAND_STOP
Definition: sm64.h:204