summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2023-12-30 22:18:38 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2023-12-30 22:18:38 +0100
commit917ca10ba5f397e3e897afd3a3f9b8324de5bdb4 (patch)
treeb7eec587ce4c35fc5fe6d0dc29cac220b4ce9f6e /src
parenta818f1b7041898d7eee28b5c1c455ba3225e063f (diff)
parent3c0c1ba5a0653e0acb1c433c3619cda0e3223ddd (diff)
Merge branch 'master' into enemies
Diffstat (limited to 'src')
-rw-r--r--src/beanstalkSubtask.c18
-rw-r--r--src/enemy/fallingBoulder.c36
-rw-r--r--src/entity.c67
-rw-r--r--src/game.c4
-rw-r--r--src/gameData.c4
-rw-r--r--src/gameUtils.c12
-rw-r--r--src/interrupts.c51
-rw-r--r--src/itemUtils.c4
-rw-r--r--src/kinstone.c5
-rw-r--r--src/manager/horizontalMinishPathBackgroundManager.c4
-rw-r--r--src/manager/hyruleTownTilesetManager.c12
-rw-r--r--src/manager/minishVillageTilesetManager.c10
-rw-r--r--src/manager/miscManager.c2
-rw-r--r--src/manager/verticalMinishPathBackgroundManager.c4
-rw-r--r--src/manager/weatherChangeManager.c8
-rw-r--r--src/npc/rem.c14
-rw-r--r--src/object/itemOnGround.c2
-rw-r--r--src/object/pressurePlate.c2
-rw-r--r--src/object/pushableStatue.c8
-rw-r--r--src/player.c2
-rw-r--r--src/playerUtils.c10
-rw-r--r--src/room.c16
-rw-r--r--src/roomInit.c86
23 files changed, 193 insertions, 188 deletions
diff --git a/src/beanstalkSubtask.c b/src/beanstalkSubtask.c
index 869294c5..3b26138a 100644
--- a/src/beanstalkSubtask.c
+++ b/src/beanstalkSubtask.c
@@ -27,7 +27,7 @@ extern u8 gUpdateVisibleTiles;
extern u16 gMapDataTopSpecial[];
extern u16 gMapDataBottomSpecial[];
extern const u8 gGlobalGfxAndPalettes[];
-extern const u8 gUnk_081091E4[];
+extern const u8 gEntityListLUT[];
typedef struct {
u16 tileType;
@@ -1084,7 +1084,7 @@ u32 sub_0801AC68(u32 position, u32 data) {
u32 end;
ptr = gUnk_0200B240;
- end = gRoomVars.unk_0e;
+ end = gRoomVars.tileEntityCount;
for (index = 0; index < end; ptr++, index++) {
if (position == ptr->position) {
return ptr->data << 2;
@@ -1150,7 +1150,7 @@ void sub_0801AD6C(const Data* param_1, u32 tilePosition) {
entity->y.HALF.HI = tmpY1 + gRoomControls.origin_y;
entity->collisionLayer = 0;
ResolveCollisionLayer(entity);
- AppendEntityToList(entity, gUnk_081091E4[entity->kind]);
+ AppendEntityToList(entity, gEntityListLUT[entity->kind]);
}
} else {
manager = GetEmptyManager();
@@ -1164,7 +1164,7 @@ void sub_0801AD6C(const Data* param_1, u32 tilePosition) {
*(u16*)(&manager[1].timer + 10) = tmpX2 + gRoomControls.origin_x;
tmpY2 = (s16)((tilePosition & 0xfc0) >> 2) + 8;
*(u16*)(&manager[1].timer + 12) = tmpY2 + gRoomControls.origin_y;
- AppendEntityToList((Entity*)manager, gUnk_081091E4[manager->kind]);
+ AppendEntityToList((Entity*)manager, gEntityListLUT[manager->kind]);
}
}
}
@@ -1224,11 +1224,11 @@ void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer) {
void sub_0801AF48(u32 data, u32 position, u32 layer) {
u32 index;
if ((data < 0x4000) && (gRoomTransition.field30 == 0)) {
- index = gRoomVars.unk_0e;
+ index = gRoomVars.tileEntityCount;
if (index < 0x100) {
gUnk_0200B240[index].data = data;
gUnk_0200B240[index].position = (layer << 0xc) | position;
- gRoomVars.unk_0e = index + 1;
+ gRoomVars.tileEntityCount = index + 1;
}
}
}
@@ -1242,7 +1242,7 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) {
layer = layer << 12;
positionLayer = position | layer;
ptr = gUnk_0200B240;
- count = gRoomVars.unk_0e;
+ count = gRoomVars.tileEntityCount;
t = 0;
if (t >= count) {
@@ -1251,7 +1251,7 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) {
if (positionLayer == ptr->position) {
count--;
- gRoomVars.unk_0e = count;
+ gRoomVars.tileEntityCount = count;
ptr[0] = ptr[count];
return;
}
@@ -1263,7 +1263,7 @@ void DeleteLoadedTileEntity(u32 position, s32 layer) {
}
}
count--;
- gRoomVars.unk_0e = count;
+ gRoomVars.tileEntityCount = count;
ptr = gUnk_0200B240;
ptr[t] = ptr[count];
}
diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c
index aee943f0..e898c1b7 100644
--- a/src/enemy/fallingBoulder.c
+++ b/src/enemy/fallingBoulder.c
@@ -75,45 +75,42 @@ void sub_0802C318(FallingBoulderEntity* this) {
}
void sub_0802C334(FallingBoulderEntity* this) {
- register Entity* entity asm("r2");
- u32 diff;
- u16 tmp;
+ Entity* entity;
+ u32 roomOriginY, tmp;
+ s32 y, i;
if (this->unk_7c == 0) {
- u32 tmp = gRoomControls.origin_y;
+ roomOriginY = gRoomControls.origin_y;
entity = &gPlayerEntity.base;
if (entity == NULL)
return;
- if (entity->y.HALF.HI - tmp <= 0x38) {
+ tmp = entity->y.HALF.HI;
+ if (0x38 >= tmp - roomOriginY)
return;
- }
this->unk_7c = 1;
super->spriteSettings.draw = 1;
}
+
GetNextFrame(super);
this->unk_7e = COORD_TO_TILE(super);
+
if (sub_080044EC(super, this->unk_84) == 1) {
EnqueueSFX(0x14c);
COLLISION_ON(super);
- this->unk_7a = 0xc;
+ this->unk_7a = 12;
sub_0802C4B0(this);
} else {
- s32 y;
-
if (this->unk_7a) {
- tmp = --this->unk_7a;
- switch (tmp) {
+ switch (--this->unk_7a) {
case 0:
COLLISION_OFF(super);
break;
case 8:
if (super->type2 != 0 && !sub_08049FA0(super)) {
- diff = 0;
- for (y = 1; y > -1; y--) {
+ for (i = 0; i < 2; i++) {
entity = CreateFx(super, FX_ROCK2, 0);
if (entity) {
- entity->x.HALF.HI = entity->x.HALF.HI + 12 - diff;
+ entity->x.HALF.HI += 12 - i * 0x18;
}
- diff += 0x18;
}
sub_0802C62C(this);
this->unk_7a = (Random() & 0xff) | 0x100;
@@ -122,11 +119,9 @@ void sub_0802C334(FallingBoulderEntity* this) {
break;
}
}
-
- {
- FORCE_REGISTER(RoomControls * tmp, r0) = &gRoomControls;
- y = tmp->origin_y + tmp->height - super->y.HALF.HI;
- }
+ roomOriginY = gRoomControls.origin_y;
+ tmp = gRoomControls.height;
+ y = roomOriginY + tmp - super->y.HALF.HI;
if (y >= 5) {
ProcessMovement1(super);
@@ -141,6 +136,7 @@ void sub_0802C334(FallingBoulderEntity* this) {
}
}
}
+
super->collisionLayer = 3;
super->spritePriority.b0 = 1;
UpdateSpriteForCollisionLayer(super);
diff --git a/src/entity.c b/src/entity.c
index 34be309d..260ee5fa 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -40,51 +40,54 @@ typedef struct {
extern UpdateContext gUpdateContext;
// List by entity kind.
-const u8 gUnk_081091E4[] = {
+const u8 gEntityListLUT[] = {
8, 1, 8, 4, 5, 8, 6, 7, 2, 6,
};
+// TODO: wrong file, maybe an "enter.c" according to lexicographical order
void sub_0805E248(void) {
- s32 v0;
+ s32 idx;
- v0 = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
+ idx = gDiggingCaveEntranceTransition.entrance->targetTilePosition;
if (gRoomControls.area == AREA_VEIL_FALLS || gRoomControls.area == AREA_VEIL_FALLS_DIG_CAVE) {
- SetTileType(0x27c, v0 + TILE_POS(-1, -1), 1);
- SetTileType(0x283, v0 + TILE_POS(-1, -1), 2);
- SetTileType(0x27d, v0 + TILE_POS(0, -1), 1);
- SetTileType(0x284, v0 + TILE_POS(0, -1), 2);
- SetTileType(0x27e, v0 + TILE_POS(1, -1), 1);
- SetTileType(0x285, v0 + TILE_POS(1, -1), 2);
- SetTileType(0x27f, v0 + TILE_POS(-1, 0), 1);
- SetTileType(0x280, v0 + TILE_POS(0, 0), 1);
- SetTileType(0x282, v0 + TILE_POS(1, 0), 1);
+ SetTileType(0x27c, idx + TILE_POS(-1, -1), 1);
+ SetTileType(0x283, idx + TILE_POS(-1, -1), 2);
+ SetTileType(0x27d, idx + TILE_POS(0, -1), 1);
+ SetTileType(0x284, idx + TILE_POS(0, -1), 2);
+ SetTileType(0x27e, idx + TILE_POS(1, -1), 1);
+ SetTileType(0x285, idx + TILE_POS(1, -1), 2);
+ SetTileType(0x27f, idx + TILE_POS(-1, 0), 1);
+ SetTileType(0x280, idx + TILE_POS(0, 0), 1);
+ SetTileType(0x282, idx + TILE_POS(1, 0), 1);
} else {
- SetTileType(0x26c, v0 + TILE_POS(-1, -1), 1);
- SetTileType(0x273, v0 + TILE_POS(-1, -1), 2);
- SetTileType(0x26d, v0 + TILE_POS(0, -1), 1);
- SetTileType(0x274, v0 + TILE_POS(0, -1), 2);
- SetTileType(0x26e, v0 + TILE_POS(1, -1), 1);
- SetTileType(0x275, v0 + TILE_POS(1, -1), 2);
- SetTileType(0x26f, v0 + TILE_POS(-1, 0), 1);
- SetTileType(0x270, v0 + TILE_POS(0, 0), 1);
- SetTileType(0x272, v0 + TILE_POS(1, 0), 1);
+ SetTileType(0x26c, idx + TILE_POS(-1, -1), 1);
+ SetTileType(0x273, idx + TILE_POS(-1, -1), 2);
+ SetTileType(0x26d, idx + TILE_POS(0, -1), 1);
+ SetTileType(0x274, idx + TILE_POS(0, -1), 2);
+ SetTileType(0x26e, idx + TILE_POS(1, -1), 1);
+ SetTileType(0x275, idx + TILE_POS(1, -1), 2);
+ SetTileType(0x26f, idx + TILE_POS(-1, 0), 1);
+ SetTileType(0x270, idx + TILE_POS(0, 0), 1);
+ SetTileType(0x272, idx + TILE_POS(1, 0), 1);
}
gUpdateVisibleTiles = 0;
}
-const u8 gUnk_081091EE[] = {
- 0, 1, 0, 0, 0, 0, 1, 1, 1, 1,
+const u8 gPrioritiesDefault[] = {
+ [0] = 0, [PLAYER] = 1, [2] = 0, [ENEMY] = 0, [PROJECTILE] = 0,
+ [5] = 0, [OBJECT] = 1, [NPC] = 1, [PLAYER_ITEM] = 1, [MANAGER] = 1,
};
-const u8 gUnk_081091F8[] = {
- 0, 3, 0, 3, 3, 0, 3, 3, 3, 3,
+const u8 gPrioritiesKinstoneMenu[] = {
+ [0] = 0, [PLAYER] = 3, [2] = 0, [ENEMY] = 3, [PROJECTILE] = 3,
+ [5] = 0, [OBJECT] = 3, [NPC] = 3, [PLAYER_ITEM] = 3, [MANAGER] = 3,
};
-void SetEntityPriorityForKind(Entity* e) {
+void InitDefaultPriority(Entity* e) {
u8 r3 = gRoomTransition.entity_update_type;
- const u8* array = gUnk_081091F8;
+ const u8* array = gPrioritiesKinstoneMenu;
if (r3 != 2) {
- array = gUnk_081091EE;
+ array = gPrioritiesDefault;
}
SetEntityPriority(e, array[e->kind]);
}
@@ -214,8 +217,10 @@ void ClearEventPriority(void) {
void UpdateEntities(void) {
void (*f)(u32);
- gRoomVars.filler1[0] = gRoomVars.field_0x4;
- gRoomVars.field_0x4 = 0;
+ // TODO: why is this needed? Does this avoid a bug?
+ gRoomVars.numKinstoneDropsPrevFrame = gRoomVars.numKinstoneDrops;
+ gRoomVars.numKinstoneDrops = 0;
+
UpdatePlayerInput();
UpdatePriority();
ClearHitboxList();
@@ -505,7 +510,7 @@ void AppendEntityToList(Entity* entity, u32 listIndex) {
} else {
gManagerCount++;
}
- SetEntityPriorityForKind(entity);
+ InitDefaultPriority(entity);
}
void PrependEntityToList(Entity* entity, u32 listIndex) {
diff --git a/src/game.c b/src/game.c
index 9f193935..138ae634 100644
--- a/src/game.c
+++ b/src/game.c
@@ -236,7 +236,7 @@ static void GameMain_ChangeRoom(void) {
}
CreateMiscManager();
#endif
- if (!gRoomVars.field_0x0) {
+ if (!gRoomVars.didEnterScrolling) {
RequestPriorityDuration(NULL, 1);
}
}
@@ -355,7 +355,7 @@ static void InitializeEntities(void) {
static void sub_08051D98(void) {
sub_08052EA0();
- gRoomVars.field_0x0 = 1;
+ gRoomVars.didEnterScrolling = TRUE;
// remove old entities, unless persistent
RecycleEntities();
diff --git a/src/gameData.c b/src/gameData.c
index 152dfbcb..581e7eff 100644
--- a/src/gameData.c
+++ b/src/gameData.c
@@ -495,8 +495,8 @@ extern EntityData gUnk_080FECC8[];
extern EntityData gUnk_080FEC28[];
extern const EntityData gUnk_080FED18[];
extern EntityData gUnk_080FED58[];
-// TODO need to find out what gRoomVars.field_0x8c[ptr->entity_idx] is.
-extern const void* gUnk_080FED98[];
+// TODO need to find out what gRoomVars.entityRails[ptr->entity_idx] is.
+extern const void* gLilypadRails[];
// gUnk_080FEDA4
// gUnk_080FEDDA
// gUnk_080FEDF8
diff --git a/src/gameUtils.c b/src/gameUtils.c
index 56a8aed7..da2afc41 100644
--- a/src/gameUtils.c
+++ b/src/gameUtils.c
@@ -571,10 +571,10 @@ RoomResInfo* GetCurrentRoomInfo(void) {
void sub_08052EA0(void) {
MemClear(&gRoomVars, sizeof gRoomVars);
- gRoomVars.unk_10[0] = -1;
- gRoomVars.unk_10[1] = gRoomVars.unk_10[0];
- gRoomVars.unk_10[2] = gRoomVars.unk_10[0];
- gRoomVars.unk_10[3] = gRoomVars.unk_10[0];
+ gRoomVars.graphicsGroups[0] = -1;
+ gRoomVars.graphicsGroups[1] = gRoomVars.graphicsGroups[0];
+ gRoomVars.graphicsGroups[2] = gRoomVars.graphicsGroups[0];
+ gRoomVars.graphicsGroups[3] = gRoomVars.graphicsGroups[0];
gRoomVars.lightLevel = 256;
gArea.locationIndex = gAreaMetadata[gRoomControls.area].location;
UpdateRoomTracker();
@@ -601,7 +601,7 @@ void UpdateFakeScroll(void) {
LinkedList* ll;
Entity* e;
- if (gArea.unk_0c_0 == 0 || !gRoomVars.field_0x0)
+ if (gArea.unk_0c_0 == 0 || !gRoomVars.didEnterScrolling)
return;
y = 0;
@@ -727,7 +727,7 @@ void CheckAreaDiscovery(void) {
e->kind = MANAGER;
e->id = ENTER_ROOM_TEXTBOX_MANAGER;
AppendEntityToList(e, 8);
- if (!gRoomVars.field_0x0 && !ReadBit(gSave.areaVisitFlags, gArea.locationIndex)) {
+ if (!gRoomVars.didEnterScrolling && !ReadBit(gSave.areaVisitFlags, gArea.locationIndex)) {
e->type2 = 1;
SetPlayerControl(3);
SetInitializationPriority();
diff --git a/src/interrupts.c b/src/interrupts.c
index 5469b5b1..b27a43a7 100644
--- a/src/interrupts.c
+++ b/src/interrupts.c
@@ -198,39 +198,39 @@ void WaitForNextFrame(void) {
FadeVBlank();
}
-void PlayerUpdate(Entity* this) {
+void PlayerUpdate(PlayerEntity* this) {
if (gSave.stats.effect != 0)
gPlayerState.flags |= PL_DRUGGED;
else
gPlayerState.flags &= ~PL_DRUGGED;
- if (!EntityDisabled(this)) {
+ if (!EntityDisabled(super)) {
if (gPlayerState.flags & PL_MOLDWORM_CAPTURED) {
PutAwayItems();
if (gPlayerState.flags & PL_MOLDWORM_RELEASED) {
gPlayerState.queued_action = PLAYER_ROLL;
gPlayerState.flags &= ~PL_MOLDWORM_CAPTURED;
gPlayerState.hurtBlinkSpeed = 240;
- COLLISION_ON(this);
+ COLLISION_ON(super);
} else {
- COLLISION_OFF(this);
+ COLLISION_OFF(super);
gPlayerState.framestate = PL_STATE_F;
}
}
- HandlePlayerLife(this);
+ HandlePlayerLife(super);
DoPlayerAction(this);
- if ((this->z.WORD == 0) && (this->action == 1 || this->action == 9))
- sub_08008790(this, 8);
+ if ((super->z.WORD == 0) && (super->action == 1 || super->action == 9))
+ sub_08008790(super, 8);
sub_080171F0();
}
- sub_08078FB0(this);
- DrawEntity(this);
+ sub_08078FB0(super);
+ DrawEntity(super);
UpdatePlayerPalette();
}
// Responsible for some life things like low health beep and initiating the death sequence
static void HandlePlayerLife(Entity* this) {
- u32 temp;
+ u32 threshold;
gUnk_0200AF00.rActionPlayerState = R_ACTION_NONE;
gUnk_0200AF00.rActionInteractTile = R_ACTION_NONE;
@@ -263,26 +263,27 @@ static void HandlePlayerLife(Entity* this) {
#ifdef EU
if ((gUnk_0200AF00.unk_1 == 0) && gRoomTransition.frameCount % 90 == 0) {
- temp = gSave.stats.maxHealth / 4;
- if (temp > 24)
- temp = 24;
- if (temp < 8)
- temp = 8;
+ threshold = gSave.stats.maxHealth / 4;
+ if (threshold > 24)
+ threshold = 24;
+ if (threshold < 8)
+ threshold = 8;
- if (gSave.stats.health <= temp) {
+ if (gSave.stats.health <= threshold) {
EnqueueSFX(SFX_LOW_HEALTH);
}
}
#else
- gRoomVars.unk2 = gMessage.state & MESSAGE_ACTIVE;
- temp = gSave.stats.maxHealth / 4;
- if (temp > 24)
- temp = 24;
- if (temp < 8)
- temp = 8;
-
- if (gSave.stats.health <= temp) {
- gRoomVars.unk2 = 1;
+ // TODO: why does message state affect health drops in US/JP?
+ gRoomVars.needHealthDrop = gMessage.state & MESSAGE_ACTIVE;
+ threshold = gSave.stats.maxHealth / 4;
+ if (threshold > 24)
+ threshold = 24;
+ if (threshold < 8)
+ threshold = 8;
+
+ if (gSave.stats.health <= threshold) {
+ gRoomVars.needHealthDrop = TRUE;
if ((gUnk_0200AF00.unk_1 == 0) && gRoomTransition.frameCount % 90 == 0) {
EnqueueSFX(SFX_LOW_HEALTH);
}
diff --git a/src/itemUtils.c b/src/itemUtils.c
index a774778f..e1794ede 100644
--- a/src/itemUtils.c
+++ b/src/itemUtils.c
@@ -428,7 +428,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
#ifndef EU
case 24:
case 25:
- r0 = gRoomVars.unk2;
+ r0 = gRoomVars.needHealthDrop;
ptr4 = &gUnk_0800191C[0];
if (r0) {
ptr4++;
@@ -545,7 +545,7 @@ u32 CreateItemDrop(Entity* arg0, u32 itemId, u32 itemParameter) {
if (GetInventoryValue(ITEM_KINSTONE_BAG) == 0) {
return ITEM_NONE;
}
- if (3 < gRoomVars.filler1[0]) {
+ if (3 < gRoomVars.numKinstoneDropsPrevFrame) {
return ITEM_NONE;
}
diff --git a/src/kinstone.c b/src/kinstone.c
index 71a93a7b..08d10e67 100644
--- a/src/kinstone.c
+++ b/src/kinstone.c
@@ -22,7 +22,7 @@ extern const EntityData gUnk_080FEE38[];
extern const EntityData gUnk_080FEE18[];
extern const EntityData gUnk_080FEE48[];
extern const EntityData gUnk_080FEE58[];
-extern const void* gUnk_080FED98[];
+extern const void* gLilypadRails[];
void sub_08018AB4(int);
void sub_08018BB4(u32 worldEventId);
@@ -339,8 +339,9 @@ void sub_0801876C(u32 worldEventId, bool32 isKinstoneFused) {
break;
case WORLD_EVENT_TYPE_11:
if (isKinstoneFused != 0) {
+ // lilypad rails
LoadRoomEntity(&gUnk_080FED58[ptr->entity_idx]);
- gRoomVars.field_0x8c[ptr->entity_idx] = (void*)gUnk_080FED98[ptr->entity_idx];
+ gRoomVars.entityRails[ptr->entity_idx] = (void*)gLilypadRails[ptr->entity_idx];
}
break;
case WORLD_EVENT_TYPE_9:
diff --git a/src/manager/horizontalMinishPathBackgroundManager.c b/src/manager/horizontalMinishPathBackgroundManager.c
index f2a8b1fb..a407e50e 100644
--- a/src/manager/horizontalMinishPathBackgroundManager.c
+++ b/src/manager/horizontalMinishPathBackgroundManager.c
@@ -29,7 +29,7 @@ void HorizontalMinishPathBackgroundManager_Main(HorizontalMinishPathBackgroundMa
}
void sub_08057EFC(void* this) {
- LoadGfxGroup((u32)gRoomVars.unk_10[0]);
+ LoadGfxGroup((u32)gRoomVars.graphicsGroups[0]);
sub_08058034();
((HorizontalMinishPathBackgroundManager*)this)->unk_3c = 0;
((HorizontalMinishPathBackgroundManager*)this)->unk_38 = 0;
@@ -103,7 +103,7 @@ void sub_080580B0(u32 unk1) {
gMapTop.bgSettings = 0;
REG_DISPCNT = 0;
LoadGfxGroup(unk1);
- gRoomVars.unk_10[0] = unk1;
+ gRoomVars.graphicsGroups[0] = unk1;
sub_08058034();
tmp = gRoomControls.scroll_x - gRoomControls.origin_x;
tmp = tmp + (tmp >> 3) + (0x400 - gRoomControls.width) / 2;
diff --git a/src/manager/hyruleTownTilesetManager.c b/src/manager/hyruleTownTilesetManager.c
index 9797a0c2..b3ce85a5 100644
--- a/src/manager/hyruleTownTilesetManager.c
+++ b/src/manager/hyruleTownTilesetManager.c
@@ -72,9 +72,9 @@ void HyruleTownTilesetManager_Main(HyruleTownTilesetManager* this) {
}
void sub_08059A2C(HyruleTownTilesetManager* this) {
- gRoomVars.unk_10[2] = 0xff;
- gRoomVars.unk_10[1] = 0xff;
- gRoomVars.unk_10[0] = 0xff;
+ gRoomVars.graphicsGroups[2] = 0xff;
+ gRoomVars.graphicsGroups[1] = 0xff;
+ gRoomVars.graphicsGroups[0] = 0xff;
this->field_0x22 = 0xff;
this->field_0x21 = 0xff;
this->field_0x20 = 0xff;
@@ -147,8 +147,8 @@ bool32 sub_08059C8C(HyruleTownTilesetManager* this, u32 param_2, u8* param_3, co
bool32 bVar2;
*param_3 = CheckRegionsOnScreen(param_4);
- if ((*param_3 != 0xff) && (gRoomVars.unk_10[param_2] != *param_3)) {
- gRoomVars.unk_10[param_2] = *param_3;
+ if ((*param_3 != 0xff) && (gRoomVars.graphicsGroups[param_2] != *param_3)) {
+ gRoomVars.graphicsGroups[param_2] = *param_3;
return TRUE;
} else {
return FALSE;
@@ -158,7 +158,7 @@ bool32 sub_08059C8C(HyruleTownTilesetManager* this, u32 param_2, u8* param_3, co
void sub_08059CC0(u32 param_1, u32 param_2) {
const Unknown* unknown;
- gRoomVars.unk_10[param_1] = param_2;
+ gRoomVars.graphicsGroups[param_1] = param_2;
if (gRoomControls.area != AREA_FESTIVAL_TOWN) {
unknown = &gUnk_08108408[param_2];
} else {
diff --git a/src/manager/minishVillageTilesetManager.c b/src/manager/minishVillageTilesetManager.c
index 225ba477..055e78b0 100644
--- a/src/manager/minishVillageTilesetManager.c
+++ b/src/manager/minishVillageTilesetManager.c
@@ -69,7 +69,7 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
return;
if (sub_08057E40(this)) {
- tmp = (u32)gRoomVars.unk_10[0];
+ tmp = (u32)gRoomVars.graphicsGroups[0];
if (this->unk_20 != tmp) {
this->unk_20 = tmp;
super->timer = 0;
@@ -115,7 +115,7 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
RegisterTransitionManager(this, sub_08057E30, 0);
}
if (sub_08057E40(this)) {
- tmp = (u32)gRoomVars.unk_10[0];
+ tmp = (u32)gRoomVars.graphicsGroups[0];
if (this->unk_20 != tmp) {
this->unk_20 = tmp;
super->timer = 0;
@@ -153,13 +153,13 @@ void MinishVillageTilesetManager_Main(MinishVillageTilesetManager* this) {
#endif
void sub_08057E30(void* this) {
- sub_08057E7C(gRoomVars.unk_10[0]);
+ sub_08057E7C(gRoomVars.graphicsGroups[0]);
}
bool32 sub_08057E40(MinishVillageTilesetManager* this) {
u32 tmp = CheckRegionsOnScreen(gUnk_08108050);
if (tmp != 0xFF) {
- gRoomVars.unk_10[0] = tmp;
+ gRoomVars.graphicsGroups[0] = tmp;
return TRUE;
} else {
return FALSE;
@@ -187,5 +187,5 @@ void sub_08057E7C(u32 unk1) {
for (tmp = 0; tmp < 8; tmp++, tmp2 += 2) {
DmaCopy32(3, &gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x400 * 4);
}
- gRoomVars.unk_10[0] = unk1;
+ gRoomVars.graphicsGroups[0] = unk1;
}
diff --git a/src/manager/miscManager.c b/src/manager/miscManager.c
index c250e517..60bed46c 100644
--- a/src/manager/miscManager.c
+++ b/src/manager/miscManager.c
@@ -392,7 +392,7 @@ void MiscManager_TypeD(MiscManager* this) {
SetPlayerControl(3);
if (gRoomControls.reload_flags)
return;
- if (gRoomVars.field_0x0) {
+ if (gRoomVars.didEnterScrolling) {
StartPlayerScript(gUnk_08108380[gRoomControls.scroll_direction]);
} else {
StartPlayerScript(gUnk_08108380[gPlayerEntity.base.animationState >> 1]);
diff --git a/src/manager/verticalMinishPathBackgroundManager.c b/src/manager/verticalMinishPathBackgroundManager.c
index d2978bb7..e67cde8d 100644
--- a/src/manager/verticalMinishPathBackgroundManager.c
+++ b/src/manager/verticalMinishPathBackgroundManager.c
@@ -51,7 +51,7 @@ void sub_080575C8(u32 param) {
gMapTop.bgSettings = 0;
REG_DISPCNT = 0;
LoadGfxGroup(param);
- gRoomVars.unk_10[0] = param;
+ gRoomVars.graphicsGroups[0] = param;
bgOffset = (gRoomControls.scroll_y - gRoomControls.origin_y);
bgOffset += bgOffset >> 3;
@@ -80,7 +80,7 @@ void sub_08057688(void) {
}
void sub_080576A0(void* this) {
- LoadGfxGroup(gRoomVars.unk_10[0]);
+ LoadGfxGroup(gRoomVars.graphicsGroups[0]);
((VerticalMinishPathBackgroundManager*)this)->field_0x38 = NULL;
((VerticalMinishPathBackgroundManager*)this)->field_0x3c = NULL;
sub_0805754C((VerticalMinishPathBackgroundManager*)this);
diff --git a/src/manager/weatherChangeManager.c b/src/manager/weatherChangeManager.c
index 83fa2d16..0528f36d 100644
--- a/src/manager/weatherChangeManager.c
+++ b/src/manager/weatherChangeManager.c
@@ -46,7 +46,7 @@ void WeatherChangeManager_Main(WeatherChangeManager* this) {
this->unk_20 = 0x1F;
this->unk_22 = 5;
}
- gRoomVars.unk_10[0] = 0xFF;
+ gRoomVars.graphicsGroups[0] = 0xFF;
RegisterTransitionManager(this, sub_080595E4, 0);
}
sub_08059608(this);
@@ -55,7 +55,7 @@ void WeatherChangeManager_Main(WeatherChangeManager* this) {
}
void sub_080595E4(WeatherChangeManager* this) {
- gRoomVars.unk_10[0] = 0xFF;
+ gRoomVars.graphicsGroups[0] = 0xFF;
sub_08059690(this);
sub_080596E0(this);
LoadStaticBackground(0);
@@ -134,8 +134,8 @@ void sub_080596E0(WeatherChangeManager* this) {
}
break;
}
- if (gRoomVars.unk_10[0] != this->unk_22) {
- gRoomVars.unk_10[0] = this->unk_22;
+ if (gRoomVars.graphicsGroups[0] != this->unk_22) {
+ gRoomVars.graphicsGroups[0] = this->unk_22;
switch (this->unk_22) {
case 0 ... 3:
LoadGfxGroup(this->unk_22 + 0x2B);
diff --git a/src/npc/rem.c b/src/npc/rem.c
index dba2b8dd..d921f196 100644
--- a/src/npc/rem.c
+++ b/src/npc/rem.c
@@ -434,18 +434,18 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
MessageNoOverlap(messageIndex, this);
switch (context->intVariable) {
case 0:
- gRoomVars.entities[0] = this;
+ gRoomVars.puzzleEntities[0] = this;
PrependEntityToList(this, NPC);
this->zVelocity = Q_16_16(1.5);
break;
case 1:
- pEnt = FindNextDuplicateID(gRoomVars.entities[0], NPC);
- gRoomVars.entities[1] = pEnt;
+ pEnt = FindNextDuplicateID(gRoomVars.puzzleEntities[0], NPC);
+ gRoomVars.puzzleEntities[1] = pEnt;
pEnt->zVelocity = Q_16_16(1.5);
break;
case 2:
- pEnt = FindNextDuplicateID(gRoomVars.entities[1], NPC);
- gRoomVars.entities[2] = pEnt;
+ pEnt = FindNextDuplicateID(gRoomVars.puzzleEntities[1], NPC);
+ gRoomVars.puzzleEntities[2] = pEnt;
pEnt->zVelocity = Q_16_16(1.5);
break;
}
@@ -456,7 +456,7 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
context->unk_18 = 1;
break;
case 1:
- pEnt = gRoomVars.entities[context->intVariable];
+ pEnt = gRoomVars.puzzleEntities[context->intVariable];
if (pEnt->z.HALF.HI < 0) {
break;
}
@@ -474,7 +474,7 @@ void sub_0806AA50(Entity* this, ScriptExecutionContext* context) {
}
void sub_0806AB74(Entity* this) {
- gRoomVars.field_0x3 = 1;
+ gRoomVars.remFlagUnused = TRUE;
if ((s32)(this->y.HALF.HI - (u32)gRoomControls.origin_y) < 0xa8) {
this->y.HALF.HI = gRoomControls.origin_y + 0xa8;
}
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index edb631a2..3a755c87 100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -95,7 +95,7 @@ void ItemOnGround(ItemOnGroundEntity* this) {
}
if (super->type == 0x5C) {
- gRoomVars.field_0x4++;
+ gRoomVars.numKinstoneDrops++;
}
sub_08080CB4(super);
diff --git a/src/object/pressurePlate.c b/src/object/pressurePlate.c
index be8a7ff6..df373091 100644
--- a/src/object/pressurePlate.c
+++ b/src/object/pressurePlate.c
@@ -104,7 +104,7 @@ static u32 sub_08088938(PressurePlateEntity* this) {
x = super->x.HALF.HI - 8;
y = super->y.HALF.HI - 8;
for (i = 0; i < 8; ++i) {
- Entity* e = gRoomVars.entities[i];
+ Entity* e = gRoomVars.puzzleEntities[i];
if (e != NULL) {
if ((u16)(e->x.HALF.HI - x) < 0x11 && ((u16)(e->y.HALF_U.HI - y) < 0x11)) {
e->spriteOffsetY = sSpriteOffsets[this->dir];
diff --git a/src/object/pushableStatue.c b/src/object/pushableStatue.c
index 386cb3e0..90ba2fc2 100644
--- a/src/object/pushableStatue.c
+++ b/src/object/pushableStatue.c
@@ -172,8 +172,8 @@ void sub_08089454(PushableStatueEntity* this) {
void sub_080894C8(PushableStatueEntity* this) {
u32 index;
for (index = 0; index < 8; index++) {
- if (gRoomVars.entities[index] == NULL) {
- gRoomVars.entities[index] = super;
+ if (gRoomVars.puzzleEntities[index] == NULL) {
+ gRoomVars.puzzleEntities[index] = super;
break;
}
}
@@ -182,8 +182,8 @@ void sub_080894C8(PushableStatueEntity* this) {
void sub_080894FC(PushableStatueEntity* this) {
u32 index;
for (index = 0; index <= 7; index++) {
- if (super == gRoomVars.entities[index]) {
- gRoomVars.entities[index] = NULL;
+ if (super == gRoomVars.puzzleEntities[index]) {
+ gRoomVars.puzzleEntities[index] = NULL;
break;
}
}
diff --git a/src/player.c b/src/player.c
index 6c89f022..e9e84ce5 100644
--- a/src/player.c
+++ b/src/player.c
@@ -1989,7 +1989,7 @@ static void sub_080724DC(PlayerEntity* this) {
} else {
super->spriteSettings.draw = 3;
super->subAction = 1;
- if (gRoomVars.field_0x0 == 0) {
+ if (!gRoomVars.didEnterScrolling) {
if (gPlayerState.flags & PL_MINISH) {
gPlayerState.animation = ANIM_BOUNCE_MINISH;
} else {
diff --git a/src/playerUtils.c b/src/playerUtils.c
index 16eb6033..c64835df 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -21,7 +21,7 @@
static void sub_08077E54(ItemBehavior* beh);
extern void sub_0800857C(Entity*);
-extern void SetEntityPriorityForKind(Entity*);
+extern void InitDefaultPriority(Entity*);
extern void sub_0809D738(Entity*);
extern s32 Mod(s32, s32);
extern u32 sub_08003FDE(Entity*, Entity*, u32, u32);
@@ -1671,7 +1671,7 @@ bool32 CheckQueuedAction(void) {
gPlayerEntity.base.action = gPlayerState.queued_action;
gPlayerEntity.base.subAction = 0;
gPlayerState.queued_action = PLAYER_INIT;
- DoPlayerAction(&gPlayerEntity.base);
+ DoPlayerAction(&gPlayerEntity);
return TRUE;
}
}
@@ -1851,7 +1851,7 @@ void PlayerSetNormalAndCollide(void) {
PL_MOLDWORM_RELEASED | PL_PARACHUTE);
ResolvePlayerAnimation();
SetPlayerActionNormal();
- SetEntityPriorityForKind(&gPlayerEntity.base);
+ InitDefaultPriority(&gPlayerEntity.base);
}
void PlayerMinishSetNormalAndCollide(void) {
@@ -1867,7 +1867,7 @@ void PlayerMinishSetNormalAndCollide(void) {
~(PL_BUSY | PL_DROWNING | PL_DISABLE_ITEMS | PL_IN_HOLE | PL_MOLDWORM_RELEASED | PL_PARACHUTE);
gPlayerState.swim_state = 0;
gPlayerState.queued_action = PLAYER_INIT;
- SetEntityPriorityForKind(&gPlayerEntity.base);
+ InitDefaultPriority(&gPlayerEntity.base);
}
void sub_080792BC(s32 speed, u32 direction, u32 field_0x38) {
@@ -2018,7 +2018,7 @@ bool32 sub_08079550(void) {
gPlayerEntity.base.subAction = 0;
COLLISION_OFF(&gPlayerEntity.base);
gPlayerState.jump_status = 0x81;
- DoPlayerAction(&gPlayerEntity.base);
+ DoPlayerAction(&gPlayerEntity);
return TRUE;
}
}
diff --git a/src/room.c b/src/room.c
index b999efce..1e321869 100644
--- a/src/room.c
+++ b/src/room.c
@@ -14,7 +14,7 @@ extern u32 sub_08049D1C(u32);
extern void** gCurrentRoomProperties;
extern void*** gAreaTable[];
-extern u8 gUnk_081091E4[];
+extern u8 gEntityListLUT[];
extern void sub_080186EC(void);
extern void sub_0804B16C(void);
@@ -102,7 +102,7 @@ void RegisterRoomEntity(Entity* ent, const EntityData* dat) {
kind = dat->kind & 0xF;
if (ent->prev == NULL) {
if (list == 0xF) {
- AppendEntityToList(ent, gUnk_081091E4[kind]);
+ AppendEntityToList(ent, gEntityListLUT[kind]);
} else if (list == 8) {
AppendEntityToList(ent, 8);
} else {
@@ -122,6 +122,8 @@ void sub_0804AF0C(Entity* ent, const EntityData* dat) {
ent->y.HALF.HI = dat->yPos + gRoomControls.origin_y;
break;
case 0x20:
+ // TODO: for enemies, I think this is for delayed spawn
+ // see mulldozerSpawnPoint.c
((GenericEntity*)ent)->field_0x6c.HALF.HI |= 0x20;
ent->x.HALF.HI = dat->xPos + gRoomControls.origin_x;
ent->y.HALF.HI = dat->yPos + gRoomControls.origin_y;
@@ -145,7 +147,7 @@ void sub_0804AFB0(void** properties) {
gCurrentRoomProperties = properties;
for (i = 0; i < 8; ++i) {
- gRoomVars.field_0x6c[i] = gCurrentRoomProperties[i];
+ gRoomVars.properties[i] = gCurrentRoomProperties[i];
}
}
@@ -247,9 +249,9 @@ void* GetCurrentRoomProperty(u32 idx) {
return NULL;
if (idx >= 0x80) {
- return gRoomVars.field_0x8c[idx & 7];
+ return gRoomVars.entityRails[idx & 7];
} else if (idx <= 7) {
- return gRoomVars.field_0x6c[idx];
+ return gRoomVars.properties[idx];
} else {
return gCurrentRoomProperties[idx];
}
@@ -353,9 +355,9 @@ static void LoadDarknessTile(TileEntity* tile) {
static void LoadDestructibleTile(TileEntity* tile) {
if (CheckLocalFlag(*(u16*)&tile->_2)) {
SetTileType(*(u16*)&tile->_6, tile->tilePos, tile->localFlag);
- } else if (!gRoomVars.filler_0x1) {
+ } else if (!gRoomVars.destructableManagerLoaded) {
Manager* mgr;
- gRoomVars.filler_0x1 = 1;
+ gRoomVars.destructableManagerLoaded = TRUE;
mgr = GetEmptyManager();
if (mgr != NULL) {
mgr->kind = MANAGER;
diff --git a/src/roomInit.c b/src/roomInit.c
index 58d70bc1..2f832223 100644
--- a/src/roomInit.c
+++ b/src/roomInit.c
@@ -399,7 +399,7 @@ u32 sub_unk3_HouseInteriors1_InnWestRoom(void) {
index = 0;
SetLocalFlag(BILL05_YADO1F_MATSU_T0);
}
- gRoomVars.field_0x6c[3] = gUnk_080D6A74[index];
+ gRoomVars.properties[3] = gUnk_080D6A74[index];
return 1;
}
@@ -427,7 +427,7 @@ u32 sub_unk3_HouseInteriors1_InnMiddleRoom(void) {
index = 0;
SetLocalFlag(BILL06_YADO1F_TAKE_T0);
}
- gRoomVars.field_0x6c[3] = gUnk_080D6B18[index];
+ gRoomVars.properties[3] = gUnk_080D6B18[index];
return 1;
}
@@ -453,7 +453,7 @@ u32 sub_unk3_HouseInteriors1_InnEastRoom(void) {
index = 0;
SetLocalFlag(BILL07_YADO1F_UME_T0);
}
- gRoomVars.field_0x6c[3] = gUnk_080D6BB8[index];
+ gRoomVars.properties[3] = gUnk_080D6BB8[index];
return 1;
}
@@ -533,7 +533,7 @@ void sub_StateChange_HouseInteriors1_SchoolWest(void) {
if (gSave.global_progress < 8) {
LoadRoomEntityList(&gUnk_080D7038);
}
- if (gRoomVars.field_0x0 == 0) {
+ if (!gRoomVars.didEnterScrolling) {
SetWorldMapPos(2, 0, 0x2c8, 0xa8);
}
}
@@ -566,8 +566,8 @@ extern u32 gUnk_080D7348;
u32 sub_unk3_HyruleCastle_0(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080D7348;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = &gUnk_080D7348;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -600,8 +600,8 @@ extern u32 gUnk_080D7410;
u32 sub_unk3_HyruleCastle_1(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080D7410;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = &gUnk_080D7410;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -1077,7 +1077,7 @@ extern TileEntity gUnk_080D9328[];
static void sub_0804C128(void) {
sub_080AF250(0);
- if (gRoomVars.field_0x0 != 0) {
+ if (gRoomVars.didEnterScrolling) {
if ((gArea.unk_0c_1) == 0) {
if ((gArea.unk_0c_4) == 0) {
gArea.unk_0c_1 = 1;
@@ -1271,7 +1271,7 @@ extern u32 gUnk_080DA230;
u32 sub_unk3_CastorDarknut_Main(void) {
if (!CheckLocalFlag(LV4_0a_TSUBO))
- gRoomVars.field_0x6c[0] = &gUnk_080DA230;
+ gRoomVars.properties[0] = &gUnk_080DA230;
return 1;
}
@@ -1633,7 +1633,7 @@ extern u32 gUnk_080DB910;
u32 sub_unk3_TownMinishHoles_LibraryBookshelf(void) {
if (CheckGlobalFlag(MIZUKAKI_START) && !CheckLocalFlag(MIZUKAKI_BOOK_ALLBACK)) {
- gRoomVars.field_0x6c[1] = &gUnk_080DB910;
+ gRoomVars.properties[1] = &gUnk_080DB910;
}
return 1;
}
@@ -2456,7 +2456,7 @@ extern u32 gUnk_080E103C;
u32 sub_unk3_CaveOfFlames_BeforeGleerok(void) {
if (CheckGlobalFlag(LV2_CLEAR)) {
- gRoomVars.field_0x6c[1] = &gUnk_080E103C;
+ gRoomVars.properties[1] = &gUnk_080E103C;
}
return 1;
}
@@ -3758,16 +3758,16 @@ extern u32 gUnk_080EB5D4;
u32 sub_unk3_DarkHyruleCastle_1FEntrance(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080EB604;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = &gUnk_080EB604;
+ gRoomVars.properties[2] = 0;
gArea.bgm = gArea.queued_bgm = BGM_BEAT_VAATI;
} else if (CheckLocalFlag(0x79)) {
- gRoomVars.field_0x6c[0] = NULL;
+ gRoomVars.properties[0] = NULL;
if (!CheckLocalFlag(0x7a)) {
SetGlobalFlag(ZELDA_CHASE);
- gRoomVars.field_0x6c[0] = &gUnk_080EB5D4;
- gRoomVars.field_0x6c[7] = sub_0804D9B0;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = &gUnk_080EB5D4;
+ gRoomVars.properties[7] = sub_0804D9B0;
+ gRoomVars.properties[2] = 0;
}
}
return 1;
@@ -3830,8 +3830,8 @@ void sub_StateChange_Dojos_ToSplitblade1(void) {
u32 sub_unk3_DarkHyruleCastle_3FTripleDarknut(void) {
if (!CheckLocalFlag(0x77)) {
- gRoomVars.field_0x6c[0] = 0;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = 0;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -4023,7 +4023,7 @@ void sub_StateChange_Dojos_ToGreatblade8(void) {
u32 sub_unk3_DarkHyruleCastle_B1Entrance(void) {
if (CheckLocalFlag(0x79)) {
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -4056,8 +4056,8 @@ extern u32 gUnk_080ED1E4;
u32 sub_unk3_DarkHyruleCastle_1FThroneRoom(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080ED1E4;
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[0] = &gUnk_080ED1E4;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -4217,8 +4217,8 @@ void sub_StateChange_Ruins_Beanstalk1(void) {
u32 sub_unk3_DarkHyruleCastle_B1Left(void) {
if (CheckLocalFlag(0x79)) {
- gRoomVars.field_0x6c[2] = 0;
- gRoomVars.field_0x6c[0] = 0;
+ gRoomVars.properties[2] = 0;
+ gRoomVars.properties[0] = 0;
}
return 1;
}
@@ -4242,7 +4242,7 @@ void sub_StateChange_Ruins_Beanstalk2(void) {
u32 sub_unk3_DarkHyruleCastle_B1Map(void) {
if (CheckLocalFlag(0x79)) {
- gRoomVars.field_0x6c[2] = 0;
+ gRoomVars.properties[2] = 0;
}
return 1;
}
@@ -4564,7 +4564,7 @@ extern u32 gUnk_080F09A0;
u32 sub_unk3_CastleGarden_Main(void) {
if (GetInventoryValue(ITEM_FOURSWORD)) {
- gRoomVars.field_0x6c[1] = &gUnk_080F09A0;
+ gRoomVars.properties[1] = &gUnk_080F09A0;
}
return 1;
}
@@ -5022,9 +5022,9 @@ extern u32 gUnk_080F3EA4;
u32 sub_unk3_LakeHylia_Main(void) {
if (CheckGlobalFlag(LV4_CLEAR) && !CheckLocalFlag(4)) {
- gRoomVars.field_0x6c[2] = &gUnk_080F3EA4;
+ gRoomVars.properties[2] = &gUnk_080F3EA4;
} else {
- gRoomVars.field_0x6c[2] = &Enemies_LakeHylia_Main;
+ gRoomVars.properties[2] = &Enemies_LakeHylia_Main;
}
return 1;
}
@@ -5177,8 +5177,8 @@ extern u32 gUnk_080F4EB0;
u32 sub_unk3_MinishWoods_Main(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080F4EB0;
- gRoomVars.field_0x6c[2] = NULL;
+ gRoomVars.properties[0] = &gUnk_080F4EB0;
+ gRoomVars.properties[2] = NULL;
}
return 1;
}
@@ -5234,9 +5234,9 @@ extern u32 gUnk_080F5348;
u32 sub_unk3_SanctuaryEntrance_Main(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080F5348;
- gRoomVars.field_0x6c[7] = sub_0804ED18;
- gRoomVars.field_0x6c[2] = NULL;
+ gRoomVars.properties[0] = &gUnk_080F5348;
+ gRoomVars.properties[7] = sub_0804ED18;
+ gRoomVars.properties[2] = NULL;
}
return 1;
}
@@ -5687,7 +5687,7 @@ extern u32 gUnk_080F7680;
u32 sub_unk3_HyruleField_EasternHillsNorth(void) {
if (GetInventoryValue(ITEM_GUST_JAR) && !GetInventoryValue(ITEM_PACCI_CANE)) {
- gRoomVars.field_0x6c[2] = &gUnk_080F7680;
+ gRoomVars.properties[2] = &gUnk_080F7680;
}
return 1;
}
@@ -5748,13 +5748,13 @@ extern void sub_0804F4E4(void);
u32 sub_unk3_HyruleField_OutsideCastle(void) {
if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(ITEM_GUST_JAR)) {
- gRoomVars.field_0x6c[0] = &gUnk_080F7CD0;
- gRoomVars.field_0x6c[7] = sub_0804F5E8;
+ gRoomVars.properties[0] = &gUnk_080F7CD0;
+ gRoomVars.properties[7] = sub_0804F5E8;
}
if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(ITEM_RED_SWORD) && !CheckLocalFlag(SOUGEN_06_SAIKAI)) {
- gRoomVars.field_0x6c[0] = &gUnk_080F7C80;
- gRoomVars.field_0x6c[7] = sub_0804F4E4;
- gRoomVars.field_0x6c[2] = NULL;
+ gRoomVars.properties[0] = &gUnk_080F7C80;
+ gRoomVars.properties[7] = sub_0804F4E4;
+ gRoomVars.properties[2] = NULL;
}
#ifndef EU
if (CheckGlobalFlag(TABIDACHI)) {
@@ -6255,7 +6255,7 @@ extern u32 gUnk_080F9BF8;
u32 sub_unk3_VeilFallsTop_Main(void) {
if (!CheckKinstoneFused(KINSTONE_E)) {
- gRoomVars.field_0x6c[0] = &gUnk_080F9BF8;
+ gRoomVars.properties[0] = &gUnk_080F9BF8;
}
return 1;
}
@@ -6541,8 +6541,8 @@ extern u32 gUnk_080FAD48;
u32 sub_unk3_MtCrenel_MountainTop(void) {
if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c[0] = &gUnk_080FAD48;
- gRoomVars.field_0x6c[2] = NULL;
+ gRoomVars.properties[0] = &gUnk_080FAD48;
+ gRoomVars.properties[2] = NULL;
}
return 1;
}