2020-03-17 04:31:30 +00:00
|
|
|
#include <ultra64.h>
|
|
|
|
#include <global.h>
|
|
|
|
|
|
|
|
extern u8 D_80160FD0[];
|
|
|
|
extern PadMgr gPadMgr;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800A9F30(s32 a, s32 b) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800D2E30(&D_80160FD0);
|
2020-04-14 17:17:25 +00:00
|
|
|
PadMgr_RumbleSet(a, &D_80160FD0);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800A9F6C(f32 a, u8 b, u8 c, u8 d) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 temp1, temp2;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (1000000.0f < a) {
|
2020-03-17 04:31:30 +00:00
|
|
|
temp1 = 1000;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
temp1 = sqrtf(a);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((temp1 < 1000) && (b != 0) && (d != 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
temp2 = b - (temp1 * 255) / 1000;
|
2020-03-22 21:19:43 +00:00
|
|
|
if (temp2 > 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801610DA = temp2;
|
|
|
|
D_80160FD0[0x10B] = c;
|
|
|
|
D_80160FD0[0x10C] = 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
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800AA0B4(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_800D3140(&D_80160FD0);
|
|
|
|
|
2020-04-14 17:17:25 +00:00
|
|
|
gPadMgr.retraceCallback = func_800A9F30;
|
|
|
|
gPadMgr.retraceCallbackValue = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (0) {} // Necessary to match
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800AA0F0(void) {
|
2020-03-18 00:09:21 +00:00
|
|
|
PadMgr* padmgr = &gPadMgr;
|
|
|
|
|
2020-04-14 17:17:25 +00:00
|
|
|
if (((void*)padmgr->retraceCallback == (void*)func_800A9F30) && (padmgr->retraceCallbackValue == 0)) {
|
|
|
|
padmgr->retraceCallback = NULL;
|
|
|
|
padmgr->retraceCallbackValue = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func_800D3178(&D_80160FD0);
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
u32 func_800AA148(void) {
|
2020-04-14 17:17:25 +00:00
|
|
|
return ((gPadMgr.pakType[0] ^ 1) == 0);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800AA15C(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801610D4 = 2;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800AA16C(void) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801610D4 = 0;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_800AA178(u32 a) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_801610D5 = !!a;
|
|
|
|
}
|