mirror of
https://github.com/Druthulu/BFM-decomp
synced 2026-09-28 23:00:29 -04:00
feat(t5): Claude wave t5z — 5 banked (sonnet 4/4, opus 1/1); fleet 213 passed, 0 failed of 213 (P31 S62 T5)
This commit is contained in:
@@ -4215,7 +4215,32 @@ void func_80182360(void *a0) {
|
||||
void func_801823C8(void) {
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_jr_8017FF7C", func_801823D0);
|
||||
#include "common.h"
|
||||
|
||||
extern void func_8013CB84(void);
|
||||
extern void func_8018246C(void);
|
||||
extern s32 D_801D99BC;
|
||||
extern s32 D_801D99C0;
|
||||
extern void func_8002D4C8(s32 a0, s32 a1);
|
||||
|
||||
void func_801823D0(void) {
|
||||
func_8013CB84();
|
||||
func_8018246C();
|
||||
if (D_801D99C0 != 1) {
|
||||
if (D_801D99C0 < 2) {
|
||||
if (D_801D99C0 == 0) {
|
||||
func_8002D4C8(0x617, 0);
|
||||
D_801D99C0++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (++D_801D99BC >= 0x97) {
|
||||
func_8002D4C8(0xD, 0x617);
|
||||
D_801D99C0++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern s32 D_801D9860;
|
||||
extern u16 D_8018BC24[];
|
||||
|
||||
@@ -3483,7 +3483,44 @@ void func_8017ED98(s32 a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_093/nonmatchings/ov_SC03_093_jr_8017D898", func_8017EE38);
|
||||
typedef struct { s16 v[4]; } Blk8_80126940_8017EE38;
|
||||
|
||||
extern u16 func_80148800(s32 *a0);
|
||||
extern void func_8017EF20(s32 param_1, s16 *param_2);
|
||||
|
||||
void func_8017EE38(s32 a0) {
|
||||
|
||||
extern s32 D_80126B58;
|
||||
extern s16 D_80189BD8[];
|
||||
extern Blk8_80126940_8017EE38 D_80126940;
|
||||
Blk8_80126940_8017EE38 sp10;
|
||||
register s16 c __asm__("$4");
|
||||
u8 t;
|
||||
|
||||
if (func_80148800(&D_80126B58) & 3) {
|
||||
t = (*(u8 *)(a0 + 5) + 1) & 1;
|
||||
*(u8 *)(a0 + 5) = t;
|
||||
*(s32 *)(a0 + 0x14) = D_80189BD8[t];
|
||||
}
|
||||
sp10 = D_80126940;
|
||||
c = -0x840;
|
||||
if (sp10.v[0] < -0x840) {
|
||||
sp10.v[0] = c;
|
||||
}
|
||||
{
|
||||
s16 hi1 = -0x4C0;
|
||||
if (hi1 < sp10.v[0]) {
|
||||
c = hi1;
|
||||
sp10.v[0] = c;
|
||||
}
|
||||
}
|
||||
if (sp10.v[2] < 0x480) {
|
||||
c = 0x480;
|
||||
sp10.v[2] = c;
|
||||
}
|
||||
func_8017EF20(a0, sp10.v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @class: schedule
|
||||
|
||||
@@ -3853,7 +3853,11 @@ extern s32 D_8019BD18;
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_095/nonmatchings/ov_SC03_095_jr_8017BEBC", func_8017DCE4);
|
||||
extern s32 D_8019BD18;
|
||||
void func_8017DCE4(void) {
|
||||
D_8019BD18 = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern void (*D_80191B78[])(void);
|
||||
|
||||
@@ -4698,7 +4698,24 @@ void func_80180758(void *a0) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC03_097/nonmatchings/ov_SC03_097_jr_8017D898", func_80180864);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern int func_80178970(void);
|
||||
extern void func_80178D18(void);
|
||||
extern void func_80180294(void *arg0);
|
||||
|
||||
void func_80180864(void *a0) {
|
||||
if (func_80178970() != 0) {
|
||||
((void (*)(s32))func_80178D18)((s32)a0);
|
||||
func_80180294(a0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void func_801808A4(s32 param_1)
|
||||
{
|
||||
|
||||
@@ -3825,7 +3825,144 @@ s32 func_801849DC(s32 a0, s32 a1, s16 a2, s16 a3, s32 a4) {
|
||||
}
|
||||
|
||||
|
||||
INCLUDE_ASM("asm/ov_SC05_010/nonmatchings/ov_SC05_010_jr_80181CDC", func_80184AA4);
|
||||
/* func_80184AA4 — SC05_010 "dust-trail / spark line" actor tick.
|
||||
*
|
||||
* Frame 0 (state word at +2 == 0) seeds four RNG fields and bumps the state.
|
||||
* Otherwise it ages the +8 timer by -0x4000 and despawns past -0x4000000;
|
||||
* else it allocates an 0x80-byte prim block, walks a swept angle (s4) and a
|
||||
* shrinking radius (s3) and emits up to 8 LINE_F2 segments through
|
||||
* RotTransPers, chaining them into the OT of the current double buffer.
|
||||
*
|
||||
* MATCH notes (P31 t5z):
|
||||
* - §195-C statement-order gap filling: `s4 += 0x80;` MUST precede `s3 -= 8;`
|
||||
* or the `lh 0x102($s1)` loses its slot and a load-delay nop appears.
|
||||
* - The OT base is indexed through the 20-byte OtBlk form
|
||||
* (`D_800A651C[i].a`), NOT `((s32*)D_800A651C)[i * 5]`: only the struct
|
||||
* form lets gcc fold the symbol into the load (`lw %lo(sym)($at)`); the
|
||||
* s32[] form materialises `la` + `addu` (2 extra instructions).
|
||||
* - The frame-0 `+2` bump is staged through `w` (the SAME local the 0x100
|
||||
* angle clamp uses further down). A fresh local there re-orders the block;
|
||||
* reusing the else-arm's `t` fixes the block but costs the hoisted
|
||||
* `lui $v1, 0xFC00` in the entry branch's delay slot.
|
||||
*/
|
||||
void func_80184AA4(s32 arg0)
|
||||
{
|
||||
extern s32 rand(void);
|
||||
extern void func_8012C218(void *a0);
|
||||
extern void *func_80010A08(s32 a0);
|
||||
extern void func_8004914C(void *a0);
|
||||
extern void func_800491AC(void *a0);
|
||||
extern s32 func_80047948(s32 a0);
|
||||
extern s32 func_8004787C(s32 a0);
|
||||
extern s32 func_80143C74(s32 a0, s32 a1);
|
||||
extern void SetLineF2(void *p);
|
||||
extern s32 RotTransPers(s32 v, s32 sxy, s32 *p, s32 *flag);
|
||||
extern s32 AddPrim(s32 ot, void *p);
|
||||
extern u8 D_800AF648;
|
||||
extern s16 D_800B9A02;
|
||||
extern struct { s32 a; s32 b[4]; } D_800A651C[];
|
||||
|
||||
s32 obj;
|
||||
u8 *db;
|
||||
u8 *prim;
|
||||
s32 s3;
|
||||
s32 s4;
|
||||
s16 w;
|
||||
s32 i;
|
||||
s32 r;
|
||||
s32 t;
|
||||
s32 otz;
|
||||
s32 ot;
|
||||
s16 cur[3];
|
||||
s16 nxt[3];
|
||||
s32 pz;
|
||||
s32 flag;
|
||||
|
||||
obj = arg0;
|
||||
|
||||
if (*(u16 *)(obj + 2) == 0) {
|
||||
*(u16 *)(obj + 0xFC) = rand() & 0xFFF;
|
||||
*(u16 *)(obj + 0x102) = (rand() & 0x1F) + 0x30;
|
||||
*(u16 *)(obj + 0x104) = rand() & 0x3F;
|
||||
w = *(u16 *)(obj + 2) + 1;
|
||||
*(u16 *)(obj + 0xFE) = *(u16 *)(obj + 0x102) + 0x2C0;
|
||||
*(u16 *)(obj + 2) = w;
|
||||
return;
|
||||
}
|
||||
|
||||
t = *(s32 *)(obj + 8) - 0x4000;
|
||||
*(s32 *)(obj + 8) = t;
|
||||
if (t < -0x4000000) {
|
||||
func_8012C218((void *)obj);
|
||||
return;
|
||||
}
|
||||
|
||||
prim = (u8 *)func_80010A08(0x80);
|
||||
if (prim == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
db = &D_800AF648;
|
||||
func_8004914C(db);
|
||||
func_800491AC(db);
|
||||
|
||||
s3 = *(s16 *)(obj + 0xFE);
|
||||
s4 = *(s16 *)(obj + 0xFC);
|
||||
w = *(u16 *)(obj + 0x100) + 0x10;
|
||||
*(u16 *)(obj + 0x100) = w;
|
||||
if (w >= 0x401) {
|
||||
*(u16 *)(obj + 0x100) = 0x400;
|
||||
*(u16 *)(obj + 0xA) = *(u16 *)(obj + 0xA) - 4;
|
||||
*(u16 *)(obj + 0xFC) = (*(u16 *)(obj + 0xFC) + 0x200) & 0xFFF;
|
||||
} else {
|
||||
*(u16 *)(obj + 0xFE) = *(u16 *)(obj + 0x102) + ((func_80047948(w) * 704) >> 12);
|
||||
*(u16 *)(obj + 0xFC) =
|
||||
(*(u16 *)(obj + 0xFC) + (func_8004787C(*(s16 *)(obj + 0x100)) >> 4)) & 0xFFF;
|
||||
}
|
||||
|
||||
cur[0] = *(u16 *)(obj + 6) + ((s3 * func_80047948(s4)) >> 12);
|
||||
cur[1] = *(u16 *)(obj + 0xA);
|
||||
cur[2] = *(u16 *)(obj + 0xE) + ((s3 * func_8004787C(s4)) >> 12);
|
||||
nxt[1] = cur[1];
|
||||
|
||||
if (*(s16 *)(obj + 0x104) != 0) {
|
||||
*(s16 *)(obj + 0x104) = *(s16 *)(obj + 0x104) - 1;
|
||||
} else {
|
||||
*(u16 *)(obj + 0x104) = rand() & 0x3F;
|
||||
r = func_80143C74(obj, 0);
|
||||
if (r != 0) {
|
||||
*(u16 *)(r + 6) = cur[0];
|
||||
*(u16 *)(r + 0xA) = cur[1];
|
||||
*(u16 *)(r + 0xE) = cur[2];
|
||||
*(s32 *)(r + 0x10) = -(func_8004787C(s4) << 8);
|
||||
*(s16 *)(r + 0x16) = -2;
|
||||
*(s32 *)(r + 0x18) = -(func_80047948(s4) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
*(u32 *)(prim + 4) = 0xFFFFFF;
|
||||
SetLineF2(prim);
|
||||
s4 += 0x80;
|
||||
s3 -= 8;
|
||||
if (s3 < *(s16 *)(obj + 0x102)) {
|
||||
s3 = *(s16 *)(obj + 0x102);
|
||||
}
|
||||
nxt[0] = *(u16 *)(obj + 6) + ((s3 * func_80047948(s4)) >> 12);
|
||||
nxt[2] = *(u16 *)(obj + 0xE) + ((s3 * func_8004787C(s4)) >> 12);
|
||||
otz = RotTransPers((s32)cur, (s32)(prim + 8), &pz, &flag);
|
||||
if (otz > 0 && flag >= 0) {
|
||||
if (RotTransPers((s32)nxt, (s32)(prim + 0xC), &pz, &flag) > 0 && flag >= 0) {
|
||||
ot = D_800A651C[*(u16 *)&D_800B9A02].a + (otz << 2);
|
||||
AddPrim(ot, prim);
|
||||
prim += 0x10;
|
||||
}
|
||||
}
|
||||
cur[0] = nxt[0];
|
||||
cur[2] = nxt[2];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user