feat(decomp): ov_SC02_027/func_801831F4 + ov_SC06_000/func_80182E38 banked — the resolver's 2 DIFF refusals autopsied to bytes: each was a wrong internal-j target (goto-to-recheck vs cross-jumped call; shared negu vs else-arm negu) that rtu's R_MIPS_26 masking hid; one-line semantic fixes, whole-binary SHA green (P31 T1)

This commit is contained in:
Drew T
2026-08-26 14:00:50 -06:00
parent 80124c6810
commit f449a455bc
2 changed files with 106 additions and 2 deletions
+31 -1
View File
@@ -5646,7 +5646,37 @@ void *arg0;
}
INCLUDE_ASM("asm/ov_SC02_027/nonmatchings/ov_SC02_027_jr_8017D898", func_801831F4);
extern u16 D_80126B5E;
void func_801831F4(s32 arg)
{
register s32 a0 __asm__("$4");
a0 = arg;
switch (*(s16 *)((s32)a0 + 0x70)) {
case 1:
if (*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0xFE) == *(s16 *)((s32)a0 + 0x70)) {
s32 *base = (s32 *)(*(s32 *)((s32)a0 + 0x20));
s32 r = *(base + 1) & 0x7FFFFFFF;
*(base + 1) = r;
__asm__("" :: "r"(base), "r"(r));
*(u16 *)((s32)a0 + 0x5C) = 0xCC00;
func_80182AA4((void *)a0); /* direct call: the retail bytes `j .L80183298` land on the shared jal (cross-jump), not on the recheck */
}
break;
case 3:
if (*(s16 *)&D_80126B5E >= 0x281) {
*(u16 *)(*(s32 *)((s32)a0 + 0x20) + 0x10) = 0;
}
/* fall through */
default:
if (*(s16 *)(*(s32 *)((s32)a0 + 0x64) + 0xFE) == *(s16 *)((s32)a0 + 0x70)) {
func_80182AA4((void *)a0);
}
break;
}
}
void func_801832B0(u8 *a0)
{
+75 -1
View File
@@ -7956,7 +7956,81 @@ void func_80182CD8(int param_1)
}
INCLUDE_ASM("asm/ov_SC06_000/nonmatchings/ov_SC06_000_jr_8017AE2C", func_80182E38);
void func_80182E38(int param_1)
{
extern s32 D_80126B58;
extern s32 D_801AECB0;
extern unsigned char D_8018C644;
extern void func_8004978C(s16 *a0, void *a1);
extern void func_8018325C(s32 a0, void *a1, void *a2);
extern void func_8012E014(s32 a0);
extern void func_8012B2CC(s32 a0);
short *dst;
char mat[0x20];
char sv[8];
int v0;
int t1;
int t2;
unsigned int uVar2;
int t;
dst = (short *)&D_80126B58;
if (*(short *)(param_1 + 0x70) < 4) {
*(unsigned short *)(sv + 2) = 0;
*(unsigned short *)(sv + 0) = 0;
t1 = *(short *)(*(int *)(param_1 + 0x64) + 0x100);
if (t1 >= -0xd0) {
v0 = -0x1a0; /* retail: -0x1A0 in the j delay slot, jumping PAST the negu */
} else {
t = (t1 + 0xc0) * 0x3600;
v0 = -(((int)t >> 16) + 0x1a0); /* the negu belongs to the else-arm only */
}
*(short *)(sv + 4) = v0;
func_8004978C((s16 *)(*(int *)(param_1 + 0x20) + 0x10), mat);
__asm__ __volatile__(
"lw $12, 0(%0)\n" "lw $13, 4(%0)\n"
"ctc2 $12, $0\n" "ctc2 $13, $1\n"
"lw $12, 8(%0)\n" "lw $13, 12(%0)\n" "lw $14, 16(%0)\n"
"ctc2 $12, $2\n" "ctc2 $13, $3\n" "ctc2 $14, $4\n"
: : "r"(mat) : "$12", "$13", "$14", "memory");
__asm__ __volatile__("lwc2 $0, 0(%0)\n" "lwc2 $1, 4(%0)\n" : : "r"(sv) : "memory");
__asm__ __volatile__("nop\n" "nop\n" "mvmva 1, 0, 0, 3, 0\n" : : : "memory");
__asm__ __volatile__(
"mfc2 $12, $9\n" "mfc2 $13, $10\n" "mfc2 $14, $11\n"
"sh $12, 0(%0)\n" "sh $13, 2(%0)\n" "sh $14, 4(%0)\n"
: : "r"(sv) : "$12", "$13", "$14", "memory");
*(short *)(param_1 + 6) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 6) + *(unsigned short *)(sv + 0);
*(short *)(param_1 + 10) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 10) + *(unsigned short *)(sv + 2);
*(short *)(param_1 + 14) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 14) + *(unsigned short *)(sv + 4);
t2 = *(short *)(*(int *)(param_1 + 0x64) + 0x100);
if (t2 != 0 && t2 >= -0x24f) {
uVar2 = *(unsigned int *)(param_1 + 0x1c);
*(unsigned int *)(param_1 + 0x1c) = uVar2 + 1;
if ((uVar2 & 7) == 0) {
*(short *)(sv + 0) = -0x48;
*(short *)(sv + 2) = 0;
*(short *)(sv + 4) = 0x58;
func_8018325C(param_1, mat, sv);
*(short *)(sv + 0) = 0x48;
func_8018325C(param_1, mat, sv);
}
}
} else {
*(short *)(param_1 + 6) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 6);
*(short *)(param_1 + 10) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 10);
*(short *)(param_1 + 14) = *(unsigned short *)(*(int *)(param_1 + 0x64) + 14);
}
if (D_801AECB0 == 0 && *(unsigned char *)(param_1 + 0x74) != 0) {
func_8012E014(param_1);
*(dst + 5) =
(*(unsigned short *)(param_1 + 10) +
*(unsigned short *)(&D_8018C644 + (*(short *)(param_1 + 0xfe) << 4))) - 1;
} else {
func_8012B2CC(param_1);
}
}
extern void (*D_8018C66C[])(void);