mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-14 05:19:36 +00:00
174af7384d
* cleanup libultra * fixes - use quotes instead of <> for includes - add macros for zelda specific thread priorities - fix Makefile - properly format the remaining pfs structs * fix button macros + add CHECK_BTN_ANY/CHECK_BTN_ALL * remove ULTRA_ABS * fix includes * update z_player.c/z_lib.c + run format.sh * merge upstream/master * fix include in En_Goroiwa * fix includes
123 lines
3.4 KiB
C
123 lines
3.4 KiB
C
#include "global.h"
|
|
|
|
void func_800D2E30(UnkRumbleStruct* arg0) {
|
|
s32 i;
|
|
s32 unk_a3;
|
|
s32 index = -1;
|
|
UnkRumbleStruct* new_var;
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
arg0->rumbleEnable[i] = 0;
|
|
}
|
|
|
|
if (arg0->unk_105 == 0) {
|
|
new_var = arg0;
|
|
if (D_8012DBB0 != 0) {
|
|
for (i = 0; i < 4; i++) {
|
|
gPadMgr.pakType[i] = 0;
|
|
}
|
|
}
|
|
D_8012DBB0 = new_var->unk_105;
|
|
return;
|
|
}
|
|
D_8012DBB0 = arg0->unk_105;
|
|
|
|
if (arg0->unk_104 == 2) {
|
|
for (i = 0; i < 4; ++i) {
|
|
gPadMgr.pakType[i] = 0;
|
|
}
|
|
|
|
for (i = 0; i < 0x40; i++) {
|
|
arg0->unk_C4[i] = 0;
|
|
arg0->unk_84[i] = 0;
|
|
arg0->unk_44[i] = 0;
|
|
arg0->unk_04[i] = 0;
|
|
}
|
|
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
|
arg0->unk_104 = 1;
|
|
}
|
|
if (arg0->unk_104 != 0) {
|
|
for (i = 0; i < 0x40; i++) {
|
|
|
|
if (arg0->unk_04[i] != 0) {
|
|
if (arg0->unk_44[i] > 0) {
|
|
arg0->unk_44[i]--;
|
|
} else {
|
|
unk_a3 = arg0->unk_04[i] - arg0->unk_84[i];
|
|
if (unk_a3 > 0) {
|
|
arg0->unk_04[i] = unk_a3;
|
|
} else {
|
|
arg0->unk_04[i] = 0;
|
|
}
|
|
}
|
|
|
|
unk_a3 = arg0->unk_C4[i] + arg0->unk_04[i];
|
|
arg0->unk_C4[i] = unk_a3;
|
|
if (index == -1) {
|
|
index = i;
|
|
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
} else {
|
|
|
|
if (arg0->unk_04[index] < arg0->unk_04[i]) {
|
|
index = i;
|
|
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (arg0->unk_10A != 0) {
|
|
if (arg0->unk_10B > 0) {
|
|
arg0->unk_10B--;
|
|
} else {
|
|
unk_a3 = arg0->unk_10A - arg0->unk_10C;
|
|
if (unk_a3 > 0) {
|
|
arg0->unk_10A = unk_a3;
|
|
} else {
|
|
arg0->unk_10A = 0;
|
|
}
|
|
}
|
|
unk_a3 = arg0->unk_10D + arg0->unk_10A;
|
|
arg0->unk_10D = unk_a3;
|
|
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
|
}
|
|
if (arg0->unk_10A != 0) {
|
|
unk_a3 = arg0->unk_10A;
|
|
} else {
|
|
if (index == -1) {
|
|
unk_a3 = 0;
|
|
} else {
|
|
unk_a3 = arg0->unk_04[index];
|
|
}
|
|
}
|
|
if (unk_a3 == 0) {
|
|
if ((++arg0->unk_108) >= 6) {
|
|
arg0->unk_106 = 0;
|
|
arg0->unk_108 = 5;
|
|
}
|
|
} else {
|
|
arg0->unk_108 = 0;
|
|
if ((++arg0->unk_106) >= 0x1C21) {
|
|
arg0->unk_104 = 0;
|
|
}
|
|
}
|
|
} else {
|
|
for (i = 0; i < 0x40; i++) {
|
|
arg0->unk_C4[i] = 0;
|
|
arg0->unk_84[i] = 0;
|
|
arg0->unk_44[i] = 0;
|
|
arg0->unk_04[i] = 0;
|
|
}
|
|
|
|
arg0->unk_106 = arg0->unk_108 = arg0->unk_10A = arg0->unk_10B = arg0->unk_10C = arg0->unk_10D = 0;
|
|
}
|
|
}
|
|
|
|
void func_800D3140(UnkRumbleStruct* arg0) {
|
|
bzero(arg0, sizeof(UnkRumbleStruct));
|
|
arg0->unk_104 = 2;
|
|
arg0->unk_105 = 1;
|
|
}
|
|
|
|
void func_800D3178(UnkRumbleStruct* arg0) {
|
|
bzero(arg0, sizeof(UnkRumbleStruct));
|
|
}
|