mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-05 17:03:23 -04:00
chore(decomp): commit in-tree banked work before the serial lane
This commit is contained in:
@@ -173,7 +173,7 @@ segments:
|
||||
- [0xb89d4, .rodata, ov_SC06_022_jr_80182D08] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0xb8ab4, .rodata, ov_SC06_022_jr_80184304] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0xb8acc, .rodata, ov_SC06_022_jr_80184A28] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0xb8ae0, data, tail20]
|
||||
- [0xb8b00, data, tail20]
|
||||
- [0xBA114, bin, trailing] # final 3 bytes (EOF not 4-aligned; spimdisasm drops a partial word)
|
||||
- [0xBA117] # EOF marker = the 0.4.dec byte length
|
||||
# @TRAILING@ (above) is replaced by tools/new_overlay.sh: for a non-4-aligned overlay it becomes
|
||||
|
||||
@@ -121,6 +121,7 @@ segments:
|
||||
- [0x52354, c, ov_SC06_030_jr_8017A4AC]
|
||||
- [0x52cd4, c, ov_SC06_030_jr_8017AE2C]
|
||||
- [0x54778, c, ov_SC06_030_jr_8017C8D0]
|
||||
- [0x57504, c, ov_SC06_030_jr_8017F65C]
|
||||
- [0x59cb4, data, tail]
|
||||
- [0x8f6ac, .rodata, ov_SC06_030] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0x8f788, .rodata, ov_SC06_030_jr_8012ACE0] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
|
||||
@@ -3730,84 +3730,7 @@ void func_8017E940(s32 a0) {
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_jr_8017C294", func_8017EA5C);
|
||||
|
||||
extern s32 func_80029178(s32);
|
||||
extern s32 func_80029504(void);
|
||||
extern s32 func_8012BD14(s32);
|
||||
extern void func_8012C218(s32);
|
||||
extern void func_8017ECFC(s16*);
|
||||
|
||||
extern s32 D_80126B58;
|
||||
extern s16 D_80126B5E;
|
||||
extern s16 D_80126B62;
|
||||
extern s16 D_80126B66;
|
||||
extern s32 D_80126B9C;
|
||||
|
||||
void func_8017EB00(s32 arg0) {
|
||||
s32 ret;
|
||||
s32 ret2;
|
||||
s32 var;
|
||||
s16* p;
|
||||
p = (s16*) &D_80126B58;
|
||||
ret = func_80029504();
|
||||
if (ret < 240) {
|
||||
var = 0;
|
||||
} else if (ret < 250) {
|
||||
var = 1;
|
||||
} else if (ret < 260) {
|
||||
var = 2;
|
||||
} else {
|
||||
if (ret < 270) {
|
||||
var = 3;
|
||||
} else if (ret < 280) {
|
||||
var = 4;
|
||||
} else {
|
||||
var = 5;
|
||||
}
|
||||
}
|
||||
switch (var) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
if (D_80126B5E >= -31) {
|
||||
D_80126B5E = -32;
|
||||
}
|
||||
if (D_80126B66 < 727) {
|
||||
D_80126B66 = 727;
|
||||
}
|
||||
if (((D_80126B9C & 0x8000000) && D_80126B62 < -1343) == 0) {
|
||||
return;
|
||||
}
|
||||
if (p[3] >= -159) {
|
||||
func_8017ECFC((s16*) arg0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
ret2 = func_8012BD14(arg0);
|
||||
if (ret2 <= 147455) {
|
||||
if (D_80126B5E < -160) {
|
||||
D_80126B5E = -160;
|
||||
}
|
||||
if (D_80126B66 < 727) {
|
||||
D_80126B66 = 727;
|
||||
}
|
||||
}
|
||||
if (((D_80126B9C & 0x8000000) && D_80126B62 < -1343) == 0) {
|
||||
return;
|
||||
}
|
||||
if (p[3] < -32) {
|
||||
func_8017ECFC((s16*) arg0);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if ((func_80029178(250) & 0xFF) == 0) {
|
||||
func_8012C218(arg0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_jr_8017C294", func_8017EB00);
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_jr_8017C294", func_8017ECFC);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
|
||||
|
||||
@@ -6043,7 +6043,60 @@ DEFINE_func_8018178C() /* dedup: shared engine-core @0x8018178C (src/shared) */
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_801817B8);
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8017AE2C", func_80181804);
|
||||
#include "common.h"
|
||||
|
||||
extern s32 func_80185BE0(s32 a0);
|
||||
extern s32 func_80184FA4(s32);
|
||||
extern void func_80184ED4(s32, s32, s32, s32);
|
||||
extern void func_80184CB8(s32*, s32);
|
||||
extern u8 D_801B66C0[];
|
||||
extern u8 D_801B6670[];
|
||||
extern u8 D_801B662C[];
|
||||
extern short D_80191B34;
|
||||
|
||||
void func_80181804(void *a0)
|
||||
{
|
||||
switch (*(u16 *)((s32)a0 + 0x34)) {
|
||||
case 0:
|
||||
if (func_80185BE0(0xD) == 0) {
|
||||
return;
|
||||
}
|
||||
*(u16 *)((s32)a0 + 0x34) = 1;
|
||||
func_80184ED4((s32)a0, (s32)D_801B66C0, 1, 0x80);
|
||||
return;
|
||||
case 1:
|
||||
func_80185BE0(0xD);
|
||||
if (func_80184FA4((s32)a0) == 0) {
|
||||
return;
|
||||
}
|
||||
*(u16 *)((s32)a0 + 0x34) = 2;
|
||||
func_80184ED4((s32)a0, (s32)D_801B6670, 1, 0x80);
|
||||
return;
|
||||
case 2:
|
||||
if (func_80184FA4((s32)a0) == 0) {
|
||||
return;
|
||||
}
|
||||
*(u16 *)((s32)a0 + 0x34) = 3;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0x20;
|
||||
return;
|
||||
case 3:
|
||||
if (func_80185BE0(3) == 0) {
|
||||
return;
|
||||
}
|
||||
*(u16 *)((s32)a0 + 0x34) = 4;
|
||||
func_80184ED4((s32)a0, (s32)D_801B662C, 1, 0x80);
|
||||
return;
|
||||
case 4:
|
||||
func_80185BE0(3);
|
||||
if (func_80184FA4((s32)a0) == 0) {
|
||||
return;
|
||||
}
|
||||
*(u16 *)((s32)a0 + 0x2) = 1;
|
||||
func_80184CB8((s32 *)a0, (s32)&D_80191B34);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void (*D_80191BDC[])(void);
|
||||
|
||||
@@ -4310,7 +4310,200 @@ void func_8017F694(s32 arg0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_016/nonmatchings/ov_SC06_016_jr_8017C8D0", func_8017F784);
|
||||
extern void *D_8019F6F8;
|
||||
extern u16 D_8019F9DC[];
|
||||
extern s16 D_8019FB60;
|
||||
extern u16 D_80188E6C[];
|
||||
extern s32 D_80188E8C[];
|
||||
extern s16 D_80188A18;
|
||||
extern void func_8012E88C(u8 *a0);
|
||||
extern void func_800183E0(s32 a0);
|
||||
extern void func_8012B370(s32 a0);
|
||||
extern void func_8017F694(s32 a0);
|
||||
extern s32 func_8012BEE8(s32 a0);
|
||||
extern void func_8012E8A8(u8 *a0);
|
||||
extern s32 func_80180BF0(void*);
|
||||
extern void func_801807C4(void *a0);
|
||||
extern void func_801803FC(void);
|
||||
extern void func_801800E0(void *a0);
|
||||
extern void func_8018048C(void *a0);
|
||||
|
||||
void func_8017F784(s32 param_1)
|
||||
{
|
||||
s32 var;
|
||||
s32 k;
|
||||
|
||||
switch (*(u16 *)(param_1 + 0x34)) {
|
||||
case 0: {
|
||||
register u16 *src __asm__("$6");
|
||||
register u16 *dst __asm__("$5");
|
||||
register s32 i __asm__("$4");
|
||||
register s32 fc __asm__("$2");
|
||||
if (*(u16 *)((char *)D_8019F6F8 + 2) != 5) {
|
||||
return;
|
||||
}
|
||||
if (*(s32 *)(param_1 + 0x20) != 0) {
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x18) = 0;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1A) = 0;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1C) = 0;
|
||||
}
|
||||
func_8012E88C((u8 *)param_1);
|
||||
src = D_80188E6C;
|
||||
i = 0;
|
||||
dst = D_8019F9DC;
|
||||
fc = *(u16 *)(param_1 + 0xFC);
|
||||
*(s32 *)(param_1 + 0x1C) = 0;
|
||||
*(u16 *)(param_1 + 0x34) = 1;
|
||||
D_8019FB60 = 1;
|
||||
*(u16 *)(param_1 + 0xFC) = (fc - 1) & 0xF;
|
||||
for (; i < 0x10; i++) {
|
||||
*dst++ = src[(i + *(s16 *)(param_1 + 0xFC)) & 0xF];
|
||||
}
|
||||
func_800183E0((s32)D_80188E8C);
|
||||
*(s32 *)(param_1 + 4) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 4);
|
||||
*(s32 *)(param_1 + 8) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 8) - 0x300000;
|
||||
*(s32 *)(param_1 + 0xC) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 0xC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) = *(u16 *)(*(s32 *)(*(s32 *)(param_1 + 0x64) + 0x20) + 0x12);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x14) += 0x78;
|
||||
func_8012B370(param_1);
|
||||
func_8017F694(param_1);
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
func_8018048C((void *)param_1);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
register u16 *src __asm__("$5");
|
||||
register u16 *dst __asm__("$4");
|
||||
register s32 i __asm__("$3");
|
||||
var = (*(s32 *)(param_1 + 0x1C) + 1) << 10;
|
||||
*(s32 *)(param_1 + 0x1C) += 1;
|
||||
if (*(s32 *)(param_1 + 0x20) != 0) {
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x18) = var;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1A) = var;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1C) = var;
|
||||
}
|
||||
func_8012E88C((u8 *)param_1);
|
||||
if (*(s32 *)(param_1 + 0x1C) == 4) {
|
||||
*(u16 *)(param_1 + 0x34) = 2;
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
k = 0x1000;
|
||||
if (*(s32 *)(param_1 + 0x20) != 0) {
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x18) = k;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1A) = k;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1C) = k;
|
||||
}
|
||||
func_8012E88C((u8 *)param_1);
|
||||
}
|
||||
src = D_80188E6C;
|
||||
*(u16 *)(param_1 + 0xFC) = (*(u16 *)(param_1 + 0xFC) - 1) & 0xF;
|
||||
for (i = 0, dst = D_8019F9DC; i < 0x10; i++) {
|
||||
*dst++ = src[(i + *(s16 *)(param_1 + 0xFC)) & 0xF];
|
||||
}
|
||||
func_800183E0((s32)D_80188E8C);
|
||||
*(s32 *)(param_1 + 4) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 4);
|
||||
*(s32 *)(param_1 + 8) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 8) - 0x300000;
|
||||
*(s32 *)(param_1 + 0xC) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 0xC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) = *(u16 *)(*(s32 *)(*(s32 *)(param_1 + 0x64) + 0x20) + 0x12);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x14) += 0x78;
|
||||
func_8012B370(param_1);
|
||||
func_8017F694(param_1);
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
func_8018048C((void *)param_1);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
register u16 *src __asm__("$5");
|
||||
register u16 *dst __asm__("$4");
|
||||
s32 i;
|
||||
func_8012E88C((u8 *)param_1);
|
||||
((void (*)(void *))func_80180BF0)((void *)param_1);
|
||||
if (*(u16 *)((char *)D_8019F6F8 + 2) == 6) {
|
||||
*(u16 *)(param_1 + 0x34) = 3;
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
*(s32 *)(param_1 + 0x1C) = D_80188A18;
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
k = 0x1000;
|
||||
if (*(s32 *)(param_1 + 0x20) != 0) {
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x18) = k;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1A) = k;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1C) = k;
|
||||
}
|
||||
func_8012E88C((u8 *)param_1);
|
||||
src = D_80188E6C;
|
||||
*(u16 *)(param_1 + 0xFC) = (*(u16 *)(param_1 + 0xFC) - 1) & 0xF;
|
||||
for (i = 0, dst = D_8019F9DC; i < 0x10; i++) {
|
||||
*dst++ = src[(i + *(s16 *)(param_1 + 0xFC)) & 0xF];
|
||||
}
|
||||
func_800183E0((s32)D_80188E8C);
|
||||
*(s32 *)(param_1 + 4) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 4);
|
||||
*(s32 *)(param_1 + 8) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 8) - 0x300000;
|
||||
*(s32 *)(param_1 + 0xC) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 0xC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) = *(u16 *)(*(s32 *)(*(s32 *)(param_1 + 0x64) + 0x20) + 0x12);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x14) += 0x78;
|
||||
func_8012B370(param_1);
|
||||
func_8017F694(param_1);
|
||||
func_801807C4((void *)param_1);
|
||||
func_801803FC();
|
||||
return;
|
||||
}
|
||||
src = D_80188E6C;
|
||||
*(u16 *)(param_1 + 0xFC) = (*(u16 *)(param_1 + 0xFC) - 1) & 0xF;
|
||||
for (i = 0, dst = D_8019F9DC; i < 0x10; i++) {
|
||||
*dst++ = src[(i + *(s16 *)(param_1 + 0xFC)) & 0xF];
|
||||
}
|
||||
func_800183E0((s32)D_80188E8C);
|
||||
*(s32 *)(param_1 + 4) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 4);
|
||||
*(s32 *)(param_1 + 8) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 8) - 0x300000;
|
||||
*(s32 *)(param_1 + 0xC) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 0xC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) = *(u16 *)(*(s32 *)(*(s32 *)(param_1 + 0x64) + 0x20) + 0x12);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x14) += 0x78;
|
||||
func_8012B370(param_1);
|
||||
func_8017F694(param_1);
|
||||
func_801800E0((void *)param_1);
|
||||
__asm__ __volatile__("" ::: "memory");
|
||||
func_8018048C((void *)param_1);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
register u16 *src __asm__("$5");
|
||||
register u16 *dst __asm__("$4");
|
||||
s32 i;
|
||||
s32 k3;
|
||||
var = ((*(s32 *)(param_1 + 0x1C) - 5) << 12) / (D_80188A18 - 5);
|
||||
if (var < 0x100) {
|
||||
var = 0x100;
|
||||
}
|
||||
k3 = 0x1000;
|
||||
if (*(s32 *)(param_1 + 0x20) != 0) {
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x18) = var;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1A) = var;
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x1C) = k3;
|
||||
}
|
||||
if (func_8012BEE8(param_1) != 0) {
|
||||
func_8012E8A8((u8 *)param_1);
|
||||
*(u16 *)(param_1 + 0x34) = 0;
|
||||
}
|
||||
src = D_80188E6C;
|
||||
*(u16 *)(param_1 + 0xFC) = (*(u16 *)(param_1 + 0xFC) - 1) & 0xF;
|
||||
for (i = 0, dst = D_8019F9DC; i < 0x10; i++) {
|
||||
*dst++ = src[(i + *(s16 *)(param_1 + 0xFC)) & 0xF];
|
||||
}
|
||||
func_800183E0((s32)D_80188E8C);
|
||||
*(s32 *)(param_1 + 4) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 4);
|
||||
*(s32 *)(param_1 + 8) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 8) - 0x300000;
|
||||
*(s32 *)(param_1 + 0xC) = *(s32 *)(*(s32 *)(param_1 + 0x64) + 0xC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) = *(u16 *)(*(s32 *)(*(s32 *)(param_1 + 0x64) + 0x20) + 0x12);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x14) += 0x78;
|
||||
func_8012B370(param_1);
|
||||
func_8017F694(param_1);
|
||||
func_801807C4((void *)param_1);
|
||||
return;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void (*D_801890AC[])(void);
|
||||
|
||||
@@ -3530,7 +3530,191 @@ void func_801859F4(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_022/nonmatchings/ov_SC06_022_jr_80184A28", func_80185B80);
|
||||
/* ov_SC06_022 :: func_80185B80 — actor state machine, jump-table switch on the
|
||||
* u16 state word at +0x34. Jump table = jtbl_801E0C3C (6 entries, 0..5),
|
||||
* defined in asm/ov_SC06_022/data/tail20.data.s — this .s carries no data of
|
||||
* its own (§160c), so plain `extern`s are correct here.
|
||||
*
|
||||
* Mechanical remap of ov_SC06_018 :: func_80187AEC (§40) — that body is BANKED
|
||||
* and whole-binary-gate-proven (§260-A); this draft is its line-for-line
|
||||
* relative with exactly four symbols remapped to this overlay's own relocs:
|
||||
* D_801B5400 -> D_801BD358 func_80189000 -> func_80187094
|
||||
* func_8018944C -> func_801874E0
|
||||
* (jtbl name is compiler-generated from the switch lowering; the func_8012xxxx
|
||||
* callees are shared-engine symbols that map to themselves under §40's rule —
|
||||
* the twin calls the same addresses under the same names.)
|
||||
*
|
||||
* ⚠ BANK PREREQUISITE (not a body defect): this is a DATA-TAIL-TABLE jr
|
||||
* function. match_one MATCH is necessary but not sufficient. Bankable ONLY
|
||||
* through a gate arming harvest_verify._jtbl_prep_one — tools/jtbl_lane.py
|
||||
* --targets func_80185B80@ov_SC06_022 --draft-dir <dir>, or a wave drawn with
|
||||
* jtbl-carve in --levers. A plain-path gate cannot bank it (duplicate table:
|
||||
* C-emitted .rodata + the raw tail20.data.s copy -> duplicate-symbol link
|
||||
* error or shifted data). No manual wiring needed: §131 clamp auto-trims the
|
||||
* non-code surplus word 0x9C024030 (verified present at 0x801E0C54 inside the
|
||||
* dlabel; unambiguous sltiu=6); single-table 4-mod-8-first carve takes no
|
||||
* JTBL_PADS var (§8e-2).
|
||||
*
|
||||
* GEOMETRY (R24, corrects the card's earlier tail19/mid-region claim — the
|
||||
* split has been regenerated since the card was written): tail20.data.s opens
|
||||
* at 0x801E0C38 with D_801E0C38 (one 4-byte zero word), then jtbl_801E0C3C
|
||||
* (six entries 0x80185BD0..0x80185E2C + the surplus word), then D_801E0C58…
|
||||
* The carve sandwich is therefore SINGLE-FILE and MINIMAL:
|
||||
* [raw: D_801E0C38, 4 bytes][rodata: jtbl 0xC3C..0xC54][raw: rest of tail20]
|
||||
* — far simpler than the multi-file flank this card previously warned about;
|
||||
* tails 18/19 hold other functions' tables and are untouched by this carve.
|
||||
*
|
||||
* TABLE-LAYOUT DISTINCTION (R22): ov_SC06_018's jr tables are FUNCTION-LOCAL
|
||||
* (its remaining unmatched jr fn declares jtbl_801D3B8C via dlabel in its own
|
||||
* .s; that overlay has NO data-tail tables), so the banked twin went through
|
||||
* the ORDINARY path. §81's law narrows to: the plain-path wall binds
|
||||
* DATA-TAIL-table jr functions only. This card is provably in the bound
|
||||
* subclass (table in tail20; own .s has no dlabel block).
|
||||
*
|
||||
* WAVE ACTIVITY OBSERVED (R23/R24): three distinct filesystem states across
|
||||
* three consecutive reads — (i) table local-only in this .s + jtbl_801E0B10
|
||||
* duplicated in both its .s and tail19, (ii) old structure restored, (iii)
|
||||
* stable state with the table in tail20. Signature of an ATOMIC
|
||||
* ATTEMPT-AND-RESTORE jtbl-carve cycle on this very function: the lane is
|
||||
* being exercised concurrently; if it lands, this draft banks through it
|
||||
* as-is.
|
||||
*
|
||||
* FALSIFIABLE PREDICTION (R20, refined R22/R24): a plain-path attempt on this
|
||||
* draft fails at LINK (duplicate global jtbl_801E0C3C) or with a
|
||||
* data-tail-only byte diff around 0x801E0C3C (in tail20) — NEVER a
|
||||
* code-section diff. A plain-path failure showing a CODE-section diff would
|
||||
* falsify this record and point back at the body despite seven MATCHes.
|
||||
*
|
||||
* Keys (all byte-forced, do NOT "clean up") — inherited verbatim from the
|
||||
* banked exemplar:
|
||||
*
|
||||
* (1) §161a — table indexed from ZERO (`lhu 0x34 ; sltiu <6 ; sll 2`), entry[0]
|
||||
* is a real body, so `case 0:` carries the first arm. All six table
|
||||
* words verified (R24) to land on this C's six case bodies.
|
||||
* (2) `s32 pad[1];` is LOAD-BEARING: forces the 0x20 frame (args 0x10 + ra/s0
|
||||
* at 0x18/0x1C). Without it the frame compiles to 0x18 and all six
|
||||
* prologue/epilogue immediates rot. 4 bytes -> right, 8 -> wrong.
|
||||
* (3) Case 0's 0x102 write must be TWO stores in an if/else: with a live temp
|
||||
* gcc keeps the value in $a0 for the later +0x400; the target instead
|
||||
* re-LOADS `lhu 0x102($s0)` (§160d). Two stores kill the temp, the
|
||||
* cross-jumper re-merges the single `sh`, the reload comes back.
|
||||
* (4) Case 0's `iVar >= 4` test is written "wrong" round on purpose: the >= 4
|
||||
* arm is the fall-through, the div arm is the branch target.
|
||||
* (5) Case 1 re-reads *(s16*)(param_1+0x70) at BOTH tests: one local gives
|
||||
* `andi $v0,$v1,0x8000` (184 ins); two reads make cse emit
|
||||
* `addu $v0,$v1,$zero` — the 185th instruction — and let the delay-slot
|
||||
* filler steal `andi $v1,$v0,0xF`.
|
||||
* (6) func_8012CC40 is fleet-canonical `void`; its $v0 is used here, so it is
|
||||
* called through a cast (§17a-1) rather than being re-declared.
|
||||
*/
|
||||
|
||||
extern void func_8012CC40(s32 arg0, s32 arg1); /* fleet-canonical: void; $v0 used -> cast at use */
|
||||
extern s32 func_80143B6C(s32 a0, s32 a1); /* fleet-canonical */
|
||||
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_8012BEE8(s32 a0);
|
||||
extern void func_8012E8C4(u8 *a0);
|
||||
extern void func_8012E8A8(u8 *a0);
|
||||
extern void func_80187094(s32 a0, s32 a1);
|
||||
extern s32 func_801874E0(s32 a0, s32 a1, s32 a2);
|
||||
extern void func_8012C218(void *a0);
|
||||
|
||||
extern u8 D_801BD358;
|
||||
|
||||
void func_80185B80(s32 param_1)
|
||||
{
|
||||
s32 iVar;
|
||||
s32 t;
|
||||
u16 st;
|
||||
u16 uVar1;
|
||||
s32 pad[1]; /* see key (2): forces the 0x20 frame — never referenced */
|
||||
|
||||
if (0xf < *(s16 *)(param_1 + 0xA)) {
|
||||
func_8012C218((void *)param_1);
|
||||
return;
|
||||
}
|
||||
switch (*(u16 *)(param_1 + 0x34)) {
|
||||
case 0:
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x10) =
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x10) + *(u16 *)(param_1 + 0xFC);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) =
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x12) + *(u16 *)(param_1 + 0xFE);
|
||||
if ((((s32 (*)(s32, s32))func_8012CC40)(
|
||||
param_1,
|
||||
((*(u16 *)(param_1 + 0x70) & 0xF) * 8) + (s32)&D_801BD358) &
|
||||
0x2000) == 0) {
|
||||
return;
|
||||
}
|
||||
iVar = *(s32 *)(param_1 + 0x1C) + 1;
|
||||
*(s32 *)(param_1 + 0x1C) = iVar;
|
||||
if (iVar >= 4) {
|
||||
if ((*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x10) & 0xFFFU) > 0x800U) {
|
||||
*(u16 *)(param_1 + 0x102) = 0xC00;
|
||||
} else {
|
||||
*(u16 *)(param_1 + 0x102) = 0x400;
|
||||
}
|
||||
t = *(u16 *)(param_1 + 0x70) & 0xF;
|
||||
if (t < 4 && t != 0) {
|
||||
*(u16 *)(param_1 + 0x102) = *(u16 *)(param_1 + 0x102) + 0x400;
|
||||
}
|
||||
*(s32 *)(param_1 + 0x1C) = 0x1E;
|
||||
*(u16 *)(param_1 + 0x34) = *(u16 *)(param_1 + 0x34) + 1;
|
||||
} else {
|
||||
*(s32 *)(param_1 + 0x14) = -(0x80000 / iVar);
|
||||
func_80143B6C(param_1, 1);
|
||||
}
|
||||
return;
|
||||
case 1:
|
||||
iVar = func_8012B608((s32)*(s16 *)(*(s32 *)(param_1 + 0x20) + 0x10),
|
||||
(s32)*(s16 *)(param_1 + 0x102), 4);
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x10) =
|
||||
*(u16 *)(*(s32 *)(param_1 + 0x20) + 0x10) + iVar;
|
||||
if (func_8012BEE8(param_1) == 0) {
|
||||
return;
|
||||
}
|
||||
st = *(u16 *)(param_1 + 0x34);
|
||||
*(s32 *)(param_1 + 0x1C) = 0x1E;
|
||||
*(u16 *)(param_1 + 0x34) = st + 1;
|
||||
if ((*(s16 *)(param_1 + 0x70) & 0x8000) != 0) {
|
||||
*(u16 *)(param_1 + 0x34) = st + 2;
|
||||
} else if ((*(s16 *)(param_1 + 0x70) & 0xF) == 4) {
|
||||
*(u16 *)(param_1 + 0x34) = 4;
|
||||
*(s32 *)(param_1 + 0x1C) = 0x1E;
|
||||
}
|
||||
return;
|
||||
case 2:
|
||||
func_8012E8C4((u8 *)param_1);
|
||||
if (func_8012BEE8(param_1) == 1) {
|
||||
func_8012C218((void *)param_1);
|
||||
}
|
||||
return;
|
||||
case 3:
|
||||
if (*(s16 *)(*(s32 *)(param_1 + 0x64) + 0x36) != *(s16 *)(param_1 + 0x10A) &&
|
||||
*(s32 *)(param_1 + 0xE0) == 0) {
|
||||
*(s32 *)(param_1 + 0x1C) = 0x1E;
|
||||
uVar1 = 2;
|
||||
if ((*(u16 *)(param_1 + 0x70) & 0xF) == 4) {
|
||||
uVar1 = 4;
|
||||
}
|
||||
*(u16 *)(param_1 + 0x34) = uVar1;
|
||||
*(s32 *)(param_1 + 0xE0) = 1;
|
||||
}
|
||||
return;
|
||||
case 4:
|
||||
if (func_8012BEE8(param_1) != 0) {
|
||||
*(s32 *)(param_1 + 0x1C) = 0xA;
|
||||
*(u16 *)(param_1 + 0x34) = *(u16 *)(param_1 + 0x34) + 1;
|
||||
func_8012E8A8((u8 *)param_1);
|
||||
func_80187094(param_1, 1);
|
||||
}
|
||||
return;
|
||||
case 5:
|
||||
if (func_801874E0(param_1, 0x60, 0xA0) == 1) {
|
||||
func_8012C218((void *)param_1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void func_8012C218(void *a0);
|
||||
|
||||
@@ -5360,7 +5360,166 @@ void func_80182DB0(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_jr_8017C954", func_80182ED8);
|
||||
extern void func_80183478();
|
||||
extern void func_8002D4C8();
|
||||
extern void func_8012F214();
|
||||
extern void func_80183534();
|
||||
extern s32 func_80013478(s32 a0, s32 a1);
|
||||
extern s32 D_801DDB28;
|
||||
extern s32 D_801DDB3C;
|
||||
extern u16 D_800B99DA;
|
||||
extern u8 D_80126B5C;
|
||||
extern u8 D_80190858[];
|
||||
extern u8 D_801908D8[];
|
||||
extern s32 D_801DFE54[];
|
||||
extern void *D_801DFDD4[][8];
|
||||
|
||||
void func_80182ED8(s32 arg0) {
|
||||
s32 val;
|
||||
s16 top[4];
|
||||
s16 bot[4];
|
||||
s32 *q;
|
||||
s32 ctr;
|
||||
s32 *p;
|
||||
u8 *p8;
|
||||
s32 *r;
|
||||
s32 *w;
|
||||
s32 t;
|
||||
s32 dd4;
|
||||
s32 pbase;
|
||||
u16 vol;
|
||||
|
||||
switch (*(u16 *)(arg0 + 0x34)) {
|
||||
case 0:
|
||||
*(u16 *)(arg0 + 0x100) += 0x20;
|
||||
if (*(s16 *)(arg0 + 0x100) >= 0x121) {
|
||||
*(u16 *)(arg0 + 0x100) = 0x120;
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
func_80183478(arg0, 1);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (*(s32 *)(arg0 + 0xE0) != 0) {
|
||||
func_801834D8(arg0, 0);
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
}
|
||||
if ((*(s16 *)(D_801DDB28 + 0x100) == 2) && ((D_800B99DA & 0x7F) == 0)) {
|
||||
func_801834D8(arg0, 0);
|
||||
*(u16 *)(arg0 + 0x34) = 4;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
*(u16 *)(arg0 + 0xFE) += 0x20;
|
||||
if (*(s16 *)(arg0 + 0xFE) >= 0x121) {
|
||||
*(u16 *)(arg0 + 0xFE) = 0x120;
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
func_801834D8(arg0, 0);
|
||||
func_801834D8(arg0, 1);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
*(u16 *)(arg0 + 2) = 2;
|
||||
if (*(s16 *)(arg0 + 0x70) == 3) {
|
||||
func_8002D4C8(4, 0x9CF);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
*(u16 *)(arg0 + 0xFE) += 0x20;
|
||||
if (*(s16 *)(arg0 + 0xFE) >= 0x121) {
|
||||
*(u16 *)(arg0 + 0xFE) = 0;
|
||||
*(u16 *)(arg0 + 0x100) = 0;
|
||||
*(u16 *)(arg0 + 0x34) = 0;
|
||||
if (*(s32 *)(*(s32 *)(arg0 + 0x64) + 0x64) == D_801DDB3C) {
|
||||
if (*(s32 *)(arg0 + 8) == 0) {
|
||||
*(s16 *)(arg0 + 0xA) = 0x200;
|
||||
} else {
|
||||
*(s16 *)(arg0 + 0xA) = 0;
|
||||
}
|
||||
} else {
|
||||
if (*(s32 *)(arg0 + 8) == 0) {
|
||||
*(s16 *)(arg0 + 0xA) = -0x200;
|
||||
} else {
|
||||
*(s16 *)(arg0 + 0xA) = 0;
|
||||
}
|
||||
}
|
||||
func_80183478(arg0, 0);
|
||||
func_801834D8(arg0, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
w = (s32 *)(arg0 + 0xE4);
|
||||
ctr = 0;
|
||||
t = *(s16 *)(arg0 + 0x70);
|
||||
p8 = D_80190858 + (t << 5);
|
||||
r = &D_801DFE54[t * 4];
|
||||
dd4 = (s32)((s32 *)D_801DFDD4);
|
||||
pbase = dd4 + 4;
|
||||
p = (s32 *)(pbase + (t << 5));
|
||||
q = (s32 *)(dd4 + (t << 5));
|
||||
|
||||
while (ctr < 4) {
|
||||
func_8012F214(*(s32 *)(arg0 + 0x64), (s32)p8, (s32)top);
|
||||
bot[0] = top[0];
|
||||
bot[1] = top[1];
|
||||
bot[2] = top[2];
|
||||
top[1] += *(u16 *)(arg0 + 0xFE) + *(u16 *)(arg0 + 0xA);
|
||||
bot[1] += *(u16 *)(arg0 + 0x100) + *(u16 *)(arg0 + 0xA);
|
||||
if (*q != 0) {
|
||||
*(s16 *)(*q + 8) = top[0];
|
||||
*(s16 *)(*q + 10) = top[1];
|
||||
*(s16 *)(*q + 12) = top[2];
|
||||
}
|
||||
if (*p != 0) {
|
||||
*(s16 *)(*p + 8) = bot[0];
|
||||
*(s16 *)(*p + 10) = bot[1];
|
||||
*(s16 *)(*p + 12) = bot[2];
|
||||
}
|
||||
func_80183534(arg0, (s32)top, (s32)bot, (s32)w);
|
||||
func_80183848(arg0, (s32)top, (s32)bot);
|
||||
top[0] = (top[0] + bot[0]) >> 1;
|
||||
top[1] = (top[1] + bot[1]) >> 1;
|
||||
top[2] = (top[2] + bot[2]) >> 1;
|
||||
*r = func_80013478((s32)&D_80126B5C, (s32)top);
|
||||
r++;
|
||||
ctr++;
|
||||
p8 += 8;
|
||||
p += 2;
|
||||
q += 2;
|
||||
w++;
|
||||
}
|
||||
|
||||
func_8012F214(*(s32 *)(arg0 + 0x64),
|
||||
(s32)(D_801908D8 + (*(s16 *)(arg0 + 0x70) << 3)), (s32)top);
|
||||
bot[0] = top[0];
|
||||
bot[1] = top[1];
|
||||
bot[2] = top[2];
|
||||
top[1] += *(u16 *)(arg0 + 0xFE) + *(u16 *)(arg0 + 0xA);
|
||||
bot[1] += *(u16 *)(arg0 + 0x100) + *(u16 *)(arg0 + 0xA);
|
||||
func_80183848(arg0, (s32)top, (s32)bot);
|
||||
|
||||
if ((*(u16 *)(arg0 + 0x34) != 3) && (*(s16 *)(arg0 + 0x70) == 3)) {
|
||||
val = D_801DFE54[0];
|
||||
for (ctr = 1; ctr < 0x10; ctr++) {
|
||||
if (D_801DFE54[ctr] < val) {
|
||||
val = D_801DFE54[ctr];
|
||||
}
|
||||
}
|
||||
val -= 0x4000;
|
||||
if (val <= 0) {
|
||||
func_8002D4C8(0x9CF, 0x107F);
|
||||
} else {
|
||||
vol = 0x7F;
|
||||
if (val <= 0xFFFFF) {
|
||||
vol -= (val * 111) / 1048576;
|
||||
} else {
|
||||
vol = 0x10;
|
||||
}
|
||||
func_8002D4C8(0x9CF, vol | 0x1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_jr_8017C954", func_801833FC);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1380
-2639
File diff suppressed because it is too large
Load Diff
@@ -4662,7 +4662,44 @@ void func_8017FE5C(void *a0) {
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_000/nonmatchings/ov_SC07_000_jr_8017BEBC", func_8017FE9C);
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_000/nonmatchings/ov_SC07_000_jr_8017BEBC", func_8017FEEC);
|
||||
extern void func_8012C1B8(void);
|
||||
extern void func_8012CAE4(void *a0);
|
||||
extern void func_8001C2C4(s32 a0);
|
||||
extern s32 func_8012AD50(void *a0);
|
||||
|
||||
extern u8 D_801865D8[];
|
||||
extern u8 D_801865DA[];
|
||||
extern u8 D_801865DC[];
|
||||
extern u8 D_801865DE[];
|
||||
extern s16 D_80186728[];
|
||||
extern u8 D_801866C8[];
|
||||
|
||||
void func_8017FEEC(void *a0) {
|
||||
s32 v0;
|
||||
s16 v1;
|
||||
|
||||
v0 = ((s32 (*)(void))func_8012C1B8)();
|
||||
*(s32 *)((u8 *)a0 + 0x20) = v0;
|
||||
if (v0 == 0) {
|
||||
func_8012CAE4(a0);
|
||||
return;
|
||||
}
|
||||
func_8001C2C4(v0);
|
||||
*(u16 *)((u8 *)a0 + 0xFE) = *(u16 *)(D_801865D8 + *(s16 *)((u8 *)a0 + 0x70) * 8) & 0xFF00;
|
||||
v1 = *(u16 *)(D_801865D8 + *(s16 *)((u8 *)a0 + 0x70) * 8);
|
||||
*(u16 *)((u8 *)a0 + 0x5C) = 0x8C00;
|
||||
*(u16 *)((u8 *)a0 + 6) = 0;
|
||||
*(s16 *)((u8 *)a0 + 0x102) = v1 & 7;
|
||||
*(u32 *)((u8 *)a0 + 0x58) = (v1 & 7) * 0x10 + (s32)D_801866C8 | 0x40000000;
|
||||
*(u16 *)((u8 *)a0 + 0xA) = *(u16 *)(D_801865DA + *(s16 *)((u8 *)a0 + 0x70) * 8);
|
||||
*(u16 *)((u8 *)a0 + 0xE) = *(u16 *)(D_801865DC + *(s16 *)((u8 *)a0 + 0x70) * 8);
|
||||
*(u16 *)(*(s32 *)((u8 *)a0 + 0x20) + 0x10) =
|
||||
*(u16 *)(D_801865DE + *(s16 *)((u8 *)a0 + 0x70) * 8) & 0xFF0;
|
||||
*(u16 *)((u8 *)a0 + 0x104) = 0;
|
||||
*(s32 *)((u8 *)a0 + 0x1C) = D_80186728[*(s16 *)((u8 *)a0 + 0x70)];
|
||||
func_8012AD50(a0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_000/nonmatchings/ov_SC07_000_jr_8017BEBC", func_8018000C);
|
||||
|
||||
@@ -4873,7 +4873,100 @@ void func_80180044(s32 a0) {
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_002/nonmatchings/ov_SC07_002_jr_8017C8D0", func_80180090);
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_002/nonmatchings/ov_SC07_002_jr_8017C8D0", func_80180248);
|
||||
void func_80180248(s32 s0)
|
||||
{
|
||||
typedef struct { s16 vx, vy, vz, pad; } SVfbd0;
|
||||
extern s16 D_80126940[4];
|
||||
extern s32 func_8012E544(s32 a0);
|
||||
extern void func_80015978(s32 a0, s32 *a1);
|
||||
extern void func_801804D4(s32 a0, s32 a1);
|
||||
extern void func_801808E0(s32 a0, s32 a1);
|
||||
extern s32 func_8018059C(s32 a0);
|
||||
extern void func_80186758(void);
|
||||
extern void func_8018672C(s32 a0);
|
||||
extern void func_801A2330(void);
|
||||
extern void func_80180F7C(s32 a0, void *a1);
|
||||
extern s32 D_8019F038;
|
||||
extern s32 D_8019F03C;
|
||||
|
||||
SVfbd0 pos;
|
||||
s32 ret;
|
||||
|
||||
ret = func_8012E544(0x306);
|
||||
if (ret != 0) {
|
||||
func_80015978(ret + 4, (s32 *)&pos);
|
||||
} else {
|
||||
pos = (*(SVfbd0 *)D_80126940);
|
||||
}
|
||||
switch (D_8019F038) {
|
||||
case 0:
|
||||
case 9:
|
||||
break;
|
||||
case 1:
|
||||
D_8019F03C = 0x1E;
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
break;
|
||||
case 2:
|
||||
D_8019F03C = D_8019F03C - 1;
|
||||
if (D_8019F03C == -1) {
|
||||
func_801804D4(s0, 0);
|
||||
func_801804D4(s0, 1);
|
||||
func_801808E0(s0, 3);
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
func_801808E0(s0, 3);
|
||||
if (func_8018059C(s0) != 0) {
|
||||
D_8019F03C = 0xA;
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
D_8019F03C = D_8019F03C - 1;
|
||||
if (D_8019F03C == -1) {
|
||||
func_801804D4(s0, 2);
|
||||
func_801804D4(s0, 3);
|
||||
func_801808E0(s0, 3);
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
func_801808E0(s0, 3);
|
||||
if (func_8018059C(s0) != 0) {
|
||||
D_8019F03C = 0xA;
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
D_8019F03C = D_8019F03C - 1;
|
||||
if (D_8019F03C == -1) {
|
||||
func_801804D4(s0, 4);
|
||||
func_801804D4(s0, 5);
|
||||
func_801808E0(s0, 3);
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
func_801808E0(s0, 3);
|
||||
if (func_8018059C(s0) != 0) {
|
||||
func_8018672C(0xA);
|
||||
D_8019F03C = 0x5A;
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
D_8019F03C = D_8019F03C - 1;
|
||||
if (D_8019F03C == -1) {
|
||||
func_80186758();
|
||||
func_801A2330();
|
||||
D_8019F038 = D_8019F038 + 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
func_80180F7C(s0, &pos);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_002/nonmatchings/ov_SC07_002_jr_8017C8D0", func_801804D4);
|
||||
|
||||
|
||||
@@ -5509,7 +5509,196 @@ void func_80189098(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_006/nonmatchings/ov_SC07_006_jr_80183814", func_801890FC);
|
||||
extern u8 D_8018E950;
|
||||
extern u8 D_8018E968;
|
||||
extern u8 D_8018E95C;
|
||||
extern u8 D_8018E970;
|
||||
extern u8 D_8018E978;
|
||||
extern u8 D_8018E9D8;
|
||||
extern u8 D_8018EA20;
|
||||
extern u8 D_8018EA68;
|
||||
extern u8 D_8018EAA0;
|
||||
extern u8 D_8018EAE8;
|
||||
extern u8 D_801BF710;
|
||||
extern u8 D_801BF718;
|
||||
extern u8 D_801BF728;
|
||||
extern u8 D_801BFCF4;
|
||||
extern u8 D_801BFCFC;
|
||||
extern u8 D_801BFD04;
|
||||
extern void func_8001CA1C(s32 a0, s32 a1);
|
||||
extern void func_8012A828(s32 a0, void *a1);
|
||||
extern void func_8012B23C(s32 a0);
|
||||
extern void func_8012B2CC(s32 a0);
|
||||
extern void func_8012B21C(void *a0);
|
||||
extern void func_8001C214(s32 a0, s32 a1);
|
||||
extern int func_8004787C(int a0);
|
||||
extern int func_80047948(int a0);
|
||||
extern s32 rand(void);
|
||||
|
||||
typedef struct {
|
||||
s8 pad00[0x0A];
|
||||
u16 f0A;
|
||||
} EntA;
|
||||
|
||||
void func_801890FC(void *a0) {
|
||||
s32 s1;
|
||||
s32 s2;
|
||||
|
||||
*(s32 *)((s32)a0 + 0x20) = func_8012C1B8();
|
||||
if (*(s32 *)((s32)a0 + 0x20) == 0) {
|
||||
func_8012CAE4(a0);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (*(s16 *)((s32)a0 + 0x70)) {
|
||||
case 0:
|
||||
func_8001CA1C(*(s32 *)((s32)a0 + 0x20), &D_8018E950);
|
||||
func_8012A828((s32)a0, &D_8018E968);
|
||||
*(u32 *)(*(s32 *)((s32)a0 + 0x20) + 4) |= 0x8000000;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x2C) |= 0x10;
|
||||
func_8012B23C((s32)a0);
|
||||
func_8012B2CC((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 1;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0x1E;
|
||||
*(u16 *)((s32)a0 + 0x16) = (rand() & 7) - 4;
|
||||
s2 = rand();
|
||||
s1 = (rand() & 7) + 8;
|
||||
*(s16 *)((s32)a0 + 0x12) = (func_8004787C(s2) * s1) >> 12;
|
||||
*(s16 *)((s32)a0 + 0x1A) = (func_80047948(s2) * s1) >> 12;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x10) = rand();
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x12) = rand();
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x14) = rand();
|
||||
break;
|
||||
case 1:
|
||||
func_8001C214(*(s32 *)((s32)a0 + 0x20), &D_801BF710);
|
||||
func_8001D0E8(*(s32 *)((s32)a0 + 0x20), 0x280, 0x1E0);
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x12) = 0x400;
|
||||
func_8012A828((s32)a0, &D_801BFCF4);
|
||||
func_8012B21C((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 2;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 3;
|
||||
*(u16 *)((s32)a0 + 0xFC) = 0;
|
||||
*(s32 *)((s32)a0 + 0x48) = *(s32 *)((s32)a0 + 0x48) >> 2;
|
||||
*(u16 *)((s32)a0 + 0xA) = *(u16 *)((s32)a0 + 0xA) - 0xAA;
|
||||
break;
|
||||
case 2: {
|
||||
s32 t1;
|
||||
s32 t2;
|
||||
s32 t3;
|
||||
s32 t4;
|
||||
s32 t5;
|
||||
func_8001C214(*(s32 *)((s32)a0 + 0x20), &D_801BF718);
|
||||
func_8001D0E8(*(s32 *)((s32)a0 + 0x20), 0x280, 0x1E0);
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x12) = 0x400;
|
||||
func_8012A828((s32)a0, &D_801BFCFC);
|
||||
func_8012B21C((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 4;
|
||||
*(u16 *)((s32)a0 + 0x1A) = -((rand() & 3) + 2);
|
||||
*(u16 *)((s32)a0 + 0xFC) = 0x30;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 6;
|
||||
t1 = *(u16 *)((s32)a0 + 0xE);
|
||||
*(u16 *)((s32)a0 + 0xFE) = 0xB;
|
||||
t2 = *(u16 *)((s32)a0 + 6);
|
||||
*(u16 *)((s32)a0 + 0xE) = t1 - 0x40;
|
||||
t3 = *(u16 *)((s32)a0 + 0xA);
|
||||
*(u16 *)((s32)a0 + 0x88) = t2 - 0x20;
|
||||
((EntA *)a0)->f0A = t3 - 0xEE;
|
||||
t4 = *(u16 *)((s32)a0 + 0xE);
|
||||
t5 = *(u16 *)((s32)a0 + 0xA);
|
||||
*(u16 *)((s32)a0 + 0x8C) = t4 - 0x37;
|
||||
*(u16 *)((s32)a0 + 0x8A) = t5 - 0x44;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
func_8001C214(*(s32 *)((s32)a0 + 0x20), &D_801BF728);
|
||||
func_8001D0E8(*(s32 *)((s32)a0 + 0x20), 0x280, 0x1E0);
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x12) = 0x400;
|
||||
func_8012A828((s32)a0, &D_801BFD04);
|
||||
func_8012B21C((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 4;
|
||||
*(u16 *)((s32)a0 + 0x1A) = (rand() & 3) + 2;
|
||||
*(s16 *)((s32)a0 + 0xFC) = -0x30;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 6;
|
||||
*(u16 *)((s32)a0 + 0xE) = *(u16 *)((s32)a0 + 0xE) + 0x40;
|
||||
*(u16 *)((s32)a0 + 0xA) = *(u16 *)((s32)a0 + 0xA) - 0xEE;
|
||||
break;
|
||||
case 4: {
|
||||
s32 m;
|
||||
s32 p;
|
||||
func_8001CA1C(*(s32 *)((s32)a0 + 0x20), &D_8018E95C);
|
||||
func_8012A828((s32)a0, &D_8018E970);
|
||||
*(u32 *)(*(s32 *)((s32)a0 + 0x20) + 4) |= 0x8000000;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x2C) |= 0x10;
|
||||
func_8012B23C((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 3;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0x78;
|
||||
*(u16 *)((s32)a0 + 0x16) = (rand() & 7) - 4;
|
||||
*(u16 *)((s32)a0 + 0xFC) = (rand() & 0x3FF) - 0x200;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x14) = rand();
|
||||
m = rand() & 0xFF;
|
||||
p = *(s32 *)((s32)a0 + 0x20);
|
||||
m = m | 0x100;
|
||||
*(u16 *)(p + 0x1A) = m;
|
||||
*(u16 *)(p + 0x18) = m;
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
s32 q;
|
||||
func_8001CA1C(*(s32 *)((s32)a0 + 0x20), &D_8018E978);
|
||||
func_8012A828((s32)a0, &D_8018E9D8);
|
||||
*(u32 *)(*(s32 *)((s32)a0 + 0x20) + 4) |= 0x8000000;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x2C) |= 0x10;
|
||||
*(u32 *)(*(s32 *)((s32)a0 + 0x20) + 4) |= 0x50000000;
|
||||
*(u16 *)((s32)a0 + 2) = 5;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0xF;
|
||||
s2 = rand();
|
||||
s1 = rand() % 0x60;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x14) = rand();
|
||||
*(u32 *)((s32)a0 + 0x94) = rand() & 7;
|
||||
*(s32 *)((s32)a0 + 0x14) = func_8004787C(s2) * s1 * 0x10 - 0xA80000;
|
||||
*(s32 *)((s32)a0 + 0x18) = func_80047948(s2) * s1 * 0x10;
|
||||
*(u16 *)((s32)a0 + 6) = *(u16 *)((s32)a0 + 6) - 0x28;
|
||||
q = *(s32 *)((s32)a0 + 0x20);
|
||||
*(u16 *)(q + 0x1A) = 0x1999;
|
||||
*(u16 *)(q + 0x18) = 0x1999;
|
||||
break;
|
||||
}
|
||||
case 6:
|
||||
if ((rand() & 1) != 0) {
|
||||
s32 m;
|
||||
s32 p;
|
||||
func_8001CA1C(*(s32 *)((s32)a0 + 0x20), &D_8018EA20);
|
||||
func_8012A828((s32)a0, &D_8018EA68);
|
||||
m = rand();
|
||||
p = *(s32 *)((s32)a0 + 0x20);
|
||||
m = (m & 0x1FF) | 0x200;
|
||||
*(u16 *)(p + 0x1A) = m;
|
||||
*(u16 *)(p + 0x18) = m;
|
||||
} else {
|
||||
s32 m;
|
||||
s32 p;
|
||||
func_8001CA1C(*(s32 *)((s32)a0 + 0x20), &D_8018EAA0);
|
||||
func_8012A828((s32)a0, &D_8018EAE8);
|
||||
*(u32 *)(*(s32 *)((s32)a0 + 0x20) + 4) |= 0x8000000;
|
||||
*(u16 *)((s32)a0 + 0xFC) = rand() & 0x3F;
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x14) = rand();
|
||||
m = rand();
|
||||
p = *(s32 *)((s32)a0 + 0x20);
|
||||
m = (m & 0x3FF) + 0x600;
|
||||
*(u16 *)(p + 0x1A) = m;
|
||||
*(u16 *)(p + 0x18) = m;
|
||||
}
|
||||
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x2C) |= 0x10;
|
||||
func_8012B23C((s32)a0);
|
||||
*(u16 *)((s32)a0 + 2) = 3;
|
||||
*(s32 *)((s32)a0 + 0x1C) = 0x78;
|
||||
*(u16 *)((s32)a0 + 0x16) = rand() | 0xFFFC;
|
||||
*(s32 *)((s32)a0 + 0x10) = *(u32 *)(*(s32 *)((s32)a0 + 0x64) + 0x10) << 2;
|
||||
*(s32 *)((s32)a0 + 0x18) = *(u32 *)(*(s32 *)((s32)a0 + 0x64) + 0x18) << 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern s32 rand(void);
|
||||
extern void func_80128EA8(s32, s32, s32);
|
||||
|
||||
@@ -7395,7 +7395,20 @@ void func_801827A4(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_007/nonmatchings/ov_SC07_007_jr_8017BEBC", func_801827E0);
|
||||
void func_801827E0(void) {
|
||||
s32 i;
|
||||
s32 end;
|
||||
|
||||
i = 0x801F0000;
|
||||
end = 0x801F944A;
|
||||
while (i <= end) {
|
||||
*(u8 *)i = *(u8 *)(-0x562B4 + i);
|
||||
i++;
|
||||
}
|
||||
func_8002D844(0x801F0000);
|
||||
func_8002D4C8(0x18E, 0);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC07_007/nonmatchings/ov_SC07_007_jr_8017BEBC", func_8018283C);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user