sub_0804E3C4 matching

This is the function to load the fight for Simon's simulation.
This commit is contained in:
Ibot02
2020-08-21 12:08:18 +02:00
parent 6e53face64
commit 52d44007f0
3 changed files with 34 additions and 73 deletions
+33 -4
View File
@@ -10,7 +10,7 @@
#include "main.h"
#include "structures.h"
void sub_0804B3C4(u32 arg0) {
void sub_0804B3C4(void* arg0) {
sub_0804B29C(arg0);
}
@@ -4467,9 +4467,38 @@ u32 sub_0804E3B8() {
return 1;
}
NAKED
extern u8* gUnk_080F0D58[4];
extern Entity* gUnk_080F0CB8[15];
extern u8* gUnk_080F0E08[];
extern struct {
u32 unk_00;
u32 unk_04;
} gUnk_080F0E1C[];
void sub_0804E3C4() {
asm(".include \"asm/non_matching/sub_0804E3C4.inc\"");
u32 r;
u32 index;
u32 tmp;
tmp = CheckGlobalFlag(LV4_CLEAR);
index = (-tmp | tmp) >> 0x1F;
if (CheckGlobalFlag(LV5_CLEAR)) {
index = 2;
}
if (CheckGlobalFlag(GAMECLEAR)) {
index = 3;
}
r = Random();
index = gUnk_080F0D58[index][r&0x1f];
LoadRoomEntityList(gUnk_080F0CB8[index & 0xF]);
index >>= 4;
r >>= 8;
index = gUnk_080F0E08[index][r&0x1F];
if (!CheckLocalFlag(0xC6)) {
SetLocalFlag(0xC6);
index = 0xE;
}
sub_0804B3C4(&gUnk_080F0E1C[index]);
PlaySFX(0x80100000);
}
u32 sub_0804E45C() {
@@ -6552,4 +6581,4 @@ void sub_0804FF84(u32 arg0)
{
((struct_02000000 * )0x02000000)->brightnessPref = arg0;
gUsedPalettes = (u32)-1;
}
}