2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
2020-04-19 02:56:53 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2021-02-14 00:49:40 +00:00
|
|
|
|
2020-04-19 02:56:53 +00:00
|
|
|
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);
|
2021-02-14 00:49:40 +00:00
|
|
|
} else if (arg0->unk_04[index] < arg0->unk_04[i]) {
|
|
|
|
index = i;
|
|
|
|
arg0->rumbleEnable[0] = (unk_a3 >= 0x100);
|
2020-04-19 02:56:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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));
|
|
|
|
}
|