summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-08-08 20:03:12 +0300
committerTal Hayon <talhayon1@gmail.com>2022-08-08 20:03:12 +0300
commit79bae9cd8a7891dd4545649fa196aad5a36237d2 (patch)
tree1e59403522cbeeaa36c33ca34662f17c49866639
parent22cbdd2fd645a5525a6ef0c9b8ee8ec11af9e9aa (diff)
Various documentations
-rw-r--r--data/scripts/cloudTops/script_WindTribespeopleGreatWhirlwindRevealed2.inc2
-rw-r--r--data/scripts/cutscene/ezlo/script_Npc4EEzloCutscene.inc4
-rw-r--r--data/scripts/cutscene/originStory/script_CutsceneMiscObjectMinishCap.inc2
-rw-r--r--data/scripts/cutscene/originStory/script_CutsceneOrchestratorVaatiAppears.inc4
-rw-r--r--data/scripts/cutscene/outro/script_Npc4EMinishPortalClosing.inc2
-rw-r--r--data/scripts/dhc/script_CutsceneMiscObjectV3DefeatedMinishCap.inc2
-rw-r--r--data/scripts/hyruleTown/script_Carlov.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_BigGoronKinstone5.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron1Kinstone2.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron2Kinstone2.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron2Kinstone4.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron2Kinstone6.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron4Kinstone4.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_Goron6Kindstone6.inc2
-rw-r--r--data/scripts/kinstoneFusion/script_KinstoneSparkKinstoneSparkFromBottom.inc4
-rw-r--r--data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge3.inc2
-rw-r--r--data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge4.inc2
-rw-r--r--data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge7.inc2
-rw-r--r--data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge8.inc2
-rw-r--r--data/scripts/unused/script_08012B24.inc2
-rw-r--r--data/scripts/unused/script_08012B50.inc2
-rw-r--r--data/scripts/unused/script_08012B7C.inc2
-rw-r--r--data/scripts/veilFalls/script_BigGoronHiding.inc2
-rw-r--r--data/scripts/veilFalls/script_MinishVillageObjectLeftStone.inc2
-rw-r--r--include/area.h5
-rw-r--r--include/color.h2
-rw-r--r--include/functions.h4
-rw-r--r--include/kinstone.h2
-rw-r--r--include/manager/fightManager.h2
-rw-r--r--include/player.h4
-rw-r--r--include/room.h6
-rw-r--r--include/structures.h2
-rw-r--r--src/code_08049DF4.c4
-rw-r--r--src/color.c14
-rw-r--r--src/common.c14
-rw-r--r--src/enemy/chuchuBoss.c2
-rw-r--r--src/enemy/enemy64.c83
-rw-r--r--src/enemy/likeLike.c4
-rw-r--r--src/enemy/octorokBoss.c2
-rw-r--r--src/enemy/vaatiArm.c2
-rw-r--r--src/enemy/vaatiWrath.c4
-rw-r--r--src/enterPortalSubtask.c22
-rw-r--r--src/entity.c2
-rw-r--r--src/game.c65
-rw-r--r--src/interrupts.c4
-rw-r--r--src/kinstone.c2
-rw-r--r--src/manager/delayedEntityLoadManager.c2
-rw-r--r--src/manager/fightManager.c8
-rw-r--r--src/manager/hyruleTownBellManager.c2
-rw-r--r--src/manager/vaati3StartManager.c2
-rw-r--r--src/manager/weatherChangeManager.c10
-rw-r--r--src/menu/figurine_menu.c14
-rw-r--r--src/menu/pause_menu.c6
-rw-r--r--src/npc/beedle.c10
-rw-r--r--src/npc/bigGoron.c2
-rw-r--r--src/object/barrelInside.c34
-rw-r--r--src/object/enemyItem.c2
-rw-r--r--src/object/fairy.c2
-rw-r--r--src/object/fourElements.c8
-rw-r--r--src/object/frozenOctorok.c2
-rw-r--r--src/object/gleerokParticle.c4
-rw-r--r--src/object/gyorgBossObject.c4
-rw-r--r--src/object/keyStealingTakkuri.c2
-rw-r--r--src/object/ladderUp.c2
-rw-r--r--src/object/lavaPlatform.c2
-rw-r--r--src/object/lilypadLarge.c4
-rw-r--r--src/object/linkHoldingItem.c28
-rw-r--r--src/object/macroPlayer.c2
-rw-r--r--src/object/minishPortalCloseup.c2
-rw-r--r--src/object/object30.c8
-rw-r--r--src/object/objectA8.c2
-rw-r--r--src/object/whirlwind.c2
-rw-r--r--src/physics.c6
-rw-r--r--src/player.c8
-rw-r--r--src/playerItemUtils.c8
-rw-r--r--src/playerUtils.c50
-rw-r--r--src/room.c2
-rw-r--r--src/roomInit.c10
-rw-r--r--src/scroll.c3
-rw-r--r--src/staffroll.c8
-rw-r--r--src/subtask2.c2
-rw-r--r--src/text.c2
-rw-r--r--src/ui.c2
83 files changed, 297 insertions, 275 deletions
diff --git a/data/scripts/cloudTops/script_WindTribespeopleGreatWhirlwindRevealed2.inc b/data/scripts/cloudTops/script_WindTribespeopleGreatWhirlwindRevealed2.inc
index 9566e4ae..76862484 100644
--- a/data/scripts/cloudTops/script_WindTribespeopleGreatWhirlwindRevealed2.inc
+++ b/data/scripts/cloudTops/script_WindTribespeopleGreatWhirlwindRevealed2.inc
@@ -12,7 +12,7 @@ SCRIPT_START script_WindTribespeopleGreatWhirlwindRevealed2
WaitForSyncFlagAndClear 0x00000002
script_0800D80C:
SetEntitySpeed 0x0100
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
DoPostScriptAction 0x000e
Call sub_0806CA5C
SetEntityVelocity 0x00040000
diff --git a/data/scripts/cutscene/ezlo/script_Npc4EEzloCutscene.inc b/data/scripts/cutscene/ezlo/script_Npc4EEzloCutscene.inc
index 015df913..76640636 100644
--- a/data/scripts/cutscene/ezlo/script_Npc4EEzloCutscene.inc
+++ b/data/scripts/cutscene/ezlo/script_Npc4EEzloCutscene.inc
@@ -1,7 +1,7 @@
@ Minish Woods Ezlo Cutscene NPC4E
SCRIPT_START script_Npc4EEzloCutscene
BeginBlock
- Call sub_08054564
+ Call DisableRandomDrops
EndBlock
script_0801248A:
CheckPlayerInRegion 0x0208, 0x02c8, 0x4020
@@ -126,7 +126,7 @@ script_08012566:
StopBgm
Wait 0x003c
PlayBGM
- Call sub_08054570
+ Call EnableRandomDrops
SetGlobalFlag EZERO_1ST
CallWithArg ResetPlayerFlag, PL_NO_CAP
Call EnablePauseMenu
diff --git a/data/scripts/cutscene/originStory/script_CutsceneMiscObjectMinishCap.inc b/data/scripts/cutscene/originStory/script_CutsceneMiscObjectMinishCap.inc
index 2bc226f6..b835a4ce 100644
--- a/data/scripts/cutscene/originStory/script_CutsceneMiscObjectMinishCap.inc
+++ b/data/scripts/cutscene/originStory/script_CutsceneMiscObjectMinishCap.inc
@@ -11,7 +11,7 @@ SCRIPT_START script_CutsceneMiscObjectMinishCap
_0807EDD4 0x0078, 0x0068
SetSyncFlag 0x00000100
WaitForSyncFlagAndClear 0x00000080
- _0807EF3C 0xff80, 0x0000
+ _0807EF3C -128, 0x0000
CallWithArg DeleteRepeatedSoundManager, 0x00000003
Wait 0x003c
SetSyncFlag 0x00000100
diff --git a/data/scripts/cutscene/originStory/script_CutsceneOrchestratorVaatiAppears.inc b/data/scripts/cutscene/originStory/script_CutsceneOrchestratorVaatiAppears.inc
index a51f7c15..6d3e1cbe 100644
--- a/data/scripts/cutscene/originStory/script_CutsceneOrchestratorVaatiAppears.inc
+++ b/data/scripts/cutscene/originStory/script_CutsceneOrchestratorVaatiAppears.inc
@@ -2,7 +2,7 @@
SCRIPT_START script_CutsceneOrchestratorVaatiAppears
BeginBlock
SetEntityPositionRelative 0x01f8, 0x00e0
- Call sub_08054564
+ Call DisableRandomDrops
EndBlock
script_08014FCC:
CheckPlayerInRegion 0x01f8, 0x00a0, 0x2040
@@ -141,7 +141,7 @@ script_08015104:
WaitUntilTextboxCloses
_0807F0B4 0x0004
CameraTargetPlayer
- Call sub_08054570
+ Call EnableRandomDrops
PlayBGM
Call EnablePauseMenu
EnablePlayerControl
diff --git a/data/scripts/cutscene/outro/script_Npc4EMinishPortalClosing.inc b/data/scripts/cutscene/outro/script_Npc4EMinishPortalClosing.inc
index d6887242..d4e0b0ab 100644
--- a/data/scripts/cutscene/outro/script_Npc4EMinishPortalClosing.inc
+++ b/data/scripts/cutscene/outro/script_Npc4EMinishPortalClosing.inc
@@ -37,7 +37,7 @@ SCRIPT_START script_Npc4EMinishPortalClosing
WaitUntilTextboxCloses
MessageFromTargetPos TEXT_VAATI2, 0x63, 0x000e
WaitUntilTextboxCloses
- OffsetEntityPosition 0x0000, 0xffe0
+ OffsetEntityPosition 0x0000, -32
Call WaitForCameraTouchRoomBorder
SetSyncFlag 0x00000002
WaitForSyncFlagAndClear 0x00000004
diff --git a/data/scripts/dhc/script_CutsceneMiscObjectV3DefeatedMinishCap.inc b/data/scripts/dhc/script_CutsceneMiscObjectV3DefeatedMinishCap.inc
index a8613fff..544a4d21 100644
--- a/data/scripts/dhc/script_CutsceneMiscObjectV3DefeatedMinishCap.inc
+++ b/data/scripts/dhc/script_CutsceneMiscObjectV3DefeatedMinishCap.inc
@@ -10,7 +10,7 @@ SCRIPT_START script_CutsceneMiscObjectV3DefeatedMinishCap
CallWithArg sub_080960C4, script_CutsceneMiscObjectV3DefeatedMinishCap2
EndBlock
PlaySound SFX_SPARKLES
- _0807EF3C 0xff80, 0x0000
+ _0807EF3C -128, 0x0000
PlaySound SFX_143
SetAnimation 0x0004
SetSyncFlag 0x00000002
diff --git a/data/scripts/hyruleTown/script_Carlov.inc b/data/scripts/hyruleTown/script_Carlov.inc
index 5939aa30..418511d1 100644
--- a/data/scripts/hyruleTown/script_Carlov.inc
+++ b/data/scripts/hyruleTown/script_Carlov.inc
@@ -50,7 +50,7 @@ script_080144C8:
Wait 0x0018
SetRoomFlag 0x0000
SetLocalFlag 0x0092
- _0807EEF4 0x0000, 0xffa0
+ _0807EEF4 0x0000, -96
Call DisablePauseMenu
Jump script_080144FC
script_080144F0:
diff --git a/data/scripts/kinstoneFusion/script_BigGoronKinstone5.inc b/data/scripts/kinstoneFusion/script_BigGoronKinstone5.inc
index 73498142..4bd86b55 100644
--- a/data/scripts/kinstoneFusion/script_BigGoronKinstone5.inc
+++ b/data/scripts/kinstoneFusion/script_BigGoronKinstone5.inc
@@ -1,7 +1,7 @@
@ BigGoron Kinstone Cutscene 5
SCRIPT_START script_BigGoronKinstone5
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xff30
+ _0807EEF4 0x0000, -208
_0807F0C8 0x0000, 0x0000
Wait 0x00b4
Call sub_08054968
diff --git a/data/scripts/kinstoneFusion/script_Goron1Kinstone2.inc b/data/scripts/kinstoneFusion/script_Goron1Kinstone2.inc
index b3c65aab..87ce4e77 100644
--- a/data/scripts/kinstoneFusion/script_Goron1Kinstone2.inc
+++ b/data/scripts/kinstoneFusion/script_Goron1Kinstone2.inc
@@ -34,5 +34,5 @@ script_0800BD1C:
SetAnimationState 0x0002
WaitForSyncFlagAndClear 0x00000004
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_Goron2Kinstone2.inc b/data/scripts/kinstoneFusion/script_Goron2Kinstone2.inc
index 588ede36..226eb90c 100644
--- a/data/scripts/kinstoneFusion/script_Goron2Kinstone2.inc
+++ b/data/scripts/kinstoneFusion/script_Goron2Kinstone2.inc
@@ -31,6 +31,6 @@ SCRIPT_START script_Goron2Kinstone2
SetAnimationState 0x0006
SetSyncFlag 0x00000004
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
Call sub_08054968
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_Goron2Kinstone4.inc b/data/scripts/kinstoneFusion/script_Goron2Kinstone4.inc
index 918a8076..b65e77f2 100644
--- a/data/scripts/kinstoneFusion/script_Goron2Kinstone4.inc
+++ b/data/scripts/kinstoneFusion/script_Goron2Kinstone4.inc
@@ -36,5 +36,5 @@ script_0800BFA8:
Wait 0x003c
Call sub_08054F64
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_Goron2Kinstone6.inc b/data/scripts/kinstoneFusion/script_Goron2Kinstone6.inc
index 0f84880e..62165e7f 100644
--- a/data/scripts/kinstoneFusion/script_Goron2Kinstone6.inc
+++ b/data/scripts/kinstoneFusion/script_Goron2Kinstone6.inc
@@ -36,5 +36,5 @@ script_0800C248:
Wait 0x003c
Call sub_08054F64
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_Goron4Kinstone4.inc b/data/scripts/kinstoneFusion/script_Goron4Kinstone4.inc
index a2a854bc..3a632fca 100644
--- a/data/scripts/kinstoneFusion/script_Goron4Kinstone4.inc
+++ b/data/scripts/kinstoneFusion/script_Goron4Kinstone4.inc
@@ -32,6 +32,6 @@ SCRIPT_START script_Goron4Kinstone4
Wait 0x003c
SetSyncFlag 0x0000001c
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
Call sub_08054968
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_Goron6Kindstone6.inc b/data/scripts/kinstoneFusion/script_Goron6Kindstone6.inc
index 1726b2c6..4eaed958 100644
--- a/data/scripts/kinstoneFusion/script_Goron6Kindstone6.inc
+++ b/data/scripts/kinstoneFusion/script_Goron6Kindstone6.inc
@@ -32,6 +32,6 @@ SCRIPT_START script_Goron6Kindstone6
Wait 0x003c
SetSyncFlag 0x0000007c
SetEntitySpeed 0x0080
- _0807EEF4 0x0000, 0xffe0
+ _0807EEF4 0x0000, -32
Call sub_08054968
SCRIPT_END
diff --git a/data/scripts/kinstoneFusion/script_KinstoneSparkKinstoneSparkFromBottom.inc b/data/scripts/kinstoneFusion/script_KinstoneSparkKinstoneSparkFromBottom.inc
index e8d78eee..cd7f7c5e 100644
--- a/data/scripts/kinstoneFusion/script_KinstoneSparkKinstoneSparkFromBottom.inc
+++ b/data/scripts/kinstoneFusion/script_KinstoneSparkKinstoneSparkFromBottom.inc
@@ -7,9 +7,9 @@ SCRIPT_START script_KinstoneSparkKinstoneSparkFromBottom
Wait 0x000a
DoPostScriptAction 0x0007
PlaySound SFX_136
- _0807EEF4 0x0000, 0xff90
+ _0807EEF4 0x0000, -112
Wait 0x001e
- _0807EEF4 0x0000, 0xffb0
+ _0807EEF4 0x0000, -80
Wait 0x003c
SetRoomFlag 0x00ff
SetAnimation 0x0005
diff --git a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge3.inc b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge3.inc
index 66905ff2..73f10379 100644
--- a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge3.inc
+++ b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge3.inc
@@ -4,7 +4,7 @@ SCRIPT_START script_CutsceneMiscObjectSwordCharge3
DoPostScriptAction 0x0007
SetAnimation 0x0002
Call sub_0807F738
- OffsetEntityPosition 0x0000, 0xfff0
+ OffsetEntityPosition 0, -16
EndBlock
WaitForSyncFlag 0x00000040
DoPostScriptAction 0x0006
diff --git a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge4.inc b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge4.inc
index a65de2da..12a257fc 100644
--- a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge4.inc
+++ b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge4.inc
@@ -4,7 +4,7 @@ SCRIPT_START script_CutsceneMiscObjectSwordCharge4
DoPostScriptAction 0x0007
SetAnimation 0x0003
Call sub_0807F738
- OffsetEntityPosition 0x0000, 0xfff0
+ OffsetEntityPosition 0, -16
EndBlock
WaitForSyncFlag 0x00000040
DoPostScriptAction 0x0006
diff --git a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge7.inc b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge7.inc
index 3c3dbe7d..156eb528 100644
--- a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge7.inc
+++ b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge7.inc
@@ -3,7 +3,7 @@ SCRIPT_START script_CutsceneMiscObjectSwordCharge7
BeginBlock
DoPostScriptAction 0x0007
SetAnimation 0x0006
- OffsetEntityPosition 0x0000, 0xfff0
+ OffsetEntityPosition 0, -16
EndBlock
WaitForSyncFlagAndClear 0x00000800
SetAnimation 0x000a
diff --git a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge8.inc b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge8.inc
index 28aa4a44..ad494b3a 100644
--- a/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge8.inc
+++ b/data/scripts/sanctuary/script_CutsceneMiscObjectSwordCharge8.inc
@@ -3,7 +3,7 @@ SCRIPT_START script_CutsceneMiscObjectSwordCharge8
BeginBlock
DoPostScriptAction 0x0007
SetAnimation 0x0007
- OffsetEntityPosition 0x0000, 0xfff0
+ OffsetEntityPosition 0, -16
EndBlock
WaitForSyncFlagAndClear 0x00001000
SetAnimation 0x000b
diff --git a/data/scripts/unused/script_08012B24.inc b/data/scripts/unused/script_08012B24.inc
index 72138857..6dd3ea33 100644
--- a/data/scripts/unused/script_08012B24.inc
+++ b/data/scripts/unused/script_08012B24.inc
@@ -7,6 +7,6 @@ SCRIPT_START script_08012B24
DoPostScriptAction 0x0001
WalkSouth 0x0008
SetSyncFlag 0x00000002
- CallWithArg SetPlayerIFrames, 0xffffffe2
+ CallWithArg SetPlayerIFrames, -30
Call SetPlayerActionNormal
SCRIPT_END
diff --git a/data/scripts/unused/script_08012B50.inc b/data/scripts/unused/script_08012B50.inc
index 8d48f7f2..d59845b9 100644
--- a/data/scripts/unused/script_08012B50.inc
+++ b/data/scripts/unused/script_08012B50.inc
@@ -7,6 +7,6 @@ SCRIPT_START script_08012B50
DoPostScriptAction 0x0001
WalkNorth 0x0008
SetSyncFlag 0x00000002
- CallWithArg SetPlayerIFrames, 0xffffffe2
+ CallWithArg SetPlayerIFrames, -30
Call SetPlayerActionNormal
SCRIPT_END
diff --git a/data/scripts/unused/script_08012B7C.inc b/data/scripts/unused/script_08012B7C.inc
index 228ba8b9..316929f6 100644
--- a/data/scripts/unused/script_08012B7C.inc
+++ b/data/scripts/unused/script_08012B7C.inc
@@ -7,6 +7,6 @@ SCRIPT_START script_08012B7C
DoPostScriptAction 0x0001
WalkEast 0x0008
SetSyncFlag 0x00000002
- CallWithArg SetPlayerIFrames, 0xffffffe2
+ CallWithArg SetPlayerIFrames, -30
Call SetPlayerActionNormal
SCRIPT_END
diff --git a/data/scripts/veilFalls/script_BigGoronHiding.inc b/data/scripts/veilFalls/script_BigGoronHiding.inc
index 1cf359ef..237d4470 100644
--- a/data/scripts/veilFalls/script_BigGoronHiding.inc
+++ b/data/scripts/veilFalls/script_BigGoronHiding.inc
@@ -5,7 +5,7 @@ SCRIPT_START script_BigGoronHiding
SetEntitySpeed 0x0010
EndBlock
script_0800932E:
- _0807EEF4 0xfff8, 0x0000
+ _0807EEF4 -8, 0x0000
_0807EEF4 0x0008, 0x0000
Jump script_0800932E
SCRIPT_END
diff --git a/data/scripts/veilFalls/script_MinishVillageObjectLeftStone.inc b/data/scripts/veilFalls/script_MinishVillageObjectLeftStone.inc
index 8005afe9..f4f1057f 100644
--- a/data/scripts/veilFalls/script_MinishVillageObjectLeftStone.inc
+++ b/data/scripts/veilFalls/script_MinishVillageObjectLeftStone.inc
@@ -1,5 +1,5 @@
@ Veil Falls MINISH_VILLAGE_OBJECT left stone
SCRIPT_START script_MinishVillageObjectLeftStone
- OffsetEntityPosition 0xfff0, 0x0000
+ OffsetEntityPosition -16, 0
SCRIPT_END
.2byte 0x0000
diff --git a/include/area.h b/include/area.h
index d8be7fc1..bffd9b43 100644
--- a/include/area.h
+++ b/include/area.h
@@ -35,7 +35,8 @@ typedef struct {
u8 unk;
u8 dungeon_idx; /* same index as global flags for dungeons */
u16 localFlagOffset;
- u8 filler[4];
+ u8 flag_bank;
+ u8 filler[3];
u16 lightLevel;
u8 lightType;
u8 unk_0c_0 : 1;
@@ -50,7 +51,7 @@ typedef struct {
u8 portal_mode;
// u8 filler3[7];
bool8 portal_in_use;
- u8 unk1A;
+ u8 portal_timer;
u8 filler2[13];
struct_area_28 unk28;
RoomResInfo roomResInfos[MAX_ROOMS];
diff --git a/include/color.h b/include/color.h
index 2a728474..fc99cdf8 100644
--- a/include/color.h
+++ b/include/color.h
@@ -9,7 +9,7 @@ typedef struct {
u8 _1;
u16 _2;
} Palette;
-extern Palette gPaletteList[];
+extern Palette gPaletteList[0x10];
typedef struct {
struct {
diff --git a/include/functions.h b/include/functions.h
index bd78c851..aeaf26f1 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -83,8 +83,8 @@ extern void sub_0803C0AC(Entity*);
extern void sub_08049CF4(Entity*);
extern u32 sub_0804A024(Entity*, u32, u32);
extern u32 sub_080542AC(u32);
-extern void sub_08054564();
-extern void sub_08054570(void);
+extern void DisableRandomDrops();
+extern void EnableRandomDrops(void);
extern s32 sub_08056338(void);
extern void sub_080575C8(u32);
extern void sub_08057688(void);
diff --git a/include/kinstone.h b/include/kinstone.h
index f3c0bd00..d9980699 100644
--- a/include/kinstone.h
+++ b/include/kinstone.h
@@ -11,7 +11,7 @@ typedef struct {
u8 action;
u8 _2;
u8 _3;
- u8 _4;
+ u8 prevUpdatePriority;
u8 _5;
u16 textIndex;
u16 _8;
diff --git a/include/manager/fightManager.h b/include/manager/fightManager.h
index 2d3968de..e3d10b18 100644
--- a/include/manager/fightManager.h
+++ b/include/manager/fightManager.h
@@ -5,7 +5,7 @@
typedef struct {
Manager base;
- u8 unk_20;
+ u8 prevBgm;
u8 unk_21[0x14];
u8 unk_35;
u8 unk_36[0x4];
diff --git a/include/player.h b/include/player.h
index 541c8821..6e6229f7 100644
--- a/include/player.h
+++ b/include/player.h
@@ -112,7 +112,7 @@ typedef enum {
PL_DRUGGED = 0x4000,
PL_PIT_IS_EXIT = 0x8000,
PL_FLAGS10000 = 0x10000,
- PL_FLAGS20000 = 0x20000,
+ PL_GYORG_FIGHT = 0x20000,
PL_ROLLING = 0x40000,
PL_MOLDWORM_CAPTURED = 0x80000,
PL_IN_HOLE = 0x100000,
@@ -120,7 +120,7 @@ typedef enum {
PL_CLONING = 0x400000,
PL_USE_LANTERN = 0x800000,
PL_PARACHUTE = 0x1000000,
- PL_FLAGS2000000 = 0x2000000,
+ PL_CONVEYOR_PUSHED = 0x2000000,
PL_ENTER_MINECART = 0x4000000,
PL_SWORD_THRUST = 0x8000000,
PL_USE_OCARINA = 0x10000000,
diff --git a/include/room.h b/include/room.h
index 710aab1f..b13fc21a 100644
--- a/include/room.h
+++ b/include/room.h
@@ -59,14 +59,14 @@ extern RoomControls gRoomControls;
typedef struct {
/* 0x00 */ u8 field_0x0;
/* 0x01 */ u8 filler_0x1;
- /* 0x02 */ u8 field_0x2;
+ /* 0x02 */ bool8 randomDropsDisabled;
/* 0x03 */ u8 field_0x3;
/* 0x04 */ u8 field_0x4;
/* 0x05 */ u8 filler1[1];
/* 0x06 */ u8 shopItemType;
/* 0x07 */ u8 shopItemType2;
/* 0x08 */ u8 field_0x8;
- /* 0x09 */ u8 field_0x9;
+ /* 0x09 */ u8 fight_bgm;
/* 0x0a */ u8 unk2;
/* 0x0b */ u8 filler2;
/* 0x0c */ s16 lightLevel;
@@ -162,7 +162,7 @@ typedef struct {
/* 0x3c */ u8 field_0x3c;
/* 0x3d */ u8 field_0x3d;
/* 0x3e */ u16 field_0x3e;
- /* 0x40 */ u16 hurtType;
+ /* 0x40 */ u16 field_0x40;
/* 0x42 */ u16 field_0x42;
/* 0x44 */ u16 field_0x44;
/* 0x46 */ u16 field_0x46;
diff --git a/include/structures.h b/include/structures.h
index 1a880e1d..a87a820a 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -298,7 +298,7 @@ typedef struct {
u8 draw_border : 1;
u8 border_type : 4;
u8 fill_type;
- u8 _15;
+ u8 charColor;
u8 _16;
u8 stylized;
} Font;
diff --git a/src/code_08049DF4.c b/src/code_08049DF4.c
index 3e46f6b6..bbef5e64 100644
--- a/src/code_08049DF4.c
+++ b/src/code_08049DF4.c
@@ -24,7 +24,7 @@ Entity* sub_08049E18(void) {
if ((gPlayerState.field_0x3c == 0) &&
!(gPlayerState.flags &
(PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN |
- PL_IN_MINECART | PL_PIT_IS_EXIT | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING))) {
+ PL_IN_MINECART | PL_PIT_IS_EXIT | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING))) {
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
@@ -35,7 +35,7 @@ Entity* sub_08049E4C(void) {
if ((gPlayerState.field_0x3c == 0) &&
!(gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_MINISH |
PL_DISABLE_ITEMS | PL_FALLING | PL_FROZEN | PL_IN_MINECART | PL_PIT_IS_EXIT |
- PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING))) {
+ PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING))) {
gUnk_020000B0 = &gPlayerEntity;
return &gPlayerEntity;
}
diff --git a/src/color.c b/src/color.c
index 28a16e93..5add643a 100644
--- a/src/color.c
+++ b/src/color.c
@@ -23,7 +23,7 @@ extern union SplitWord gUnk_08133368[];
void ResetPaletteTable(u32 a1) {
u32 i;
- MemClear(gPaletteList, 0x40);
+ MemClear(gPaletteList, sizeof(gPaletteList));
for (i = 0; i < 6; ++i) {
sub_0801CFD0(i);
}
@@ -52,7 +52,7 @@ void sub_0801D000(u32 a1) {
CleanUpObjPalettes();
sub_0801CFD0(0xf);
} else {
- if ((gUnk_02001A3C._0_0) == 4) {
+ if (gUnk_02001A3C._0_0 == 4) {
gUnk_02001A3C._0_0 = 0;
gUnk_02001A3C._0_4 = 0;
gUnk_02001A3C._1 = 0;
@@ -106,7 +106,7 @@ s32 FindPalette(u32 a1) {
if (a1 <= 5)
return a1;
- for (index = 6, palette = gPaletteList; index < 0x10; index++) {
+ for (index = 6, palette = gPaletteList; index < ARRAY_COUNT(gPaletteList); index++) {
if (a1 == palette[index]._2) {
return index;
}
@@ -120,7 +120,7 @@ u32 FindFreeObjPalette(u32 a1) {
u32 uVar2;
u32 tmp;
- for (uVar1 = 0, uVar2 = 6; uVar2 < 0x10; uVar2++) {
+ for (uVar1 = 0, uVar2 = 6; uVar2 < ARRAY_COUNT(gPaletteList); uVar2++) {
switch ((gPaletteList[uVar2]._0_0)) {
case 0:
uVar1 = uVar1 + 1;
@@ -134,7 +134,7 @@ u32 FindFreeObjPalette(u32 a1) {
}
}
- for (uVar1 = 0, uVar2 = 6; uVar2 < 0x10; uVar2++) {
+ for (uVar1 = 0, uVar2 = 6; uVar2 < ARRAY_COUNT(gPaletteList); uVar2++) {
switch (gPaletteList[uVar2]._0_0) {
case 0:
case 1:
@@ -250,9 +250,9 @@ void CleanUpObjPalettes(void) {
u32 index2;
Entity* pEVar9;
int iVar10;
- u8 local_24[0x10];
+ u8 local_24[ARRAY_COUNT(gPaletteList)];
- for (index1 = 0; index1 < 0x10; index1++) {
+ for (index1 = 0; index1 < ARRAY_COUNT(gPaletteList); index1++) {
local_24[index1] = index1;
switch (gPaletteList[index1]._0_0) {
case 0:
diff --git a/src/common.c b/src/common.c
index a8ee1736..d4349a6a 100644
--- a/src/common.c
+++ b/src/common.c
@@ -33,7 +33,7 @@ extern void (*gUnk_080C9CAC[])(void);
static void StoreKeyInput(Input* input, u32 keyInput);
void ClearOAM(void);
void ResetScreenRegs(void);
-void sub_0801E0E0(u32);
+void MessageFromFusionTarget(u32);
void sub_0801E24C(s32, s32);
void sub_0801E290(u32, u32, u32);
s32 sub_0801E8B0(u32);
@@ -366,7 +366,7 @@ void DispReset(bool32 refresh) {
ClearOAM();
ResetScreenRegs();
MemClear((void*)0x600C000, 0x20);
- MemClear(gBG0Buffer, 0x800);
+ MemClear(gBG0Buffer, sizeof(gBG0Buffer));
gScreen.bg0.updated = refresh;
}
@@ -534,7 +534,7 @@ void sub_0801DFB4(Entity* entity, u32 textIndex, u32 a3, u32 a4) {
gFuseInfo.ent = entity;
gFuseInfo._3 = gUnk_03003DF0.unk_2;
if (entity != NULL) {
- gFuseInfo._4 = entity->updatePriority;
+ gFuseInfo.prevUpdatePriority = entity->updatePriority;
entity->updatePriority = 2;
}
gFuseInfo._0 = 0;
@@ -546,7 +546,7 @@ u32 sub_0801E00C(void) {
}
void sub_0801E02C(void) {
- sub_0801E0E0(gFuseInfo.textIndex);
+ MessageFromFusionTarget(gFuseInfo.textIndex);
gFuseInfo._0 = 3;
gFuseInfo.action = 1;
}
@@ -572,20 +572,20 @@ void sub_0801E074(void) {
default:
return;
}
- sub_0801E0E0(tmp);
+ MessageFromFusionTarget(tmp);
gFuseInfo.action = 3;
}
void sub_0801E0A0(void) {
if ((gMessage.doTextBox & 0x7f) == 0) {
if (gFuseInfo.ent != NULL) {
- gFuseInfo.ent->updatePriority = gFuseInfo._4;
+ gFuseInfo.ent->updatePriority = gFuseInfo.prevUpdatePriority;
}
gFuseInfo._0 = gFuseInfo._0 == 6 ? 2 : 1;
}
}
-void sub_0801E0E0(u32 textIndex) {
+void MessageFromFusionTarget(u32 textIndex) {
if (textIndex != 0) {
if (gFuseInfo.ent != NULL) {
MessageNoOverlap(textIndex, gFuseInfo.ent);
diff --git a/src/enemy/chuchuBoss.c b/src/enemy/chuchuBoss.c
index d86f012c..ea2eab93 100644
--- a/src/enemy/chuchuBoss.c
+++ b/src/enemy/chuchuBoss.c
@@ -613,7 +613,7 @@ void sub_08026414(ChuchuBossEntity* this) {
Entity* child;
if (this->unk_7c-- == 0) {
- super->z.HALF.HI = 0xff40;
+ super->z.HALF.HI = -192;
child = super->child;
parent = super->parent;
this->unk_68->base.spriteSettings.draw = 1;
diff --git a/src/enemy/enemy64.c b/src/enemy/enemy64.c
index 1c675710..e1b3e51a 100644
--- a/src/enemy/enemy64.c
+++ b/src/enemy/enemy64.c
@@ -29,13 +29,6 @@ typedef struct {
extern void sub_08047EA4(Entity*, u32); // gyorgMale
-extern void (*const Enemy64_Actions[])(Enemy64Entity*);
-extern void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*);
-extern void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*);
-extern void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*);
-extern const u8 gUnk_080D29B8[];
-extern void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*);
-
void sub_080499F0(Enemy64Entity*);
void sub_08049998(Enemy64Entity*, u32);
void Enemy64_Action2_SubAction1(Enemy64Entity*);
@@ -43,8 +36,36 @@ void sub_08049944(Enemy64Entity*);
bool32 sub_08049A8C(Enemy64Entity*);
void sub_08049AB0(Enemy64Entity*);
void sub_08049B20(Enemy64Entity*);
+void Enemy64_Init(Enemy64Entity* this);
+void Enemy64_Action1(Enemy64Entity* this);
+void Enemy64_Action2(Enemy64Entity* this);
+void Enemy64_Action3(Enemy64Entity* this);
+void Enemy64_Action4(Enemy64Entity* this);
+void Enemy64_Action1_SubAction0(Enemy64Entity* this);
+void Enemy64_Action1_SubAction1(Enemy64Entity* this);
+void Enemy64_Action2_SubAction0(Enemy64Entity* this);
+void Enemy64_Action2_SubAction1(Enemy64Entity* this);
+void Enemy64_Action2_SubAction2(Enemy64Entity* this);
+void Enemy64_Action2_SubAction3(Enemy64Entity* this);
+void Enemy64_Action2_SubAction4(Enemy64Entity* this);
+void Enemy64_Action2_SubAction5(Enemy64Entity* this);
+void Enemy64_Action3_SubAction0(Enemy64Entity* this);
+void Enemy64_Action3_SubAction1(Enemy64Entity* this);
+void Enemy64_Action3_SubAction2(Enemy64Entity* this);
+void Enemy64_Action3_SubAction3(Enemy64Entity* this);
+void Enemy64_Action4_SubAction0(Enemy64Entity* this);
+void Enemy64_Action4_SubAction1(Enemy64Entity* this);
+void Enemy64_Action4_SubAction2(Enemy64Entity* this);
+void Enemy64_Action4_SubAction3(Enemy64Entity* this);
+void Enemy64_Action4_SubAction4(Enemy64Entity* this);
+void Enemy64_Action4_SubAction5(Enemy64Entity* this);
+void Enemy64_Action4_SubAction6(Enemy64Entity* this);
+void Enemy64_Action4_SubAction7(Enemy64Entity* this);
void Enemy64(Enemy64Entity* this) {
+ static void (*const Enemy64_Actions[])(Enemy64Entity*) = {
+ Enemy64_Init, Enemy64_Action1, Enemy64_Action2, Enemy64_Action3, Enemy64_Action4,
+ };
if (super->action != 0) {
super->spriteSettings.draw = this->unk_7d;
}
@@ -102,6 +123,10 @@ void Enemy64_Init(Enemy64Entity* this) {
}
void Enemy64_Action1(Enemy64Entity* this) {
+ static void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*) = {
+ Enemy64_Action1_SubAction0,
+ Enemy64_Action1_SubAction1,
+ };
Enemy64_Action1_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -133,6 +158,10 @@ void Enemy64_Action1_SubAction1(Enemy64Entity* this) {
}
void Enemy64_Action2(Enemy64Entity* this) {
+ static void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*) = {
+ Enemy64_Action2_SubAction0, Enemy64_Action2_SubAction1, Enemy64_Action2_SubAction2,
+ Enemy64_Action2_SubAction3, Enemy64_Action2_SubAction4, Enemy64_Action2_SubAction5,
+ };
Enemy64_Action2_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -253,6 +282,12 @@ void Enemy64_Action2_SubAction5(Enemy64Entity* this) {
}
void Enemy64_Action3(Enemy64Entity* this) {
+ static void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*) = {
+ Enemy64_Action3_SubAction0,
+ Enemy64_Action3_SubAction1,
+ Enemy64_Action3_SubAction2,
+ Enemy64_Action3_SubAction3,
+ };
Enemy64_Action3_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -275,10 +310,13 @@ void Enemy64_Action3_SubAction0(Enemy64Entity* this) {
}
void Enemy64_Action3_SubAction1(Enemy64Entity* this) {
+ static const s8 gUnk_080D29B8[] = {
+ 144, 112, 56, 200, 0, 0, 0, 0,
+ };
if (EntityWithinDistance(super, gRoomControls.origin_x + 0xa8, gRoomControls.origin_y + 0x80, 0x28)) {
super->subAction = 2;
super->timer = 45;
- this->unk_74 = gUnk_080D29B8[Random() & 7] << 0x18 >> 0x18;
+ this->unk_74 = gUnk_080D29B8[Random() & 7];
this->unk_76 = super->direction << 8;
}
sub_08049998(this, ((0x100 - super->direction) & 0xff) << 8);
@@ -303,6 +341,10 @@ void Enemy64_Action3_SubAction3(Enemy64Entity* this) {
}
void Enemy64_Action4(Enemy64Entity* this) {
+ static void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*) = {
+ Enemy64_Action4_SubAction0, Enemy64_Action4_SubAction1, Enemy64_Action4_SubAction2, Enemy64_Action4_SubAction3,
+ Enemy64_Action4_SubAction4, Enemy64_Action4_SubAction5, Enemy64_Action4_SubAction6, Enemy64_Action4_SubAction7,
+ };
Enemy64_Action4_SubActions[super->subAction](this);
UpdateAnimationSingleFrame(super);
}
@@ -497,28 +539,3 @@ void sub_08049B20(Enemy64Entity* this) {
gPlayerEntity.y.HALF.HI = (super->y.HALF.HI - tmpY) + gPlayerEntity.y.HALF.HI;
}
}
-
-void (*const Enemy64_Actions[])(Enemy64Entity*) = {
- Enemy64_Init, Enemy64_Action1, Enemy64_Action2, Enemy64_Action3, Enemy64_Action4,
-};
-void (*const Enemy64_Action1_SubActions[])(Enemy64Entity*) = {
- Enemy64_Action1_SubAction0,
- Enemy64_Action1_SubAction1,
-};
-void (*const Enemy64_Action2_SubActions[])(Enemy64Entity*) = {
- Enemy64_Action2_SubAction0, Enemy64_Action2_SubAction1, Enemy64_Action2_SubAction2,
- Enemy64_Action2_SubAction3, Enemy64_Action2_SubAction4, Enemy64_Action2_SubAction5,
-};
-void (*const Enemy64_Action3_SubActions[])(Enemy64Entity*) = {
- Enemy64_Action3_SubAction0,
- Enemy64_Action3_SubAction1,
- Enemy64_Action3_SubAction2,
- Enemy64_Action3_SubAction3,
-};
-const u8 gUnk_080D29B8[] = {
- 144, 112, 56, 200, 0, 0, 0, 0,
-};
-void (*const Enemy64_Action4_SubActions[])(Enemy64Entity*) = {
- Enemy64_Action4_SubAction0, Enemy64_Action4_SubAction1, Enemy64_Action4_SubAction2, Enemy64_Action4_SubAction3,
- Enemy64_Action4_SubAction4, Enemy64_Action4_SubAction5, Enemy64_Action4_SubAction6, Enemy64_Action4_SubAction7,
-};
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index 8f7e01bf..9125158f 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -261,11 +261,11 @@ bool32 LikeLike_StealItem(u32 item) {
bool32 ret = FALSE;
if (GetInventoryValue(item) == 1) {
if (ItemIsShield(gSave.stats.itemButtons[SLOT_A])) {
- gSave.stats.itemButtons[SLOT_A] = 0;
+ gSave.stats.itemButtons[SLOT_A] = ITEM_NONE;
}
if (ItemIsShield(gSave.stats.itemButtons[SLOT_B])) {
- gSave.stats.itemButtons[SLOT_B] = 0;
+ gSave.stats.itemButtons[SLOT_B] = ITEM_NONE;
}
SetInventoryValue(item, 0);
diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c
index cf313f3e..c9343196 100644
--- a/src/enemy/octorokBoss.c
+++ b/src/enemy/octorokBoss.c
@@ -272,7 +272,7 @@ void OctorokBoss_Hit_SubAction6(OctorokBossEntity* this) {
if ((this->unk_80 & 0x80) != 0) {
this->unk_80 -= (Random() & 3);
if ((this->unk_80 & 0x80) == 0) {
- this->unk_80 = ((this->unk_80 & 0x80) << 0x18) >> 0x18;
+ this->unk_80 = 0;
}
} else {
this->unk_80 += (Random() & 3);
diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c
index 8e69fd33..40008e77 100644
--- a/src/enemy/vaatiArm.c
+++ b/src/enemy/vaatiArm.c
@@ -1362,7 +1362,7 @@ static void sub_08043DB0(Entity* this) {
gRoomTransition.field_0x3d = 0x1e - (cVar1 / 0x3c);
gRoomTransition.field_0x3c = this->type2;
pEVar2 = ((VaatiArm_HeapStruct*)this->myHeap)->parent;
- gRoomTransition.hurtType = pEVar2->x.HALF.HI;
+ gRoomTransition.field_0x40 = pEVar2->x.HALF.HI;
gRoomTransition.field_0x42 = pEVar2->y.HALF.HI;
pEVar4 = ((VaatiArm_HeapStruct*)pEVar2->myHeap)->parent;
if (pEVar4 != NULL) {
diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c
index 22df2068..b7c9fd3a 100644
--- a/src/enemy/vaatiWrath.c
+++ b/src/enemy/vaatiWrath.c
@@ -136,7 +136,7 @@ void VaatiWrathType0Action0(Entity* this) {
this->action = 2;
this->timer = 60;
}
- this->x.HALF.HI = gRoomTransition.hurtType;
+ this->x.HALF.HI = gRoomTransition.field_0x40;
this->y.HALF.HI = gRoomTransition.field_0x42;
sub_08042004(this);
} else {
@@ -147,7 +147,7 @@ void VaatiWrathType0Action0(Entity* this) {
this->subAction = bVar1;
this->timer = 120;
this->spritePriority.b1 = 0;
- this->z.HALF.HI = 0xffb0;
+ this->z.HALF.HI = -80;
gRoomControls.camera_target = this;
sub_080809D4();
}
diff --git a/src/enterPortalSubtask.c b/src/enterPortalSubtask.c
index ce6dc548..dcc0c603 100644
--- a/src/enterPortalSubtask.c
+++ b/src/enterPortalSubtask.c
@@ -29,20 +29,20 @@ bool32 sub_0804ACA8(void);
bool32 CheckInitPortal(void) {
if (gArea.portal_in_use) {
gMain.substate = GAMEMAIN_MINISHPORTAL;
- gArea.filler[8] = 0;
- gArea.filler[9] = 0;
- *(u16*)&gArea.filler[10] = 0;
+ gArea.filler3[0] = 0;
+ gArea.filler3[1] = 0;
+ gArea.field_0x10 = 0;
SetInitializationPriority();
- return 1;
+ return TRUE;
} else {
- gArea.filler[18] = gArea.portal_in_use;
- *(vu8*)&gArea.portal_in_use = gArea.portal_in_use;
- return 0;
+ gArea.portal_mode = 0;
+ gArea.portal_in_use = FALSE;
+ return FALSE;
}
}
void GameMain_MinishPortal(void) {
- gUnk_080D4120[gArea.filler[8]]();
+ gUnk_080D4120[gArea.filler3[0]]();
}
void sub_0804AAD4(void) {
@@ -50,7 +50,7 @@ void sub_0804AAD4(void) {
gUnk_02018EB0.unk_14 = NULL;
EraseAllEntities();
CreateObject(MINISH_PORTAL_CLOSEUP, gArea.portal_type, 0);
- gArea.filler[8]++;
+ gArea.filler3[0]++;
}
void sub_0804AB04(void) {
@@ -66,14 +66,14 @@ void sub_0804AB24(void) {
if (!gFadeControl.active) {
gScreen.lcd.displayControl = 0;
sub_0801E104();
- gArea.filler[8] = 0;
+ gArea.filler3[0] = 0;
MenuFadeIn(6, 0);
gFadeControl.active = 0;
}
}
void Subtask_PortalCutscene(void) {
- gUnk_080D412C[gArea.filler[8]]();
+ gUnk_080D412C[gArea.filler3[0]]();
}
void sub_0804AB70(void) {
const u8* ptr;
diff --git a/src/entity.c b/src/entity.c
index 5e3d20bd..5972636e 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -220,7 +220,7 @@ void UpdateManagers(void) {
void EraseAllEntities(void) {
DeleteAllEntities();
- MemClear(&gPriorityHandler, 12);
+ MemClear(&gPriorityHandler, sizeof(PriorityHandler));
MemClear(&gPlayerEntity, 10880);
MemClear(&gUnk_02033290, 2048);
sub_0805E98C();
diff --git a/src/game.c b/src/game.c
index cdfebe13..19740478 100644
--- a/src/game.c
+++ b/src/game.c
@@ -674,14 +674,14 @@ static void sub_08052010(void) {
InitSoundPlayingInfo();
MessageInitialize();
DispReset(1);
- MemClear(gBG1Buffer, 0x800);
- MemClear(gBG2Buffer, 0x800);
+ MemClear(gBG1Buffer, sizeof(gBG1Buffer));
+ MemClear(gBG2Buffer, sizeof(gBG2Buffer));
sub_080A4D34();
LoadPaletteGroup(0xA);
SetColor(0, 0);
LoadGfxGroup(4);
MemClear((void*)0x06000000, 0x20);
- MemClear(&gMenu, 0x30);
+ MemClear(&gGenericMenu, sizeof(gGenericMenu));
gScreen.lcd.displayControl |= DISPCNT_OBJ_ON;
gScreen.bg1.control = BGCNT_PRIORITY(1) | BGCNT_SCREENBASE(28) | BGCNT_CHARBASE(0);
gScreen.bg2.control = BGCNT_PRIORITY(1) | BGCNT_SCREENBASE(29) | BGCNT_CHARBASE(1);
@@ -923,7 +923,7 @@ void SetPopupState(u32 type, u32 choice_idx) {
.draw_border = 0,
.border_type = 0,
.fill_type = 6,
- ._15 = 4,
+ .charColor = 4,
._16 = 1,
.stylized = 0,
};
@@ -1348,9 +1348,9 @@ static void CreateMiscManager(void) {
static void sub_08052C3C(void) {
if (gArea.portal_mode == 0)
- gArea.unk1A = gArea.portal_mode;
- if (gArea.unk1A) {
- gArea.unk1A--;
+ gArea.portal_timer = 0;
+ if (gArea.portal_timer) {
+ gArea.portal_timer--;
gArea.portal_mode = 0;
}
}
@@ -1388,8 +1388,8 @@ void InitRoom(void) {
gArea.locationIndex = a_hdr->location;
gArea.dungeon_idx = a_hdr->location - 23;
gArea.localFlagOffset = gLocalFlagBanks[a_hdr->flag_bank];
- gArea.filler[0] = a_hdr->flag_bank;
- gArea.unk1A = 180;
+ gArea.flag_bank = a_hdr->flag_bank;
+ gArea.portal_timer = 180;
gArea.lightLevel = 256;
InitRoomTransition();
InitAllRoomResInfo();
@@ -2483,9 +2483,9 @@ void PutItemOnSlot(u32 itemID) {
}
if (itemID2 - 1 < 0x1f) {
itemSlot = 2;
- if (gSave.stats.itemButtons[SLOT_A] == 0) {
+ if (gSave.stats.itemButtons[SLOT_A] == ITEM_NONE) {
itemSlot = 0;
- } else if (gSave.stats.itemButtons[SLOT_B] == 0) {
+ } else if (gSave.stats.itemButtons[SLOT_B] == ITEM_NONE) {
itemSlot = 1;
}
if (itemSlot == 2) {
@@ -2527,13 +2527,10 @@ void ForceEquipItem(u32 itemID, u32 itemSlot) {
u32 SetBottleContents(u32 itemID, u32 bottleIndex) {
if (bottleIndex > 3) {
bottleIndex = 0;
- if (gSave.stats.bottles[0] != 0x20) {
- do {
- bottleIndex++;
- if (bottleIndex > 3) {
- return bottleIndex;
- }
- } while (gSave.stats.bottles[bottleIndex] != 0x20);
+ for (bottleIndex = 0; gSave.stats.bottles[bottleIndex] != ITEM_BOTTLE_EMPTY;) {
+ if (++bottleIndex > 3) {
+ return bottleIndex;
+ }
}
if (bottleIndex > 3) {
return bottleIndex;
@@ -2558,23 +2555,23 @@ bool32 ItemIsSword(u32 item) {
bool32 ItemIsShield(u32 id) {
switch (id) {
- case 13:
- case 14:
- return 1;
+ case ITEM_SHIELD:
+ case ITEM_MIRROR_SHIELD:
+ return TRUE;
default:
- return 0;
+ return FALSE;
}
}
bool32 ItemIsBottle(u32 id) {
switch (id) {
- case 28:
- case 29:
- case 30:
- case 31:
- return 1;
+ case ITEM_BOTTLE1:
+ case ITEM_BOTTLE2:
+ case ITEM_BOTTLE3:
+ case ITEM_BOTTLE4:
+ return TRUE;
default:
- return 0;
+ return FALSE;
}
}
@@ -2604,15 +2601,15 @@ void sub_08054524(void) {
}
bVar1 = gUnk_080FE1C6[bVar1];
- MemCopy(&gAreaDroptables[bVar1], &gRoomVars.currentAreaDroptable, 0x20);
+ MemCopy(&gAreaDroptables[bVar1], &gRoomVars.currentAreaDroptable, sizeof(Droptable));
}
-void sub_08054564(void) {
- gRoomVars.field_0x2 = 1;
+void DisableRandomDrops(void) {
+ gRoomVars.randomDropsDisabled = TRUE;
}
-void sub_08054570(void) {
- gRoomVars.field_0x2 = 0;
+void EnableRandomDrops(void) {
+ gRoomVars.randomDropsDisabled = FALSE;
}
extern void sub_08000F14(s16*, const s16*, const s16*, const s16*);
@@ -2630,7 +2627,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
const Droptable *ptr2, *ptr3, *ptr4;
Droptable droptable;
r3 = arg1;
- if (gRoomVars.field_0x2 != 1) {
+ if (gRoomVars.randomDropsDisabled != TRUE) {
ptr2 = &gDroptableModifiers[DROPTABLE_NONE];
ptr4 = NULL;
switch (r3) {
diff --git a/src/interrupts.c b/src/interrupts.c
index 7d5c162d..84784698 100644
--- a/src/interrupts.c
+++ b/src/interrupts.c
@@ -232,7 +232,7 @@ static void HandlePlayerLife(Entity* this) {
if ((gPlayerEntity.contactFlags & 0x80) && (gPlayerEntity.iframes > 0))
SoundReq(SFX_86);
- gPlayerState.flags &= ~(PL_FALLING | PL_FLAGS2000000);
+ gPlayerState.flags &= ~(PL_FALLING | PL_CONVEYOR_PUSHED);
if (gPlayerState.flags & PL_BURNING)
ResetPlayerItem();
if ((gPlayerState.flags & PL_CLONING) && gPlayerState.chargeState.action == 0)
@@ -332,7 +332,7 @@ static void sub_080171F0(void) {
gPlayerState.mobility = 0;
gPlayerState.speed_modifier = 0;
gPlayerState.field_0xaa = 0;
- MemClear(&gCarriedEntity, 0x8c);
+ MemClear(&gCarriedEntity, sizeof(gCarriedEntity));
gPlayerEntity.spriteOffsetY = gPlayerState.spriteOffsetY;
gPlayerState.spriteOffsetY = 0;
sub_0807B0C8();
diff --git a/src/kinstone.c b/src/kinstone.c
index c019a623..49d1ac00 100644
--- a/src/kinstone.c
+++ b/src/kinstone.c
@@ -73,7 +73,7 @@ void sub_0801855C(void) {
// TODO: Figure out what is up with the pointer assignment
struct_gUnk_080B3D20* pcVar2 = (struct_gUnk_080B3D20*)&gArea.unk28;
- MemClear(pcVar2, 0x14);
+ MemClear(pcVar2, sizeof(struct_area_28));
ptr = (struct_area_28*)pcVar2;
for (pcVar2 = gUnk_080B3D20, bVar3 = 0; pcVar2->unk0 != 0xff; pcVar2++) {
if (sub_080185B4(pcVar2)) {
diff --git a/src/manager/delayedEntityLoadManager.c b/src/manager/delayedEntityLoadManager.c
index f113330a..de9a8390 100644
--- a/src/manager/delayedEntityLoadManager.c
+++ b/src/manager/delayedEntityLoadManager.c
@@ -36,7 +36,7 @@ void DelayedEntityLoadManager_Main(DelayedEntityLoadManager* this) {
}
if (super->action == 0) {
super->action++;
- this->unk_20 = gArea.filler[2];
+ this->unk_20 = gArea.filler[1];
SetDefaultPriority((Entity*)this, 6);
npcPtr = gNPCData;
npcPtr += (super->type2 + this->unk_20);
diff --git a/src/manager/fightManager.c b/src/manager/fightManager.c
index 3459bbd8..1ac77f67 100644
--- a/src/manager/fightManager.c
+++ b/src/manager/fightManager.c
@@ -65,8 +65,8 @@ void FightManager_WaitForFlag(FightManager* this) {
if (CheckFlags(this->fightStartFlag)) {
FightManager_LoadFight(this);
if (!this->unk_35) {
- tmp = gRoomVars.field_0x9 ? gRoomVars.field_0x9 : 0x33;
- this->unk_20 = gArea.bgm;
+ tmp = gRoomVars.fight_bgm ? gRoomVars.fight_bgm : BGM_FIGHT_THEME2;
+ this->prevBgm = gArea.bgm;
gArea.bgm = tmp;
SoundReq(tmp);
}
@@ -84,7 +84,7 @@ void FightManager_WaitForDone(FightManager* this) {
// restore music (if it was set, which apparently is only possible if there's a flag the fight waited for)
if (this->fightStartFlag) {
if (!this->unk_35) {
- gArea.bgm = this->unk_20;
+ gArea.bgm = this->prevBgm;
SoundReq(gArea.bgm);
sub_0801855C();
}
@@ -138,7 +138,7 @@ FightManagerHelper* FightManager_CreateHelper(FightManager* this) {
extra->base.type = 1;
extra->base.parent = (Entity*)this;
super->timer++;
- MemClear(&extra->enemies, 0x20);
+ MemClear(&extra->enemies, sizeof(extra->enemies));
AppendEntityToList((Entity*)extra, 8);
}
return extra;
diff --git a/src/manager/hyruleTownBellManager.c b/src/manager/hyruleTownBellManager.c
index bc8eb795..c22442dc 100644
--- a/src/manager/hyruleTownBellManager.c
+++ b/src/manager/hyruleTownBellManager.c
@@ -28,7 +28,7 @@ void HyruleTownBellManager_Main(HyruleTownBellManager* this) {
if (object != NULL) {
object->x.HALF.HI = roomControls->origin_x + 0x1f8;
object->y.HALF.HI = roomControls->origin_y + 0x140;
- object->z.HALF.HI = 0xffe8;
+ object->z.HALF.HI = -24;
}
DeleteThisEntity();
}
diff --git a/src/manager/vaati3StartManager.c b/src/manager/vaati3StartManager.c
index 9f727808..f088d9a4 100644
--- a/src/manager/vaati3StartManager.c
+++ b/src/manager/vaati3StartManager.c
@@ -140,7 +140,7 @@ void Vaati3StartManager_Type1_Init(Vaati3StartManager* this) {
super->child = enemy;
super->action = 1;
SetPlayerControl(3);
- gArea.queued_bgm = 0x80010000;
+ gArea.queued_bgm = SONG_STOP_ALL;
SetFade(FADE_BLACK_WHITE | FADE_INSTANT, 4);
SoundReq(SFX_APPARATE);
}
diff --git a/src/manager/weatherChangeManager.c b/src/manager/weatherChangeManager.c
index c6c0c3d1..b74edcc2 100644
--- a/src/manager/weatherChangeManager.c
+++ b/src/manager/weatherChangeManager.c
@@ -70,15 +70,15 @@ void sub_08059608(WeatherChangeManager* this) {
return;
}
if (sub_0805986C()) {
- if (gArea.queued_bgm != 0x1E) {
- gArea.queued_bgm = 0x1E;
+ if (gArea.queued_bgm != BGM_CRENEL_STORM) {
+ gArea.queued_bgm = BGM_CRENEL_STORM;
this->unk_23 = 0x78;
SoundReq(SONG_FADE_OUT_BGM);
}
return;
}
- if (gArea.queued_bgm != 0x37) {
- gArea.queued_bgm = 0x37;
+ if (gArea.queued_bgm != BGM_MT_CRENEL) {
+ gArea.queued_bgm = BGM_MT_CRENEL;
this->unk_23 = 0x78;
SoundReq(SONG_FADE_OUT_BGM);
}
@@ -214,6 +214,6 @@ void sub_08059960(const u16* unk1, const u16* unk2, u16* unk3, u8 unk4) {
void sub_08059994(void) {
if (sub_0805986C()) {
LoadPaletteGroup(0x5B);
- gArea.queued_bgm = 0x1E;
+ gArea.queued_bgm = BGM_CRENEL_STORM;
}
}
diff --git a/src/menu/figurine_menu.c b/src/menu/figurine_menu.c
index 7506116f..4a558423 100644
--- a/src/menu/figurine_menu.c
+++ b/src/menu/figurine_menu.c
@@ -101,8 +101,8 @@ void FigurineMenu_080A4608(void) {
sub_080A4DA8(3);
SetColor(0, gPaletteBuffer[0xfb]);
SetColor(0x15c, gPaletteBuffer[0xd3]);
- MemClear(&gBG0Buffer, 0x800);
- MemClear(&gBG3Buffer, 0x1000);
+ MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
+ MemClear(&gBG3Buffer, sizeof(gBG3Buffer));
gScreen.controls.window0HorizontalDimensions = DISPLAY_WIDTH;
gScreen.controls.window0VerticalDimensions = 0x7898;
gScreen.controls.windowInsideControl = 0x1f;
@@ -534,8 +534,8 @@ u32 sub_080A4CBC(u32 param_1) {
if (gFigurineMenu.unk1a != param_1) {
gFigurineMenu.unk1a = param_1;
- MemClear(&gBG1Buffer, 0x800);
- MemCopy(&gBG1Buffer, (void*)0x600e000, 0x800);
+ MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
+ MemCopy(&gBG1Buffer, (void*)0x600e000, sizeof(gBG1Buffer));
iVar1 = sub_080A4948(param_1);
if (iVar1 != 0) {
sub_0805F46C(param_1 + 0x900, &gUnk_08128190);
@@ -589,9 +589,9 @@ void sub_080A4DB8(u32 param_1) {
const struct_08128AD8* ptr;
DisableVBlankDMA();
- MemClear(&gBG0Buffer, 0x800);
- MemClear(&gBG1Buffer, 0x800);
- MemClear(&gBG2Buffer, 0x800);
+ MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
+ MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
+ MemClear(&gBG2Buffer, sizeof(gBG2Buffer));
MemClear(gUnk_0200AF00.elements, sizeof(gUnk_0200AF00.elements));
MemClear(&gFigurineMenu, sizeof(gFigurineMenu));
gFigurineMenu.unk2e = -1;
diff --git a/src/menu/pause_menu.c b/src/menu/pause_menu.c
index 6a64c87d..0d16d8cc 100644
--- a/src/menu/pause_menu.c
+++ b/src/menu/pause_menu.c
@@ -148,7 +148,7 @@ void PauseMenu_Variant2(void) {
sub_080A4E90(6);
} else {
sub_080A4E90(3);
- MemClear(&gBG0Buffer, 0x800);
+ MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
gScreen.bg0.updated = 1;
}
}
@@ -527,14 +527,14 @@ void PauseMenu_ItemMenu_Draw(void) {
gOamCmd._8 = 0x800;
DrawDirect(sub_080A5384_draw_constant0, 0x22);
}
- i = GetMenuSlotForItem(gSave.stats.itemButtons[0]);
+ i = GetMenuSlotForItem(gSave.stats.itemButtons[SLOT_A]);
if (i < MENU_SLOT_COUNT) {
entry = &gItemMenuTable[i];
gOamCmd.x = entry->x;
gOamCmd.y = entry->y;
DrawDirect(sub_080A5384_draw_constant0, 3);
}
- i = GetMenuSlotForItem(gSave.stats.itemButtons[1]);
+ i = GetMenuSlotForItem(gSave.stats.itemButtons[SLOT_B]);
if (i < MENU_SLOT_COUNT) {
entry = &gItemMenuTable[i];
gOamCmd.x = entry->x;
diff --git a/src/npc/beedle.c b/src/npc/beedle.c
index 68f6d30c..b9c562ee 100644
--- a/src/npc/beedle.c
+++ b/src/npc/beedle.c
@@ -6,6 +6,7 @@
#include "npc.h"
#include "game.h"
#include "functions.h"
+#include "item.h"
typedef struct {
s8 unk_00;
@@ -24,7 +25,14 @@ void sub_0806336C(Entity* this);
void sub_08063390(Entity* this);
static const u8 gUnk_0810C88C[] = {
- 0, 0x2d, 0x2c, 0x29, 0x2a, 0x2b, 0x2e, 0,
+ ITEM_NONE,
+ ITEM_BOTTLE_PICOLYTE_BLUE,
+ ITEM_BOTTLE_PICOLYTE_GREEN,
+ ITEM_BOTTLE_PICOLYTE_RED,
+ ITEM_BOTTLE_PICOLYTE_ORANGE,
+ ITEM_BOTTLE_PICOLYTE_YELLOW,
+ ITEM_BOTTLE_PICOLYTE_WHITE,
+ ITEM_NONE,
};
static const Hitbox gUnk_0810C894 = { 0, 0, { 0, 0, 0, 0 }, 16, 6 };
static const gUnk_0810C89C_struct gUnk_0810C89C[] = {
diff --git a/src/npc/bigGoron.c b/src/npc/bigGoron.c
index e7208579..e94a54ff 100644
--- a/src/npc/bigGoron.c
+++ b/src/npc/bigGoron.c
@@ -423,7 +423,7 @@ void sub_0806D5D4(void) {
InitBiggoronTimer();
itemSlot = IsItemEquipped(ITEM_SHIELD);
if (itemSlot != 2) {
- gSave.stats.itemButtons[itemSlot] = 0;
+ gSave.stats.itemButtons[itemSlot] = ITEM_NONE;
}
SetInventoryValue(ITEM_SHIELD, 0);
}
diff --git a/src/object/barrelInside.c b/src/object/barrelInside.c
index 9c67eeb4..3ef99da4 100644
--- a/src/object/barrelInside.c
+++ b/src/object/barrelInside.c
@@ -6,38 +6,40 @@
*/
#include "entity.h"
-const u8 gUnk_08120C80[];
-const u8 gUnk_08120C92[];
+typedef struct {
+ u8 b3Rendering;
+ u8 b0Priority;
+ u8 flipY;
+} PACKED BarrelInsideSpriteDef;
void BarrelInside(Entity* this) {
- const u8* ptr;
+ static const BarrelInsideSpriteDef spriteDefs[] = {
+ { 2, 5, 2 }, { 2, 5, 2 }, { 3, 4, 2 }, { 3, 6, 3 }, { 3, 5, 3 }, { 3, 6, 3 },
+ };
+
+ static const u8 frameIndices[] = {
+ 4, 6, 7, 0, 0, 0,
+ };
+ const BarrelInsideSpriteDef* ptr;
if (this->action == 0) {
this->action = 1;
this->spriteSettings.draw = 1;
this->frameIndex = this->type;
this->timer = 16;
this->subtimer = 1;
- ptr = gUnk_08120C80 + this->type * 3;
- this->spriteRendering.b3 = *ptr;
- this->spritePriority.b0 = *(ptr + 1);
- this->spriteOrientation.flipY = *(ptr + 2);
+ ptr = &spriteDefs[this->type];
+ this->spriteRendering.b3 = ptr->b3Rendering;
+ this->spritePriority.b0 = ptr->b0Priority;
+ this->spriteOrientation.flipY = ptr->flipY;
}
if (this->type == 4) {
if (--this->timer == 0) {
this->timer = 16;
- this->frameIndex = gUnk_08120C92[this->subtimer++];
+ this->frameIndex = frameIndices[this->subtimer++];
if (this->subtimer == 3) {
this->subtimer = 0;
}
}
}
}
-
-const u8 gUnk_08120C80[] = {
- 2, 5, 2, 2, 5, 2, 3, 4, 2, 3, 6, 3, 3, 5, 3, 3, 6, 3,
-};
-
-const u8 gUnk_08120C92[] = {
- 4, 6, 7, 0, 0, 0,
-};
diff --git a/src/object/enemyItem.c b/src/object/enemyItem.c
index 5a238b52..862f184e 100644
--- a/src/object/enemyItem.c
+++ b/src/object/enemyItem.c
@@ -43,7 +43,7 @@ void EnemyItem(EnemyItemEntity* this) {
if (super->child == NULL) {
sub_080A2534(this);
}
- sub_08054564();
+ DisableRandomDrops();
}
entity = super->child;
if (entity != NULL) {
diff --git a/src/object/fairy.c b/src/object/fairy.c
index 91cda244..8b177ced 100644
--- a/src/object/fairy.c
+++ b/src/object/fairy.c
@@ -214,7 +214,7 @@ void Fairy_Action4(FairyEntity* this) {
}
if (--super->subtimer == 0) {
super->subtimer = 6;
- if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) {
+ if (--super->spriteOffsetY < -0x16) {
sub_08081404(super, 1);
}
}
diff --git a/src/object/fourElements.c b/src/object/fourElements.c
index 1a8f5240..ef79e2f0 100644
--- a/src/object/fourElements.c
+++ b/src/object/fourElements.c
@@ -51,7 +51,7 @@ void FourElements_Init(FourElementsEntity* this) {
super->spritePriority.b1 = 2;
super->spriteRendering.b3 = 1;
super->hitbox = (Hitbox*)&gHitbox_6;
- super->z.HALF.HI = 0xff40;
+ super->z.HALF.HI = -192;
this->unk_6a = 0x40;
switch (super->type) {
case 0x41:
@@ -157,10 +157,10 @@ void sub_080A0424(FourElementsEntity* this) {
}
void sub_080A0444(FourElementsEntity* this) {
- static const u8 gUnk_081248B4[] = {
- 249, 248, 247, 246, 245, 246, 247, 248,
+ static const s8 gUnk_081248B4[] = {
+ -7, -8, -9, -10, -11, -10, -9, -8,
};
- super->z.HALF.HI = gUnk_081248B4[(super->subtimer++ >> 3) & 7] << 0x18 >> 0x18;
+ super->z.HALF.HI = gUnk_081248B4[(super->subtimer++ >> 3) & 7];
}
void sub_080A0464(FourElementsEntity* this, ScriptExecutionContext* context) {
diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c
index 4d497b72..5415125e 100644
--- a/src/object/frozenOctorok.c
+++ b/src/object/frozenOctorok.c
@@ -344,7 +344,7 @@ void sub_0809CB70(FrozenOctorokEntity* this, s32 angle, s32 radius) {
NONMATCH("asm/non_matching/frozenOctorok/sub_0809CBE4.inc", void sub_0809CBE4(FrozenOctorokEntity* this)) {
this->unk_79 += super->subtimer;
if ((s8)super->subtimer < 0) {
- if (super->timer < -(this->unk_79 << 0x18 >> 0x18)) {
+ if (super->timer < -this->unk_79) {
super->subtimer = -super->subtimer;
SoundReq(SFX_19E);
}
diff --git a/src/object/gleerokParticle.c b/src/object/gleerokParticle.c
index e878f2a1..0ab61153 100644
--- a/src/object/gleerokParticle.c
+++ b/src/object/gleerokParticle.c
@@ -130,12 +130,12 @@ void GleerokParticle_Init(GleerokParticleEntity* this) {
this->unk7c = 0xce;
this->unk74 = 0;
if ((ptr->unk4 & 0x40) != 0) {
- this->unk80.HALF.HI = 0xff00;
+ this->unk80.HALF.HI = -0x100;
} else {
this->unk80.HALF.HI = 0x100;
}
if ((ptr->unk4 & 0x80) != 0) {
- this->unk84.HALF.HI = 0xff00;
+ this->unk84.HALF.HI = -0x100;
} else {
this->unk84.HALF.HI = 0x100;
}
diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c
index d9f44c6d..8652b3c4 100644
--- a/src/object/gyorgBossObject.c
+++ b/src/object/gyorgBossObject.c
@@ -102,7 +102,7 @@ void GyorgBossObject_SetupStart(GyorgBossObjectEntity* this) {
this->unk_76 = 0xc0;
this->unk_78 = 0xc0;
gRoomTransition.field_0x39 = 1;
- gPlayerState.flags |= PL_FLAGS20000;
+ gPlayerState.flags |= PL_GYORG_FIGHT;
gPlayerState.startPosX = gRoomControls.origin_x + 0x200;
gPlayerState.startPosY = gRoomControls.origin_y + 0x210;
#ifndef EU
@@ -238,7 +238,7 @@ void GyorgBossObject_FemalePhase4(GyorgBossObjectEntity* this) {
this->timer = 420;
super->direction = 0;
super->speed = 0x60;
- gPlayerState.flags &= ~PL_FLAGS20000;
+ gPlayerState.flags &= ~PL_GYORG_FIGHT;
CopyPosition(&gPlayerEntity, super);
gRoomControls.camera_target = super;
SetPlayerControl(2);
diff --git a/src/object/keyStealingTakkuri.c b/src/object/keyStealingTakkuri.c
index 1cc970ca..1b166cab 100644
--- a/src/object/keyStealingTakkuri.c
+++ b/src/object/keyStealingTakkuri.c
@@ -284,7 +284,7 @@ void KeyStealingTakkuri_Type3_Init(KeyStealingTakkuriEntity* this) {
ptr = &gUnk_08124132[super->type2 * 2];
super->x.HALF.HI = gRoomControls.origin_x + ptr[0];
super->y.HALF.HI = gRoomControls.origin_y + ptr[1] + 0x40;
- super->z.HALF.HI = 0xffc0;
+ super->z.HALF.HI = -64;
UpdateSpriteForCollisionLayer(super);
InitAnimationForceUpdate(super, gUnk_08124128[super->type2]);
obj = CreateObject(KEY_STEALING_TAKKURI, 1, 0);
diff --git a/src/object/ladderUp.c b/src/object/ladderUp.c
index 1264763e..8743fadc 100644
--- a/src/object/ladderUp.c
+++ b/src/object/ladderUp.c
@@ -31,7 +31,7 @@ void LadderUp(Entity* this) {
this->spriteOffsetY += 8;
InitializeAnimation(this, 10);
if (this->action == 1) {
- this->z.HALF.HI = 0xff80;
+ this->z.HALF.HI = -0x80;
}
if (this->type2) {
return;
diff --git a/src/object/lavaPlatform.c b/src/object/lavaPlatform.c
index 016e0e7e..a79e8c4f 100644
--- a/src/object/lavaPlatform.c
+++ b/src/object/lavaPlatform.c
@@ -127,7 +127,7 @@ void LavaPlatform_Type1Action1(LavaPlatformEntity* this) {
super->animationState ^= 1;
InitializeAnimation(super, (u32)super->animationState);
}
- if (--super->spriteOffsetY * 0x1000000 >> 0x18 == -3) {
+ if (--super->spriteOffsetY == -3) {
sub_0809264C(this);
}
}
diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c
index 71a1f443..e03dd38f 100644
--- a/src/object/lilypadLarge.c
+++ b/src/object/lilypadLarge.c
@@ -372,12 +372,12 @@ void sub_08085A98(LilypadLargeEntity* this) {
super->subAction = 2;
if (gArea.locationIndex == 0x1b) {
super->y.HALF.HI += 0xd0;
- super->z.HALF.HI = 0xff30;
+ super->z.HALF.HI = -0xd0;
this->unk_82 = 0x46;
SetLocalFlag(0x73);
} else {
super->y.HALF.HI += 0x40;
- super->z.HALF.HI = 0xffc0;
+ super->z.HALF.HI = -0x40;
this->unk_82 = 0xf;
}
CreateObjectWithParent(super, LILYPAD_LARGE_FALLING, 0, 0);
diff --git a/src/object/linkHoldingItem.c b/src/object/linkHoldingItem.c
index 7f536b5f..d3a98df9 100644
--- a/src/object/linkHoldingItem.c
+++ b/src/object/linkHoldingItem.c
@@ -62,10 +62,10 @@ void LinkHoldingItem_Action1(LinkHoldingItemEntity* this) {
case 1:
this->unk_68 = GiveItem(super->type, super->type2);
switch (super->type) {
- case 0x40:
- case 0x41:
- case 0x42:
- case 0x43:
+ case ITEM_EARTH_ELEMENT:
+ case ITEM_FIRE_ELEMENT:
+ case ITEM_WATER_ELEMENT:
+ case ITEM_WIND_ELEMENT:
break;
default:
SoundReq(SFX_ITEM_GET);
@@ -78,7 +78,7 @@ void LinkHoldingItem_Action1(LinkHoldingItemEntity* this) {
SoundReq(SFX_ITEM_GET);
break;
case 5:
- tmp = GetInventoryValue((u32)super->type);
+ tmp = GetInventoryValue(super->type);
ptr = &gItemMetaData[super->type];
if (tmp == 0) {
this->unk_68 = *(u16*)&ptr->textId;
@@ -109,10 +109,10 @@ void LinkHoldingItem_Action2(LinkHoldingItemEntity* this) {
messageIndex = this->unk_68;
if (messageIndex != 0) {
switch (super->type) {
- case 0x63:
+ case ITEM_HEART_PIECE:
messageIndex += gSave.stats.heartPieces;
break;
- case 0x3f:
+ case ITEM_SHELLS:
if (super->type2 > 1) {
if (messageIndex == TEXT_INDEX(TEXT_ITEM_GET, 0x77)) {
messageIndex--;
@@ -138,11 +138,11 @@ void LinkHoldingItem_Action3(LinkHoldingItemEntity* this) {
case 0:
case 1:
case 2:
- if (super->type != 0x62) {
- if (super->type != 0x63) {
+ if (super->type != ITEM_HEART_CONTAINER) {
+ if (super->type != ITEM_HEART_PIECE) {
break;
}
- ModHealth(0xa0);
+ ModHealth(160);
gSave.stats.heartPieces++;
if (gSave.stats.heartPieces < 4) {
break;
@@ -150,15 +150,15 @@ void LinkHoldingItem_Action3(LinkHoldingItemEntity* this) {
gSave.stats.heartPieces = 0;
}
gSave.stats.maxHealth += 8;
- if (gSave.stats.maxHealth > 0xa0) {
- gSave.stats.maxHealth = 0xa0;
+ if (gSave.stats.maxHealth > 160) {
+ gSave.stats.maxHealth = 160;
}
- ModHealth(0xa0);
+ ModHealth(160);
break;
case 3:
tmp = GetBottleContaining(super->type);
if (tmp != 0) {
- gSave.stats.itemButtons[tmp + 1] = 0x20;
+ gSave.stats.itemButtons[tmp + 1] = ITEM_BOTTLE_EMPTY;
} else {
SetInventoryValue(super->type, ITEM_GREEN_SWORD);
}
diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c
index 71a2eb9b..79921a39 100644
--- a/src/object/macroPlayer.c
+++ b/src/object/macroPlayer.c
@@ -113,7 +113,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) {
super->spriteOrientation.flipY = 2;
this->unk68.HWORD = 0x114;
super->animIndex = 0xff;
- super->z.HALF.HI = 0xff50;
+ super->z.HALF.HI = -0xb0;
this->unk6a = 4;
super->spriteRendering.b0 = 3;
SetAffineInfo(super, 4, 4, 0);
diff --git a/src/object/minishPortalCloseup.c b/src/object/minishPortalCloseup.c
index 6b6877b0..f0e3c8c4 100644
--- a/src/object/minishPortalCloseup.c
+++ b/src/object/minishPortalCloseup.c
@@ -85,7 +85,7 @@ void sub_0808D030(void) {
s32 index;
ptr = gOAMControls.oam;
- index = 0x80;
+ index = ARRAY_COUNT(gOAMControls.oam);
MemClear(&gOAMControls, 0xb74);
while (index != 0) {
// TODO split up into bitfield writes?
diff --git a/src/object/object30.c b/src/object/object30.c
index dc304585..196a3bc4 100644
--- a/src/object/object30.c
+++ b/src/object/object30.c
@@ -67,10 +67,9 @@ void Object30_Action1(Object30Entity* this) {
}
void Object30_Action2(Object30Entity* this) {
- static const u8 gUnk_08121194[] = {
- 249, 248, 247, 246, 245, 246, 247, 248,
+ static const s8 gUnk_08121194[] = {
+ -7, -8, -9, -10, -11, -10, -9, -8,
};
- u8 tmp;
switch (super->type) {
case 0:
if (this->gravity != 0) {
@@ -90,8 +89,7 @@ void Object30_Action2(Object30Entity* this) {
}
// fallthrough
case 1:
- tmp = gUnk_08121194[(super->subtimer++ >> 3) & 7];
- super->z.HALF.HI = tmp << 0x18 >> 0x18;
+ super->z.HALF.HI = gUnk_08121194[(super->subtimer++ >> 3) & 7];
if (!IsCollidingPlayer(super)) {
return;
}
diff --git a/src/object/objectA8.c b/src/object/objectA8.c
index 05845e66..fcaf3966 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -217,7 +217,7 @@ void ObjectA8_Action6(ObjectA8Entity* this) {
}
if (--super->subtimer == 0) {
super->subtimer = 6;
- if (((--super->spriteOffsetY) * 0x1000000) >> 0x18 < -0x16) {
+ if (--super->spriteOffsetY < -0x16) {
sub_08081404(super, 1);
}
}
diff --git a/src/object/whirlwind.c b/src/object/whirlwind.c
index b7933500..0193f063 100644
--- a/src/object/whirlwind.c
+++ b/src/object/whirlwind.c
@@ -46,7 +46,7 @@ void Whirlwind_Init(Entity* this) {
ChangeObjPalette(this, 0x161);
InitializeAnimation(this, 1);
} else {
- this->z.HALF.HI = 0xffe8;
+ this->z.HALF.HI = -24;
InitializeAnimation(this, 1);
}
if ((this->flags & ENT_SCRIPTED) != 0) {
diff --git a/src/physics.c b/src/physics.c
index 5d7b8c58..cd09c05b 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -26,12 +26,12 @@ static void sub_0806FEFC(struct_gUnk_020000C0_1*, Entity*);
static bool32 sub_0807007C(struct_gUnk_020000C0*, u32);
void sub_0806F364(void) {
- gArea.filler[2] ^= 0x80;
- MemClear(&gArea.filler6[(gArea.filler[2] + 7) / 8], 16);
+ gArea.filler[1] ^= 0x80;
+ MemClear(&gArea.filler6[(gArea.filler[1] + 7) / 8], 16);
}
void sub_0806F38C(void) {
- gArea.filler[2] ^= 0x80;
+ gArea.filler[1] ^= 0x80;
}
u32 sub_0806F39C(Entity* ent) {
diff --git a/src/player.c b/src/player.c
index 22fbeb95..c5299bc1 100644
--- a/src/player.c
+++ b/src/player.c
@@ -522,7 +522,7 @@ static void PlayerNormal(Entity* this) {
gPlayerState.framestate = PL_STATE_SWIM;
sub_0807ACCC(this);
} else {
- if ((gPlayerState.flags & PL_FLAGS2000000) == 0)
+ if ((gPlayerState.flags & PL_CONVEYOR_PUSHED) == 0)
this->spritePriority.b1 = 1;
if (gPlayerState.dash_state & 0x40) {
sub_08008AA0(this);
@@ -1257,7 +1257,7 @@ static void sub_080717F8(Entity* this) {
this->animationState = gArea.portal_exit_dir << 1;
this->x.HALF.HI = gArea.portal_x + sOffsets[gArea.portal_exit_dir * 2];
this->y.HALF.HI = gArea.portal_y + sOffsets[gArea.portal_exit_dir * 2 + 1];
- gArea.unk1A = 0xb4;
+ gArea.portal_timer = 180;
gPauseMenuOptions.disabled = 0;
this->action = PLAYER_MINISH;
this->subAction = 0;
@@ -1551,7 +1551,7 @@ static void sub_08071D04(Entity* this) {
return;
deltaHealth = 0;
- idx = GetBottleContaining(0x28);
+ idx = GetBottleContaining(ITEM_BOTTLE_FAIRY);
if (idx != 0) {
gSave.stats.bottles[idx - 1] = 0x20;
CreateObject(FAIRY, 0x60, 2);
@@ -3783,7 +3783,7 @@ static void conveyer_push(Entity* this) {
ResetPlayerItem();
this->spritePriority.b1 = 0;
this->speed = WALK_SPEED;
- gPlayerState.flags |= PL_FLAGS2000000;
+ gPlayerState.flags |= PL_CONVEYOR_PUSHED;
gPlayerState.field_0xa |= 0x80;
gPlayerState.mobility |= 0x80;
gPlayerState.field_0x27[0]++;
diff --git a/src/playerItemUtils.c b/src/playerItemUtils.c
index 6ed9e1f2..f6a4d67c 100644
--- a/src/playerItemUtils.c
+++ b/src/playerItemUtils.c
@@ -30,15 +30,15 @@ void InitItemGetSequence(u32 type, u32 type2, u32 delay) {
}
}
-static Entity* GiveItemWithCutscene(u32 type, u32 type2, u32 delay) {
+static Entity* GiveItemWithCutscene(u32 item, u32 type2, u32 delay) {
Entity* e;
- if (type == ITEM_SHELLS && gSave.stats.hasAllFigurines) {
- type = ITEM_RUPEE50;
+ if (item == ITEM_SHELLS && gSave.stats.hasAllFigurines) {
+ item = ITEM_RUPEE50;
type2 = 0;
}
e = CreateItemGetEntity();
if (e != NULL) {
- e->type = type;
+ e->type = item;
e->type2 = type2;
e->timer = delay;
e->id = LINK_HOLDING_ITEM;
diff --git a/src/playerUtils.c b/src/playerUtils.c
index c2044701..08af08f3 100644
--- a/src/playerUtils.c
+++ b/src/playerUtils.c
@@ -184,8 +184,8 @@ void sub_08077698(PlayerEntity* this) {
((gPlayerState.jump_status & 0x40) == 0)) &&
(gPlayerState.swim_state == 0)) &&
((sub_08077758(this) && (sub_080777A0() == 0)))) {
- sub_08077880(gSave.stats.itemButtons[0], 1, 0);
- sub_08077880(gSave.stats.itemButtons[1], 2, 0);
+ sub_08077880(gSave.stats.itemButtons[SLOT_A], 1, 0);
+ sub_08077880(gSave.stats.itemButtons[SLOT_B], 2, 0);
sub_080778CC();
}
idx = 0;
@@ -201,9 +201,9 @@ void sub_08077698(PlayerEntity* this) {
void sub_08077728(u32 param_1) {
if (param_1 == 0) {
- sub_08077880(gSave.stats.itemButtons[0], 1, 1);
+ sub_08077880(gSave.stats.itemButtons[SLOT_A], 1, 1);
} else {
- sub_08077880(gSave.stats.itemButtons[1], 2, 1);
+ sub_08077880(gSave.stats.itemButtons[SLOT_B], 2, 1);
}
}
@@ -230,12 +230,12 @@ bool32 sub_080777A0(void) {
} else {
switch (gArea.portal_mode) {
case 2:
- if (gArea.unk1A == 0) {
+ if (gArea.portal_timer == 0) {
gPlayerEntity.subAction++;
}
break;
case 3:
- if ((gArea.unk1A == 0) && ((gPlayerState.flags & PL_MINISH) != 0)) {
+ if ((gArea.portal_timer == 0) && ((gPlayerState.flags & PL_MINISH) != 0)) {
gPlayerEntity.subAction++;
gPlayerEntity.flags &= ~ENT_COLLIDE;
RequestPriorityDuration(&gPlayerEntity, 180);
@@ -624,7 +624,7 @@ void DeletePlayerItem(ItemBehavior* arg0, u32 idx) {
not = ~not ;
gPlayerState.field_0xa &= not ;
gPlayerState.keepFacing &= not ;
- MemClear(arg0, 0x1c);
+ MemClear(arg0, sizeof(ItemBehavior));
}
bool32 sub_08077EC8(ItemBehavior* beh) {
@@ -707,10 +707,10 @@ bool32 sub_08077FEC(u32 action) {
bool32 sub_08078008(ChargeState* state) {
Item swordType;
- if (ItemIsSword(gSave.stats.itemButtons[0]) != ITEM_NONE) {
- swordType = gSave.stats.itemButtons[0];
- } else if (ItemIsSword(gSave.stats.itemButtons[1]) != ITEM_NONE) {
- swordType = gSave.stats.itemButtons[1];
+ if (ItemIsSword(gSave.stats.itemButtons[SLOT_A]) != ITEM_NONE) {
+ swordType = gSave.stats.itemButtons[SLOT_A];
+ } else if (ItemIsSword(gSave.stats.itemButtons[SLOT_B]) != ITEM_NONE) {
+ swordType = gSave.stats.itemButtons[SLOT_B];
} else {
swordType = ITEM_NONE;
}
@@ -961,7 +961,7 @@ bool32 sub_080782C0(void) {
}
void sub_080784C8(void) {
- MemClear(&gUnk_03003DF0, 0x188);
+ MemClear(&gUnk_03003DF0, sizeof(gUnk_03003DF0));
gUnk_03003DF0.unk_4 = (u8*)gUnk_0811C000;
}
@@ -1205,7 +1205,7 @@ void ClearPlayerState(void) {
gPlayerState.spriteOffsetY = 0;
gPlayerState.field_0x3c = 0;
MemFill32(0xffffffff, gPlayerState.path_memory, 0x40);
- MemClear(&gUnk_03003DF0, 0x188);
+ MemClear(&gUnk_03003DF0, sizeof(gUnk_03003DF0));
}
void UpdateCarriedObject(void) {
@@ -1610,7 +1610,7 @@ void ResolvePlayerAnimation(void) {
if ((gPlayerState.field_0x1c | gPlayerState.moleMittsState) != 0) {
return;
}
- if ((gPlayerState.flags & PL_FLAGS2000000) != 0) {
+ if ((gPlayerState.flags & PL_CONVEYOR_PUSHED) != 0) {
anim = 0x810;
} else if (gPlayerState.field_0x3[0] != 0) {
anim = 0x414;
@@ -1655,7 +1655,7 @@ void ResolvePlayerAnimation(void) {
}
if ((gPlayerState.flags & PL_MOLDWORM_CAPTURED) != 0) {
anim = 0x8b0;
- } else if ((gPlayerState.flags & PL_FLAGS2000000) != 0) {
+ } else if ((gPlayerState.flags & PL_CONVEYOR_PUSHED) != 0) {
anim = 0x810;
} else if (gPlayerState.dash_state != 0) {
anim = 0x298;
@@ -1888,9 +1888,9 @@ bool32 sub_08079F48(u32 param_1, u32 param_2) {
}
bool32 PlayerCanBeMoved(void) {
- if ((gPlayerState.flags &
- (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_FROZEN | PL_FALLING | PL_DISABLE_ITEMS |
- PL_PIT_IS_EXIT | PL_IN_MINECART | PL_MOLDWORM_CAPTURED | PL_IN_HOLE | PL_FLAGS2000000 | PL_CLIMBING)) != 0 ||
+ if ((gPlayerState.flags & (PL_BUSY | PL_DROWNING | PL_CAPTURED | PL_USE_PORTAL | PL_HIDDEN | PL_FROZEN |
+ PL_FALLING | PL_DISABLE_ITEMS | PL_PIT_IS_EXIT | PL_IN_MINECART | PL_MOLDWORM_CAPTURED |
+ PL_IN_HOLE | PL_CONVEYOR_PUSHED | PL_CLIMBING)) != 0 ||
gPlayerState.field_0x3c != 0 || gPlayerEntity.action == PLAYER_FALL ||
gPlayerEntity.action == PLAYER_08071DB8) {
return FALSE;
@@ -1991,10 +1991,10 @@ void DeleteClones(void) {
}
bool32 HasSwordEquipped(void) {
- if (ItemIsSword((u32)gSave.stats.itemButtons[0]) != 0) {
+ if (ItemIsSword((u32)gSave.stats.itemButtons[SLOT_A]) != 0) {
return TRUE;
} else {
- return ItemIsSword((u32)gSave.stats.itemButtons[1]);
+ return ItemIsSword((u32)gSave.stats.itemButtons[SLOT_B]);
}
}
@@ -3035,8 +3035,8 @@ void LoadRoomGfx(void) {
sub_0807BFA8();
roomControls = &gRoomControls;
roomControls->scroll_flags &= 0xfc;
- MemClear(gMapTop.mapData, 0x2000);
- MemClear(gMapTop.collisionData, 0x1000);
+ MemClear(gMapTop.mapData, sizeof(gMapTop.mapData));
+ MemClear(gMapTop.collisionData, sizeof(gMapTop.collisionData));
MemClear(&gMapDataBottomSpecial, 0x8000);
MemClear(&gMapDataTopSpecial, 0x8000);
sub_080197D4((gArea.pCurrentRoomInfo)->map);
@@ -3045,12 +3045,12 @@ void LoadRoomGfx(void) {
sub_0807C8B0(gMapTop.mapData, roomControls->width >> 4, roomControls->height >> 4);
tmp = FALSE;
} else {
- MemClear(gMapBottom.mapData, 0x2000);
+ MemClear(gMapBottom.mapData, sizeof(gMapBottom.mapData));
tmp = TRUE;
}
if (gRoomTransition.field_0x2c[0] == 0) {
- MemCopy(gMapBottom.mapData, gMapBottom.mapDataClone, 0x2000);
- MemCopy(gMapTop.mapData, gMapTop.mapDataClone, 0x2000);
+ MemCopy(gMapBottom.mapData, gMapBottom.mapDataClone, sizeof(gMapBottom.mapData));
+ MemCopy(gMapTop.mapData, gMapTop.mapDataClone, sizeof(gMapBottom.mapData));
} else if (gRoomTransition.field_0x2c[0] == 2) {
MemCopy(gMapBottom.mapData, gMapBottom.unkData3, 0x1000);
MemCopy(gMapBottom.mapDataClone, gMapBottom.mapData, 0x1000);
diff --git a/src/room.c b/src/room.c
index deca4b40..12abcc67 100644
--- a/src/room.c
+++ b/src/room.c
@@ -298,7 +298,7 @@ void LoadRoomTileEntities(TileEntity* list) {
LoadLocationTile(t);
break;
case TILE_ENTITY_D:
- gRoomVars.field_0x9 = t->_3;
+ gRoomVars.fight_bgm = t->_3;
break;
}
}
diff --git a/src/roomInit.c b/src/roomInit.c
index 502527f9..65cb1b18 100644
--- a/src/roomInit.c
+++ b/src/roomInit.c
@@ -1050,7 +1050,7 @@ void sub_StateChange_RoyalValley_Main(void) {
SetTileType(0x17d, 0x5cf, 1);
}
- sub_08054570();
+ EnableRandomDrops();
sub_08059278();
SetTile(0x4072, 0xa47, 1);
SetTile(0x4072, 0xc47, 1);
@@ -3131,7 +3131,7 @@ u32 sub_unk3_RoyalCrypt_MushroomPit(void) {
}
void sub_StateChange_RoyalCrypt_MushroomPit(void) {
- sub_08054570();
+ EnableRandomDrops();
}
u32 sub_unk3_RoyalCrypt_Entrance(void) {
@@ -3143,7 +3143,7 @@ extern EntityData gUnk_080E71AC;
void sub_StateChange_RoyalCrypt_Entrance(void) {
SetTileType(0x312, 0x108, 1);
- sub_08054570();
+ EnableRandomDrops();
if (!CheckLocalFlag(0xc4)) {
LoadRoomEntityList(&gUnk_080E718C);
}
@@ -4351,7 +4351,7 @@ extern EntityData gUnk_080EEA9C;
extern EntityData gUnk_080EEBAC;
void sub_StateChange_HyruleTown_0(void) {
- sub_08054570();
+ EnableRandomDrops();
TryLoadPrologueHyruleTown();
#if defined(USA) || defined(DEMO_USA) || defined(DEMO_JP)
SetTileType(0x176, 0x66b, 1);
@@ -4967,7 +4967,7 @@ u32 sub_unk3_HouseInteriors4_Swiftblade(void) {
}
void sub_StateChange_HouseInteriors4_Swiftblade(void) {
- sub_08054564();
+ DisableRandomDrops();
}
u32 sub_unk3_HouseInteriors4_RanchHouseWest(void) {
diff --git a/src/scroll.c b/src/scroll.c
index 41ea9204..37af7af7 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -469,8 +469,7 @@ void UpdateIsDiggingCave(void) {
}
void ClearTilemaps(void) {
- // Is gRoomControls 4 bytes bigger?
- MemClear(&gRoomControls, 0x38);
+ MemClear(&gRoomControls, sizeof(gRoomControls));
MemClear(&gDiggingCaveEntranceTransition, sizeof(gDiggingCaveEntranceTransition));
gRoomControls.filler3 = 0xffff;
gDiggingCaveEntranceTransition.previousArea = 0xff;
diff --git a/src/staffroll.c b/src/staffroll.c
index 632aa62c..e5d32e14 100644
--- a/src/staffroll.c
+++ b/src/staffroll.c
@@ -107,7 +107,7 @@ void StaffrollTask_State1MenuType1(void) {
const u8* ptr = &gUnk_08127CEC[gStaffrollMenu.unk_10 * 2];
LoadPaletteGroup(ptr[0]);
LoadGfxGroup(ptr[1]);
- MemClear(&gBG1Buffer, 0x800);
+ MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
gScreen.bg1.updated = 1;
gScreen.bg2.xOffset = gStaffrollMenu.unk_12;
gScreen.controls.alphaBlend = 0x1000;
@@ -124,7 +124,7 @@ void StaffrollTask_State1MenuType2(void) {
u8 tmp;
switch (gStaffrollMenu.base.overlayType) {
case 0:
- MemClear(&gBG1Buffer, 0x800);
+ MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
sub_0805F46C(gStaffrollMenu.unk_10, (Font*)gUnk_081272E0[gStaffrollMenu.unk_19]);
gScreen.bg1.updated = 1;
gStaffrollMenu.base.overlayType++;
@@ -191,9 +191,9 @@ void StaffrollTask_State1MenuType5(void) {
void StaffrollTask_State1MenuType6(void) {
if (gFadeControl.active == 0) {
- MemClear(&gBG1Buffer, 0x800);
+ MemClear(&gBG1Buffer, sizeof(gBG1Buffer));
gScreen.bg1.updated = 1;
- MemClear(&gBG2Buffer, 0x800);
+ MemClear(&gBG2Buffer, sizeof(gBG2Buffer));
gScreen.bg2.updated = 1;
gScreen.controls.alphaBlend = 0x1000;
gMenu.menuType = 0;
diff --git a/src/subtask2.c b/src/subtask2.c
index 31f813a4..c0d501fe 100644
--- a/src/subtask2.c
+++ b/src/subtask2.c
@@ -1803,7 +1803,7 @@ void Subtask_Init(void) {
if (gFadeControl.active == 0) {
DeleteAllEntities();
MemClear(&gMenu, sizeof(FigurineMenu));
- MemClear(&gRoomControls, 0x38);
+ MemClear(&gRoomControls, sizeof(gRoomControls));
MemClear(gOAMControls.unk, 0x100);
MemClear(&gActiveScriptInfo, sizeof(gActiveScriptInfo));
gActiveScriptInfo.fadeSpeed = 8;
diff --git a/src/text.c b/src/text.c
index 69f3bdaa..50d98a01 100644
--- a/src/text.c
+++ b/src/text.c
@@ -456,7 +456,7 @@ u32 sub_0805F46C(u32 param_1, const Font* param_2) {
pWVar4->unk04 = font.stylized;
pWVar4->unk4 = font.width;
pWVar4->unk8 = font.buffer_loc;
- pWVar4->charColor = font._15;
+ pWVar4->charColor = font.charColor;
pWVar4->bgColor = font.fill_type;
if (font.draw_border) {
sub_0805F918(font.border_type, font.fill_type, font.gfx_dest);
diff --git a/src/ui.c b/src/ui.c
index 800971a0..b70180b5 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -198,7 +198,7 @@ void InitUI(bool32 keepHealthAndRupees) {
gUnk_0200AF00.maxHealth = gSave.stats.maxHealth >> 1;
LoadPaletteGroup(0xc);
LoadGfxGroup(0x10);
- MemClear(&gBG0Buffer, 0x800);
+ MemClear(&gBG0Buffer, sizeof(gBG0Buffer));
gScreen.bg0.tilemap = &gBG0Buffer;
gScreen.bg0.control = 0x1f0c;
gScreen.lcd.displayControl |= 0x100;