mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-29 15:18:24 -04:00
feat(decomp): parallel gate — 3 fns across 3 binaries (12 workers)
md_MAIN_013 func_800CB56C ov_SC04_003 func_80180FB8 ov_SC04_005 func_80187548
This commit is contained in:
@@ -305,7 +305,71 @@ void func_800CB510(void *arg0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/md_MAIN_013/nonmatchings/md_MAIN_013", func_800CB56C);
|
||||
#include "common.h"
|
||||
|
||||
void func_800CB56C(s32 arg0) {
|
||||
|
||||
typedef struct { s32 w[8]; } Blk20;
|
||||
|
||||
extern Blk20 D_800AE620;
|
||||
extern void RotMatrixZ(s32 a0, void *a1);
|
||||
extern void ApplyMatrixSV();
|
||||
extern void MulMatrix0(s32 a0, void *a1, s32 a2);
|
||||
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80128ED8(s32 param_1, s32 *param_2);
|
||||
extern void func_80146C3C();
|
||||
|
||||
u16 vec[8];
|
||||
Blk20 blk;
|
||||
|
||||
s32 ent;
|
||||
s32 obj;
|
||||
s32 ang;
|
||||
register s32 ang2 __asm__("$4");
|
||||
|
||||
obj = *(s32 *)(arg0 + 0x20);
|
||||
__asm__ __volatile__("" : : : "memory");
|
||||
ent = *(s32 *)(arg0 + 0x34);
|
||||
__asm__ __volatile__("" : : : "memory");
|
||||
{ register Blk20 *s __asm__("$5") = &D_800AE620; s32 t0, t1, t2;
|
||||
__asm__ __volatile__("" : "=r"(s) : "0"(s));
|
||||
t0 = s->w[0]; t1 = s->w[1]; t2 = s->w[2];
|
||||
blk.w[0] = t0; blk.w[1] = t1; blk.w[2] = t2;
|
||||
t0 = s->w[3]; t1 = s->w[4]; t2 = s->w[5];
|
||||
blk.w[3] = t0; blk.w[4] = t1; blk.w[5] = t2;
|
||||
t0 = s->w[6]; t1 = s->w[7];
|
||||
blk.w[6] = t0; blk.w[7] = t1; }
|
||||
ang = *(s16 *)(arg0 + 0x10);
|
||||
{ void *q = &blk; RotMatrixZ(ang, q); __asm__ __volatile__("" : "=r"(q)); }
|
||||
vec[0] = *(s32 *)(arg0 + 0x30) << 2;
|
||||
vec[1] = 0;
|
||||
vec[2] = 0x30;
|
||||
{ void *q = &blk; ApplyMatrixSV(q, vec, vec); __asm__ __volatile__("" : "=r"(q)); }
|
||||
ent += 0x38;
|
||||
func_8012F14C(ent, (s32)vec, (s32)vec);
|
||||
*(s16 *)(arg0 + 6) = vec[0];
|
||||
*(s16 *)(arg0 + 0xA) = vec[1];
|
||||
ang2 = ang + 0x200;
|
||||
__asm__ __volatile__("" : : : "memory");
|
||||
*(s16 *)(arg0 + 0xE) = vec[2];
|
||||
__asm__ __volatile__("" : : : "memory");
|
||||
{ register Blk20 *s __asm__("$7") = &D_800AE620;
|
||||
s32 t0, t1; register s32 t2 __asm__("$6");
|
||||
__asm__ __volatile__("" : "=r"(s) : "0"(s));
|
||||
t0 = s->w[0]; t1 = s->w[1]; t2 = s->w[2];
|
||||
blk.w[0] = t0; blk.w[1] = t1; blk.w[2] = t2;
|
||||
t0 = s->w[3]; t1 = s->w[4]; t2 = s->w[5];
|
||||
blk.w[3] = t0; blk.w[4] = t1; blk.w[5] = t2;
|
||||
t0 = s->w[6]; t1 = s->w[7];
|
||||
blk.w[6] = t0; blk.w[7] = t1; }
|
||||
{ void *q; __asm__ __volatile__("" : : : "memory"); q = &blk;
|
||||
RotMatrixZ(ang2, q); __asm__ __volatile__("" : "=r"(q)); }
|
||||
MulMatrix0(ent, &blk, arg0 + 0x38);
|
||||
if (func_80128ED8(obj, (s32 *)(arg0 + 0x24)) != 0) {
|
||||
((void (*)(s32))func_80146C3C)(arg0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_800CB6E4(void *arg0) {
|
||||
extern s32 func_80146A6C(s32, void *, s32, s32, s32, s32, s32);
|
||||
|
||||
@@ -6016,7 +6016,91 @@ void func_80180E8C(u8 *a0)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_003/nonmatchings/ov_SC04_003_jr_8017BEBC", func_80180FB8);
|
||||
|
||||
|
||||
typedef struct { short a, b, c; } SV3_801802D0;
|
||||
typedef struct { s16 a, b, c, d; } SV4x_80183E2C; /* 8-byte, align-2 quad of s16 */
|
||||
|
||||
|
||||
extern s32 D_80126B58;
|
||||
extern u16 D_80126B5E;
|
||||
extern u16 D_80126B62;
|
||||
extern u16 D_80126B66;
|
||||
|
||||
void func_80180FB8(s32 arg0, s32 arg1) {
|
||||
u16 w5e;
|
||||
u16 p6;
|
||||
u16 w66;
|
||||
u16 pE;
|
||||
s16 x;
|
||||
s16 y;
|
||||
s16 z;
|
||||
s16 lim;
|
||||
s32 wide;
|
||||
s16 t1n;
|
||||
s16 a3n;
|
||||
register s32 d __asm__("6");
|
||||
register s32 t1 __asm__("9");
|
||||
register s32 a3 __asm__("7");
|
||||
|
||||
if (*(u16 *)&D_80126B58 == 0x1A) {
|
||||
return;
|
||||
}
|
||||
w5e = D_80126B5E;
|
||||
p6 = *(u16 *)(arg0 + 6);
|
||||
d = w5e - p6;
|
||||
t1 = d;
|
||||
if ((s16)d < 0) {
|
||||
t1 = -d;
|
||||
}
|
||||
w66 = D_80126B66;
|
||||
pE = *(u16 *)(arg0 + 0xE);
|
||||
d = w66 - pE;
|
||||
a3 = d;
|
||||
if ((s16)d < 0) {
|
||||
a3 = -d;
|
||||
}
|
||||
x = *(s16 *)(arg0 + 0xA);
|
||||
y = *(s16 *)(arg1 + 8);
|
||||
lim = *(s16 *)&D_80126B62;
|
||||
if (lim < x + y) {
|
||||
return;
|
||||
}
|
||||
z = *(s16 *)(arg1 + 0xA);
|
||||
if (x + z < lim) {
|
||||
return;
|
||||
}
|
||||
wide = t1 << 16;
|
||||
t1 = wide >> 16;
|
||||
if (t1 >= 0x49) {
|
||||
return;
|
||||
}
|
||||
wide = a3 << 16;
|
||||
a3 = wide >> 16;
|
||||
if (a3 >= 0x49) {
|
||||
return;
|
||||
}
|
||||
if (lim < x + ((y + z) >> 1)) {
|
||||
D_80126B62 = x + y - 1;
|
||||
return;
|
||||
}
|
||||
t1n = t1;
|
||||
a3n = a3;
|
||||
if (t1n < a3n) {
|
||||
if ((s16)w66 > (s16)pE) {
|
||||
D_80126B66 = pE + 0x49;
|
||||
} else {
|
||||
D_80126B66 = pE - 0x49;
|
||||
}
|
||||
} else {
|
||||
if ((s16)w5e > (s16)p6) {
|
||||
D_80126B5E = p6 + 0x49;
|
||||
} else {
|
||||
D_80126B5E = p6 - 0x49;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
|
||||
|
||||
|
||||
@@ -10877,7 +10877,91 @@ void func_8018741C(void *a0)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_005/nonmatchings/ov_SC04_005_jr_8017BEBC", func_80187548);
|
||||
|
||||
|
||||
typedef struct { short a, b, c; } SV3_801802D0;
|
||||
typedef struct { s16 a, b, c, d; } SV4x_80183E2C; /* 8-byte, align-2 quad of s16 */
|
||||
|
||||
|
||||
extern s32 D_80126B58;
|
||||
extern u16 D_80126B5E;
|
||||
extern u16 D_80126B62;
|
||||
extern u16 D_80126B66;
|
||||
|
||||
void func_80187548(s32 arg0, s32 arg1) {
|
||||
u16 w5e;
|
||||
u16 p6;
|
||||
u16 w66;
|
||||
u16 pE;
|
||||
s16 x;
|
||||
s16 y;
|
||||
s16 z;
|
||||
s16 lim;
|
||||
s32 wide;
|
||||
s16 t1n;
|
||||
s16 a3n;
|
||||
register s32 d __asm__("6");
|
||||
register s32 t1 __asm__("9");
|
||||
register s32 a3 __asm__("7");
|
||||
|
||||
if (*(u16 *)&D_80126B58 == 0x1A) {
|
||||
return;
|
||||
}
|
||||
w5e = D_80126B5E;
|
||||
p6 = *(u16 *)(arg0 + 6);
|
||||
d = w5e - p6;
|
||||
t1 = d;
|
||||
if ((s16)d < 0) {
|
||||
t1 = -d;
|
||||
}
|
||||
w66 = D_80126B66;
|
||||
pE = *(u16 *)(arg0 + 0xE);
|
||||
d = w66 - pE;
|
||||
a3 = d;
|
||||
if ((s16)d < 0) {
|
||||
a3 = -d;
|
||||
}
|
||||
x = *(s16 *)(arg0 + 0xA);
|
||||
y = *(s16 *)(arg1 + 8);
|
||||
lim = *(s16 *)&D_80126B62;
|
||||
if (lim < x + y) {
|
||||
return;
|
||||
}
|
||||
z = *(s16 *)(arg1 + 0xA);
|
||||
if (x + z < lim) {
|
||||
return;
|
||||
}
|
||||
wide = t1 << 16;
|
||||
t1 = wide >> 16;
|
||||
if (t1 >= 0x49) {
|
||||
return;
|
||||
}
|
||||
wide = a3 << 16;
|
||||
a3 = wide >> 16;
|
||||
if (a3 >= 0x49) {
|
||||
return;
|
||||
}
|
||||
if (lim < x + ((y + z) >> 1)) {
|
||||
D_80126B62 = x + y - 1;
|
||||
return;
|
||||
}
|
||||
t1n = t1;
|
||||
a3n = a3;
|
||||
if (t1n < a3n) {
|
||||
if ((s16)w66 > (s16)pE) {
|
||||
D_80126B66 = pE + 0x49;
|
||||
} else {
|
||||
D_80126B66 = pE - 0x49;
|
||||
}
|
||||
} else {
|
||||
if ((s16)w5e > (s16)p6) {
|
||||
D_80126B5E = p6 + 0x49;
|
||||
} else {
|
||||
D_80126B5E = p6 - 0x49;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user