![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <ultra64.h>
#include "sm64.h"
#include "engine/math_util.h"
#include "engine/surface_collision.h"
#include "mario.h"
#include "audio/external.h"
#include "display.h"
#include "interaction.h"
#include "mario_step.h"
Variables | |
static s16 | sMovingSandSpeeds [] = { 12, 8, 4, 0 } |
struct Surface | gWaterSurfacePseudoFloor |
void apply_gravity | ( | struct MarioState * | m | ) |
void apply_twirl_gravity | ( | struct MarioState * | m | ) |
void apply_vertical_wind | ( | struct MarioState * | m | ) |
u32 check_ledge_grab | ( | struct MarioState * | m, |
struct Surface * | wall, | ||
Vec3f | intendedPos, | ||
Vec3f | nextPos | ||
) |
Since the search for floors starts at y + 160, we will sometimes grab
Always returns zero.
This may have been intended to be used for the beta trampoline. Its return value is used by set_mario_y_vel_based_on_fspeed as a constant addition to Mario's Y velocity. Given the closeness of this function to nop_80254E50, it is probable that this was intended to check whether a trampoline had made itself known through nop_80254E50 and whether Mario was on it, and if so return a higher value than 0.
void init_bully_collision_data | ( | struct BullyCollisionData * | data, |
f32 | posX, | ||
f32 | posZ, | ||
f32 | forwardVel, | ||
s16 | yaw, | ||
f32 | conversionRatio, | ||
f32 | radius | ||
) |
void mario_bonk_reflection | ( | struct MarioState * | m, |
u32 | negateSpeed | ||
) |
u32 mario_push_off_steep_floor | ( | struct MarioState * | m, |
u32 | action, | ||
u32 | actionArg | ||
) |
u32 mario_update_moving_sand | ( | struct MarioState * | m | ) |
u32 mario_update_quicksand | ( | struct MarioState * | m, |
f32 | sinkingSpeed | ||
) |
u32 mario_update_windy_ground | ( | struct MarioState * | m | ) |
void nop_80254E3C | ( | UNUSED struct MarioState * | x | ) |
Does nothing, but takes in a MarioState.
This is only ever called by update_mario_inputs, which is called as part of Mario's update routine. Due to its proximity to nop_80254E50, an incomplete trampoline function, and get_additive_y_vel_for_jumps, a potentially trampoline-related function, it is plausible that this could be used for checking if Mario was on the trampoline. It could, for example, make him bounce.
Does nothing.
This is only called by the beta trampoline. Due to its proximity to get_additive_y_vel_for_jumps, another currently-pointless function, it is probable that this was used by the trampoline to make itself known to get_additive_y_vel_for_jumps, or to set a variable with its intended additive Y vel.
s32 perform_air_quarter_step | ( | struct MarioState * | m, |
Vec3f | intendedPos, | ||
u32 | stepArg | ||
) |
The water pseudo floor is not referenced when your intended qstep is
Incorrect origin offset (no effect)
This check uses f32, but findFloor uses short (overflow jumps)
When ceilHeight - floorHeight <= 160, the step result says that
Uses referenced ceiling instead of ceil (ceiling hang upwarp)
Potential subframe downwarp->upwarp?
When the wall is not completely vertical or there is a slight wall
s32 perform_air_step | ( | struct MarioState * | m, |
u32 | stepArg | ||
) |
On one qf, hit OOB/ceil/wall to store the 2 return value, and continue
|
static |
Wrong origin offset (no effect)
s32 perform_ground_step | ( | struct MarioState * | m | ) |
void set_vel_from_pitch_and_yaw | ( | struct MarioState * | m | ) |
void set_vel_from_yaw | ( | struct MarioState * | m | ) |
u32 should_strengthen_gravity_for_jump_ascent | ( | struct MarioState * | m | ) |
s32 stationary_ground_step | ( | struct MarioState * | m | ) |
This is responsible for several stationary downwarps.
void stop_and_set_height_to_floor | ( | struct MarioState * | m | ) |
This is responsible for some downwarps.
void transfer_bully_speed | ( | struct BullyCollisionData * | obj1, |
struct BullyCollisionData * | obj2 | ||
) |
Bully NaN crash
Bully battery
|
static |