diff options
| author | Tharo <17233964+Thar0@users.noreply.github.com> | 2022-03-01 19:29:42 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-01 20:29:42 +0100 |
| commit | 362bc5e61353d2ffb9767f15ab649fbfa5ac4cf4 (patch) | |
| tree | 952ff32ad819dab2b734ebddf6242b5cd61e2d72 | |
| parent | ed6ec5bceb667f10faf2b0672e273c78feba971e (diff) | |
Name fmodf (#1162)
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | data/unk_8012ABC0.data.s | 2 | ||||
| -rw-r--r-- | spec | 2 | ||||
| -rw-r--r-- | src/code/code_801067F0.c | 12 | ||||
| -rw-r--r-- | src/code/fmodf.c | 12 |
5 files changed, 15 insertions, 15 deletions
@@ -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 @@ -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); +} |
