mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-29 15:18:24 -04:00
feat(decomp): serial idiom lane — func_80181FA8 (65 ins, head-crack, group worth 1066)
This commit is contained in:
@@ -297,87 +297,7 @@ INCLUDE_RODATA("asm/md_SC03_076/nonmatchings/md_SC03_076", D_801EF540);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_076/nonmatchings/md_SC03_076", func_801EFBB4);
|
||||
|
||||
void func_801F0210(void) {
|
||||
typedef struct { u32 *ot; u32 pad[4]; } Env_801F1520; /* 0x14 stride */
|
||||
typedef struct { u16 f0; u16 f2; } Prim4_801F1520;
|
||||
typedef struct {
|
||||
s16 f0; /* 0x00 */
|
||||
s16 f2; /* 0x02 */
|
||||
void *f4; /* 0x04 */
|
||||
void *f8; /* 0x08 */
|
||||
s16 fC; /* 0x0C */
|
||||
s16 fE; /* 0x0E */
|
||||
s16 f10; /* 0x10 */
|
||||
s16 f12; /* 0x12 */
|
||||
void *f14; /* 0x14 */
|
||||
Prim4_801F1520 *f18; /* 0x18 */
|
||||
void *f1C; /* 0x1C */
|
||||
} Panel_801F1520; /* 0x20 stride */
|
||||
|
||||
extern Env_801F1520 D_800AE7BC[];
|
||||
extern s16 D_8011512C;
|
||||
extern Panel_801F1520 *D_80115134;
|
||||
extern s32 D_801151D0;
|
||||
extern s16 D_800B9A02;
|
||||
|
||||
extern s32 *func_801F1520(s32 *out);
|
||||
extern s32 func_801F03C0(s32 ot, u8 *s, s16 c);
|
||||
extern s32 func_8005A600(s32, s32, s32, s32, s32);
|
||||
|
||||
s32 ot;
|
||||
Panel_801F1520 *s2;
|
||||
s16 n;
|
||||
s16 i;
|
||||
|
||||
ot = D_801151D0;
|
||||
s2 = D_80115134;
|
||||
|
||||
if (D_8011512C == 1 || D_8011512C == 2) {
|
||||
ot = (s32)func_801F1520((s32 *)ot);
|
||||
}
|
||||
|
||||
switch (D_8011512C) {
|
||||
case 0:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
n = 1;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
n = 5;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 10:
|
||||
case 11:
|
||||
n = 5;
|
||||
goto CALL;
|
||||
case 6:
|
||||
case 7:
|
||||
case 12:
|
||||
n = 1;
|
||||
CALL:
|
||||
ot = func_801F03C0(ot, (u8 *)(s2 + 5), 0);
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
ot = func_801F03C0(ot, (u8 *)s2, i);
|
||||
s2 += 1;
|
||||
}
|
||||
|
||||
func_8005A600(ot, 0, 0, 0x15, 0);
|
||||
|
||||
*(s32 *)ot = 0x02000000;
|
||||
*(s32 *)ot = (D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] & 0xFFFFFF) | 0x02000000;
|
||||
D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] =
|
||||
(D_800AE7BC[*(u16 *)&D_800B9A02].ot[2] & 0xFF000000) | ((u32)ot & 0xFFFFFF);
|
||||
|
||||
ot += 0x28;
|
||||
((struct { s32 f; } *)&D_801151D0)->f = ot;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_076/nonmatchings/md_SC03_076", func_801F0210);
|
||||
|
||||
typedef struct { s8 c[8]; } Blk8_8012C890_8017C348_801F03C0;
|
||||
typedef struct { s16 m[3][3]; s32 t[3]; } MTX_C974_801F03C0;
|
||||
|
||||
@@ -440,157 +440,7 @@ INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E38B4);
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E3C1C);
|
||||
|
||||
typedef struct {
|
||||
char c[3];
|
||||
} Blk3_801E40A8;
|
||||
|
||||
extern char *strcpy(char *, const char *);
|
||||
extern u32 func_801E45C0(s32 a0, s32 a1);
|
||||
extern void func_801E4628(val, n, dst, flag);
|
||||
|
||||
extern void *D_801EAC58[]; /* status ptr per slot */
|
||||
extern void *D_801E6424[]; /* HUD prim ptr array per slot */
|
||||
extern char *D_801E632C[]; /* label strings */
|
||||
extern s32 D_801E65B8[]; /* level thresholds */
|
||||
extern u16 *D_801E6390[]; /* icon tables */
|
||||
extern char *D_801E634C;
|
||||
extern Blk3_801E40A8 D_801E26C0;
|
||||
|
||||
void func_801E40A8(void) {
|
||||
s16 k;
|
||||
s16 i;
|
||||
s16 j;
|
||||
u8 *p;
|
||||
void **arr;
|
||||
u32 a;
|
||||
u32 b;
|
||||
s32 r;
|
||||
s32 n;
|
||||
u16 *ico;
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
p = (u8 *)D_801EAC58[k];
|
||||
arr = (void **)D_801E6424[k];
|
||||
if (p != NULL) {
|
||||
for (i = 0; i < 7; i++) {
|
||||
strcpy((char *)arr[i], D_801E632C[i]);
|
||||
switch (i) {
|
||||
case 0:
|
||||
for (j = 0; j < 5; j++) {
|
||||
if (*(s16 *)(p + 8) < D_801E65B8[j]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (p[0x4E] != 0) {
|
||||
j = (*(s32 *)p == 0) ? 0x1A : 0x1C;
|
||||
}
|
||||
*(s32 *)arr = j + 4;
|
||||
break;
|
||||
case 1:
|
||||
a = p[7];
|
||||
if (a >= 100) {
|
||||
a = 99;
|
||||
}
|
||||
b = p[6];
|
||||
if (b >= 60) {
|
||||
b = 59;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)((func_801E45C0((u16)a, 0x18) | 0xB00000) |
|
||||
func_801E45C0(b, 0xC),
|
||||
5, (u8 *)arr[1] + 0x12, 0);
|
||||
break;
|
||||
case 2:
|
||||
a = *(u16 *)(p + 0x34);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(func_801E45C0((u16)a, 0x14), 3, (u8 *)arr[2] + 8, 1);
|
||||
n = p[0x42];
|
||||
if (n >= 7) {
|
||||
n = 6;
|
||||
}
|
||||
ico = D_801E6390[n];
|
||||
*(u16 *)((u8 *)arr[2] + 0x10) = *ico++;
|
||||
*(u16 *)((u8 *)arr[2] + 0x12) = ico[0];
|
||||
*(u16 *)((u8 *)arr[2] + 0x14) = ico[1];
|
||||
a = p[0x39];
|
||||
if (a >= 0x18) {
|
||||
a = 0x17;
|
||||
}
|
||||
b = p[0x38];
|
||||
if (b >= 0x3C) {
|
||||
b = 0x3B;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)((func_801E45C0((u16)a, 0x18) | 0xB00000) |
|
||||
func_801E45C0(b, 0xC),
|
||||
5, (u8 *)arr[2] + 0x18, 0);
|
||||
break;
|
||||
case 3:
|
||||
a = *(u16 *)(p + 0x3C);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
b = *(u16 *)(p + 0x3A);
|
||||
if (b >= 1000) {
|
||||
b = 999;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x14);
|
||||
if (r == 0) {
|
||||
r = 0xD00000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r | (func_801E45C0(b, 4) | 0xC0000), 7, (u8 *)arr[3] + 6, 1);
|
||||
break;
|
||||
case 4:
|
||||
a = *(u16 *)(p + 0x40);
|
||||
if (a >= 1000) {
|
||||
a = 999;
|
||||
}
|
||||
b = *(u16 *)(p + 0x3E);
|
||||
if (b >= 1000) {
|
||||
b = 999;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x14);
|
||||
if (r == 0) {
|
||||
r = 0xD00000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r | (func_801E45C0(b, 4) | 0xC0000), 7, (u8 *)arr[4] + 6, 1);
|
||||
break;
|
||||
case 5:
|
||||
a = *(u32 *)(p + 0x14);
|
||||
if (a > 99999) {
|
||||
a = 99999;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(func_801E45C0(a, 0xC), 5, (u8 *)arr[5] + 2, 1);
|
||||
break;
|
||||
case 6:
|
||||
a = *(u16 *)(p + 0xC);
|
||||
if (a >= 0x24) {
|
||||
a = 0x23;
|
||||
}
|
||||
r = func_801E45C0((u16)a, 0x18);
|
||||
if (r == 0) {
|
||||
r = 0xD000000;
|
||||
}
|
||||
((void (*)(unsigned int, short, unsigned short *, short))func_801E4628)(r, 2, (u8 *)arr[6] + 0x10, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 7; i++) {
|
||||
if (i == 0) {
|
||||
*(s32 *)arr = 4;
|
||||
} else if (i == 1) {
|
||||
strcpy((char *)arr[i], D_801E632C[i]);
|
||||
} else if (i == 4) {
|
||||
strcpy((char *)arr[i], D_801E634C);
|
||||
} else {
|
||||
*(Blk3_801E40A8 *)arr[i] = D_801E26C0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/md_SC03_135/nonmatchings/md_SC03_135", func_801E40A8);
|
||||
|
||||
u32 func_801E45C0(s32 a0, s32 a1) {
|
||||
s32 t0;
|
||||
|
||||
@@ -3471,12 +3471,7 @@ DEFINE_func_80172FEC() /* dedup: shared engine-core @0x80172fec (src/shared) */
|
||||
DEFINE_func_8017303C() /* dedup: shared engine-core @0x8017303c (src/shared) */
|
||||
|
||||
|
||||
s32 func_80173078(void *a0)
|
||||
{
|
||||
extern void (*D_8018194C[])();
|
||||
D_8018194C[*(u8 *)((s32)a0 + 0x214)]();
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_MAIN_012/nonmatchings/ov_MAIN_012_jr_80171B4C", func_80173078);
|
||||
|
||||
DEFINE_func_801730B4() /* dedup: shared engine-core @0x801730b4 (src/shared) */
|
||||
|
||||
|
||||
@@ -4493,15 +4493,7 @@ s32 param_1;
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_801EDA1C;
|
||||
extern s32 func_80182B00(s32 arg0);
|
||||
|
||||
void func_80180890(s32 arg0) {
|
||||
if (func_80182B00(arg0) != 0 || D_801EDA1C != 0) {
|
||||
*(s16 *)(arg0 + 2) = 1;
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC01_001/nonmatchings/ov_SC01_001_jr_8017D2DC", func_80180890);
|
||||
|
||||
|
||||
extern void (*D_80188E10[])(void);
|
||||
|
||||
@@ -5278,31 +5278,7 @@ s32 func_8017F6D8(s16 *a0) {
|
||||
return D_8018A904[(u16)a0[1]]();
|
||||
}
|
||||
|
||||
extern void func_8012A828(s32 a0, void *a1);
|
||||
extern void func_8012B23C(s32 a0);
|
||||
|
||||
extern M2C_UNK D_80186E48;
|
||||
extern int D_8018A928;
|
||||
|
||||
void func_8017F714(void)
|
||||
{
|
||||
register int param_1 __asm__("$4");
|
||||
int s0 = param_1;
|
||||
int iVar1;
|
||||
|
||||
func_8012A828(param_1, &D_80186E48);
|
||||
*(short *)(s0 + 2) = 2;
|
||||
*(short *)(s0 + 0x34) = 0;
|
||||
func_8012B23C(s0);
|
||||
*(int *)(s0 + 0x44) = 0;
|
||||
*(int *)(s0 + 0x48) = 0;
|
||||
iVar1 = D_8018A928;
|
||||
*(short *)(s0 + 0x5c) = 0;
|
||||
*(int *)(s0 + 0x1c) = 0x100;
|
||||
*(short *)(s0 + 0x84) = 0;
|
||||
*(int *)(s0 + 0x4c) = -iVar1;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC01_077/nonmatchings/ov_SC01_077_jr_8017AE2C", func_8017F714);
|
||||
|
||||
// @class: struct
|
||||
// @stuck: none — MATCH (26 ins)
|
||||
|
||||
@@ -5682,60 +5682,7 @@ void func_801813D4(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
void func_80181410(s32 param_1)
|
||||
{
|
||||
u16 sp10[3];
|
||||
u16 sp18[3];
|
||||
u16 sp20[4];
|
||||
u16 sp28[4];
|
||||
u16 sp30[16];
|
||||
s32 v0;
|
||||
s32 t2;
|
||||
s32 t3;
|
||||
u16 c;
|
||||
u16 t;
|
||||
|
||||
sp20[0] = *(u16 *)(param_1 + 6);
|
||||
sp20[1] = *(u16 *)(param_1 + 0xA);
|
||||
sp20[2] = *(u16 *)(param_1 + 0xE);
|
||||
func_800D20C0((void *)sp20, (void *)sp28, 1);
|
||||
t2 = (s32)&sp28[0];
|
||||
__asm__ __volatile__("" : "=r"(t2));
|
||||
func_800D23D0((void *)t2);
|
||||
sp28[2] = sp28[1] * 2;
|
||||
t3 = (s32)&sp28[0];
|
||||
__asm__ __volatile__("" : "=r"(t3));
|
||||
RotMatrixYXZ((void *)t3, (void *)sp30);
|
||||
if (*(s32 *)(param_1 + 0x1C) & 1) {
|
||||
v0 = (rand() & 0x7FF) + 0x600;
|
||||
} else {
|
||||
v0 = 0x500;
|
||||
}
|
||||
*(s32 *)(param_1 + 0x2C) = v0;
|
||||
func_801696D8(param_1, (s32)sp30);
|
||||
*(s32 *)(param_1 + 0x1C) = *(s32 *)(param_1 + 0x1C) - 1;
|
||||
if (*(s32 *)(param_1 + 0x1C) != -1) {
|
||||
sp10[0] = *(u16 *)(param_1 + 6);
|
||||
sp10[1] = *(u16 *)(param_1 + 0xA);
|
||||
sp10[2] = *(u16 *)(param_1 + 0xE);
|
||||
func_8012931C(param_1);
|
||||
sp18[0] = *(u16 *)(param_1 + 6);
|
||||
sp18[1] = *(u16 *)(param_1 + 0xA);
|
||||
sp18[2] = *(u16 *)(param_1 + 0xE);
|
||||
if (func_80135168(1, sp10, sp18) != 0) {
|
||||
t = *(u16 *)(param_1 + 2);
|
||||
*(u16 *)(param_1 + 6) = sp18[0];
|
||||
*(u16 *)(param_1 + 0xA) = sp18[1];
|
||||
c = sp18[2];
|
||||
*(s32 *)(param_1 + 0x1C) = 0xC;
|
||||
*(u16 *)(param_1 + 2) = t + 1;
|
||||
*(u16 *)(param_1 + 0xE) = c;
|
||||
}
|
||||
} else {
|
||||
func_801292C8((u8 *)param_1);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC01_080/nonmatchings/ov_SC01_080_jr_8017AE2C", func_80181410);
|
||||
|
||||
extern void (*D_8018A258[])(void);
|
||||
|
||||
|
||||
@@ -4941,31 +4941,7 @@ void func_801847F8(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
void func_80184834(s32 param_1) {
|
||||
extern s32 func_80014C54(s32, s32, s32);
|
||||
extern void func_8012A828(s32 a0, void *a1);
|
||||
extern s32 D_8018A978[];
|
||||
s16 v;
|
||||
u16 t;
|
||||
s32 iVar3;
|
||||
|
||||
v = func_80014C54(1, 0, 0x40);
|
||||
if (v != 0) {
|
||||
*(s16 *)(*(s32 *)(param_1 + 0x20) + 0x12) += 0x200;
|
||||
}
|
||||
v = func_80014C54(1, 0, 0x20);
|
||||
if (v != 0) {
|
||||
t = *(u16 *)(param_1 + 0xFC) + 1;
|
||||
*(u16 *)(param_1 + 0xFC) = t;
|
||||
iVar3 = *(s32 *)(D_8018A978[*(s16 *)(param_1 + 0x70)] + ((t << 16) >> 14));
|
||||
if (iVar3 == 0) {
|
||||
*(u16 *)(param_1 + 0xFC) = 0;
|
||||
iVar3 = *(s32 *)D_8018A978[*(s16 *)(param_1 + 0x70)];
|
||||
}
|
||||
func_8012A828(param_1, (void *)iVar3);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC01_084/nonmatchings/ov_SC01_084_jr_8017F690", func_80184834);
|
||||
|
||||
extern void func_8012C1B8(void);
|
||||
extern void func_8012CAE4(void *a0);
|
||||
|
||||
@@ -6532,39 +6532,7 @@ void func_80189A00(s32 param_1) {
|
||||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
s16 start;
|
||||
s16 end;
|
||||
} Range_80189A70;
|
||||
|
||||
extern u8 D_8018F71C[];
|
||||
extern s16 D_8018F71E;
|
||||
extern u32 func_80189DB8(u32, u32);
|
||||
|
||||
void func_80189A70(s32 *a0)
|
||||
{
|
||||
s32 v;
|
||||
s32 t;
|
||||
s32 c;
|
||||
Range_80189A70 range;
|
||||
|
||||
v = (s16)(*(u16 *)((s32)a0 + 0x100) -= 0x10);
|
||||
if (v < 0) {
|
||||
D_8018F71E = 1;
|
||||
func_8012AD44(a0, 0);
|
||||
return;
|
||||
}
|
||||
t = v << 8;
|
||||
if (v >= 0x20) {
|
||||
c = v | 0x202000;
|
||||
} else {
|
||||
c = v | ((v << 16) | t);
|
||||
}
|
||||
range.start = 0;
|
||||
range.end = 0x50;
|
||||
func_80189B1C(a0, &range, D_8018F71C, ((void * (*)(void))func_80189DB8)(a0, c));
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_000/nonmatchings/ov_SC02_000_jr_8018173C", func_80189A70);
|
||||
|
||||
#include "common.h"
|
||||
#include "/home/musashi/bfm-decomp/src/shared/engine_core.h"
|
||||
|
||||
@@ -4005,34 +4005,7 @@ void func_801857B0(s32 param_1) {
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_801E8750;
|
||||
|
||||
void func_80185840(s32 param_1) {
|
||||
s16 r;
|
||||
s16 t;
|
||||
u32 val;
|
||||
|
||||
func_80185C48(param_1, 0);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) += *(u16 *)(param_1 + 0xE0);
|
||||
t = *(s16 *)(param_1 + 0xE0);
|
||||
r = 0x80;
|
||||
if (t < 0x80) {
|
||||
r = t + *(u16 *)(param_1 + 0xE2);
|
||||
}
|
||||
*(s16 *)(param_1 + 0xE0) = r;
|
||||
D_801E8750 += 0x27D7D;
|
||||
val = (u32)D_801E8750 >> 16;
|
||||
if (val >= 0x80) {
|
||||
val = 0x7F;
|
||||
}
|
||||
func_8018623C(0x4DF, val + 0x1000);
|
||||
if (*(s32 *)(param_1 + 0x18) < -0xB9999) {
|
||||
*(s32 *)(param_1 + 0x18) = -0xB9999;
|
||||
*(s16 *)(param_1 + 2) = 0xB;
|
||||
func_8018623C(0x4DF, 0x107F);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_003/nonmatchings/ov_SC02_003_jr_8018173C", func_80185840);
|
||||
|
||||
|
||||
typedef struct { u32 addr:24; u32 len:8; } PTAG_85910;
|
||||
|
||||
@@ -5214,20 +5214,7 @@ void func_80185764(void *a0)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
extern s32 D_801E43C0[];
|
||||
extern F5C_S *D_801E43CC[];
|
||||
|
||||
void func_80185858(s32 arg0, void *arg1, void *arg2) {
|
||||
s32 *p = D_801E43C0;
|
||||
|
||||
if ((*p != 0) && (*(p++ + 1) != 0)) {
|
||||
return;
|
||||
}
|
||||
func_8018C598(D_801E43CC[(arg0 << 16) >> 16], arg1, arg2, p, 0x20, 0x80);
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_005/nonmatchings/ov_SC02_005_jr_80181D30", func_80185858);
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -4003,33 +4003,7 @@ extern s32 func_8012AD50(void *a0);
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012BEE8(s32 a0);
|
||||
extern u8 *func_801290DC(s32 a0, u8 *a1);
|
||||
extern void func_8012BF4C(s32 *a0, s32 a1);
|
||||
|
||||
void func_8017F468(s32 *s1) {
|
||||
u16 sp[4];
|
||||
s32 d, v;
|
||||
u8 *s0;
|
||||
|
||||
if (func_8012BEE8((s32)s1)) {
|
||||
func_80015978((s32)s1 + 4, (s32 *)sp);
|
||||
if (*(s32 *)((s8 *)s1 + 0xDC)) {
|
||||
v = rand() % 352;
|
||||
d = (v & 1) ? -v : v;
|
||||
sp[0] += d;
|
||||
v = rand() % 256;
|
||||
d = (v & 1) ? -v : v;
|
||||
sp[2] += d;
|
||||
}
|
||||
s0 = func_801290DC(0x27, (u8 *)sp);
|
||||
if (s0) {
|
||||
func_8012BF4C(s1, (rand() & 0x7F) + 0x60);
|
||||
*(u16 *)(s0 + 0x2E) = *(u16 *)((s8 *)s1 + 0xFC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_jr_8017C294", func_8017F468);
|
||||
|
||||
|
||||
extern void (*D_80183950[])(void);
|
||||
|
||||
@@ -3493,31 +3493,7 @@ int func_8017D9D8(short *a0) {
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_8012704C;
|
||||
|
||||
s32 func_8017DA5C(void) {
|
||||
s32 x;
|
||||
s32 r;
|
||||
|
||||
x = D_8012704C;
|
||||
if (x == 1) {
|
||||
r = 0x3B;
|
||||
} else {
|
||||
r = x < 2;
|
||||
if (r != 0) {
|
||||
if (x == 0) {
|
||||
r = 0x39;
|
||||
}
|
||||
} else {
|
||||
r = 2;
|
||||
if (x == 2) {
|
||||
r = 0x45;
|
||||
}
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_026/nonmatchings/ov_SC02_026_jr_8017C180", func_8017DA5C);
|
||||
|
||||
typedef struct { u8 b[8]; } Blk8_8017DAB8;
|
||||
typedef struct {
|
||||
|
||||
@@ -7945,37 +7945,7 @@ void func_80186C0C(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_801AFBD8[];
|
||||
extern s32 D_801AFBDC[];
|
||||
extern s32 D_801AFBE0[];
|
||||
extern s32 D_801AFBE4[];
|
||||
extern s32 D_801AFBE8[];
|
||||
extern s32 func_8012C51C(int a0, int a1);
|
||||
|
||||
void func_80186CE0(u16 *a0, s32 n)
|
||||
{
|
||||
s32 buf[5];
|
||||
s32 p;
|
||||
u16 *q;
|
||||
s32 t0, t1, t2, t3;
|
||||
|
||||
p = (s32)a0;
|
||||
t0 = D_801AFBD8[n * 5];
|
||||
t1 = D_801AFBDC[n * 5];
|
||||
t2 = D_801AFBE0[n * 5];
|
||||
t3 = D_801AFBE4[n * 5];
|
||||
buf[0] = t0;
|
||||
buf[1] = t1;
|
||||
buf[2] = t2;
|
||||
buf[3] = t3;
|
||||
buf[4] = D_801AFBE8[n * 5];
|
||||
q = (u16 *)buf;
|
||||
q[0] += *(u16 *)(p + 6);
|
||||
q[1] += *(u16 *)(p + 0xA);
|
||||
q[2] += *(u16 *)(p + 0xE);
|
||||
func_8012C51C((s32)buf, p);
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_027/nonmatchings/ov_SC02_027_jr_8017D898", func_80186CE0);
|
||||
|
||||
typedef struct {
|
||||
s32 a; /* 0x00 -> D_801D0120 */
|
||||
|
||||
@@ -4047,33 +4047,7 @@ void func_80186A7C(void) {
|
||||
void func_80186A84(void) {
|
||||
}
|
||||
|
||||
void func_80186A8C(void *arg0) {
|
||||
extern s32 D_80192A6C;
|
||||
extern s32 D_80192A64;
|
||||
extern s32 D_801C3C90;
|
||||
extern s32 D_801EB318;
|
||||
extern void func_80186C54(void);
|
||||
if (func_8018727C(arg0, &D_80192A6C) != 0) {
|
||||
s32 v0;
|
||||
s32 v1 = func_80029504();
|
||||
if (v1 < 0x1E) {
|
||||
v0 = 1;
|
||||
} else if (v1 < 0x46) {
|
||||
v0 = 4;
|
||||
} else {
|
||||
func_8012CAE4(arg0);
|
||||
return;
|
||||
}
|
||||
*(s16 *)((char *)arg0 + 2) = v0;
|
||||
func_8012E8E0((s32)arg0, (s32)&D_80192A64);
|
||||
func_80187750((s32)arg0);
|
||||
func_8012A828((s32)arg0, (s32)&D_801C3C90);
|
||||
func_8001C97C(&D_801EB318);
|
||||
*(s16 *)(*(s32 *)((char *)arg0 + 0x68) + 0xC) = 0x7FFF;
|
||||
*(s32 *)((char *)arg0 + 0xD4) = func_801788B8((s32)arg0, (s32)func_80186C54);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_001/nonmatchings/ov_SC03_001_jr_80184F64", func_80186A8C);
|
||||
|
||||
extern void func_8012C218(void *a0);
|
||||
|
||||
|
||||
@@ -4480,35 +4480,7 @@ void func_80186074(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
void func_8018611C(void *a0) {
|
||||
s32 sp10[3];
|
||||
extern void func_80185D3C(void *a0, s32 a1);
|
||||
extern void func_80185E3C(void *a0);
|
||||
extern void (*D_8018C678[])(void);
|
||||
s32 t;
|
||||
|
||||
if (func_8012CBCC() & 0x2000) {
|
||||
func_80146A6C(2, a0, 0, 0, 0, 3, 0x30000000);
|
||||
t = *(s32 *)((s32)a0 + 0x1C) + 1;
|
||||
*(s32 *)((s32)a0 + 0x1C) = t;
|
||||
if (t == 1) {
|
||||
sp10[0] = 0;
|
||||
sp10[1] = 0xFFFD0000;
|
||||
sp10[2] = 0x20000;
|
||||
func_8012B14C((s32)a0, sp10);
|
||||
return;
|
||||
}
|
||||
func_8012B200((u8 *)a0);
|
||||
func_8012A828(a0, (void *)&D_8018C678);
|
||||
*(u16 *)((s32)a0 + 0xF6) = *(u16 *)((s32)a0 + 0x76) - 8;
|
||||
*(u16 *)((s32)a0 + 0x98) = 0;
|
||||
*(u16 *)((s32)a0 + 2) += 1;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0x50;
|
||||
}
|
||||
func_80185D3C(a0, 0);
|
||||
func_80185E3C(a0);
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_007/nonmatchings/ov_SC03_007_jr_80183894", func_8018611C);
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -4263,103 +4263,7 @@ void func_8017FA4C(u8 *a0) {
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_801151D4;
|
||||
extern void func_8002D4C8(s32 a0, s32 a1);
|
||||
extern void func_80029514(s32);
|
||||
extern u8 D_801A8C34[];
|
||||
extern u8 D_801AA66C[];
|
||||
extern u16 D_80184F80[];
|
||||
extern u8 D_80184F8C[];
|
||||
extern int func_80178970(void);
|
||||
extern void func_80178D18(void);
|
||||
|
||||
|
||||
|
||||
void func_8017FAA8(s32 param_1) {
|
||||
s32 *ptr;
|
||||
s32 i;
|
||||
s32 *p = (s32 *)D_801151D4;
|
||||
SV3 sv;
|
||||
SV3 *svp;
|
||||
switch (*(u16 *)(param_1 + 0x34)) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
for (i = 0; i < 0x30; i++) {
|
||||
ptr = (s32 *)func_80143C74(param_1, 0);
|
||||
if (ptr != 0) {
|
||||
*(s32 *)(ptr + 4) = (rand() - 0x4000) * 0x10;
|
||||
*(s32 *)(ptr + 6) = (rand() - 0x4000) * 0x10;
|
||||
*(u16 *)((s32)ptr + 0x16) = -(rand() & 0x1F);
|
||||
*(s32 *)(ptr + 0x12) = -(*(s32 *)(ptr + 5) >> 4);
|
||||
sv.x = p[0x17] - *(s16 *)((s32)ptr + 6);
|
||||
sv.y = p[0x18] - *(s16 *)((s32)ptr + 0xA);
|
||||
sv.z = p[0x19] - *(s16 *)((s32)ptr + 0xE);
|
||||
svp = &sv;
|
||||
VectorNormalSS(svp, svp);
|
||||
*(s16 *)((s32)ptr + 6) += sv.x >> 6;
|
||||
*(s16 *)((s32)ptr + 0xA) += sv.y >> 6;
|
||||
*(s16 *)((s32)ptr + 0xE) += sv.z >> 6;
|
||||
}
|
||||
}
|
||||
*(s32 *)(param_1 + 0x1C) = 4;
|
||||
*(s16 *)(param_1 + 0x34) += 1;
|
||||
func_8002D4C8(0x9E2, 0);
|
||||
break;
|
||||
case 2:
|
||||
if (--*(s32 *)(param_1 + 0x1C) == 0) {
|
||||
func_8001C214(*(s32 *)(param_1 + 0x20), &D_801A8C34);
|
||||
func_8012A828(param_1, &D_801AA66C);
|
||||
*(s16 *)(param_1 + 0x34) = 0;
|
||||
func_8001AAA0(0x62);
|
||||
func_8002AC00(0x1C);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for (i = 0; i < 0x30; i++) {
|
||||
ptr = (s32 *)func_80143C74(param_1, 0);
|
||||
if (ptr != 0) {
|
||||
*(s32 *)(ptr + 4) = (rand() - 0x4000) * 0x10;
|
||||
*(s32 *)(ptr + 6) = (rand() - 0x4000) * 0x10;
|
||||
*(u16 *)((s32)ptr + 0x16) = -(rand() & 0x1F);
|
||||
*(s32 *)(ptr + 0x12) = -(*(s32 *)(ptr + 5) >> 4);
|
||||
sv.x = p[0x17] - *(s16 *)((s32)ptr + 6);
|
||||
sv.y = p[0x18] - *(s16 *)((s32)ptr + 0xA);
|
||||
sv.z = p[0x19] - *(s16 *)((s32)ptr + 0xE);
|
||||
svp = &sv;
|
||||
VectorNormalSS(svp, svp);
|
||||
*(s16 *)((s32)ptr + 6) += sv.x >> 6;
|
||||
*(s16 *)((s32)ptr + 0xA) += sv.y >> 6;
|
||||
*(s16 *)((s32)ptr + 0xE) += sv.z >> 6;
|
||||
func_8002D4C8(0x9E3, 0);
|
||||
}
|
||||
}
|
||||
*(s32 *)(param_1 + 0x1C) = 4;
|
||||
*(s16 *)(param_1 + 0x34) += 1;
|
||||
break;
|
||||
case 4:
|
||||
if (--*(s32 *)(param_1 + 0x1C) == 0) {
|
||||
func_8001AAA0(0x63);
|
||||
func_8001CA1C(*(s32 *)(param_1 + 0x20), &D_80184F80);
|
||||
func_8012A828(param_1, &D_80184F8C);
|
||||
*(s16 *)(param_1 + 0x34) += 1;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (func_80174774() != 0) {
|
||||
*(s32 *)(*(s32 *)(param_1 + 0x20) + 4) |= 0x80000000;
|
||||
*(s16 *)(param_1 + 0xE) = -0x600;
|
||||
*(s16 *)(param_1 + 0x34) += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (((s32 (*)(s32))func_80178970)(param_1) != 0) {
|
||||
((void (*)(s32))func_80178D18)(param_1);
|
||||
func_80029514(0x3d4);
|
||||
func_8012C218(param_1);
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_013/nonmatchings/ov_SC03_013_jr_8017C730", func_8017FAA8);
|
||||
|
||||
|
||||
extern void (*D_801850F8[])(void);
|
||||
|
||||
@@ -5694,7 +5694,44 @@ s32 arg0;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_091/nonmatchings/ov_SC03_091_jr_8018326C", func_8018771C);
|
||||
#include "common.h"
|
||||
|
||||
extern s32 *D_80126B78;
|
||||
extern u16 D_801A8C14[];
|
||||
extern u8 D_801152A8[];
|
||||
|
||||
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
|
||||
|
||||
/* DEF-SIDE ALIAS (§37/§124): TU:5199 already declares
|
||||
* `extern void func_8018771C(s32 a0, s32 a1);` at file scope, but the target .s
|
||||
* proves a non-void return: both exits write $v0 (addiu $v0,$zero,0x1 before the
|
||||
* epilogue; beqz $v0,.Lepilogue filled with addu $v0,$zero,$zero — a $v0-setting
|
||||
* fill reorg only permits when $v0 is live-out, §162f1). A plain `s32
|
||||
* func_8018771C` definition would be a conflicting-types error against TU:5199,
|
||||
* so define under a distinct C name bound to the emitted symbol. */
|
||||
s32 aF8018771C(s32 arg0, s32 arg1) __asm__("func_8018771C");
|
||||
|
||||
s32 aF8018771C(s32 arg0, s32 arg1) {
|
||||
s32 buf1[2];
|
||||
s32 buf2[2];
|
||||
s32 a1v;
|
||||
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)D_801A8C14, (s32)buf1);
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)(D_801A8C14 + 4), (s32)buf2);
|
||||
if (func_80135888(*(s32 *)(arg0 + 0x20), *(s32 *)(arg0 + 0x58), (s32)buf1, (s32)buf2) != 0) {
|
||||
if (*(u16 *)(arg0 + 0x70) & 0xF) {
|
||||
a1v = 0x2001;
|
||||
} else {
|
||||
a1v = 1;
|
||||
}
|
||||
func_8012F568(1, a1v, *(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12), arg1, (s32)buf2, (s32)D_801152A8);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012CC88(s32 a0, s32 a1, s32 a2);
|
||||
typedef struct {
|
||||
|
||||
@@ -5333,7 +5333,29 @@ void func_80180388(void *arg0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_095/nonmatchings/ov_SC03_095_jr_8017BEBC", func_8018049C);
|
||||
extern s32 *D_80126B78;
|
||||
extern s32 D_80194FE0;
|
||||
extern u8 D_801152A8[];
|
||||
|
||||
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
|
||||
|
||||
s32 func_8018049C_def(s32 arg0) __asm__("func_8018049C");
|
||||
|
||||
s32 func_8018049C_def(s32 arg0) {
|
||||
s32 buf1[2];
|
||||
s32 buf2[2];
|
||||
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)&D_80194FE0, (s32)buf1);
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)&D_80194FE0 + 8, (s32)buf2);
|
||||
if (func_80135888(*(s32 *)(arg0 + 0x20), *(s32 *)(arg0 + 0x58), (s32)buf1, (s32)buf2) != 0) {
|
||||
func_8012F568(1, 1, *(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12), 9, (s32)buf2, (s32)D_801152A8);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012B864(s32 a0);
|
||||
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
|
||||
|
||||
@@ -4794,7 +4794,39 @@ void func_80181F6C(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_116/nonmatchings/ov_SC03_116_jr_8017AE2C", func_80181FA8);
|
||||
extern void D_80194EE0;
|
||||
extern void D_801864E0;
|
||||
extern void D_801864C8;
|
||||
extern void D_801864D4;
|
||||
|
||||
void func_80181FA8(void *arg0) {
|
||||
s32 v;
|
||||
if ((u8)func_80029178(0x11C) != 0) {
|
||||
func_8012CAE4(arg0);
|
||||
return;
|
||||
}
|
||||
*(u32 *)((s32)arg0 + 0x20) = (u32)func_8012C1B8();
|
||||
if (*(u32 *)((s32)arg0 + 0x20) == 0) {
|
||||
func_8012CAE4(arg0);
|
||||
return;
|
||||
}
|
||||
func_8001C810(*(u32 *)((s32)arg0 + 0x20), &D_80194EE0);
|
||||
*(u32 *)(*(u32 *)((s32)arg0 + 0x20) + 4) |= 0x8000;
|
||||
*(u32 *)((s32)arg0 + 0x58) = 0x40000000 | (u32)&D_801864E0;
|
||||
*(u16 *)((s32)arg0 + 0x5C) = 0xC800;
|
||||
*(u16 *)&D_801864C8 = 0;
|
||||
*(u16 *)&D_801864D4 = 0;
|
||||
*(u32 *)(*(u32 *)((s32)arg0 + 0x20) + 0x20) = (u32)&D_801864C8;
|
||||
v = *(u32 *)((s32)arg0 + 0x20);
|
||||
*(u16 *)((s32)arg0 + 0xE4) = 0x80;
|
||||
*(u16 *)((s32)arg0 + 0xE2) = 0x80;
|
||||
*(u16 *)((s32)arg0 + 0xE0) = 0x80;
|
||||
*(s16 *)((s32)arg0 + 0xE6) = -2;
|
||||
*(u16 *)(v + 0x2C) |= 0x80;
|
||||
*(u32 *)(*(u32 *)((s32)arg0 + 0x20) + 0x80) = (u32)arg0 + 0xE0;
|
||||
*(u16 *)((s32)arg0 + 2) += 1;
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_8012E57C(s32 a0, s32 a1);
|
||||
extern s32 func_8012E544(s32 a0);
|
||||
|
||||
Reference in New Issue
Block a user