mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-08 17:51:46 -04:00
feat(phase-30 S48-0b): jtbl family func_8015AE2C — 1/3 blocked-binary siblings banked
This commit is contained in:
+1
-1
@@ -4938,7 +4938,7 @@ ov_SC02_037_ELF := $(ov_SC02_037_OUT).elf
|
||||
ov_SC02_037_MAPFILE := $(ov_SC02_037_OUT).map
|
||||
ov_SC02_037_LD_SCRIPT := $(ov_SC02_037_OUT).ld
|
||||
ov_SC02_037_SPLAT_YAML := config/splat.ov_SC02_037.yaml
|
||||
ov_SC02_037_JTBL_INTERLEAVE := --order tail.data.o,ov_SC02_037_jr_801789AC.o,tail2.data.o,ov_SC02_037_jr_8017AE2C.o,tail3.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
|
||||
ov_SC02_037_JTBL_INTERLEAVE := --order tail.data.o,ov_SC02_037.o,tail2.data.o,ov_SC02_037_jr_801789AC.o,tail3.data.o,ov_SC02_037_jr_8017AE2C.o,tail4.data.o,trailing.o # Phase-26 §8 jtbl-rodata carve
|
||||
build/src/ov_SC02_037/ov_SC02_037_jr_8017AE2C.o: JTBL_PADS := 0,0,0,0 # §8e pads (jtbl_carve.py) tables=+0x0,+0x14,+0x34,+0x4c
|
||||
ov_SC02_037_CHECK_SHA := config/check.ov_SC02_037.sha
|
||||
ov_SC02_037_SYMBOLS := config/symbols.ov_SC02_037.txt
|
||||
|
||||
@@ -97,10 +97,12 @@ segments:
|
||||
- [0x50854, c, ov_SC02_037_jr_801789AC]
|
||||
- [0x52cd4, c, ov_SC02_037_jr_8017AE2C]
|
||||
- [0x5ba68, data, tail]
|
||||
- [0x9fc6c, .rodata, ov_SC02_037] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0x9fc88, data, tail2]
|
||||
- [0x9ff24, .rodata, ov_SC02_037_jr_801789AC] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0x9ff3c, data, tail2]
|
||||
- [0x9ff3c, data, tail3]
|
||||
- [0xa01d4, .rodata, ov_SC02_037_jr_8017AE2C] # Phase-26 §8 jtbl-rodata carve (jtbl_carve.py)
|
||||
- [0xa0238, data, tail3]
|
||||
- [0xa0238, data, tail4]
|
||||
- [0xA198C, bin, trailing] # final 3 bytes (EOF not 4-aligned; spimdisasm drops a partial word)
|
||||
- [0xA198F] # 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
|
||||
|
||||
@@ -13303,7 +13303,336 @@ DEFINE_func_8015AD78() /* dedup: shared engine-core @0x8015ad78 (src/shared) */
|
||||
DEFINE_func_8015ADB0() /* dedup: shared engine-core @0x8015adb0 (src/shared) */
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC02_037/nonmatchings/ov_SC02_037", func_8015AE2C);
|
||||
|
||||
/* func_8015AE2C (ov_SC01_077_after, 562 ins, jtbl_801D8B54) — Phase 26 crack
|
||||
* Entity main-update dispatcher: 7-case switch (0/1/2/6 shared, 3/4/5 own, no default
|
||||
* block — out-of-range falls to the after-switch join), then movement/clamp/decay tail.
|
||||
* PIN-FREE. Offset-pure (s32 arg0 + raw offsets) — ×134 template-safe.
|
||||
*
|
||||
* match_one: MATCH (562 ins). rtu_match (whole-TU): MATCH (562 ins) — see func_8015AE2C.md
|
||||
* for the two TU-side prerequisites (engine_core.h DEFINE_func_8015BEC4 extern must drop its
|
||||
* `(void)` prototype, and the def must stay K&R) plus the jtbl_carve trailing-pad-word note.
|
||||
*
|
||||
* Signature: `s32` return + K&R def are REQUIRED by the TU, byte-neutral vs void/ANSI here
|
||||
* (both verified MATCH 562): engine_core.h's thunk DEFINE_func_8015BEC4 does
|
||||
* `return func_8015AE2C();` (s32, zero-arg call) — only an unprototyped K&R def coexists
|
||||
* with that call. §41d does not bite on this body (it has early `return;`s).
|
||||
*
|
||||
* jtbl_801D8B54 = 7 entries [0,1,2,6]->0x8015AEE4 [3]->0x8015AFE0 [4]->0x8015AFF0
|
||||
* [5]->0x8015B000, bound `sltiu 7`, default(out-of-range) -> 0x8015B044 (after-switch).
|
||||
* The raw dlabel's 8th word 0x00000000 is NOT a table entry: it is the original TU's
|
||||
* intra-TU `.align 3` pad between consecutive jtbls (B34/B54/B74 chain) — the compiled
|
||||
* object emits exactly 28 B; the pad must stay in the raw post-carve data piece.
|
||||
*/
|
||||
extern void (*D_801862A8[])(void *);
|
||||
extern s32 func_80161A60(s32 a0);
|
||||
extern u16 func_801487F4(s32 *a0);
|
||||
extern s32 func_80149FB0(s32 a0);
|
||||
extern s32 func_801619A4(s32 *a0);
|
||||
extern s32 func_80149C08(s32 a0);
|
||||
extern void func_801577C8();
|
||||
extern s32 func_8015B6F4(s32 a0);
|
||||
extern s32 func_8015B7B4(s32 a0);
|
||||
extern void func_80154A74(s32 a0, s32 a1);
|
||||
extern void func_8015B8F8(s32 *a0);
|
||||
extern s32 func_80146994(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern s32 func_801498E0(s32 *a0);
|
||||
extern s32 func_80149954(s32 s0);
|
||||
extern s32 func_80149A64(s32 *a0);
|
||||
extern void func_800CCCC0(s32 a0);
|
||||
extern int func_80155FF8(int arg, int a1);
|
||||
extern s32 func_8015B858(u8 *a0);
|
||||
extern void func_80148038(s32 a0, s32 a1);
|
||||
extern void func_80147460(s32 a0);
|
||||
extern void func_80147814(s32 a0, s32 a1);
|
||||
extern s32 func_800CF8B4(void);
|
||||
extern s32 func_801491C4(s32 a0);
|
||||
extern int func_80148AFC(void *a0);
|
||||
extern s32 func_80149184(s32 a0);
|
||||
extern void func_80146E90(s32 *a0, s32 a1);
|
||||
extern void func_80147A30(s32 a0, s32 a1, s32 a2);
|
||||
extern s32 func_80146E98(s32 a0);
|
||||
extern void func_80146D90(s32 a0);
|
||||
extern void func_80147A84(s32 a0);
|
||||
extern void func_801473EC(s32 *a0);
|
||||
extern s32 func_80172644(u8 *a0);
|
||||
extern void func_80147AD4(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
extern void func_801541D8(u8 *a0, s32 a1, s32 a2);
|
||||
extern s32 func_8014C050(s32 a0, s32 a1);
|
||||
extern void func_800CCB78(s32 a0);
|
||||
extern void func_80154150(s32 a0, s32 a1);
|
||||
extern void func_80154274(s32 *a0, s32 a1);
|
||||
extern s32 func_80161488(void *a0);
|
||||
extern void func_80146CA0(void *a0);
|
||||
extern s32 func_8014A674(s32 *a0);
|
||||
extern void func_8014E434(void);
|
||||
extern void func_8015CC40(s32 *a0);
|
||||
extern s32 func_8014A69C(s32 *a0);
|
||||
extern void func_8014E6A0(void);
|
||||
extern void func_8015CF8C(s32 *a0);
|
||||
extern s32 func_801725A4(u8 *a0);
|
||||
extern s16 D_801152A0;
|
||||
extern u8 D_800D4BE0[];
|
||||
extern s32 D_800D4E94;
|
||||
extern s32 D_800D4ED4;
|
||||
extern u8 D_800D4F8C[];
|
||||
extern s32 D_800D4A9C;
|
||||
extern s32 D_800D4B48;
|
||||
|
||||
s32 func_8015AE2C(arg0)
|
||||
s32 arg0;
|
||||
{
|
||||
s32 flag;
|
||||
s32 r;
|
||||
s32 lim;
|
||||
s32 doit;
|
||||
s32 t;
|
||||
|
||||
flag = 0;
|
||||
if ((func_80161A60(arg0) != 0) && (((s32 (*)(s32))func_801487F4)(arg0) & 0x40) && (*(s32 *)(arg0 + 0x34) >= 0)) {
|
||||
flag = 1;
|
||||
if (*(s32 *)(arg0 + 0x5C) == 0) {
|
||||
*(s32 *)(arg0 + 0x58) = 0;
|
||||
*(s32 *)(arg0 + 0x54) = 0;
|
||||
*(s32 *)(arg0 + 0x50) = 0;
|
||||
}
|
||||
*(s32 *)(arg0 + 0x5C) = 1;
|
||||
} else {
|
||||
*(s32 *)(arg0 + 0x5C) = 0;
|
||||
}
|
||||
((void (*)(s32))func_80149FB0)(arg0);
|
||||
if (*(s32 *)(arg0 + 0x1B0) == 0) {
|
||||
switch (((s32 (*)(s32))func_801619A4)(arg0)) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 6:
|
||||
if (*(s32 *)(arg0 + 0xB4) == (s32)&(*(s32 *)&D_800D4BE0)) {
|
||||
if (func_80149C08(arg0) != 0) {
|
||||
D_801862A8[*(u16 *)arg0]((void *)arg0);
|
||||
((void (*)(s32))func_801577C8)(arg0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ((*(s32 *)(arg0 + 0xB4) != (s32)&D_800D4E94) &&
|
||||
(*(s32 *)(arg0 + 0xB4) != (s32)&D_800D4ED4) &&
|
||||
(*(s32 *)(arg0 + 0xB4) != (s32)&(*(s32 *)&D_800D4F8C))) {
|
||||
if (func_8015B6F4(arg0) == 0) {
|
||||
((void (*)(s32))func_8015B7B4)(arg0);
|
||||
}
|
||||
} else {
|
||||
if (*(u16 *)(arg0 + 0xB8) == 0x8000) {
|
||||
func_80154A74(arg0, 0x22);
|
||||
((void (*)(s32))func_8015B8F8)(arg0);
|
||||
*(u32 *)(arg0 + 0x44) &= ~2;
|
||||
if (flag != 0) {
|
||||
((void (*)(s32, s32, s32, s32))func_80146994)(0x3B, arg0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
((void (*)(s32))func_801498E0)(arg0);
|
||||
break;
|
||||
case 4:
|
||||
((void (*)(s32))func_80149954)(arg0);
|
||||
break;
|
||||
case 5:
|
||||
if (((s32 (*)(s32))func_80149A64)(arg0) != 0) {
|
||||
D_801862A8[*(u16 *)arg0]((void *)arg0);
|
||||
func_800CCCC0(arg0);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (*(u32 *)(arg0 + 0x44) & 2) {
|
||||
((void (*)(s32, s32))func_80155FF8)(arg0, *(u8 *)(arg0 + 0x1AA));
|
||||
} else {
|
||||
if ((*(s32 *)(arg0 + 0x240) == 0) && (((s32 (*)(s32))func_8015B858)(arg0) != 0)) {
|
||||
*(s32 *)(arg0 + 0x240) += 1;
|
||||
}
|
||||
if ((*(s32 *)(arg0 + 0xB4) == (s32)&(*(s32 *)&D_800D4BE0)) && (*(u16 *)(arg0 + 0xB8) & 0x8000)) {
|
||||
((void (*)(s32))func_8015B8F8)(arg0);
|
||||
} else if ((*(s32 *)(arg0 + 0xB4) == (s32)&D_800D4A9C) ||
|
||||
(*(s32 *)(arg0 + 0xB4) == (s32)&D_800D4B48)) {
|
||||
if (*(u16 *)(arg0 + 0xB8) & 0x8000) {
|
||||
if (*(s32 *)(arg0 + 0x34) >= 0) {
|
||||
*(u16 *)(arg0 + 0xB8) += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*(u8 *)(arg0 + 0x1C6) != 0) {
|
||||
if (((s32 (*)(s32))func_801487F4)(arg0) & 0x40) {
|
||||
func_80148038(arg0, 0xFFFE6000);
|
||||
} else {
|
||||
func_80148038(arg0, 0x1A000);
|
||||
}
|
||||
lim = 0x40000;
|
||||
if ((*(s32 *)(arg0 + 0xB4) != (s32)&D_800D4E94) &&
|
||||
(*(s32 *)(arg0 + 0xB4) != (s32)&D_800D4ED4) &&
|
||||
(*(s32 *)(arg0 + 0xB4) != (s32)&(*(s32 *)&D_800D4F8C))) {
|
||||
lim = 0xC0000;
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x34) < -lim) {
|
||||
*(s32 *)(arg0 + 0x34) = -lim;
|
||||
} else if (lim < *(s32 *)(arg0 + 0x34)) {
|
||||
*(s32 *)(arg0 + 0x34) = lim;
|
||||
}
|
||||
func_80147460(arg0);
|
||||
} else {
|
||||
if (*(s32 *)(arg0 + 0x34) < 0) {
|
||||
if (((s32 (*)(s32))func_801487F4)(arg0) & 0x40) {
|
||||
func_80147814(arg0, 0xFFFF0000);
|
||||
}
|
||||
func_80147814(arg0, 0x10000);
|
||||
}
|
||||
}
|
||||
if (func_800CF8B4() != 0) {
|
||||
*(u16 *)(*(s32 *)(arg0 + 0x20) + 0x12) = ((*(u16 *)&D_801152A0) + func_801491C4(arg0)) & 0xFFF;
|
||||
}
|
||||
if (flag == 0) {
|
||||
if ((u8)((s32 (*)(s32))func_80148AFC)(arg0)) {
|
||||
(*(u16 *)&D_801152A0) = func_80149184(arg0);
|
||||
((void (*)(s32, s32))func_80146E90)(arg0, 4);
|
||||
if (*(s32 *)(arg0 + 0x2C) > -0x80000) {
|
||||
*(s32 *)(arg0 + 0x2C) = -0x80000;
|
||||
func_80147A30(arg0, -0x10000, 0xBA000);
|
||||
} else {
|
||||
func_80147A30(arg0, -0x1000, 0xBA000);
|
||||
}
|
||||
} else {
|
||||
if (func_80146E98(arg0) != 0) {
|
||||
func_80146D90(arg0);
|
||||
}
|
||||
}
|
||||
func_80147A84(arg0);
|
||||
((void (*)(s32))func_801473EC)(arg0);
|
||||
if (*(u8 *)(arg0 + 0x1C6) == 0) {
|
||||
func_80148038(arg0, 0x1A000);
|
||||
func_80147460(arg0);
|
||||
}
|
||||
} else {
|
||||
((void (*)(s32))func_80172644)(arg0);
|
||||
if ((u8)((s32 (*)(s32))func_80148AFC)(arg0)) {
|
||||
(*(u16 *)&D_801152A0) = func_80149184(arg0);
|
||||
func_80146D90(arg0);
|
||||
func_80147AD4(arg0, 0, 0, 0xFFFF4000);
|
||||
*(s32 *)(arg0 + 0x50) += *(s32 *)(arg0 + 0x10);
|
||||
*(s32 *)(arg0 + 0x54) += *(s32 *)(arg0 + 0x14);
|
||||
*(s32 *)(arg0 + 0x58) += *(s32 *)(arg0 + 0x18);
|
||||
if (*(s32 *)(arg0 + 0x50) > 0xBA000) {
|
||||
*(s32 *)(arg0 + 0x50) = 0xBA000;
|
||||
} else if (*(s32 *)(arg0 + 0x50) < -0xBA000) {
|
||||
*(s32 *)(arg0 + 0x50) = -0xBA000;
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x54) > 0xBA000) {
|
||||
*(s32 *)(arg0 + 0x54) = 0xBA000;
|
||||
} else if (*(s32 *)(arg0 + 0x54) < -0xBA000) {
|
||||
*(s32 *)(arg0 + 0x54) = -0xBA000;
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x58) > 0xBA000) {
|
||||
*(s32 *)(arg0 + 0x58) = 0xBA000;
|
||||
} else if (*(s32 *)(arg0 + 0x58) < -0xBA000) {
|
||||
*(s32 *)(arg0 + 0x58) = -0xBA000;
|
||||
}
|
||||
*(s32 *)(arg0 + 0x10) = *(s32 *)(arg0 + 0x50);
|
||||
*(s32 *)(arg0 + 0x14) = *(s32 *)(arg0 + 0x54);
|
||||
*(s32 *)(arg0 + 0x18) = *(s32 *)(arg0 + 0x58);
|
||||
((void (*)(s32))func_801473EC)(arg0);
|
||||
} else {
|
||||
doit = 0;
|
||||
if (*(s32 *)(arg0 + 0x50) != 0) {
|
||||
doit = 1;
|
||||
if (*(s32 *)(arg0 + 0x50) >= 0) {
|
||||
*(s32 *)(arg0 + 0x50) -= 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x50) < 0) {
|
||||
*(s32 *)(arg0 + 0x50) = 0;
|
||||
}
|
||||
} else {
|
||||
*(s32 *)(arg0 + 0x50) += 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x50) >= 0) {
|
||||
*(s32 *)(arg0 + 0x50) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x54) != 0) {
|
||||
doit = 1;
|
||||
if (*(s32 *)(arg0 + 0x54) >= 0) {
|
||||
*(s32 *)(arg0 + 0x54) -= 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x54) < 0) {
|
||||
*(s32 *)(arg0 + 0x54) = 0;
|
||||
}
|
||||
} else {
|
||||
*(s32 *)(arg0 + 0x54) += 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x54) >= 0) {
|
||||
*(s32 *)(arg0 + 0x54) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x58) != 0) {
|
||||
doit = 1;
|
||||
if (*(s32 *)(arg0 + 0x58) >= 0) {
|
||||
*(s32 *)(arg0 + 0x58) -= 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x58) < 0) {
|
||||
*(s32 *)(arg0 + 0x58) = 0;
|
||||
}
|
||||
} else {
|
||||
*(s32 *)(arg0 + 0x58) += 0x8000;
|
||||
if (*(s32 *)(arg0 + 0x58) >= 0) {
|
||||
*(s32 *)(arg0 + 0x58) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (doit != 0) {
|
||||
*(s32 *)(arg0 + 0x10) = *(s32 *)(arg0 + 0x50);
|
||||
*(s32 *)(arg0 + 0x14) = *(s32 *)(arg0 + 0x54);
|
||||
*(s32 *)(arg0 + 0x18) = *(s32 *)(arg0 + 0x58);
|
||||
((void (*)(s32))func_801473EC)(arg0);
|
||||
}
|
||||
if (!(*(u32 *)(arg0 + 0x44) & 2)) {
|
||||
((void (*)(s32, s32, s32))func_801541D8)(arg0, 0xF, 0x12);
|
||||
}
|
||||
}
|
||||
t = func_8014C050(arg0, 0x3B);
|
||||
if (t != 0) {
|
||||
func_800CCB78(t);
|
||||
}
|
||||
if ((*(u16 *)(arg0 + 0x1C8) & 0x1F) == 0) {
|
||||
((void (*)(s32, s32, s32, s32))func_80146994)(0x3C, arg0, 0, 0);
|
||||
}
|
||||
}
|
||||
if (*(s32 *)(arg0 + 0x1B0) != 0) {
|
||||
if (*(s32 *)(arg0 + 0x1B0) == 1) {
|
||||
func_80154A74(arg0, 0x22);
|
||||
func_80154150(arg0, 0xF);
|
||||
} else {
|
||||
((void (*)(s32, s32))func_80154274)(arg0, *(s32 *)(arg0 + 0x1B4));
|
||||
}
|
||||
}
|
||||
r = ((s32 (*)(s32))func_80161488)(arg0);
|
||||
if (r & 5) {
|
||||
*(u32 *)(arg0 + 0x44) &= ~2;
|
||||
if (*(s32 *)(arg0 + 0xB4) == (s32)&D_800D4A9C) {
|
||||
func_80154150(arg0, 0xE);
|
||||
} else {
|
||||
func_80154150(arg0, 0x10);
|
||||
}
|
||||
((void (*)(s32))func_80146CA0)(arg0);
|
||||
}
|
||||
if (r == 0) {
|
||||
if ((((s32 (*)(s32))func_8014A674)(arg0) != 0) && (((s32 (*)(s32))func_8014E434)(arg0) != 0)) {
|
||||
D_801862A8[*(u16 *)arg0]((void *)arg0);
|
||||
((void (*)(s32))func_8015CC40)(arg0);
|
||||
} else if ((((s32 (*)(s32))func_8014A69C)(arg0) != 0) && (((s32 (*)(s32))func_8014E6A0)(arg0) != 0)) {
|
||||
D_801862A8[*(u16 *)arg0]((void *)arg0);
|
||||
((void (*)(s32))func_8015CF8C)(arg0);
|
||||
} else {
|
||||
((void (*)(s32))func_801725A4)(arg0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_func_8015B6F4() /* dedup: shared engine-core @0x8015b6f4 (src/shared) */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user