summaryrefslogtreecommitdiff
path: root/src/code/code_800A9F30.c
diff options
context:
space:
mode:
authorJoshDuMan <40190173+JoshDuMan@users.noreply.github.com>2020-03-24 14:38:55 -0400
committerGitHub <noreply@github.com>2020-03-24 14:38:55 -0400
commit234b954473e05009326b017b34e7a2bbe77a3de1 (patch)
tree3cbbac4cc24bf81c4a35fe270ba8fddc993f23bf /src/code/code_800A9F30.c
parent2c7a339a81ddb3698bac0a3bb4238dd3e65d34ce (diff)
parent4eb7f023f348151fb73f4a0850a6f348280d7805 (diff)
Bring up to master.
Diffstat (limited to 'src/code/code_800A9F30.c')
-rw-r--r--src/code/code_800A9F30.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/src/code/code_800A9F30.c b/src/code/code_800A9F30.c
index c5248faca..ddc8c0223 100644
--- a/src/code/code_800A9F30.c
+++ b/src/code/code_800A9F30.c
@@ -5,26 +5,23 @@
extern u8 D_80160FD0[];
extern PadMgr gPadMgr;
-void func_800A9F30(s32 a, s32 b)
-{
+void func_800A9F30(s32 a, s32 b) {
func_800D2E30(&D_80160FD0);
func_800C7948(a, &D_80160FD0);
}
-void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
-{
+void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
s32 temp1, temp2;
- if (1000000.0f < a)
+ if (1000000.0f < a) {
temp1 = 1000;
- else
+ } else {
temp1 = sqrtf(a);
+ }
- if ((temp1 < 1000) && (b != 0) && (d != 0))
- {
+ if ((temp1 < 1000) && (b != 0) && (d != 0)) {
temp2 = b - (temp1 * 255) / 1000;
- if (temp2 > 0)
- {
+ if (temp2 > 0) {
D_801610DA = temp2;
D_80160FD0[0x10B] = c;
D_80160FD0[0x10C] = d;
@@ -35,49 +32,38 @@ void func_800A9F6C(f32 a, u8 b, u8 c, u8 d)
#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA000.s")
// this function is very similar to the one above but has a loop in it I can't figure out
-void func_800AA0B4(void)
-{
+void func_800AA0B4(void) {
func_800D3140(&D_80160FD0);
gPadMgr.unk_460 = func_800A9F30;
gPadMgr.unk_464 = 0;
- if (0) ; // Necessary to match
+ if (0) {} // Necessary to match
}
-#ifdef NON_MATCHING
-void func_800AA0F0(void)
-{
- if ((gPadMgr.unk_460 == func_800A9F30) && (gPadMgr.unk_464 == 0))
- {
- // asm loads/writes directly to 0x80166D20 and 0x80166D24
- // but the compiler wants to reuse offsets from 0x801668C0
- gPadMgr.unk_460 = NULL;
- gPadMgr.unk_464 = 0;
+void func_800AA0F0(void) {
+ PadMgr* padmgr = &gPadMgr;
+
+ if ((padmgr->unk_460 == func_800A9F30) && (padmgr->unk_464 == 0)) {
+ padmgr->unk_460 = NULL;
+ padmgr->unk_464 = 0;
}
func_800D3178(&D_80160FD0);
}
-#else
-#pragma GLOBAL_ASM("asm/non_matchings/code/code_800A9F30/func_800AA0F0.s")
-#endif
-u32 func_800AA148(void)
-{
+u32 func_800AA148(void) {
return ((gPadMgr.unk_2AE[0] ^ 1) == 0);
}
-void func_800AA15C(void)
-{
+void func_800AA15C(void) {
D_801610D4 = 2;
}
-void func_800AA16C(void)
-{
+void func_800AA16C(void) {
D_801610D4 = 0;
}
-void func_800AA178(u32 a)
-{
+void func_800AA178(u32 a) {
D_801610D5 = !!a;
}