summaryrefslogtreecommitdiff
path: root/src/code/z_lib.c
diff options
context:
space:
mode:
authorfig02 <fig02srl@gmail.com>2020-03-20 08:17:48 -0400
committerfig02 <fig02srl@gmail.com>2020-03-20 08:17:48 -0400
commitaa603ca22970b42a6b7026f1cd08b614b928c79c (patch)
tree458acc42491b8943fc77fad1e58ca356304e4382 /src/code/z_lib.c
parentf3b509eb68a3563b48d4cc2226e93a213d6bf427 (diff)
parent2a283c18a952960ad0e61ee39a644fc71a7001be (diff)
merge and change scene thing
Diffstat (limited to 'src/code/z_lib.c')
-rw-r--r--src/code/z_lib.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/src/code/z_lib.c b/src/code/z_lib.c
index 7b8bcbc2c..a7411c53d 100644
--- a/src/code/z_lib.c
+++ b/src/code/z_lib.c
@@ -1,20 +1,17 @@
#include <ultra64.h>
#include <global.h>
-#ifdef NON_MATCHING
-void Lib_MemSet(void* dest, size_t size, u8 val)
+void Lib_MemSet(u8* dest, size_t size, u8 val)
{
- u8* destu = dest;
- u32 i;
+ u32 i = 0;
- for (i = 0; i < size; i++)
- {
- *destu++ = val;
- }
+ // TODO: Convert this to while/for if possible
+ if (i == size) return;
+ do {
+ *dest++ = val;
+ i++;
+ } while (i != size);
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_lib/Lib_MemSet.s")
-#endif
f32 Math_Coss(s16 angle)
{
@@ -559,15 +556,12 @@ f32 func_800784D8(f32* pValue, f32 target, f32 scale, f32 maxStep, f32 minStep)
return step;
}
-#ifdef NON_MATCHING
-// regalloc differences
s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep, s16 minStep)
{
+ s16 step = 0;
s16 diff = (target - *pValue);
- s32 baseStep;
- s16 step;
- baseStep = diff / invScale;
+ s32 baseStep = diff / invScale;
if (*pValue != target)
{
@@ -604,9 +598,6 @@ s16 Math_SmoothScaleMaxMinS(s16* pValue, s16 target, s16 invScale, s16 maxStep,
return diff;
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/z_lib/Math_SmoothScaleMaxMinS.s")
-#endif
void Math_SmoothScaleMaxS(s16* pValue, s16 target, s16 invScale, s16 maxStep)
{