New RoomMemory struct

This commit is contained in:
Elliptic Ellipsis 2022-03-19 04:02:46 +00:00
parent 495258646f
commit 1a6d14cd36
2 changed files with 20 additions and 10 deletions

View File

@ -83,6 +83,16 @@ typedef struct {
static_assert(sizeof(RoomVars) == 0xCC);
extern RoomVars gRoomVars;
typedef struct {
u8 area;
u8 room;
u16 unk_02;
u32 unk_04;
} RoomMemory;
extern RoomMemory* gUnk_020354B0;
extern RoomMemory gRoomMemory[];
// Packets used to store which entities to load in a room
typedef struct {
u8 kind;

View File

@ -1,25 +1,25 @@
#define NENT_DEPRECATED
#include "global.h"
extern u32* gUnk_020354B0;
extern u32 gRoomMemory;
#include "entity.h"
#include "room.h"
extern void MemFill32(u32, void*, u32);
void ClearRoomMemory(void) {
MemFill32(0xFFFFFFFF, &gRoomMemory, 0x40);
gUnk_020354B0 = &gRoomMemory;
MemFill32(0xFFFFFFFF, gRoomMemory, 0x40);
gUnk_020354B0 = gRoomMemory;
}
void sub_08049CF4(u8* arg0) {
u8 field_0x6c = *(arg0 + 0x6c);
void sub_08049CF4(GenericEntity* ent) {
u8 field_0x6c = ent->field_0x6c.HALF.LO;
if (field_0x6c & 0x80) {
*(gUnk_020354B0 + 1) |= 1 << (field_0x6c & 0x1f);
gUnk_020354B0->unk_04 |= 1 << (field_0x6c & 0x1f);
}
}
u32 sub_08049D1C(u32 arg0) {
u32 bitmask = *(gUnk_020354B0 + 1) >> arg0;
u32 bitmask = gUnk_020354B0->unk_04 >> arg0;
u32 output = 1;
output &= ~bitmask;
return output;
}
}