Skip to content

Commit 6def678

Browse files
authored
MAP0_S00: match func_800DD0CC (#405)
1 parent 4cd5f55 commit 6def678

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

include/maps/map0/map0_s00.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ typedef struct
99
VECTOR3 position1_C;
1010
} s_800E32DC;
1111

12+
typedef struct {
13+
s16 unk0;
14+
s16 unk2;
15+
} s_800DFB44;
16+
17+
typedef struct {
18+
u8 unk0;
19+
u8 unk1;
20+
u8 unk2;
21+
} s_800DFB48;
22+
1223
extern s_800E32DC D_800E32DC;
1324

1425
/** "STAGE 0-0" string */
@@ -55,6 +66,12 @@ extern s32 D_800DFAC4;
5566
extern VECTOR3 D_800DFAE0[]; // } TODO might be one big table.
5667
extern VECTOR3 D_800DFB28[3]; // }
5768

69+
extern s32 D_800DFB40;
70+
71+
extern s_800DFB44 D_800DFB44;
72+
73+
extern s_800DFB48 D_800DFB48;
74+
5875
void func_800CBFB0(void);
5976

6077
void func_800D0124();

src/maps/map0_s00/map0_s00.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,36 @@ s32 func_800DCF38(s32 arg0) // 0x800DCF38
13921392
return FP_MULTIPLY_PRECISE(g_DeltaTime0, Q12(9.0f), Q12_SHIFT) + arg0;
13931393
}
13941394

1395-
INCLUDE_ASM("asm/maps/map0_s00/nonmatchings/map0_s00", func_800DD0CC);
1395+
void func_800DD0CC()
1396+
{
1397+
s32 vec0[2];
1398+
1399+
if (D_800DFB40 == NO_VALUE)
1400+
{
1401+
func_8003EF10(6, 6, 5, (s32) &D_800DFB40, 0, 0x64000);
1402+
D_800DFB40 = 0;
1403+
}
1404+
D_800DFB44.unk0 += g_DeltaTime0;
1405+
vec0[0] = FP_MULTIPLY(D_800DFB44.unk0, D_800DFB48.unk0, 6);
1406+
if (vec0[0] >= 0x1000)
1407+
{
1408+
D_800DFB44.unk0 = 0U;
1409+
D_800DFB48.unk0 = (u8) ((Rng_Rand16() & 0x3F) + 0x20);
1410+
D_800DFB48.unk1 = (u8) ((Rng_Rand16() & 0x1F) + 0x20);
1411+
vec0[0] &= 0xFFF;
1412+
}
1413+
1414+
vec0[0] = FP_MULTIPLY(D_800DFB48.unk1, Math_Sin(D_800DFB44.unk2), 12);
1415+
D_800DFB44.unk2 += g_DeltaTime0;
1416+
vec0[1] = FP_MULTIPLY(D_800DFB44.unk2, D_800DFB48.unk2, 6);
1417+
if (vec0[1] >= 0x1000)
1418+
{
1419+
D_800DFB44.unk2 = 0;
1420+
D_800DFB48.unk2 = (u8) ((Rng_Rand16() & 0x3F) + 0x20);
1421+
vec0[1] &= 0xFFF;
1422+
}
1423+
1424+
D_800DFB40 = MAX(0, FP_MULTIPLY((FP_MULTIPLY(vec0[0], Q12(4.5f), 6) + Q12(2.5f)), Math_Sin(vec0[1]), 12) + Q12(4.0f));
1425+
}
13961426

13971427
INCLUDE_RODATA("asm/maps/map0_s00/nonmatchings/map0_s00", D_800CB6A4);

0 commit comments

Comments
 (0)