Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Bug List
Global apply_to_obj_types_in_group (s32, applyproc_t, struct ObjGroup *)
When group pointer is NULL, garbage is returned, not the count of fn calls
Global apply_to_obj_types_in_group (s32, applyproc_t, struct ObjGroup *)
When group pointer is NULL, garbage is returned, not the count of fn calls
Global bhv_goomba_update (void)
Weak attacks on huge goombas in a triplet mark them as dead even if they're not.
Global bhv_merry_go_round_loop (void)
Interestingly, this means if Mario goes from outside
Global chk_shapegen (struct ObjShape *shape)
Call to make_face_with_colour() compiles incorrectly due to Goddard only declaring the functions, not prototyping the functions
Global create_child_gdl (s32 id, struct GdDisplayList *srcDl)
No return statement, despite return value being used. Goddard lucked out that v0 return from alloc_displaylist() is not overwriten, as that pointer is what should be returned
Global create_shape_gddl (struct ObjShape *s)
Nothing is returned if the DL is created
Global d_makeobj (enum DObjTypes type, DynId id)

Returns garbage when making D_DATA_GRP object

When making a D_LABEL, the call to make_label() compiles incorrectly due to Goddard only declaring the functions, not prototyping the functions

Global d_set_matrix (Mat4f *src)
When setting an ObjNet matrix, the source is copied twice due to a probable copy-paste line repeat error
Global draw_face (struct ObjFace *)
This function seems to have some parts based on older versions of ObjVertex as the struct requests fields passed the end of an ObjVertex. The bad code is statically unreachable, so...
Global draw_face (struct ObjFace *)
This function seems to have some parts based on older versions of ObjVertex as the struct requests fields passed the end of an ObjVertex. The bad code is statically unreachable, so...
Global func_801A43F0 (UNUSED const char *menufmt,...)
no return; function was stubbed
Global gd_printf (const char *,...)
formatter 'c' uses s32 for va_arg instead of char
Global gd_printf (const char *,...)
formatter 'c' uses s32 for va_arg instead of char
Global gdm_gettestdl (s32)

Code treats sYoshiSceneView as group; not called in game though

Code treats sCarSceneView as group; not called in game though

Global gdm_gettestdl (s32)

Code treats sYoshiSceneView as group; not called in game though

Code treats sCarSceneView as group; not called in game though

Global Geo18_80177518 (s16 run, UNUSED struct GraphNode *node)
Another geo function missing the third param. Harmless in practice due to o32 convention.
Global geo_process_master_list_sub (struct GraphNodeMasterList *node)
This is where the LookAt values should be calculated but aren't. As a result, environment mapping is broken on Fast3DEX2 without the changes below.
Global geo_switch_anim_state (s32 run, struct GraphNode *node)
Every geo function declares the 3 parameters of run, node, and the matrix array.
Global geo_switch_area (s32 run, struct GraphNode *node)
Same issue as geo_switch_anim_state.
Global get_water_level_below_shadow (struct Shadow *s)
Missing return statement. This compiles to return waterLevel incidentally.
Global init_shadow (struct Shadow *s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 overwriteSolidity)
Use of potentially undefined variable waterLevel
Global make_zone (struct ObjGroup *, struct GdPlaneF *, struct ObjGroup *)
Created ObjZone is not returned
Global make_zone (struct ObjGroup *, struct GdPlaneF *, struct ObjGroup *)
Created ObjZone is not returned
Global my_rsp_init (void)
Nintendo did not explicitly define the clipping ratio. For Fast3DEX2, this causes the dreaded warped vertices issue unless the clipping ratio is changed back to the intended value, as Fast3DEX2 uses a different initial value than Fast3D(EX).
Global setup_view_buffers (const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, UNUSED s32 lrx, UNUSED s32 lry)
No actual return, but the return value is used. There is no obvious value to return. Since the function doesn't use four of its parameters, this function may have had a fair amount of its code commented out. In game, the returned value is always 0, so the fix returns that value
Global UnknownRecursive8017E2F0 (struct GdObj *, enum ObjTypeFlag)
Nothing is returned if a GdObj of type is not found
Global UnknownRecursive8017E2F0 (struct GdObj *, enum ObjTypeFlag)
Nothing is returned if a GdObj of type is not found