From 9195ceed28fa476838f4338f5a8b8b3376991ab3 Mon Sep 17 00:00:00 2001 From: Ryan Myers Date: Wed, 11 Jun 2025 10:44:40 -0400 Subject: [PATCH] Fix score script (#619) --- README.md | 2 +- src/hasm/math_util.c | 8 +++++--- tools/python/score.py | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 81866958..9ef7b2fe 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ As of June 11, 2025, this is our current score: # Decompiled functions: 1913 # GLOBAL_ASM remaining: 37 # NON_MATCHING functions: 4 - # NON_EQUIVALENT WIP functions: 29 + # NON_EQUIVALENT WIP functions: 30 --------------------------- Game Status ---------------------------- Balloons: 42/47, Keys: 4/4, Trophies: 4/5 T.T. Amulets: 4/4, Wizpig Amulets: 4/4 diff --git a/src/hasm/math_util.c b/src/hasm/math_util.c index d010b3d3..6de8a7fa 100644 --- a/src/hasm/math_util.c +++ b/src/hasm/math_util.c @@ -806,7 +806,8 @@ UNUSED s32 fix32_sqrt(s32 x) { GLOBAL_ASM("asm/math_util/fix32_sqrt.s") #endif -#ifdef NON_EQUIVALENT // Untested +// Untested +#ifdef NON_EQUIVALENT UNUSED s32 bad_int_sqrt(s32 arg0) { return (s32) (sqrtf((f32) arg0 / 65536.0f) * 65536.0f); } @@ -818,8 +819,9 @@ GLOBAL_ASM("asm/math_util/sins_f.s") GLOBAL_ASM("asm/math_util/coss_f.s") GLOBAL_ASM("asm/math_util/coss.s") GLOBAL_ASM("asm/math_util/sins_2.s") - -#ifdef NON_EQUIVALENT // Untested + +// Untested +#ifdef NON_EQUIVALENT UNUSED s32 calc_dyn_lighting_for_level_segment(LevelModelSegment *segment, s32 *vec3_ints) { s32 dotProduct; s32 numVertsInBatch; diff --git a/tools/python/score.py b/tools/python/score.py index cb497145..9af807a1 100644 --- a/tools/python/score.py +++ b/tools/python/score.py @@ -152,7 +152,8 @@ class ScoreFile: self.nonEquivalents = re.findall(NON_EQUVIALENT_REGEX, self.text) self.nonEquivalentsSizes = 0 for nonEquivalent in self.nonEquivalents: - self.nonEquivalentsSizes += MAP_FILE.functionSizes[nonEquivalent] + if (nonEquivalent not in NOT_FUNCTION_NAMES): + self.nonEquivalentsSizes += MAP_FILE.functionSizes[nonEquivalent] self.numNonEquivalents = len(self.nonEquivalents) self.text = re.sub(WIP_REGEX, r"GLOBAL_ASM(\1)", self.text)