mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-10-05 17:03:23 -04:00
feat(decomp): free A-prop sibling lane (maintenance pass) — zero model tokens
This commit is contained in:
@@ -30,7 +30,19 @@ void func_800CCB20(s32 a0)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/md_MAIN_042/nonmatchings/md_MAIN_042", func_800CCBA0);
|
||||
extern void (*D_800CCD94[])(s32);
|
||||
extern void func_80149020(s32 *a0);
|
||||
|
||||
void func_800CCBA0(param_1)
|
||||
s32 param_1;
|
||||
{
|
||||
s32 s0 = param_1;
|
||||
s32 idx;
|
||||
func_80149020(s0);
|
||||
idx = *(u16 *)(s0 + 2) - 2;
|
||||
D_800CCD94[idx](s0);
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@@ -6569,7 +6569,15 @@ extern void func_80016714(void *a0, s32 a1);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_090/nonmatchings/ov_SC03_090_jr_8017CA80", func_80184E58);
|
||||
extern s32 D_801A3048;
|
||||
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
|
||||
void func_80184E58(arg0)
|
||||
s32 arg0;
|
||||
{
|
||||
((void (*)(void *, s32, s32, s32))func_8012D5E4)((void *)arg0, &D_801A3048, (s32)&D_801A3048 + 0x8, 0x5);
|
||||
}
|
||||
|
||||
|
||||
#define gte_SetRotMatrix(r0) __asm__ volatile ( \
|
||||
"lw $12, 0( %0 );" \
|
||||
|
||||
@@ -3277,7 +3277,15 @@ extern void func_80016714(void *a0, s32 a1);
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_104/nonmatchings/ov_SC03_104_jr_80182038", func_80182CEC);
|
||||
extern s32 D_80199F10;
|
||||
extern s32 func_8012D5E4(s32 a0, s32 a1, s32 a2, s32 a3);
|
||||
|
||||
void func_80182CEC(arg0)
|
||||
s32 arg0;
|
||||
{
|
||||
((void (*)(void *, s32, s32, s32))func_8012D5E4)((void *)arg0, &D_80199F10, (s32)&D_80199F10 + 0x8, 0x5);
|
||||
}
|
||||
|
||||
|
||||
#define gte_SetRotMatrix(r0) __asm__ volatile ( \
|
||||
"lw $12, 0( %0 );" \
|
||||
|
||||
@@ -5869,7 +5869,48 @@ void func_80181ECC(void *a0)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_8017C24C", func_80181EEC);
|
||||
extern int func_8012C354();
|
||||
extern u8 D_801A7D38[];
|
||||
extern u8 D_801A7D6C[];
|
||||
extern u8 D_801ACC70[];
|
||||
extern u8 D_801AF2B0[];
|
||||
extern void func_8001C214(s32 a0, s32 a1);
|
||||
extern void func_8012A828();
|
||||
extern void func_8012B030();
|
||||
extern void func_8012B23C();
|
||||
|
||||
void func_80181EEC(a0)
|
||||
s32 a0;
|
||||
{
|
||||
|
||||
extern u8 D_801A7D38[];
|
||||
extern u8 D_801ACC70[];
|
||||
extern u8 D_801AF2B0[];
|
||||
extern u8 D_801A7D6C[];
|
||||
|
||||
s32 v0;
|
||||
|
||||
v0 = func_8012C354(a0, (s32)D_801A7D38);
|
||||
if (v0 != 0) {
|
||||
if (*(s16 *)(a0 + 0x70) != 0) {
|
||||
func_8001C214(*(s32 *)(a0 + 0x20), (s32)D_801ACC70);
|
||||
}
|
||||
*(u8 *)(a0 + 0xC0) = 1;
|
||||
*(s32 *)(a0 + 0xB4) = 0xFFFFDFDF;
|
||||
func_8012B030(a0);
|
||||
*(s16 *)(a0 + 0xAE) = 0x2100;
|
||||
func_8012A828(a0, D_801AF2B0);
|
||||
*(u16 *)(a0 + 2) = *(u16 *)(a0 + 2) + 1;
|
||||
func_8012B23C(a0);
|
||||
*(void **)(a0 + 0xBC) = D_801A7D6C;
|
||||
*(u32 *)(a0 + 0xC4) = *(u32 *)(a0 + 0xC4) | 2;
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x2C) = *(u16 *)(*(s32 *)(a0 + 0x20) + 0x2C) | 0x10;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x18) = 0x2400;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x1A) = 0x2400;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x1C) = 0x2400;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_80181FDC(void) {
|
||||
}
|
||||
@@ -5992,7 +6033,48 @@ void func_80182198(void *a0)
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_8017C24C", func_801821B8);
|
||||
extern int func_8012C354();
|
||||
extern u8 D_801A7DB0[];
|
||||
extern u8 D_801A7DE4[];
|
||||
extern u8 D_801AD9DC[];
|
||||
extern u8 D_801AF3B0[];
|
||||
extern void func_8001C214(s32 a0, s32 a1);
|
||||
extern void func_8012A828();
|
||||
extern void func_8012B030();
|
||||
extern void func_8012B23C();
|
||||
|
||||
void func_801821B8(a0)
|
||||
s32 a0;
|
||||
{
|
||||
|
||||
extern u8 D_801A7DB0[];
|
||||
extern u8 D_801AD9DC[];
|
||||
extern u8 D_801A7DE4[];
|
||||
extern u8 D_801AF3B0[];
|
||||
|
||||
s32 v0;
|
||||
|
||||
v0 = func_8012C354(a0, (s32)D_801A7DB0);
|
||||
if (v0 != 0) {
|
||||
if (*(s16 *)(a0 + 0x70) != 0) {
|
||||
func_8001C214(*(s32 *)(a0 + 0x20), (s32)D_801AD9DC);
|
||||
}
|
||||
*(u8 *)(a0 + 0xC0) = 1;
|
||||
*(s32 *)(a0 + 0xB4) = 0xFFFFDFDF;
|
||||
func_8012B030(a0);
|
||||
*(void **)(a0 + 0xBC) = D_801A7DE4;
|
||||
*(s16 *)(a0 + 0xAE) = 0x2100;
|
||||
*(u32 *)(a0 + 0xC4) = *(u32 *)(a0 + 0xC4) | 2;
|
||||
func_8012A828(a0, D_801AF3B0);
|
||||
*(u16 *)(a0 + 2) = *(u16 *)(a0 + 2) + 1;
|
||||
func_8012B23C(a0);
|
||||
*(u16 *)(*(s32 *)(a0 + 0x20) + 0x2C) = *(u16 *)(*(s32 *)(a0 + 0x20) + 0x2C) | 0x10;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x18) = 0x2400;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x1A) = 0x2400;
|
||||
*(s16 *)(*(s32 *)(a0 + 0x20) + 0x1C) = 0x2400;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_801822AC(void) {
|
||||
}
|
||||
|
||||
@@ -3230,7 +3230,120 @@ void func_8018D98C(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_8018D98C", func_8018E4A4);
|
||||
extern s32 func_8012C588(s32 a0, s32 a1);
|
||||
extern s32 func_8012C658(s32 arg0, s32 arg1, s32 arg2);
|
||||
extern u8 *func_8012913C();
|
||||
extern u8 D_801C9488[];
|
||||
extern void func_8001C214();
|
||||
extern void func_8002A04C(s32 a0);
|
||||
extern void func_8002D4C8(s32 a0, s32 a1);
|
||||
extern void func_8012C218(void *a0);
|
||||
extern void func_80189390(void *a0);
|
||||
|
||||
void func_8018E4A4(arg0)
|
||||
s32 arg0;
|
||||
{
|
||||
s32 e;
|
||||
s32 p;
|
||||
s32 i;
|
||||
s32 t;
|
||||
|
||||
switch (*(u16 *)(arg0 + 0x34)) {
|
||||
case 0:
|
||||
*(s32 *)(arg0 + 0x1C) = 0x1E;
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
goto end;
|
||||
case 1:
|
||||
*(u8 *)(arg0 + 0xC2) = 0xA;
|
||||
e = ((s32 (*)(s32))func_8012913C)(0x23);
|
||||
if (e != 0) {
|
||||
*(u16 *)(e + 6) = *(u16 *)(arg0 + 6) - rand() % 224 + 0x10;
|
||||
*(u16 *)(e + 0xA) = *(u16 *)(arg0 + 0xA) - rand() % 320;
|
||||
*(u16 *)(e + 0xE) = *(u16 *)(arg0 + 0xE) - 0x28;
|
||||
*(s32 *)(e + 0x18) = 0;
|
||||
*(s32 *)(e + 0x14) = 0;
|
||||
*(s32 *)(e + 0x10) = 0;
|
||||
*(u16 *)(e + 0x34) = (rand() & 0x17FF) + 0x1800;
|
||||
func_8002D4C8(0xAD7, 0);
|
||||
}
|
||||
t = *(s32 *)(arg0 + 0x1C) - 1;
|
||||
*(s32 *)(arg0 + 0x1C) = t;
|
||||
if (t == 0) {
|
||||
e = *(s32 *)(arg0 + 0xCC);
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
if (e != 0) {
|
||||
*(u16 *)(e + 0x5C) = *(u16 *)(e + 0x5C) | 1;
|
||||
if (*(s32 *)(*(s32 *)(arg0 + 0x6C) + 0xF4) == 0) {
|
||||
*(s16 *)(e + 0x76) = -0x1F4;
|
||||
} else {
|
||||
*(s16 *)(e + 0x76) = -0x3E8;
|
||||
}
|
||||
*(u16 *)(e + 0x5E) = 2;
|
||||
*(s32 *)(arg0 + 0xCC) = 0;
|
||||
}
|
||||
}
|
||||
goto end;
|
||||
case 2:
|
||||
if (*(s32 *)(*(s32 *)(arg0 + 0x6C) + 0xF4) != 0) {
|
||||
func_8002D4C8(0xAD6, 0);
|
||||
p = func_8012C658(0x33, 3, arg0);
|
||||
if (p != 0) {
|
||||
*(s16 *)(p + 0x12) = -3;
|
||||
*(s16 *)(p + 0x16) = -0x10;
|
||||
*(s16 *)(p + 0x1A) = -4;
|
||||
*(u16 *)(p + 6) = *(u16 *)(p + 6) - 0x140;
|
||||
}
|
||||
p = func_8012C658(0x33, 2, arg0);
|
||||
if (p != 0) {
|
||||
*(u16 *)(p + 0x12) = 3;
|
||||
*(s16 *)(p + 0x16) = -0x10;
|
||||
*(s16 *)(p + 0x1A) = -4;
|
||||
*(u16 *)(p + 6) = *(u16 *)(p + 6) - 0x140;
|
||||
}
|
||||
p = func_8012C658(0x32, 2, arg0);
|
||||
if (p != 0) {
|
||||
*(u16 *)(p + 0x12) = 0;
|
||||
*(s16 *)(p + 0x16) = -0x10;
|
||||
*(s16 *)(p + 0x1A) = -4;
|
||||
*(u16 *)(p + 6) = *(u16 *)(p + 6) - 0x140;
|
||||
}
|
||||
i = 0;
|
||||
do {
|
||||
e = func_8012C588(0x281, arg0);
|
||||
if (e != 0) {
|
||||
*(s32 *)(e + 0x1C) = 2;
|
||||
*(u16 *)(e + 6) = (u16)(*(u16 *)(e + 6) - 0x30) - rand() % 320;
|
||||
*(u16 *)(e + 0xA) = (u16)(*(u16 *)(e + 0xA) - 0x20) - rand() % 256;
|
||||
*(u16 *)(e + 0x12) = (rand() & 0x1F) - 0x10;
|
||||
*(u16 *)(e + 0x16) = -((rand() & 0xF) + 0x10);
|
||||
*(u16 *)(e + 0x1A) = (rand() & 0x1F) - 0x10;
|
||||
}
|
||||
i += 1;
|
||||
} while (i < 8);
|
||||
func_8002A04C(arg0);
|
||||
if (*(s32 *)(*(s32 *)(arg0 + 0x6C) + 0xCC) != 0) {
|
||||
e = *(s32 *)(*(s32 *)(arg0 + 0x6C) + 0xCC);
|
||||
*(s16 *)(e + 0x76) = -0x3E8;
|
||||
*(u16 *)(e + 0x5E) = 2;
|
||||
*(u16 *)(e + 0x5C) = *(u16 *)(e + 0x5C) | 1;
|
||||
}
|
||||
func_8012C218(*(void **)(arg0 + 0x6C));
|
||||
func_8012C218((void *)arg0);
|
||||
goto end;
|
||||
}
|
||||
i = *(s16 *)(*(s32 *)(arg0 + 0x20) + 0x12);
|
||||
func_8001C214(*(s32 *)(arg0 + 0x20), D_801C9488);
|
||||
*(u16 *)(*(s32 *)(arg0 + 0x20) + 0x12) = i;
|
||||
*(s16 *)(arg0 + 0xAE) = -1;
|
||||
*(u16 *)(arg0 + 0x34) = *(u16 *)(arg0 + 0x34) + 1;
|
||||
goto end;
|
||||
default:
|
||||
goto end;
|
||||
}
|
||||
end:
|
||||
((void (*)(s32))func_80189390)(arg0);
|
||||
}
|
||||
|
||||
|
||||
void func_8018E89C(void *arg) {
|
||||
extern s32 rand(void);
|
||||
|
||||
Reference in New Issue
Block a user