feat(decomp): ox wave cb overlays — 12 banked

Committed before the main batch: gate_main reverts on failure and would take these with it.
This commit is contained in:
Drew T
2026-08-24 22:30:24 -06:00
parent 3d1a79a70c
commit 89b4064c10
9 changed files with 330 additions and 12 deletions
+43 -1
View File
@@ -90,7 +90,49 @@ INCLUDE_ASM("asm/md_MAIN_015/nonmatchings/md_MAIN_015", func_800CB4F0);
INCLUDE_ASM("asm/md_MAIN_015/nonmatchings/md_MAIN_015", func_800CB6A4);
INCLUDE_ASM("asm/md_MAIN_015/nonmatchings/md_MAIN_015", func_800CB6FC);
extern signed char D_800CBB44[];
extern s32 func_80017758(void *a0, void *a1);
s32 func_800CB6FC(s32 param_1) {
unsigned char buf[0x34];
signed char *p;
short i;
u8 t;
p = D_800CBB44;
i = 0;
*(short *)(buf + 0x0c) = 0;
*(short *)(buf + 0x0a) = 0;
*(short *)(buf + 0x08) = 0;
*(short *)(buf + 0x1a) = 0;
*(short *)(buf + 0x12) = 0;
*(short *)(buf + 0x02) = 0;
t = *(u8 *)(param_1 + 0x30);
buf[0x22] = 0;
buf[0x21] = 0;
buf[0x20] = 0;
buf[0x2a] = 0;
buf[0x29] = 0;
buf[0x28] = 0;
buf[0x2e] = 0;
buf[0x2d] = 0;
buf[0x2c] = 0;
*(int *)(buf + 0x30) = 0x50000000;
buf[0x25] = t;
buf[0x26] = t;
buf[0x24] = t;
do {
*(short *)(buf + 0x00) = *p++;
*(short *)(buf + 0x04) = *p++;
*(short *)(buf + 0x10) = *p++;
*(short *)(buf + 0x14) = *p++;
*(short *)(buf + 0x18) = *p++;
*(short *)(buf + 0x1c) = *p--;
func_80017758(buf, (void *)((s32)param_1 + 0x38));
i++;
} while (i < 4);
}
extern void func_80146C3C(void);
+16 -1
View File
@@ -119,7 +119,22 @@ void func_800CB4F4(int param_1)
INCLUDE_ASM("asm/md_MAIN_022/nonmatchings/md_MAIN_022", func_800CB550);
INCLUDE_ASM("asm/md_MAIN_022/nonmatchings/md_MAIN_022", func_800CB5E4);
extern s32 func_80146E98(s32 a0);
extern void func_80146C3C();
void func_800CB5E4(void *a0) {
s32 v0;
s32 v1;
v0 = *(s32 *)((s32)a0 + 0x1C) << 9;
v1 = *(s32 *)((s32)a0 + 0x20);
*(u16 *)(v1 + 0x1A) = v0;
*(u16 *)(v1 + 0x18) = v0;
if (func_80146E98((s32)a0) != 0) {
func_80146C3C(a0);
}
}
extern void func_80146C3C(void);
+26 -1
View File
@@ -4224,7 +4224,32 @@ void func_8018694C(void *a0)
}
INCLUDE_ASM("asm/ov_SC02_003/nonmatchings/ov_SC02_003_jr_8018173C", func_801869CC);
void func_801869CC(s32 arg0)
{
extern s32 D_8018F33C;
extern s32 D_801E8018;
extern s32 func_80178B18(s32 param_1, s32 param_2);
extern int func_80178970(void);
extern void func_80178D18(void);
switch (*(u16 *)(arg0 + 0x34)) {
case 0:
if (D_801E8018 == 0)
return;
func_80178B18(arg0, (s32)&D_8018F33C);
break;
case 1:
if (((int (*)(s32))func_80178970)(arg0) == 0)
return;
((void (*)(s32))func_80178D18)(arg0);
break;
case 2:
default:
return;
}
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
}
extern void func_8002D4C8(s32 arg0, s32 arg1);
void func_80186A64(void *a0) {
+56 -2
View File
@@ -4813,7 +4813,20 @@ extern s32 func_8012B030(u8 *a0);
INCLUDE_ASM("asm/ov_SC02_035/nonmatchings/ov_SC02_035_jr_8017BEBC", func_8017F8A0);
INCLUDE_ASM("asm/ov_SC02_035/nonmatchings/ov_SC02_035_jr_8017BEBC", func_8017F918);
extern s32 func_8012BEE8(s32 a0);
void func_8017F918(void *a0) {
s32 v1;
if (func_8012BEE8((s32)a0)) {
*(u16 *)((char *)a0 + 0x2) = 6;
*(u16 *)((char *)a0 + 0x34) = 0;
v1 = *(s32 *)((char *)a0 + 0x20);
*(u16 *)(v1 + 0x1C) = 0x400;
*(u16 *)(v1 + 0x18) = 0x400;
*(u16 *)(*(s32 *)((char *)a0 + 0x20) + 0x1A) = 0x3000;
}
}
extern void func_8012BE54(s32 a0);
@@ -5215,7 +5228,48 @@ void func_801805FC(void *a0) {
}
INCLUDE_ASM("asm/ov_SC02_035/nonmatchings/ov_SC02_035_jr_8017BEBC", func_80180638);
void func_80180638(s32 a0) {
extern u8 D_800D3918[];
extern void func_801292C8(u8 *a0);
extern s32 func_801809E4(s32 a0, s32 a1, s32 a2);
s32 ret;
s32 partner;
ret = func_801809E4(a0, (s32)D_800D3918, 0x11);
if ((ret & 0xFF) == 0) {
if ((ret & 0x2000) != 0) {
if (*(s32 *)(a0 + 0x2C) == 0) {
func_801292C8((u8 *)a0);
return;
}
*(s32 *)(a0 + 0x1C) = 0x1E;
*(s16 *)(a0 + 0x2) = 4;
return;
} else {
if (*(s32 *)(a0 + 0x1C) < 0x23) {
*(s32 *)(a0 + 0x14) += 0x10000;
if (*(s32 *)(a0 + 0x2C) != 0) {
*(u8 *)(*(s32 *)(a0 + 0x20) + 0x27) = 0x62;
}
}
if (--*(s32 *)(a0 + 0x1C) != 0) {
return;
}
}
}
partner = *(s32 *)(a0 + 0x2C);
if (partner != 0) {
if (partner != -1) {
*(s32 *)(partner + 0x30) -= 1;
}
}
func_801292C8((u8 *)a0);
}
extern void func_80180C10(s32 a0);
+15 -1
View File
@@ -3280,7 +3280,21 @@ INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_jr_8017D5C0", func_8017E7B
INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_jr_8017D5C0", func_8017E808);
INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_jr_8017D5C0", func_8017E844);
void func_8017E844(u8 *a0) {
s16 arr[3];
if (--(*(s32 *)(a0 + 0x200)) == -1) {
*(u16 *)(a0 + 0x74) = 0x1080;
*(u16 *)(a0 + 0x72) = 0x1080;
*(u16 *)(a0 + 0x70) = 0x1080;
arr[0] = *(u16 *)(a0 + 6) - 0x40;
arr[1] = *(u16 *)(a0 + 0xA) - 0x10;
arr[2] = *(u16 *)(a0 + 0xE) + 0x10;
func_80146A6C(0x36, a0, (s16)arr[0], (s16)arr[1], (s16)arr[2], 0, 0);
func_80171990(a0);
}
}
INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_jr_8017D5C0", func_8017E8E8);
+21 -1
View File
@@ -3823,7 +3823,27 @@ INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_jr_8017DB5C", func_8018094
INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_jr_8017DB5C", func_801809D0);
INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_jr_8017DB5C", func_80180A80);
extern void func_800183E0(s32 a0);
extern void (*D_80186540[])(void *);
extern s32 func_8004787C(s32 a0);
void func_80180A80(void *a0)
{
u16 h;
func_800183E0(*(s32 *)((u8 *)D_80186540 + ((*(u16 *)((u8 *)a0 + 0xFC) << 1) & 0x1C)));
h = *(u16 *)((u8 *)a0 + 0xFE) + 0x40;
*(u16 *)((u8 *)a0 + 0xFE) = h;
if ((s16)h >= 0x201 || (s16)h < 0x600) {
*(u16 *)((u8 *)a0 + 0xFC) = 8;
}
*(u16 *)((u8 *)a0 + 6) = *(u16 *)((u8 *)a0 + 6) + 2;
*(s16 *)((u8 *)a0 + 0xA) = -0x32B - ((func_8004787C(*(s16 *)((u8 *)a0 + 0xFE)) << 6) >> 12);
if (*(s16 *)((u8 *)a0 + 0xFE) == 0x800) {
*(u16 *)((u8 *)a0 + 2) = 2;
}
}
INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_jr_8017DB5C", func_80180B38);
+78 -3
View File
@@ -5940,7 +5940,19 @@ void func_8017D280(s32 param_1, s16 *param_2) {
INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017D418);
INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017D474);
void func_8017D474(s32 a0, s32 a1, s32 a2) {
*(u16 *)(a0 + 0xA0) = *(u16 *)(a2 + 8);
*(u16 *)(a0 + 0xA2) = *(u16 *)(a2 + 0xA);
*(s32 *)(a0 + 0x14) = *(s32 *)(a2 + 0xC);
{
s32 y = *(s16 *)(a2 + 2);
s32 x = *(s16 *)(a2 + 0);
s32 frame_pad[1];
(void)&frame_pad;
*(s16 *)(a1 + 0) = x + (y - x) / 2;
}
}
void func_8017D4C8(s32 a0, s32 a1, s32 a2) {
*(u16 *)(a0 + 0xA0) = *(u16 *)(a2 + 8);
@@ -5997,7 +6009,46 @@ s32 func_8017D57C(void *a0, s32 *p) {
}
INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017D5C4);
extern s32 func_80029504(void);
extern void func_8012C1B8(void);
extern void func_8012CAE4(void *a0);
extern void func_8001C214(s32 a0, s32 a1);
void func_8017D5C4(void *a0) {
s32 s1;
s32 v0;
s32 ad;
s32 t;
extern u8 D_801860B0;
extern u8 D_801860A0[];
extern void (*D_80186090[])(void);
extern u8 D_80186080[];
s1 = func_80029504();
v0 = ((s32 (*)(void))func_8012C1B8)();
*(s32 *)((s32)a0 + 0x20) = v0;
if (v0 == 0) {
func_8012CAE4(a0);
return;
}
func_8001C214(v0, 0);
ad = (s32)&D_801860B0;
*(s32 *)((s32)a0 + 0x58) = ad;
t = *(u16 *)((s32)a0 + 0x2);
*(s16 *)((s32)a0 + 0x5C) = 0x80;
*(u16 *)((s32)a0 + 0x2) = t + 1;
if (s1 >= 0x384) {
*(s32 *)((s32)a0 + 0xDC) = func_8017D57C(a0, (s32 *)D_801860A0);
} else if (s1 >= 0x258) {
*(s32 *)((s32)a0 + 0xDC) = func_8017D57C(a0, (s32 *)D_80186090);
} else if (s1 >= 0xC8) {
*(s32 *)((s32)a0 + 0xDC) = func_8017D57C(a0, (s32 *)D_80186080);
}
}
void func_8017D690(void) {
}
@@ -6229,7 +6280,31 @@ INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017DBD
INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017DCA0);
INCLUDE_ASM("asm/ov_SC03_107/nonmatchings/ov_SC03_107_jr_801789AC", func_8017DD78);
extern s32 func_8012B8E4(s32 arg0, s32 arg1);
extern s32 func_8012BCCC(s32 a0);
extern s32 func_8012BDBC(s32 a0, s32 a1);
extern void func_8012B178(s32 a0, s32 a1);
extern s32 func_8012B608(s32 a0, s32 a1, s32 a2);
extern s32 func_8017ED6C(s32 a0, s32 a1);
extern s32 func_8017EB70(s32 arg0);
void func_8017DD78(s32 arg0) {
if (func_8012BDBC(arg0, 0x400) == 1) {
if (func_8012BCCC(arg0) < 0x3001) {
*(s16 *)(arg0 + 2) = 8;
return;
}
*(u16 *)(*(s32 *)(arg0 + 0x20) + 0x12) += func_8012B8E4(arg0, 4);
func_8012B178(arg0, *(s32 *)(arg0 + 0xE8));
func_8017ED6C(arg0, 1);
} else {
*(u16 *)(*(s32 *)(arg0 + 0x20) + 0x12) += func_8012B608(*(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12), *(s32 *)(arg0 + 0xE0), 0xA);
func_8012B178(arg0, *(s32 *)(arg0 + 0xE8));
func_8017ED6C(arg0, 0);
}
func_8017EB70(arg0);
}
extern void func_8012A828(s32 a0, void * a1);
extern void func_8017EB04(s32 a0);
+38 -1
View File
@@ -3500,7 +3500,44 @@ void func_8017D7CC(s32 a0) {
}
INCLUDE_ASM("asm/ov_SC06_022/nonmatchings/ov_SC06_022_jr_8017BEBC", func_8017D8D4);
void func_8017D8D4(s32 a0) {
extern s32 D_80126B58;
extern s16 D_80190E3C[];
extern Blk8_80126940_8017D7CC D_80126940;
Blk8_80126940_8017D7CC sp10;
u8 t;
s16 v0, v1;
if (func_80148800(&D_80126B58) & 3) {
t = (*(u8 *)(a0 + 5) + 1) & 1;
*(u8 *)(a0 + 5) = t;
*(s32 *)(a0 + 0x14) = D_80190E3C[t];
}
sp10 = D_80126940;
v1 = sp10.v[0];
if (v1 < -0xC0) {
sp10.v[0] = -0xC0;
} else if (v1 < 0xC1) {
;
} else {
sp10.v[0] = 0xC0;
}
v0 = sp10.v[2];
if (v0 < 0x6BE) {
sp10.v[2] = 0x6BE;
} else if (v0 < 0x701) {
;
} else {
sp10.v[2] = 0x700;
}
func_8017D9C0(a0, sp10.v);
}
// @class: schedule
+37 -1
View File
@@ -5549,7 +5549,43 @@ void func_80182B58(s32 a0)
}
INCLUDE_ASM("asm/ov_SC06_024/nonmatchings/ov_SC06_024_jr_8017BEBC", func_80182BD8);
extern void func_800484EC(s32 a0, s32 a1, s32 a2);
extern void RotMatrixY(s32 a0, void *a1);
extern s32 func_8012C658(s32 arg0, s32 arg1, s32 arg2);
extern s32 rand(void);
extern Blk20 D_800AE620;
extern u8 D_801AC510[];
void func_80182BD8(s32 a0, void *a1, s32 a2, s32 a3)
{
register s32 r __asm__("$2");
register s32 t __asm__("$3");
Blk20 m;
s32 out[3];
s32 ent;
s32 o;
m = D_800AE620;
ent = func_8012C658((s16)a2, (s16)a3, a0);
if (ent != 0) {
r = rand();
o = *(u16 *)(ent + 6);
*(u16 *)(ent + 6) = (o - 31) + (*(u16 *)a1 + (r & 0x3F));
r = rand();
o = *(u16 *)(ent + 10);
*(u16 *)(ent + 10) = (o - 31) + (((u16 *)a1)[1] + (r & 0x3F));
*(u16 *)(ent + 14) += ((u16 *)a1)[2];
RotMatrixY(*(s16 *)((u8 *)a1 + 6), &m);
func_800484EC((s32)&m, (s32)&D_801AC510, (s32)out);
t = out[0];
*(s32 *)(ent + 0x14) = -0x100000;
*(s32 *)(ent + 0x10) = t;
*(s32 *)(ent + 0x18) = out[2];
}
}
#include "common.h"