summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2022-03-01 19:29:42 +0000
committerGitHub <noreply@github.com>2022-03-01 20:29:42 +0100
commit362bc5e61353d2ffb9767f15ab649fbfa5ac4cf4 (patch)
tree952ff32ad819dab2b734ebddf6242b5cd61e2d72
parented6ec5bceb667f10faf2b0672e273c78feba971e (diff)
Name fmodf (#1162)
-rw-r--r--Makefile2
-rw-r--r--data/unk_8012ABC0.data.s2
-rw-r--r--spec2
-rw-r--r--src/code/code_801067F0.c12
-rw-r--r--src/code/fmodf.c12
5 files changed, 15 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index 7d72161c4..8796ed954 100644
--- a/Makefile
+++ b/Makefile
@@ -188,7 +188,7 @@ build/src/code/fault_drawer.o: OPTFLAGS := -O2 -g3
build/src/code/ucode_disas.o: OPTFLAGS := -O2 -g3
build/src/code/code_801068B0.o: OPTFLAGS := -g
build/src/code/code_80106860.o: OPTFLAGS := -g
-build/src/code/code_801067F0.o: OPTFLAGS := -g
+build/src/code/fmodf.o: OPTFLAGS := -g
build/src/libultra/libc/absf.o: OPTFLAGS := -O2 -g3
build/src/libultra/libc/sqrt.o: OPTFLAGS := -O2 -g3
diff --git a/data/unk_8012ABC0.data.s b/data/unk_8012ABC0.data.s
index d4781c3b8..31e03580e 100644
--- a/data/unk_8012ABC0.data.s
+++ b/data/unk_8012ABC0.data.s
@@ -11,7 +11,7 @@
# Unused
glabel D_8012ABC0
- .word func_801067F0 # fmodf?
+ .word fmodf
.word guScale
.word guRotate
.word guTranslate
diff --git a/spec b/spec
index 6a6938d17..85c79d43a 100644
--- a/spec
+++ b/spec
@@ -509,7 +509,7 @@ beginseg
include "build/src/libultra/io/spsetpc.o"
include "build/src/libultra/libc/sqrt.o"
include "build/src/libultra/libc/absf.o"
- include "build/src/code/code_801067F0.o"
+ include "build/src/code/fmodf.o"
include "build/src/code/code_80106860.o"
include "build/src/code/code_801068B0.o"
include_data_with_rodata "build/src/code/z_message_PAL.o"
diff --git a/src/code/code_801067F0.c b/src/code/code_801067F0.c
deleted file mode 100644
index ae65e522b..000000000
--- a/src/code/code_801067F0.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "global.h"
-
-// fmodf?
-f32 func_801067F0(f32 arg0, f32 arg1) {
- s32 sp4;
-
- if (arg1 == 0.0f) {
- return 0.0f;
- }
- sp4 = arg0 / arg1;
- return arg0 - (sp4 * arg1);
-}
diff --git a/src/code/fmodf.c b/src/code/fmodf.c
new file mode 100644
index 000000000..6cc69dd87
--- /dev/null
+++ b/src/code/fmodf.c
@@ -0,0 +1,12 @@
+#include "global.h"
+
+f32 fmodf(f32 x, f32 y) {
+ s32 quot;
+
+ if (y == 0.0f) {
+ return 0.0f;
+ }
+ quot = x / y;
+
+ return x - (quot * y);
+}