mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-01 15:43:06 -04:00
feat(decomp): ox wave en overlays — 14 banked
Committed before the main batch: gate_main reverts on failure and would take these with it.
This commit is contained in:
@@ -4572,7 +4572,39 @@ void func_8017F5DC(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_026/nonmatchings/ov_SC02_026_jr_8017C180", func_8017F6B0);
|
||||
extern s32 func_8012C51C(void *a0, s32 a1);
|
||||
extern s32 D_801A5460;
|
||||
extern s32 D_801A5464;
|
||||
extern s32 D_801A5468;
|
||||
extern s32 D_801A546C;
|
||||
extern s32 D_801A5470;
|
||||
|
||||
void func_8017F6B0(void *a0, s32 a1) {
|
||||
s32 t0, t1, t2, t3, t4;
|
||||
s32 sp10[5];
|
||||
u16 *h;
|
||||
s32 off;
|
||||
|
||||
off = a1 * 20;
|
||||
t0 = *(s32 *)((char *)&D_801A5460 + off);
|
||||
t1 = *(s32 *)((char *)&D_801A5464 + off);
|
||||
t2 = *(s32 *)((char *)&D_801A5468 + off);
|
||||
t3 = *(s32 *)((char *)&D_801A546C + off);
|
||||
sp10[0] = t0;
|
||||
sp10[1] = t1;
|
||||
sp10[2] = t2;
|
||||
sp10[3] = t3;
|
||||
t4 = *(s32 *)((char *)&D_801A5470 + off);
|
||||
sp10[4] = t4;
|
||||
__asm__ __volatile__("" :: "r"(off));
|
||||
h = (u16 *)sp10;
|
||||
h[0] = h[0] + *(u16 *)((s32)a0 + 6);
|
||||
h[1] = h[1] + *(u16 *)((s32)a0 + 0xA);
|
||||
__asm__ __volatile__("" :: "r"(t3));
|
||||
h[2] = h[2] + *(u16 *)((s32)a0 + 0xE);
|
||||
func_8012C51C(sp10, (s32)a0);
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -3940,7 +3940,19 @@ INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_jr_8017DC70", func_801803B
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_jr_8017DC70", func_80180410);
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_jr_8017DC70", func_80180444);
|
||||
extern u8 D_8018B8CC[];
|
||||
extern s32 D_801C0028;
|
||||
|
||||
void func_80180444(void *arg0) {
|
||||
*(u16 *)(*(s32 *)((u8 *)arg0 + 0x20) + 0x10) = 0;
|
||||
*(u16 *)((u8 *)arg0 + 0x5C) = 0;
|
||||
*(u8 *)((u8 *)arg0 + 0xC2) = 0;
|
||||
func_8012B14C((s32)arg0, (s32)D_8018B8CC);
|
||||
func_8012A828((s32)arg0, (void *)&D_801C0028);
|
||||
*(s32 *)((u8 *)arg0 + 0x1C) = 0;
|
||||
*(u8 *)((u8 *)arg0 + 0x109) = 0x28;
|
||||
}
|
||||
|
||||
|
||||
extern void func_800291C8(s32, s32);
|
||||
extern void func_8002D4C8(s32 a0, s32 a1);
|
||||
|
||||
@@ -4962,7 +4962,102 @@ extern s32 func_8012AD50(void *a0);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_030/nonmatchings/ov_SC03_030_jr_8017AE2C", func_8017F6E0);
|
||||
#define gte_SetRotMatrix(r0) __asm__ volatile ( \
|
||||
"lw $12, 0( %0 );" \
|
||||
"lw $13, 4( %0 );" \
|
||||
"ctc2 $12, $0;" \
|
||||
"ctc2 $13, $1;" \
|
||||
"lw $12, 8( %0 );" \
|
||||
"lw $13, 12( %0 );" \
|
||||
"lw $14, 16( %0 );" \
|
||||
"ctc2 $12, $2;" \
|
||||
"ctc2 $13, $3;" \
|
||||
"ctc2 $14, $4" \
|
||||
: \
|
||||
: "r"( r0 ) \
|
||||
: "$12", "$13", "$14" )
|
||||
#define gte_SetTransMatrix(r0) __asm__ volatile ( \
|
||||
"lw $12, 20( %0 );" \
|
||||
"lw $13, 24( %0 );" \
|
||||
"ctc2 $12, $5;" \
|
||||
"lw $14, 28( %0 );" \
|
||||
"ctc2 $13, $6;" \
|
||||
"ctc2 $14, $7" \
|
||||
: \
|
||||
: "r"( r0 ) \
|
||||
: "$12", "$13", "$14" )
|
||||
|
||||
#define gte_ldv0(r0) __asm__ volatile ( \
|
||||
"lwc2 $0, 0( %0 );" \
|
||||
"lwc2 $1, 4( %0 )" \
|
||||
: \
|
||||
: "r"( r0 ) )
|
||||
#define gte_rtps() __asm__ volatile ("nop;nop;rtps")
|
||||
#define gte_stsxy(r0) __asm__ volatile ( \
|
||||
"swc2 $14, 0( %0 )" \
|
||||
: \
|
||||
: "r"( r0 ) \
|
||||
: "memory" )
|
||||
#define gte_stflg(r0) __asm__ volatile ( \
|
||||
"cfc2 $12, $31;" \
|
||||
"nop;" \
|
||||
"sw $12, 0( %0 )" \
|
||||
: \
|
||||
: "r"( r0 ) \
|
||||
: "$12", "memory" )
|
||||
|
||||
extern void (*D_80186464[])(void);
|
||||
extern u8 D_800AF648[];
|
||||
extern u16 D_800AF7BE;
|
||||
extern void func_80015978(s32, s32 *);
|
||||
extern u8 *func_801290DC(s32, u8 *);
|
||||
|
||||
void func_8017F6E0(int param_1)
|
||||
{
|
||||
s16 sxy[4]; /* sp+0x10 */
|
||||
s32 flag[1]; /* sp+0x18 */
|
||||
u8 *rec;
|
||||
u8 *fld;
|
||||
u8 *hit;
|
||||
u8 *m;
|
||||
|
||||
rec = (u8 *)D_80186464[*(s16 *)((s32)param_1 + 0xFC)];
|
||||
m = D_800AF648;
|
||||
gte_SetRotMatrix(m);
|
||||
gte_SetTransMatrix(m);
|
||||
|
||||
func_80015978((s32)param_1 + 4, (s32 *)sxy);
|
||||
gte_ldv0(sxy);
|
||||
gte_rtps();
|
||||
gte_stsxy(sxy);
|
||||
gte_stflg(flag);
|
||||
|
||||
if ((-(s32)D_800AF7BE / 2 < sxy[1]) && (sxy[1] < (s32)(((u32)D_800AF7BE >> 1) + 0x20)) && (flag[0] >= 0)) {
|
||||
u16 temp[4]; /* sp+0x20 */
|
||||
if (*(s32 *)((s32)param_1 + 0x1C) == 0) {
|
||||
if (*(s16 *)(rec + 6) != 0xFF) {
|
||||
fld = rec + 8;
|
||||
do {
|
||||
temp[0] = *(u16 *)((s32)param_1 + 6);
|
||||
temp[1] = *(u16 *)((s32)param_1 + 0xA);
|
||||
temp[2] = *(u16 *)((s32)param_1 + 0xE);
|
||||
temp[0] += *(u16 *)(rec + 0);
|
||||
temp[1] += *(u16 *)(fld - 6);
|
||||
temp[2] += *(u16 *)(fld - 4);
|
||||
hit = func_801290DC(0x25, (u8 *)temp);
|
||||
if (hit != 0) {
|
||||
*(s32 *)(hit + 0x2C) = *(s16 *)(fld - 2);
|
||||
}
|
||||
fld += 8;
|
||||
rec += 8;
|
||||
} while (*(s16 *)(fld - 2) != 0xFF);
|
||||
}
|
||||
*(s32 *)((s32)param_1 + 0x1C) = *(s32 *)((s32)param_1 + 0xDC);
|
||||
}
|
||||
*(s32 *)((s32)param_1 + 0x1C) = *(s32 *)((s32)param_1 + 0x1C) - 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -8845,7 +8845,32 @@ void func_80187C64(s32 a0, s32 a1)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_090/nonmatchings/ov_SC03_090_jr_8017CA80", func_80187CBC);
|
||||
#include "common.h"
|
||||
|
||||
extern s32 *D_80126B78;
|
||||
extern u8 D_801A906C[];
|
||||
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);
|
||||
|
||||
void func_80187CBC(s32 arg0) {
|
||||
register s32 rv __asm__("$2");
|
||||
s32 buf1[2];
|
||||
s32 buf2[2];
|
||||
|
||||
((void (*)(s32, s32, s32))func_8012F14C)((s32)D_80126B78 + 0x34, (s32)D_801A906C, (s32)buf1);
|
||||
((void (*)(s32, s32, s32))func_8012F14C)((s32)D_80126B78 + 0x34, (s32)(D_801A906C + 8), (s32)buf2);
|
||||
if (func_80135888(*(s32 *)(arg0 + 0x20), *(s32 *)(arg0 + 0x58), (s32)buf1, (s32)buf2) == 0) {
|
||||
rv = 0;
|
||||
} else {
|
||||
func_8012F568(1, 0x201, *(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12), 0x23, (s32)buf2, (s32)D_801152A8);
|
||||
rv = 1;
|
||||
}
|
||||
__asm__ __volatile__("" : "=r"(rv) : "0"(rv));
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -7239,7 +7239,27 @@ void func_801837FC(void *arg0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_094/nonmatchings/ov_SC03_094_jr_8017BEBC", func_80183910);
|
||||
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern u8 D_801152A8[];
|
||||
|
||||
s32 aF80183910(s32 arg0) __asm__("func_80183910");
|
||||
s32 aF80183910(s32 arg0) {
|
||||
extern s32 *D_80126B78;
|
||||
extern u8 D_801AE940[];
|
||||
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
|
||||
s32 buf1[2];
|
||||
s32 buf2[2];
|
||||
|
||||
((void (*)(s32, s32, s32))func_8012F14C)((s32)D_80126B78 + 0x34, (s32)D_801AE940, (s32)buf1);
|
||||
((void (*)(s32, s32, s32))func_8012F14C)((s32)D_80126B78 + 0x34, (s32)(D_801AE940 + 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);
|
||||
|
||||
@@ -3971,7 +3971,37 @@ void func_80184AE8(void *arg0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_097/nonmatchings/ov_SC03_097_jr_80182B9C", func_80184BFC);
|
||||
extern void func_8012F14C(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80135888(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
|
||||
/* §37/§124 def-side asm-label alias: TU:3710 declares `extern void func_80184BFC(s32 a0);`
|
||||
* for its discarding caller (TU:3742), but the byte-true def must return s32 ($v0 = 1/0 on
|
||||
* both exits; a void def DCEs them -> 43 ins). Neither side can move (the caller discards,
|
||||
* so widening the shared decl is not available from the splice point), so the definition
|
||||
* takes a private C identifier and binds the emitted symbol with a GNU asm label.
|
||||
* Zero blast radius: the TU's declaration never meets the definition, and the emitted
|
||||
* symbol is unchanged. */
|
||||
s32 aF80184BFC(s32 arg0) __asm__("func_80184BFC");
|
||||
|
||||
s32 aF80184BFC(s32 arg0) {
|
||||
|
||||
extern s32 *D_80126B78;
|
||||
extern u8 D_8019EABC[];
|
||||
extern u8 D_801152A8[];
|
||||
extern void func_8012F568(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4, s32 a5);
|
||||
|
||||
s32 buf1[2];
|
||||
s32 buf2[2];
|
||||
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)D_8019EABC, (s32)buf1);
|
||||
func_8012F14C((s32)D_80126B78 + 0x34, (s32)(D_8019EABC + 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 void func_800484EC(s32 a0, s32 a1, s32 a2);
|
||||
extern void func_80049CAC(s32 a0, s32 a1);
|
||||
|
||||
@@ -3803,7 +3803,21 @@ s32 func_8017EBA8(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_105/nonmatchings/ov_SC03_105_jr_8017C8D0", func_8017EBF8);
|
||||
extern void func_8012C218(void *a0);
|
||||
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern u16 D_80126B96;
|
||||
extern void (*D_8018E038[])(void);
|
||||
|
||||
s32 func_8017EBF8(void *param_1, s32 param_2) {
|
||||
if (func_8012D5E4((s32)param_1, (s32)D_8018E038, (s32)D_8018E038 + 8, param_2) == 1) {
|
||||
u16 *flagp = &D_80126B96;
|
||||
*flagp |= 0x4200;
|
||||
func_8012C218(param_1);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void (*D_8018E12C[])(void);
|
||||
|
||||
@@ -3509,7 +3509,15 @@ void func_8017D460(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_121/nonmatchings/ov_SC03_121_jr_8017BEBC", func_8017D49C);
|
||||
extern s32 D_80185C5C;
|
||||
extern void func_8017D4C4(s32 param_1, s16 *param_2);
|
||||
|
||||
void func_8017D49C(s32 param_1) {
|
||||
s16 unused[4];
|
||||
|
||||
func_8017D4C4(param_1, (s16 *)&D_80185C5C);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @class: schedule
|
||||
|
||||
@@ -6279,7 +6279,34 @@ void func_80181040(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_124/nonmatchings/ov_SC03_124_jr_8017AE2C", func_8018107C);
|
||||
extern void func_8012A828(s32, s32);
|
||||
extern void func_8012E8E0(s32 a0, s32 a1);
|
||||
extern void func_801845FC(s32, s32, s32, s32);
|
||||
|
||||
s32 func_8018107C()
|
||||
{
|
||||
extern u8 D_801DE0E8[];
|
||||
extern s32 D_80190018[];
|
||||
extern s16 D_801B95F0;
|
||||
extern u8 D_80190020;
|
||||
|
||||
register s32 t __asm__("$4");
|
||||
register s32 s0 __asm__("$16");
|
||||
s32 a1v;
|
||||
s32 zv;
|
||||
u8 a3v;
|
||||
|
||||
s0 = t;
|
||||
*(u16 *)((s32)s0 + 2) = 2;
|
||||
func_8012A828(t, (s32)D_801DE0E8);
|
||||
func_8012E8E0((s32)s0, (s32)&D_80190018[0]);
|
||||
a1v = (s32)&D_801B95F0;
|
||||
zv = 0;
|
||||
a3v = D_80190020;
|
||||
*(u16 *)((s32)s0 + 0x34) = 0;
|
||||
func_801845FC((s32)s0, a1v, zv, a3v);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_124/nonmatchings/ov_SC03_124_jr_8017AE2C", func_801810E4);
|
||||
|
||||
|
||||
@@ -3596,6 +3596,70 @@ void func_8018654C(void)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_124/nonmatchings/ov_SC03_124_jr_80185C98", func_80186ED8);
|
||||
void func_80186ED8(void) {
|
||||
|
||||
extern s32 D_801151D0;
|
||||
extern s32 D_801151C8[];
|
||||
extern u16 xf02 __asm__("D_800B9A02");
|
||||
extern s16 xa __asm__("D_8011511A");
|
||||
extern u16 xb __asm__("D_8011511A");
|
||||
extern s32 xf168c(s32 a0) __asm__("func_8014168C");
|
||||
extern u8 D_80115138[];
|
||||
extern s32 D_801E2358;
|
||||
extern s32 D_80115130;
|
||||
extern s32 D_801E235C;
|
||||
extern s32 D_801BCB58;
|
||||
extern u8 D_800B9A15;
|
||||
extern u16 D_80115112;
|
||||
extern s16 D_801E1C88;
|
||||
|
||||
extern s32 func_80187B50(void);
|
||||
extern void func_80187EA0(void);
|
||||
extern s32 func_80188544(s32 a0, s32 a1);
|
||||
extern void func_80139954(void);
|
||||
extern s32 func_801376E8(s32 a0, s32 a1);
|
||||
extern void func_80137B80(void);
|
||||
extern void func_8002D4C8(s32 a0, s32 a1);
|
||||
|
||||
s32 pad[2];
|
||||
s32 v;
|
||||
s32 b;
|
||||
s32 r2;
|
||||
s32 ret;
|
||||
s16 rn;
|
||||
s32 *p30;
|
||||
u16 *p12;
|
||||
|
||||
D_801151D0 = ((s32 *)D_801151C8)[xf02];
|
||||
ret = func_80187B50();
|
||||
func_80187EA0();
|
||||
r2 = xf168c(xa);
|
||||
b = D_80115138[xb];
|
||||
if (D_801E2358 == 0) {
|
||||
v = func_80188544(b, (s16)r2);
|
||||
} else {
|
||||
v = D_801E2358;
|
||||
}
|
||||
if (v != 0) {
|
||||
p30 = &D_80115130;
|
||||
if (v != *p30) {
|
||||
*p30 = v;
|
||||
func_80139954();
|
||||
D_801E235C = func_801376E8(v, (s32)&D_801BCB58);
|
||||
}
|
||||
}
|
||||
func_80137B80();
|
||||
rn = ret;
|
||||
if (rn < 0) {
|
||||
func_80139954();
|
||||
D_800B9A15 = 0;
|
||||
if (D_801E1C88 == 0) {
|
||||
func_8002D4C8(0x474, 0);
|
||||
}
|
||||
p12 = &D_80115112;
|
||||
*p12 += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6812,7 +6812,55 @@ s32 func_80181F80(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_007/nonmatchings/ov_SC04_007_jr_8017BEBC", func_80182074);
|
||||
extern u8 D_801202A0[];
|
||||
extern s32 func_8012BC60(struct Vec *a0, struct Vec *a1);
|
||||
extern s32 func_8012B6D4(s16 *a0, s16 *a1);
|
||||
extern void func_8012B0B4(unsigned int *param_1, int param_2, int param_3);
|
||||
extern s32 func_8012CEB0(s32 a0, s32 a1, s32 a2);
|
||||
extern void func_8012ADE4(u8 *a0);
|
||||
|
||||
void func_80182074(s32 a0) {
|
||||
u8 *p;
|
||||
s16 *self4;
|
||||
unsigned int *sc;
|
||||
s32 i;
|
||||
s32 ang;
|
||||
s16 v10[4];
|
||||
s16 v18[4];
|
||||
s32 sp20[2];
|
||||
|
||||
i = 0;
|
||||
p = D_801202A0;
|
||||
self4 = (s16 *)(a0 + 4);
|
||||
sc = (unsigned int *)sp20;
|
||||
do {
|
||||
if ((*(u16 *)p == 0x1DC) && ((u8 *)a0 != p)) {
|
||||
if (func_8012BC60((struct Vec *)self4, (struct Vec *)(p + 4)) < 0x900) {
|
||||
ang = func_8012B6D4(self4, (s16 *)(p + 4));
|
||||
func_8012B0B4(sc, ang, 0x31);
|
||||
v18[0] = *(u16 *)(p + 6);
|
||||
v18[1] = *(u16 *)(p + 0xA);
|
||||
v18[2] = *(u16 *)(p + 0xE);
|
||||
v18[0] += sp20[0];
|
||||
v18[2] += sp20[0] >> 16;
|
||||
v10[0] = *(u16 *)(a0 + 0x3A);
|
||||
v10[1] = *(u16 *)(a0 + 0x3E);
|
||||
v10[2] = *(u16 *)(a0 + 0x42);
|
||||
if (func_8012CEB0((s32)v10, (s32)v18, 0) & 0x2000) {
|
||||
*(u16 *)(a0 + 6) = v18[0];
|
||||
*(u16 *)(a0 + 0xA) = v18[1];
|
||||
*(u16 *)(a0 + 0xE) = v18[2];
|
||||
return;
|
||||
}
|
||||
func_8012ADE4((u8 *)a0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
p += 0x10C;
|
||||
} while (i < 0x60);
|
||||
}
|
||||
|
||||
|
||||
extern s32 func_80132EF4(s32 a0, s32 a1);
|
||||
typedef struct { short a, b, c; } SV3_80181D44_801821DC; /* == the TU's own `SV3` (engine_types.h:612); renamed only because
|
||||
|
||||
@@ -3505,7 +3505,19 @@ void func_8017D5B8(void) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_009/nonmatchings/ov_SC04_009_jr_8017BEBC", func_8017D5E4);
|
||||
extern s32 func_8017D638();
|
||||
|
||||
void aF8017D5E4(void *param_1) __asm__("func_8017D5E4");
|
||||
|
||||
void aF8017D5E4(void *param_1) {
|
||||
*(u16 *)((s32)param_1 + 0x5C) = 0;
|
||||
*(s16 *)((s32)param_1 + 0xAE) = -1;
|
||||
*(u8 *)((s32)param_1 + 0xC1) = 0;
|
||||
*(u16 *)((s32)param_1 + 0x5E) = 0;
|
||||
func_8017D638();
|
||||
(*(u16 *)(*(s32 *)((s32)param_1 + 0x64) + 0xFE))--;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_009/nonmatchings/ov_SC04_009_jr_8017BEBC", func_8017D638);
|
||||
|
||||
|
||||
@@ -5075,7 +5075,7 @@ extern u8 D_80194C14[];
|
||||
extern void func_80189188();
|
||||
extern void func_80189270();
|
||||
extern void func_801439C0();
|
||||
extern void func_80183564();
|
||||
extern void func_80183564(s32 a0, s16 *a1);
|
||||
extern void func_80186300();
|
||||
extern void func_80184CCC();
|
||||
extern void func_80184DB8(s32 a0);
|
||||
@@ -5944,7 +5944,7 @@ extern void func_801863D4();
|
||||
extern void func_801863B4(s32 a0);
|
||||
extern void func_80184ABC();
|
||||
/* §183 SIGNATURE-cast-at-call: batch-wide spelling is (s32, s16 *). */
|
||||
extern void func_80183564(s32 a0, s16 *a1);
|
||||
extern void func_80183564();
|
||||
|
||||
void func_8018332C(s32 a0, s32 a1) {
|
||||
s32 v0;
|
||||
|
||||
@@ -3473,7 +3473,22 @@ int param_1;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC05_019/nonmatchings/ov_SC05_019_jr_8017D5C0", func_8017ED0C);
|
||||
void func_8017ED0C(s32 self) {
|
||||
extern void func_80148038(s32 a0, s32 a1);
|
||||
extern void func_80147460(s32 a0);
|
||||
extern void func_80161450(void *a0);
|
||||
extern void func_80147060(u8 *a0);
|
||||
extern void func_80171928(void *a0);
|
||||
|
||||
func_80148038(self, 0x1A000);
|
||||
func_80147460(self);
|
||||
if (((((s32 (*)(void *))func_80161450)((void *)self)) & 5) == 0) {
|
||||
return;
|
||||
}
|
||||
func_80147060((u8 *)self);
|
||||
func_80171928((void *)self);
|
||||
}
|
||||
|
||||
|
||||
extern void func_8016EE40(s32 a0, s32 a1, s32 a2);
|
||||
void func_8017ED68(void) {
|
||||
|
||||
@@ -3460,7 +3460,47 @@ void func_80186F78(s32 param_1) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_018/nonmatchings/ov_SC06_018_jr_80186270", func_80187038);
|
||||
extern void func_80187038(void);
|
||||
void func_80187038(void) {
|
||||
register s32 a0v __asm__("$4");
|
||||
extern u8 D_801CCEC0[];
|
||||
extern u8 D_801CC1E8[];
|
||||
extern s32 D_801B51FC[];
|
||||
extern s32 D_801B520C[];
|
||||
s32 e = a0v;
|
||||
s32 flags;
|
||||
|
||||
flags = *(s32 *)(e + 0xE0);
|
||||
if (flags & 4) {
|
||||
goto L_bit4;
|
||||
}
|
||||
if (flags & 0x800) {
|
||||
*(u16 *)(e + 2) = 0xE;
|
||||
func_8012A828(e, D_801CCEC0);
|
||||
return;
|
||||
}
|
||||
if (flags & 1) {
|
||||
goto L_tbl;
|
||||
}
|
||||
if (*(s32 *)(e + 0xD0) == 0) {
|
||||
goto L_tbl;
|
||||
}
|
||||
*(u16 *)(e + 2) = 0xE;
|
||||
*(u16 *)(e + 0x34) = 2;
|
||||
*(s32 *)(e + 0x1C) = 0x200;
|
||||
func_8012A828(e, D_801CC1E8);
|
||||
return;
|
||||
|
||||
L_tbl:
|
||||
*(u16 *)(e + 2) = D_801B51FC[*(u16 *)(e + 0x70) & 0xF];
|
||||
return;
|
||||
|
||||
L_bit4:
|
||||
*(u16 *)(e + 2) = D_801B520C[*(u16 *)(e + 0x70) & 0xF];
|
||||
func_8012A828(e, D_801CCEC0);
|
||||
*(s32 *)(e + 0x1C) = 0x200;
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -6830,7 +6830,38 @@ void *func_80185C6C(a0, a1)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_jr_8017C954", func_80185C88);
|
||||
extern s32 func_8012C1B8(void);
|
||||
extern void func_8012CAE4(void *a0);
|
||||
extern void func_8001C214(s32 a0, s32 a1);
|
||||
extern void func_8012B2CC(s32 a0);
|
||||
extern s32 rand(void);
|
||||
|
||||
void func_80185C88(void *arg0) {
|
||||
s32 v0 = func_8012C1B8();
|
||||
s32 v1;
|
||||
|
||||
*(s32 *)((u8 *)arg0 + 0x20) = v0;
|
||||
if (v0 == 0) {
|
||||
func_8012CAE4(arg0);
|
||||
return;
|
||||
}
|
||||
|
||||
func_8001C214(v0, 0);
|
||||
|
||||
*(s32 *)((u8 *)arg0 + 8) = *(s32 *)((u8 *)arg0 + 8) + *(s32 *)(*(s32 *)((u8 *)arg0 + 0x64) + 8);
|
||||
*(u16 *)(*(s32 *)((u8 *)arg0 + 0x20) + 0x12) = *(u16 *)((u8 *)arg0 + 0xFC);
|
||||
func_8012B2CC(arg0);
|
||||
|
||||
*(s32 *)((u8 *)arg0 + 0x1C) = 0x90;
|
||||
v1 = rand();
|
||||
*(s16 *)((u8 *)arg0 + 0xFE) = (v1 % 64) + 0x40;
|
||||
{
|
||||
u16 x = *(u16 *)(*(s32 *)((u8 *)arg0 + 0x64) + 0x36);
|
||||
*(u16 *)((u8 *)arg0 + 2) = *(u16 *)((u8 *)arg0 + 2) + 1;
|
||||
*(u16 *)((u8 *)arg0 + 0x100) = x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_jr_8017C954", func_80185D44);
|
||||
|
||||
|
||||
@@ -3651,7 +3651,65 @@ void func_80185DA8(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_80184CF8", func_80185F6C);
|
||||
/* SIMULATION of real-TU context: the TU carries these two rows before the def */
|
||||
extern void func_80185F6C(s32 a0, s32 a1);
|
||||
extern void func_80185F6C(s32 a0, s32 a1);
|
||||
|
||||
void func_80185F6C(s32 arg0, s32 arg1) {
|
||||
extern u8 D_801AF990[];
|
||||
extern s32 D_801AFBC8[];
|
||||
extern u8 D_800D3918[];
|
||||
extern void func_80187E08(s32 a0, void *a1, void *a2, s32 a3);
|
||||
extern void func_80187DA4(s32 a0, void *a1, s32 a2, s32 a3, s32 a4, s32 a5);
|
||||
extern void func_8001C924(s32 a0, void *a1);
|
||||
register s32 rv __asm__("$2");
|
||||
u8 buf[8];
|
||||
s32 x = arg1;
|
||||
s32 y;
|
||||
s32 res;
|
||||
s16 state;
|
||||
s32 flags;
|
||||
|
||||
__asm__("addu %0, %1, $zero" : "=r"(y) : "r"(x));
|
||||
state = *(u16 *)(arg0 + 0x70) & 0xF;
|
||||
flags = *(u32 *)(arg0 + 0xE0);
|
||||
if (flags & 4) {
|
||||
rv = 0;
|
||||
goto epi;
|
||||
}
|
||||
switch (state) {
|
||||
case 0:
|
||||
if (flags & 1) {
|
||||
func_80187E08(arg0, D_801AF990, buf, 0xC);
|
||||
res = ((s32 (*)(s32, void *, s32, s32, s32, s32))func_80187DA4)(arg0, buf, 0x27F, (s16)x, 0, 0);
|
||||
*(s32 *)(arg0 + 0xD0) = res;
|
||||
*(u32 *)(arg0 + 0xE0) &= ~1;
|
||||
if (res != 0) {
|
||||
*(u16 *)(arg0 + 0xEE) = *(u16 *)(res + 0x36);
|
||||
}
|
||||
}
|
||||
/* fallthrough */
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
func_80187E08(arg0, D_800D3918, buf, 0xB);
|
||||
res = ((s32 (*)(s32, void *, s32, s32, s32, s32))func_80187DA4)(arg0, buf, 0x27F, (s16)(y | (state + 1)), 0, 0);
|
||||
*(s32 *)(arg0 + 0xCC) = res;
|
||||
*(u32 *)(arg0 + 0xE0) |= 4;
|
||||
func_8001C924(*(s32 *)(arg0 + 0x20), (void *)D_801AFBC8[state]);
|
||||
if (res != 0) {
|
||||
*(u16 *)(arg0 + 0xEC) = *(u16 *)(res + 0x36);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
rv = 1;
|
||||
goto epi;
|
||||
}
|
||||
rv = 1;
|
||||
epi:
|
||||
__asm__ volatile("" : : "r"(rv));
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_80184CF8", func_801860E4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user