diff --git a/Makefile b/Makefile index e75cb031..e9969ae0 100644 --- a/Makefile +++ b/Makefile @@ -130,10 +130,14 @@ $(eval $(call validate-option,TEXT_ENGINE,none s2dex_text_engine)) # Default non-gcc opt flags DEFAULT_OPT_FLAGS = -Ofast +# Note: -fno-associative-math is used here to suppress warnings, ideally we would enable this as an optimization but +# this conflicts with -ftrapping-math apparently. +# TODO: Figure out how to allow -fassociative-math to be enabled +SAFETY_OPT_FLAGS = -ftrapping-math -fno-associative-math # Main opt flags GCC_MAIN_OPT_FLAGS = \ - -Ofast \ + $(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \ --param case-values-threshold=20 \ --param max-completely-peeled-insns=10 \ --param max-unrolled-insns=10 \ @@ -144,7 +148,7 @@ GCC_MAIN_OPT_FLAGS = \ # Surface Collision GCC_COLLISION_OPT_FLAGS = \ - -Ofast \ + $(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \ --param case-values-threshold=20 \ --param max-completely-peeled-insns=100 \ --param max-unrolled-insns=100 \ @@ -157,7 +161,7 @@ GCC_COLLISION_OPT_FLAGS = \ # Math Util GCC_MATH_UTIL_OPT_FLAGS = \ - -Ofast \ + $(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \ -fno-unroll-loops \ -fno-peel-loops \ --param case-values-threshold=20 \ @@ -169,7 +173,7 @@ GCC_MATH_UTIL_OPT_FLAGS = \ # Rendering graph node GCC_GRAPH_NODE_OPT_FLAGS = \ - -Ofast \ + $(DEFAULT_OPT_FLAGS) $(SAFETY_OPT_FLAGS) \ --param case-values-threshold=20 \ --param max-completely-peeled-insns=100 \ --param max-unrolled-insns=100 \ diff --git a/VERSION.txt b/VERSION.txt index c2f6de90..923fd4d2 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v2.0.5 +v2.0.8 diff --git a/include/config/config_movement.h b/include/config/config_movement.h index 8f6c6542..ae4e36cf 100644 --- a/include/config/config_movement.h +++ b/include/config/config_movement.h @@ -116,7 +116,7 @@ /** * Makes Mario unable to ledge grab steep slopes to prevent false ledge grabs. */ -// #define DONT_LEDGE_GRAB_STEEP_SLOPES +#define DONT_LEDGE_GRAB_STEEP_SLOPES /** * Disables BLJs and crushes SimpleFlips's dreams. diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 1d46a79e..86d95269 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -28,7 +28,7 @@ Vec3s gVec3sOne = { 1, 1, 1 }; static u16 gRandomSeed16; // Generate a pseudorandom integer from 0 to 65535 from the random seed, and update the seed. -u32 random_u16(void) { +u16 random_u16(void) { if (gRandomSeed16 == 22026) { gRandomSeed16 = 0; } diff --git a/src/engine/math_util.h b/src/engine/math_util.h index 016dc87f..b0fab842 100644 --- a/src/engine/math_util.h +++ b/src/engine/math_util.h @@ -475,7 +475,7 @@ ALWAYS_INLINE s32 absi(s32 in) { #define FLT_IS_NONZERO(x) (absf(x) > NEAR_ZERO) -u32 random_u16(void); +u16 random_u16(void); f32 random_float(void); s32 random_sign(void); diff --git a/src/game/mario_step.c b/src/game/mario_step.c index eb9923fd..028d4962 100644 --- a/src/game/mario_step.c +++ b/src/game/mario_step.c @@ -541,7 +541,7 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr } } - if (stepResult == AIR_STEP_GRABBED_LEDGE && grabbedWall != NULL && ledgeFloor != NULL && ledgePos != NULL) { + if (stepResult == AIR_STEP_GRABBED_LEDGE && grabbedWall != NULL && ledgeFloor != NULL) { vec3f_copy(m->pos, ledgePos); set_mario_floor(m, floor, ledgePos[1]); m->faceAngle[0] = 0x0; diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c index 611271db..89bf249d 100644 --- a/src/goddard/dynlist_proc.c +++ b/src/goddard/dynlist_proc.c @@ -1889,47 +1889,6 @@ void d_set_att_offset(const struct GdVec3f *off) { } } -/** - * An incorrectly-coded recursive function that was presumably supposed to - * set the offset of an attached object. Now, it will only call itself - * until it encounters a NULL pointer, which will trigger a `fatal_printf()` - * call. - * - * @note Not called - */ -void d_set_att_to_offset(UNUSED u32 a) { - struct GdObj *dynobj; // sp3c - UNUSED u8 filler[24]; - - if (sDynListCurObj == NULL) { - fatal_printf("proc_dynlist(): No current object"); - } - - dynobj = sDynListCurObj; - d_stash_dynobj(); - switch (sDynListCurObj->type) { - case OBJ_TYPE_JOINTS: - set_cur_dynobj(((struct ObjJoint *) dynobj)->attachedToObj); - break; - case OBJ_TYPE_NETS: - set_cur_dynobj(((struct ObjNet *) dynobj)->attachedToObj); - break; - case OBJ_TYPE_PARTICLES: - set_cur_dynobj(((struct ObjParticle *) dynobj)->attachedToObj); - break; - default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAttToOffset()", - sDynListCurInfo->name, sDynListCurObj->type); - } - - if (sDynListCurObj == NULL) { - fatal_printf("dSetAttOffset(): Object '%s' isnt attached to anything", - sStashedDynObjInfo->name); - } - d_set_att_to_offset(a); - d_unstash_dynobj(); -} - /** * Store the offset of the attached object into `dst`. *