summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2020-11-13 23:27:50 -0800
committertheo3 <arisstephenson2@gmail.com>2020-11-13 23:27:50 -0800
commit3079c016b455c7008995d26ea227a4f05bc79988 (patch)
treefbe584b74e020cd6d25bf7904b1ab576327b62b1 /src
parent8fd74813959a978489e0c4917fcbfe86500debbb (diff)
clang-format and newlines
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/chooseFile.c15
-rw-r--r--src/code_08018C58.c22
-rw-r--r--[-rwxr-xr-x]src/code_0801D79C.c6
-rw-r--r--src/code_080300AC.c14
-rw-r--r--src/code_0804AA84.c86
-rw-r--r--src/code_0805436C.c6
-rw-r--r--src/code_08077B98.c182
-rw-r--r--src/code_08077DF4.c150
-rw-r--r--src/code_08078778.c70
-rw-r--r--src/code_0807CC3C.c79
-rw-r--r--src/code_0808091C.c9
-rw-r--r--src/code_080A29BC.c92
-rw-r--r--src/createBowEntity.c2
-rw-r--r--src/enemy/acroBandits.c4
-rw-r--r--src/enemy/beetle.c2
-rw-r--r--src/enemy/bladeTrap.c2
-rw-r--r--src/enemy/bombPeahat.c2
-rw-r--r--src/enemy/bowMoblin.c42
-rw-r--r--src/enemy/chaser.c5
-rw-r--r--src/enemy/cuccoChickAggr.c7
-rw-r--r--src/enemy/enemy4D.c2
-rw-r--r--src/enemy/fallingBoulder.c8
-rw-r--r--src/enemy/fireballGuy.c4
-rw-r--r--src/enemy/hangingSeed.c1
-rw-r--r--src/enemy/keaton.c2
-rw-r--r--src/enemy/lakitu.c171
-rw-r--r--src/enemy/lakituCloud.c74
-rw-r--r--src/enemy/likeLike.c21
-rw-r--r--src/enemy/miniSlime.c2
-rw-r--r--src/enemy/moldorm.c2
-rw-r--r--src/enemy/peahat.c5
-rw-r--r--src/enemy/smallPesto.c104
-rw-r--r--[-rwxr-xr-x]src/enemy/treeItem.c6
-rw-r--r--src/entity.c6
-rw-r--r--src/flags.c27
-rw-r--r--src/initializePlayer.c31
-rw-r--r--src/input.c36
-rw-r--r--src/intro.c93
-rw-r--r--src/item.c58
-rw-r--r--src/item11.c109
-rw-r--r--src/loadRoom.c2
-rw-r--r--src/mainLoop.c11
-rw-r--r--src/manager/manager1.c79
-rw-r--r--src/manager/manager15.c101
-rw-r--r--src/manager/manager1A.c39
-rw-r--r--src/manager/manager2.c17
-rw-r--r--src/manager/manager20.c7
-rw-r--r--src/manager/manager27.c104
-rw-r--r--src/manager/manager2E.c10
-rw-r--r--src/manager/manager3.c16
-rw-r--r--src/manager/manager30.c45
-rw-r--r--src/manager/manager4.c53
-rw-r--r--src/manager/manager5.c62
-rw-r--r--src/manager/manager6.c8
-rw-r--r--src/manager/manager7.c92
-rw-r--r--src/manager/manager8.c28
-rw-r--r--src/manager/manager9.c36
-rw-r--r--src/manager/managerA.c48
-rw-r--r--src/manager/managerB.c95
-rw-r--r--src/manager/managerE.c2
-rw-r--r--src/npc/anju.c27
-rw-r--r--src/npc/bladeBrothers.c9
-rw-r--r--src/npc/carlov.c17
-rw-r--r--src/npc/carpenter.c8
-rw-r--r--src/npc/festari.c48
-rw-r--r--src/npc/gentari.c25
-rw-r--r--src/npc/goronMerchant.c176
-rw-r--r--src/npc/mailbox.c3
-rw-r--r--src/npc/moblinLady.c6
-rw-r--r--src/npc/npc9.c59
-rw-r--r--src/npc/postman.c92
-rw-r--r--src/npc/rem.c21
-rw-r--r--src/npc/simon.c52
-rw-r--r--src/npc/syrup.c47
-rw-r--r--src/npc/wheaton.c10
-rw-r--r--src/npc/zeldaFollower.c3
-rw-r--r--src/object/archway.c9
-rw-r--r--src/object/backgroundCloud.c3
-rw-r--r--src/object/bigVortex.c2
-rw-r--r--src/object/bird.c2
-rw-r--r--src/object/button.c35
-rw-r--r--src/object/chestSpawner.c23
-rw-r--r--src/object/fan.c102
-rw-r--r--src/object/floatingBlock.c4
-rw-r--r--src/object/hiddenLadderDown.c2
-rw-r--r--[-rwxr-xr-x]src/object/houseDoorExterior.c27
-rw-r--r--[-rwxr-xr-x]src/object/itemOnGround.c4
-rw-r--r--src/object/jailBars.c75
-rw-r--r--src/object/lightableSwitch.c3
-rw-r--r--src/object/lilypadSmall.c53
-rw-r--r--src/object/mask.c35
-rw-r--r--src/object/metalDoor.c147
-rw-r--r--src/object/minecart.c69
-rw-r--r--src/object/mineralWaterSource.c12
-rw-r--r--src/object/minishLight.c30
-rw-r--r--src/object/minishSizedEntrance.c26
-rw-r--r--src/object/object1C.c23
-rw-r--r--src/object/object1D.c13
-rw-r--r--src/object/object2A.c17
-rw-r--r--[-rwxr-xr-x]src/object/object48.c11
-rw-r--r--src/object/object49.c161
-rw-r--r--src/object/object7E.c4
-rw-r--r--src/object/object86.c54
-rw-r--r--src/object/object9E.c66
-rw-r--r--src/object/objectA.c16
-rw-r--r--src/object/objectA8.c45
-rw-r--r--src/object/palaceArchway.c16
-rw-r--r--src/object/pinwheel.c29
-rw-r--r--[-rwxr-xr-x]src/object/pot.c1
-rw-r--r--src/object/smoke.c64
-rw-r--r--src/object/swordsmanNewsletter.c24
-rw-r--r--src/object/thoughtBubble.c47
-rw-r--r--src/object/treeHidingPortal.c5
-rw-r--r--src/object/windTribeFlag.c33
-rw-r--r--src/object/windcrest.c33
-rw-r--r--src/position.c29
-rw-r--r--src/room.c1907
-rw-r--r--src/sub_08050024.c93
-rw-r--r--src/sub_08055E08.c15
-rw-r--r--src/sub_08070680.c88
-rw-r--r--src/sub_0807C998.c18
-rw-r--r--src/sub_080A3B84.c94
-rw-r--r--src/sub_080A554C.c10
-rw-r--r--src/tmc.code-workspace18
-rw-r--r--src/trig.c131
125 files changed, 3172 insertions, 3573 deletions
diff --git a/src/chooseFile.c b/src/chooseFile.c
index 143819f2..5a36de17 100755..100644
--- a/src/chooseFile.c
+++ b/src/chooseFile.c
@@ -125,8 +125,8 @@ void sub_080503E4(u32 saveFileId) {
brightnessPref = saveFile->brightnessPref;
}
- ((struct_02000000 *)0x2000000)->messageSpeed = messageSpeed;
- ((struct_02000000 *)0x2000000)->brightnessPref = brightnessPref;
+ ((struct_02000000*)0x2000000)->messageSpeed = messageSpeed;
+ ((struct_02000000*)0x2000000)->brightnessPref = brightnessPref;
gUsedPalettes = 0xFFFFFFFF;
}
@@ -134,7 +134,7 @@ void sub_0805041C(u32 saveFileId) {
SaveFile* saveFile;
if (saveFileId < 3) {
- ((struct_02000000 *)0x2000000)->saveFileId = saveFileId;
+ ((struct_02000000*)0x2000000)->saveFileId = saveFileId;
saveFile = &gSaveFiles[saveFileId];
_DmaCopy(saveFile, &gUnk_02002A40, sizeof(*saveFile));
}
@@ -164,8 +164,8 @@ void HandleChooseFileScreen(void) {
sub_0801C208();
sub_080AD9B0();
sub_080AD918();
- if (gUnk_02019EE0.unk3 != ((struct_02000000 *)0x2000000)->gameLanguage) {
- gUnk_02019EE0.unk3 = ((struct_02000000 *)0x2000000)->gameLanguage;
+ if (gUnk_02019EE0.unk3 != ((struct_02000000*)0x2000000)->gameLanguage) {
+ gUnk_02019EE0.unk3 = ((struct_02000000*)0x2000000)->gameLanguage;
sub_080503A8(0x6);
sub_080503A8(0xF);
}
@@ -185,7 +185,7 @@ void sub_080504F4(void) {
_DmaZero(&gUnk_0200AF00, sizeof(gUnk_0200AF00));
_DmaZero(&gUnk_02019EE0, sizeof(gUnk_02019EE0));
gUnk_02019EE0.unk3 = 7;
- gUnk_02019EE0.unk6 = ((struct_02000000 *)0x2000000)->gameLanguage > 1 ? 3 : 0;
+ gUnk_02019EE0.unk6 = ((struct_02000000*)0x2000000)->gameLanguage > 1 ? 3 : 0;
_DmaZero(&gUnk_02032EC0, sizeof(gUnk_02032EC0));
gUnk_02032EC0.transitionType = 8;
sub_080503BC(0);
@@ -285,7 +285,6 @@ void sub_0805070C(void) {
}
sub_0805F300(var0);
}
-
}
void sub_08050790(void) {
@@ -395,7 +394,7 @@ void sub_08050940(void) {
newKeys &= ~(DPAD_UP | DPAD_DOWN);
}
- var1 = ((struct_02000000 *)0x2000000)->gameLanguage > 1 ? 4 : 3;
+ var1 = ((struct_02000000*)0x2000000)->gameLanguage > 1 ? 4 : 3;
var2 = gUnk_02032EC0.transitionType;
switch (newKeys) {
case DPAD_UP:
diff --git a/src/code_08018C58.c b/src/code_08018C58.c
index d088db48..fd918e31 100644
--- a/src/code_08018C58.c
+++ b/src/code_08018C58.c
@@ -3,8 +3,7 @@
extern u32 SetTileType(u32 tileID, u32 tilePos, u32 layerID);
-void CreateMinishEntrance(u32 tilePos)
-{
+void CreateMinishEntrance(u32 tilePos) {
u32 x, y;
u32 tileID = 0x185;
@@ -16,14 +15,13 @@ void CreateMinishEntrance(u32 tilePos)
}
}
-void sub_08018C58(u32 tilePos)
-{
- u32 i = 0;
-
- for (;i < 6;) {
- SetTileType(0x260 + i, tilePos, 1);
- SetTileType(0x261 + i, tilePos + 1, 1);
- i += 2;
- tilePos += 0x40;
- }
+void sub_08018C58(u32 tilePos) {
+ u32 i = 0;
+
+ for (; i < 6;) {
+ SetTileType(0x260 + i, tilePos, 1);
+ SetTileType(0x261 + i, tilePos + 1, 1);
+ i += 2;
+ tilePos += 0x40;
+ }
}
diff --git a/src/code_0801D79C.c b/src/code_0801D79C.c
index 3ceb70e9..8f085aae 100755..100644
--- a/src/code_0801D79C.c
+++ b/src/code_0801D79C.c
@@ -53,17 +53,17 @@ void LoadGfxGroup(u32 group) {
case 0xD:
return;
case 0xE:
- if (((struct_02000000 *)0x2000000)->gameLanguage > 1) {
+ if (((struct_02000000*)0x2000000)->gameLanguage > 1) {
loadGfx = TRUE;
}
break;
case 0xF:
- if (((struct_02000000 *)0x2000000)->gameLanguage != 0) {
+ if (((struct_02000000*)0x2000000)->gameLanguage != 0) {
loadGfx = TRUE;
}
break;
default:
- if (ctrl == ((struct_02000000 *)0x2000000)->gameLanguage) {
+ if (ctrl == ((struct_02000000*)0x2000000)->gameLanguage) {
loadGfx = TRUE;
}
break;
diff --git a/src/code_080300AC.c b/src/code_080300AC.c
index e2da29ec..55d5a080 100644
--- a/src/code_080300AC.c
+++ b/src/code_080300AC.c
@@ -2,7 +2,7 @@
#include "entity.h"
#include "functions.h"
-//extern void DmaZero(void*, u32);
+// extern void DmaZero(void*, u32);
typedef struct {
u16 unk0;
@@ -13,13 +13,13 @@ typedef struct {
extern struct_0300110C gUnk_0300110C;
void sub_080300AC(void) {
- _DmaZero(&gUnk_0300110C.unk0, 0x44);
- gUnk_0300110C.unk66 = 0xff;
+ _DmaZero(&gUnk_0300110C.unk0, 0x44);
+ gUnk_0300110C.unk66 = 0xff;
}
void sub_080300C4(void) {
- if (gScreenTransition.field_0xae == 0xff) {
- gScreenTransition.field_0xac = 0;
- _DmaZero(&gScreenTransition.field_0x4c[32], 0x40);
- }
+ if (gScreenTransition.field_0xae == 0xff) {
+ gScreenTransition.field_0xac = 0;
+ _DmaZero(&gScreenTransition.field_0x4c[32], 0x40);
+ }
}
diff --git a/src/code_0804AA84.c b/src/code_0804AA84.c
index d3eff465..11db91d7 100644
--- a/src/code_0804AA84.c
+++ b/src/code_0804AA84.c
@@ -6,7 +6,7 @@
#include "screen.h"
typedef struct {
- u8 filler [18];
+ u8 filler[18];
u32 unk;
} struct_02018EB0;
@@ -15,62 +15,54 @@ extern void sub_0805E5A8();
extern void (*const gUnk_080D4120[])();
extern void (*const gUnk_080D412C[])();
-
extern struct_02018EB0 gUnk_02018EB0;
-u32 sub_0804AA84(void)
-{
- if (gArea.fadeOut != 0) {
- gUnk_03001000.transition = 4;
- gArea.filler[8] = 0;
- gArea.filler[9] = 0;
- *(u16*)&gArea.filler[10] = 0;
- sub_0805E5A8();
- return 1;
- }
- else {
- gArea.filler[18] = gArea.fadeOut;
- *(vu8*)&gArea.fadeOut = gArea.fadeOut;
- return 0;
- }
+u32 sub_0804AA84(void) {
+ if (gArea.fadeOut != 0) {
+ gUnk_03001000.transition = 4;
+ gArea.filler[8] = 0;
+ gArea.filler[9] = 0;
+ *(u16*)&gArea.filler[10] = 0;
+ sub_0805E5A8();
+ return 1;
+ } else {
+ gArea.filler[18] = gArea.fadeOut;
+ *(vu8*)&gArea.fadeOut = gArea.fadeOut;
+ return 0;
+ }
}
-void sub_0804AAB8(void)
-{
- gUnk_080D4120[gArea.filler[8]]();
+void sub_0804AAB8(void) {
+ gUnk_080D4120[gArea.filler[8]]();
}
-void sub_0804AAD4(void)
-{
- _DmaZero((void *)&gUnk_02018EB0, 0x28);
- gUnk_02018EB0.unk = 0;
- EraseAllEntities();
- CreateObject(0x3d, gArea.field_0x17, 0);
- gArea.filler[8]++;
+void sub_0804AAD4(void) {
+ _DmaZero((void*)&gUnk_02018EB0, 0x28);
+ gUnk_02018EB0.unk = 0;
+ EraseAllEntities();
+ CreateObject(0x3d, gArea.field_0x17, 0);
+ gArea.filler[8]++;
}
-void sub_0804AB04(void)
-{
- sub_0805E5C0();
- if (gArea.field_0x10 != 0) {
- sub_080AD90C();
- sub_080AD9B0();
- sub_080AD918();
- }
+void sub_0804AB04(void) {
+ sub_0805E5C0();
+ if (gArea.field_0x10 != 0) {
+ sub_080AD90C();
+ sub_080AD9B0();
+ sub_080AD918();
+ }
}
-void sub_0804AB24(void)
-{
- if (!gFadeControl.active) {
- gScreen.lcd.displayControl = 0;
- sub_0801E104();
- gArea.filler[8] = 0;
- MenuFadeIn(6, 0);
- gFadeControl.active = 0;
- }
+void sub_0804AB24(void) {
+ if (!gFadeControl.active) {
+ gScreen.lcd.displayControl = 0;
+ sub_0801E104();
+ gArea.filler[8] = 0;
+ MenuFadeIn(6, 0);
+ gFadeControl.active = 0;
+ }
}
-void sub_0804AB54(void)
-{
- gUnk_080D412C[gArea.filler[8]]();
+void sub_0804AB54(void) {
+ gUnk_080D412C[gArea.filler[8]]();
}
diff --git a/src/code_0805436C.c b/src/code_0805436C.c
index abdc457d..c1b3033a 100644
--- a/src/code_0805436C.c
+++ b/src/code_0805436C.c
@@ -30,7 +30,6 @@ extern u8 gUnk_080FE1C6[];
extern u32 gUnk_02034398;
extern void (*const gUnk_080FE2A0[])();
-
u32 IsItemEquipped(u32 itemID) {
u32 ret;
@@ -268,7 +267,6 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
}
*/
-void sub_08054870(void)
-{
- gUnk_080FE2A0[gMenu.menuType]();
+void sub_08054870(void) {
+ gUnk_080FE2A0[gMenu.menuType]();
}
diff --git a/src/code_08077B98.c b/src/code_08077B98.c
index 2195fc3e..83d0089b 100644
--- a/src/code_08077B98.c
+++ b/src/code_08077B98.c
@@ -3,7 +3,6 @@
#include "player.h"
#include "functions.h"
-
typedef struct {
u8 unk[12];
} struct_0811BE48;
@@ -20,120 +19,109 @@ extern Entity* sub_0805E744();
extern struct_0811BE48 gUnk_0811BE48[];
-void sub_08077B98(UnkItemStruct* unk)
-{
- if ((gPlayerState.field_0x2c == NULL) || (gPlayerState.field_0x2c[9] != 1)) {
- gPlayerState.field_0x2c = sub_08077C54(unk);
- }
+void sub_08077B98(UnkItemStruct* unk) {
+ if ((gPlayerState.field_0x2c == NULL) || (gPlayerState.field_0x2c[9] != 1)) {
+ gPlayerState.field_0x2c = sub_08077C54(unk);
+ }
}
-void sub_08077BB8(UnkItemStruct* unk)
-{
- u8* temp = sub_08077C54(unk);
- if (temp != NULL) {
- temp[0x10] = 0x20;
- }
- gPlayerState.field_0x2c = temp;
+void sub_08077BB8(UnkItemStruct* unk) {
+ u8* temp = sub_08077C54(unk);
+ if (temp != NULL) {
+ temp[0x10] = 0x20;
+ }
+ gPlayerState.field_0x2c = temp;
}
-Entity* sub_08077BD4(ItemBehavior *beh)
-{
- if (sub_08077C94(beh, gUnk_0811BE48[beh->behaviorID].unk[3]) != 0) {
- return NULL;
- }
- else {
- return CreatePlayerBomb(beh, gUnk_0811BE48[beh->behaviorID].unk[3]);
- }
+Entity* sub_08077BD4(ItemBehavior* beh) {
+ if (sub_08077C94(beh, gUnk_0811BE48[beh->behaviorID].unk[3]) != 0) {
+ return NULL;
+ } else {
+ return CreatePlayerBomb(beh, gUnk_0811BE48[beh->behaviorID].unk[3]);
+ }
}
-Entity * sub_08077C0C(ItemBehavior *beh, u32 arg1)
-{
- u8 bVar1;
- Entity *pEVar3;
-
- bVar1 = gUnk_0811BE48[arg1].unk[3];
-
- if (sub_08077C94(beh, bVar1) != 0) {
- return NULL;
- }
- else {
- return CreatePlayerBomb(beh, bVar1);
- }
+Entity* sub_08077C0C(ItemBehavior* beh, u32 arg1) {
+ u8 bVar1;
+ Entity* pEVar3;
+
+ bVar1 = gUnk_0811BE48[arg1].unk[3];
+
+ if (sub_08077C94(beh, bVar1) != 0) {
+ return NULL;
+ } else {
+ return CreatePlayerBomb(beh, bVar1);
+ }
}
-Entity * CreatePlayerBomb(ItemBehavior *beh, u32 subtype)
-{
- Entity *pEVar1;
-
- pEVar1 = CreatePlayerItem(subtype, 0, 0, beh->behaviorID);
- if (pEVar1 != NULL) {
- *(ItemBehavior **)&pEVar1->parent = beh;
- }
- return pEVar1;
+Entity* CreatePlayerBomb(ItemBehavior* beh, u32 subtype) {
+ Entity* pEVar1;
+
+ pEVar1 = CreatePlayerItem(subtype, 0, 0, beh->behaviorID);
+ if (pEVar1 != NULL) {
+ *(ItemBehavior**)&pEVar1->parent = beh;
+ }
+ return pEVar1;
}
-void* sub_08077C54(UnkItemStruct* unk)
-{
- Entity *item;
-
- item = sub_0805E744();
- if (item != NULL) {
- item->entityType.subtype = gUnk_0811BE48[unk->field_0x1].unk[3];
- item->entityType.type = 8;
- item->flags = 0xa0;
- item->parent = (Entity*)unk;
- item->field_0x68.HALF.LO = unk->field_0x1;
- AppendEntityToList(item, 2);
- }
- return item;
+void* sub_08077C54(UnkItemStruct* unk) {
+ Entity* item;
+
+ item = sub_0805E744();
+ if (item != NULL) {
+ item->entityType.subtype = gUnk_0811BE48[unk->field_0x1].unk[3];
+ item->entityType.type = 8;
+ item->flags = 0xa0;
+ item->parent = (Entity*)unk;
+ item->field_0x68.HALF.LO = unk->field_0x1;
+ AppendEntityToList(item, 2);
+ }
+ return item;
}
-Entity* sub_08077C94(ItemBehavior* arg0, u32 arg1)
-{
- Entity* iVar1;
-
- iVar1 = FindEntityInListBySubtype(8, gUnk_0811BE48[arg1].unk[3], 2);
- if (iVar1 == NULL) {
- return NULL;
- }
- return iVar1;
+Entity* sub_08077C94(ItemBehavior* arg0, u32 arg1) {
+ Entity* iVar1;
+
+ iVar1 = FindEntityInListBySubtype(8, gUnk_0811BE48[arg1].unk[3], 2);
+ if (iVar1 == NULL) {
+ return NULL;
+ }
+ return iVar1;
}
-Entity * CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk)
-{
- Entity *ent;
-
- ent = GetEmptyEntity();
- if (ent != NULL) {
- ent->flags = 0x80;
- (ent->entityType).type = 8;
- (ent->entityType).subtype = subtype;
- (ent->entityType).form = form;
- (ent->entityType).parameter = parameter;
- ent->field_0x68.HALF.LO = unk;
- AppendEntityToList(ent, 2);
- }
- return ent;
+Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) {
+ Entity* ent;
+
+ ent = GetEmptyEntity();
+ if (ent != NULL) {
+ ent->flags = 0x80;
+ (ent->entityType).type = 8;
+ (ent->entityType).subtype = subtype;
+ (ent->entityType).form = form;
+ (ent->entityType).parameter = parameter;
+ ent->field_0x68.HALF.LO = unk;
+ AppendEntityToList(ent, 2);
+ }
+ return ent;
}
-Entity * sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk)
-{
- Entity *ent;
-
- ent = sub_0805E744();
- if (ent != NULL) {
- ent->flags = 0x80;
- (ent->entityType).type = 8;
- (ent->entityType).subtype = subtype;
- (ent->entityType).form = form;
- (ent->entityType).parameter = parameter;
- ent->field_0x68.HALF.LO = unk;
- AppendEntityToList(ent, 2);
- }
- return ent;
+Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) {
+ Entity* ent;
+
+ ent = sub_0805E744();
+ if (ent != NULL) {
+ ent->flags = 0x80;
+ (ent->entityType).type = 8;
+ (ent->entityType).subtype = subtype;
+ (ent->entityType).form = form;
+ (ent->entityType).parameter = parameter;
+ ent->field_0x68.HALF.LO = unk;
+ AppendEntityToList(ent, 2);
+ }
+ return ent;
}
NAKED
-void sub_08077D38(ItemBehavior *beh, u32 arg1) {
+void sub_08077D38(ItemBehavior* beh, u32 arg1) {
asm(".include \"asm/non_matching/sub_08077D38.inc\"");
}
diff --git a/src/code_08077DF4.c b/src/code_08077DF4.c
index 69dd5820..f29aa06b 100644
--- a/src/code_08077DF4.c
+++ b/src/code_08077DF4.c
@@ -4,91 +4,81 @@
#include "functions.h"
typedef struct {
- u8 b0: 4;
- u8 b1: 4;
+ u8 b0 : 4;
+ u8 b1 : 4;
} PACKED Unk_bitfield;
typedef struct {
u8 unk[16];
} Unk_struct;
-void sub_08077DF4(Entity *ent, u32 arg1)
-{
- *(u16 *)&ent->flags = arg1;
- if ((arg1 & 0xff) > 0xb8) {
- arg1 += (ent->entityType).form >> 1;
- }
- gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
- InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
- sub_08077E54(ent);
+void sub_08077DF4(Entity* ent, u32 arg1) {
+ *(u16*)&ent->flags = arg1;
+ if ((arg1 & 0xff) > 0xb8) {
+ arg1 += (ent->entityType).form >> 1;
+ }
+ gPlayerEntity.spriteIndex = (short)(arg1 >> 8);
+ InitAnimationForceUpdate(&gPlayerEntity, (u8)arg1);
+ sub_08077E54(ent);
}
-void UpdateItemAnim(Entity *ent)
-{
- UpdateAnimationSingleFrame(&gPlayerEntity);
- sub_08077E54(ent);
+void UpdateItemAnim(Entity* ent) {
+ UpdateAnimationSingleFrame(&gPlayerEntity);
+ sub_08077E54(ent);
}
-void sub_08077E3C(Entity *ent, u32 idx)
-{
- sub_080042BA(&gPlayerEntity, idx);
- sub_08077E54(ent);
+void sub_08077E3C(Entity* ent, u32 idx) {
+ sub_080042BA(&gPlayerEntity, idx);
+ sub_08077E54(ent);
}
-void sub_08077E54(Entity *ent)
-{
- ent->action = gPlayerEntity.animIndex;
- *(u8 *)&ent->spriteIndex = gPlayerEntity.frameIndex;
- ent->previousActionFlag = gPlayerEntity.frameDuration;
- ent->actionDelay = gPlayerEntity.frames.all;
+void sub_08077E54(Entity* ent) {
+ ent->action = gPlayerEntity.animIndex;
+ *(u8*)&ent->spriteIndex = gPlayerEntity.frameIndex;
+ ent->previousActionFlag = gPlayerEntity.frameDuration;
+ ent->actionDelay = gPlayerEntity.frames.all;
}
-void sub_08077E78(void* arg0, u32 bits)
-{
- u8 *pbVar1;
- u32 not;
-
+void sub_08077E78(void* arg0, u32 bits) {
+ u8* pbVar1;
+ u32 not ;
+
if (bits == 0) {
if (gPlayerState.field_0x2c != NULL) {
- ((Unk_bitfield *)gPlayerState.field_0x2c)[0x11].b0 = 6;
- gPlayerState.field_0x2c = (u8 *)bits;
- }
- else {
- gPlayerState.field_0x2c = (u8 *)bits;
+ ((Unk_bitfield*)gPlayerState.field_0x2c)[0x11].b0 = 6;
+ gPlayerState.field_0x2c = (u8*)bits;
+ } else {
+ gPlayerState.field_0x2c = (u8*)bits;
}
}
- not = (8 >> bits);
- gPlayerState.field_0x3[1] &= ~((u8)((8 >> bits) << 4) | not);
- not = ~not;
- gPlayerState.field_0xa &= not;
- gPlayerState.keepFacing &= not;
- _DmaZero(arg0, 0x1c);
+ not = (8 >> bits);
+ gPlayerState.field_0x3[1] &= ~((u8)((8 >> bits) << 4) | not );
+ not = ~not ;
+ gPlayerState.field_0xa &= not ;
+ gPlayerState.keepFacing &= not ;
+ _DmaZero(arg0, 0x1c);
}
-u32 sub_08077EC8(Unk_struct* arg0)
-{
-
- if ((gPlayerState.field_0x1a[1] & 8) != 0) {
- sub_08077DF4((Entity *)arg0,0x170);
- arg0->unk[7] = 0x28;
- arg0->unk[4] = 7;
- arg0->unk[15] = 6;
- return 1;
- }
- else {
- return 0;
- }
+u32 sub_08077EC8(Unk_struct* arg0) {
+
+ if ((gPlayerState.field_0x1a[1] & 8) != 0) {
+ sub_08077DF4((Entity*)arg0, 0x170);
+ arg0->unk[7] = 0x28;
+ arg0->unk[4] = 7;
+ arg0->unk[15] = 6;
+ return 1;
+ } else {
+ return 0;
+ }
}
-void sub_08077EFC(ItemBehavior* arg0)
-{
- sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
+void sub_08077EFC(ItemBehavior* arg0) {
+ sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.LO);
}
-void sub_08077F10(ItemBehavior* arg0)
-{
- sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
+void sub_08077F10(ItemBehavior* arg0) {
+ sub_08077F24(arg0, (u16)gPlayerState.field_0x90.HALF.HI);
}
NAKED
@@ -96,38 +86,34 @@ void sub_08077F24(ItemBehavior* beh, u32 arg1) {
asm(".include \"asm/non_matching/sub_08077F24.inc\"");
}
-void sub_08077F50(ItemBehavior *beh, u32 arg1)
-{
- sub_08079184();
- sub_08077E78(beh, arg1);
+void sub_08077F50(ItemBehavior* beh, u32 arg1) {
+ sub_08079184();
+ sub_08077E78(beh, arg1);
}
-u32 sub_08077F64(ItemBehavior* arg0, u32 unk)
-{
+u32 sub_08077F64(ItemBehavior* arg0, u32 unk) {
u32 temp;
if (gPlayerState.heldObject == 0) {
sub_08077F50(arg0, unk);
temp = 0;
- }
- else {
+ } else {
temp = 1;
}
return temp;
}
-void sub_08077F84(void)
-{
- Entity *obj;
-
- if (((gPlayerEntity.collisionLayer & 2) == 0) &&
- GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
- sub_0807AA80(&gPlayerEntity);
- gPlayerState.jumpStatus |= 8;
- obj = CreateObject(0x44, 0, 0);
- if (obj != NULL) {
- obj->x = gPlayerEntity.x;
- obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
- gPlayerEntity.y.HALF.HI -= 0xc;
+void sub_08077F84(void) {
+ Entity* obj;
+
+ if (((gPlayerEntity.collisionLayer & 2) == 0) &&
+ GetTileTypeByPos(gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 0xc, 2) - 0x343U < 4) {
+ sub_0807AA80(&gPlayerEntity);
+ gPlayerState.jumpStatus |= 8;
+ obj = CreateObject(0x44, 0, 0);
+ if (obj != NULL) {
+ obj->x = gPlayerEntity.x;
+ obj->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0xc;
+ gPlayerEntity.y.HALF.HI -= 0xc;
+ }
}
- }
}
diff --git a/src/code_08078778.c b/src/code_08078778.c
index 7d181f1d..32e422ff 100644
--- a/src/code_08078778.c
+++ b/src/code_08078778.c
@@ -42,47 +42,43 @@ void sub_080787CC(Entity* ent) {
sub_0807887C(ent, 5, 0);
}
-s32 sub_080787D8(Entity *ent)
-{
- s32 iVar1;
-
- iVar1 = sub_0807887C(ent, 8, 0);
- if (iVar1 >= 0) {
- gUnk_03003DF0[iVar1].unk[10] = 0xbe;
- }
- return iVar1;
+s32 sub_080787D8(Entity* ent) {
+ s32 iVar1;
+
+ iVar1 = sub_0807887C(ent, 8, 0);
+ if (iVar1 >= 0) {
+ gUnk_03003DF0[iVar1].unk[10] = 0xbe;
+ }
+ return iVar1;
}
-s32 sub_08078800(Entity *ent)
-{
- s32 iVar1;
-
- iVar1 = sub_0807887C(ent, 6, 0);
- if (iVar1 >= 0) {
- gUnk_03003DF0[iVar1].unk[10] = 0xbe;
- }
- return iVar1;
+s32 sub_08078800(Entity* ent) {
+ s32 iVar1;
+
+ iVar1 = sub_0807887C(ent, 6, 0);
+ if (iVar1 >= 0) {
+ gUnk_03003DF0[iVar1].unk[10] = 0xbe;
+ }
+ return iVar1;
}
-s32 sub_08078828(Entity *ent)
-{
- s32 iVar1;
-
- iVar1 = sub_0807887C(ent, 3, 0);
- if (iVar1 >= 0) {
- gUnk_03003DF0[iVar1].unk[10] = 0xbe;
- }
- return iVar1;
+s32 sub_08078828(Entity* ent) {
+ s32 iVar1;
+
+ iVar1 = sub_0807887C(ent, 3, 0);
+ if (iVar1 >= 0) {
+ gUnk_03003DF0[iVar1].unk[10] = 0xbe;
+ }
+ return iVar1;
}
-void sub_08078850(u32 arg0, u32 arg1, u32 arg2, u32 arg3)
-{
- s32 iVar1;
-
- iVar1 = sub_08078904();
- if (iVar1 >= 0) {
- gUnk_03003DF0[iVar1].unk[8] = arg1;
- gUnk_03003DF0[iVar1].unk[10] = arg2;
- *(&gUnk_03003DF0[iVar1].unk4 + 1) = arg3;
- }
+void sub_08078850(u32 arg0, u32 arg1, u32 arg2, u32 arg3) {
+ s32 iVar1;
+
+ iVar1 = sub_08078904();
+ if (iVar1 >= 0) {
+ gUnk_03003DF0[iVar1].unk[8] = arg1;
+ gUnk_03003DF0[iVar1].unk[10] = arg2;
+ *(&gUnk_03003DF0[iVar1].unk4 + 1) = arg3;
+ }
}
diff --git a/src/code_0807CC3C.c b/src/code_0807CC3C.c
index e3ddac70..80e0bfe7 100644
--- a/src/code_0807CC3C.c
+++ b/src/code_0807CC3C.c
@@ -72,33 +72,32 @@ s32 sub_0807CE54(void) {
return uVar1;
}
-u32 sub_0807CE90(void)
-{
- struct_0807D1C4 *puVar1;
- int iVar2;
- int iVar3;
-
- sub_080B1520(0x40);
- puVar1 = sub_0807D1C4(4);
- iVar3 = 0;
- if (sub_0807D24C(puVar1->field_0x6, gUnk_0811E484, puVar1->field_0x0) == 0) {
- iVar3 += 1;
- }
- if (sub_0807D24C(puVar1->field_0x8, gUnk_0811E484, puVar1->field_0x0) == 0) {
- iVar3 += 2;
- }
- if (iVar3 != 0) {
- if (iVar3 == 3) {
- sub_0807CF68(5);
- sub_0807CF68(3);
- sub_0807CF68(2);
- sub_0807CF68(1);
- sub_0807CF68(0);
+u32 sub_0807CE90(void) {
+ struct_0807D1C4* puVar1;
+ int iVar2;
+ int iVar3;
+
+ sub_080B1520(0x40);
+ puVar1 = sub_0807D1C4(4);
+ iVar3 = 0;
+ if (sub_0807D24C(puVar1->field_0x6, gUnk_0811E484, puVar1->field_0x0) == 0) {
+ iVar3 += 1;
}
- sub_0807D20C(puVar1->field_0x8, gUnk_0811E484, puVar1->field_0x0);
- sub_0807D20C(puVar1->field_0x6, gUnk_0811E484, puVar1->field_0x0);
- }
- return 1;
+ if (sub_0807D24C(puVar1->field_0x8, gUnk_0811E484, puVar1->field_0x0) == 0) {
+ iVar3 += 2;
+ }
+ if (iVar3 != 0) {
+ if (iVar3 == 3) {
+ sub_0807CF68(5);
+ sub_0807CF68(3);
+ sub_0807CF68(2);
+ sub_0807CF68(1);
+ sub_0807CF68(0);
+ }
+ sub_0807D20C(puVar1->field_0x8, gUnk_0811E484, puVar1->field_0x0);
+ sub_0807D20C(puVar1->field_0x6, gUnk_0811E484, puVar1->field_0x0);
+ }
+ return 1;
}
u32 sub_0807CF08(u32 arg0, u8* arg1) {
@@ -125,22 +124,20 @@ u32 sub_0807CF3C(void* arg0) {
return sub_0807D008(5, arg0);
}
-void sub_0807CF48(u32 arg0)
-{
- struct_0807D1C4 *temp;
-
- temp = sub_0807D1C4(arg0);
- sub_0807D184(temp->field_0x4, gUnk_0811E4AC);
- sub_0807D184(temp->field_0x2, gUnk_0811E4AC);
+void sub_0807CF48(u32 arg0) {
+ struct_0807D1C4* temp;
+
+ temp = sub_0807D1C4(arg0);
+ sub_0807D184(temp->field_0x4, gUnk_0811E4AC);
+ sub_0807D184(temp->field_0x2, gUnk_0811E4AC);
}
-void sub_0807CF68(u32 arg0)
-{
- struct_0807D1C4 *temp;
- char* str;
+void sub_0807CF68(u32 arg0) {
+ struct_0807D1C4* temp;
+ char* str;
- temp = sub_0807D1C4(arg0);
- str = gUnk_0811E4A4;
- sub_0807D184(temp->field_0x4, str);
- sub_0807D184(temp->field_0x2, str);
+ temp = sub_0807D1C4(arg0);
+ str = gUnk_0811E4A4;
+ sub_0807D184(temp->field_0x4, str);
+ sub_0807D184(temp->field_0x2, str);
}
diff --git a/src/code_0808091C.c b/src/code_0808091C.c
index ae04dcad..cdd7504a 100644
--- a/src/code_0808091C.c
+++ b/src/code_0808091C.c
@@ -36,8 +36,7 @@ void sub_08080910(void) {
gScreenTransition.transitionType = 1;
}
-void sub_0808091C(ScreenTransitionData* param_1, u32 param_2)
-{
+void sub_0808091C(ScreenTransitionData* param_1, u32 param_2) {
DoExitTransition(param_1);
gScreenTransition.transitionType = param_2;
return;
@@ -54,8 +53,7 @@ void sub_08080930(void)
return;
}
-u32* GetLayerByIndex(u32 param_1)
-{
+u32* GetLayerByIndex(u32 param_1) {
if (param_1 == 2) {
return &gUnk_0200B650;
@@ -64,8 +62,7 @@ u32* GetLayerByIndex(u32 param_1)
}
}
-void sub_08080964(u16 time, u32 magnitude)
-{
+void sub_08080964(u16 time, u32 magnitude) {
gRoomControls.screenShakeTime = time;
gRoomControls.screenShakeMagnitude = magnitude & 7;
return;
diff --git a/src/code_080A29BC.c b/src/code_080A29BC.c
index bb9d1701..d33d3b94 100644
--- a/src/code_080A29BC.c
+++ b/src/code_080A29BC.c
@@ -2,68 +2,60 @@
#include "entity.h"
#include "room.h"
-void sub_080A29BC(Entity *parent)
-{
- CreateFx(parent, 2, 0);
+void sub_080A29BC(Entity* parent) {
+ CreateFx(parent, 2, 0);
}
-void sub_080A29C8(s32 xOff, s32 yOff, u32 layer)
-{
- Entity *pEVar1;
-
- pEVar1 = CreateObject(0xf, 2, 0);
- if (pEVar1 != NULL) {
- pEVar1->x.HALF.HI = gRoomControls.roomOriginX + xOff;
- pEVar1->y.HALF.HI = gRoomControls.roomOriginY + yOff;
- pEVar1->collisionLayer = layer;
- }
+void sub_080A29C8(s32 xOff, s32 yOff, u32 layer) {
+ Entity* pEVar1;
+
+ pEVar1 = CreateObject(0xf, 2, 0);
+ if (pEVar1 != NULL) {
+ pEVar1->x.HALF.HI = gRoomControls.roomOriginX + xOff;
+ pEVar1->y.HALF.HI = gRoomControls.roomOriginY + yOff;
+ pEVar1->collisionLayer = layer;
+ }
}
-void sub_080A29FC(Entity *parent)
-{
- CreateFx(parent, 0x11, 0);
+void sub_080A29FC(Entity* parent) {
+ CreateFx(parent, 0x11, 0);
}
-void sub_080A2A08(Entity *parent)
-{
- CreateFx(parent, 0x6, 0);
+void sub_080A2A08(Entity* parent) {
+ CreateFx(parent, 0x6, 0);
}
-void sub_080A2A14(Entity *parent)
-{
- CreateFx(parent, 0xb, 0);
+void sub_080A2A14(Entity* parent) {
+ CreateFx(parent, 0xb, 0);
}
-Entity * sub_080A2A20(Entity *parent, u32 form, u32 parameter)
-{
- Entity *pEVar1;
-
- pEVar1 = CreateObjectWithParent(parent, 0, form, parameter);
- if (pEVar1 != NULL) {
- pEVar1->actionDelay = 5;
- }
- return pEVar1;
+Entity* sub_080A2A20(Entity* parent, u32 form, u32 parameter) {
+ Entity* pEVar1;
+
+ pEVar1 = CreateObjectWithParent(parent, 0, form, parameter);
+ if (pEVar1 != NULL) {
+ pEVar1->actionDelay = 5;
+ }
+ return pEVar1;
}
-Entity * sub_080A2A3C(Entity *parent, u32 form, u32 subtype, u32 param_4)
-{
- Entity *ent;
-
- ent = CreateObjectWithParent(parent, 0, form, subtype);
- if (ent != NULL) {
- ent->actionDelay = 5;
- *(u32*)(&ent->field_0x86) = param_4;
- }
- return ent;
+Entity* sub_080A2A3C(Entity* parent, u32 form, u32 subtype, u32 param_4) {
+ Entity* ent;
+
+ ent = CreateObjectWithParent(parent, 0, form, subtype);
+ if (ent != NULL) {
+ ent->actionDelay = 5;
+ *(u32*)(&ent->field_0x86) = param_4;
+ }
+ return ent;
}
-Entity * sub_080A2A64(Entity *parent)
-{
- Entity *pEVar1;
-
- pEVar1 = CreateFx(parent, 0x20, 0);
- if (pEVar1 != NULL) {
- pEVar1->spritePriority.b0 = 7;
- }
- return pEVar1;
+Entity* sub_080A2A64(Entity* parent) {
+ Entity* pEVar1;
+
+ pEVar1 = CreateFx(parent, 0x20, 0);
+ if (pEVar1 != NULL) {
+ pEVar1->spritePriority.b0 = 7;
+ }
+ return pEVar1;
}
diff --git a/src/createBowEntity.c b/src/createBowEntity.c
index 0e1f0ef8..eab87381 100644
--- a/src/createBowEntity.c
+++ b/src/createBowEntity.c
@@ -3,6 +3,6 @@
extern void (*const gUnk_080B3E30[])(Entity*);
-void sub_08018FCC(Entity* this){
+void sub_08018FCC(Entity* this) {
gUnk_080B3E30[(this->action)](this);
}
diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c
index 724880ac..73212e2f 100644
--- a/src/enemy/acroBandits.c
+++ b/src/enemy/acroBandits.c
@@ -206,7 +206,6 @@ void sub_08031C1C(Entity* this) {
}
}
-
void sub_08031C58(Entity* this) {
Entity *a, *b;
@@ -412,7 +411,6 @@ void sub_08032008(Entity* this) {
if (this->direction & 0xf)
this->spriteSettings.b.flipX = (this->direction >> 4 ^ 1);
-
ProcessMovement(this);
} else {
if (this->field_0x76.HALF.HI == 0) {
@@ -544,7 +542,7 @@ void sub_080322E8(Entity* this) {
}
}
-void sub_08032338(Entity *this) {
+void sub_08032338(Entity* this) {
if ((((Entity*)this->field_0x7c.WORD)->actionDelay += 15) != 80)
this->field_0x6c.HALF.LO = 0;
}
diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c
index aa51a736..9536f297 100644
--- a/src/enemy/beetle.c
+++ b/src/enemy/beetle.c
@@ -315,7 +315,6 @@ void sub_08021D44(Entity* this, u32 direction) {
}
}
-
// clang-format off
void (*const gUnk_080CB590[])(Entity*) = {
sub_08021768,
@@ -356,4 +355,3 @@ const s8 gUnk_080CB5E4[] = {
-1, -2, -1, 0, 1, 2, 1, 0,
};
// clang-format on
-
diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c
index b58ef0d6..54dcfcb7 100644
--- a/src/enemy/bladeTrap.c
+++ b/src/enemy/bladeTrap.c
@@ -20,8 +20,6 @@ void BladeTrap(Entity* ent) {
sub_0806F69C(ent);
}
-
-
puVar3 = &(ent->field_0x74.HWORD);
uVar1 = *puVar3;
*puVar3 = uVar1 - 1;
diff --git a/src/enemy/bombPeahat.c b/src/enemy/bombPeahat.c
index 98f54841..938e9af1 100644
--- a/src/enemy/bombPeahat.c
+++ b/src/enemy/bombPeahat.c
@@ -665,4 +665,4 @@ const BoundingBox gUnk_080CD174 = {
const BoundingBox gUnk_080CD17C = {
0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x16, 0x16,
};
-// clang-format on \ No newline at end of file
+// clang-format on
diff --git a/src/enemy/bowMoblin.c b/src/enemy/bowMoblin.c
index c23b1294..e29d6177 100644
--- a/src/enemy/bowMoblin.c
+++ b/src/enemy/bowMoblin.c
@@ -10,32 +10,30 @@ extern void sub_0803C5F0(Entity*);
extern void (*const gUnk_080CFF78[])(Entity*);
extern void (*const gUnk_080CFF90[])(Entity*);
-void BowMoblin(Entity *this)
-{
- EnemyFunctionHandler(this, gUnk_080CFF78);
- SetChildOffset(this, 0, 1, -0x18);
+void BowMoblin(Entity* this) {
+ EnemyFunctionHandler(this, gUnk_080CFF78);
+ SetChildOffset(this, 0, 1, -0x18);
}
-void sub_0803C180(Entity *this)
-{
- gUnk_080CFF90[this->action](this);
+void sub_0803C180(Entity* this) {
+ gUnk_080CFF90[this->action](this);
}
-void sub_0803C198(Entity *this)
-{
- Entity *pEVar1;
-
- if (this->field_0x43 != 0) {
- sub_0804A9FC(this,0x1c);
- }
- sub_0804AA30(this, &gUnk_080CFF78);
- if ((this->bitfield & 0x80) != 0) {
- sub_0803C5F0(this);
- pEVar1 = this->attachedEntity;
- if (pEVar1 != NULL) {
- pEVar1->field_0xf++;
+void sub_0803C198(Entity* this) {
+ Entity* pEVar1;
+
+ if (this->field_0x43 != 0) {
+ sub_0804A9FC(this, 0x1c);
+ }
+ sub_0804AA30(this, &gUnk_080CFF78);
+ if ((this->bitfield & 0x80) != 0) {
+ sub_0803C5F0(this);
+ pEVar1 = this->attachedEntity;
+ if (pEVar1 != NULL) {
+ pEVar1->field_0xf++;
+ }
}
- }
}
-void nullsub_168(Entity* this){}
+void nullsub_168(Entity* this) {
+}
diff --git a/src/enemy/chaser.c b/src/enemy/chaser.c
index a5f1f522..00d99937 100644
--- a/src/enemy/chaser.c
+++ b/src/enemy/chaser.c
@@ -61,16 +61,15 @@ void sub_0802B56C(Entity* this) {
}
}
-void sub_0802B5C8(Entity *this) {
+void sub_0802B5C8(Entity* this) {
GetNextFrame(this);
if (this->frames.all & 0x80) {
this->action = 1;
this->actionDelay = 30;
- InitializeAnimation(this,0);
+ InitializeAnimation(this, 0);
}
}
-
// clang-format off
void (*const gUnk_080CD27C[])(Entity*) = {
sub_0802B518,
diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c
index 686e5100..de87165a 100644
--- a/src/enemy/cuccoChickAggr.c
+++ b/src/enemy/cuccoChickAggr.c
@@ -136,17 +136,16 @@ u32 sub_08022B20(Entity* this) {
return sub_080041A0(this, &gPlayerEntity, 0x24, 0x24);
}
-void sub_08022B44(Entity *this){
+void sub_08022B44(Entity* this) {
this->field_0x20 = 0xc000;
- this->direction = GetFacingDirection(this,&gPlayerEntity);
+ this->direction = GetFacingDirection(this, &gPlayerEntity);
if (this->direction & 0xf)
- this->spriteSettings.b.flipX = (this->direction >> 4)^1;
+ this->spriteSettings.b.flipX = (this->direction >> 4) ^ 1;
EnqueueSFX(0xd6);
}
-
// clang-format off
void (*const gUnk_080CBB64[])(Entity*) = {
sub_08022934,
diff --git a/src/enemy/enemy4D.c b/src/enemy/enemy4D.c
index 3c168052..a29157bc 100644
--- a/src/enemy/enemy4D.c
+++ b/src/enemy/enemy4D.c
@@ -52,4 +52,4 @@ void sub_0803EB44(Entity* this) {
InitAnimationForceUpdate(this, this->animationState << 2);
sub_0803EE8C(this);
}
-} \ No newline at end of file
+}
diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c
index 435e6b21..24f18515 100644
--- a/src/enemy/fallingBoulder.c
+++ b/src/enemy/fallingBoulder.c
@@ -143,13 +143,13 @@ void sub_0802C4B0(Entity* this) {
switch (sub_080001DA(this->field_0x7c.HALF_U.HI, this->collisionLayer)) {
case 0x1ab ... 0x1af:
- offset = 8;
+ offset = 8;
break;
case 0x1c4:
- offset = 4;
+ offset = 4;
break;
default:
- offset = 0;
+ offset = 0;
break;
}
@@ -208,7 +208,7 @@ void sub_0802C4B0(Entity* this) {
}
}
-void sub_0802C62C(Entity *this) {
+void sub_0802C62C(Entity* this) {
this->action = 1;
this->y.HALF.HI = this->field_0x82.HWORD;
this->x.HALF.HI = this->field_0x80.HWORD;
diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c
index bd033058..f7f51c71 100644
--- a/src/enemy/fireballGuy.c
+++ b/src/enemy/fireballGuy.c
@@ -95,11 +95,11 @@ void sub_08045454(Entity* this) {
u32 sub_0804A024(Entity*, u32, u32);
-void sub_08045524(Entity *this) {
+void sub_08045524(Entity* this) {
u32 tmp, tmp1, tmp2;
this->field_0x20 = 0x1c000;
- tmp = sub_0804A024(this,1,8);
+ tmp = sub_0804A024(this, 1, 8);
if (tmp != 0xff && (Random() & 3) == 0) {
this->actionDelay = Random() & 3;
this->direction = DirectionRound(tmp);
diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c
index f819287f..7ca8808a 100644
--- a/src/enemy/hangingSeed.c
+++ b/src/enemy/hangingSeed.c
@@ -50,4 +50,3 @@ void (*const gUnk_080CB588[])(Entity*) = {
HangingSeed_Hang,
};
// clang-format on
-
diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c
index 4d7e003d..18b4f87e 100644
--- a/src/enemy/keaton.c
+++ b/src/enemy/keaton.c
@@ -124,7 +124,7 @@ void sub_08032574(Entity* this) {
sub_0803275C(this);
return;
}
-
+
UpdateAnimationSingleFrame(this);
if ((this->field_0x76.HWORD & 0x7) == 0) {
sub_08032794(this);
diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c
index 5225f644..163ec9e1 100644
--- a/src/enemy/lakitu.c
+++ b/src/enemy/lakitu.c
@@ -5,62 +5,62 @@
#include "random.h"
#include "player.h"
-extern void (*const LakituActionFuncs[])(Entity *);
+extern void (*const LakituActionFuncs[])(Entity*);
// Lakitu
-extern void EnemyFunctionHandler(Entity *, void (*const funcs[])(Entity*));
+extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*));
// sub_0803C784
-extern void sub_0804AA30(Entity *, void (*const funcs[])(Entity *));
+extern void sub_0804AA30(Entity*, void (*const funcs[])(Entity*));
// sub_0803C820
-extern u32 sub_0806F520(Entity *);
+extern u32 sub_0806F520(Entity*);
// sub_0803C850
-extern void sub_0806F4E8(Entity *);
+extern void sub_0806F4E8(Entity*);
// Lakitu_Initialize
-extern void sub_0804A720(Entity *);
+extern void sub_0804A720(Entity*);
// Lakitu_Cloudless
-extern u32 sub_08003FC4(Entity *, u32);
+extern u32 sub_08003FC4(Entity*, u32);
// sub_0803CA4C
-extern u32 sub_080041A0(Entity *, Entity *, u32, u32);
+extern u32 sub_080041A0(Entity*, Entity*, u32, u32);
// sub_0803CAD0
-extern u32 sub_080AEFE0(Entity *);
+extern u32 sub_080AEFE0(Entity*);
// Lakitu_SpawnLightning
void PositionRelative(Entity*, Entity*, s32, s32);
extern void EnqueueSFX(u32);
// sub_0803CC08
-extern void DeleteEntity(Entity *);
+extern void DeleteEntity(Entity*);
// Part of function tables
-extern void sub_08001324(Entity *);
-extern void sub_0804A7D4(Entity *);
-extern void sub_08001242(Entity *);
+extern void sub_08001324(Entity*);
+extern void sub_0804A7D4(Entity*);
+extern void sub_08001242(Entity*);
// Used in multiple functions
-extern Entity *CreateFx(Entity*, u32, u32);
-extern Entity *sub_0804A98C(Entity *positionEntity, u8 subtype, u8 form); // Creates a projectile positioned at the given entity
-extern void UpdateAnimationSingleFrame(Entity *);
-extern void InitAnimationForceUpdate(Entity *, u32);
-extern u32 sub_0806FCB8(Entity *, u32, u32, u32);
-extern u32 GetFacingDirection(Entity *, Entity *);
-
+extern Entity* CreateFx(Entity*, u32, u32);
+extern Entity* sub_0804A98C(Entity* positionEntity, u8 subtype,
+ u8 form); // Creates a projectile positioned at the given entity
+extern void UpdateAnimationSingleFrame(Entity*);
+extern void InitAnimationForceUpdate(Entity*, u32);
+extern u32 sub_0806FCB8(Entity*, u32, u32, u32);
+extern u32 GetFacingDirection(Entity*, Entity*);
// Forward references to functions in lakitu.c
-extern void sub_0803CAD0(Entity *);
-extern void sub_0803CBAC(Entity *);
-extern void sub_0803CA84(Entity *, u32);
-extern bool32 sub_0803CA4C(Entity *);
-extern bool32 sub_0803CB04(Entity *);
-extern void Lakitu_SpawnLightning(Entity *);
-extern void sub_0803CB34(Entity *);
-extern void sub_0803CC08(Entity *this);
+extern void sub_0803CAD0(Entity*);
+extern void sub_0803CBAC(Entity*);
+extern void sub_0803CA84(Entity*, u32);
+extern bool32 sub_0803CA4C(Entity*);
+extern bool32 sub_0803CB04(Entity*);
+extern void Lakitu_SpawnLightning(Entity*);
+extern void sub_0803CB34(Entity*);
+extern void sub_0803CC08(Entity* this);
enum {
INIT,
@@ -79,21 +79,21 @@ typedef struct {
} PACKED OffsetCoords;
// sub_0803CC08
-extern void DeleteEntity(Entity *);
+extern void DeleteEntity(Entity*);
// Variables
-extern void (*const gUnk_080D0110[])(Entity *);
-extern void (*const gUnk_080D0128[])(Entity *);
-extern void (*const gUnk_080D0148[])(Entity *);
+extern void (*const gUnk_080D0110[])(Entity*);
+extern void (*const gUnk_080D0128[])(Entity*);
+extern void (*const gUnk_080D0148[])(Entity*);
extern const OffsetCoords gUnk_080D0154[];
-void Lakitu(Entity *this) {
+void Lakitu(Entity* this) {
EnemyFunctionHandler(this, gUnk_080D0110);
SetChildOffset(this, 0, 1, -16);
}
-void Lakitu_DoAction(Entity *this) {
+void Lakitu_DoAction(Entity* this) {
if (this->action != 0 && this->action != 7) {
sub_0803CAD0(this);
}
@@ -101,15 +101,14 @@ void Lakitu_DoAction(Entity *this) {
LakituActionFuncs[this->action](this);
}
-void sub_0803C784(Entity *this) {
+void sub_0803C784(Entity* this) {
if ((this->bitfield & 0x7f) == 0x1d) {
this->field_0x20 = 0x20000;
sub_0803CBAC(this);
- }
- else {
+ } else {
if (this->damageType == 0x43) {
- Entity *fx = CreateFx(this, 2, 0);
+ Entity* fx = CreateFx(this, 2, 0);
if (fx != NULL) {
u32 angle = (this->field_0x3e ^ 0x10) << 3;
@@ -139,19 +138,19 @@ void sub_0803C784(Entity *this) {
sub_0804AA30(this, gUnk_080D0110);
}
-void sub_0803C820(Entity *this) {
+void sub_0803C820(Entity* this) {
if (sub_0806F520(this)) {
gUnk_080D0148[this->previousActionFlag](this);
}
}
-void sub_0803C844(Entity *this) {
+void sub_0803C844(Entity* this) {
this->previousActionFlag = 1;
this->field_0x1d = 0x3c;
}
-void sub_0803C850(Entity *this) {
- Entity *cloud = this->attachedEntity;
+void sub_0803C850(Entity* this) {
+ Entity* cloud = this->attachedEntity;
if (cloud != NULL) {
cloud->spriteOffsetX = this->spriteOffsetX;
}
@@ -159,13 +158,13 @@ void sub_0803C850(Entity *this) {
sub_0806F4E8(this);
}
-void sub_0803C86C(Entity *this) {
+void sub_0803C86C(Entity* this) {
sub_0803CBAC(this);
this->attachedEntity = NULL;
}
-void Lakitu_Initialize(Entity *this) {
- Entity *cloud = sub_0804A98C(this, 17, 0);
+void Lakitu_Initialize(Entity* this) {
+ Entity* cloud = sub_0804A98C(this, 17, 0);
if (cloud == NULL) {
return;
}
@@ -185,7 +184,7 @@ void Lakitu_Initialize(Entity *this) {
this->field_0x76.HWORD = this->y.HALF.HI;
}
-void Lakitu_Hide(Entity *this) {
+void Lakitu_Hide(Entity* this) {
sub_0803CA84(this, 0);
if (sub_0803CA4C(this)) {
@@ -194,7 +193,7 @@ void Lakitu_Hide(Entity *this) {
}
}
-void Lakitu_EndHide(Entity *this) {
+void Lakitu_EndHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3) {
@@ -207,7 +206,7 @@ void Lakitu_EndHide(Entity *this) {
}
}
-void Lakitu_Idle(Entity *this) {
+void Lakitu_Idle(Entity* this) {
if (sub_0803CB04(this)) {
return;
}
@@ -217,13 +216,12 @@ void Lakitu_Idle(Entity *this) {
this->damageType = 0x43;
InitAnimationForceUpdate(this, this->animationState + 0xc);
- }
- else {
+ } else {
sub_0803CA84(this, 4);
}
}
-void Lakitu_BeginHide(Entity *this) {
+void Lakitu_BeginHide(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3 != 0) {
@@ -234,7 +232,7 @@ void Lakitu_BeginHide(Entity *this) {
}
}
-void Lakitu_Lightning(Entity *this) {
+void Lakitu_Lightning(Entity* this) {
UpdateAnimationSingleFrame(this);
if (this->frames.b.f3 == 0) {
@@ -250,8 +248,7 @@ void Lakitu_Lightning(Entity *this) {
this->actionDelay = 0xf;
this->field_0x78.HALF.HI = TRUE;
- }
- else {
+ } else {
this->actionDelay = 0x1e;
this->field_0x78.HALF.HI = FALSE;
@@ -260,17 +257,16 @@ void Lakitu_Lightning(Entity *this) {
}
}
-void Lakitu_LightningDelay(Entity *this) {
+void Lakitu_LightningDelay(Entity* this) {
this->actionDelay--;
if (this->actionDelay != 0) {
return;
}
-
+
if (this->field_0x78.HALF.HI == 1) {
sub_0803CB34(this);
- }
- else {
+ } else {
this->action = IDLE;
this->actionDelay = 0xb4;
@@ -278,7 +274,7 @@ void Lakitu_LightningDelay(Entity *this) {
}
}
-void Lakitu_Cloudless(Entity *this) {
+void Lakitu_Cloudless(Entity* this) {
if (sub_08003FC4(this, 0x1800) == 0 && this->animIndex <= 19) {
InitAnimationForceUpdate(this, this->animationState + 20);
@@ -289,7 +285,7 @@ void Lakitu_Cloudless(Entity *this) {
sub_0803CC08(this);
}
-bool32 sub_0803CA4C(Entity *this) {
+bool32 sub_0803CA4C(Entity* this) {
if (sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) {
if (sub_080041A0(this, &gPlayerEntity, 0x70, 0x50)) {
return 1;
@@ -299,10 +295,10 @@ bool32 sub_0803CA4C(Entity *this) {
return 0;
}
-void sub_0803CA84(Entity *this, u32 unkParameter) {
+void sub_0803CA84(Entity* this, u32 unkParameter) {
u32 altAnimState = GetFacingDirection(this, &gPlayerEntity);
- if (((altAnimState - 3) & 7) > 2 || ((this->animationState - (altAnimState >> 3)) & 3) > 1) {
+ if (((altAnimState - 3) & 7) > 2 || ((this->animationState - (altAnimState >> 3)) & 3) > 1) {
altAnimState = DirectionRoundUp(altAnimState) >> 3;
if (altAnimState != this->animationState) {
@@ -314,23 +310,23 @@ void sub_0803CA84(Entity *this, u32 unkParameter) {
}
}
-void sub_0803CAD0(Entity *this) {
+void sub_0803CAD0(Entity* this) {
if (sub_0806FCB8(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) {
- this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD);
+ this->direction =
+ sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD);
sub_080AEFE0(this);
}
}
-bool32 sub_0803CB04(Entity *this) {
+bool32 sub_0803CB04(Entity* this) {
bool32 returnValue;
u8 delay;
delay = --this->actionDelay;
if (delay != 0) {
returnValue = 0;
- }
- else {
+ } else {
sub_0803CB34(this);
this->field_0x78.HALF.HI = delay;
@@ -341,7 +337,7 @@ bool32 sub_0803CB04(Entity *this) {
return returnValue;
}
-void sub_0803CB34(Entity *this) {
+void sub_0803CB34(Entity* this) {
this->action = LIGHTNING_THROW;
this->damageType = 0xa6;
@@ -350,9 +346,9 @@ void sub_0803CB34(Entity *this) {
InitAnimationForceUpdate(this, this->animationState + 8);
}
-void Lakitu_SpawnLightning(Entity *this) {
- Entity *lightning;
- const OffsetCoords *offset;
+void Lakitu_SpawnLightning(Entity* this) {
+ Entity* lightning;
+ const OffsetCoords* offset;
lightning = sub_0804A98C(this, 18, 0);
@@ -369,8 +365,8 @@ void Lakitu_SpawnLightning(Entity *this) {
EnqueueSFX(0x193);
}
-void sub_0803CBAC(Entity *this) {
- Entity *cloud;
+void sub_0803CBAC(Entity* this) {
+ Entity* cloud;
cloud = this->attachedEntity;
if (cloud != NULL) {
@@ -390,9 +386,9 @@ void sub_0803CBAC(Entity *this) {
InitAnimationForceUpdate(this, this->animationState + 16);
}
-void sub_0803CC08(Entity *this) {
- Entity *cloud;
- Entity *fx;
+void sub_0803CC08(Entity* this) {
+ Entity* cloud;
+ Entity* fx;
cloud = this->attachedEntity;
if (cloud == NULL) {
@@ -439,27 +435,16 @@ void sub_0803CC08(Entity *this) {
DeleteEntity(cloud);
}
-void (*const gUnk_080D0110[])(Entity *) = {
- Lakitu_DoAction,
- sub_0803C784,
- sub_08001324,
- sub_0804A7D4,
- sub_08001242,
- sub_0803C820,
+void (*const gUnk_080D0110[])(Entity*) = {
+ Lakitu_DoAction, sub_0803C784, sub_08001324, sub_0804A7D4, sub_08001242, sub_0803C820,
};
-void (*const LakituActionFuncs[])(Entity *) = {
- Lakitu_Initialize,
- Lakitu_Hide,
- Lakitu_EndHide,
- Lakitu_Idle,
- Lakitu_BeginHide,
- Lakitu_Lightning,
- Lakitu_LightningDelay,
- Lakitu_Cloudless,
+void (*const LakituActionFuncs[])(Entity*) = {
+ Lakitu_Initialize, Lakitu_Hide, Lakitu_EndHide, Lakitu_Idle,
+ Lakitu_BeginHide, Lakitu_Lightning, Lakitu_LightningDelay, Lakitu_Cloudless,
};
-void (*const gUnk_080D0148[])(Entity *) = {
+void (*const gUnk_080D0148[])(Entity*) = {
sub_0803C844,
sub_0803C850,
sub_0803C86C,
diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c
index 85baf8ca..4ee9063b 100644
--- a/src/enemy/lakituCloud.c
+++ b/src/enemy/lakituCloud.c
@@ -2,61 +2,60 @@
#include "entity.h"
#include "player.h"
-extern u32 GetNextFunction(Entity *);
+extern u32 GetNextFunction(Entity*);
-extern void sub_0804A7D4(Entity *);
-extern void sub_08001242(Entity *);
+extern void sub_0804A7D4(Entity*);
+extern void sub_08001242(Entity*);
-extern void (*const gUnk_080D0418[6])(Entity *);
-extern void (*const gUnk_080D0430[3])(Entity *);
-extern void (*const gUnk_080D043C[3])(Entity *);
+extern void (*const gUnk_080D0418[6])(Entity*);
+extern void (*const gUnk_080D0430[3])(Entity*);
+extern void (*const gUnk_080D043C[3])(Entity*);
-extern bool32 sub_0806F3E4(Entity *);
-extern bool32 sub_0806F520(Entity *);
+extern bool32 sub_0806F3E4(Entity*);
+extern bool32 sub_0806F520(Entity*);
-extern void sub_0800449C(Entity *, u32);
-extern void sub_0803CE14(Entity *);
-extern void sub_0803CE3C(Entity *);
-extern Entity *GetCurrentRoomProperty(u8);
-extern void sub_0806F4E8(Entity *);
-extern void sub_0806F69C(Entity *);
+extern void sub_0800449C(Entity*, u32);
+extern void sub_0803CE14(Entity*);
+extern void sub_0803CE3C(Entity*);
+extern Entity* GetCurrentRoomProperty(u8);
+extern void sub_0806F4E8(Entity*);
+extern void sub_0806F69C(Entity*);
extern void sub_08079D84(void);
-extern void sub_080A2CC0(Entity *, Entity **, u16 *);
+extern void sub_080A2CC0(Entity*, Entity**, u16*);
-void LakituCloud(Entity *this) {
+void LakituCloud(Entity* this) {
gUnk_080D0418[GetNextFunction(this)](this);
}
-void sub_0803CCD4(Entity *this) {
+void sub_0803CCD4(Entity* this) {
gUnk_080D0430[this->action](this);
}
-void sub_0803CCEC(Entity *this) {
+void sub_0803CCEC(Entity* this) {
this->field_0x42 = 0;
sub_0803CCD4(this);
}
-void sub_0803CCFC(Entity *this) {
+void sub_0803CCFC(Entity* this) {
if (sub_0806F520(this) == 0) {
if (this->previousActionFlag == 2) {
sub_0803CE3C(this);
}
- }
- else {
+ } else {
gUnk_080D043C[this->previousActionFlag](this);
}
}
-void sub_0803CD2C(Entity *this) {
+void sub_0803CD2C(Entity* this) {
this->previousActionFlag = 1;
this->field_0x1d = 0x3c;
}
-void sub_0803CD38(Entity *this) {
+void sub_0803CD38(Entity* this) {
sub_0806F4E8(this);
}
-void sub_0803CD40(Entity *this) {
+void sub_0803CD40(Entity* this) {
if (!sub_0806F3E4(this)) {
return;
}
@@ -69,8 +68,8 @@ void sub_0803CD40(Entity *this) {
sub_0803CE3C(this);
}
-void sub_0803CD6C(Entity *this) {
- Entity *lakitu;
+void sub_0803CD6C(Entity* this) {
+ Entity* lakitu;
this->action = 1;
this->height.HALF.HI = -2;
@@ -88,7 +87,7 @@ void sub_0803CD6C(Entity *this) {
sub_0803CE14(this);
}
-void sub_0803CDA8(Entity *this) {
+void sub_0803CDA8(Entity* this) {
UpdateAnimationSingleFrame(this);
if ((this->direction & 0x80) == 0) {
@@ -100,7 +99,7 @@ void sub_0803CDA8(Entity *this) {
}
}
-void sub_0803CDD8(Entity *this) {
+void sub_0803CDD8(Entity* this) {
u8 one;
u8 draw;
@@ -112,14 +111,14 @@ void sub_0803CDD8(Entity *this) {
if (this->actionDelay == 0) {
this->action = 1;
-
+
this->flags |= 0x80;
this->spriteSettings.b.draw = one;
}
}
-void sub_0803CE14(Entity *this) {
+void sub_0803CE14(Entity* this) {
u8 direction;
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x74.HWORD);
@@ -134,7 +133,7 @@ void sub_0803CE14(Entity *this) {
InitAnimationForceUpdate(this, direction);
}
-void sub_0803CE3C(Entity *this) {
+void sub_0803CE3C(Entity* this) {
CreateFx(this, 2, 0);
this->action = 2;
@@ -152,22 +151,17 @@ void sub_0803CE3C(Entity *this) {
sub_0803CE14(this);
}
-void (*const gUnk_080D0418[])(Entity *) = {
- sub_0803CCD4,
- sub_0803CCD4,
- sub_0803CCEC,
- sub_0804A7D4,
- sub_08001242,
- sub_0803CCFC,
+void (*const gUnk_080D0418[])(Entity*) = {
+ sub_0803CCD4, sub_0803CCD4, sub_0803CCEC, sub_0804A7D4, sub_08001242, sub_0803CCFC,
};
-void (*const gUnk_080D0430[])(Entity *) = {
+void (*const gUnk_080D0430[])(Entity*) = {
sub_0803CD6C,
sub_0803CDA8,
sub_0803CDD8,
};
-void (*const gUnk_080D043C[])(Entity *) = {
+void (*const gUnk_080D043C[])(Entity*) = {
sub_0803CD2C,
sub_0803CD38,
sub_0803CD40,
diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c
index ca50374f..43c2417d 100644
--- a/src/enemy/likeLike.c
+++ b/src/enemy/likeLike.c
@@ -265,23 +265,10 @@ void sub_08028224(u32 param_1) {
TextboxNoOverlapFollow(0x579);
}
-
-void (*const gUnk_080CC6FC[])(Entity *) = {
- sub_08027D8C,
- sub_08027DA4,
- sub_08001324,
- sub_08027E40,
- sub_08001242,
- nullsub_139,
+void (*const gUnk_080CC6FC[])(Entity*) = {
+ sub_08027D8C, sub_08027DA4, sub_08001324, sub_08027E40, sub_08001242, nullsub_139,
};
-void (*const gUnk_080CC714[])(Entity *) = {
- sub_08027E70,
- sub_08027EFC,
- nullsub_12,
- sub_08027F84,
- sub_08027FB4,
- sub_08027FE0,
- sub_0802802C,
- sub_0802805C,
+void (*const gUnk_080CC714[])(Entity*) = {
+ sub_08027E70, sub_08027EFC, nullsub_12, sub_08027F84, sub_08027FB4, sub_08027FE0, sub_0802802C, sub_0802805C,
};
diff --git a/src/enemy/miniSlime.c b/src/enemy/miniSlime.c
index 973f8839..55af91ab 100644
--- a/src/enemy/miniSlime.c
+++ b/src/enemy/miniSlime.c
@@ -65,7 +65,7 @@ void sub_080452E4(Entity* this) {
this->actionDelay = (Random() & 0x1f) + 1;
}
-void sub_080452FC(Entity *this) {
+void sub_080452FC(Entity* this) {
u32 cVar2, bVar3;
GetNextFrame(this);
if (--this->actionDelay == 0) {
diff --git a/src/enemy/moldorm.c b/src/enemy/moldorm.c
index 3338a15a..6f86d987 100644
--- a/src/enemy/moldorm.c
+++ b/src/enemy/moldorm.c
@@ -173,7 +173,7 @@ void sub_08022F14(Entity* this) {
this->direction += this->field_0x78.HALF.LO;
this->direction &= 0x1f;
-
+
this->animationState = ((this->direction + 2) & 0x1c) >> 2;
this->frameIndex = this->animationState;
}
diff --git a/src/enemy/peahat.c b/src/enemy/peahat.c
index 664e1615..828c2c4d 100644
--- a/src/enemy/peahat.c
+++ b/src/enemy/peahat.c
@@ -356,7 +356,7 @@ void sub_080205F8(Entity* this) {
this->actionDelay = 60;
}
-void sub_08020604(Entity *this){
+void sub_08020604(Entity* this) {
if (!sub_08049FA0(this) && (Random() & 3)) {
this->direction = sub_08049EE4(this);
} else {
@@ -365,8 +365,6 @@ void sub_08020604(Entity *this){
}
}
-
-
// clang-format off
void (*const gPeahatFunctions[])(Entity*) = {
Peahat_OnTick,
@@ -414,4 +412,3 @@ const s8 gUnk_080CA5D4[] = {
};
*/
// clang-format on
-
diff --git a/src/enemy/smallPesto.c b/src/enemy/smallPesto.c
index 299d9219..b01daa8d 100644
--- a/src/enemy/smallPesto.c
+++ b/src/enemy/smallPesto.c
@@ -24,99 +24,98 @@ void sub_08031840(Entity*);
extern BoundingBox gUnk_080CE560;
-void SmallPesto(Entity *this){
- gUnk_080CE530[GetNextFunction(this)](this);
+void SmallPesto(Entity* this) {
+ gUnk_080CE530[GetNextFunction(this)](this);
}
-void sub_08031680(Entity *this){
- gUnk_080CE548[this->action](this);
+void sub_08031680(Entity* this) {
+ gUnk_080CE548[this->action](this);
}
-void nullsub_152(){}
+void nullsub_152() {
+}
-void sub_0803169C(Entity *this){
- s32 iVar1;
-
- GetNextFrame(this);
- iVar1 = sub_0806F520(this);
- if (iVar1 == 0) {
- this->action = 1;
- this->previousActionFlag = 0;
- this->flags = this->flags | 0x80;
- this->nonPlanarMovement = 0x40;
- this->field_0xf = 1;
- }
- else {
- gUnk_080CE554[this->previousActionFlag](this);
- }
+void sub_0803169C(Entity* this) {
+ s32 iVar1;
+
+ GetNextFrame(this);
+ iVar1 = sub_0806F520(this);
+ if (iVar1 == 0) {
+ this->action = 1;
+ this->previousActionFlag = 0;
+ this->flags = this->flags | 0x80;
+ this->nonPlanarMovement = 0x40;
+ this->field_0xf = 1;
+ } else {
+ gUnk_080CE554[this->previousActionFlag](this);
+ }
}
-void sub_080316DC(Entity *this){
- this->previousActionFlag = 1;
- this->field_0x1d = 0x3c;
+void sub_080316DC(Entity* this) {
+ this->previousActionFlag = 1;
+ this->field_0x1d = 0x3c;
}
-void sub_080316E8(Entity *this){
+void sub_080316E8(Entity* this) {
sub_0806F4E8(this);
}
-void sub_080316F0(Entity *this){
- if (sub_0806F3E4()) {
- sub_0804A7D4(this);
- }
+void sub_080316F0(Entity* this) {
+ if (sub_0806F3E4()) {
+ sub_0804A7D4(this);
+ }
}
-void sub_08031704(Entity *this){
- sub_0804A720(this);
- sub_080317F8(this);
+void sub_08031704(Entity* this) {
+ sub_0804A720(this);
+ sub_080317F8(this);
}
-void sub_08031714(Entity* this){
+void sub_08031714(Entity* this) {
u8 newDirection;
sub_080317B4(this);
- if(--this->field_0xf == 0){
+ if (--this->field_0xf == 0) {
this->field_0xf = (Random() & 0xf) + 0x10;
- if(sub_08049FA0(this) == 0){
- if((this->field_0xf & 1) != 0){
+ if (sub_08049FA0(this) == 0) {
+ if ((this->field_0xf & 1) != 0) {
this->direction = sub_08049EE4(this);
goto _08031766;
}
}
- this->direction += 0x18;
- this->direction = ((Random() & 0xe) + this->direction) & 0x1f;
+ this->direction += 0x18;
+ this->direction = ((Random() & 0xe) + this->direction) & 0x1f;
_08031766:
- sub_080317E0(this);
+ sub_080317E0(this);
}
}
-void sub_08031770(Entity* this){
- if(this->field_0x80.HWORD != 0){
- if(--this->field_0x80.HWORD == 0){
+void sub_08031770(Entity* this) {
+ if (this->field_0x80.HWORD != 0) {
+ if (--this->field_0x80.HWORD == 0) {
sub_08031840(this);
}
- }else if(this->attachedEntity == NULL){
+ } else if (this->attachedEntity == NULL) {
this->field_0x80.HWORD = (Random() & 0x7f) | (0x80 << 2);
- }else{
- if(this->attachedEntity->next == NULL){
+ } else {
+ if (this->attachedEntity->next == NULL) {
this->attachedEntity = NULL;
}
}
return;
}
-void sub_080317B4(Entity* this){
- this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd;
+void sub_080317B4(Entity* this) {
+ this->height.HALF.HI = ((Random() & 0x30) != 0) ? -0xc : -0xd;
sub_0806F69C(this);
GetNextFrame(this);
}
-
-void sub_080317E0(Entity *this){
+void sub_080317E0(Entity* this) {
this->animationState = ((u8)(this->direction + 2) & 0x1c) >> 2;
InitializeAnimation(this, this->animationState);
}
-void sub_080317F8(Entity *this){
+void sub_080317F8(Entity* this) {
u8 newDirection = Random() & 0x18;
this->action = 1;
this->height.HALF.HI = 0x0000FFF4;
@@ -130,13 +129,12 @@ void sub_080317F8(Entity *this){
this->field_0xf = 0x20;
}
-void sub_08031840(Entity* this){
- Entity *enemy = CreateEnemy(0x2d, this->entityType.form);
- if(enemy!= NULL){
+void sub_08031840(Entity* this) {
+ Entity* enemy = CreateEnemy(0x2d, this->entityType.form);
+ if (enemy != NULL) {
CopyPosition(this, enemy);
enemy->parent = this;
this->attachedEntity = enemy;
enemy->entityType.parameter = 1;
}
}
-
diff --git a/src/enemy/treeItem.c b/src/enemy/treeItem.c
index 24cd16bb..38fce4c3 100755..100644
--- a/src/enemy/treeItem.c
+++ b/src/enemy/treeItem.c
@@ -87,10 +87,8 @@ static bool32 ShouldSpawnTreeItem(Entity* this) {
}
playerState = gPlayerEntity.animationState;
- if ((playerState == 0 && expectedStateY == 0) ||
- (playerState == 4 && expectedStateY == 4) ||
- (playerState == 6 && expectedStateX == 6) ||
- (playerState == 2 && expectedStateX == 2)) {
+ if ((playerState == 0 && expectedStateY == 0) || (playerState == 4 && expectedStateY == 4) ||
+ (playerState == 6 && expectedStateX == 6) || (playerState == 2 && expectedStateX == 2)) {
return TRUE;
}
diff --git a/src/entity.c b/src/entity.c
index 1b8d1cb1..4327bd42 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -317,10 +317,8 @@ Entity* FindEntityInListByForm(int type, int subtype, int listIndex, int form, i
list = &gEntityLists[listIndex];
for (i = list->first; (u32)i != (u32)list; i = i->next) {
- if (type == i->entityType.type
- && subtype == i->entityType.subtype
- && form == i->entityType.form
- && parameter == i->entityType.parameter)
+ if (type == i->entityType.type && subtype == i->entityType.subtype && form == i->entityType.form &&
+ parameter == i->entityType.parameter)
return i;
}
return NULL;
diff --git a/src/flags.c b/src/flags.c
index 5cce7c9e..6f1d5d56 100644
--- a/src/flags.c
+++ b/src/flags.c
@@ -17,20 +17,19 @@ u32 CheckFlags(u32 flags) {
s32 uVar1;
s32 index;
s32 length;
- index = flags & 0x3ff;
- length = (((flags & (0xf0) << 0x6) >> 0xa) + 1);
- uVar1 = (flags & 0xc000) >> 0xe;
- switch ((u32)uVar1) {
- case 2:
- return CheckRoomFlags(index, length);
- case 0:
- return CheckLocalFlags(index, length);
- case 1:
- return CheckGlobalFlags(index, length);
- default:
- return 0;
- }
-
+ index = flags & 0x3ff;
+ length = (((flags & (0xf0) << 0x6) >> 0xa) + 1);
+ uVar1 = (flags & 0xc000) >> 0xe;
+ switch ((u32)uVar1) {
+ case 2:
+ return CheckRoomFlags(index, length);
+ case 0:
+ return CheckLocalFlags(index, length);
+ case 1:
+ return CheckGlobalFlags(index, length);
+ default:
+ return 0;
+ }
}
u32 CheckGlobalFlag(u32 flag) {
diff --git a/src/initializePlayer.c b/src/initializePlayer.c
index bf112c39..966b71fb 100644
--- a/src/initializePlayer.c
+++ b/src/initializePlayer.c
@@ -13,17 +13,16 @@ extern Entity gPlayerEntity;
extern u8 gUnk_080FCAC8[];
-void InitializePlayer(void)
-{
+void InitializePlayer(void) {
Entity* pl;
sub_080784C8();
- _DmaZero((void *)&gUnk_03000B80, 0x70);
- _DmaZero((void *)&gPlayerState, 0xb0);
+ _DmaZero((void*)&gUnk_03000B80, 0x70);
+ _DmaZero((void*)&gPlayerState, 0xb0);
_DmaFill32(0xffffffff, &gPlayerState.field_0x40, 0x40);
pl = &gPlayerEntity;
- _DmaZero((void *)pl, 0x88);
+ _DmaZero((void*)pl, 0x88);
gRoomControls.cameraTarget = pl;
gPlayerState.playerAction = gUnk_080FCAC8[gScreenTransition.field_0xf];
if (!CheckGlobalFlag(0x14)) {
@@ -54,15 +53,15 @@ void InitializePlayer(void)
case 0xc:
gPlayerState.field_0x34[4] = 4;
}
- pl->entityType.type = 1;
- pl->flags |= 0xa0;
- pl->spritePriority.b0 = 4;
- pl->currentHealth = gUnk_02002A40.stats.health;
- pl->x.HALF.HI = gScreenTransition.playerStartPos.HALF.x;
- pl->y.HALF.HI = gScreenTransition.playerStartPos.HALF.y;
- pl->animationState = gScreenTransition.playerState;
- pl->collisionLayer = gScreenTransition.playerLayer;
- UpdateSpriteForCollisionLayer(pl);
- AppendEntityToList(pl, 1);
- sub_08017640();
+ pl->entityType.type = 1;
+ pl->flags |= 0xa0;
+ pl->spritePriority.b0 = 4;
+ pl->currentHealth = gUnk_02002A40.stats.health;
+ pl->x.HALF.HI = gScreenTransition.playerStartPos.HALF.x;
+ pl->y.HALF.HI = gScreenTransition.playerStartPos.HALF.y;
+ pl->animationState = gScreenTransition.playerState;
+ pl->collisionLayer = gScreenTransition.playerLayer;
+ UpdateSpriteForCollisionLayer(pl);
+ AppendEntityToList(pl, 1);
+ sub_08017640();
}
diff --git a/src/input.c b/src/input.c
index b9ea2c72..64386be6 100644
--- a/src/input.c
+++ b/src/input.c
@@ -4,29 +4,25 @@
static void StoreKeyInput(Input*, u32);
-void ReadKeyInput(void)
-{
+void ReadKeyInput(void) {
u32 keyInput = ~REG_KEYINPUT & KEYS_MASK;
StoreKeyInput(&gUnk_03000FF0, keyInput);
}
-static void StoreKeyInput(Input *input, u32 keyInput)
-{
- u32 heldKeys = input->heldKeys;
- u32 difference = keyInput & ~heldKeys;
- input->newKeys = difference;
- if (keyInput == heldKeys) {
- if (--input->unk7 == 0) {
- input->unk7 = 4;
- input->unk4 = keyInput;
+static void StoreKeyInput(Input* input, u32 keyInput) {
+ u32 heldKeys = input->heldKeys;
+ u32 difference = keyInput & ~heldKeys;
+ input->newKeys = difference;
+ if (keyInput == heldKeys) {
+ if (--input->unk7 == 0) {
+ input->unk7 = 4;
+ input->unk4 = keyInput;
+ } else {
+ input->unk4 = 0;
+ }
+ } else {
+ input->unk7 = 0x14;
+ input->unk4 = difference;
}
- else {
- input->unk4 = 0;
- }
- }
- else {
- input->unk7 = 0x14;
- input->unk4 = difference;
- }
- input->heldKeys = keyInput;
+ input->heldKeys = keyInput;
}
diff --git a/src/intro.c b/src/intro.c
index 53466e3b..090c9b9d 100644
--- a/src/intro.c
+++ b/src/intro.c
@@ -48,52 +48,43 @@ static void (*const sIntroSequenceHandlers[])(void) = {
};
static const u16 sLightRaysAlphaBlends[] = {
- BLDALPHA_BLEND(9, 9),
- BLDALPHA_BLEND(8, 10),
- BLDALPHA_BLEND(7, 11),
- BLDALPHA_BLEND(6, 12),
- BLDALPHA_BLEND(5, 13),
- BLDALPHA_BLEND(6, 12),
- BLDALPHA_BLEND(7, 11),
- BLDALPHA_BLEND(8, 10),
+ BLDALPHA_BLEND(9, 9), BLDALPHA_BLEND(8, 10), BLDALPHA_BLEND(7, 11), BLDALPHA_BLEND(6, 12),
+ BLDALPHA_BLEND(5, 13), BLDALPHA_BLEND(6, 12), BLDALPHA_BLEND(7, 11), BLDALPHA_BLEND(8, 10),
};
-static u32 AdvanceIntroSequence(u32 transition)
-{
+static u32 AdvanceIntroSequence(u32 transition) {
gUnk_02032EC0.transitionType = transition;
gUnk_03001000.funcIndex = 2;
_DmaZero(&gIntroState, sizeof(gIntroState));
DoFade(7, 8);
}
-void HandleIntroScreen(void)
-{
- sub_080AD90C();
- switch (gUnk_03001000.funcIndex) {
- case 0:
- sub_08056418();
- _DmaZero(&gUnk_02032EC0, 0x3b4);
- AdvanceIntroSequence(0);
- break;
- case 1:
- sIntroSequenceHandlers[gUnk_02032EC0.transitionType]();
- break;
- case 2:
- if (gFadeControl.active) {
- return;
- }
- sub_0801DA90(1);
- gUnk_03001000.funcIndex = 1;
- break;
- }
- sub_080AD918();
+void HandleIntroScreen(void) {
+ sub_080AD90C();
+ switch (gUnk_03001000.funcIndex) {
+ case 0:
+ sub_08056418();
+ _DmaZero(&gUnk_02032EC0, 0x3b4);
+ AdvanceIntroSequence(0);
+ break;
+ case 1:
+ sIntroSequenceHandlers[gUnk_02032EC0.transitionType]();
+ break;
+ case 2:
+ if (gFadeControl.active) {
+ return;
+ }
+ sub_0801DA90(1);
+ gUnk_03001000.funcIndex = 1;
+ break;
+ }
+ sub_080AD918();
}
-static void HandleNintendoCapcomLogos(void)
-{
+static void HandleNintendoCapcomLogos(void) {
u32 advance;
u32 paletteGroup;
-
+
advance = GetAdvanceState();
if (gIntroState.state == 0) {
sub_0801DA90(1);
@@ -101,10 +92,9 @@ static void HandleNintendoCapcomLogos(void)
gIntroState.timer = 120;
LoadGfxGroup(16);
LoadGfxGroup(1);
- if (((struct_02000000 *)0x2000000)->gameLanguage == 0) {
+ if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
paletteGroup = 1;
- }
- else {
+ } else {
paletteGroup = 2;
}
LoadPaletteGroup(paletteGroup);
@@ -126,8 +116,7 @@ static void HandleNintendoCapcomLogos(void)
extern u16 gUnk_03001010[5];
-static void HandleTitlescreen(void)
-{
+static void HandleTitlescreen(void) {
int advance;
u32 paletteGroup;
@@ -145,8 +134,7 @@ static void HandleTitlescreen(void)
LoadGfxGroup(2);
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
paletteGroup = 3;
- }
- else {
+ } else {
paletteGroup = 4;
}
LoadPaletteGroup(paletteGroup);
@@ -158,8 +146,7 @@ static void HandleTitlescreen(void)
gScreen.affine.bg3Control = 0x1e03;
gScreen.lcd.displayControl |= 0x1e00;
gScreen.bg.bg2xOffset = 0xff60;
- }
- else {
+ } else {
gScreen.controls.layerFXControl = 0x241;
gScreen.controls.alphaBlend = BLDALPHA_BLEND(9, 9);
gScreen.bg.bg0Control = 0x1d02;
@@ -171,7 +158,7 @@ static void HandleTitlescreen(void)
UpdateSwordBgAffineData();
}
sub_080A3210();
- PlaySFX(3); //fanfare
+ PlaySFX(3); // fanfare
DoFade(6, 8);
break;
case 1:
@@ -180,8 +167,7 @@ static void HandleTitlescreen(void)
}
if (((struct_02000000*)0x2000000)->gameLanguage == 0) {
HandleJapaneseTitlescreenAnimationIntro();
- }
- else {
+ } else {
HandleTitlescreenAnimationIntro();
}
break;
@@ -197,8 +183,7 @@ static void HandleTitlescreen(void)
if (advance != ADVANCE_NONE) {
if (advance == ADVANCE_KEY_PRESSED) {
PlaySFX(0x6a);
- }
- else {
+ } else {
advance = ADVANCE_NONE;
}
AdvanceIntroSequence(advance);
@@ -208,7 +193,7 @@ static void HandleTitlescreen(void)
if ((gIntroState.timer & 0x20) == 0) {
gUnk_03001010[4] = 0xe000;
gUnk_03001010[1] = 0x84;
- sub_080ADA14(0x1ff,0);
+ sub_080ADA14(0x1ff, 0);
}
}
if (gIntroState.gameLanguage != ((struct_02000000*)0x2000000)->gameLanguage) {
@@ -230,8 +215,7 @@ static void UpdatePressStartIcon(void) {
return;
}
-static void UpdateSwordBgAffineData(void)
-{
+static void UpdateSwordBgAffineData(void) {
struct BgAffineSrcData aff;
aff.texY = 0x8000;
aff.texX = 0x8000;
@@ -242,9 +226,8 @@ static void UpdateSwordBgAffineData(void)
BgAffineSet(&aff, (struct BgAffineDstData*)&gBgControls, 1);
}
-static void HandleJapaneseTitlescreenAnimationIntro(void)
-{
- Entity *pEVar2;
+static void HandleJapaneseTitlescreenAnimationIntro(void) {
+ Entity* pEVar2;
switch (gIntroState.subState) {
case 0:
@@ -268,7 +251,7 @@ static void HandleJapaneseTitlescreenAnimationIntro(void)
gFadeControl.field_0x4 = -1;
gIntroState.subState++;
gIntroState.timer = 90;
- pEVar2 = CreateObject(0xb4,0,0);
+ pEVar2 = CreateObject(0xb4, 0, 0);
if (pEVar2 != NULL) {
pEVar2->x.HALF.HI = 0;
pEVar2->y.HALF.HI = 0x48;
diff --git a/src/item.c b/src/item.c
index 52b94c07..3561ba36 100644
--- a/src/item.c
+++ b/src/item.c
@@ -2,41 +2,12 @@
#include "entity.h"
#include "item.h"
-
// TODO - How does this relate to PlayerItemFunctions? Is this just a lookup table?
void (*const gItemFunctions[])(ItemBehavior*, u32) = {
- DebugItem,
- Sword,
- Sword,
- Sword,
- Sword,
- Sword,
- Sword,
- Bomb,
- Bomb,
- Bow,
- Bow,
- sub_08075D14,
- sub_08075D14,
- Shield,
- Shield,
- Lantern,
- Lantern,
- GustJar,
- PacciCane,
- MoleMitts,
- RocsCape,
- sub_08076800,
- DebugItem,
- Ocarina,
- DebugItem,
- DebugItem,
- DebugItem,
- TryPickupObject,
- JarEmpty,
- JarEmpty,
- JarEmpty,
- JarEmpty,
+ DebugItem, Sword, Sword, Sword, Sword, Sword, Sword, Bomb,
+ Bomb, Bow, Bow, sub_08075D14, sub_08075D14, Shield, Shield, Lantern,
+ Lantern, GustJar, PacciCane, MoleMitts, RocsCape, sub_08076800, DebugItem, Ocarina,
+ DebugItem, DebugItem, DebugItem, TryPickupObject, JarEmpty, JarEmpty, JarEmpty, JarEmpty,
};
extern void sub_08077E78(ItemBehavior*, u32);
@@ -141,20 +112,17 @@ void sub_08076D34(ItemBehavior* beh, u32 arg1) {
}
}
-void sub_08076D94(ItemBehavior *beh, u32 arg1)
-{
- if (sub_08077EFC(beh)) {
- gPlayerState.field_0x3[0] |= 1;
- UpdateItemAnim(beh);
- }
- else {
- gPlayerState.field_0x3[0] = 0;
- sub_08077E78(beh, arg1);
- }
+void sub_08076D94(ItemBehavior* beh, u32 arg1) {
+ if (sub_08077EFC(beh)) {
+ gPlayerState.field_0x3[0] |= 1;
+ UpdateItemAnim(beh);
+ } else {
+ gPlayerState.field_0x3[0] = 0;
+ sub_08077E78(beh, arg1);
+ }
}
-void GustJar(ItemBehavior *beh, u32 arg1)
-{
+void GustJar(ItemBehavior* beh, u32 arg1) {
gPlayerState.field_0xa8 = 3;
gUnk_0811BDF4[beh->stateID](beh, arg1);
}
diff --git a/src/item11.c b/src/item11.c
index 12d4a563..b77eae9b 100644
--- a/src/item11.c
+++ b/src/item11.c
@@ -14,69 +14,64 @@ extern BoundingBox gUnk_080B3E18;
extern u8 gUnk_080B3DE0[];
extern BoundingBox* gUnk_080B3DE8[];
-void Item11(Entity *this)
-{
- if (this->currentHealth) {
- this->hurtBlinkTime = 0;
- gUnk_080B3DD0[this->action](this);
- }
- else {
- DeleteThisEntity();
- }
+void Item11(Entity* this) {
+ if (this->currentHealth) {
+ this->hurtBlinkTime = 0;
+ gUnk_080B3DD0[this->action](this);
+ } else {
+ DeleteThisEntity();
+ }
}
-void sub_08018CBC(Entity *this)
-{
- u32 PVar1;
- u8 uVar2;
- Entity *pEVar3;
-
- *(u32 *)&this->cutsceneBeh = this->x.WORD = gPlayerEntity.x.WORD;
- *(u32 *)&this->field_0x80 = this->y.WORD = gPlayerEntity.y.WORD;
- uVar2 = this->animationState = gPlayerEntity.animationState & 0xe;
- this->direction = (u8)(uVar2 << 2);
- this->nonPlanarMovement = 0x400;
- this->damageType = 0x96;
- this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80;
- this->flags2 = gPlayerEntity.flags2;
- pEVar3 = this->attachedEntity;
- if (pEVar3 != NULL) {
- this->action = 1;
- this->flags = this->flags & 0x7f;
- this->actionDelay = 0x56;
- this->field_0x40 = 0x1c;
- this->field_0x44 = 6;
- this->boundingBox = &gUnk_080B3E18;
- this->attachedEntity->spriteOffsetX = 0;
- this->attachedEntity->spriteSettings.b.draw = 0;
- }
- else {
- if (gPlayerState.field_0x1c == 0) {
- DeleteThisEntity();
+void sub_08018CBC(Entity* this) {
+ u32 PVar1;
+ u8 uVar2;
+ Entity* pEVar3;
+
+ *(u32*)&this->cutsceneBeh = this->x.WORD = gPlayerEntity.x.WORD;
+ *(u32*)&this->field_0x80 = this->y.WORD = gPlayerEntity.y.WORD;
+ uVar2 = this->animationState = gPlayerEntity.animationState & 0xe;
+ this->direction = (u8)(uVar2 << 2);
+ this->nonPlanarMovement = 0x400;
+ this->damageType = 0x96;
+ this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x80;
+ this->flags2 = gPlayerEntity.flags2;
+ pEVar3 = this->attachedEntity;
+ if (pEVar3 != NULL) {
+ this->action = 1;
+ this->flags = this->flags & 0x7f;
+ this->actionDelay = 0x56;
+ this->field_0x40 = 0x1c;
+ this->field_0x44 = 6;
+ this->boundingBox = &gUnk_080B3E18;
+ this->attachedEntity->spriteOffsetX = 0;
+ this->attachedEntity->spriteSettings.b.draw = 0;
+ } else {
+ if (gPlayerState.field_0x1c == 0) {
+ DeleteThisEntity();
+ }
+ this->action = 2;
+ this->spriteSettings.b.draw = 1;
+ this->spriteIndex = 0xa6;
+ this->palette.raw = 0x33;
+ this->spriteVramOffset = 0;
+ (this->entityType).form = gPlayerState.field_0x1d[0] - 1;
+ this->actionDelay = gUnk_080B3DE0[(this->entityType).form * 2];
+ this->field_0x44 = gUnk_080B3DE0[(this->entityType).form * 2 + 1];
+ this->field_0x40 = 0x1b;
+ this->boundingBox = gUnk_080B3DE8[(this->entityType).form];
+ (u32*)gPlayerEntity.field_0x70.WORD = this;
+ sub_08078CD0(&gPlayerEntity);
+ (u32*)gPlayerEntity.field_0x70.WORD = pEVar3;
+ InitializeAnimation(this, (this->entityType).form + 10);
+ sub_08018FA0(this);
}
- this->action = 2;
- this->spriteSettings.b.draw = 1;
- this->spriteIndex = 0xa6;
- this->palette.raw = 0x33;
- this->spriteVramOffset = 0;
- (this->entityType).form = gPlayerState.field_0x1d[0] - 1;
- this->actionDelay = gUnk_080B3DE0[(this->entityType).form * 2];
- this->field_0x44 = gUnk_080B3DE0[(this->entityType).form * 2 + 1];
- this->field_0x40 = 0x1b;
- this->boundingBox = gUnk_080B3DE8[(this->entityType).form];
- (u32 *)gPlayerEntity.field_0x70.WORD = this;
- sub_08078CD0(&gPlayerEntity);
- (u32 *)gPlayerEntity.field_0x70.WORD = pEVar3;
- InitializeAnimation(this, (this->entityType).form + 10);
- sub_08018FA0(this);
- }
- sub_0801766C(this);
+ sub_0801766C(this);
}
-void sub_08018DE8(Entity *this)
-{
+void sub_08018DE8(Entity* this) {
u8 bVar1;
-
+
bVar1 = this->attachedEntity->field_0x3a & 4;
if (bVar1 == 0) {
gPlayerState.field_0x1c = bVar1;
diff --git a/src/loadRoom.c b/src/loadRoom.c
index 7a52709d..3e756c15 100644
--- a/src/loadRoom.c
+++ b/src/loadRoom.c
@@ -47,7 +47,7 @@ void sub_0804B058(EntityData* dat) {
}
uVar2++;
dat++;
- } while (*(u8*)dat!= 0xff);
+ } while (*(u8*)dat != 0xff);
}
}
diff --git a/src/mainLoop.c b/src/mainLoop.c
index 3ad0eaae..33c1d27a 100644
--- a/src/mainLoop.c
+++ b/src/mainLoop.c
@@ -15,12 +15,9 @@ static void sub_08055F70(void);
static bool32 SoftResetKeysPressed(void);
static void (*const sScreenHandlers[])(void) = {
- [SCREEN_INTRO] = HandleIntroScreen,
- [SCREEN_CHOOSE_FILE] = HandleChooseFileScreen,
- [SCREEN_GAMEPLAY] = HandleGameplayScreen,
- [SCREEN_GAME_OVER] = HandleGameOverScreen,
- [SCREEN_CREDITS] = HandleCreditsScreen,
- [SCREEN_DEBUG_TEXT] = HandleDebugTextScreen,
+ [SCREEN_INTRO] = HandleIntroScreen, [SCREEN_CHOOSE_FILE] = HandleChooseFileScreen,
+ [SCREEN_GAMEPLAY] = HandleGameplayScreen, [SCREEN_GAME_OVER] = HandleGameOverScreen,
+ [SCREEN_CREDITS] = HandleCreditsScreen, [SCREEN_DEBUG_TEXT] = HandleDebugTextScreen,
};
void MainLoop(void) {
@@ -93,7 +90,7 @@ static void sub_08055F70(void) {
DisableInterruptsAndDMA();
RegisterRamReset(RESET_ALL & ~RESET_EWRAM);
- *(vu16 *)BG_PLTT = 0x7FFF;
+ *(vu16*)BG_PLTT = 0x7FFF;
REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3;
size = 0x3FFD0;
_DmaZero(gUnk_02000030, size);
diff --git a/src/manager/manager1.c b/src/manager/manager1.c
index 6be9a387..31c20d17 100644
--- a/src/manager/manager1.c
+++ b/src/manager/manager1.c
@@ -13,52 +13,47 @@ extern void (*const gUnk_08107C48[])(Entity*);
extern u8 gUnk_08107C40[];
-void Manager1(Entity *this)
-{
- u8 bVar1;
- u8 *pbVar2;
-
- gUnk_08107C5C[this->action](this);
- gUnk_08107C48[((u8*)&this->field_0x20)[1]](this);
- bVar1 = gUnk_08107C40[((u8*)&this->field_0x20)[1]];
- if ((bVar1 != 0) && (*(u8 *)&this->field_0x20 != bVar1)) {
- ((u8*)&this->field_0x20)[0] = bVar1;
- LoadGfxGroup(bVar1);
- }
+void Manager1(Entity* this) {
+ u8 bVar1;
+ u8* pbVar2;
+
+ gUnk_08107C5C[this->action](this);
+ gUnk_08107C48[((u8*)&this->field_0x20)[1]](this);
+ bVar1 = gUnk_08107C40[((u8*)&this->field_0x20)[1]];
+ if ((bVar1 != 0) && (*(u8*)&this->field_0x20 != bVar1)) {
+ ((u8*)&this->field_0x20)[0] = bVar1;
+ LoadGfxGroup(bVar1);
+ }
}
-void sub_080570B8(Entity *this)
-{
- u8 *pbVar1;
-
- LoadGfxGroup(((u8 *)&this->field_0x20)[0]);
- this->height.WORD = 0;
- pbVar1 = ((u8 *)&this->field_0x20 + 1);
- if (*pbVar1 == 3) {
- gScreen.affine.unk4 = 1;
- }
- else {
- gUnk_08107C48[*pbVar1](this);
- }
+void sub_080570B8(Entity* this) {
+ u8* pbVar1;
+
+ LoadGfxGroup(((u8*)&this->field_0x20)[0]);
+ this->height.WORD = 0;
+ pbVar1 = ((u8*)&this->field_0x20 + 1);
+ if (*pbVar1 == 3) {
+ gScreen.affine.unk4 = 1;
+ } else {
+ gUnk_08107C48[*pbVar1](this);
+ }
}
-void sub_080570F8(void)
-{
- gScreen.lcd.displayControl &= 0xf7ff;
- gScreen.controls.layerFXControl = 0;
- sub_08056250();
+void sub_080570F8(void) {
+ gScreen.lcd.displayControl &= 0xf7ff;
+ gScreen.controls.layerFXControl = 0;
+ sub_08056250();
}
-void sub_08057118(Entity *this)
-{
- this->actionDelay = 0;
- *(u8 *)&this->field_0x20 = 0;
- ((u8 *)&this->field_0x20)[1] = 0;
- ((u8 *)&this->field_0x20)[2] = 0;
- this->action = 1;
- gScreen.affine.bg3Control = 0x1e04;
- gScreen.lcd.displayControl |= 0x800;
- gScreen.controls.layerFXControl = 0x3648;
- gScreen.controls.alphaBlend = 0x1000;
- sub_08052D74(this, sub_080570B8, sub_080570F8);
+void sub_08057118(Entity* this) {
+ this->actionDelay = 0;
+ *(u8*)&this->field_0x20 = 0;
+ ((u8*)&this->field_0x20)[1] = 0;
+ ((u8*)&this->field_0x20)[2] = 0;
+ this->action = 1;
+ gScreen.affine.bg3Control = 0x1e04;
+ gScreen.lcd.displayControl |= 0x800;
+ gScreen.controls.layerFXControl = 0x3648;
+ gScreen.controls.alphaBlend = 0x1000;
+ sub_08052D74(this, sub_080570B8, sub_080570F8);
}
diff --git a/src/manager/manager15.c b/src/manager/manager15.c
index c4d1f8b0..51a675f4 100644
--- a/src/manager/manager15.c
+++ b/src/manager/manager15.c
@@ -9,7 +9,7 @@ typedef struct {
u8 unk_20;
u8 unk_21;
u8 unk_22;
- u8 unk_23;//used
+ u8 unk_23; // used
u16 unk_24;
u16 unk_26;
void* unk_28;
@@ -20,7 +20,7 @@ typedef struct {
s16 unk_38;
s16 unk_3a;
u16 unk_3c;
- u16 unk_3e;//used
+ u16 unk_3e; // used
} Manager15;
extern void (*const gUnk_081085D8[])(Manager*);
@@ -29,7 +29,6 @@ void sub_0805A280(Manager* this) {
gUnk_081085D8[this->unk_0a](this);
}
-
void sub_0805A89C(Manager15*);
void sub_0805A8EC(Manager15*);
void sub_0805AAF0(u32);
@@ -86,7 +85,7 @@ void sub_0805A370(Manager15* this) {
void sub_0805A394(Manager15* this) {
Entity* ent;
- if ((ent = FindEntityInListBySubtype(0x3,0x13,0x4))) {
+ if ((ent = FindEntityInListBySubtype(0x3, 0x13, 0x4))) {
if (ent->entityType.form != 4) {
return;
}
@@ -162,7 +161,7 @@ void sub_0805A4CC(Manager15* this, u32 unk_0) {
if (tmp) {
tmp->x.HALF.HI = this->unk_38 + gRoomControls.roomOriginX;
tmp->y.HALF.HI = this->unk_3a + gRoomControls.roomOriginY - 0x30;
- tmp->parent = (Entity*) this;
+ tmp->parent = (Entity*)this;
this->manager.unk_0d = 0;
}
}
@@ -197,13 +196,15 @@ void sub_0805A500(Manager15* this) {
sub_0805AA58(this);
sub_0805A9CC(this);
if (gRoomControls.unk2 == 1) {
- gScreen.lcd.displayControl |= 0x80<<7;
+ gScreen.lcd.displayControl |= 0x80 << 7;
this->manager.unk_0d = 1;
return;
}
- if (!this->manager.unk_0d) return;
+ if (!this->manager.unk_0d)
+ return;
this->manager.unk_0d = 0;
- if (this->unk_20 == gRoomControls.roomID) return;
+ if (this->unk_20 == gRoomControls.roomID)
+ return;
gScreen.lcd.displayControl &= 0xB7FF;
DeleteThisEntity();
}
@@ -211,7 +212,7 @@ void sub_0805A500(Manager15* this) {
void sub_0805A5FC(Manager15* this) {
if (CheckLocalFlag(0x34)) {
this->manager.action = 2;
- sub_0805A4CC(this,2);
+ sub_0805A4CC(this, 2);
}
}
@@ -225,7 +226,7 @@ void sub_0805A628(Manager15* this) {
if (CheckLocalFlag(0x36)) {
this->manager.action = 4;
this->unk_23 = 3;
- sub_0805A4CC(this,3);
+ sub_0805A4CC(this, 3);
}
}
@@ -235,8 +236,10 @@ void sub_0805A64C(Manager15* this) {
}
}
-void sub_0805A65C(Manager15* this) {}
-void sub_0805A660(Manager15* this) {}
+void sub_0805A65C(Manager15* this) {
+}
+void sub_0805A660(Manager15* this) {
+}
extern void (*const gUnk_08108638[])(Manager15*);
void sub_0805A68C(Manager15*);
@@ -259,7 +262,7 @@ void sub_0805A68C(Manager15* this) {
if (this->unk_2c > 0x1000) {
this->unk_2c--;
}
- gScreen.controls.alphaBlend=this->unk_2c;
+ gScreen.controls.alphaBlend = this->unk_2c;
}
}
@@ -295,10 +298,7 @@ extern void sub_0805E4E0(Manager*, u32);
extern void sub_08077B20(void);
void sub_0805A76C(Manager15* this) {
- if ((gPlayerEntity.currentHealth != 0)
- && (gPlayerEntity.height.HALF.HI == 0)
- && (!gPlayerState.field_0x2c)
- ) {
+ if ((gPlayerEntity.currentHealth != 0) && (gPlayerEntity.height.HALF.HI == 0) && (!gPlayerState.field_0x2c)) {
switch (gPlayerState.field_0xa9) {
case 1:
case 0:
@@ -337,9 +337,10 @@ void sub_0805A804(Manager15* this) {
sub_0805E3A0(this, 6);
break;
case 1:
- if (CheckLocalFlag(this->unk_3e)) break;
+ if (CheckLocalFlag(this->unk_3e))
+ break;
this->manager.action = 2;
- sub_0805A4CC(this,4);
+ sub_0805A4CC(this, 4);
break;
case 2:
if (this->manager.unk_0d) {
@@ -347,9 +348,10 @@ void sub_0805A804(Manager15* this) {
}
break;
case 3:
- if (!CheckLocalFlag(this->unk_3e)) break;
+ if (!CheckLocalFlag(this->unk_3e))
+ break;
this->manager.action = 4;
- sub_0805A4CC(this,4);
+ sub_0805A4CC(this, 4);
break;
case 4:
if (this->manager.unk_0d) {
@@ -387,9 +389,11 @@ void sub_0805A8EC(Manager15* this) {
gScreen.lcd.displayControl |= 0x4000;
this->manager.unk_0d = 1;
} else {
- if (!this->manager.unk_0d) return;
+ if (!this->manager.unk_0d)
+ return;
this->manager.unk_0d = 0;
- if (this->unk_20 == gRoomControls.roomID) return;
+ if (this->unk_20 == gRoomControls.roomID)
+ return;
gScreen.lcd.displayControl &= 0xB7FF;
DeleteThisEntity();
}
@@ -401,17 +405,25 @@ void sub_0805A94C(Manager15* this) {
gScreen.affine.bg3yOffset = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
tmp1 = -gScreen.affine.bg3xOffset;
tmp2 = tmp1 + 0x100;
- if (tmp1 < 0) tmp1 = 0;
- if (tmp1 > 0xF0) tmp1 = 0xF0;
- if (tmp2 < 0) tmp2 = 0;
- if (tmp2 > 0xF0) tmp2 = 0xF0;
+ if (tmp1 < 0)
+ tmp1 = 0;
+ if (tmp1 > 0xF0)
+ tmp1 = 0xF0;
+ if (tmp2 < 0)
+ tmp2 = 0;
+ if (tmp2 > 0xF0)
+ tmp2 = 0xF0;
gScreen.controls.window1HorizontalDimensions = (tmp1 << 8 | tmp2);
tmp1 = -gScreen.affine.bg3yOffset;
tmp2 = tmp1 + 0x100;
- if (tmp1 < 0) tmp1 = 0;
- if (tmp1 > 0xA0) tmp1 = 0xA0;
- if (tmp2 < 0) tmp2 = 0;
- if (tmp2 > 0xA0) tmp2 = 0xA0;
+ if (tmp1 < 0)
+ tmp1 = 0;
+ if (tmp1 > 0xA0)
+ tmp1 = 0xA0;
+ if (tmp2 < 0)
+ tmp2 = 0;
+ if (tmp2 > 0xA0)
+ tmp2 = 0xA0;
gScreen.controls.window1VerticalDimensions = (tmp1 << 8 | tmp2);
}
@@ -424,18 +436,24 @@ void sub_0805A9CC(Manager15* this) {
gScreen.affine.bg3xOffset = gRoomControls.roomScrollX - this->unk_24 + this->unk_34;
tmp1 = -gScreen.affine.bg3xOffset;
tmp2 = tmp1 + 0x100;
- if (tmp1 < 0) tmp1 = 0;
- if (tmp1 > 0xF0) tmp1 = 0xF0;
- if (tmp2 < 0) tmp2 = 0;
- if (tmp2 > 0xF0) tmp2 = 0xF0;
+ if (tmp1 < 0)
+ tmp1 = 0;
+ if (tmp1 > 0xF0)
+ tmp1 = 0xF0;
+ if (tmp2 < 0)
+ tmp2 = 0;
+ if (tmp2 > 0xF0)
+ tmp2 = 0xF0;
gScreen.controls.window1HorizontalDimensions = tmp1 << 8 | tmp2;
tmp1 = gRoomControls.roomScrollY - this->unk_26 + this->unk_36;
gScreen.affine.bg3yOffset = tmp1 & 0x3F;
- if (tmp1 < 0) tmp1 += 0x3F;
+ if (tmp1 < 0)
+ tmp1 += 0x3F;
tmp3 = (&gUnk_02001A40[(tmp1 >> 6 << 9)]);
- gScreen.affine.unk5 = (u32) tmp3;
+ gScreen.affine.unk5 = (u32)tmp3;
gScreen.controls.window1VerticalDimensions = 0xa0;
- if (this->unk_28 == tmp3) return;
+ if (this->unk_28 == tmp3)
+ return;
this->unk_28 = tmp3;
gScreen.affine.unk4 = 1;
}
@@ -446,9 +464,7 @@ void sub_0805A9CC(Manager15* this) {
}
#endif
-extern struct {
- u8 unk_00[0x20];
-} gUnk_085A97A0[];
+extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
extern u16 gUnk_081085B8[];
extern void LoadPalettes(const u8*, u32, u32);
@@ -457,7 +473,7 @@ void sub_0805AA58(Manager15* this) {
this->manager.unk_0e = 8;
this->unk_21 += 1;
this->unk_21 &= 3;
- LoadPalettes(gUnk_085A97A0[this->unk_21].unk_00,5,1);
+ LoadPalettes(gUnk_085A97A0[this->unk_21].unk_00, 5, 1);
}
if (--this->manager.unk_0f == 0) {
this->manager.unk_0f = 0x10;
@@ -472,7 +488,6 @@ void sub_0805AAC8(Manager15* this) {
sub_0805A280(&this->manager);
}
-
extern u16 gUnk_08108648[];
void sub_0805AADC(u32 unk0) {
diff --git a/src/manager/manager1A.c b/src/manager/manager1A.c
index ff6d8afe..96c5b248 100644
--- a/src/manager/manager1A.c
+++ b/src/manager/manager1A.c
@@ -6,7 +6,6 @@
#include "screen.h"
#include "functions.h"
-
typedef struct {
Manager manager;
s16 unk_20;
@@ -35,9 +34,9 @@ extern u32 sub_0806FBFC(u32, u32, u32, u32);
typedef struct struct_08108764 {
u8 unk_00;
- u8 unk_01;//area ID?
- u8 unk_02;//room ID?
- u8 unk_03;//layer?
+ u8 unk_01; // area ID?
+ u8 unk_02; // room ID?
+ u8 unk_03; // layer?
u16 unk_04;
u16 unk_06;
u8 unk_08;
@@ -50,19 +49,19 @@ typedef struct struct_08108764 {
u16 unk_06;
u16 unk_08;
u16 unk_0a;
- }* unk_0c;
+ } * unk_0c;
struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[2];
u16 unk_04;
u16 unk_06;
- }* unk_10;
+ } * unk_10;
} struct_08108764;
extern struct_08108764 gUnk_08108764[];
-u32 sub_0805B1CC(Manager1A*);
+u32 sub_0805B1CC(Manager1A*);
void sub_0805B210(Manager1A*);
void sub_0805B2B0(Manager1A*);
void sub_0805B328(Manager1A*);
@@ -99,14 +98,15 @@ void sub_0805B048(Manager1A* this) {
sub_0805B328(this);
sub_08052D74(this, sub_0805B328, 0);
}
- if (!tmp->unk_10) return;
+ if (!tmp->unk_10)
+ return;
obj = CreateObject(0x28, tmp->unk_10->unk_00, tmp->unk_10->unk_01);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.roomOriginX;
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.roomOriginY;
}
- if (this->manager.unk_0a != 0xa
- || CheckLocalFlag(0x4B)) return;
+ if (this->manager.unk_0a != 0xa || CheckLocalFlag(0x4B))
+ return;
obj = CreateObject(0x28, 3, 3);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.roomOriginX;
@@ -125,9 +125,11 @@ void sub_0805B168(Manager1A* this) {
this->manager.unk_0d = 1;
return;
}
- if (!this->manager.unk_0d) return;
+ if (!this->manager.unk_0d)
+ return;
this->manager.unk_0d = 0;
- if (this->unk_3f == gRoomControls.roomID) return;
+ if (this->unk_3f == gRoomControls.roomID)
+ return;
if (this->manager.unk_0b) {
gScreen.lcd.displayControl &= ~0x800;
}
@@ -147,7 +149,7 @@ u32 sub_0805B1CC(Manager1A* this) {
}
void sub_0805B210(Manager1A* this) {
- struct_08108764 *tmp;
+ struct_08108764* tmp;
gScreenTransition.transitioningOut = 1;
gScreenTransition.transitionType = 1;
gScreenTransition.playerState = 4;
@@ -179,7 +181,8 @@ void sub_0805B210(Manager1A* this) {
void sub_0805B2B0(Manager1A* this) {
s32 tmp, tmp2;
- if (!this->manager.unk_0b) return;
+ if (!this->manager.unk_0b)
+ return;
tmp = (this->unk_30 - gRoomControls.roomScrollX) / 4;
tmp2 = (this->unk_32 - gRoomControls.roomScrollY) / 4;
if (tmp < -12) {
@@ -202,8 +205,9 @@ void sub_0805B2B0(Manager1A* this) {
}
void sub_0805B328(Manager1A* this) {
- struct_08108764 *tmp;
- if (!this->manager.unk_0b) return;
+ struct_08108764* tmp;
+ if (!this->manager.unk_0b)
+ return;
tmp = &gUnk_08108764[this->manager.unk_0a];
LoadAssetAsync(&gGlobalGfxAndPalettes[tmp->unk_0c->unk_00], 0x0600F000, 0x800);
gScreen.affine.bg3Control = 0x1E07;
@@ -215,7 +219,8 @@ void sub_0805B328(Manager1A* this) {
void sub_0805B390(u32 unk1) {
Manager* tmp = GetEmptyManager();
- if (!tmp) return;
+ if (!tmp)
+ return;
tmp->type = 0x9;
tmp->subtype = 0x1A;
tmp->unk_0a = unk1;
diff --git a/src/manager/manager2.c b/src/manager/manager2.c
index 60a74935..4b492311 100644
--- a/src/manager/manager2.c
+++ b/src/manager/manager2.c
@@ -6,13 +6,12 @@ extern void sub_080576A0();
extern void sub_08052D74();
extern void sub_0805754C(Entity*);
-void Manager2(Entity *this)
-{
- if (this->action == 0) {
- this->action = 1;
- gScreen.affine.unk4 = 0;
- gScreen.bg.bg2yOffset = 0;
- sub_08052D74(this, sub_080576A0, 0);
- }
- sub_0805754C(this);
+void Manager2(Entity* this) {
+ if (this->action == 0) {
+ this->action = 1;
+ gScreen.affine.unk4 = 0;
+ gScreen.bg.bg2yOffset = 0;
+ sub_08052D74(this, sub_080576A0, 0);
+ }
+ sub_0805754C(this);
}
diff --git a/src/manager/manager20.c b/src/manager/manager20.c
index fe50967e..b8a20f5f 100644
--- a/src/manager/manager20.c
+++ b/src/manager/manager20.c
@@ -21,16 +21,17 @@ extern void DeleteManager(Manager20*);
void sub_0805B7A0(Manager20* this) {
Entity* tmp = CreateObject(this->manager.unk_0e, this->manager.unk_0a, this->manager.unk_0b);
- if (!tmp) return;
+ if (!tmp)
+ return;
tmp->field_0x86.HWORD = this->unk_3e;
if (CheckFlags(this->unk_3e)) {
- tmp->x.HALF.HI = this->unk_36 | (this->unk_37&0xF)<<8;//r1
+ tmp->x.HALF.HI = this->unk_36 | (this->unk_37 & 0xF) << 8; // r1
tmp->y.HALF.HI = this->unk_3c & 0xFFF;
tmp->collisionLayer = this->unk_3c >> 0xC;
} else {
tmp->x.HALF.HI = this->unk_38;
tmp->y.HALF.HI = this->unk_3a;
- tmp->collisionLayer = this->unk_37>>4;
+ tmp->collisionLayer = this->unk_37 >> 4;
}
tmp->x.HALF.HI += gRoomControls.roomOriginX;
tmp->y.HALF.HI += gRoomControls.roomOriginY;
diff --git a/src/manager/manager27.c b/src/manager/manager27.c
index 3b82fe0a..13e3c09b 100644
--- a/src/manager/manager27.c
+++ b/src/manager/manager27.c
@@ -9,76 +9,66 @@ extern void (*const gUnk_08108D10[])(Entity*);
extern u8 gUnk_08108D20[];
-void Manager27(Entity *this)
-{
-
- gUnk_08108D10[this->action](this);
- if (CheckLocalFlagByOffset(0x300, this->entityType.form + 0x67)) {
- gScreenTransition.field_0xac |= (1 << (this->entityType).form);
- }
- else {
- gScreenTransition.field_0xac &= ~(1 << (this->entityType).form);
- }
+void Manager27(Entity* this) {
+
+ gUnk_08108D10[this->action](this);
+ if (CheckLocalFlagByOffset(0x300, this->entityType.form + 0x67)) {
+ gScreenTransition.field_0xac |= (1 << (this->entityType).form);
+ } else {
+ gScreenTransition.field_0xac &= ~(1 << (this->entityType).form);
+ }
}
-void sub_0805C874(Entity *this)
-{
- u8 bVar1;
+void sub_0805C874(Entity* this) {
+ u8 bVar1;
- if (sub_0805C920(this)) {
- this->action = 2;
- }
- else {
- this->action = 1;
- }
-
- this->actionDelay = 1;
- this->field_0xf = 0;
-}
+ if (sub_0805C920(this)) {
+ this->action = 2;
+ } else {
+ this->action = 1;
+ }
-void sub_0805C894(Entity *this)
-{
-
- if (sub_0805C920(this)) {
- this->action = 2;
this->actionDelay = 1;
- PlaySFX(0x11a);
- }
+ this->field_0xf = 0;
}
-void sub_0805C8B4(Entity *this)
-{
- u8 bVar1;
- int iVar2;
-
+void sub_0805C894(Entity* this) {
- if (--this->actionDelay == 0) {
- this->actionDelay = 0x14;
+ if (sub_0805C920(this)) {
+ this->action = 2;
+ this->actionDelay = 1;
+ PlaySFX(0x11a);
+ }
+}
- if (5 < ++this->field_0xf) {
- this->field_0xf = 0;
+void sub_0805C8B4(Entity* this) {
+ u8 bVar1;
+ int iVar2;
+
+ if (--this->actionDelay == 0) {
+ this->actionDelay = 0x14;
+
+ if (5 < ++this->field_0xf) {
+ this->field_0xf = 0;
+ }
+ LoadPaletteGroup(gUnk_08108D20[this->field_0xf]);
+ if (this->field_0xf == 0) {
+ PlaySFX(0x11a);
+ }
}
- LoadPaletteGroup(gUnk_08108D20[this->field_0xf]);
- if (this->field_0xf == 0) {
- PlaySFX(0x11a);
+ if (sub_0805C920(this) == 0) {
+ this->action = 3;
}
- }
- if (sub_0805C920(this) == 0) {
- this->action = 3;
- }
}
-void sub_0805C908(Entity *this)
-{
- if (this->field_0xf == 0) {
- this->action = 1;
- }
- else {
- sub_0805C8B4(this);
- }
+void sub_0805C908(Entity* this) {
+ if (this->field_0xf == 0) {
+ this->action = 1;
+ } else {
+ sub_0805C8B4(this);
+ }
}
-u32 sub_0805C920(Entity *this)
-{
- return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67);
+u32 sub_0805C920(Entity* this) {
+ return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67);
}
diff --git a/src/manager/manager2E.c b/src/manager/manager2E.c
index 1c374d13..cc07c980 100644
--- a/src/manager/manager2E.c
+++ b/src/manager/manager2E.c
@@ -4,12 +4,10 @@
extern void (*const gUnk_08108D3C[])(Entity*);
extern void (*const gUnk_08108D44[])(Entity*);
-void sub_0805D250(Entity *this)
-{
- gUnk_08108D3C[this->entityType.form](this);
+void sub_0805D250(Entity* this) {
+ gUnk_08108D3C[this->entityType.form](this);
}
-void sub_0805D268(Entity *this)
-{
- gUnk_08108D44[this->action](this);
+void sub_0805D268(Entity* this) {
+ gUnk_08108D44[this->action](this);
}
diff --git a/src/manager/manager3.c b/src/manager/manager3.c
index d22dbb25..45dce8ea 100644
--- a/src/manager/manager3.c
+++ b/src/manager/manager3.c
@@ -51,7 +51,8 @@ void sub_080576C0(Manager3* this) {
}
}
if (sub_080002C0(this->unk_38, this->unk_3a, this->manager.unk_0e) == 0x3d) {
- sub_080577AC(this->unk_38 + gRoomControls.roomOriginX, this->unk_3a + gRoomControls.roomOriginY, this->manager.unk_0e);
+ sub_080577AC(this->unk_38 + gRoomControls.roomOriginX, this->unk_3a + gRoomControls.roomOriginY,
+ this->manager.unk_0e);
if (!this->manager.unk_0f) {
this->manager.unk_0f = 1;
PlaySFX(0x152);
@@ -62,7 +63,6 @@ void sub_080576C0(Manager3* this) {
} else {
this->manager.unk_0f = 0;
}
-
}
void sub_080577AC(u32 baseX, u32 baseY, u32 layer) {
@@ -70,9 +70,11 @@ void sub_080577AC(u32 baseX, u32 baseY, u32 layer) {
int offsetX, offsetY;
Entity* spark;
r = Random();
- if ((r & 0x7) != 0) return;
+ if ((r & 0x7) != 0)
+ return;
spark = CreateObject(0xF, 0x26, 0);
- if (!spark) return;
+ if (!spark)
+ return;
offsetX = (r >> 0x8) & 0xF;
offsetY = ((r >> 0x10) & 0xF);
if (offsetY > 0x4) {
@@ -88,10 +90,8 @@ void sub_080577AC(u32 baseX, u32 baseY, u32 layer) {
}
u32 sub_08057810(void) {
- if ((gPlayerState.flags.all & 0x80)
- && !gPlayerState.field_0xaa
- && (gArea.field_0x17 != 0x6)
- && (gPlayerState.heldObject == 0)) {
+ if ((gPlayerState.flags.all & 0x80) && !gPlayerState.field_0xaa && (gArea.field_0x17 != 0x6) &&
+ (gPlayerState.heldObject == 0)) {
switch (gPlayerState.field_0xa8) {
case 0:
case 1:
diff --git a/src/manager/manager30.c b/src/manager/manager30.c
index 5f5ead82..9a48d968 100644
--- a/src/manager/manager30.c
+++ b/src/manager/manager30.c
@@ -5,12 +5,12 @@
typedef struct Manager30 {
Manager manager;
- u8 unk_20[8];//unused
+ u8 unk_20[8]; // unused
u16 own_tile;
- u8 unk_2a[0x2];//unused
+ u8 unk_2a[0x2]; // unused
u16 player_previous_tile;
u16 player_current_tile;
- u8 unk_30[0x6];//unused
+ u8 unk_30[0x6]; // unused
u8 width;
u8 height;
s16 x;
@@ -21,19 +21,14 @@ typedef struct Manager30 {
extern void sub_0807B7D8(u32, u32, u32);
-enum {
- INIT,
- IN_PROGRESS,
- FAILED,
- SUCCEEDED
-};
+enum { INIT, IN_PROGRESS, FAILED, SUCCEEDED };
-/*
+/*
* Tile puzzles (step on all blue tiles exactly once).
- *
+ *
* The Manager's field 0xe is used for the remaining number of tiles to be changed.
* field 0xf is used for the total number of tiles to be changed.
-*/
+ */
void Manager30_Main(Manager30* this) {
u32 i, j, tmp, tmp2;
switch (this->manager.action) {
@@ -42,8 +37,7 @@ void Manager30_Main(Manager30* this) {
case INIT:
this->manager.action = IN_PROGRESS;
this->manager.unk_0f = this->manager.unk_0e;
- this->own_tile = (((this->x >> 4) & 0x3fU) |
- ((this->y >> 4) & 0x3fU) << 6);
+ this->own_tile = (((this->x >> 4) & 0x3fU) | ((this->y >> 4) & 0x3fU) << 6);
this->player_previous_tile = this->player_current_tile = COORD_TO_TILE((&gPlayerEntity));
break;
case 1:
@@ -52,29 +46,31 @@ void Manager30_Main(Manager30* this) {
this->player_previous_tile = this->player_current_tile;
switch (GetTileType(this->player_current_tile, this->manager.unk_0b)) {
case 0x317:
- //stepped on a red tile again
+ // stepped on a red tile again
this->manager.action = FAILED;
PlaySFX(0x6d);
break;
case 0x318:
- //stepped on a blue tile
- //turn the tile into a red tile
+ // stepped on a blue tile
+ // turn the tile into a red tile
sub_0807B7D8(0x317, this->player_current_tile, this->manager.unk_0b);
PlaySFX(0x6b);
- //decrease the number of remaining tiles and check if we're done
+ // decrease the number of remaining tiles and check if we're done
if (--this->manager.unk_0e == 0) {
this->manager.action = SUCCEEDED;
- //set up delay for setting the flag/playing the success sfx
+ // set up delay for setting the flag/playing the success sfx
this->manager.unk_0e = 0x40;
}
break;
}
}
- //fall through, can be reset in-progress
+ // fall through, can be reset in-progress
case FAILED:
- if (!this->flag_reset) return;//can't be reset
- if (!CheckFlags(this->flag_reset)) return;//wait for the flag telling it to reset
- ClearFlag(this->flag_reset);//make sure the puzzle can be reset again later
+ if (!this->flag_reset)
+ return; // can't be reset
+ if (!CheckFlags(this->flag_reset))
+ return; // wait for the flag telling it to reset
+ ClearFlag(this->flag_reset); // make sure the puzzle can be reset again later
this->manager.action = IN_PROGRESS;
this->manager.unk_0e = this->manager.unk_0f;
for (i = 0; i < this->height; i++) {
@@ -85,7 +81,8 @@ void Manager30_Main(Manager30* this) {
}
break;
case SUCCEEDED:
- if (this->manager.unk_0e == 0) return;
+ if (this->manager.unk_0e == 0)
+ return;
tmp2 = --this->manager.unk_0e;
if (tmp2) {
if (tmp2 == 0x20) {
diff --git a/src/manager/manager4.c b/src/manager/manager4.c
index 7a47f977..da43751f 100644
--- a/src/manager/manager4.c
+++ b/src/manager/manager4.c
@@ -7,7 +7,7 @@
extern void (*gUnk_08107C70[])(Manager*);
void sub_08057854(Manager* this) {
- gUnk_08107C70[this->action](this);
+ gUnk_08107C70[this->action](this);
}
extern void sub_080805F8(void);
@@ -20,7 +20,7 @@ void sub_0805786C(Manager* this) {
DiggingCaveEntrance* tmp;
u8 roomID;
u8 areaID;
- u16 uVar = 0x81<<7;
+ u16 uVar = 0x81 << 7;
sub_080805F8();
if (gUnk_03004030.unk_08 != 0) {
if (gUnk_03004030.unk_00 == 0) {
@@ -39,8 +39,8 @@ void sub_0805786C(Manager* this) {
}
roomID = gRoomControls.roomID;
tmp = gUnk_08107DC0[gRoomControls.areaID];
- uVar = 0x81<<7;
- for (tmp = sub_08057AA8(tmp, roomID); tmp != 0; tmp = sub_08057AA8(tmp, roomID)){
+ uVar = 0x81 << 7;
+ for (tmp = sub_08057AA8(tmp, roomID); tmp != 0; tmp = sub_08057AA8(tmp, roomID)) {
SetTile(uVar, tmp->unk_00 + 0x3F, 1);
SetTile(uVar, tmp->unk_00 + 0x40, 1);
SetTile(uVar, tmp->unk_00 + 0x41, 1);
@@ -56,7 +56,9 @@ void sub_08057920(Manager* this) {
DiggingCaveEntrance* tmp;
u8 roomID;
roomID = gRoomControls.roomID;
- for (tmp = gUnk_08107DC0[gRoomControls.areaID];(tmp = sub_08057AA8(tmp, roomID)) != 0 && !sub_0805795C(this, tmp);tmp++);
+ for (tmp = gUnk_08107DC0[gRoomControls.areaID]; (tmp = sub_08057AA8(tmp, roomID)) != 0 && !sub_0805795C(this, tmp);
+ tmp++)
+ ;
}
void sub_08057A18(Manager*, DiggingCaveEntrance*);
@@ -69,23 +71,25 @@ u32 sub_0805795C(Manager* this, DiggingCaveEntrance* entr) {
offsetX = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX;
offsetY = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY;
offsetX2 = (entr->unk_00 & 0x3F) * 16 + 8;
- offsetY2 = ((entr->unk_00 & 0xFC0)>> 6) * 16 + 0x18;
- if ((u32)(offsetX - offsetX2) + 0x18 > 0x30) return 0;
- if (
- (u32)(offsetY - offsetY2) + 8 > 0x10) return 0;
- if (
- ((offsetY < offsetY2)))
- if (
- (u32)(offsetX - offsetX2) + 0xC <= 0x18) return 0;
-
+ offsetY2 = ((entr->unk_00 & 0xFC0) >> 6) * 16 + 0x18;
+ if ((u32)(offsetX - offsetX2) + 0x18 > 0x30)
+ return 0;
+ if ((u32)(offsetY - offsetY2) + 8 > 0x10)
+ return 0;
+ if (((offsetY < offsetY2)))
+ if ((u32)(offsetX - offsetX2) + 0xC <= 0x18)
+ return 0;
+
} else {
- //offsetX = ((gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F;
- //offsetY = ((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F;
- //tmp = offsetX | (offsetY << 6);
+ // offsetX = ((gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F;
+ // offsetY = ((gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F;
+ // tmp = offsetX | (offsetY << 6);
tmp = COORD_TO_TILE((&gPlayerEntity));
- if (tmp != entr->unk_00) return 0;
- offsetY = gRoomControls.roomOriginY + ((tmp>>6) * 16) + 6;
- if (gPlayerEntity.y.HALF.HI >= offsetY) return 0;
+ if (tmp != entr->unk_00)
+ return 0;
+ offsetY = gRoomControls.roomOriginY + ((tmp >> 6) * 16) + 6;
+ if (gPlayerEntity.y.HALF.HI >= offsetY)
+ return 0;
}
sub_08057A18(this, entr);
return 1;
@@ -111,7 +115,7 @@ void sub_08057A18(Manager* this, DiggingCaveEntrance* entr) {
gRoomControls.areaID = entr->target_areaID;
gRoomControls.roomID = entr->target_roomID;
gUnk_03004030.unk_00 = entr;
- gUnk_03004030.unk_04 = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX - ((entr->unk_00 & 0x3F)*16);
+ gUnk_03004030.unk_04 = gPlayerEntity.x.HALF.HI - gRoomControls.roomOriginX - ((entr->unk_00 & 0x3F) * 16);
gUnk_03004030.unk_06 = gPlayerEntity.y.HALF.HI - gRoomControls.roomOriginY - ((entr->unk_00 & 0xFC0) >> 2);
tmp = gUnk_03004030.unk_08;
if (!tmp) {
@@ -124,9 +128,10 @@ void sub_08057A18(Manager* this, DiggingCaveEntrance* entr) {
DeleteManager(this);
}
-DiggingCaveEntrance* sub_08057AA8(DiggingCaveEntrance* entr, int roomID){
- for (;entr->unk_00 != 0xFFFF;entr++) {
- if (entr->source_roomID == roomID) return entr;
+DiggingCaveEntrance* sub_08057AA8(DiggingCaveEntrance* entr, int roomID) {
+ for (; entr->unk_00 != 0xFFFF; entr++) {
+ if (entr->source_roomID == roomID)
+ return entr;
}
return 0;
}
diff --git a/src/manager/manager5.c b/src/manager/manager5.c
index de4e08b9..f90ef1db 100644
--- a/src/manager/manager5.c
+++ b/src/manager/manager5.c
@@ -3,7 +3,6 @@
#include "flags.h"
#include "functions.h"
-
typedef struct {
Manager manager;
u8 unk_20[0x08];
@@ -24,32 +23,10 @@ void sub_08057AE8(Manager5*);
void sub_08057BA4(Manager5*);
void sub_08057C28(Manager5*);
-const u16 gUnk_08108024[] = {
- 0,
- -1,
- 1,
- 0,
- 0,
- 1,
- -1,
- 0
-};
-const u16 gUnk_08108034[] = {
- 0,
- 1,
- -1,
- 0,
- 0,
- -1,
- 1,
- 0
-};
+const u16 gUnk_08108024[] = { 0, -1, 1, 0, 0, 1, -1, 0 };
+const u16 gUnk_08108034[] = { 0, 1, -1, 0, 0, -1, 1, 0 };
-void (*const gUnk_08108044[])(Manager5*) = {
- sub_08057AE8,
- sub_08057BA4,
- sub_08057C28
-};
+void (*const gUnk_08108044[])(Manager5*) = { sub_08057AE8, sub_08057BA4, sub_08057C28 };
void sub_08057AD0(Manager5* this) {
gUnk_08108044[this->manager.action](this);
@@ -61,40 +38,43 @@ extern void DeleteManager(Manager*);
void sub_08057AE8(Manager5* this) {
u32 tmp;
- tmp = (this->manager.unk_0b & 0x3)<<1;
+ tmp = (this->manager.unk_0b & 0x3) << 1;
if (this->manager.unk_0e == 1) {
this->unk_30 = 0x323;
} else {
this->unk_30 = tmp & 2 ? 0x37 : 0x36;
}
this->unk_28 = gUnk_08108024[tmp];
- this->unk_2a = gUnk_08108024[tmp+1];
+ this->unk_2a = gUnk_08108024[tmp + 1];
this->unk_2c = gUnk_08108034[tmp];
- this->unk_2e = gUnk_08108034[tmp+1];
- this->unk_32 = ((this->manager.unk_0b>>2)&0xF)+1;
+ this->unk_2e = gUnk_08108034[tmp + 1];
+ this->unk_32 = ((this->manager.unk_0b >> 2) & 0xF) + 1;
this->manager.unk_0e = 0x1C;
this->manager.unk_0f = 0;
- this->manager.action = (this->manager.unk_0b & 0x80)?2:1;
- if (this->manager.action != 2
- || !CheckFlags(this->unk_3e)) return;
- for (;this->unk_32;this->unk_32--) {
+ this->manager.action = (this->manager.unk_0b & 0x80) ? 2 : 1;
+ if (this->manager.action != 2 || !CheckFlags(this->unk_3e))
+ return;
+ for (; this->unk_32; this->unk_32--) {
sub_08057CA4(this, this->unk_28, this->unk_2a);
- sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6),this->unk_3c);
+ sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6), this->unk_3c);
}
DeleteManager(&this->manager);
}
void sub_08057BA4(Manager5* this) {
- if (--this->manager.unk_0e) return;
+ if (--this->manager.unk_0e)
+ return;
this->manager.unk_0e = 8;
if (CheckFlags(this->unk_3e)) {
- if (this->unk_32 == this->manager.unk_0f) return;
+ if (this->unk_32 == this->manager.unk_0f)
+ return;
sub_08057CA4(this, this->unk_28, this->unk_2a);
sub_0807B7D8(this->unk_30, this->unk_38 | (this->unk_3a << 6), this->unk_3c);
this->manager.unk_0f++;
PlaySFX(0x71);
} else {
- if (!this->manager.unk_0f) return;
+ if (!this->manager.unk_0f)
+ return;
sub_0807BA8C(this->unk_38 | (this->unk_3a << 6), this->unk_3c);
sub_08057CA4(this, this->unk_2c, this->unk_2e);
this->manager.unk_0f--;
@@ -104,10 +84,12 @@ void sub_08057BA4(Manager5* this) {
void sub_08057C28(Manager5* this) {
if (!this->manager.unk_0d) {
- if (!CheckFlags(this->unk_3e)) return;
+ if (!CheckFlags(this->unk_3e))
+ return;
this->manager.unk_0d++;
} else {
- if (--this->manager.unk_0e) return;
+ if (--this->manager.unk_0e)
+ return;
this->manager.unk_0e = 8;
if (this->unk_32 != this->manager.unk_0f) {
sub_08057CA4(this, this->unk_28, this->unk_2a);
diff --git a/src/manager/manager6.c b/src/manager/manager6.c
index fa2fcd24..aa5cb48a 100644
--- a/src/manager/manager6.c
+++ b/src/manager/manager6.c
@@ -8,14 +8,14 @@ extern u32 CheckPlayerInRegion(u16, u16, u8, u8);
extern void DoExitTransition(void*);
extern void DeleteManager(Entity*);
-void sub_08057CB4(Manager6 * this) {
+void sub_08057CB4(Manager6* this) {
u32 tmp;
Manager6WarpData* i;
- if (this->manager.action == 0){
+ if (this->manager.action == 0) {
this->manager.action = 1;
this->warpList = GetCurrentRoomProperty(this->manager.unk_0a);
if (!this->warpList) {
- DeleteManager((Entity*) this);
+ DeleteManager((Entity*)this);
return;
}
}
@@ -24,7 +24,7 @@ void sub_08057CB4(Manager6 * this) {
tmp = (i->unk_07.all & 0x3);
if (((tmp & (gPlayerEntity.collisionLayer)) != 0) &&
(((gPlayerState.flags.all & 0x80) != 0) || ((i->unk_07.b.unk2) != 0)) &&
- (CheckPlayerInRegion(i->posX,i->posY,i->width,i->height) != 0) &&
+ (CheckPlayerInRegion(i->posX, i->posY, i->width, i->height) != 0) &&
(gPlayerEntity.height.HALF.HI == 0)) {
DoExitTransition(GetCurrentRoomProperty(i->unk_06));
}
diff --git a/src/manager/manager7.c b/src/manager/manager7.c
index 14557946..55e88f7d 100644
--- a/src/manager/manager7.c
+++ b/src/manager/manager7.c
@@ -3,7 +3,6 @@
#include "functions.h"
#include "gba/gba.h"
-
typedef struct {
Manager manager;
u8 unk_20;
@@ -22,74 +21,28 @@ extern void sub_0805E3A0();
extern u8 gUnk_02034490;
extern const u8 gGlobalGfxAndPalettes[];
-const u16 gUnk_08108050[0x2A] = {
- 0, 0, 0x20, 0xE0,
- 0xE0, 1, 0, 0x1D0,
- 0x80, 0x60, 2, 0x170,
- 0x278, 0xF8, 0xA0, 3,
- 0x310, 0x178, 0xC0, 0x150,
- 3, 0x340, 0x2C8, 0x60,
- 0x90, 4, 0x1D0, 0,
- 0x200, 0xE0, 1, 0x108,
- 0x188, 0xD0, 0x80, 2,
- 0x1E8, 0x338, 0x50, 0xC0,
- 0xFF, 0
-};
+const u16 gUnk_08108050[0x2A] = { 0, 0, 0x20, 0xE0, 0xE0, 1, 0, 0x1D0, 0x80, 0x60, 2,
+ 0x170, 0x278, 0xF8, 0xA0, 3, 0x310, 0x178, 0xC0, 0x150, 3, 0x340,
+ 0x2C8, 0x60, 0x90, 4, 0x1D0, 0, 0x200, 0xE0, 1, 0x108, 0x188,
+ 0xD0, 0x80, 2, 0x1E8, 0x338, 0x50, 0xC0, 0xFF, 0 };
const u32 gUnk_081080A4[0x50] = {
- 0x001095E0, 0x06000000,
- 0x0010A5E0, 0x06001000,
- 0x0010B5E0, 0x06002000,
- 0x0010C5E0, 0x06003000,
- 0x0010D5E0, 0x06008000,
- 0x0010E5E0, 0x06009000,
- 0x0010F5E0, 0x0600A000,
- 0x001105E0, 0x0600B000,
- 0x001115E0, 0x06000000,
- 0x001125E0, 0x06001000,
- 0x001135E0, 0x06002000,
- 0x001145E0, 0x06003000,
- 0x001155E0, 0x06008000,
- 0x001165E0, 0x06009000,
- 0x001175E0, 0x0600A000,
- 0x001185E0, 0x0600B000,
- 0x001195E0, 0x06000000,
- 0x0011A5E0, 0x06001000,
- 0x0011B5E0, 0x06002000,
- 0x0011C5E0, 0x06003000,
- 0x0011D5E0, 0x06008000,
- 0x0011E5E0, 0x06009000,
- 0x0011F5E0, 0x0600A000,
- 0x001205E0, 0x0600B000,
- 0x001215E0, 0x06000000,
- 0x001225E0, 0x06001000,
- 0x001235E0, 0x06002000,
- 0x001245E0, 0x06003000,
- 0x001255E0, 0x06008000,
- 0x001265E0, 0x06009000,
- 0x001275E0, 0x0600A000,
- 0x001285E0, 0x0600B000,
- 0x001295E0, 0x06000000,
- 0x0012A5E0, 0x06001000,
- 0x0012B5E0, 0x06002000,
- 0x0012C5E0, 0x06003000,
- 0x0012D5E0, 0x06008000,
- 0x0012E5E0, 0x06009000,
- 0x0012F5E0, 0x0600A000,
- 0x001305E0, 0x0600B000
+ 0x001095E0, 0x06000000, 0x0010A5E0, 0x06001000, 0x0010B5E0, 0x06002000, 0x0010C5E0, 0x06003000, 0x0010D5E0,
+ 0x06008000, 0x0010E5E0, 0x06009000, 0x0010F5E0, 0x0600A000, 0x001105E0, 0x0600B000, 0x001115E0, 0x06000000,
+ 0x001125E0, 0x06001000, 0x001135E0, 0x06002000, 0x001145E0, 0x06003000, 0x001155E0, 0x06008000, 0x001165E0,
+ 0x06009000, 0x001175E0, 0x0600A000, 0x001185E0, 0x0600B000, 0x001195E0, 0x06000000, 0x0011A5E0, 0x06001000,
+ 0x0011B5E0, 0x06002000, 0x0011C5E0, 0x06003000, 0x0011D5E0, 0x06008000, 0x0011E5E0, 0x06009000, 0x0011F5E0,
+ 0x0600A000, 0x001205E0, 0x0600B000, 0x001215E0, 0x06000000, 0x001225E0, 0x06001000, 0x001235E0, 0x06002000,
+ 0x001245E0, 0x06003000, 0x001255E0, 0x06008000, 0x001265E0, 0x06009000, 0x001275E0, 0x0600A000, 0x001285E0,
+ 0x0600B000, 0x001295E0, 0x06000000, 0x0012A5E0, 0x06001000, 0x0012B5E0, 0x06002000, 0x0012C5E0, 0x06003000,
+ 0x0012D5E0, 0x06008000, 0x0012E5E0, 0x06009000, 0x0012F5E0, 0x0600A000, 0x001305E0, 0x0600B000
};
-const u8 gUnk_081081E4[] = {
- 0x16,
- 0x17,
- 0x17,
- 0x18,
- 0x18
-};
+const u8 gUnk_081081E4[] = { 0x16, 0x17, 0x17, 0x18, 0x18 };
void Manager7_Main(Manager7* this) {
u32 tmp;
- const u32 * tmp2;
+ const u32* tmp2;
if (!this->manager.action) {
this->manager.action = 1;
this->manager.unk_0e = 8;
@@ -104,9 +57,10 @@ void Manager7_Main(Manager7* this) {
this->manager.unk_0e = 0;
}
}
- if (gRoomControls.unk2) return;
+ if (gRoomControls.unk2)
+ return;
tmp = this->unk_20;
- tmp2 = &gUnk_081080A4[tmp<<4];
+ tmp2 = &gUnk_081080A4[tmp << 4];
switch (this->manager.unk_0e) {
case 0:
gUnk_02034490 = 1;
@@ -121,7 +75,8 @@ void Manager7_Main(Manager7* this) {
case 5:
case 6:
case 7:
- LoadAssetAsync(&gGlobalGfxAndPalettes[tmp2[(this->manager.unk_0e << 1)]], tmp2[(this->manager.unk_0e << 1)+1], 0x1000);
+ LoadAssetAsync(&gGlobalGfxAndPalettes[tmp2[(this->manager.unk_0e << 1)]],
+ tmp2[(this->manager.unk_0e << 1) + 1], 0x1000);
this->manager.unk_0e++;
break;
case 8:
@@ -156,11 +111,12 @@ void sub_08057E64() {
void sub_08057E7C(u32 unk1) {
u32 tmp;
const u32* tmp2;
- if (unk1 > 4) return;
+ if (unk1 > 4)
+ return;
LoadPaletteGroup(gUnk_081081E4[unk1]);
- tmp2 = &gUnk_081080A4[unk1<<4];
+ tmp2 = &gUnk_081080A4[unk1 << 4];
for (tmp = 0; tmp < 8; tmp++, tmp2 += 2) {
- DmaSet(3,&gGlobalGfxAndPalettes[tmp2[0]],tmp2[1],0x84000400);
+ DmaSet(3, &gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x84000400);
}
gRoomVars.unk_10 = unk1;
}
diff --git a/src/manager/manager8.c b/src/manager/manager8.c
index 2688bc42..8fd1d83b 100644
--- a/src/manager/manager8.c
+++ b/src/manager/manager8.c
@@ -47,23 +47,23 @@ extern u8 gUnk_02006F00[];
void sub_08057F20(Manager8* this) {
u32 tmp;
tmp = gRoomControls.roomScrollX - gRoomControls.roomOriginX;
- tmp = tmp + (tmp >> 3) + ((0x400 - gRoomControls.width)/2);
- gScreen.affine.bg3xOffset = tmp&0xF;
- gScreen.affine.bg3yOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY))>>2);
+ tmp = tmp + (tmp >> 3) + ((0x400 - gRoomControls.width) / 2);
+ gScreen.affine.bg3xOffset = tmp & 0xF;
+ gScreen.affine.bg3yOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY)) >> 2);
gScreen.affine.unk5 = gUnk_02001A40;
sub_08058004(tmp, gUnk_02006F00, gUnk_02001A40);
- tmp = ((tmp>>4)<<1);
+ tmp = ((tmp >> 4) << 1);
if (this->unk_38 != tmp) {
this->unk_38 = tmp;
gScreen.affine.unk4 = 1;
}
tmp = (gRoomControls.roomScrollX - gRoomControls.roomOriginX);
- tmp = tmp + (tmp >> 2) + ((0x400 - gRoomControls.width)/2);
- gScreen.bg.bg1yOffset = tmp&0xF;
- gScreen.bg.bg2xOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY))>>1);
+ tmp = tmp + (tmp >> 2) + ((0x400 - gRoomControls.width) / 2);
+ gScreen.bg.bg1yOffset = tmp & 0xF;
+ gScreen.bg.bg2xOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY)) >> 1);
gScreen.bg.unk_14 = gUnk_02001A40 + 0x800;
sub_08058004(tmp, gUnk_02006F00 + 0x2000, gUnk_02001A40 + 0x800);
- tmp = ((tmp>>4)<<1);
+ tmp = ((tmp >> 4) << 1);
if (this->unk_3c != tmp) {
this->unk_3c = tmp;
gScreen.bg.bg2yOffset = 1;
@@ -101,8 +101,8 @@ void sub_08058034() {
void sub_08058084(u16* unk1, u16* unk2) {
u32 tmp;
- for (tmp = 0; tmp < 0x20; tmp++, unk1+=0x20, unk2+=0x80) {
- DmaSet(3,unk1,unk2,0x80000020);
+ for (tmp = 0; tmp < 0x20; tmp++, unk1 += 0x20, unk2 += 0x80) {
+ DmaSet(3, unk1, unk2, 0x80000020);
}
}
@@ -115,19 +115,19 @@ void sub_080580B0(u32 unk1) {
LoadGfxGroup(unk1);
gRoomVars.unk_10 = unk1;
sub_08058034();
- tmp = gRoomControls.roomScrollX - gRoomControls.roomOriginX;//r7
+ tmp = gRoomControls.roomScrollX - gRoomControls.roomOriginX; // r7
tmp = tmp + (tmp >> 3) + (0x400 - gRoomControls.width) / 2;
sub_08058004(tmp, gUnk_02006F00, gUnk_02001A40);
gScreen.affine.bg3xOffset = tmp & 0xF;
- gScreen.affine.bg3yOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY))>>1);//?
+ gScreen.affine.bg3yOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY)) >> 1); //?
gScreen.affine.bg3Control = 0x1D09;
gScreen.affine.unk5 = gUnk_02001A40;
gScreen.affine.unk4 = 1;
- tmp = gRoomControls.roomScrollX - gRoomControls.roomOriginX;//r7
+ tmp = gRoomControls.roomScrollX - gRoomControls.roomOriginX; // r7
tmp = tmp + (tmp >> 2) + (0x400 - gRoomControls.width) / 2;
sub_08058004(tmp, gUnk_02006F00 + 0x2000, gUnk_02001A40 + 0x800);
gScreen.bg.bg1yOffset = tmp & 0xF;
- gScreen.bg.bg2xOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY))>>1);//?
+ gScreen.bg.bg2xOffset = 0x30 - ((0x30 - (gRoomControls.roomScrollY - gRoomControls.roomOriginY)) >> 1); //?
gScreen.bg.bg1xOffset = 0x1E09;
gScreen.bg.unk_14 = gUnk_02001A40 + 0x800;
gScreen.bg.bg2yOffset = 1;
diff --git a/src/manager/manager9.c b/src/manager/manager9.c
index b5929a2e..d57942c7 100644
--- a/src/manager/manager9.c
+++ b/src/manager/manager9.c
@@ -4,7 +4,6 @@
#include "screen.h"
#include "functions.h"
-
typedef struct {
Manager manager;
u8 unk_00[0x1C];
@@ -13,7 +12,7 @@ typedef struct {
void sub_08058204(Manager9*);
void sub_08058210(Manager9*);
-u32 sub_08058244(int);
+u32 sub_08058244(int);
void sub_080582A0(u32, u32*, u8*);
void sub_080582F8(u8*, u8*);
void sub_08058324();
@@ -21,20 +20,14 @@ void sub_08058324();
extern u32 gUnk_02006F00[];
extern u8 gUnk_02001A40[];
-
-const u16 gUnk_081081EC[] = {
- 0x30,
- 0x30,
- 0x30,
- 0x38
-};
+const u16 gUnk_081081EC[] = { 0x30, 0x30, 0x30, 0x38 };
void sub_080581D8(Manager9* this) {
sub_08058210(this);
if (!this->manager.action) {
- this->manager.action=1;
- gScreen.bg.bg2yOffset=0;
- sub_08052D74(this,sub_08058204,NULL);
+ this->manager.action = 1;
+ gScreen.bg.bg2yOffset = 0;
+ sub_08052D74(this, sub_08058204, NULL);
}
}
@@ -44,10 +37,11 @@ void sub_08058204(Manager9* this) {
void sub_08058210(Manager9* this) {
u32 tmp = sub_08058244(this->manager.unk_0a);
- if (this->unk_3c == tmp) return;
+ if (this->unk_3c == tmp)
+ return;
this->unk_3c = tmp;
sub_080582A0(tmp, gUnk_02006F00, gUnk_02001A40);
- gScreen.bg.bg2yOffset=1;
+ gScreen.bg.bg2yOffset = 1;
}
u32 sub_08058244(int i) {
@@ -55,16 +49,16 @@ u32 sub_08058244(int i) {
s32 tmp2;
u32 tmp3;
s32 tmp4;
- tmp = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY)*0x20)/(gRoomControls.height-0xa0);
+ tmp = ((gRoomControls.roomScrollY - gRoomControls.roomOriginY) * 0x20) / (gRoomControls.height - 0xa0);
gScreen.bg.bg2xOffset = gRoomControls.roomOriginY + tmp;
- tmp = (((gRoomControls.roomScrollX - gRoomControls.roomOriginX) * gUnk_081081EC[i])/(gRoomControls.width-0xf0));
+ tmp = (((gRoomControls.roomScrollX - gRoomControls.roomOriginX) * gUnk_081081EC[i]) / (gRoomControls.width - 0xf0));
gScreen.bg.bg1yOffset = tmp & 0xf;
return tmp;
}
void sub_080582A0(u32 unk, u32* unk2, u8* unk3) {
int i = 0x20;
- unk2 += unk>>4;
+ unk2 += unk >> 4;
for (; i != 0; i--) {
DmaSet(3, unk2, unk3, 0x80000020);
unk2 += 0x40;
@@ -94,11 +88,11 @@ extern u32 gUnk_0200B650;
void sub_08058324(u32 unk) {
gUnk_0200B650 = 0;
- LoadPaletteGroup(unk+0x86);
- LoadGfxGroup(unk+0x36);
+ LoadPaletteGroup(unk + 0x86);
+ LoadGfxGroup(unk + 0x36);
sub_080582D0();
- sub_080582A0(sub_08058244(unk),gUnk_02006F00,gUnk_02001A40);
- gScreen.bg.bg1xOffset=0x1D47;
+ sub_080582A0(sub_08058244(unk), gUnk_02006F00, gUnk_02001A40);
+ gScreen.bg.bg1xOffset = 0x1D47;
gScreen.bg.unk_14 = gUnk_02001A40;
gScreen.bg.bg2yOffset = 1;
gScreen.lcd.displayControl |= 0x200;
diff --git a/src/manager/managerA.c b/src/manager/managerA.c
index 7d7fc388..3033dd21 100644
--- a/src/manager/managerA.c
+++ b/src/manager/managerA.c
@@ -5,38 +5,29 @@
#include "flags.h"
#include "area.h"
-
void sub_08058398(ManagerA*);
void sub_080583EC(ManagerA*);
void sub_08058408(ManagerA*);
void sub_08058514(ManagerA*);
void sub_080585B0(ManagerA*);
-
-void (* const gUnk_081081F4[])(ManagerA*) = {
- sub_08058398,
- sub_080583EC,
- sub_08058408,
- sub_08058514,
- sub_080585B0
-};
+
+void (*const gUnk_081081F4[])(ManagerA*) = { sub_08058398, sub_080583EC, sub_08058408, sub_08058514, sub_080585B0 };
void sub_08058380(ManagerA* this) {
gUnk_081081F4[this->manager.action](this);
}
-
-
extern void sub_0805E3A0(Manager*, u32);
void sub_08058398(ManagerA* this) {
-
+
if (CheckFlags(this->unk_3c) != 0) {
DeleteThisEntity();
}
- this->unk_24 = this->unk_3a<<3;
- this->unk_26 = this->unk_3b<<3;
- this->unk_20 = this->unk_24 + (this->unk_38<<4);
- this->unk_22 = this->unk_26 + (this->unk_39<<4);
+ this->unk_24 = this->unk_3a << 3;
+ this->unk_26 = this->unk_3b << 3;
+ this->unk_20 = this->unk_24 + (this->unk_38 << 4);
+ this->unk_22 = this->unk_26 + (this->unk_39 << 4);
sub_0805E3A0(&this->manager, 0x06);
if (this->unk_3e == 0) {
this->manager.action = 2;
@@ -45,7 +36,6 @@ void sub_08058398(ManagerA* this) {
}
}
-
void sub_08058408(ManagerA*);
void sub_080583EC(ManagerA* this) {
@@ -65,21 +55,25 @@ extern void sub_08078B48(void);
u32 sub_0805848C(ManagerA*);
void sub_080585DC(ManagerA*);
-void sub_08058408(ManagerA* this){
+void sub_08058408(ManagerA* this) {
u32 tmp2;
tmp2 = (gPlayerState.flags.all & 0x08);
- if (tmp2 != 0) return;
- if (!CheckPlayerInRegion(this->unk_20, this->unk_22, this->unk_24, this->unk_26)) return;
+ if (tmp2 != 0)
+ return;
+ if (!CheckPlayerInRegion(this->unk_20, this->unk_22, this->unk_24, this->unk_26))
+ return;
switch (this->manager.unk_0a) {
case 1:
return;
case 2:
sub_080585DC(this);
- if ((gPlayerState.flags.all & 0x80) == 0) return;
+ if ((gPlayerState.flags.all & 0x80) == 0)
+ return;
case 0:
default:
sub_080585DC(this);
- if (sub_0805848C(this) == 0) return;
+ if (sub_0805848C(this) == 0)
+ return;
sub_08078A90(3);
sub_08078B48();
sub_0805E544();
@@ -95,9 +89,8 @@ void sub_08058408(ManagerA* this){
}
}
-
u32 sub_0805848C(ManagerA* this) {
- switch (gPlayerState.field_0xa8-5) {
+ switch (gPlayerState.field_0xa8 - 5) {
case 0:
case 2:
case 3:
@@ -128,7 +121,6 @@ u32 sub_0805848C(ManagerA* this) {
}
}
-
extern void UnfreezeTime(void);
void sub_08058514(ManagerA* this) {
@@ -145,12 +137,13 @@ void sub_08058514(ManagerA* this) {
return;
case 0:
case 2:
- if (((--this->manager.unk_0e)<<0x18) == 0) {
+ if (((--this->manager.unk_0e) << 0x18) == 0) {
this->manager.unk_0d++;
}
return;
case 3:
- if (gPlayerEntity.action != 1 && gPlayerEntity.action != 9) return;
+ if (gPlayerEntity.action != 1 && gPlayerEntity.action != 9)
+ return;
gPlayerState.field_0x8b = 1;
UnfreezeTime();
SetFlag(this->unk_3c);
@@ -161,7 +154,6 @@ void sub_08058514(ManagerA* this) {
}
}
-
extern void sub_0801855C(void);
void sub_080585B0(ManagerA* this) {
diff --git a/src/manager/managerB.c b/src/manager/managerB.c
index a23faacf..a63fb8a0 100644
--- a/src/manager/managerB.c
+++ b/src/manager/managerB.c
@@ -10,36 +10,33 @@
* Manager B is used to create fights:
* It possibly waits for an inhibitor flag to be set, then spawns a bunch of entities (based on room data).
* Once all enemies created this way are dead, it sets a flag.
- * (There is also a part about changing the music and setting it back when the fight is done, which is song 0x33 (a fight theme) by default but can be overridden through room data)
-*/
+ * (There is also a part about changing the music and setting it back when the fight is done, which is song 0x33 (a
+ * fight theme) by default but can be overridden through room data)
+ */
void (*const ManagerB_ActionFuncs[])(Manager*);
void sub_080585F0(Manager* this) {
- //make a distincion if this is a controller (unk_0a = 0) or a helper (unk_0a = 1)
+ // make a distincion if this is a controller (unk_0a = 0) or a helper (unk_0a = 1)
ManagerB_ActionFuncs[this->unk_0a](this);
}
-enum ManagerB_State {
- Init,
- WaitForFlag,
- WaitForDone
-};
+enum ManagerB_State { Init, WaitForFlag, WaitForDone };
void (*const ManagerB_StateFuncs[])(ManagerB*);
void ManagerB_Main(ManagerB* this) {
- //make a distinction based on the state of this controller
+ // make a distinction based on the state of this controller
ManagerB_StateFuncs[this->manager.action](this);
}
void ManagerB_LoadFight(Manager*);
void ManagerB_Init(ManagerB* this) {
- //check if the fight was already completed previously (checks the flag that gets set after the fight is done)
+ // check if the fight was already completed previously (checks the flag that gets set after the fight is done)
if (!CheckFlags(this->unk_3e)) {
this->manager.action = WaitForFlag;
- //if there is no flag that needs to be set before the fight is started, start it immediately
+ // if there is no flag that needs to be set before the fight is started, start it immediately
if (!this->unk_3c) {
ManagerB_LoadFight(&this->manager);
}
@@ -67,11 +64,12 @@ void ManagerB_WaitForFlag(ManagerB* this) {
extern void sub_0801855C(void);
void ManagerB_WaitForDone(ManagerB* this) {
- //check if all helpers are done
- if (this->manager.unk_0e) return;
- //set the completion flag for the fight
+ // check if all helpers are done
+ if (this->manager.unk_0e)
+ return;
+ // set the completion flag for the fight
SetFlag(this->unk_3e);
- //restore music (if it was set, which apparently is only possible if there's a flag the fight waited for)
+ // restore music (if it was set, which apparently is only possible if there's a flag the fight waited for)
if (this->unk_3c) {
if (!this->unk_35) {
gArea.musicIndex = this->unk_20;
@@ -79,7 +77,7 @@ void ManagerB_WaitForDone(ManagerB* this) {
sub_0801855C();
}
}
- DeleteThisEntity();
+ DeleteThisEntity();
}
ManagerBHelper* CreateHelper(Manager*);
@@ -96,10 +94,11 @@ void ManagerB_LoadFight(Manager* this) {
this->action = 2;
this->unk_0e = 0;
counter = 0;
- //Create a helper to keep track of the created entities.
+ // Create a helper to keep track of the created entities.
monitor = CreateHelper(this);
- if (!monitor) DeleteThisEntity();
- prop = (EntityData*) GetCurrentRoomProperty(this->unk_0b);
+ if (!monitor)
+ DeleteThisEntity();
+ prop = (EntityData*)GetCurrentRoomProperty(this->unk_0b);
if (prop) {
while (*((u8*)prop) != 0xFF) {
ent = LoadRoomEntity(prop++);
@@ -110,19 +109,20 @@ void ManagerB_LoadFight(Manager* this) {
if (counter >= 7) {
counter = 0;
monitor = CreateHelper(this);
- if (!monitor) return;
+ if (!monitor)
+ return;
}
- }
+ }
}
}
/*
* Create a helper and increment the counter for the number of helpers (unk_0e).
* The helper will decrease said counter when it deletes itself (when none of the enemies it monitors remain).
-*/
+ */
ManagerBHelper* CreateHelper(Manager* this) {
ManagerBHelper* extra;
- extra = (ManagerBHelper*) GetEmptyManager();
+ extra = (ManagerBHelper*)GetEmptyManager();
if (extra) {
extra->manager.type = 9;
extra->manager.subtype = 0xB;
@@ -136,66 +136,61 @@ ManagerBHelper* CreateHelper(Manager* this) {
}
void ManagerBHelper_Monitor(ManagerBHelper* this, Entity* ent, u32 index) {
- this->enemies[index]=ent;
+ this->enemies[index] = ent;
this->manager.unk_0e++;
}
-//case unk_0a is 1: The manager is a helper
+// case unk_0a is 1: The manager is a helper
void ManagerBHelper_Main(Manager* this) {
u8 i, anyRemaining;
Entity* current;
if (this->action == 0) {
this->action = 1;
- sub_0805E3A0(this,3);
+ sub_0805E3A0(this, 3);
}
- //go through and check all monitored enemies.
+ // go through and check all monitored enemies.
anyRemaining = 0;
for (i = 0; i < 8; i++) {
if ((current = ((ManagerBHelper*)this)->enemies[i])) {
if (!current->next) {
- ((ManagerBHelper*) this)->enemies[i] = 0;
+ ((ManagerBHelper*)this)->enemies[i] = 0;
} else {
anyRemaining = 1;
}
}
}
if (!anyRemaining) {
- //inform the parent that we're done
- if (((ManagerB*) this->parent)->manager.unk_0e) {
- ((ManagerB*) this->parent)->manager.unk_0e--;
+ // inform the parent that we're done
+ if (((ManagerB*)this->parent)->manager.unk_0e) {
+ ((ManagerB*)this->parent)->manager.unk_0e--;
}
DeleteThisEntity();
}
}
-
extern Manager gUnk_03003DB0;
/*
* Replace an entity that is currently being monitored with a new one
-*/
+ */
void ReplaceMonitoredEntity(Entity* old, Entity* new) {
- ManagerBHelper* current;
+ ManagerBHelper* current;
Manager* end = &gUnk_03003DB0;
u32 i;
- for (current = (ManagerBHelper*) end->next; (Manager*)current != end; current=(ManagerBHelper*)current->manager.next) {
- if (current->manager.type != 0x9 || current->manager.subtype != 0xB) continue;
- for (i = 0; i < 8; i++) {
- if (old == current->enemies[i]) {
- current->enemies[i] = new;
- return;
- }
+ for (current = (ManagerBHelper*)end->next; (Manager*)current != end;
+ current = (ManagerBHelper*)current->manager.next) {
+ if (current->manager.type != 0x9 || current->manager.subtype != 0xB)
+ continue;
+ for (i = 0; i < 8; i++) {
+ if (old == current->enemies[i]) {
+ current->enemies[i] = new;
+ return;
}
+ }
}
}
-void (*const ManagerB_ActionFuncs[])(Manager*) = {
- (void (*)(Manager*)) ManagerB_Main,
- (void (*)(Manager*)) ManagerBHelper_Main
-};
-void (*const ManagerB_StateFuncs[])(ManagerB*) = {
- ManagerB_Init,
- ManagerB_WaitForFlag,
- ManagerB_WaitForDone
-};
+void (*const ManagerB_ActionFuncs[])(Manager*) = { (void (*)(Manager*))ManagerB_Main,
+ (void (*)(Manager*))ManagerBHelper_Main };
+void (*const ManagerB_StateFuncs[])(ManagerB*) = { ManagerB_Init, ManagerB_WaitForFlag, ManagerB_WaitForDone };
diff --git a/src/manager/managerE.c b/src/manager/managerE.c
index f9edc70a..b48c1cc5 100644
--- a/src/manager/managerE.c
+++ b/src/manager/managerE.c
@@ -27,7 +27,7 @@ void sub_08058E60(ManagerE* this) {
sub_08078A90(0xff);
sub_08078B48();
}
- if (this->unk_3a == 0){
+ if (this->unk_3a == 0) {
if (this->unk_38 != 0) {
PlaySFX(this->unk_38);
}
diff --git a/src/npc/anju.c b/src/npc/anju.c
index 72ada630..b0b0ee91 100644
--- a/src/npc/anju.c
+++ b/src/npc/anju.c
@@ -15,8 +15,7 @@ extern void sub_0807DD94(Entity*, u32);
extern u32 sub_0801E99C(void);
extern void sub_08078784(Entity*, u32);
-void Anju(Entity *this)
-{
+void Anju(Entity* this) {
switch (this->action) {
case 0:
this->action = 1;
@@ -28,7 +27,8 @@ void Anju(Entity *this)
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
- InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
+ InitializeAnimation(this,
+ (this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
@@ -42,20 +42,17 @@ void Anju(Entity *this)
}
}
-void sub_0806C354(Entity *this)
-{
+void sub_0806C354(Entity* this) {
this->field_0x68.HALF.LO = sub_0801E99C();
sub_08078784(this, this->field_0x68.HALF.LO);
}
-void Anju_Fusion(Entity *this)
-{
- if (this->action == 0) {
- this->action++;
- this->spriteSettings.b.draw = 1;
- InitAnimationForceUpdate(this,6);
- }
- else {
- UpdateAnimationSingleFrame(this);
- }
+void Anju_Fusion(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ this->spriteSettings.b.draw = 1;
+ InitAnimationForceUpdate(this, 6);
+ } else {
+ UpdateAnimationSingleFrame(this);
+ }
}
diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c
index cc6433f6..afaf454d 100644
--- a/src/npc/bladeBrothers.c
+++ b/src/npc/bladeBrothers.c
@@ -6,7 +6,6 @@
#include "room.h"
#include "textbox.h"
-
extern void (*gUnk_081115C0[])(Entity*);
extern void (*gUnk_081115D0[])(Entity*);
@@ -304,22 +303,22 @@ switchD_08068d12_caseD_0:
*(u32*)&param_2->animationState = 1;
}
-//Introduction dialoague
+// Introduction dialoague
void sub_08068DB8(Entity* this) {
TextboxNoOverlap(gUnk_08111664[this->actionDelay], this);
}
-//Ask to teach dialoague
+// Ask to teach dialoague
void sub_08068DD0(Entity* this) {
TextboxNoOverlap(gUnk_0811167A[this->actionDelay], this);
}
-//Technique Dialogue
+// Technique Dialogue
void sub_08068DE8(Entity* this) {
TextboxNoOverlap(gUnk_08111690[this->actionDelay], this);
}
-//Posession dialogue
+// Posession dialogue
void sub_08068E00(Entity* this) {
TextboxNoOverlap(gUnk_081116A6[this->actionDelay], this);
}
diff --git a/src/npc/carlov.c b/src/npc/carlov.c
index b5251365..1d17ee4c 100644
--- a/src/npc/carlov.c
+++ b/src/npc/carlov.c
@@ -8,25 +8,22 @@
#include "npc.h"
#include "structures.h"
-extern void sub_0807DD50(Entity *);
-extern void sub_0807DD94(Entity *,u32);
+extern void sub_0807DD50(Entity*);
+extern void sub_0807DD94(Entity*, u32);
extern void EnqueueSFX(u32);
-extern void sub_08080964(u32,u32);
+extern void sub_08080964(u32, u32);
-
-void Carlov(Entity *this)
-{
+void Carlov(Entity* this) {
if (this->action == 0) {
this->action++;
sub_0807DD50(this);
- }
- else {
- sub_0807DD94(this,0);
+ } else {
+ sub_0807DD94(this, 0);
}
if ((this->frames.all & 0x10) != 0) {
this->frames.all = this->frames.all & 0xef;
EnqueueSFX(0x104);
- sub_08080964(0x10,0);
+ sub_08080964(0x10, 0);
}
if ((this->frames.all & 0x20) != 0) {
this->frames.all = this->frames.all & 0xdf;
diff --git a/src/npc/carpenter.c b/src/npc/carpenter.c
index 5d36bffb..db160475 100644
--- a/src/npc/carpenter.c
+++ b/src/npc/carpenter.c
@@ -35,7 +35,8 @@ void Carpenter(Entity* this) {
this->action = 2;
this->interactType = 0;
this->field_0x68.HALF.HI = this->animIndex;
- InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 + (this->entityType.form * 8));
+ InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)) + 4 +
+ (this->entityType.form * 8));
sub_0806F118(this);
} else {
sub_0807DDAC(this, 0);
@@ -68,7 +69,6 @@ void Carpenter_Head(Entity* this) {
}
}
-void sub_080672b0(Entity *this, u32 param_2)
-{
- InitializeAnimation(this,*(u32 *)(param_2 + 4) + (this->animationState >> 1) + this->entityType.form * 8);
+void sub_080672b0(Entity* this, u32 param_2) {
+ InitializeAnimation(this, *(u32*)(param_2 + 4) + (this->animationState >> 1) + this->entityType.form * 8);
}
diff --git a/src/npc/festari.c b/src/npc/festari.c
index dccde267..67637ec3 100644
--- a/src/npc/festari.c
+++ b/src/npc/festari.c
@@ -8,49 +8,43 @@ extern u32 sub_0801E99C(Entity*);
extern void sub_08078784(Entity*, u32);
extern void sub_0807DD50(Entity*);
extern void sub_0806F118(Entity*);
-extern void ExecuteScriptCommandSet(Entity*, void *);
+extern void ExecuteScriptCommandSet(Entity*, void*);
extern void sub_0805FF2C(Entity*, void*);
extern void (*const gUnk_08109BBC[])(Entity*);
-
-void Festari(Entity *this)
-{
+void Festari(Entity* this) {
gUnk_08109BBC[this->action](this);
}
-void sub_0805FE10(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = TRUE;
- sub_0805E3A0(this, 2);
- this->field_0x68.HALF.LO = sub_0801E99C(this);
- sub_08078784(this, this->field_0x68.HALF.LO);
- sub_0807DD50(this);
+void sub_0805FE10(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = TRUE;
+ sub_0805E3A0(this, 2);
+ this->field_0x68.HALF.LO = sub_0801E99C(this);
+ sub_08078784(this, this->field_0x68.HALF.LO);
+ sub_0807DD50(this);
}
-void sub_0805FE48(Entity *this)
-{
+void sub_0805FE48(Entity* this) {
u8 bVar1;
u16 uVar2;
u32 uVar3;
u32 uVar4;
-
+
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
sub_0806F118(this);
- }
- else {
- ExecuteScriptCommandSet(this, *(void **)&this->cutsceneBeh);
- sub_0805FF2C(this, *(void **)&this->cutsceneBeh);
+ } else {
+ ExecuteScriptCommandSet(this, *(void**)&this->cutsceneBeh);
+ sub_0805FF2C(this, *(void**)&this->cutsceneBeh);
uVar4 = this->field_0x80.HWORD;
if (uVar4 < 8) {
if ((this->field_0x82.HWORD & 1) != 0) {
uVar4 = (uVar4 & 0xfc) + (this->field_0xf >> 1);
- }
- else {
+ } else {
uVar4 = (uVar4 & 0xfc) + (this->animationState >> 1);
this->field_0xf = this->animationState;
}
@@ -60,8 +54,7 @@ void sub_0805FE48(Entity *this)
}
UpdateAnimationSingleFrame(this);
- if (this->frames.b.f3)
- {
+ if (this->frames.b.f3) {
switch (this->animIndex) {
case 8:
case 10:
@@ -77,9 +70,8 @@ void sub_0805FE48(Entity *this)
}
}
-void sub_0805FF18(Entity *this)
-{
- if (UpdateFuseInteraction(this)) {
- this->action = 1;
- }
+void sub_0805FF18(Entity* this) {
+ if (UpdateFuseInteraction(this)) {
+ this->action = 1;
+ }
}
diff --git a/src/npc/gentari.c b/src/npc/gentari.c
index cbd521b2..b7387777 100644
--- a/src/npc/gentari.c
+++ b/src/npc/gentari.c
@@ -11,8 +11,7 @@ extern u32 sub_0806F5A4(u32);
extern void sub_0806F118(Entity*);
extern void sub_0807DD94(Entity*, u32);
-void Gentari(Entity *this)
-{
+void Gentari(Entity* this) {
switch (this->action) {
case 0:
this->action = 1;
@@ -35,19 +34,17 @@ void Gentari(Entity *this)
case 2:
if (UpdateFuseInteraction(this)) {
this->action = 1;
- }
+ }
}
}
-void Gentari_Fusion(Entity *this)
-{
- if (this->action == 0) {
- this->action++;
- this->spriteSettings.b.draw = TRUE;
- sub_0805E3A0(this, 2);
- InitAnimationForceUpdate(this, 10);
- }
- else {
- UpdateAnimationSingleFrame(this);
- }
+void Gentari_Fusion(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ this->spriteSettings.b.draw = TRUE;
+ sub_0805E3A0(this, 2);
+ InitAnimationForceUpdate(this, 10);
+ } else {
+ UpdateAnimationSingleFrame(this);
+ }
}
diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c
index 9c2e56fe..35de4c0a 100644
--- a/src/npc/goronMerchant.c
+++ b/src/npc/goronMerchant.c
@@ -13,87 +13,76 @@ extern void (*const gUnk_08111B98[])(Entity*);
extern u16 gUnk_08111BA0[];
-
-void GoronMerchant(Entity *this)
-{
- if ((this->flags & 2) != 0) {
- gUnk_08111B98[this->action](this);
- }
- else {
- gUnk_08111B88[this->action](this);
- sub_0806ED78(this);
- }
+void GoronMerchant(Entity* this) {
+ if ((this->flags & 2) != 0) {
+ gUnk_08111B98[this->action](this);
+ } else {
+ gUnk_08111B88[this->action](this);
+ sub_0806ED78(this);
+ }
}
-void sub_08069584(Entity *this)
-{
- if (gScreenTransition.field_0x24[8] != 0) {
- this->action = 3;
+void sub_08069584(Entity* this) {
+ if (gScreenTransition.field_0x24[8] != 0) {
+ this->action = 3;
+ } else {
+ this->action = 1;
}
- else {
- this->action = 1;
- }
- InitAnimationForceUpdate(this, 2);
+ InitAnimationForceUpdate(this, 2);
}
-void sub_080695AC(Entity *this)
-{
- s32 iVar2;
+void sub_080695AC(Entity* this) {
+ s32 iVar2;
- if (++this->field_0xf > 0x10) {
- this->field_0xf = 0;
- iVar2 = sub_0806ED9C(this, 0x28, 0x28);
- if (iVar2 > -1) {
- this->animationState = iVar2;
+ if (++this->field_0xf > 0x10) {
+ this->field_0xf = 0;
+ iVar2 = sub_0806ED9C(this, 0x28, 0x28);
+ if (iVar2 > -1) {
+ this->animationState = iVar2;
+ }
+ }
+ if (this->animIndex != this->animationState) {
+ InitAnimationForceUpdate(this, this->animationState);
}
- }
- if (this->animIndex != this->animationState) {
- InitAnimationForceUpdate(this, this->animationState);
- }
}
-void sub_080695E8(Entity *this)
-{
- UpdateAnimationSingleFrame(this);
- if ((gTextBox.doTextBox & 0x7f) == 0) {
- this->action = 1;
- this->interactType = gTextBox.doTextBox & 0x7f;
- sub_0805E584(this);
- InitAnimationForceUpdate(this, this->animationState);
- }
+void sub_080695E8(Entity* this) {
+ UpdateAnimationSingleFrame(this);
+ if ((gTextBox.doTextBox & 0x7f) == 0) {
+ this->action = 1;
+ this->interactType = gTextBox.doTextBox & 0x7f;
+ sub_0805E584(this);
+ InitAnimationForceUpdate(this, this->animationState);
+ }
}
-void sub_0806961C(Entity *this)
-{
- if (gScreenTransition.field_0x24[8] == 2) {
- UpdateAnimationSingleFrame(this);
- }
- sub_0806FD3C(this);
+void sub_0806961C(Entity* this) {
+ if (gScreenTransition.field_0x24[8] == 2) {
+ UpdateAnimationSingleFrame(this);
+ }
+ sub_0806FD3C(this);
}
-void sub_0806963C(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = TRUE;
- sub_0807DD50(this);
+void sub_0806963C(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = TRUE;
+ sub_0807DD50(this);
}
-void sub_08069654(Entity* this) {
+void sub_08069654(Entity* this) {
sub_0807DD94(this, 0);
}
-void sub_08069660(Entity *this)
-{
- u32 uVar1;
-
- TextboxNoOverlap(0x2c1c, this);
- gTextBox.field_0x10 = (u16)sub_080696BC(this);
+void sub_08069660(Entity* this) {
+ u32 uVar1;
+
+ TextboxNoOverlap(0x2c1c, this);
+ gTextBox.field_0x10 = (u16)sub_080696BC(this);
}
-void sub_08069684(void)
-{
- Manager *mgr;
-
+void sub_08069684(void) {
+ Manager* mgr;
+
if (FindEntityInListBySubtype(9, 0x31, 8) == NULL) {
mgr = GetEmptyManager();
if (mgr != NULL) {
@@ -104,40 +93,37 @@ void sub_08069684(void)
}
}
-void sub_080696B0(void)
-{
- gRoomVars.itemForSaleIndex = 0;
+void sub_080696B0(void) {
+ gRoomVars.itemForSaleIndex = 0;
}
-u32 sub_080696BC(Entity* this)
-{
- u32 uVar1;
- u32 temp;
- u32 iVar3;
- s32 temp2;
-
- temp2 = gRoomVars.field_0x7;
- if (temp2 > 0x70) {
- iVar3 = 1;
- }
- else {
- iVar3 = 0;
- }
- if (temp2 > 0x72) {
- iVar3 = 2;
- }
-
- temp = CheckGlobalFlag(0x3e);
- uVar1 = (-temp | temp) >> 0x1f;
-
- if (CheckGlobalFlag(0x3f)) {
- uVar1 = 2;
- }
- if (CheckGlobalFlag(0x40)) {
- uVar1 = 3;
- }
- if (CheckGlobalFlag(0x41)) {
- uVar1 = 4;
- }
- return gUnk_08111BA0[uVar1 * 3 + iVar3];
+u32 sub_080696BC(Entity* this) {
+ u32 uVar1;
+ u32 temp;
+ u32 iVar3;
+ s32 temp2;
+
+ temp2 = gRoomVars.field_0x7;
+ if (temp2 > 0x70) {
+ iVar3 = 1;
+ } else {
+ iVar3 = 0;
+ }
+ if (temp2 > 0x72) {
+ iVar3 = 2;
+ }
+
+ temp = CheckGlobalFlag(0x3e);
+ uVar1 = (-temp | temp) >> 0x1f;
+
+ if (CheckGlobalFlag(0x3f)) {
+ uVar1 = 2;
+ }
+ if (CheckGlobalFlag(0x40)) {
+ uVar1 = 3;
+ }
+ if (CheckGlobalFlag(0x41)) {
+ uVar1 = 4;
+ }
+ return gUnk_08111BA0[uVar1 * 3 + iVar3];
}
diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c
index 1aca5a34..6ccdd0a8 100644
--- a/src/npc/mailbox.c
+++ b/src/npc/mailbox.c
@@ -57,5 +57,6 @@ void sub_08063280(Entity* this, u32 unused) {
UpdateAnimationSingleFrame(e);
var = e->frames.all & 0x7F;
e->frames.all ^= var;
- if (var == 2) CreateFx(e, 49, 0);
+ if (var == 2)
+ CreateFx(e, 49, 0);
}
diff --git a/src/npc/moblinLady.c b/src/npc/moblinLady.c
index 74fc9268..640c09d9 100644
--- a/src/npc/moblinLady.c
+++ b/src/npc/moblinLady.c
@@ -9,13 +9,11 @@
extern void sub_0807DD50();
extern void sub_0807DD94();
-
void MoblinLady(Entity* this) {
if (this->action == 0) {
this->action++;
sub_0807DD50(this);
- }
- else {
- sub_0807DD94(this,0);
+ } else {
+ sub_0807DD94(this, 0);
}
}
diff --git a/src/npc/npc9.c b/src/npc/npc9.c
index d720bddf..47cc501b 100644
--- a/src/npc/npc9.c
+++ b/src/npc/npc9.c
@@ -9,45 +9,40 @@ extern void sub_0805E584(Entity*);
extern void (*const gUnk_0810C290[])(Entity*);
-void NPC9(Entity *this)
-{
+void NPC9(Entity* this) {
gUnk_0810C290[this->action](this);
}
-void sub_08062AF0(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = TRUE;
- InitializeAnimation(this, 0);
- sub_08078778(this);
+void sub_08062AF0(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = TRUE;
+ InitializeAnimation(this, 0);
+ sub_08078778(this);
}
-void sub_08062B14(Entity *this)
-{
- GetNextFrame(this);
- if (this->interactType != 0) {
- this->interactType = 0;
- this->action++;
- InitializeAnimation(this, 1);
- sub_0805E47C(this);
- }
- sub_0806ED78(this);
+void sub_08062B14(Entity* this) {
+ GetNextFrame(this);
+ if (this->interactType != 0) {
+ this->interactType = 0;
+ this->action++;
+ InitializeAnimation(this, 1);
+ sub_0805E47C(this);
+ }
+ sub_0806ED78(this);
}
-void sub_08062B48(Entity *this)
-{
- GetNextFrame(this);
- if ((this->frames.b.f3) != 0) {
- TextboxNoOverlapFollow(0xa01);
- this->action++;
- }
+void sub_08062B48(Entity* this) {
+ GetNextFrame(this);
+ if ((this->frames.b.f3) != 0) {
+ TextboxNoOverlapFollow(0xa01);
+ this->action++;
+ }
}
-void sub_08062B70(Entity *this)
-{
- if ((gTextBox.doTextBox & 0x7f) == 0) {
- InitializeAnimation(this, 2);
- this->action = 1;
- sub_0805E584(this);
- }
+void sub_08062B70(Entity* this) {
+ if ((gTextBox.doTextBox & 0x7f) == 0) {
+ InitializeAnimation(this, 2);
+ this->action = 1;
+ sub_0805E584(this);
+ }
}
diff --git a/src/npc/postman.c b/src/npc/postman.c
index 0624935b..b1a328c1 100644
--- a/src/npc/postman.c
+++ b/src/npc/postman.c
@@ -125,8 +125,7 @@ void sub_080604DC(Entity* this) {
}
}
-void sub_08060528(Entity *this)
-{
+void sub_08060528(Entity* this) {
switch (this->action) {
case 0:
this->action = 1;
@@ -140,23 +139,21 @@ void sub_08060528(Entity *this)
break;
case 1:
if (this->interactType == 2) {
- this->action = 3;
- this->interactType = 0;
- sub_0806F118(this);
- InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
- }
- else {
+ this->action = 3;
+ this->interactType = 0;
+ sub_0806F118(this);
+ InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
+ } else {
if (this->interactType != 0) {
this->action = 2;
this->interactType = 0;
sub_080606D8(this);
InitAnimationForceUpdate(this, sub_0806F5A4(GetFacingDirection(this, &gPlayerEntity)));
- }
- else {
+ } else {
sub_0807DD94(this, 0);
}
}
- break;
+ break;
case 2:
UpdateAnimationSingleFrame(this);
if ((gTextBox.doTextBox & 0x7f) != 0) {
@@ -170,51 +167,47 @@ void sub_08060528(Entity *this)
break;
}
this->action = 1;
- }
- sub_080604DC(this);
- if (0 < (s16)this->field_0x6a.HWORD) {
- if ((s16)this->field_0x6a.HWORD > 0x12b) {
- this->field_0x6a.HWORD = 0;
- this->field_0x20 = 0x20000;
- this->field_0x6c.HALF.HI = 1;
- sub_080788E0(this);
- EnqueueSFX(0x7c);
}
- else {
- this->field_0x6a.HWORD -= 1;
+ sub_080604DC(this);
+ if (0 < (s16)this->field_0x6a.HWORD) {
+ if ((s16)this->field_0x6a.HWORD > 0x12b) {
+ this->field_0x6a.HWORD = 0;
+ this->field_0x20 = 0x20000;
+ this->field_0x6c.HALF.HI = 1;
+ sub_080788E0(this);
+ EnqueueSFX(0x7c);
+ } else {
+ this->field_0x6a.HWORD -= 1;
+ }
+ }
+ sub_08003FC4(this, 0x1800);
+ if (((this->field_0x6c.HALF.HI != 0) && (this->field_0x20 == 0)) && this->height.WORD == 0) {
+ this->field_0x6c.HALF.HI = 0;
+ sub_080606C0(this);
}
- }
- sub_08003FC4(this, 0x1800);
- if (((this->field_0x6c.HALF.HI != 0) && (this->field_0x20 == 0)) && this->height.WORD == 0) {
- this->field_0x6c.HALF.HI = 0;
- sub_080606C0(this);
- }
- if ((-1 < this->height.WORD) &&
- ((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
- sub_0806ED78(this);
- }
- sub_0800451C(this);
+ if ((-1 < this->height.WORD) &&
+ ((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
+ sub_0806ED78(this);
+ }
+ sub_0800451C(this);
}
-void sub_080606C0(Entity *this)
-{
- this->field_0x6c.HALF.LO = sub_0801E99C(this);
- sub_08078784(this, this->field_0x6c.HALF.LO);
+void sub_080606C0(Entity* this) {
+ this->field_0x6c.HALF.LO = sub_0801E99C(this);
+ sub_08078784(this, this->field_0x6c.HALF.LO);
}
-void sub_080606D8(Entity* this)
-{
- s32 index;
-
- index = gUnk_02002A40.unk8 - 2;
- if (index < 0) {
- index = 0;
- }
- ShowNPCDialogue(this, &gUnk_0810AA30[index]);
+void sub_080606D8(Entity* this) {
+ s32 index;
+
+ index = gUnk_02002A40.unk8 - 2;
+ if (index < 0) {
+ index = 0;
+ }
+ ShowNPCDialogue(this, &gUnk_0810AA30[index]);
}
-void sub_08060700(Entity *entity, u32 arg1)
-{
+void sub_08060700(Entity* entity, u32 arg1) {
s8* var0 = gUnk_0810A918[(s8)entity->field_0x68.HALF.LO];
Coords16* coords = &gUnk_0810A66C[var0[(s8)entity->field_0x68.HALF.HI]];
u32 x = coords->x + gRoomControls.roomOriginX;
@@ -223,8 +216,7 @@ void sub_08060700(Entity *entity, u32 arg1)
gUnk_02033280.unk |= 1;
}
-void sub_0806075C(Entity *this)
-{
+void sub_0806075C(Entity* this) {
this->field_0x68.HALF.LO = 0xb;
this->field_0x68.HALF.HI = 0xff;
}
diff --git a/src/npc/rem.c b/src/npc/rem.c
index 6d17b95d..415f7ffa 100644
--- a/src/npc/rem.c
+++ b/src/npc/rem.c
@@ -38,15 +38,14 @@ void sub_0806a370(Entity* this) {
}
}
-void sub_0806A3D8(Entity *this)
-{
- u32 *uVar1;
-
- this->action = 1;
- this->actionDelay = 0xb4;
- sub_0805E3A0(this, 2);
- sub_0806A8C8(this);
- uVar1 = StartCutscene(this,&gUnk_08012F0C);
- *(u32 *)&this->cutsceneBeh = (u32)uVar1;
- sub_0807DD94(this, 0);
+void sub_0806A3D8(Entity* this) {
+ u32* uVar1;
+
+ this->action = 1;
+ this->actionDelay = 0xb4;
+ sub_0805E3A0(this, 2);
+ sub_0806A8C8(this);
+ uVar1 = StartCutscene(this, &gUnk_08012F0C);
+ *(u32*)&this->cutsceneBeh = (u32)uVar1;
+ sub_0807DD94(this, 0);
}
diff --git a/src/npc/simon.c b/src/npc/simon.c
index d30b869a..7c4b7f48 100644
--- a/src/npc/simon.c
+++ b/src/npc/simon.c
@@ -5,51 +5,45 @@
#include "flags.h"
typedef struct {
- u8 filler[4];
- u32 unk;
+ u8 filler[4];
+ u32 unk;
} struct_0806C2A0;
-extern void DoExitTransition(void *);
+extern void DoExitTransition(void*);
extern void SetTileType(u32, u32, u32);
-extern void DoExitTransition(void *);
+extern void DoExitTransition(void*);
extern void DoFade(u32, u32);
extern void gUnk_0813AD60;
extern void gUnk_0813AD74;
-void Simon(Entity *this)
-{
- if (this->action == 0) {
- this->action++;
- sub_0807DD50(this);
- }
- else {
- sub_0807DD94(this, 0);
- }
+void Simon(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ sub_0807DD50(this);
+ } else {
+ sub_0807DD94(this, 0);
+ }
}
-void sub_0806C224(void)
-{
- DoExitTransition(&gUnk_0813AD60);
- gScreenTransition.transitionType = 6;
+void sub_0806C224(void) {
+ DoExitTransition(&gUnk_0813AD60);
+ gScreenTransition.transitionType = 6;
}
-void Simon_CreateChest(Entity *this)
-{
- CreateObjectWithParent(this,0xf,0x43,0);
- SetTileType(0x73, COORD_TO_TILE(this), this->collisionLayer);
- PlaySFX(0x73);
+void Simon_CreateChest(Entity* this) {
+ CreateObjectWithParent(this, 0xf, 0x43, 0);
+ SetTileType(0x73, COORD_TO_TILE(this), this->collisionLayer);
+ PlaySFX(0x73);
}
-void sub_0806C280(void)
-{
- SetGlobalFlag(MAROYA_WAKEUP);
- DoExitTransition(&gUnk_0813AD74);
- gScreenTransition.transitionType = 6;
+void sub_0806C280(void) {
+ SetGlobalFlag(MAROYA_WAKEUP);
+ DoExitTransition(&gUnk_0813AD74);
+ gScreenTransition.transitionType = 6;
}
-void sub_0806C2A0(u32 *param_1,struct_0806C2A0 *param_2)
-{
+void sub_0806C2A0(u32* param_1, struct_0806C2A0* param_2) {
switch (param_2->unk) {
case 0:
DoFade(0xd, 4);
diff --git a/src/npc/syrup.c b/src/npc/syrup.c
index 58a3cb61..7904ce09 100644
--- a/src/npc/syrup.c
+++ b/src/npc/syrup.c
@@ -2,7 +2,6 @@
#include "entity.h"
#include "npc.h"
-
extern void sub_0807DD50(Entity*);
extern void sub_0806ED78(Entity*);
extern void sub_0805E3A0(Entity*, u32);
@@ -16,50 +15,45 @@ extern void sub_0807DD94(Entity*, u32);
extern void sub_0806A26C(Entity*);
extern void sub_080042BA(Entity*, u32);
-void Syrup(Entity *this)
-{
- gUnk_081121D4[this->action](this);
- sub_0806ED78(this);
+void Syrup(Entity* this) {
+ gUnk_081121D4[this->action](this);
+ sub_0806ED78(this);
}
-void sub_0806A1F8(Entity *this)
-{
+void sub_0806A1F8(Entity* this) {
u32 iVar1;
- SpriteLoadData *paVar2;
+ SpriteLoadData* paVar2;
- (this->entityType).form == 0 ? (paVar2 = &gUnk_081121B4) : (paVar2 = &gUnk_081121C4);
+ (this->entityType).form == 0 ? (paVar2 = &gUnk_081121B4) : (paVar2 = &gUnk_081121C4);
- iVar1 = LoadExtraSpriteData(this,paVar2);
- if (iVar1) {
- this->action = 1;
- sub_0805E3A0(this,2);
- sub_0807DD50(this);
- InitializeAnimation(this,0);
- }
+ iVar1 = LoadExtraSpriteData(this, paVar2);
+ if (iVar1) {
+ this->action = 1;
+ sub_0805E3A0(this, 2);
+ sub_0807DD50(this);
+ InitializeAnimation(this, 0);
+ }
}
-void sub_0806A234(Entity *this)
-{
+void sub_0806A234(Entity* this) {
sub_0807DD94(this, 0);
if ((this->field_0x82.HWORD & 4) != 0) {
if ((gScreenTransition & 7) == 0) {
sub_0806A26C(this);
}
- sub_080042BA(this, 2);
+ sub_080042BA(this, 2);
}
}
#ifdef NON_MATCHING
-void sub_0806A26C(Entity *this)
-{
+void sub_0806A26C(Entity* this) {
u8 unk;
u32 uVar2;
- Entity *pEVar1;
- pEVar1 = CreateObject(0xf,0x2f,0);
+ Entity* pEVar1;
+ pEVar1 = CreateObject(0xf, 0x2f, 0);
if (pEVar1 != NULL) {
PositionEntityOnTop(this, pEVar1);
- if (uVar2 = Random(), uVar2)
- {
+ if (uVar2 = Random(), uVar2) {
unk = -unk; // wtf?!
}
pEVar1->spriteOffsetX = gUnk_081121DC[uVar2 & 7];
@@ -68,8 +62,7 @@ void sub_0806A26C(Entity *this)
}
#else
NAKED
-void sub_0806A26C(Entity *this)
-{
+void sub_0806A26C(Entity* this) {
asm(".include \"asm/non_matching/syrup/sub_0806A26C.inc\"");
}
#endif
diff --git a/src/npc/wheaton.c b/src/npc/wheaton.c
index abcf1fbd..b7003233 100644
--- a/src/npc/wheaton.c
+++ b/src/npc/wheaton.c
@@ -1,13 +1,13 @@
#include "global.h"
#include "entity.h"
-extern void sub_0805E3A0(Entity *, u32);
-extern void ResolveEntityOnTop(Entity *, Entity *);
+extern void sub_0805E3A0(Entity*, u32);
+extern void ResolveEntityOnTop(Entity*, Entity*);
extern BoundingBox gUnk_0810C3C0;
-extern void sub_0807DD64(Entity *);
-extern void sub_0807DD94(Entity *, u32);
+extern void sub_0807DD64(Entity*);
+extern void sub_0807DD94(Entity*, u32);
-void Wheaton(Entity *this) {
+void Wheaton(Entity* this) {
if (this->action == 0) {
this->action++;
diff --git a/src/npc/zeldaFollower.c b/src/npc/zeldaFollower.c
index fbcc9ecc..6f5866b2 100644
--- a/src/npc/zeldaFollower.c
+++ b/src/npc/zeldaFollower.c
@@ -5,8 +5,7 @@
extern void sub_08068318(Entity*);
extern void sub_0806854C(Entity*, u32);
-void ZeldaFollower(Entity *this)
-{
+void ZeldaFollower(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.b.draw = TRUE;
diff --git a/src/object/archway.c b/src/object/archway.c
index 1ca48499..b00192db 100644
--- a/src/object/archway.c
+++ b/src/object/archway.c
@@ -4,8 +4,7 @@
extern u32 CheckIsDungeon();
-void Archway(Entity *this)
-{
+void Archway(Entity* this) {
u32 v1;
u32 v2;
u32 v3;
@@ -20,8 +19,8 @@ void Archway(Entity *this)
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
v3 = CheckIsDungeon();
- if (v3 != 0) {
- this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1;
+ if (v3 != 0) {
+ this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1;
+ }
}
- }
}
diff --git a/src/object/backgroundCloud.c b/src/object/backgroundCloud.c
index 6be23764..909a88a8 100644
--- a/src/object/backgroundCloud.c
+++ b/src/object/backgroundCloud.c
@@ -30,8 +30,7 @@ void sub_0808F658(Entity* this) {
void sub_0808F6E0(Entity* this) {
sub_0806F69C(this);
- if ((s16)this->x.HALF.HI < (s16)this->field_0x78.HWORD ||
- (s16)this->x.HALF.HI > (s16)this->field_0x7a.HWORD)
+ if ((s16)this->x.HALF.HI < (s16)this->field_0x78.HWORD || (s16)this->x.HALF.HI > (s16)this->field_0x7a.HWORD)
this->action = 2;
}
diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c
index 8e8522c0..67d69520 100644
--- a/src/object/bigVortex.c
+++ b/src/object/bigVortex.c
@@ -108,4 +108,4 @@ void sub_08098E88(Entity* this) {
PositionRelative(this, ent2, 0, -0x20000);
ent2->spriteOffsetY = 0x10;
}
-} \ No newline at end of file
+}
diff --git a/src/object/bird.c b/src/object/bird.c
index 83af1b5d..aedff14d 100644
--- a/src/object/bird.c
+++ b/src/object/bird.c
@@ -141,4 +141,4 @@ void sub_0809D178(Entity* this) {
} else {
GetNextFrame(this);
}
-} \ No newline at end of file
+}
diff --git a/src/object/button.c b/src/object/button.c
index 99d018b3..8ba71c8e 100644
--- a/src/object/button.c
+++ b/src/object/button.c
@@ -19,8 +19,8 @@ void sub_08081AE0(Entity* this) {
if (this->cutsceneBeh.HWORD != 0) {
this->collisionLayer = this->cutsceneBeh.HWORD;
}
- this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX)>>4) & 0x3F) |
- ((((this->y.HALF.HI - gRoomControls.roomOriginY)>>4) & 0x3F) << 6);
+ this->field_0x74.HWORD = (((this->x.HALF.HI - gRoomControls.roomOriginX) >> 4) & 0x3F) |
+ ((((this->y.HALF.HI - gRoomControls.roomOriginY) >> 4) & 0x3F) << 6);
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
if (this->entityType.form == 0 && CheckFlags(this->field_0x86.HWORD)) {
this->action = 5;
@@ -36,7 +36,7 @@ void sub_08081AE0(Entity* this) {
void sub_08081B84(Entity* this) {
if (sub_08081E3C(this)) {
- this->action=2;
+ this->action = 2;
this->field_0x70.HALF.HI = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
}
}
@@ -167,7 +167,7 @@ Entity* sub_08081D74(Entity* this) {
}
}
}
- this->attachedEntity=ent;
+ this->attachedEntity = ent;
return ent;
}
@@ -190,7 +190,8 @@ u32 sub_08081E3C(Entity* this) {
tmp2 = GetTileType(this->field_0x74.HWORD, this->collisionLayer);
tmp1 = gUnk_0811EE50;
do {
- if (*tmp1 == tmp2) return 1;
+ if (*tmp1 == tmp2)
+ return 1;
} while (*++tmp1);
return 0;
}
@@ -203,10 +204,10 @@ extern u16 gMapDataTopSpecial[0x2000];
void sub_08081E6C(Entity* this) {
u32 r4;
u16 *tmp, *r1;
- u8 *tmp2;
+ u8* tmp2;
u32 r6 = this->field_0x74.HWORD;
u32 r5 = this->collisionLayer;
- u32 tile = GetTileType(r6,r5);
+ u32 tile = GetTileType(r6, r5);
if (tile < 0x4000)
return;
r1 = GetLayerByIndex(r5);
@@ -215,11 +216,11 @@ void sub_08081E6C(Entity* this) {
r1 += 0x3002 + r4;
tmp = tmp + (*r1 << 2);
tmp2 = (r5 == 2 ? gMapDataTopSpecial : (u8*)&gUnk_02019EE0);
- tmp2 += (((0x3f & r6)<<1)+((0xfc0 & r6)<<2))<<1;
+ tmp2 += (((0x3f & r6) << 1) + ((0xfc0 & r6) << 2)) << 1;
if (sub_08081F00((u32*)tmp2, (u32*)tmp))
return;
SetTileType(r4, r6, r5);
- SetTile(tile,r6,r5);
+ SetTile(tile, r6, r5);
}
#else
NAKED
@@ -229,8 +230,10 @@ void sub_08081E6C(Entity* this) {
#endif
u32 sub_08081F00(u32* unk1, u32* unk2) {
- if (*unk1 != *unk2) return 0;
- if (unk1[0x40] != unk2[1]) return 0;
+ if (*unk1 != *unk2)
+ return 0;
+ if (unk1[0x40] != unk2[1])
+ return 0;
return 1;
}
@@ -251,9 +254,10 @@ void sub_08081F24(Entity* this) {
u32 sub_08081F7C(Entity* this, u32 r7) {
u16 tmp;
- if (this->actionDelay == 0) return 1;
+ if (this->actionDelay == 0)
+ return 1;
if (--this->actionDelay > 6) {
- if(this->attachedEntity)
+ if (this->attachedEntity)
this->attachedEntity->spriteOffsetY = 0xfc;
} else {
if (this->actionDelay == 6) {
@@ -275,12 +279,13 @@ extern void sub_080044AE(Entity*, u32, u32);
void sub_08081FF8(Entity* this) {
u32 direction;
u32 i;
- if (this->attachedEntity != &gPlayerEntity) return;
+ if (this->attachedEntity != &gPlayerEntity)
+ return;
direction = GetFacingDirection(this->attachedEntity, this);
sub_080044AE(this->attachedEntity, 0x200, direction);
for (i = 0; i < 3; i++) {
if (gUnk_03004040[i]) {
- sub_080044AE(gUnk_03004040[i],0x200, direction);
+ sub_080044AE(gUnk_03004040[i], 0x200, direction);
}
}
}
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index 8af7769d..06782b2e 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -11,25 +11,22 @@ extern void (*const gUnk_0811F808[])(Entity*);
extern void (*const gUnk_0811F818[])(Entity*);
extern u32 gUnk_0811F8B0;
-void ChestSpawner(Entity* this)
-{
- gUnk_0811F7E8[this->entityType.form](this);
+void ChestSpawner(Entity* this) {
+ gUnk_0811F7E8[this->entityType.form](this);
}
void sub_08083DF0(Entity* this) {
gUnk_0811F808[this->action](this);
}
-void sub_08083E08(Entity *this)
-{
- gUnk_0811F818[this->action](this);
+void sub_08083E08(Entity* this) {
+ gUnk_0811F818[this->action](this);
}
-void sub_08083E20(Entity *this)
-{
- this->action = 3;
- this->spriteSettings.b.draw = 1;
- this->spriteRendering.alphaBlend = 0;
- sub_080842D8(this);
- sub_08078828(this);
+void sub_08083E20(Entity* this) {
+ this->action = 3;
+ this->spriteSettings.b.draw = 1;
+ this->spriteRendering.alphaBlend = 0;
+ sub_080842D8(this);
+ sub_08078828(this);
}
diff --git a/src/object/fan.c b/src/object/fan.c
index 04854f4d..5d8874bf 100644
--- a/src/object/fan.c
+++ b/src/object/fan.c
@@ -11,76 +11,64 @@ extern void sub_0809EE24(Entity*);
extern void (*const gUnk_081243D4[])(Entity*);
-void Fan(Entity *this)
-{
- gUnk_081243D4[this->action](this);
+void Fan(Entity* this) {
+ gUnk_081243D4[this->action](this);
}
-void sub_0809ED30(Entity *this)
-{
- this->direction = (this->entityType.form ^ 2) << 3;
- sub_0809EE34(this);
- sub_0809EFB0(this);
- InitializeAnimation(this, this->entityType.form);
+void sub_0809ED30(Entity* this) {
+ this->direction = (this->entityType.form ^ 2) << 3;
+ sub_0809EE34(this);
+ sub_0809EFB0(this);
+ InitializeAnimation(this, this->entityType.form);
}
-void sub_0809ED54(Entity *this)
-{
- u16 uVar1;
- u32 iVar2;
-
- if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
- ((this->entityType.parameter != 1 ||
- (--this->field_0x74.HWORD == 0)))) {
- sub_0809EE08(this);
- }
-}
+void sub_0809ED54(Entity* this) {
+ u16 uVar1;
+ u32 iVar2;
-void sub_0809ED88(Entity *this)
-{
- sub_0809F08C();
- sub_0809EE44(this);
- if (this->field_0x86.HWORD != 0) {
- if (this->cutsceneBeh.HWORD == this->field_0x86.HWORD) {
- if (CheckFlags(this->cutsceneBeh.HWORD)) {
- return;
- }
+ if (((this->cutsceneBeh.HWORD == 0) || CheckFlags(this->cutsceneBeh.HWORD)) &&
+ ((this->entityType.parameter != 1 || (--this->field_0x74.HWORD == 0)))) {
+ sub_0809EE08(this);
}
- else if (!CheckFlags(this->cutsceneBeh.HWORD)) {
- return;
- }
- sub_0809EE24(this);
- }
- else if (((this->entityType).parameter == 1) &&
- (--this->field_0x74.HWORD == 0)) {
- sub_0809EE24(this);
+}
+
+void sub_0809ED88(Entity* this) {
+ sub_0809F08C();
+ sub_0809EE44(this);
+ if (this->field_0x86.HWORD != 0) {
+ if (this->cutsceneBeh.HWORD == this->field_0x86.HWORD) {
+ if (CheckFlags(this->cutsceneBeh.HWORD)) {
+ return;
+ }
+ } else if (!CheckFlags(this->cutsceneBeh.HWORD)) {
+ return;
+ }
+ sub_0809EE24(this);
+ } else if (((this->entityType).parameter == 1) && (--this->field_0x74.HWORD == 0)) {
+ sub_0809EE24(this);
}
}
-void sub_0809EDE4(Entity *this)
-{
- sub_0809F08C();
- sub_0809EE44(this);
- if (this->frames.b.f3) {
- sub_0809EE34(this);
- }
+void sub_0809EDE4(Entity* this) {
+ sub_0809F08C();
+ sub_0809EE44(this);
+ if (this->frames.b.f3) {
+ sub_0809EE34(this);
+ }
}
-void sub_0809EE08(Entity *this)
-{
- this->action = 2;
- this->field_0x74.HWORD = *((u8 *)&this->field_0x7c + 3) << 2;
- InitializeAnimation(this, this->entityType.form);
+void sub_0809EE08(Entity* this) {
+ this->action = 2;
+ this->field_0x74.HWORD = *((u8*)&this->field_0x7c + 3) << 2;
+ InitializeAnimation(this, this->entityType.form);
}
-void sub_0809EE24(Entity *this)
-{
- this->action = 3;
- InitializeAnimation(this, this->entityType.form + 4);
+void sub_0809EE24(Entity* this) {
+ this->action = 3;
+ InitializeAnimation(this, this->entityType.form + 4);
}
-void sub_0809EE34(Entity *this)
-{
- this->action = 1;
- this->field_0x74.HWORD = this->actionDelay << 2;
+void sub_0809EE34(Entity* this) {
+ this->action = 1;
+ this->field_0x74.HWORD = this->actionDelay << 2;
}
diff --git a/src/object/floatingBlock.c b/src/object/floatingBlock.c
index 3b865e91..e9bb10e8 100644
--- a/src/object/floatingBlock.c
+++ b/src/object/floatingBlock.c
@@ -5,9 +5,9 @@
void FloatingBlock(Entity* this) {
if (this->action == 0) {
this->action = 1;
- this->frameIndex=this->entityType.form;
+ this->frameIndex = this->entityType.form;
this->spritePriority.b0 = 0xe;
this->collisionLayer = 1;
UpdateSpriteForCollisionLayer(this);
}
-} \ No newline at end of file
+}
diff --git a/src/object/hiddenLadderDown.c b/src/object/hiddenLadderDown.c
index 932018c8..5a176b07 100644
--- a/src/object/hiddenLadderDown.c
+++ b/src/object/hiddenLadderDown.c
@@ -41,4 +41,4 @@ void sub_08092000(Entity* this) {
this->spriteSettings.b.draw = TRUE;
SetFlag(this->field_0x86.HWORD);
}
-} \ No newline at end of file
+}
diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c
index 4b53add6..c15f94f0 100755..100644
--- a/src/object/houseDoorExterior.c
+++ b/src/object/houseDoorExterior.c
@@ -11,7 +11,7 @@ typedef struct {
/*0x05*/ u8 unk5;
/*0x06*/ u8 unk6;
/*0x07*/ u8 unk7;
- /*0x08*/ u8 *unk8;
+ /*0x08*/ u8* unk8;
} unk_DoorProperty;
typedef struct {
@@ -42,7 +42,7 @@ void sub_080866D8(Entity* this) {
if (this->action == 0) {
this->action = 1;
- *((u32 *)(&this->field_0x68)) = 0;
+ *((u32*)(&this->field_0x68)) = 0;
this->field_0x6c.HALF.LO = this->actionDelay;
sub_0805E3A0(this, 6);
}
@@ -50,8 +50,7 @@ void sub_080866D8(Entity* this) {
prop = GetCurrentRoomProperty(this->field_0x6c.HALF.LO);
for (i = 0; prop->unk0 != 0xFFFF && i < 32; prop++, i++) {
int mask = 1 << i;
- if ((*((u32 *)(&this->field_0x68)) & mask) == 0 &&
- sub_080867CC(prop->unk5) &&
+ if ((*((u32*)(&this->field_0x68)) & mask) == 0 && sub_080867CC(prop->unk5) &&
sub_080562CC(prop->unk0, prop->unk2, 32, 32)) {
entity = CreateObject(0x19, prop->unk7, prop->unk6);
if (entity) {
@@ -64,9 +63,9 @@ void sub_080866D8(Entity* this) {
entity->collisionLayer = prop->unk4;
entity->previousActionFlag = prop->unk5;
UpdateSpriteForCollisionLayer(entity);
- *((u32 *)(&this->field_0x68)) |= mask;
+ *((u32*)(&this->field_0x68)) |= mask;
if (prop->unk8) {
- *((u32 **)(&entity->cutsceneBeh)) = StartCutscene(entity, prop->unk8);
+ *((u32**)(&entity->cutsceneBeh)) = StartCutscene(entity, prop->unk8);
}
}
}
@@ -85,7 +84,7 @@ static bool32 sub_080867CC(u32 arg0) {
void sub_080867E4(Entity* this) {
if (!sub_080562CC(this->field_0x68.HWORD, this->field_0x6a.HWORD, 32, 32)) {
- *((u32 *)(&this->parent->field_0x68)) = *((u32 *)(&this->parent->field_0x68)) & ~(1 << this->field_0x6c.HALF.LO);
+ *((u32*)(&this->parent->field_0x68)) = *((u32*)(&this->parent->field_0x68)) & ~(1 << this->field_0x6c.HALF.LO);
DeleteThisEntity();
}
sub_0808681C(this);
@@ -118,8 +117,8 @@ static void sub_0808681C(Entity* this) {
}
if (this->flags & 0x2) {
- ExecuteScriptCommandSet(this, *(u32 **)&this->cutsceneBeh);
- sub_080868EC(this, *(void **)&this->cutsceneBeh);
+ ExecuteScriptCommandSet(this, *(u32**)&this->cutsceneBeh);
+ sub_080868EC(this, *(void**)&this->cutsceneBeh);
}
}
@@ -130,8 +129,8 @@ void sub_080868B0(Entity* this) {
this->boundingBox = &gUnk_081206AC;
this->actionDelay = 8;
}
- ExecuteScriptCommandSet(this, *(u32 **)&this->cutsceneBeh);
- sub_080868EC(this, *(void **)&this->cutsceneBeh);
+ ExecuteScriptCommandSet(this, *(u32**)&this->cutsceneBeh);
+ sub_080868EC(this, *(void**)&this->cutsceneBeh);
}
static void sub_080868EC(Entity* entity, unk_80868EC* arg1) {
@@ -165,10 +164,8 @@ void sub_0808692C(Entity* this) {
static u8 sub_08086954(Entity* this) {
if (sub_0800445C(this)) {
- if (sub_0806ED9C(this, 6, 20) >= 0 &&
- gPlayerEntity.animationState == 0 &&
- (u16)gPlayerState.field_0x90.HALF.LO == 0x400 &&
- gPlayerState.jumpStatus == 0) {
+ if (sub_0806ED9C(this, 6, 20) >= 0 && gPlayerEntity.animationState == 0 &&
+ (u16)gPlayerState.field_0x90.HALF.LO == 0x400 && gPlayerState.jumpStatus == 0) {
this->actionDelay--;
}
} else {
diff --git a/src/object/itemOnGround.c b/src/object/itemOnGround.c
index ad8bdec9..6aa09588 100755..100644
--- a/src/object/itemOnGround.c
+++ b/src/object/itemOnGround.c
@@ -268,9 +268,7 @@ void sub_080812A8(Entity* this) {
void sub_080812E8(Entity* this) {
PlayerState* playerState = &gPlayerState;
- if ((playerState->swimState & 0x80) &&
- !(playerState->flags.all & 0x80) &&
- sub_080177A0(this, &gPlayerEntity)) {
+ if ((playerState->swimState & 0x80) && !(playerState->flags.all & 0x80) && sub_080177A0(this, &gPlayerEntity)) {
sub_080810FC(this);
}
}
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index f262e819..aa17aae3 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -11,54 +11,49 @@ extern void (*const gUnk_08124950[])(Entity*);
extern u8 gUnk_08124960;
extern u8 gUnk_0812497A;
-void JailBars(Entity *this)
-{
+void JailBars(Entity* this) {
gUnk_08124950[this->action](this);
}
-void sub_080A08C4(Entity *this)
-{
- if (CheckFlags(this->field_0x86.HWORD) == 0) {
- this->action = 1;
- sub_080A0960(this, 0);
- }
- else {
- this->action = 3;
- InitializeAnimation(this,1);
- sub_080A0960(this, 1);
- }
- this->spriteSettings.b.draw = 3; // ???
- this->collisionLayer = 1;
- UpdateSpriteForCollisionLayer(this);
+void sub_080A08C4(Entity* this) {
+ if (CheckFlags(this->field_0x86.HWORD) == 0) {
+ this->action = 1;
+ sub_080A0960(this, 0);
+ } else {
+ this->action = 3;
+ InitializeAnimation(this, 1);
+ sub_080A0960(this, 1);
+ }
+ this->spriteSettings.b.draw = 3; // ???
+ this->collisionLayer = 1;
+ UpdateSpriteForCollisionLayer(this);
}
-void sub_080A0910(Entity *this)
-{
- if (CheckFlags(this->field_0x86.HWORD) != 0) {
- this->action = 2;
- sub_080A0960(this, 1);
- PlaySFX(0x10b);
- }
+void sub_080A0910(Entity* this) {
+ if (CheckFlags(this->field_0x86.HWORD) != 0) {
+ this->action = 2;
+ sub_080A0960(this, 1);
+ PlaySFX(0x10b);
+ }
}
-void sub_080A0938(Entity *this)
-{
- GetNextFrame(this);
- if ((this->frames.b.f3) != 0) {
- this->action = 3;
- InitializeAnimation(this, 1);
- }
+void sub_080A0938(Entity* this) {
+ GetNextFrame(this);
+ if ((this->frames.b.f3) != 0) {
+ this->action = 3;
+ InitializeAnimation(this, 1);
+ }
}
-void nullsub_127(Entity* this) {}
+void nullsub_127(Entity* this) {
+}
+
+void sub_080A0960(Entity* this, u32 arg1) {
+ u8* puVar1;
-void sub_080A0960(Entity *this, u32 arg1)
-{
- u8 *puVar1;
-
- puVar1 = &gUnk_08124960;
- if (arg1 == 1) {
- puVar1 = &gUnk_0812497A;
- }
- sub_0801AF18(puVar1, COORD_TO_TILE(this), 1);
+ puVar1 = &gUnk_08124960;
+ if (arg1 == 1) {
+ puVar1 = &gUnk_0812497A;
+ }
+ sub_0801AF18(puVar1, COORD_TO_TILE(this), 1);
}
diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c
index 5d3e693c..ecc6449e 100644
--- a/src/object/lightableSwitch.c
+++ b/src/object/lightableSwitch.c
@@ -142,4 +142,5 @@ void sub_0809EC08(Entity* this) {
}
}
-void nullsub_126(Entity* this) { }
+void nullsub_126(Entity* this) {
+}
diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c
index 1efa9768..32991f65 100644
--- a/src/object/lilypadSmall.c
+++ b/src/object/lilypadSmall.c
@@ -8,35 +8,33 @@ extern void sub_080A2CC0(Entity*, Entity**, u16*);
extern u16 gUnk_08123318[];
-void LilypadSmall(Entity *this)
-{
- u32 rand;
- u16 *psVar4;
-
- if (this->action == 0) {
- this->action = 1;
- this->actionDelay = 0x5a;
- rand = Random();
- this->field_0xf = rand;
- this->frameIndex = (rand >> 0x10) & 3;
- this->spriteSettings.b.draw = TRUE;
- this->spritePriority.b0 = 7;
- this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
- sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
- }
- sub_080A2BE4(this, sub_08097ADC(this));
- sub_08097B24(this);
- psVar4 = (u16 *)&this->field_0x70;
- if (--*psVar4 == 0) {
- sub_080A2CC0(this, &this->attachedEntity, psVar4);
- }
+void LilypadSmall(Entity* this) {
+ u32 rand;
+ u16* psVar4;
+
+ if (this->action == 0) {
+ this->action = 1;
+ this->actionDelay = 0x5a;
+ rand = Random();
+ this->field_0xf = rand;
+ this->frameIndex = (rand >> 0x10) & 3;
+ this->spriteSettings.b.draw = TRUE;
+ this->spritePriority.b0 = 7;
+ this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
+ sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
+ }
+ sub_080A2BE4(this, sub_08097ADC(this));
+ sub_08097B24(this);
+ psVar4 = (u16*)&this->field_0x70;
+ if (--*psVar4 == 0) {
+ sub_080A2CC0(this, &this->attachedEntity, psVar4);
+ }
}
-u32 sub_08097ADC(Entity *this)
-{
+u32 sub_08097ADC(Entity* this) {
if ((gPlayerState.flags.all & 0x80) == 0) {
return 0;
- } else if (sub_080041A0(this,&gPlayerEntity,8,8) == 0) {
+ } else if (sub_080041A0(this, &gPlayerEntity, 8, 8) == 0) {
return 0;
} else if (sub_08079F8C() == 0) {
return 0;
@@ -50,11 +48,10 @@ u32 sub_08097ADC(Entity *this)
}
}
-void sub_08097B24(Entity *this)
-{
+void sub_08097B24(Entity* this) {
u32 temp;
u32 temp2;
- u16 *temp3;
+ u16* temp3;
if (--this->actionDelay == 0) {
this->actionDelay = 0x5a;
diff --git a/src/object/mask.c b/src/object/mask.c
index 9fb42c68..03dceea7 100644
--- a/src/object/mask.c
+++ b/src/object/mask.c
@@ -6,7 +6,7 @@
extern Entity gPlayerEntity;
extern u16 gScreenTransition[];
-extern void (*MaskActionFuncs[])(Entity *);
+extern void (*MaskActionFuncs[])(Entity*);
extern void DeleteThisEntity();
@@ -21,15 +21,14 @@ extern s16 sub_080001DA(u16, u32);
extern u16 sub_080002E0(u16, u32);
extern void EnqueueSFX(u32);
-extern void sub_080044EC(Entity *, u16);
-extern void sub_0805457C(Entity *, s32);
+extern void sub_080044EC(Entity*, u16);
+extern void sub_0805457C(Entity*, s32);
-
-void Mask(Entity *this) {
+void Mask(Entity* this) {
MaskActionFuncs[this->action](this);
}
-void sub_080929A4(Entity *this) {
+void sub_080929A4(Entity* this) {
if (this->entityType.parameter & 0xC0) {
if (CheckFlags(this->field_0x86.HWORD)) {
s32 field_0x0a;
@@ -37,7 +36,7 @@ void sub_080929A4(Entity *this) {
switch (this->entityType.parameter & 0xC0) {
case 0x40:
field_0x0a = gScreenTransition[0x5];
-
+
switch (field_0x0a) {
case 0x44D ... 0x44F:
case 0x182:
@@ -51,7 +50,7 @@ void sub_080929A4(Entity *this) {
DeleteThisEntity();
break;
}
- switchEnd:
+ switchEnd:
}
}
@@ -59,7 +58,7 @@ void sub_080929A4(Entity *this) {
this->field_0x20 = 0x18000;
this->field_0x78.HWORD = ((Random() & 7) << 10) | 0x2000;
-
+
this->field_0xf = this->actionDelay >> 1;
this->actionDelay = 0;
@@ -74,7 +73,7 @@ void sub_080929A4(Entity *this) {
}
// Probably related to knocking it down
-void sub_08092A94(Entity *this) {
+void sub_08092A94(Entity* this) {
// Check for the first frame of bonking animation
if (gPlayerEntity.action != 6) {
return;
@@ -89,13 +88,14 @@ void sub_08092A94(Entity *this) {
return;
}
- if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf || this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) {
+ if (this->x.HALF.HI - gPlayerEntity.x.HALF.HI >= this->field_0xf ||
+ this->x.HALF.HI - gPlayerEntity.x.HALF.HI <= -this->field_0xf) {
return;
}
// Presumably, make the mask fall
SetTile((u16)this->field_0x7c.HALF.LO, this->field_0x7c.HALF.HI, 1);
-
+
sub_08000148(this->field_0x7a.HWORD, this->field_0x7c.HALF.HI, 1);
this->action = 2;
@@ -107,26 +107,23 @@ void sub_08092A94(Entity *this) {
}
// Probably falling down
-void sub_08092B0C(Entity *this) {
+void sub_08092B0C(Entity* this) {
if (this->actionDelay == 1) {
this->action = 3;
this->actionDelay = 0;
- switch (this->entityType.parameter & 0xC0)
- {
+ switch (this->entityType.parameter & 0xC0) {
case 0x80:
EnqueueSFX(0x72);
case 0x40:
SetFlag(this->field_0x86.HWORD);
break;
-
}
CreateFx(this, 5, 0);
sub_0805457C(this, 3);
- }
- else {
+ } else {
sub_080044EC(this, this->field_0x78.HWORD);
if (this->height.HALF.HI == 0) {
@@ -135,6 +132,6 @@ void sub_08092B0C(Entity *this) {
}
}
-void Mask_Delete(Entity *this) {
+void Mask_Delete(Entity* this) {
DeleteThisEntity();
}
diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c
index 888c35f7..625cd129 100644
--- a/src/object/metalDoor.c
+++ b/src/object/metalDoor.c
@@ -20,96 +20,89 @@ void MetalDoor(Entity* this) {
gUnk_0812493C[this->action](this);
}
-void sub_080A0684(Entity *this)
-{
- if ((this->cutsceneBeh.HWORD != 0xffff) && CheckFlags(this->cutsceneBeh.HWORD)) {
- DeleteThisEntity();
- }
- this->action = 1;
- this->nonPlanarMovement = 0x300;
- this->spriteSettings.b.draw = 0;
- this->frameIndex = 0;
- this->spriteSettings.b.flipY = 1;
- this->boundingBox = &gUnk_080FD180;
- this->spritePriority.b0 = 5;
- this->field_0x70.HALF.LO = this->x.HALF.HI;
- this->field_0x70.HALF.HI = this->y.HALF.HI;
- this->field_0x74.HWORD = COORD_TO_TILE(this);
+void sub_080A0684(Entity* this) {
+ if ((this->cutsceneBeh.HWORD != 0xffff) && CheckFlags(this->cutsceneBeh.HWORD)) {
+ DeleteThisEntity();
+ }
+ this->action = 1;
+ this->nonPlanarMovement = 0x300;
+ this->spriteSettings.b.draw = 0;
+ this->frameIndex = 0;
+ this->spriteSettings.b.flipY = 1;
+ this->boundingBox = &gUnk_080FD180;
+ this->spritePriority.b0 = 5;
+ this->field_0x70.HALF.LO = this->x.HALF.HI;
+ this->field_0x70.HALF.HI = this->y.HALF.HI;
+ this->field_0x74.HWORD = COORD_TO_TILE(this);
}
-void sub_080A0718(Entity *this)
-{
- if (sub_08083734(this, 2) != 0) {
- this->action = 2;
- this->actionDelay = 0xc;
- this->spriteSettings.b.draw = TRUE;
- this->direction = 0;
- this->y.HALF.HI += 0x24;
- sub_080A080C(this);
- }
+void sub_080A0718(Entity* this) {
+ if (sub_08083734(this, 2) != 0) {
+ this->action = 2;
+ this->actionDelay = 0xc;
+ this->spriteSettings.b.draw = TRUE;
+ this->direction = 0;
+ this->y.HALF.HI += 0x24;
+ sub_080A080C(this);
+ }
}
-void sub_080A074C(Entity *this)
-{
- u8 bVar1;
- Entity *ent;
-
- sub_0806F69C(this);
+void sub_080A074C(Entity* this) {
+ u8 bVar1;
+ Entity* ent;
- if (--this->actionDelay == 0) {
- this->action = 3;
- this->height.HALF.HI = 0;
- this->x.HALF.HI = this->field_0x70.HALF.LO;
- this->y.HALF.HI = this->field_0x70.HALF.HI;
- ent = CreateFx(this, 0x11, 0x40);
- if (ent != NULL) {
- ent->x.HALF.HI += 0xc;
- ent->y.HALF.HI -= 0xc;
- }
- ent = CreateFx(this, 0x11, 0x40);
- if (ent != NULL) {
- ent->x.HALF.HI -= 0xc;
- ent->y.HALF.HI -= 0xc;
+ sub_0806F69C(this);
+
+ if (--this->actionDelay == 0) {
+ this->action = 3;
+ this->height.HALF.HI = 0;
+ this->x.HALF.HI = this->field_0x70.HALF.LO;
+ this->y.HALF.HI = this->field_0x70.HALF.HI;
+ ent = CreateFx(this, 0x11, 0x40);
+ if (ent != NULL) {
+ ent->x.HALF.HI += 0xc;
+ ent->y.HALF.HI -= 0xc;
+ }
+ ent = CreateFx(this, 0x11, 0x40);
+ if (ent != NULL) {
+ ent->x.HALF.HI -= 0xc;
+ ent->y.HALF.HI -= 0xc;
+ }
+ EnqueueSFX(0x10b);
}
- EnqueueSFX(0x10b);
- }
}
-void sub_080A07BC(Entity *this)
-{
- if (CheckFlags(this->field_0x86.HWORD)) {
- this->action = 4;
- this->actionDelay = 0xc;
- this->direction = 0x10;
- this->y.HALF.HI += 2;
- sub_080A0870(this);
- PlaySFX(0x10b);
- }
+void sub_080A07BC(Entity* this) {
+ if (CheckFlags(this->field_0x86.HWORD)) {
+ this->action = 4;
+ this->actionDelay = 0xc;
+ this->direction = 0x10;
+ this->y.HALF.HI += 2;
+ sub_080A0870(this);
+ PlaySFX(0x10b);
+ }
}
-void sub_080A07F0(Entity *this)
-{
-
- sub_0806F69C(this);
+void sub_080A07F0(Entity* this) {
+
+ sub_0806F69C(this);
- if (--this->actionDelay == 0) {
- DeleteThisEntity();
- }
+ if (--this->actionDelay == 0) {
+ DeleteThisEntity();
+ }
}
-void sub_080A080C(Entity *this)
-{
- this->field_0x76.HWORD = sub_080001DA(this->field_0x74.HWORD - 1, this->collisionLayer);
- this->field_0x78.HWORD = sub_080001DA(this->field_0x74.HWORD, this->collisionLayer);
- this->field_0x7a.HWORD = sub_080001DA(this->field_0x74.HWORD + 1, this->collisionLayer);
- SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
- SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
- SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
+void sub_080A080C(Entity* this) {
+ this->field_0x76.HWORD = sub_080001DA(this->field_0x74.HWORD - 1, this->collisionLayer);
+ this->field_0x78.HWORD = sub_080001DA(this->field_0x74.HWORD, this->collisionLayer);
+ this->field_0x7a.HWORD = sub_080001DA(this->field_0x74.HWORD + 1, this->collisionLayer);
+ SetTile(0x4022, this->field_0x74.HWORD - 1, this->collisionLayer);
+ SetTile(0x4022, this->field_0x74.HWORD, this->collisionLayer);
+ SetTile(0x4022, this->field_0x74.HWORD + 1, this->collisionLayer);
}
-void sub_080A0870(Entity *this)
-{
- SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer);
- SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer);
- SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer);
+void sub_080A0870(Entity* this) {
+ SetTile(this->field_0x76.HWORD, this->field_0x74.HWORD - 1, this->collisionLayer);
+ SetTile(this->field_0x78.HWORD, this->field_0x74.HWORD, this->collisionLayer);
+ SetTile(this->field_0x7a.HWORD, this->field_0x74.HWORD + 1, this->collisionLayer);
}
diff --git a/src/object/minecart.c b/src/object/minecart.c
index 9207c8c0..5417e8a7 100644
--- a/src/object/minecart.c
+++ b/src/object/minecart.c
@@ -93,40 +93,37 @@ void sub_080917DC(Entity* this) {
}
}
-void sub_080918A4(Entity *this)
-{
- if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) {
- gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
- gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
- if (gPlayerEntity.height.HALF.HI > -0x10) {
- if ((s32)gPlayerEntity.field_0x20 > -1) {
- return;
- }
- gPlayerEntity.animationState = this->animationState << 1;
- gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x4000000) | 0x1000;
- this->action++;
- this->field_0xf = 1;
- this->flags |= 0x20;
- this->damageType = 0x97;
- this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
- this->flags2 = gPlayerEntity.flags2;
- this->field_0x40 = 0x18;
- this->field_0x44 = 8;
- sub_0801766C(this);
- sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
- PlaySFX(0x137);
+void sub_080918A4(Entity* this) {
+ if (sub_080041A0(this, &gPlayerEntity, 2, 2) != 0) {
+ gPlayerEntity.x.HALF.HI = this->x.HALF.HI;
+ gPlayerEntity.y.HALF.HI = this->y.HALF.HI;
+ if (gPlayerEntity.height.HALF.HI > -0x10) {
+ if ((s32)gPlayerEntity.field_0x20 > -1) {
+ return;
+ }
+ gPlayerEntity.animationState = this->animationState << 1;
+ gPlayerState.flags.all = (gPlayerState.flags.all ^ 0x4000000) | 0x1000;
+ this->action++;
+ this->field_0xf = 1;
+ this->flags |= 0x20;
+ this->damageType = 0x97;
+ this->field_0x3c = (gPlayerEntity.field_0x3c + 1) | 0x20;
+ this->flags2 = gPlayerEntity.flags2;
+ this->field_0x40 = 0x18;
+ this->field_0x44 = 8;
+ sub_0801766C(this);
+ sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer);
+ PlaySFX(0x137);
+ }
+ } else {
+ gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this);
+ }
+ if (gPlayerEntity.field_0x20 < 0) {
+ gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
}
- }
- else {
- gPlayerEntity.direction = GetFacingDirection(&gPlayerEntity, this);
- }
- if (gPlayerEntity.field_0x20 < 0) {
- gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
- }
}
-void sub_080919AC(Entity *this)
-{
+void sub_080919AC(Entity* this) {
u32 iVar2;
u32 uVar3;
@@ -138,7 +135,7 @@ void sub_080919AC(Entity *this)
if ((gPlayerEntity.frames.all & 0xf) == 0) {
this->flags = this->flags & 0x7f;
- CopyPosition(this,&gPlayerEntity);
+ CopyPosition(this, &gPlayerEntity);
if ((gPlayerEntity.frames.all & 0xf0) == 0x10) {
this->spriteOffsetY = 1;
} else {
@@ -148,7 +145,7 @@ void sub_080919AC(Entity *this)
this->flags = this->flags | 0x80;
gPlayerEntity.nonPlanarMovement = 0;
sub_0806F69C(this);
- CopyPosition(this,&gPlayerEntity);
+ CopyPosition(this, &gPlayerEntity);
gPlayerEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
if (!sub_08091DDC(this)) {
if ((gScreenTransition.frameCount & 0xf) == 0) {
@@ -160,7 +157,8 @@ void sub_080919AC(Entity *this)
this->field_0xf = 0x3c;
}
- uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2], gUnk_081223C8[this->animationState * 2 + 1]);
+ uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2],
+ gUnk_081223C8[this->animationState * 2 + 1]);
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
if (iVar2 == 0) {
this->direction = this->direction ^ 0x10;
@@ -207,8 +205,7 @@ void sub_080919AC(Entity *this)
gPlayerEntity.animationState = this->animationState << 1;
if (this->animIndex == this->animationState) {
UpdateAnimationSingleFrame(this);
- }
- else {
+ } else {
InitAnimationForceUpdate(this, this->animationState);
}
}
diff --git a/src/object/mineralWaterSource.c b/src/object/mineralWaterSource.c
index 50887521..b19046f0 100644
--- a/src/object/mineralWaterSource.c
+++ b/src/object/mineralWaterSource.c
@@ -1,7 +1,7 @@
#include "global.h"
#include "entity.h"
-extern void (*MineralWaterSourceActionFuncs[])(Entity *);
+extern void (*MineralWaterSourceActionFuncs[])(Entity*);
typedef struct {
u8 field_0x00;
@@ -12,14 +12,14 @@ typedef struct {
extern UnkStruct_MineralWater MineralWaterSourceParameters[];
-extern bool32 sub_0806FBD8(Entity *);
+extern bool32 sub_0806FBD8(Entity*);
-void MineralWaterSource(Entity *this) {
+void MineralWaterSource(Entity* this) {
MineralWaterSourceActionFuncs[this->action](this);
}
-void MineralWaterSource_Init(Entity *this) {
- UnkStruct_MineralWater *unknownParameters;
+void MineralWaterSource_Init(Entity* this) {
+ UnkStruct_MineralWater* unknownParameters;
if (!sub_0806FBD8(this)) {
return;
@@ -42,6 +42,6 @@ void MineralWaterSource_Init(Entity *this) {
this->action = 1;
}
-void sub_080973DC(Entity *this) {
+void sub_080973DC(Entity* this) {
this->bitfield = 0;
}
diff --git a/src/object/minishLight.c b/src/object/minishLight.c
index 8982a49a..21465597 100644
--- a/src/object/minishLight.c
+++ b/src/object/minishLight.c
@@ -1,30 +1,26 @@
#include "global.h"
#include "entity.h"
-extern void (* const gUnk_081247F8[])(Entity*);
+extern void (*const gUnk_081247F8[])(Entity*);
-void MinishLight(Entity* this)
-{
- gUnk_081247F8[this->action](this);
+void MinishLight(Entity* this) {
+ gUnk_081247F8[this->action](this);
}
-void sub_0809F840(Entity* this)
-{
- this->action = 1;
- this->frameIndex = 0;
- this->actionDelay = 0x20;
- this->field_0xf = 0;
+void sub_0809F840(Entity* this) {
+ this->action = 1;
+ this->frameIndex = 0;
+ this->actionDelay = 0x20;
+ this->field_0xf = 0;
- if (this->entityType.parameter != 0)
- {
- this->spriteSettings.b.flipX = 1;
- }
+ if (this->entityType.parameter != 0) {
+ this->spriteSettings.b.flipX = 1;
+ }
- UpdateSpriteForCollisionLayer(this);
+ UpdateSpriteForCollisionLayer(this);
}
-void sub_0809F868(Entity* this)
-{
+void sub_0809F868(Entity* this) {
if (--this->actionDelay == 0) {
if (this->field_0xf == 0) {
if (++this->frameIndex == 3) {
diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c
index 55160cb7..59a9294b 100644
--- a/src/object/minishSizedEntrance.c
+++ b/src/object/minishSizedEntrance.c
@@ -7,20 +7,18 @@ extern void LoadFixedGFX(Entity*, u32);
extern void (*const gUnk_08122254[])(Entity*);
-void MinishSizedEntrance(Entity* this)
-{
- gUnk_08122254[this->action](this);
+void MinishSizedEntrance(Entity* this) {
+ gUnk_08122254[this->action](this);
}
-void sub_08090EC0(Entity *this)
-{
- this->action = 1;
- this->spriteRendering.b3 = 3;
- this->spritePriority.b0 = 7;
- this->frameIndex = (this->entityType).parameter;
- if (CheckIsDungeon()) {
- this->frameIndex += 4;
- sub_080AE068(this);
- LoadFixedGFX(this, 0x184);
- }
+void sub_08090EC0(Entity* this) {
+ this->action = 1;
+ this->spriteRendering.b3 = 3;
+ this->spritePriority.b0 = 7;
+ this->frameIndex = (this->entityType).parameter;
+ if (CheckIsDungeon()) {
+ this->frameIndex += 4;
+ sub_080AE068(this);
+ LoadFixedGFX(this, 0x184);
+ }
}
diff --git a/src/object/object1C.c b/src/object/object1C.c
index 725f4223..ace54e82 100644
--- a/src/object/object1C.c
+++ b/src/object/object1C.c
@@ -4,16 +4,15 @@
extern u32 CheckRectOnScreen(s16, s16, u32, u32);
extern void DeleteThisEntity();
-void Object1C(Entity *this)
-{
- s32 iVar1;
-
- if (this->action == 0) {
- this->action = 1;
- }
- iVar1 = CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10);
- if (iVar1 == 0) {
- this->parent->field_0x20 &= ~(1 << this->entityType.parameter);
- DeleteThisEntity();
- }
+void Object1C(Entity* this) {
+ s32 iVar1;
+
+ if (this->action == 0) {
+ this->action = 1;
+ }
+ iVar1 = CheckRectOnScreen(this->field_0x80.HWORD, this->field_0x82.HWORD, 0x10, 0x10);
+ if (iVar1 == 0) {
+ this->parent->field_0x20 &= ~(1 << this->entityType.parameter);
+ DeleteThisEntity();
+ }
}
diff --git a/src/object/object1D.c b/src/object/object1D.c
index 1912facb..8442b227 100644
--- a/src/object/object1D.c
+++ b/src/object/object1D.c
@@ -5,14 +5,13 @@ void DeleteThisEntity();
extern void (*gUnk_081208A0[])(Entity*);
-void Object1D(Entity *this)
-{
- gUnk_081208A0[this->action](this);
+void Object1D(Entity* this) {
+ gUnk_081208A0[this->action](this);
}
-void sub_080874F8(Entity* this)
-{
- DeleteThisEntity();
+void sub_080874F8(Entity* this) {
+ DeleteThisEntity();
}
-void nullsub_117(Entity* this){}
+void nullsub_117(Entity* this) {
+}
diff --git a/src/object/object2A.c b/src/object/object2A.c
index 44d272c5..9844ec72 100644
--- a/src/object/object2A.c
+++ b/src/object/object2A.c
@@ -9,15 +9,14 @@ void Object2A(Entity* this) {
gUnk_08120DD0[this->action](this);
}
-void sub_08089B18(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = TRUE;
- if (this->entityType.parameter != 0) {
- this->actionDelay = this->entityType.parameter;
- }
- InitializeAnimation(this, 0);
- switch (this->entityType.form) {
+void sub_08089B18(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = TRUE;
+ if (this->entityType.parameter != 0) {
+ this->actionDelay = this->entityType.parameter;
+ }
+ InitializeAnimation(this, 0);
+ switch (this->entityType.form) {
case 1:
this->y.HALF.HI -= 8;
this->actionDelay = 0x28;
diff --git a/src/object/object48.c b/src/object/object48.c
index 30ddda26..5db2b96a 100755..100644
--- a/src/object/object48.c
+++ b/src/object/object48.c
@@ -179,7 +179,7 @@ void sub_0808EA28(Entity* this) {
u32 var1;
if (this->entityType.form == 3) {
- if (((struct_02000000 *)0x2000000)->gameLanguage > 1) {
+ if (((struct_02000000*)0x2000000)->gameLanguage > 1) {
this->spriteSettings.b.draw = 2;
} else {
this->spriteSettings.b.draw = 0;
@@ -298,7 +298,7 @@ void sub_0808EBB8(Entity* this) {
case 0:
break;
case 1:
- y = ((struct_02000000 *)0x2000000)->gameLanguage * 16 + 24;
+ y = ((struct_02000000*)0x2000000)->gameLanguage * 16 + 24;
x = 112;
break;
case 2:
@@ -407,7 +407,7 @@ void sub_0808ED98(Entity* this) {
void sub_0808EE00(Entity* this) {
int var0, var1, var2;
- var0 = ((struct_02000000 *)0x2000000)->gameLanguage != 0;
+ var0 = ((struct_02000000*)0x2000000)->gameLanguage != 0;
var1 = this->entityType.form - 10;
this->frameIndex = gUnk_08121D38[var0][var1];
this->x.HALF.HI = gUnk_08121D18[var0][var1];
@@ -426,7 +426,6 @@ void sub_0808EE00(Entity* this) {
}
void nullsub_522(Entity* this) {
-
}
void sub_0808EE98(Entity* this) {
@@ -458,9 +457,9 @@ void sub_0808EF24(Entity* this) {
} else {
this->spriteSettings.b.draw = 2;
if (this->entityType.form == 21) {
- var0 = ((struct_02000000 *)0x2000000)->messageSpeed;
+ var0 = ((struct_02000000*)0x2000000)->messageSpeed;
} else {
- var0 = ((struct_02000000 *)0x2000000)->brightnessPref;
+ var0 = ((struct_02000000*)0x2000000)->brightnessPref;
}
this->frameIndex = this->lastFrameIndex + var0;
}
diff --git a/src/object/object49.c b/src/object/object49.c
index 0617aad2..a31149ca 100644
--- a/src/object/object49.c
+++ b/src/object/object49.c
@@ -11,7 +11,7 @@ static void sub_0808F244(Entity*);
extern void sub_0806FCF4(Entity*, u32, u32, u32);
extern void sub_0808F5EC(Entity*);
-extern bool32 sub_0806F3E4(Entity *);
+extern bool32 sub_0806F3E4(Entity*);
extern void (*const gUnk_08121E5C[])(Entity*);
extern void (*const gUnk_08121E88[])(Entity*);
@@ -63,98 +63,89 @@ static void sub_0808F14C(Entity* this) {
}
}
-void sub_0808F170(Entity *this)
-{
- *(u32 *)&this->field_0x74 -= 0x20;
- *(u32 *)&this->field_0x78 += 0x20;
- sub_0806FCF4(this, *(u32 *)&this->field_0x78, 8, 2);
- if (*(u32 *)&this->field_0x78 > 0x1ff) {
- this->action++;
- }
- sub_0808F2B0(this);
-}
-
-void sub_0808F1A4(Entity *this)
-{
- *(u32 *)&this->field_0x78 += 0x10;
- *(u32 *)&this->field_0x74 += 0x10;
- sub_0806FCF4(this, *(u32 *)&this->field_0x78, 8, 2);
- if (*(u32 *)&this->field_0x78 > 0x3ff) {
- this->attachedEntity->action = 0xff;
- DeleteThisEntity();
- }
- else {
+void sub_0808F170(Entity* this) {
+ *(u32*)&this->field_0x74 -= 0x20;
+ *(u32*)&this->field_0x78 += 0x20;
+ sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
+ if (*(u32*)&this->field_0x78 > 0x1ff) {
+ this->action++;
+ }
sub_0808F2B0(this);
- }
}
-void sub_0808F1E0(Entity *this)
-{
- gUnk_08121E98[this->action](this);
-}
-
-void sub_0808F1F8(Entity *this)
-{
- u8 bVar1;
-
- this->spriteRendering.b0 = 3;
- this->action++;
- this->spriteRendering.b3 = this->parent->spriteRendering.b3;
- this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
- this->spritePriority.b0 = 7;
- InitializeAnimation(this, 1);
- sub_0808F244(this);
+void sub_0808F1A4(Entity* this) {
+ *(u32*)&this->field_0x78 += 0x10;
+ *(u32*)&this->field_0x74 += 0x10;
+ sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
+ if (*(u32*)&this->field_0x78 > 0x3ff) {
+ this->attachedEntity->action = 0xff;
+ DeleteThisEntity();
+ } else {
+ sub_0808F2B0(this);
+ }
}
-static void sub_0808F244(Entity *this)
-{
-
- this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
- this->y.HALF.HI = this->parent->y.HALF.HI + 3;
- this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI);
- this->height.WORD = 0;
- *(u32 *)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI;
- *(u32 *)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI;
- *(u32 *)&this->field_0x70.WORD = *((u8 *)&this->parent->field_0x7c + 3);
- sub_0808F2B0(this);
- if ((this->parent->field_0x6c.HALF.HI & 2) != 0) {
- DeleteThisEntity();
- }
+void sub_0808F1E0(Entity* this) {
+ gUnk_08121E98[this->action](this);
}
-static void sub_0808F2B0(Entity *this)
-{
- sub_0805EC9C(this, *(u32 *)&this->field_0x74, *(u32 *)&this->field_0x78, this->field_0x70.WORD);
-}
+void sub_0808F1F8(Entity* this) {
+ u8 bVar1;
-void sub_0808F2C0(Entity *this)
-{
- if (this->action == 0) {
+ this->spriteRendering.b0 = 3;
this->action++;
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
- this->spriteSettings.b.draw = 1;
this->spritePriority.b0 = 7;
- this->height.WORD = 0;
+ InitializeAnimation(this, 1);
+ sub_0808F244(this);
+}
+static void sub_0808F244(Entity* this) {
+
+ this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
this->y.HALF.HI = this->parent->y.HALF.HI + 3;
- this->x.HALF.HI = this->parent->x.HALF.HI;
- InitializeAnimation(this,3);
- }
- if (this->parent->height.HALF.HI == 0) {
- *(u32 *)&this->field_0x74 = *(u32 *)&this->parent->field_0x74;
- *(u32 *)&this->field_0x78 = *(u32 *)&this->parent->field_0x78;
- }
- else {
- *(u32 *)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI;
- *(u32 *)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300;
- }
- *(u32 *)&this->field_0x70 = 0;
- sub_0808F2B0(this);
- sub_0806FCF4(this,*(u32 *)&this->field_0x78,8,2);
- if (this->action == 0xff) {
- DeleteThisEntity();
- }
+ this->x.HALF.HI = (*(s8*)&this->attachedEntity->spriteOffsetX + this->attachedEntity->x.HALF.HI);
+ this->height.WORD = 0;
+ *(u32*)&this->field_0x74 = 0x80 - this->parent->height.HALF.HI;
+ *(u32*)&this->field_0x78 = 0x100 - this->parent->height.HALF.HI;
+ *(u32*)&this->field_0x70.WORD = *((u8*)&this->parent->field_0x7c + 3);
+ sub_0808F2B0(this);
+ if ((this->parent->field_0x6c.HALF.HI & 2) != 0) {
+ DeleteThisEntity();
+ }
+}
+
+static void sub_0808F2B0(Entity* this) {
+ sub_0805EC9C(this, *(u32*)&this->field_0x74, *(u32*)&this->field_0x78, this->field_0x70.WORD);
+}
+
+void sub_0808F2C0(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ this->spriteRendering.b3 = this->parent->spriteRendering.b3;
+ this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
+ this->spriteSettings.b.draw = 1;
+ this->spritePriority.b0 = 7;
+ this->height.WORD = 0;
+
+ this->y.HALF.HI = this->parent->y.HALF.HI + 3;
+ this->x.HALF.HI = this->parent->x.HALF.HI;
+ InitializeAnimation(this, 3);
+ }
+ if (this->parent->height.HALF.HI == 0) {
+ *(u32*)&this->field_0x74 = *(u32*)&this->parent->field_0x74;
+ *(u32*)&this->field_0x78 = *(u32*)&this->parent->field_0x78;
+ } else {
+ *(u32*)&this->field_0x74 = 0x200 - this->parent->height.HALF.HI;
+ *(u32*)&this->field_0x78 = this->parent->height.HALF.HI * -2 + 0x300;
+ }
+ *(u32*)&this->field_0x70 = 0;
+ sub_0808F2B0(this);
+ sub_0806FCF4(this, *(u32*)&this->field_0x78, 8, 2);
+ if (this->action == 0xff) {
+ DeleteThisEntity();
+ }
}
void sub_0808F370(Entity* this) {
@@ -168,7 +159,7 @@ void sub_0808F370(Entity* this) {
u8 flag = this->parent->previousActionFlag - 1;
if (flag < 5) {
if (this->field_0x70.WORD == 0) {
- if (--(*(u32 *)&this->field_0x74) == -1) {
+ if (--(*(u32*)&this->field_0x74) == -1) {
this->field_0x70.WORD = gUnk_08121EA0[Random() & 1];
}
} else {
@@ -178,7 +169,7 @@ void sub_0808F370(Entity* this) {
}
} else {
this->action = 0;
- *(u32 *)&this->field_0x74 = 0;
+ *(u32*)&this->field_0x74 = 0;
}
}
}
@@ -201,7 +192,7 @@ void sub_0808F3DC(Entity* this) {
}
ResolveEntityOnTop(this->attachedEntity, this);
} else {
- if (*(u32 *)&this->parent->field_0x74 == 0) {
+ if (*(u32*)&this->parent->field_0x74 == 0) {
if (this->entityType.form == 8) {
this->attachedEntity->damageType = this->damageType;
}
@@ -260,8 +251,8 @@ void sub_0808F554(Entity* this) {
}
if (this->action != 0) {
- if (*(u32 *)&this->cutsceneBeh) {
- if (--(*(u32 *)&this->cutsceneBeh) == 0) {
+ if (*(u32*)&this->cutsceneBeh) {
+ if (--(*(u32*)&this->cutsceneBeh) == 0) {
DeleteThisEntity();
}
}
@@ -294,5 +285,5 @@ void sub_0808F5EC(Entity* this) {
entity->attachedEntity = this->attachedEntity;
}
- *(u32 *)&this->field_0x74 = 600;
+ *(u32*)&this->field_0x74 = 600;
}
diff --git a/src/object/object7E.c b/src/object/object7E.c
index a5618a3f..a8120b22 100644
--- a/src/object/object7E.c
+++ b/src/object/object7E.c
@@ -2,8 +2,8 @@
#include "entity.h"
#include "functions.h"
-void Object7E(Entity *this) {
-
+void Object7E(Entity* this) {
+
if (this->parent->next == NULL) {
DeleteThisEntity();
}
diff --git a/src/object/object86.c b/src/object/object86.c
index e6a1b683..9706e040 100644
--- a/src/object/object86.c
+++ b/src/object/object86.c
@@ -42,39 +42,37 @@ void sub_08099E10(Entity* this) {
}
}
-void sub_08099E58(Entity *this)
-{
- GetNextFrame(this);
- if (this->frames.b.f3) {
- this->frames.b.f3 = 0;
- this->actionDelay++;
- if (this->actionDelay == 3) {
- this->action = 3;
- this->frameIndex = 4;
+void sub_08099E58(Entity* this) {
+ GetNextFrame(this);
+ if (this->frames.b.f3) {
+ this->frames.b.f3 = 0;
+ this->actionDelay++;
+ if (this->actionDelay == 3) {
+ this->action = 3;
+ this->frameIndex = 4;
+ }
}
- }
}
-void sub_08099E8C(Entity *this)
-{
- if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) {
- if (this->previousActionFlag == 0) {
- sub_08099ECC(this);
- sub_0805E4E0(this, 0x1e);
- }
- if (CheckLocalFlag(0x75)) {
- sub_0805B390(0x7);
+void sub_08099E8C(Entity* this) {
+ if (sub_080041A0(this, &gPlayerEntity, 0xc, 0xc)) {
+ if (this->previousActionFlag == 0) {
+ sub_08099ECC(this);
+ sub_0805E4E0(this, 0x1e);
+ }
+ if (CheckLocalFlag(0x75)) {
+ sub_0805B390(0x7);
+ }
}
- }
}
-void nullsub_534(Entity* this) {}
+void nullsub_534(Entity* this) {
+}
-void sub_08099ECC(Entity *this)
-{
- this->previousActionFlag = 1;
- CopyPosition(this, &gPlayerEntity);
- gPlayerState.playerAction = 3;
- gPlayerState.field_0x34[4] = 0;
- gPlayerState.flags.all |= 0x8000;
+void sub_08099ECC(Entity* this) {
+ this->previousActionFlag = 1;
+ CopyPosition(this, &gPlayerEntity);
+ gPlayerState.playerAction = 3;
+ gPlayerState.field_0x34[4] = 0;
+ gPlayerState.flags.all |= 0x8000;
}
diff --git a/src/object/object9E.c b/src/object/object9E.c
index 5923b167..32786007 100644
--- a/src/object/object9E.c
+++ b/src/object/object9E.c
@@ -6,39 +6,37 @@ extern BoundingBox gUnk_080FD168;
extern void SetTile(u32, u32, u32);
-void Object9E(Entity *this)
-{
- Entity *ent;
- u32 tilePos;
- u8 *layer;
-
- if (this->action == 0) {
- this->action = 1;
- this->spritePriority.b0 = 6;
- if ((this->entityType).form == 0) {
- this->flags = this->flags | 0x80;
- this->frameIndex = 1;
- layer = &this->collisionLayer;
- *layer = 1;
- this->field_0x3c = 7;
- this->field_0x40 = 0x48;
- this->damageType = 0x7a;
- this->flags2 = 1;
- this->boundingBox = &gUnk_080FD168;
- tilePos = COORD_TO_TILE(this);
- SetTile(0x4066, tilePos - 1, *layer);
- SetTile(0x4065, tilePos, *layer);
- UpdateSpriteForCollisionLayer(this);
- ent = CreateObject(0x9e,1,0);
- if (ent != NULL) {
- this->attachedEntity = ent;
- CopyPosition(this, ent);
- }
- }
- else {
- this->frameIndex = 0;
- this->collisionLayer = 2;
- UpdateSpriteForCollisionLayer(this);
+void Object9E(Entity* this) {
+ Entity* ent;
+ u32 tilePos;
+ u8* layer;
+
+ if (this->action == 0) {
+ this->action = 1;
+ this->spritePriority.b0 = 6;
+ if ((this->entityType).form == 0) {
+ this->flags = this->flags | 0x80;
+ this->frameIndex = 1;
+ layer = &this->collisionLayer;
+ *layer = 1;
+ this->field_0x3c = 7;
+ this->field_0x40 = 0x48;
+ this->damageType = 0x7a;
+ this->flags2 = 1;
+ this->boundingBox = &gUnk_080FD168;
+ tilePos = COORD_TO_TILE(this);
+ SetTile(0x4066, tilePos - 1, *layer);
+ SetTile(0x4065, tilePos, *layer);
+ UpdateSpriteForCollisionLayer(this);
+ ent = CreateObject(0x9e, 1, 0);
+ if (ent != NULL) {
+ this->attachedEntity = ent;
+ CopyPosition(this, ent);
+ }
+ } else {
+ this->frameIndex = 0;
+ this->collisionLayer = 2;
+ UpdateSpriteForCollisionLayer(this);
+ }
}
- }
}
diff --git a/src/object/objectA.c b/src/object/objectA.c
index dbb79088..a95b3f9d 100644
--- a/src/object/objectA.c
+++ b/src/object/objectA.c
@@ -8,9 +8,9 @@ extern BoundingBox gUnk_080FD170;
extern u8 gUnk_02000070;
-void ObjectA(Entity *this) {
- u32 uVar2;
-
+void ObjectA(Entity* this) {
+ u32 uVar2;
+
if (this->action == 0) {
this->action = 1;
this->boundingBox = &gUnk_080FD170;
@@ -30,10 +30,10 @@ void ObjectA(Entity *this) {
sub_080787CC(this);
}
} else if (this->interactType != 0) {
- SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
- SetFlag(this->field_0x86.HWORD);
- CreateDust(this);
- sub_080526F8(-1);
- DeleteThisEntity();
+ SetTileType(*(u16*)&this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
+ SetFlag(this->field_0x86.HWORD);
+ CreateDust(this);
+ sub_080526F8(-1);
+ DeleteThisEntity();
}
}
diff --git a/src/object/objectA8.c b/src/object/objectA8.c
index 9f4f4bb4..ce298c29 100644
--- a/src/object/objectA8.c
+++ b/src/object/objectA8.c
@@ -9,28 +9,27 @@ extern void (*gUnk_08124824[])(Entity*);
extern Entity gPlayerEntity;
-void ObjectA8(Entity *this)
-{
- if ((this->bitfield & 0x80) != 0) {
- switch(this->bitfield & 0x7f) {
- case 0:
- case 1:
- case 4:
- case 5:
- case 6:
- case 8:
- case 9:
- case 10:
- case 0xb:
- case 0xc:
- case 0x1e:
- case 0x1f:
- this->action = 5;
- this->attachedEntity = &gPlayerEntity;
- CreateItemEntity((this->entityType).form, 0, 0);
- DeleteThisEntity();
+void ObjectA8(Entity* this) {
+ if ((this->bitfield & 0x80) != 0) {
+ switch (this->bitfield & 0x7f) {
+ case 0:
+ case 1:
+ case 4:
+ case 5:
+ case 6:
+ case 8:
+ case 9:
+ case 10:
+ case 0xb:
+ case 0xc:
+ case 0x1e:
+ case 0x1f:
+ this->action = 5;
+ this->attachedEntity = &gPlayerEntity;
+ CreateItemEntity((this->entityType).form, 0, 0);
+ DeleteThisEntity();
+ }
}
- }
- gUnk_08124824[this->action](this);
- sub_08080CB4(this);
+ gUnk_08124824[this->action](this);
+ sub_08080CB4(this);
}
diff --git a/src/object/palaceArchway.c b/src/object/palaceArchway.c
index 3cbcf178..de1e5297 100644
--- a/src/object/palaceArchway.c
+++ b/src/object/palaceArchway.c
@@ -9,13 +9,13 @@ void PalaceArchway(Entity* this) {
gUnk_081246EC[this->action](this);
}
-void sub_0809F2A0(Entity *this)
-{
- this->action = 1;
- this->frameIndex = this->entityType.parameter;
- this->spriteRendering.b3 = 3;
- this->spritePriority.b0 = 7;
- SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
+void sub_0809F2A0(Entity* this) {
+ this->action = 1;
+ this->frameIndex = this->entityType.parameter;
+ this->spriteRendering.b3 = 3;
+ this->spritePriority.b0 = 7;
+ SetTile(0x4069, COORD_TO_TILE(this), this->collisionLayer);
}
-void nullsub_537() {}
+void nullsub_537() {
+}
diff --git a/src/object/pinwheel.c b/src/object/pinwheel.c
index 1476bc58..5862c3ca 100644
--- a/src/object/pinwheel.c
+++ b/src/object/pinwheel.c
@@ -13,31 +13,30 @@ extern void (*gUnk_0812505C[])(Entity*);
void Pinwheel(Entity* this) {
u16 x = this->currentHealth;
if ((x & 0x7f) != 0) {
- if (ReadBit(&gUnk_020342F8,x-1) == 0) {
- DeleteThisEntity();
- }
+ if (ReadBit(&gUnk_020342F8, x - 1) == 0) {
+ DeleteThisEntity();
+ }
}
gUnk_0812505C[this->action](this);
}
-void sub_080A23DC(Entity *this) {
+void sub_080A23DC(Entity* this) {
this->field_0x68.HWORD = gUnk_08125050[this->entityType.parameter];
this->spritePriority.b0 = 7;
- if (CheckLocalFlag(this->field_0x68.HWORD) !=0) {
+ if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
this->action = 2;
- }
- else {
+ } else {
this->action = 1;
}
- InitializeAnimation(this,0);
+ InitializeAnimation(this, 0);
}
-void sub_080A2420(Entity *this) {
- if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
- this->action = 2;
- CreateDust(this);
- }
+void sub_080A2420(Entity* this) {
+ if (CheckLocalFlag(this->field_0x68.HWORD) != 0) {
+ this->action = 2;
+ CreateDust(this);
+ }
}
-void sub_080A243C(Entity *this) {
+void sub_080A243C(Entity* this) {
GetNextFrame(this);
-} \ No newline at end of file
+}
diff --git a/src/object/pot.c b/src/object/pot.c
index 47ea8c9f..ddce728f 100755..100644
--- a/src/object/pot.c
+++ b/src/object/pot.c
@@ -128,7 +128,6 @@ void sub_08082510(Entity* this) {
this->previousActionFlag++;
}
-
void nullsub_511(Entity* this) {
}
diff --git a/src/object/smoke.c b/src/object/smoke.c
index 54047762..c8759c7c 100644
--- a/src/object/smoke.c
+++ b/src/object/smoke.c
@@ -13,46 +13,42 @@ void Smoke(Entity* this) {
gUnk_08121060[this->entityType.form](this);
}
-void sub_0808A40C(Entity *this)
-{
- Entity *ent;
-
- if (this->action == 0) {
- this->action = 1;
- this->actionDelay = 0x28;
- }
- if (--this->actionDelay == 0) {
- this->actionDelay = 0x40 - (Random() & 0x1f);
- ent = CreateObject(0x2d, 1, 0);
- if (ent != NULL) {
- CopyPosition(this,ent);
- ent->x.HALF.HI += gUnk_08121068[(Random() & 7)];
+void sub_0808A40C(Entity* this) {
+ Entity* ent;
+
+ if (this->action == 0) {
+ this->action = 1;
+ this->actionDelay = 0x28;
+ }
+ if (--this->actionDelay == 0) {
+ this->actionDelay = 0x40 - (Random() & 0x1f);
+ ent = CreateObject(0x2d, 1, 0);
+ if (ent != NULL) {
+ CopyPosition(this, ent);
+ ent->x.HALF.HI += gUnk_08121068[(Random() & 7)];
+ }
}
- }
}
-void sub_0808A46C(Entity *this)
-{
+void sub_0808A46C(Entity* this) {
gUnk_08121070[this->action](this);
}
-void sub_0808A484(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = TRUE;
- this->nonPlanarMovement = 0x40;
- this->direction = 6;
- this->spriteRendering.b3 = 1;
- this->spritePriority.b0 = 0;
- this->spriteOrientation.flipY = 1;
- InitializeAnimation(this, 0x28);
+void sub_0808A484(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = TRUE;
+ this->nonPlanarMovement = 0x40;
+ this->direction = 6;
+ this->spriteRendering.b3 = 1;
+ this->spritePriority.b0 = 0;
+ this->spriteOrientation.flipY = 1;
+ InitializeAnimation(this, 0x28);
}
-void sub_0808A4D0(Entity *this)
-{
- GetNextFrame(this);
- sub_0806F69C(this);
- if (this->frames.b.f3) {
- DeleteEntity(this);
- }
+void sub_0808A4D0(Entity* this) {
+ GetNextFrame(this);
+ sub_0806F69C(this);
+ if (this->frames.b.f3) {
+ DeleteEntity(this);
+ }
}
diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c
index 61bd48a1..2cdea24d 100644
--- a/src/object/swordsmanNewsletter.c
+++ b/src/object/swordsmanNewsletter.c
@@ -13,19 +13,17 @@ void SwordsmanNewsletter(Entity* this) {
gUnk_081228B0[this->action](this);
}
-void sub_080933D8(Entity *this)
-{
- this->action = 1;
- this->frameIndex = this->entityType.form;
- UpdateSpriteForCollisionLayer(this);
- this->boundingBox = &gUnk_081228A8;
- sub_080787B4(this);
+void sub_080933D8(Entity* this) {
+ this->action = 1;
+ this->frameIndex = this->entityType.form;
+ UpdateSpriteForCollisionLayer(this);
+ this->boundingBox = &gUnk_081228A8;
+ sub_080787B4(this);
}
-void sub_080933FC(Entity *this)
-{
- if (this->interactType != 0) {
- this->interactType = 0;
- TextboxNoOverlap(gUnk_081228B8[this->entityType.form], this);
- }
+void sub_080933FC(Entity* this) {
+ if (this->interactType != 0) {
+ this->interactType = 0;
+ TextboxNoOverlap(gUnk_081228B8[this->entityType.form], this);
+ }
}
diff --git a/src/object/thoughtBubble.c b/src/object/thoughtBubble.c
index 73316eca..1b1b6e47 100644
--- a/src/object/thoughtBubble.c
+++ b/src/object/thoughtBubble.c
@@ -10,34 +10,31 @@ extern void (*const ThoughtBubble_Behaviors[])(Entity*);
extern u16 ThoughtBubble_SFX[];
-void ThoughtBubble(Entity* this)
-{
- ThoughtBubble_Behaviors[this->action](this);
+void ThoughtBubble(Entity* this) {
+ ThoughtBubble_Behaviors[this->action](this);
}
-void ThoughtBubble_Init(Entity *this)
-{
- this->action = 1;
- this->spriteSettings.b.draw = 1;
- if (this->actionDelay == 0) {
- this->actionDelay = 0x2d;
- }
- this->spriteOrientation.flipY = 1;
- InitializeAnimation(this, this->entityType.parameter);
- PlaySFX(ThoughtBubble_SFX[this->entityType.parameter]);
+void ThoughtBubble_Init(Entity* this) {
+ this->action = 1;
+ this->spriteSettings.b.draw = 1;
+ if (this->actionDelay == 0) {
+ this->actionDelay = 0x2d;
+ }
+ this->spriteOrientation.flipY = 1;
+ InitializeAnimation(this, this->entityType.parameter);
+ PlaySFX(ThoughtBubble_SFX[this->entityType.parameter]);
}
-void ThoughtBubble_Update(Entity *this)
-{
- if (this->parent != NULL) {
- this->x.HALF.HI = this->parent->x.HALF.HI;
- this->y.HALF.HI = this->parent->y.HALF.HI;
- this->height.HALF.HI = this->parent->height.HALF.HI;
- }
- if ((this->entityType).parameter != 2) {
- if (--this->actionDelay == 0) {
- DeleteThisEntity();
+void ThoughtBubble_Update(Entity* this) {
+ if (this->parent != NULL) {
+ this->x.HALF.HI = this->parent->x.HALF.HI;
+ this->y.HALF.HI = this->parent->y.HALF.HI;
+ this->height.HALF.HI = this->parent->height.HALF.HI;
+ }
+ if ((this->entityType).parameter != 2) {
+ if (--this->actionDelay == 0) {
+ DeleteThisEntity();
+ }
}
- }
- GetNextFrame(this);
+ GetNextFrame(this);
}
diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c
index 8d34e3b9..c11ace77 100644
--- a/src/object/treeHidingPortal.c
+++ b/src/object/treeHidingPortal.c
@@ -82,7 +82,6 @@ void sub_0809E918(Entity* this) {
}
}
-void sub_0809E96C(Entity *this)
-{
- CreateMinishEntrance(COORD_TO_TILE_OFFSET(this, 0x20, 0x8));
+void sub_0809E96C(Entity* this) {
+ CreateMinishEntrance(COORD_TO_TILE_OFFSET(this, 0x20, 0x8));
}
diff --git a/src/object/windTribeFlag.c b/src/object/windTribeFlag.c
index f9c82da8..01d7e554 100644
--- a/src/object/windTribeFlag.c
+++ b/src/object/windTribeFlag.c
@@ -2,24 +2,21 @@
#include "entity.h"
#include "functions.h"
-void WindTribeFlag(Entity *this)
-{
- if (this->action == 0) {
- this->action++;
- this->collisionLayer = 2;
- if ((this->entityType).form == 0) {
- this->spriteSettings.b.flipX = 0;
+void WindTribeFlag(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ this->collisionLayer = 2;
+ if ((this->entityType).form == 0) {
+ this->spriteSettings.b.flipX = 0;
+ } else {
+ this->spriteSettings.b.flipX = 1;
+ }
+ UpdateSpriteForCollisionLayer(this);
+ InitializeAnimation(this, 0);
+ } else {
+ GetNextFrame(this);
}
- else {
- this->spriteSettings.b.flipX = 1;
+ if (this->frameDuration == 0xff) {
+ this->frameDuration = (Random() & 0xf) + 0x10;
}
- UpdateSpriteForCollisionLayer(this);
- InitializeAnimation(this,0);
- }
- else {
- GetNextFrame(this);
- }
- if (this->frameDuration == 0xff) {
- this->frameDuration = (Random() & 0xf) + 0x10;
- }
}
diff --git a/src/object/windcrest.c b/src/object/windcrest.c
index 3b883f4e..f8c804e5 100644
--- a/src/object/windcrest.c
+++ b/src/object/windcrest.c
@@ -7,29 +7,26 @@ extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*);
extern void sub_08078850(Entity*, u32, u32, u8*);
extern void PlaySFX(u32);
-extern Entity* CreateFx (Entity*, u32, u32);
+extern Entity* CreateFx(Entity*, u32, u32);
extern u8 gUnk_08125010;
-void Windcrest(Entity *this)
-{
- if (this->action == 0) {
- this->action++;
- this->frameIndex = 0;
- sub_0807DD64(this);
- }
- sub_0807DDAC(this, 0);
- sub_0807DDE4(this);
+void Windcrest(Entity* this) {
+ if (this->action == 0) {
+ this->action++;
+ this->frameIndex = 0;
+ sub_0807DD64(this);
+ }
+ sub_0807DDAC(this, 0);
+ sub_0807DDE4(this);
}
-void sub_080A2124(Entity *this)
-{
- sub_08078850(this, 1, 0xe, &gUnk_08125010);
+void sub_080A2124(Entity* this) {
+ sub_08078850(this, 1, 0xe, &gUnk_08125010);
}
-void Windcrest_Unlock(Entity *this)
-{
- PlaySFX(0x72);
- gUnk_02002A40.windcrests = gUnk_02002A40.windcrests | 1 << (this->entityType.parameter + 0x18);
- CreateFx(this, 0x46, 0);
+void Windcrest_Unlock(Entity* this) {
+ PlaySFX(0x72);
+ gUnk_02002A40.windcrests = gUnk_02002A40.windcrests | 1 << (this->entityType.parameter + 0x18);
+ CreateFx(this, 0x46, 0);
}
diff --git a/src/position.c b/src/position.c
index 50aa4c6f..628042c3 100644
--- a/src/position.c
+++ b/src/position.c
@@ -6,8 +6,7 @@
extern u8 gUnk_08114F78[];
extern u8 gUnk_08114F80[];
-void CopyPosition(Entity* param_1, Entity* param_2)
-{
+void CopyPosition(Entity* param_1, Entity* param_2) {
PositionRelative(param_1, param_2, 0, 0);
}
@@ -31,26 +30,22 @@ void PositionRelative(Entity* source, Entity* target, s32 offsetX, s32 offsetY)
UpdateSpriteForCollisionLayer(target);
}
-void CopyPositionAndSpriteOffset(Entity *param_1,Entity *param_2)
-{
- param_2->spriteOffsetX = param_1->spriteOffsetX;
- param_2->spriteOffsetY = param_1->spriteOffsetY;
- PositionRelative(param_1, param_2, 0, 0);
+void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2) {
+ param_2->spriteOffsetX = param_1->spriteOffsetX;
+ param_2->spriteOffsetY = param_1->spriteOffsetY;
+ PositionRelative(param_1, param_2, 0, 0);
}
-void sub_0806FA90(Entity *param_1,Entity *param_2, s32 offsetX, s32 offsetY)
-{
- param_2->spriteOffsetX = param_1->spriteOffsetX;
- param_2->spriteOffsetY = param_1->spriteOffsetY;
- PositionRelative(param_1,param_2, offsetX * 64 * 32 * 32, offsetY * 64 * 32 * 32);
+void sub_0806FA90(Entity* param_1, Entity* param_2, s32 offsetX, s32 offsetY) {
+ param_2->spriteOffsetX = param_1->spriteOffsetX;
+ param_2->spriteOffsetY = param_1->spriteOffsetY;
+ PositionRelative(param_1, param_2, offsetX * 64 * 32 * 32, offsetY * 64 * 32 * 32);
}
-void ResolveEntityOnTop(Entity *param_1,Entity *param_2)
-{
+void ResolveEntityOnTop(Entity* param_1, Entity* param_2) {
param_2->spritePriority.b0 = gUnk_08114F78[param_1->spritePriority.b0];
}
-void sub_0806FAD8(Entity *param_1,Entity *param_2)
-{
- param_2->spritePriority.b0 = gUnk_08114F80[param_1->spritePriority.b0];
+void sub_0806FAD8(Entity* param_1, Entity* param_2) {
+ param_2->spritePriority.b0 = gUnk_08114F80[param_1->spritePriority.b0];
}
diff --git a/src/room.c b/src/room.c
index b8cdbcda..e9d2c358 100644
--- a/src/room.c
+++ b/src/room.c
@@ -4259,8 +4259,10 @@ void LoadHyruleTown(void) {
LoadRoomEntityList(&gUnk_080EECBC);
}
if (CheckKinstoneFused(0x1b) && (gUnk_02002A40.unk8 > 3)) {
- if (!CheckGlobalFlag(NEW_HOUSE_DIN) && !CheckGlobalFlag(NEW_HOUSE_NAYRU) && !CheckGlobalFlag(NEW_HOUSE_FARORE)) {
- if (!CheckGlobalFlag(RENTED_HOUSE_DIN) && !CheckGlobalFlag(RENTED_HOUSE_NAYRU) && !CheckGlobalFlag(RENTED_HOUSE_FARORE)) {
+ if (!CheckGlobalFlag(NEW_HOUSE_DIN) && !CheckGlobalFlag(NEW_HOUSE_NAYRU) &&
+ !CheckGlobalFlag(NEW_HOUSE_FARORE)) {
+ if (!CheckGlobalFlag(RENTED_HOUSE_DIN) && !CheckGlobalFlag(RENTED_HOUSE_NAYRU) &&
+ !CheckGlobalFlag(RENTED_HOUSE_FARORE)) {
LoadRoomEntityList(&gUnk_080EE95C);
} else {
if (!CheckGlobalFlag(TATEKAKE_HOUSE)) {
@@ -4283,7 +4285,8 @@ void LoadHyruleTown(void) {
LoadRoomEntityList(&gUnk_080EE9DC);
}
if ((gUnk_02002A40.unk8 > 4) && !CheckKinstoneFused(0xb) &&
- (CheckGlobalFlag(RENTED_HOUSE_DIN) || CheckGlobalFlag(RENTED_HOUSE_NAYRU) || CheckGlobalFlag(RENTED_HOUSE_FARORE))) {
+ (CheckGlobalFlag(RENTED_HOUSE_DIN) || CheckGlobalFlag(RENTED_HOUSE_NAYRU) ||
+ CheckGlobalFlag(RENTED_HOUSE_FARORE))) {
LoadRoomEntityList(&gUnk_080EEA5C);
}
// rocs cape
@@ -4305,11 +4308,10 @@ void LoadHyruleTown(void) {
extern EntityData gUnk_080EEBAC;
-void sub_0804E130(void)
-{
- if ((gUnk_02002A40.windcrests & 0x8000000) == 0) {
- LoadRoomEntityList(&gUnk_080EEBAC);
- }
+void sub_0804E130(void) {
+ if ((gUnk_02002A40.windcrests & 0x8000000) == 0) {
+ LoadRoomEntityList(&gUnk_080EEBAC);
+ }
}
NAKED
@@ -4321,55 +4323,64 @@ u32 sub_0804E1F4() {
return 1;
}
-void nullsub_76() {}
+void nullsub_76() {
+}
u32 sub_0804E1FC() {
return 1;
}
-void nullsub_77() {}
+void nullsub_77() {
+}
u32 sub_0804E204() {
return 1;
}
-void nullsub_78() {}
+void nullsub_78() {
+}
u32 sub_0804E20C() {
return 1;
}
-void nullsub_79() {}
+void nullsub_79() {
+}
u32 sub_0804E214() {
return 1;
}
-void nullsub_080() {}
+void nullsub_080() {
+}
u32 sub_0804E21C() {
return 1;
}
-void nullsub_081() {}
+void nullsub_081() {
+}
u32 sub_0804E224() {
return 1;
}
-void nullsub_082() {}
+void nullsub_082() {
+}
u32 sub_0804E22C() {
return 1;
}
-void nullsub_083() {}
+void nullsub_083() {
+}
u32 sub_0804E234() {
return 1;
}
-void nullsub_084() {}
+void nullsub_084() {
+}
u32 sub_0804E23C() {
return 1;
@@ -4382,30 +4393,32 @@ u32 sub_0804E244() {
return 1;
}
-void nullsub_086() {}
+void nullsub_086() {
+}
u32 sub_0804E24C() {
return 1;
}
-void nullsub_087() {}
+void nullsub_087() {
+}
u32 sub_0804E254() {
return 1;
}
-void nullsub_088() {}
+void nullsub_088() {
+}
extern u32 gUnk_080F09A0;
-u32 sub_0804E25C(void)
-{
-
- //four sword
- if (GetInventoryValue(0x6)) {
- gRoomVars.field_0x70 = &gUnk_080F09A0;
- }
- return 1;
+u32 sub_0804E25C(void) {
+
+ // four sword
+ if (GetInventoryValue(0x6)) {
+ gRoomVars.field_0x70 = &gUnk_080F09A0;
+ }
+ return 1;
}
extern EntityData gUnk_080F0650;
@@ -4416,50 +4429,46 @@ extern EntityData gUnk_080F0870;
extern EntityData gUnk_080F0890;
extern EntityData gUnk_080F0920;
-void sub_0804E27C(void)
-{
+void sub_0804E27C(void) {
- if (!CheckGlobalFlag(TABIDACHI)) {
- LoadRoomEntityList(&gUnk_080F0650);
- gArea.pMusicIndex = 0x13;
- SetGlobalFlag(CASTLE_BGM);
- }
- else {
- if (CheckGlobalFlag(CASTLE_BGM)) {
- gArea.pMusicIndex = 0x1b;
+ if (!CheckGlobalFlag(TABIDACHI)) {
+ LoadRoomEntityList(&gUnk_080F0650);
+ gArea.pMusicIndex = 0x13;
+ SetGlobalFlag(CASTLE_BGM);
+ } else {
+ if (CheckGlobalFlag(CASTLE_BGM)) {
+ gArea.pMusicIndex = 0x1b;
+ }
}
- }
- if (!CheckLocalFlag(0x9c)) {
- LoadRoomEntityList(&gUnk_080F0800);
- SetTileType(0x4072, 600, 1);
- SetTileType(0x4072, 0x298, 1);
- SetTileType(0x4072, 0x266, 1);
- SetTileType(0x4072, 0x2a6, 1);
- }
- else {
- // four sword
- if (!GetInventoryValue(0x6)) {
- LoadRoomEntityList(&gUnk_080F08F0);
- SetTileType(0x4072, 0x9e, 1);
- SetTileType(0x4072, 0x9f, 1);
- SetTileType(0x4072, 0xa0, 1);
- }
- LoadRoomEntityList(&gUnk_080F0850);
- // water element
- if (!GetInventoryValue(0x42)) {
- LoadRoomEntityList(&gUnk_080F0870);
- }
- else {
- LoadRoomEntityList(&gUnk_080F0890);
- }
- SetTileType(0x4072, 600, 1);
- SetTileType(0x4072, 0x298, 1);
- if (CheckLocalFlag(0x10)) {
- LoadRoomEntityList(&gUnk_080F0920);
- ClearLocalFlag(0x10);
+ if (!CheckLocalFlag(0x9c)) {
+ LoadRoomEntityList(&gUnk_080F0800);
+ SetTileType(0x4072, 600, 1);
+ SetTileType(0x4072, 0x298, 1);
+ SetTileType(0x4072, 0x266, 1);
+ SetTileType(0x4072, 0x2a6, 1);
+ } else {
+ // four sword
+ if (!GetInventoryValue(0x6)) {
+ LoadRoomEntityList(&gUnk_080F08F0);
+ SetTileType(0x4072, 0x9e, 1);
+ SetTileType(0x4072, 0x9f, 1);
+ SetTileType(0x4072, 0xa0, 1);
+ }
+ LoadRoomEntityList(&gUnk_080F0850);
+ // water element
+ if (!GetInventoryValue(0x42)) {
+ LoadRoomEntityList(&gUnk_080F0870);
+ } else {
+ LoadRoomEntityList(&gUnk_080F0890);
+ }
+ SetTileType(0x4072, 600, 1);
+ SetTileType(0x4072, 0x298, 1);
+ if (CheckLocalFlag(0x10)) {
+ LoadRoomEntityList(&gUnk_080F0920);
+ ClearLocalFlag(0x10);
+ }
}
- }
- sub_080AF284();
+ sub_080AF284();
}
u32 sub_0804E3B8() {
@@ -4488,11 +4497,11 @@ void sub_0804E3C4() {
index = 3;
}
r = Random();
- index = gUnk_080F0D58[index][r&0x1f];
+ index = gUnk_080F0D58[index][r & 0x1f];
LoadRoomEntityList(gUnk_080F0CB8[index & 0xF]);
index >>= 4;
r >>= 8;
- index = gUnk_080F0E08[index][r&0x1F];
+ index = gUnk_080F0E08[index][r & 0x1F];
if (!CheckLocalFlag(0xC6)) {
SetLocalFlag(0xC6);
index = 0xE;
@@ -4508,14 +4517,12 @@ u32 sub_0804E45C() {
extern EntityData gUnk_080F1C68;
extern EntityData gUnk_080F1C88;
-void sub_0804E460(void)
-{
- if (!CheckGlobalFlag(POWERGLOVE_HINT)) {
- LoadRoomEntityList(&gUnk_080F1C68);
- }
- else {
- LoadRoomEntityList(&gUnk_080F1C88);
- }
+void sub_0804E460(void) {
+ if (!CheckGlobalFlag(POWERGLOVE_HINT)) {
+ LoadRoomEntityList(&gUnk_080F1C68);
+ } else {
+ LoadRoomEntityList(&gUnk_080F1C88);
+ }
}
u32 sub_0804E484() {
@@ -4526,8 +4533,7 @@ extern EntityData gUnk_080F1D90;
extern EntityData gUnk_080F1DB0;
extern EntityData gUnk_080F1DD0;
-void sub_0804E488(void)
-{
+void sub_0804E488(void) {
if (CheckGlobalFlag(NEW_HOUSE_DIN)) {
LoadRoomEntityList(&gUnk_080F1D90);
} else if (CheckGlobalFlag(NEW_HOUSE_NAYRU)) {
@@ -4541,13 +4547,15 @@ u32 sub_0804E4D0() {
return 1;
}
-void nullsub_375() {}
+void nullsub_375() {
+}
u32 sub_0804E4D8() {
return 1;
}
-void nullsub_376() {}
+void nullsub_376() {
+}
u32 sub_0804E4E0() {
return 1;
@@ -4557,17 +4565,16 @@ extern EntityData gUnk_080F2174;
extern EntityData gUnk_080F2194;
extern EntityData gUnk_080F21B4;
-void sub_0804E4E4(void)
-{
-
- LoadRoomEntityList(&gUnk_080F2174);
- // picori legend book
- if (!GetInventoryValue(0x3a) && CheckGlobalFlag(MIZUKAKI_HARIFALL)) {
- LoadRoomEntityList(&gUnk_080F2194);
- }
- if (gScreenTransition.field_0xf == 1) {
- LoadRoomEntityList(&gUnk_080F21B4);
- }
+void sub_0804E4E4(void) {
+
+ LoadRoomEntityList(&gUnk_080F2174);
+ // picori legend book
+ if (!GetInventoryValue(0x3a) && CheckGlobalFlag(MIZUKAKI_HARIFALL)) {
+ LoadRoomEntityList(&gUnk_080F2194);
+ }
+ if (gScreenTransition.field_0xf == 1) {
+ LoadRoomEntityList(&gUnk_080F21B4);
+ }
}
u32 sub_0804E528() {
@@ -4578,19 +4585,17 @@ extern EntityData gUnk_080F23BC;
extern EntityData gUnk_080F238C;
extern EntityData gUnk_080F236C;
-void sub_0804E52C(void)
-{
-
- if (gUnk_02002A40.unk8 > 7) {
- LoadRoomEntityList(&gUnk_080F23BC);
- }
- // flippers
- if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START)) {
- LoadRoomEntityList(&gUnk_080F238C);
- }
- else {
- LoadRoomEntityList(&gUnk_080F236C);
- }
+void sub_0804E52C(void) {
+
+ if (gUnk_02002A40.unk8 > 7) {
+ LoadRoomEntityList(&gUnk_080F23BC);
+ }
+ // flippers
+ if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START)) {
+ LoadRoomEntityList(&gUnk_080F238C);
+ } else {
+ LoadRoomEntityList(&gUnk_080F236C);
+ }
}
u32 sub_0804E570() {
@@ -4602,8 +4607,7 @@ extern EntityData gUnk_080F2590;
extern EntityData gUnk_080F25C0;
extern EntityData gUnk_080F2600;
-void sub_0804E574(void)
-{
+void sub_0804E574(void) {
switch (gUnk_02002A40.unk8) {
case 0:
case 2:
@@ -4646,25 +4650,21 @@ extern EntityData gUnk_080F2758;
extern EntityData gUnk_080F27D8;
extern EntityData gUnk_080F2798;
-void sub_0804E618(void)
-{
- if (CheckKinstoneFused(0x21)) {
- if (!CheckLocalFlag(0x42)) {
- if (!CheckLocalFlag(0x43)) {
- LoadRoomEntityList(&gUnk_080F2718);
- LoadRoomTileEntities(&gUnk_080F2860);
- }
- else {
- LoadRoomEntityList(&gUnk_080F2758);
- }
+void sub_0804E618(void) {
+ if (CheckKinstoneFused(0x21)) {
+ if (!CheckLocalFlag(0x42)) {
+ if (!CheckLocalFlag(0x43)) {
+ LoadRoomEntityList(&gUnk_080F2718);
+ LoadRoomTileEntities(&gUnk_080F2860);
+ } else {
+ LoadRoomEntityList(&gUnk_080F2758);
+ }
+ } else if (!CheckLocalFlag(0x3f)) {
+ LoadRoomEntityList(&gUnk_080F27D8);
+ } else {
+ LoadRoomEntityList(&gUnk_080F2798);
+ }
}
- else if (!CheckLocalFlag(0x3f)) {
- LoadRoomEntityList(&gUnk_080F27D8);
- }
- else {
- LoadRoomEntityList(&gUnk_080F2798);
- }
- }
}
u32 sub_0804E680() {
@@ -4675,8 +4675,7 @@ extern EntityData gUnk_080F28D4;
extern EntityData gUnk_080F28F4;
extern EntityData gUnk_080F2914;
-void sub_0804E684(void)
-{
+void sub_0804E684(void) {
if (CheckGlobalFlag(RENTED_HOUSE_DIN)) {
LoadRoomEntityList(&gUnk_080F28D4);
} else if (CheckGlobalFlag(RENTED_HOUSE_NAYRU)) {
@@ -4690,19 +4689,22 @@ u32 sub_0804E6CC9() {
return 1;
}
-void nullsub_377() {}
+void nullsub_377() {
+}
u32 sub_0804E6D4() {
return 1;
}
-void nullsub_378() {}
+void nullsub_378() {
+}
u32 sub_0804E6DC() {
return 1;
}
-void nullsub_379() {}
+void nullsub_379() {
+}
u32 sub_0804E6E4() {
return 1;
@@ -4710,15 +4712,14 @@ u32 sub_0804E6E4() {
extern EntityData gUnk_080F2E2C;
-void sub_0804E6E8(void)
-{
- if (!CheckGlobalFlag(OUTDOOR)) {
- gArea.musicIndex = gArea.pMusicIndex;
- PlaySFX(0x800b0036);
- }
- if (!CheckGlobalFlag(START)) {
- LoadRoomEntityList(&gUnk_080F2E2C);
- }
+void sub_0804E6E8(void) {
+ if (!CheckGlobalFlag(OUTDOOR)) {
+ gArea.musicIndex = gArea.pMusicIndex;
+ PlaySFX(0x800b0036);
+ }
+ if (!CheckGlobalFlag(START)) {
+ LoadRoomEntityList(&gUnk_080F2E2C);
+ }
}
u32 sub_0804E728() {
@@ -4728,18 +4729,16 @@ u32 sub_0804E728() {
extern EntityData gUnk_080F2E94;
extern EntityData gUnk_080F2EC4;
-void sub_0804E72C(void)
-{
- if (!CheckGlobalFlag(OUTDOOR)) {
- gArea.musicIndex = gArea.pMusicIndex;
- PlaySFX(0x800b0036);
- }
- if (!CheckGlobalFlag(START)) {
- LoadRoomEntityList(&gUnk_080F2E94);
- }
- else {
- LoadRoomEntityList(&gUnk_080F2EC4);
- }
+void sub_0804E72C(void) {
+ if (!CheckGlobalFlag(OUTDOOR)) {
+ gArea.musicIndex = gArea.pMusicIndex;
+ PlaySFX(0x800b0036);
+ }
+ if (!CheckGlobalFlag(START)) {
+ LoadRoomEntityList(&gUnk_080F2E94);
+ } else {
+ LoadRoomEntityList(&gUnk_080F2EC4);
+ }
}
u32 sub_0804E778() {
@@ -4748,12 +4747,11 @@ u32 sub_0804E778() {
extern EntityData gUnk_080F2FD4;
-void sub_0804E77C(void)
-{
+void sub_0804E77C(void) {
// graveyard key
- if (!CheckLocalFlag(0x69) || GetInventoryValue(0x3c) > 1) {
- LoadRoomEntityList(&gUnk_080F2FD4);
- }
+ if (!CheckLocalFlag(0x69) || GetInventoryValue(0x3c) > 1) {
+ LoadRoomEntityList(&gUnk_080F2FD4);
+ }
}
u32 sub_0804E7A0() {
@@ -4762,13 +4760,11 @@ u32 sub_0804E7A0() {
extern EntityData gUnk_080F30CC;
-void sub_0804E7A4(void)
-{
+void sub_0804E7A4(void) {
// dog food
- if ((GetInventoryValue(0x36) == 1) && !CheckGlobalFlag(BIN_DOGFOOD) &&
- (gPlayerState.flags.all & 0x80) == 0) {
- LoadRoomEntityList(&gUnk_080F30CC);
- }
+ if ((GetInventoryValue(0x36) == 1) && !CheckGlobalFlag(BIN_DOGFOOD) && (gPlayerState.flags.all & 0x80) == 0) {
+ LoadRoomEntityList(&gUnk_080F30CC);
+ }
}
u32 sub_0804E7D8() {
@@ -4779,32 +4775,30 @@ extern EntityData gUnk_080F31D8;
extern u8 gUnk_02000070;
extern u32 gUnk_08009B30;
-void sub_0804E7DC(void)
-{
+void sub_0804E7DC(void) {
- if (!CheckGlobalFlag(START) && !CheckLocalFlag(0x46)) {
- sub_080A71C4(5, 1, 4, 4);
- gUnk_02000070 = 0;
- DoFade(5, 0x100);
- sub_080751E8(0, 6, &gUnk_08009B30);
- }
- if (!CheckGlobalFlag(OUTDOOR)) {
- gArea.musicIndex = gArea.pMusicIndex;
- PlaySFX(0x800b0036);
- }
- if ((gPlayerState.flags.all & 8) == 0) {
- LoadRoomEntityList(&gUnk_080F31D8);
- }
+ if (!CheckGlobalFlag(START) && !CheckLocalFlag(0x46)) {
+ sub_080A71C4(5, 1, 4, 4);
+ gUnk_02000070 = 0;
+ DoFade(5, 0x100);
+ sub_080751E8(0, 6, &gUnk_08009B30);
+ }
+ if (!CheckGlobalFlag(OUTDOOR)) {
+ gArea.musicIndex = gArea.pMusicIndex;
+ PlaySFX(0x800b0036);
+ }
+ if ((gPlayerState.flags.all & 8) == 0) {
+ LoadRoomEntityList(&gUnk_080F31D8);
+ }
}
extern u32 gUnk_08009E58;
-void sub_0804E864(void)
-{
- gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90;
- gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
- sub_080751E8(1, 6, &gUnk_08009E58);
- ModHealth(0xa0);
+void sub_0804E864(void) {
+ gPlayerEntity.x.HALF.HI = gRoomControls.roomOriginX + 0x90;
+ gPlayerEntity.y.HALF.HI = gRoomControls.roomOriginY + 0x38;
+ sub_080751E8(1, 6, &gUnk_08009E58);
+ ModHealth(0xa0);
}
u32 sub_0804E894() {
@@ -4813,16 +4807,15 @@ u32 sub_0804E894() {
extern EntityData gUnk_080F3260;
-void sub_0804E898(void)
-{
- // pacci cane
- if (GetInventoryValue(0x12)) {
- LoadRoomEntityList(&gUnk_080F3260);
- SetTileType(0x4072, 0x202, 1);
- SetTileType(0x4072, 0x242, 1);
- SetTileType(0x4072, 0x204, 1);
- SetTileType(0x4072, 0x244, 1);
- }
+void sub_0804E898(void) {
+ // pacci cane
+ if (GetInventoryValue(0x12)) {
+ LoadRoomEntityList(&gUnk_080F3260);
+ SetTileType(0x4072, 0x202, 1);
+ SetTileType(0x4072, 0x242, 1);
+ SetTileType(0x4072, 0x204, 1);
+ SetTileType(0x4072, 0x244, 1);
+ }
}
u32 sub_0804E8EC() {
@@ -4840,13 +4833,11 @@ u32 sub_0804E8F8() {
extern EntityData gUnk_080F36FC;
extern EntityData gUnk_080F3604;
-void sub_0804E8FC(void)
-{
- if (!CheckGlobalFlag(INLOCK)) {
- LoadRoomEntityList(&gUnk_080F36FC);
- }
- else if (gUnk_02002A40.unk8 < 4) {
- LoadRoomEntityList(&gUnk_080F3604);
+void sub_0804E8FC(void) {
+ if (!CheckGlobalFlag(INLOCK)) {
+ LoadRoomEntityList(&gUnk_080F36FC);
+ } else if (gUnk_02002A40.unk8 < 4) {
+ LoadRoomEntityList(&gUnk_080F3604);
}
}
@@ -4856,18 +4847,18 @@ u32 sub_0804E92C() {
extern EntityData gUnk_080F37D0;
-void sub_0804E930(void)
-{
- if (CheckGlobalFlag(INLOCK)) {
- LoadRoomEntityList(&gUnk_080F37D0);
- }
+void sub_0804E930(void) {
+ if (CheckGlobalFlag(INLOCK)) {
+ LoadRoomEntityList(&gUnk_080F37D0);
+ }
}
-u32 sub_0804E948 () {
+u32 sub_0804E948() {
return 1;
}
-void nullsub_380() {}
+void nullsub_380() {
+}
u32 sub_0804E950() {
return 1;
@@ -4875,61 +4866,57 @@ u32 sub_0804E950() {
extern EntityData gUnk_080F3A48;
-void sub_0804E954(void)
-{
- // flippers, history of masks
- if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START) && !GetInventoryValue(0x3b)) {
- LoadRoomEntityList(&gUnk_080F3A48);
- }
- gScreenTransition.field_0x20 = 0xf28;
- gScreenTransition.field_0x22 = 0x82d;
+void sub_0804E954(void) {
+ // flippers, history of masks
+ if (!GetInventoryValue(0x46) && CheckGlobalFlag(MIZUKAKI_START) && !GetInventoryValue(0x3b)) {
+ LoadRoomEntityList(&gUnk_080F3A48);
+ }
+ gScreenTransition.field_0x20 = 0xf28;
+ gScreenTransition.field_0x22 = 0x82d;
}
extern u32 gUnk_080F3D44;
extern u32 gUnk_080F3EA4;
-u32 sub_0804E998(void)
-{
- if (CheckGlobalFlag(LV4_CLEAR) && !CheckLocalFlag(4)) {
- gRoomVars.field_0x74 = &gUnk_080F3EA4;
- }
- else {
- gRoomVars.field_0x74 = &gUnk_080F3D44;
- }
- return 1;
+u32 sub_0804E998(void) {
+ if (CheckGlobalFlag(LV4_CLEAR) && !CheckLocalFlag(4)) {
+ gRoomVars.field_0x74 = &gUnk_080F3EA4;
+ } else {
+ gRoomVars.field_0x74 = &gUnk_080F3D44;
+ }
+ return 1;
}
extern EntityData gUnk_080F3C64;
extern EntityData gUnk_080F3C94;
extern EntityData gUnk_080F3C44;
-void sub_0804E9D0(void)
-{
- if (CheckGlobalFlag(LV4_CLEAR) && !CheckLocalFlag(4)) {
- LoadRoomEntityList(&gUnk_080F3C64);
- }
- if (CheckKinstoneFused(0x12)) {
- LoadRoomEntityList(&gUnk_080F3C94);
- }
- if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
- LoadRoomEntityList(&gUnk_080F3C44);
- }
- SetTile(0x4091, 0x590, 1);
- SetTile(0x4091, 0x591, 1);
- SetTile(0x4091, 0x592, 1);
- SetTile(0x4091, 0x593, 1);
- SetTile(0x4091, 0x594, 1);
- SetTile(0x4091, 0x5d0, 1);
- SetTile(0x4091, 0x610, 1);
- SetTile(0x4091, 0x650, 1);
- SetTile(0x4091, 0x5d4, 1);
- SetTile(0x4091, 0x614, 1);
- SetTile(0x4091, 0x654, 1);
- SetTile(0x4091, 0x690, 1);
- SetTile(0x4091, 0x691, 1);
- SetTile(0x4091, 0x692, 1);
- SetTile(0x4091, 0x693, 1);
- SetTile(0x4091, 0x694, 1);
+void sub_0804E9D0(void) {
+ if (CheckGlobalFlag(LV4_CLEAR) && !CheckLocalFlag(4)) {
+ LoadRoomEntityList(&gUnk_080F3C64);
+ }
+ if (CheckKinstoneFused(0x12)) {
+ LoadRoomEntityList(&gUnk_080F3C94);
+ }
+ if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
+ LoadRoomEntityList(&gUnk_080F3C44);
+ }
+ SetTile(0x4091, 0x590, 1);
+ SetTile(0x4091, 0x591, 1);
+ SetTile(0x4091, 0x592, 1);
+ SetTile(0x4091, 0x593, 1);
+ SetTile(0x4091, 0x594, 1);
+ SetTile(0x4091, 0x5d0, 1);
+ SetTile(0x4091, 0x610, 1);
+ SetTile(0x4091, 0x650, 1);
+ SetTile(0x4091, 0x5d4, 1);
+ SetTile(0x4091, 0x614, 1);
+ SetTile(0x4091, 0x654, 1);
+ SetTile(0x4091, 0x690, 1);
+ SetTile(0x4091, 0x691, 1);
+ SetTile(0x4091, 0x692, 1);
+ SetTile(0x4091, 0x693, 1);
+ SetTile(0x4091, 0x694, 1);
}
u32 sub_0804EB04() {
@@ -4943,107 +4930,115 @@ u32 sub_0804EB0C() {
return 1;
}
-void nullsub_382() {}
+void nullsub_382() {
+}
u32 sub_0804EB14() {
return 1;
}
-void nullsub_383() {}
+void nullsub_383() {
+}
u32 sub_0804EB1() {
return 1;
}
-void nullsub_384() {}
+void nullsub_384() {
+}
u32 sub_0804EB24() {
return 1;
}
-void nullsub_385() {}
+void nullsub_385() {
+}
u32 sub_0804EB2C() {
return 1;
}
-void nullsub_386() {}
+void nullsub_386() {
+}
u32 sub_0804EB34() {
return 1;
}
-void nullsub_387() {}
+void nullsub_387() {
+}
u32 sub_0804EB3C() {
return 1;
}
-void nullsub_388() {}
+void nullsub_388() {
+}
u32 sub_0804EB44() {
return 1;
}
-void nullsub_389() {}
+void nullsub_389() {
+}
u32 sub_0804EB4C() {
return 1;
}
-void nullsub_390() {}
+void nullsub_390() {
+}
-u32 sub_0804EB54(void)
-{
- gArea.areaMetadata |= 0x48;
- return 1;
+u32 sub_0804EB54(void) {
+ gArea.areaMetadata |= 0x48;
+ return 1;
}
-void nullsub_391() {}
+void nullsub_391() {
+}
-u32 sub_0804EB6C(void)
-{
- gArea.areaMetadata |= 0x48;
- return 1;
+u32 sub_0804EB6C(void) {
+ gArea.areaMetadata |= 0x48;
+ return 1;
}
-void nullsub_392() {}
+void nullsub_392() {
+}
-u32 sub_0804EB84(void)
-{
- gArea.areaMetadata |= 0x48;
- return 1;
+u32 sub_0804EB84(void) {
+ gArea.areaMetadata |= 0x48;
+ return 1;
}
-void nullsub_393() {}
+void nullsub_393() {
+}
-u32 sub_0804EB9C(void)
-{
- sub_0801DD58(0x58, 5);
- gArea.areaMetadata |= 0x48;
- return 1;
+u32 sub_0804EB9C(void) {
+ sub_0801DD58(0x58, 5);
+ gArea.areaMetadata |= 0x48;
+ return 1;
}
-void nullsub_394() {}
+void nullsub_394() {
+}
-u32 sub_0804EBBC(void)
-{
- sub_0801DD58(0x58, 6);
- gArea.areaMetadata |= 0x48;
- return 1;
+u32 sub_0804EBBC(void) {
+ sub_0801DD58(0x58, 6);
+ gArea.areaMetadata |= 0x48;
+ return 1;
}
-void nullsub_395() {}
+void nullsub_395() {
+}
extern u32 gUnk_080F4EB0;
-u32 sub_0804EBDC(void)
-{
- if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c = &gUnk_080F4EB0;
- gRoomVars.field_0x74 = NULL;
- }
- return 1;
+u32 sub_0804EBDC(void) {
+ if (CheckGlobalFlag(ENDING)) {
+ gRoomVars.field_0x6c = &gUnk_080F4EB0;
+ gRoomVars.field_0x74 = NULL;
+ }
+ return 1;
}
extern EntityData gUnk_080F4D50;
@@ -5053,87 +5048,81 @@ extern EntityData gUnk_080F4DF0;
extern EntityData gUnk_080F4F10;
extern EntityData gUnk_080F4E10;
-void sub_0804EC00(void)
-{
- if (CheckGlobalFlag(ENDING)) {
- gArea.pMusicIndex = gArea.musicIndex;
- }
- if (!CheckGlobalFlag(EZERO_1ST)) {
- LoadRoomEntityList(&gUnk_080F4D50);
- }
- if (!CheckLocalFlag(0x3e)) {
- if (!CheckLocalFlag(0x3b)) {
- LoadRoomEntityList(&gUnk_080F4DB0);
+void sub_0804EC00(void) {
+ if (CheckGlobalFlag(ENDING)) {
+ gArea.pMusicIndex = gArea.musicIndex;
}
- else {
- LoadRoomEntityList(&gUnk_080F4DD0);
+ if (!CheckGlobalFlag(EZERO_1ST)) {
+ LoadRoomEntityList(&gUnk_080F4D50);
+ }
+ if (!CheckLocalFlag(0x3e)) {
+ if (!CheckLocalFlag(0x3b)) {
+ LoadRoomEntityList(&gUnk_080F4DB0);
+ } else {
+ LoadRoomEntityList(&gUnk_080F4DD0);
+ }
+ LoadRoomEntityList(&gUnk_080F4DF0);
+ }
+ if (CheckKinstoneFused(0x4e)) {
+ LoadRoomEntityList(&gUnk_080F4F10);
+ }
+ if ((s32)gUnk_02002A40.windcrests > -1) {
+ LoadRoomEntityList(&gUnk_080F4E10);
}
- LoadRoomEntityList(&gUnk_080F4DF0);
- }
- if (CheckKinstoneFused(0x4e)) {
- LoadRoomEntityList(&gUnk_080F4F10);
- }
- if ((s32)gUnk_02002A40.windcrests > -1) {
- LoadRoomEntityList(&gUnk_080F4E10);
- }
}
extern EntityData gUnk_080F4E10;
-void sub_0804EC98(void)
-{
- if ((s32)gUnk_02002A40.windcrests > -1) {
- LoadRoomEntityList(&gUnk_080F4E10);
- }
+void sub_0804EC98(void) {
+ if ((s32)gUnk_02002A40.windcrests > -1) {
+ LoadRoomEntityList(&gUnk_080F4E10);
+ }
}
u32 sub_0804ECB4() {
return 1;
}
-void nullsub_396() {}
+void nullsub_396() {
+}
extern u32 gUnk_080F5348;
-u32 sub_0804ECBC(void)
-{
- if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c = &gUnk_080F5348;
- gRoomVars.field_0x88 = sub_0804ED18;
- gRoomVars.field_0x74 = NULL;
- }
- return 1;
+u32 sub_0804ECBC(void) {
+ if (CheckGlobalFlag(ENDING)) {
+ gRoomVars.field_0x6c = &gUnk_080F5348;
+ gRoomVars.field_0x88 = sub_0804ED18;
+ gRoomVars.field_0x74 = NULL;
+ }
+ return 1;
}
extern EntityData gUnk_080F5328;
extern EntityData gUnk_080F5308;
-void sub_0804ECEC(void)
-{
+void sub_0804ECEC(void) {
// white sword
- if (GetInventoryValue(0x2)) {
- LoadRoomEntityList(&gUnk_080F5328);
- if (!CheckLocalFlag(0x14)) {
- LoadRoomEntityList(&gUnk_080F5308);
+ if (GetInventoryValue(0x2)) {
+ LoadRoomEntityList(&gUnk_080F5328);
+ if (!CheckLocalFlag(0x14)) {
+ LoadRoomEntityList(&gUnk_080F5308);
+ }
}
- }
}
-void sub_0804ED18(void)
-{
- gArea.pMusicIndex = gArea.musicIndex;
+void sub_0804ED18(void) {
+ gArea.pMusicIndex = gArea.musicIndex;
}
u32 sub_0804ED30() {
return 1;
}
-void sub_0804ED34(void)
-{
- sub_080AF2E4();
- if (CheckGlobalFlag(SEIIKI_BGM)) {
- gArea.pMusicIndex = 0x31;
- }
+void sub_0804ED34(void) {
+ sub_080AF2E4();
+ if (CheckGlobalFlag(SEIIKI_BGM)) {
+ gArea.pMusicIndex = 0x31;
+ }
}
u32 sub_0804ED58() {
@@ -5149,48 +5138,42 @@ extern EntityData gUnk_080F5528;
extern EntityData gUnk_080F5578;
extern EntityData gUnk_080F55B8;
-void sub_0804ED5C(void)
-{
- if (!CheckLocalFlag(0x79)) {
- LoadRoomEntityList(&gUnk_080F54E8);
- }
- if (!CheckLocalFlag(0x7a)) {
- // white sword, white sword 2, earth element, fire element
- if (GetInventoryValue(0x2) && !GetInventoryValue(0x3) &&
- GetInventoryValue(0x40) && GetInventoryValue(0x41)) {
- LoadRoomEntityList(&gUnk_080F5508);
+void sub_0804ED5C(void) {
+ if (!CheckLocalFlag(0x79)) {
+ LoadRoomEntityList(&gUnk_080F54E8);
}
- }
- else {
- if (!CheckLocalFlag(0x7b)) {
- if (GetInventoryValue(0x3) && !GetInventoryValue(0x4) &&
- GetInventoryValue(0x42)) {
- LoadRoomEntityList(&gUnk_080F5558);
- }
- }
- else {
- if (!CheckLocalFlag(0x7c)) {
- if (!GetInventoryValue(0x6) && GetInventoryValue(0x43)) {
- LoadRoomEntityList(&gUnk_080F5598);
+ if (!CheckLocalFlag(0x7a)) {
+ // white sword, white sword 2, earth element, fire element
+ if (GetInventoryValue(0x2) && !GetInventoryValue(0x3) && GetInventoryValue(0x40) && GetInventoryValue(0x41)) {
+ LoadRoomEntityList(&gUnk_080F5508);
+ }
+ } else {
+ if (!CheckLocalFlag(0x7b)) {
+ if (GetInventoryValue(0x3) && !GetInventoryValue(0x4) && GetInventoryValue(0x42)) {
+ LoadRoomEntityList(&gUnk_080F5558);
+ }
+ } else {
+ if (!CheckLocalFlag(0x7c)) {
+ if (!GetInventoryValue(0x6) && GetInventoryValue(0x43)) {
+ LoadRoomEntityList(&gUnk_080F5598);
+ }
+ } else {
+ LoadRoomEntityList(&gUnk_080F55D8);
+ }
}
- }
- else {
- LoadRoomEntityList(&gUnk_080F55D8);
- }
}
- }
- if (CheckLocalFlag(0x7a)) {
- LoadRoomEntityList(&gUnk_080F5528);
- }
- if (CheckLocalFlag(0x7b)) {
- LoadRoomEntityList(&gUnk_080F5578);
- }
- if (CheckLocalFlag(0x7c)) {
- LoadRoomEntityList(&gUnk_080F55B8);
- }
- if (CheckGlobalFlag(SEIIKI_BGM)) {
- gArea.pMusicIndex = 0x31;
- }
+ if (CheckLocalFlag(0x7a)) {
+ LoadRoomEntityList(&gUnk_080F5528);
+ }
+ if (CheckLocalFlag(0x7b)) {
+ LoadRoomEntityList(&gUnk_080F5578);
+ }
+ if (CheckLocalFlag(0x7c)) {
+ LoadRoomEntityList(&gUnk_080F55B8);
+ }
+ if (CheckGlobalFlag(SEIIKI_BGM)) {
+ gArea.pMusicIndex = 0x31;
+ }
}
u32 sub_0804EE74() {
@@ -5199,14 +5182,13 @@ u32 sub_0804EE74() {
extern EntityData gUnk_080F5660;
-void sub_0804EE78(void)
-{
- if (!CheckLocalFlag(0x78) && CheckLocalFlag(0x7c)) {
- LoadRoomEntityList(&gUnk_080F5660);
- }
- if (CheckGlobalFlag(SEIIKI_BGM)) {
- gArea.pMusicIndex = 0x31;
- }
+void sub_0804EE78(void) {
+ if (!CheckLocalFlag(0x78) && CheckLocalFlag(0x7c)) {
+ LoadRoomEntityList(&gUnk_080F5660);
+ }
+ if (CheckGlobalFlag(SEIIKI_BGM)) {
+ gArea.pMusicIndex = 0x31;
+ }
}
u32 sub_0804EEB8() {
@@ -5226,47 +5208,44 @@ extern EntityData gUnk_080F5788;
extern u8 gBombBagSizes[];
-void sub_0804EEBC(void)
-{
- LoadRoomEntityList(&gUnk_080F5758);
- if (!GetInventoryValue(0x36) && CheckLocalFlagByOffset(0x200, 0x8f)) {
- LoadRoomEntityList(&gUnk_080F57E8);
- }
- if (!CheckLocalFlag(0x55)) {
- LoadRoomEntityList(&gUnk_080F57A8);
- }
- else {
- if (gBombBagSizes[gUnk_02002A40.stats.bombBagType] > 0x1d) {
- LoadRoomEntityList(&gUnk_080F57C8);
- }
- if (!GetInventoryValue(0xb) && !GetInventoryValue(0xc)) {
- LoadRoomEntityList(&gUnk_080F5888);
+void sub_0804EEBC(void) {
+ LoadRoomEntityList(&gUnk_080F5758);
+ if (!GetInventoryValue(0x36) && CheckLocalFlagByOffset(0x200, 0x8f)) {
+ LoadRoomEntityList(&gUnk_080F57E8);
}
- else {
- if (!CheckLocalFlag(0xcd)) {
- LoadRoomEntityList(&gUnk_080F58A8);
- }
+ if (!CheckLocalFlag(0x55)) {
+ LoadRoomEntityList(&gUnk_080F57A8);
+ } else {
+ if (gBombBagSizes[gUnk_02002A40.stats.bombBagType] > 0x1d) {
+ LoadRoomEntityList(&gUnk_080F57C8);
+ }
+ if (!GetInventoryValue(0xb) && !GetInventoryValue(0xc)) {
+ LoadRoomEntityList(&gUnk_080F5888);
+ } else {
+ if (!CheckLocalFlag(0xcd)) {
+ LoadRoomEntityList(&gUnk_080F58A8);
+ }
+ }
}
- }
- if (GetInventoryValue(0x9) || CheckGlobalFlag(LV3_CLEAR)) {
- LoadRoomEntityList(&gUnk_080F5868);
- if (!CheckLocalFlag(0x56)) {
- LoadRoomEntityList(&gUnk_080F5828);
+ if (GetInventoryValue(0x9) || CheckGlobalFlag(LV3_CLEAR)) {
+ LoadRoomEntityList(&gUnk_080F5868);
+ if (!CheckLocalFlag(0x56)) {
+ LoadRoomEntityList(&gUnk_080F5828);
+ } else {
+ LoadRoomEntityList(&gUnk_080F5848);
+ }
}
- else {
- LoadRoomEntityList(&gUnk_080F5848);
+ if (gUnk_02002A40.stats.filler2[5] == 0) {
+ LoadRoomEntityList(&gUnk_080F5788);
}
- }
- if (gUnk_02002A40.stats.filler2[5] == 0) {
- LoadRoomEntityList(&gUnk_080F5788);
- }
}
u32 sub_0804EFB0() {
return 1;
}
-void nullsub_397() {}
+void nullsub_397() {
+}
u32 sub_0804EFB8() {
return 1;
@@ -5274,37 +5253,35 @@ u32 sub_0804EFB8() {
extern EntityData gUnk_080F5B3C;
-void sub_0804EFBC(void)
-{
- if (GetInventoryValue(0x38) == 1) {
- LoadRoomEntityList(&gUnk_080F5B3C);
- }
+void sub_0804EFBC(void) {
+ if (GetInventoryValue(0x38) == 1) {
+ LoadRoomEntityList(&gUnk_080F5B3C);
+ }
}
u32 sub_0804EFD4() {
return 1;
}
-void nullsub_398() {}
+void nullsub_398() {
+}
-u32 sub_0804EFDC(void)
-{
- if (CheckGlobalFlag(MAROYA_WAKEUP)) {
- gScreenTransition.field_0xf = 5;
- }
- return 1;
+u32 sub_0804EFDC(void) {
+ if (CheckGlobalFlag(MAROYA_WAKEUP)) {
+ gScreenTransition.field_0xf = 5;
+ }
+ return 1;
}
extern EntityData gUnk_080F5DD0;
extern u32 gUnk_08011C50;
-void sub_0804EFF8(void)
-{
- if (gUnk_02002A40.unk8 > 7) {
- LoadRoomEntityList(&gUnk_080F5DD0);
- }
- if (CheckGlobalFlag(MAROYA_WAKEUP)) {
- sub_080751E8(1, 2, &gUnk_08011C50);
- }
+void sub_0804EFF8(void) {
+ if (gUnk_02002A40.unk8 > 7) {
+ LoadRoomEntityList(&gUnk_080F5DD0);
+ }
+ if (CheckGlobalFlag(MAROYA_WAKEUP)) {
+ sub_080751E8(1, 2, &gUnk_08011C50);
+ }
}
u32 sub_0804F02C() {
@@ -5313,11 +5290,10 @@ u32 sub_0804F02C() {
extern EntityData gUnk_080F5E68;
-void sub_0804F030(void)
-{
- if (!CheckLocalFlagByOffset(0x100, 0xd1)) {
- LoadRoomEntityList(&gUnk_080F5E68);
- }
+void sub_0804F030(void) {
+ if (!CheckLocalFlagByOffset(0x100, 0xd1)) {
+ LoadRoomEntityList(&gUnk_080F5E68);
+ }
}
u32 sub_0804F04C() {
@@ -5328,55 +5304,53 @@ extern EntityData gUnk_080F5F38;
extern EntityData gUnk_080F5F58;
extern EntityData gUnk_080F5F78;
-void sub_0804F050(void)
-{
-
- if (gUnk_02002A40.unk8 > 4) {
- LoadRoomEntityList(&gUnk_080F5F38);
- }
- if (!CheckLocalFlag(0x92)) {
- LoadRoomEntityList(&gUnk_080F5F58);
- }
- else {
- LoadRoomEntityList(&gUnk_080F5F78);
- }
+void sub_0804F050(void) {
+
+ if (gUnk_02002A40.unk8 > 4) {
+ LoadRoomEntityList(&gUnk_080F5F38);
+ }
+ if (!CheckLocalFlag(0x92)) {
+ LoadRoomEntityList(&gUnk_080F5F58);
+ } else {
+ LoadRoomEntityList(&gUnk_080F5F78);
+ }
}
u32 sub_0804F08C() {
return 1;
}
-void nullsub_399() {}
+void nullsub_399() {
+}
u32 sub_0804F094() {
return 1;
}
-void nullsub_400() {}
+void nullsub_400() {
+}
-u32 sub_0804F09C(void)
-{
- if (CheckGlobalFlag(KUMOTATSUMAKI) && CheckLocalFlagByOffset(0x100, 0xdc)) {
- SetGlobalFlag(WARP_EVENT_END);
- }
- return 1;
+u32 sub_0804F09C(void) {
+ if (CheckGlobalFlag(KUMOTATSUMAKI) && CheckLocalFlagByOffset(0x100, 0xdc)) {
+ SetGlobalFlag(WARP_EVENT_END);
+ }
+ return 1;
}
extern EntityData gUnk_080F61BC;
-void sub_0804F0C0(void)
-{
- if (CheckLocalFlagByOffset(0x100, 0xdc)) {
- SetLocalFlag(0x90);
- }
- if (CheckKinstoneFused(0xf)) {
- LoadRoomEntityList(&gUnk_080F61BC);
- }
- if (!CheckGlobalFlag(WARP_EVENT_END)) {
- SetTileType(0x4072, 0x4c7, 1);
- SetTileType(0x4072, 0x507, 1);
- }
- sub_08052CA4(8, 0, 0x1e8, 0x158);
+void sub_0804F0C0(void) {
+ if (CheckLocalFlagByOffset(0x100, 0xdc)) {
+ SetLocalFlag(0x90);
+ }
+ if (CheckKinstoneFused(0xf)) {
+ LoadRoomEntityList(&gUnk_080F61BC);
+ }
+ if (!CheckGlobalFlag(WARP_EVENT_END)) {
+ SetTileType(0x4072, 0x4c7, 1);
+ SetTileType(0x4072, 0x507, 1);
+ }
+ sub_08052CA4(8, 0, 0x1e8, 0x158);
}
u32 sub_0804F128() {
@@ -5386,23 +5360,22 @@ u32 sub_0804F128() {
extern EntityData gUnk_080F62E4;
extern EntityData gUnk_080F6324;
-void sub_0804F12C(void)
-{
- if (!CheckGlobalFlag(WARP_EVENT_END)) {
- LoadRoomEntityList(&gUnk_080F62E4);
- }
- else {
- if (CheckLocalFlag(99)) {
- LoadRoomEntityList(&gUnk_080F6324);
+void sub_0804F12C(void) {
+ if (!CheckGlobalFlag(WARP_EVENT_END)) {
+ LoadRoomEntityList(&gUnk_080F62E4);
+ } else {
+ if (CheckLocalFlag(99)) {
+ LoadRoomEntityList(&gUnk_080F6324);
+ }
}
- }
}
u32 sub_0804F15C() {
return 1;
}
-void nullsub_401() {}
+void nullsub_401() {
+}
u32 sub_0804F164() {
return 1;
@@ -5411,15 +5384,13 @@ u32 sub_0804F164() {
extern EntityData gUnk_080F6564;
extern EntityData gUnk_080F6584;
-void sub_0804F168(void)
-{
+void sub_0804F168(void) {
- if (!CheckLocalFlag(0xb1)) {
- LoadRoomEntityList(&gUnk_080F6564);
- }
- else {
- LoadRoomEntityList(&gUnk_080F6584);
- }
+ if (!CheckLocalFlag(0xb1)) {
+ LoadRoomEntityList(&gUnk_080F6564);
+ } else {
+ LoadRoomEntityList(&gUnk_080F6584);
+ }
}
u32 sub_0804F18C() {
@@ -5428,75 +5399,84 @@ u32 sub_0804F18C() {
extern EntityData gUnk_080F66AC;
-void sub_0804F190(void)
-{
- sub_0805B4D0(5);
- if (CheckGlobalFlag(LV5_CLEAR) && !CheckLocalFlagByOffset(0x100, 5)) {
- LoadRoomEntityList(&gUnk_080F66AC);
- }
- sub_08052CA4(8, 0, 0x1e8, 0x158);
- gArea.areaMetadata |= 0x80;
+void sub_0804F190(void) {
+ sub_0805B4D0(5);
+ if (CheckGlobalFlag(LV5_CLEAR) && !CheckLocalFlagByOffset(0x100, 5)) {
+ LoadRoomEntityList(&gUnk_080F66AC);
+ }
+ sub_08052CA4(8, 0, 0x1e8, 0x158);
+ gArea.areaMetadata |= 0x80;
}
u32 sub_0804F1DC() {
return 1;
}
-void nullsub_402() {}
+void nullsub_402() {
+}
u32 sub_0804F1E4() {
return 1;
}
-void nullsub_403() {}
+void nullsub_403() {
+}
u32 sub_0804F1EC() {
return 1;
}
-void nullsub_404() {}
+void nullsub_404() {
+}
u32 sub_0804F1F4() {
return 1;
}
-void nullsub_405() {}
+void nullsub_405() {
+}
u32 sub_0804F1FC() {
return 1;
}
-void nullsub_406() {}
+void nullsub_406() {
+}
u32 sub_0804F204() {
return 1;
}
-void nullsub_407() {}
+void nullsub_407() {
+}
u32 sub_0804F20C() {
return 1;
}
-void nullsub_408() {}
+void nullsub_408() {
+}
u32 sub_0804F214() {
return 1;
}
-void nullsub_409() {}
+void nullsub_409() {
+}
u32 sub_0804F21C() {
return 1;
}
-void nullsub_410() {}
+void nullsub_410() {
+}
u32 sub_0804F224() {
return 1;
}
-void nullsub_411() {}
+void nullsub_411() {
+}
u32 sub_0804F22C() {
return 1;
@@ -5506,44 +5486,41 @@ void sub_0804F230() {
sub_0805ADD8(0);
}
-u32 sub_0804F23C(void)
-{
- if (!CheckLocalFlag(0x6d)) {
- DoFade(7, 0x100);
- }
- SetGlobalFlag(OUTDOOR);
- return 1;
+u32 sub_0804F23C(void) {
+ if (!CheckLocalFlag(0x6d)) {
+ DoFade(7, 0x100);
+ }
+ SetGlobalFlag(OUTDOOR);
+ return 1;
}
extern EntityData gUnk_080F70A8;
extern EntityData gUnk_080F70D8;
extern EntityData gUnk_080F7088;
-void sub_0804F25C(void)
-{
- sub_0805ADD8(0);
- if (!CheckLocalFlag(0x6d)) {
- LoadRoomEntityList(&gUnk_080F70A8);
- ClearGlobalFlag(ZELDA_CHASE);
- }
- if (!CheckGlobalFlag(TABIDACHI)) {
- gArea.pMusicIndex = 0x10;
- }
- if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
- LoadRoomEntityList(&gUnk_080F70D8);
- }
- if (gUnk_02002A40.unk8 > 3) {
- LoadRoomEntityList(&gUnk_080F7088);
- }
+void sub_0804F25C(void) {
+ sub_0805ADD8(0);
+ if (!CheckLocalFlag(0x6d)) {
+ LoadRoomEntityList(&gUnk_080F70A8);
+ ClearGlobalFlag(ZELDA_CHASE);
+ }
+ if (!CheckGlobalFlag(TABIDACHI)) {
+ gArea.pMusicIndex = 0x10;
+ }
+ if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
+ LoadRoomEntityList(&gUnk_080F70D8);
+ }
+ if (gUnk_02002A40.unk8 > 3) {
+ LoadRoomEntityList(&gUnk_080F7088);
+ }
}
extern EntityData gUnk_080F70D8;
-void sub_0804F2C8(void)
-{
- if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
- LoadRoomEntityList(&gUnk_080F70D8);
- }
+void sub_0804F2C8(void) {
+ if ((gUnk_02002A40.windcrests & 0x40000000) == 0) {
+ LoadRoomEntityList(&gUnk_080F70D8);
+ }
}
u32 sub_0804F2E8() {
@@ -5564,30 +5541,28 @@ void sub_0804F2FC() {
extern u32 gUnk_080F7680;
-u32 sub_0804f308(void)
-{
- if (GetInventoryValue(0x11) && !GetInventoryValue(0x12)) {
- gRoomVars.field_0x74 = &gUnk_080F7680;
- }
- return 1;
+u32 sub_0804f308(void) {
+ if (GetInventoryValue(0x11) && !GetInventoryValue(0x12)) {
+ gRoomVars.field_0x74 = &gUnk_080F7680;
+ }
+ return 1;
}
extern EntityData gUnk_080F7500;
extern EntityData gUnk_080F7550;
-void sub_0804F330(void)
-{
- sub_0805ADD8(0);
- if (gUnk_02002A40.unk8 > 3) {
- LoadRoomEntityList(&gUnk_080F7500);
- }
- if (GetInventoryValue(0x11) && !GetInventoryValue(0x12)) {
- LoadRoomEntityList(&gUnk_080F7550);
- SetTileType(0x4072, 0x311, 1);
- SetTileType(0x4072, 0x351, 1);
- SetTileType(0x4072, 0x3d9, 1);
- SetTileType(0x4072, 0x419, 1);
- }
+void sub_0804F330(void) {
+ sub_0805ADD8(0);
+ if (gUnk_02002A40.unk8 > 3) {
+ LoadRoomEntityList(&gUnk_080F7500);
+ }
+ if (GetInventoryValue(0x11) && !GetInventoryValue(0x12)) {
+ LoadRoomEntityList(&gUnk_080F7550);
+ SetTileType(0x4072, 0x311, 1);
+ SetTileType(0x4072, 0x351, 1);
+ SetTileType(0x4072, 0x3d9, 1);
+ SetTileType(0x4072, 0x419, 1);
+ }
}
u32 sub_0804F3AC() {
@@ -5600,29 +5575,27 @@ extern EntityData gUnk_080F7810;
extern EntityData gUnk_080F7860;
extern EntityData gUnk_080F78A0;
-void sub_0804F3B0(void)
-{
+void sub_0804F3B0(void) {
- sub_0805ADD8(0);
- if (CheckLocalFlagByOffset(0x200, 0x8f)) {
- if (!CheckGlobalFlag(INLOCK)) {
- LoadRoomEntityList(&gUnk_080F77C0);
+ sub_0805ADD8(0);
+ if (CheckLocalFlagByOffset(0x200, 0x8f)) {
+ if (!CheckGlobalFlag(INLOCK)) {
+ LoadRoomEntityList(&gUnk_080F77C0);
+ }
+ } else if (GetInventoryValue(0x40)) {
+ LoadRoomEntityList(&gUnk_080F77F0);
}
- }
- else if (GetInventoryValue(0x40)) {
- LoadRoomEntityList(&gUnk_080F77F0);
+ if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(0x40)) {
+ LoadRoomEntityList(&gUnk_080F7810);
+ }
+ if (!CheckKinstoneFused(0x29)) {
+ LoadRoomEntityList(&gUnk_080F7860);
+ SetTile(0x4072, 0xd88, 1);
+ SetTile(0x4096, 0xdc8, 1);
+ }
+ if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
+ LoadRoomEntityList(&gUnk_080F78A0);
}
- if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(0x40)) {
- LoadRoomEntityList(&gUnk_080F7810);
- }
- if (!CheckKinstoneFused(0x29)) {
- LoadRoomEntityList(&gUnk_080F7860);
- SetTile(0x4072, 0xd88, 1);
- SetTile(0x4096, 0xdc8, 1);
- }
- if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
- LoadRoomEntityList(&gUnk_080F78A0);
- }
}
extern u32 gUnk_080F7CD0;
@@ -5630,21 +5603,20 @@ extern void sub_0804F5E8();
extern u32 gUnk_080F7C80;
extern void sub_0804F4E4();
-u32 sub_0804F468(void)
-{
- if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(0x11)) {
- gRoomVars.field_0x6c = &gUnk_080F7CD0;
- gRoomVars.field_0x88 = sub_0804F5E8;
- }
- if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) && !CheckLocalFlag(0x8c)) {
- gRoomVars.field_0x6c = &gUnk_080F7C80;
- gRoomVars.field_0x88 = sub_0804F4E4;
- gRoomVars.field_0x74 = NULL;
- }
- if (CheckGlobalFlag(TABIDACHI)) {
- ClearGlobalFlag(CASTLE_BGM);
- }
- return 1;
+u32 sub_0804F468(void) {
+ if (CheckGlobalFlag(TABIDACHI) && !GetInventoryValue(0x11)) {
+ gRoomVars.field_0x6c = &gUnk_080F7CD0;
+ gRoomVars.field_0x88 = sub_0804F5E8;
+ }
+ if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) && !CheckLocalFlag(0x8c)) {
+ gRoomVars.field_0x6c = &gUnk_080F7C80;
+ gRoomVars.field_0x88 = sub_0804F4E4;
+ gRoomVars.field_0x74 = NULL;
+ }
+ if (CheckGlobalFlag(TABIDACHI)) {
+ ClearGlobalFlag(CASTLE_BGM);
+ }
+ return 1;
}
void sub_0804F4E4() {
@@ -5654,188 +5626,167 @@ void sub_0804F4E4() {
extern EntityData gUnk_080F7D70;
-void sub_0804F4F4(void)
-{
- sub_0804F4E4();
- if (!CheckLocalFlag(0x8b)) {
- LoadRoomEntityList(&gUnk_080F7D70);
- SetTileType(0x174, 0x7a2, 1);
- SetTileType(0x174, 0x7a3, 1);
- SetTileType(0x174, 0x7a5, 1);
- SetTileType(0x174, 0x7a6, 1);
- SetTileType(0x174, 0x7a7, 1);
- }
- if (!CheckGlobalFlag(TABIDACHI)) {
- gArea.pMusicIndex = 0x13;
- }
+void sub_0804F4F4(void) {
+ sub_0804F4E4();
+ if (!CheckLocalFlag(0x8b)) {
+ LoadRoomEntityList(&gUnk_080F7D70);
+ SetTileType(0x174, 0x7a2, 1);
+ SetTileType(0x174, 0x7a3, 1);
+ SetTileType(0x174, 0x7a5, 1);
+ SetTileType(0x174, 0x7a6, 1);
+ SetTileType(0x174, 0x7a7, 1);
+ }
+ if (!CheckGlobalFlag(TABIDACHI)) {
+ gArea.pMusicIndex = 0x13;
+ }
}
extern EntityData gUnk_080F7DC0;
-void sub_0804F578(void)
-{
- if (!CheckLocalFlag(0x8e)) {
- LoadRoomEntityList(&gUnk_080F7DC0);
- }
- else {
- SetTileType(0x37,0x94a,1);
- SetTileType(0x37,0x94b,1);
- SetTileType(0x37,0x94c,1);
- SetTileType(0x37,0x98a,1);
- SetTileType(0x37,0x98b,1);
- SetTileType(0x37,0x98c,1);
- }
+void sub_0804F578(void) {
+ if (!CheckLocalFlag(0x8e)) {
+ LoadRoomEntityList(&gUnk_080F7DC0);
+ } else {
+ SetTileType(0x37, 0x94a, 1);
+ SetTileType(0x37, 0x94b, 1);
+ SetTileType(0x37, 0x94c, 1);
+ SetTileType(0x37, 0x98a, 1);
+ SetTileType(0x37, 0x98b, 1);
+ SetTileType(0x37, 0x98c, 1);
+ }
}
-void sub_0804F5E8(void)
-{
- sub_0804F4E4();
- SetTileType(0x1d3,0xbde,1);
- SetTileType(0x1d6,0xbe2,1);
- SetTileType(0x1d4,0xc1f,1);
- SetTileType(0x1d5,0xc20,1);
- SetTileType(0x1d6,0xc5e,1);
- SetTileType(0x4072,0xb9b,1);
- SetTileType(0x4072,0xbdb,1);
- SetTileType(0x4072,0xaa4,1);
- SetTileType(0x4072,0xae4,1);
-}
-
-void sub_0804F680(Entity *parent, s32 x, s32 y)
-{
- Entity *fx;
-
- fx = CreateFx(parent,2,0);
- if (fx != NULL) {
- fx->x.HALF.HI = gRoomControls.roomOriginX + x;
- fx->y.HALF.HI = gRoomControls.roomOriginY + y;
- }
+void sub_0804F5E8(void) {
+ sub_0804F4E4();
+ SetTileType(0x1d3, 0xbde, 1);
+ SetTileType(0x1d6, 0xbe2, 1);
+ SetTileType(0x1d4, 0xc1f, 1);
+ SetTileType(0x1d5, 0xc20, 1);
+ SetTileType(0x1d6, 0xc5e, 1);
+ SetTileType(0x4072, 0xb9b, 1);
+ SetTileType(0x4072, 0xbdb, 1);
+ SetTileType(0x4072, 0xaa4, 1);
+ SetTileType(0x4072, 0xae4, 1);
}
-void sub_0804F6A8(Entity* arg0)
-{
- sub_0804F680(arg0, 0x1d8, 0x108);
- sub_0804F680(arg0, 0x218, 0x188);
+void sub_0804F680(Entity* parent, s32 x, s32 y) {
+ Entity* fx;
+
+ fx = CreateFx(parent, 2, 0);
+ if (fx != NULL) {
+ fx->x.HALF.HI = gRoomControls.roomOriginX + x;
+ fx->y.HALF.HI = gRoomControls.roomOriginY + y;
+ }
}
-void sub_0804F6C8(Entity* arg0)
-{
- sub_0804F680(arg0, 0x1e8, 0x108);
- sub_0804F680(arg0, 0x208, 0x188);
+void sub_0804F6A8(Entity* arg0) {
+ sub_0804F680(arg0, 0x1d8, 0x108);
+ sub_0804F680(arg0, 0x218, 0x188);
}
-void sub_0804F6E8(Entity *arg0)
-{
- sub_0804F680(arg0, 0x1f8, 0x108);
- sub_0804F680(arg0, 0x258, 0x138);
- sub_0804F680(arg0, 0x1f8, 0x188);
- sub_0804F680(arg0, 0x198, 0x158);
+void sub_0804F6C8(Entity* arg0) {
+ sub_0804F680(arg0, 0x1e8, 0x108);
+ sub_0804F680(arg0, 0x208, 0x188);
}
-void sub_0804F724(Entity *arg0)
-{
- sub_0804F680(arg0, 0x208, 0x108);
- sub_0804F680(arg0, 0x258, 0x148);
- sub_0804F680(arg0, 0x1e8, 0x188);
- sub_0804F680(arg0, 0x198, 0x148);
+void sub_0804F6E8(Entity* arg0) {
+ sub_0804F680(arg0, 0x1f8, 0x108);
+ sub_0804F680(arg0, 0x258, 0x138);
+ sub_0804F680(arg0, 0x1f8, 0x188);
+ sub_0804F680(arg0, 0x198, 0x158);
}
-void sub_0804F760(Entity *arg0)
-{
- sub_0804F680(arg0, 0x218, 0x108);
- sub_0804F680(arg0, 0x258, 0x158);
- sub_0804F680(arg0, 0x1d8, 0x188);
- sub_0804F680(arg0, 0x198, 0x138);
+void sub_0804F724(Entity* arg0) {
+ sub_0804F680(arg0, 0x208, 0x108);
+ sub_0804F680(arg0, 0x258, 0x148);
+ sub_0804F680(arg0, 0x1e8, 0x188);
+ sub_0804F680(arg0, 0x198, 0x148);
}
-void sub_0804F79C(Entity *parent)
-{
- Entity *fx;
-
- fx = CreateFx(parent, 0x35, 0);
- if (fx != NULL) {
- fx->spriteRendering.b3 = 0;
- fx->x.HALF.HI = gRoomControls.roomOriginX + 0x1b8;
- fx->y.HALF.HI = gRoomControls.roomOriginY + 0x148;
- }
- fx = CreateFx(parent, 0x35, 0);
- if (fx != NULL) {
- fx->spriteRendering.b3 = 0;
- fx->x.HALF.HI = gRoomControls.roomOriginX + 0x238;
- fx->y.HALF.HI = gRoomControls.roomOriginY + 0x148;
- }
+void sub_0804F760(Entity* arg0) {
+ sub_0804F680(arg0, 0x218, 0x108);
+ sub_0804F680(arg0, 0x258, 0x158);
+ sub_0804F680(arg0, 0x1d8, 0x188);
+ sub_0804F680(arg0, 0x198, 0x138);
}
-void sub_0804F808(void)
-{
- SetTileType(0x1d3, 0x41d, 1);
- SetTileType(0x1d3, 0x621, 1);
+void sub_0804F79C(Entity* parent) {
+ Entity* fx;
+
+ fx = CreateFx(parent, 0x35, 0);
+ if (fx != NULL) {
+ fx->spriteRendering.b3 = 0;
+ fx->x.HALF.HI = gRoomControls.roomOriginX + 0x1b8;
+ fx->y.HALF.HI = gRoomControls.roomOriginY + 0x148;
+ }
+ fx = CreateFx(parent, 0x35, 0);
+ if (fx != NULL) {
+ fx->spriteRendering.b3 = 0;
+ fx->x.HALF.HI = gRoomControls.roomOriginX + 0x238;
+ fx->y.HALF.HI = gRoomControls.roomOriginY + 0x148;
+ }
}
-void sub_0804F830(void)
-{
- SetTileType(0x1d4, 0x41e, 1);
- SetTileType(0x1d4, 0x620, 1);
+void sub_0804F808(void) {
+ SetTileType(0x1d3, 0x41d, 1);
+ SetTileType(0x1d3, 0x621, 1);
}
-void sub_0804F854(void)
-{
- SetTileType(0x1d5, 0x41f, 1);
- SetTileType(0x1d4, 0x4e5, 1);
- SetTileType(0x1d5, 0x61f, 1);
- SetTileType(0x1d4, 0x559, 1);
+void sub_0804F830(void) {
+ SetTileType(0x1d4, 0x41e, 1);
+ SetTileType(0x1d4, 0x620, 1);
}
-void sub_0804F89C(void)
-{
- SetTileType(0x1d6, 0x420, 1);
- SetTileType(0x1d5, 0x525, 1);
- SetTileType(0x1d6, 0x61e, 1);
- SetTileType(0x1d5, 0x519, 1);
+void sub_0804F854(void) {
+ SetTileType(0x1d5, 0x41f, 1);
+ SetTileType(0x1d4, 0x4e5, 1);
+ SetTileType(0x1d5, 0x61f, 1);
+ SetTileType(0x1d4, 0x559, 1);
}
-void sub_0804F8E0(void)
-{
- SetTileType(0x1d3, 0x421, 1);
- SetTileType(0x1d6, 0x565, 1);
- SetTileType(0x1d3, 0x61d, 1);
- SetTileType(0x1d6, 0x4d9, 1);
+void sub_0804F89C(void) {
+ SetTileType(0x1d6, 0x420, 1);
+ SetTileType(0x1d5, 0x525, 1);
+ SetTileType(0x1d6, 0x61e, 1);
+ SetTileType(0x1d5, 0x519, 1);
}
-void sub_0804F928(void)
-{
- sub_0807BA8C(0x41d, 1);
- sub_0807BA8C(0x621, 1);
+void sub_0804F8E0(void) {
+ SetTileType(0x1d3, 0x421, 1);
+ SetTileType(0x1d6, 0x565, 1);
+ SetTileType(0x1d3, 0x61d, 1);
+ SetTileType(0x1d6, 0x4d9, 1);
}
-void sub_0804F944(void)
-{
- sub_0807BA8C(0x41e, 1);
- sub_0807BA8C(0x620, 1);
+void sub_0804F928(void) {
+ sub_0807BA8C(0x41d, 1);
+ sub_0807BA8C(0x621, 1);
}
-void sub_0804F960(void)
-{
- sub_0807BA8C(0x41f, 1);
- sub_0807BA8C(0x4e5, 1);
- sub_0807BA8C(0x61f, 1);
- sub_0807BA8C(0x559, 1);
+void sub_0804F944(void) {
+ sub_0807BA8C(0x41e, 1);
+ sub_0807BA8C(0x620, 1);
}
-void sub_0804F994(void)
-{
- sub_0807BA8C(0x420, 1);
- sub_0807BA8C(0x525, 1);
- sub_0807BA8C(0x61e, 1);
- sub_0807BA8C(0x519, 1);
+void sub_0804F960(void) {
+ sub_0807BA8C(0x41f, 1);
+ sub_0807BA8C(0x4e5, 1);
+ sub_0807BA8C(0x61f, 1);
+ sub_0807BA8C(0x559, 1);
}
-void sub_0804F9C8(void)
-{
- sub_0807BA8C(0x421, 1);
- sub_0807BA8C(0x565, 1);
- sub_0807BA8C(0x61d, 1);
- sub_0807BA8C(0x4d9, 1);
+void sub_0804F994(void) {
+ sub_0807BA8C(0x420, 1);
+ sub_0807BA8C(0x525, 1);
+ sub_0807BA8C(0x61e, 1);
+ sub_0807BA8C(0x519, 1);
+}
+
+void sub_0804F9C8(void) {
+ sub_0807BA8C(0x421, 1);
+ sub_0807BA8C(0x565, 1);
+ sub_0807BA8C(0x61d, 1);
+ sub_0807BA8C(0x4d9, 1);
}
u32 sub_0804F9FC() {
@@ -5845,11 +5796,11 @@ u32 sub_0804F9FC() {
extern EntityData gUnk_080F806C;
void sub_0804FA00(void) {
-
- sub_0805ADD8(0);
- if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
- LoadRoomEntityList(&gUnk_080F806C);
- }
+
+ sub_0805ADD8(0);
+ if ((gUnk_02002A40.unk8 > 3) && CheckGlobalFlag(TINGLE_TALK1ST)) {
+ LoadRoomEntityList(&gUnk_080F806C);
+ }
}
u32 sub_0804FA2C() {
@@ -5858,14 +5809,12 @@ u32 sub_0804FA2C() {
extern EntityData gUnk_080F82E0;
-void sub_0804FA30(void)
-{
-
- sub_0805ADD8(0);
- if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) &&
- !CheckLocalFlag(0x9c)) {
- LoadRoomEntityList(&gUnk_080F82E0);
- }
+void sub_0804FA30(void) {
+
+ sub_0805ADD8(0);
+ if (CheckGlobalFlag(LV2_CLEAR) && GetInventoryValue(0x3) && !CheckLocalFlag(0x9c)) {
+ LoadRoomEntityList(&gUnk_080F82E0);
+ }
}
u32 sub_0804FA64() {
@@ -5874,13 +5823,12 @@ u32 sub_0804FA64() {
extern EntityData gUnk_080F8430;
-void sub_0804FA68(void)
-{
-
- sub_0805ADD8(0);
- if (CheckKinstoneFused(0x21) && !CheckLocalFlagByOffset(0x200, 0x42)) {
- LoadRoomEntityList(&gUnk_080F8430);
- }
+void sub_0804FA68(void) {
+
+ sub_0805ADD8(0);
+ if (CheckKinstoneFused(0x21) && !CheckLocalFlagByOffset(0x200, 0x42)) {
+ LoadRoomEntityList(&gUnk_080F8430);
+ }
}
u32 sub_0804FA94() {
@@ -5890,166 +5838,185 @@ u32 sub_0804FA94() {
extern EntityData gUnk_080F85F8;
extern EntityData gUnk_080F85D8;
-void sub_0804FA98(void)
-{
+void sub_0804FA98(void) {
- if (CheckGlobalFlag(SOUGEN_06_HASHIGO)) {
- LoadRoomEntityList(&gUnk_080F85D8);
- }
- else {
- LoadRoomEntityList(&gUnk_080F85F8);
- }
- if (!GetInventoryValue(0xc)) {
- ClearLocalFlag(8);
- }
+ if (CheckGlobalFlag(SOUGEN_06_HASHIGO)) {
+ LoadRoomEntityList(&gUnk_080F85D8);
+ } else {
+ LoadRoomEntityList(&gUnk_080F85F8);
+ }
+ if (!GetInventoryValue(0xc)) {
+ ClearLocalFlag(8);
+ }
}
u32 sub_0804FACC() {
return 1;
}
-void nullsub_412() {}
+void nullsub_412() {
+}
u32 sub_0804FAD4() {
return 1;
}
-void nullsub_413() {}
+void nullsub_413() {
+}
u32 sub_0804FADC() {
return 1;
}
-void nullsub_414() {}
+void nullsub_414() {
+}
u32 sub_0804FAE4() {
return 1;
}
-void nullsub_415() {}
+void nullsub_415() {
+}
u32 sub_0804FAEC() {
return 1;
}
-void nullsub_416() {}
+void nullsub_416() {
+}
u32 sub_0804FAF4() {
return 1;
}
-void nullsub_417() {}
+void nullsub_417() {
+}
u32 sub_0804FAFC() {
return 1;
}
-void nullsub_418() {}
+void nullsub_418() {
+}
u32 sub_0804FB04() {
return 1;
}
-void nullsub_419() {}
+void nullsub_419() {
+}
u32 sub_0804FB0C() {
return 1;
}
-void nullsub_420() {}
+void nullsub_420() {
+}
u32 sub_0804FB14() {
return 1;
}
-void nullsub_421() {}
+void nullsub_421() {
+}
u32 sub_0804FB1C() {
return 1;
}
-void nullsub_422() {}
+void nullsub_422() {
+}
u32 sub_0804FB249() {
return 1;
}
-void nullsub_423() {}
+void nullsub_423() {
+}
u32 sub_0804FB2C() {
return 1;
}
-void sub_0804FB30(void)
-{
- if (CheckLocalFlag(0x11)) {
- SetRoomFlag(0);
- SetRoomFlag(1);
- sub_0805308C(0x100);
- if (!CheckLocalFlag(0x12)) {
- SetTileType(0x73,0xcb,1);
+void sub_0804FB30(void) {
+ if (CheckLocalFlag(0x11)) {
+ SetRoomFlag(0);
+ SetRoomFlag(1);
+ sub_0805308C(0x100);
+ if (!CheckLocalFlag(0x12)) {
+ SetTileType(0x73, 0xcb, 1);
+ }
}
- }
}
u32 sub_0804FB68() {
return 1;
}
-void nullsub_089() {}
+void nullsub_089() {
+}
u32 sub_0804FB70() {
return 1;
}
-void nullsub_90() {}
+void nullsub_90() {
+}
u32 sub_0804FB78() {
return 1;
}
-void nullsub_91() {}
+void nullsub_91() {
+}
u32 sub_0804FB80() {
return 1;
}
-void nullsub_92() {}
+void nullsub_92() {
+}
u32 sub_0804FB88() {
return 1;
}
-void nullsub_93() {}
+void nullsub_93() {
+}
u32 sub_0804FB90() {
return 1;
}
-void nullsub_94() {}
+void nullsub_94() {
+}
u32 sub_0804FB98() {
return 1;
}
-void nullsub_95() {}
+void nullsub_95() {
+}
u32 sub_0804FBA0() {
return 1;
}
-void nullsub_96() {}
+void nullsub_96() {
+}
u32 sub_0804FBA8() {
return 1;
}
-void nullsub_97() {}
+void nullsub_97() {
+}
u32 sub_0804FBB09() {
return 1;
}
-void nullsub_98() {}
+void nullsub_98() {
+}
u32 sub_0804FBB8() {
return 1;
@@ -6057,90 +6024,97 @@ u32 sub_0804FBB8() {
extern EntityData gUnk_080F9304;
-void sub_0804FBBC(void)
-{
- if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
- LoadRoomEntityList(&gUnk_080F9304);
- }
+void sub_0804FBBC(void) {
+ if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
+ LoadRoomEntityList(&gUnk_080F9304);
+ }
}
extern EntityData gUnk_080F9304;
-void sub_0804FBDC(void)
-{
- if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
- LoadRoomEntityList(&gUnk_080F9304);
- }
+void sub_0804FBDC(void) {
+ if ((gUnk_02002A40.windcrests & 0x2000000) == 0) {
+ LoadRoomEntityList(&gUnk_080F9304);
+ }
}
u32 sub_0804FBFC() {
return 1;
}
-void nullsub_424() {}
+void nullsub_424() {
+}
u32 sub_0804FC04() {
return 1;
}
-void nullsub_425() {}
+void nullsub_425() {
+}
u32 sub_0804FC0C() {
return 1;
}
-void nullsub_426() {}
+void nullsub_426() {
+}
u32 sub_0804FC14() {
return 1;
}
-void nullsub_427() {}
+void nullsub_427() {
+}
u32 sub_0804FC1C() {
return 1;
}
-void nullsub_428() {}
+void nullsub_428() {
+}
u32 sub_0804FC24() {
return 1;
}
-void nullsub_429() {}
+void nullsub_429() {
+}
u32 sub_0804FC2C() {
return 1;
}
-void nullsub_430() {}
+void nullsub_430() {
+}
u32 sub_0804FC34() {
return 1;
}
-void nullsub_431() {}
+void nullsub_431() {
+}
u32 sub_0804FC3C() {
return 1;
}
-void nullsub_432() {}
+void nullsub_432() {
+}
u32 sub_0804FC44() {
return 1;
}
-void nullsub_433() {}
+void nullsub_433() {
+}
extern u32 gUnk_080F9BF8;
-u32 sub_0804FC4C(void)
-{
- if (!CheckKinstoneFused(0xe)) {
- gRoomVars.field_0x6c = &gUnk_080F9BF8;
- }
- return 1;
+u32 sub_0804FC4C(void) {
+ if (!CheckKinstoneFused(0xe)) {
+ gRoomVars.field_0x6c = &gUnk_080F9BF8;
+ }
+ return 1;
}
void sub_0804FC6C() {
@@ -6152,31 +6126,36 @@ u32 sub_0804FC7C() {
return 1;
}
-void nullsub_99() {}
+void nullsub_99() {
+}
u32 sub_0804FC84() {
return 1;
}
-void nullsub_100() {}
+void nullsub_100() {
+}
u32 sub_0804FC8C() {
return 1;
}
-void nullsub_101() {}
+void nullsub_101() {
+}
u32 sub_0804FC94() {
return 1;
}
-void nullsub_102() {}
+void nullsub_102() {
+}
u32 sub_0804FC9C() {
return 1;
}
-void nullsub_103() {}
+void nullsub_103() {
+}
u32 sub_0804FCA4() {
return 1;
@@ -6185,99 +6164,112 @@ u32 sub_0804FCA4() {
extern EntityData gUnk_080F9FA8;
extern EntityData gUnk_080F9F88;
-void sub_0804FCA8(void)
-{
- if (CheckKinstoneFused(0x14)) {
- LoadRoomEntityList(&gUnk_080F9FA8);
- }
- if (!GetInventoryValue(0x38)) {
- LoadRoomEntityList(&gUnk_080F9F88);
- }
+void sub_0804FCA8(void) {
+ if (CheckKinstoneFused(0x14)) {
+ LoadRoomEntityList(&gUnk_080F9FA8);
+ }
+ if (!GetInventoryValue(0x38)) {
+ LoadRoomEntityList(&gUnk_080F9F88);
+ }
}
u32 sub_0804FCD4() {
return 1;
}
-void nullsub_434() {}
+void nullsub_434() {
+}
u32 sub_0804FCDC() {
return 1;
}
-void nullsub_435() {}
+void nullsub_435() {
+}
u32 sub_0804FCE4() {
return 1;
}
-void nullsub_436() {}
+void nullsub_436() {
+}
u32 sub_0804FCEC() {
return 1;
}
-void nullsub_437() {}
+void nullsub_437() {
+}
u32 sub_0804FCF4() {
return 1;
}
-void nullsub_438() {}
+void nullsub_438() {
+}
u32 sub_0804FCFC() {
return 1;
}
-void nullsub_439() {}
+void nullsub_439() {
+}
u32 sub_0804FD04() {
return 1;
}
-void nullsub_440() {}
+void nullsub_440() {
+}
u32 sub_0804FD0C() {
return 1;
}
-void nullsub_441() {}
+void nullsub_441() {
+}
u32 sub_0804FD14() {
return 1;
}
-void nullsub_442() {}
+void nullsub_442() {
+}
u32 sub_0804FD1C() {
return 1;
}
-void nullsub_443() {}
+void nullsub_443() {
+}
u32 sub_0804FD24() {
return 1;
}
-void nullsub_444() {}
+void nullsub_444() {
+}
u32 sub_0804FD2C() {
return 1;
}
-void nullsub_445() {}
+void nullsub_445() {
+}
u32 sub_0804FD34() {
return 1;
}
-void nullsub_446() {}
+void nullsub_446() {
+}
u32 sub_0804FD3C() {
return 1;
}
-void nullsub_447() {}
+void nullsub_447() {
+}
u32 sub_0804FD44() {
return 1;
@@ -6290,7 +6282,8 @@ u32 sub_0804FD4C() {
return 1;
}
-void nullsub_449() {}
+void nullsub_449() {
+}
u32 sub_0804FD54() {
return 1;
@@ -6298,119 +6291,129 @@ u32 sub_0804FD54() {
extern EntityData gUnk_080FA5D0;
-void sub_0804FD58(void)
-{
- if (!CheckKinstoneFused(0x21)) {
- LoadRoomEntityList(&gUnk_080FA5D0);
- }
+void sub_0804FD58(void) {
+ if (!CheckKinstoneFused(0x21)) {
+ LoadRoomEntityList(&gUnk_080FA5D0);
+ }
}
u32 sub_0804FD70() {
return 1;
}
-void nullsub_450() {}
+void nullsub_450() {
+}
u32 sub_0804FD78() {
return 1;
}
-void nullsub_451() {}
+void nullsub_451() {
+}
u32 sub_0804FD80() {
return 1;
}
-void nullsub_452() {}
+void nullsub_452() {
+}
u32 sub_0804FD88() {
return 1;
}
-void nullsub_453() {}
+void nullsub_453() {
+}
u32 sub_0804FD90() {
return 1;
}
-void nullsub_454() {}
+void nullsub_454() {
+}
u32 sub_0804FD98() {
return 1;
}
-void nullsub_455() {}
+void nullsub_455() {
+}
u32 sub_0804FDA0() {
return 1;
}
-void nullsub_456() {}
+void nullsub_456() {
+}
u32 sub_0804FDA8() {
return 1;
}
-void nullsub_457() {}
+void nullsub_457() {
+}
u32 sub_0804FDB0() {
return 1;
}
-void nullsub_458() {}
+void nullsub_458() {
+}
u32 sub_0804FDB8() {
return 1;
}
-void nullsub_459() {}
+void nullsub_459() {
+}
u32 sub_0804FDC0() {
return 1;
}
-void nullsub_460() {}
+void nullsub_460() {
+}
u32 sub_0804FDC8() {
return 1;
}
-void nullsub_461() {}
+void nullsub_461() {
+}
u32 sub_0804FDD0() {
return 1;
}
-void nullsub_462() {}
+void nullsub_462() {
+}
u32 sub_0804FDD8() {
return 1;
}
-void nullsub_463() {}
+void nullsub_463() {
+}
extern u32 gUnk_080FAD48;
-u32 sub_0804FDE0(void)
-{
- if (CheckGlobalFlag(ENDING)) {
- gRoomVars.field_0x6c = &gUnk_080FAD48;
- gRoomVars.field_0x74 = NULL;
- }
- return 1;
+u32 sub_0804FDE0(void) {
+ if (CheckGlobalFlag(ENDING)) {
+ gRoomVars.field_0x6c = &gUnk_080FAD48;
+ gRoomVars.field_0x74 = NULL;
+ }
+ return 1;
}
extern EntityData gUnk_080FACB8;
-void sub_0804FE04(void)
-{
- if (CheckGlobalFlag(ENDING)) {
- gArea.pMusicIndex = gArea.musicIndex;
- }
- else {
- LoadRoomEntityList(&gUnk_080FACB8);
- }
- sub_0805B4D0(0);
- sub_08059994();
+void sub_0804FE04(void) {
+ if (CheckGlobalFlag(ENDING)) {
+ gArea.pMusicIndex = gArea.musicIndex;
+ } else {
+ LoadRoomEntityList(&gUnk_080FACB8);
+ }
+ sub_0805B4D0(0);
+ sub_08059994();
}
void sub_0804FE40() {
@@ -6421,7 +6424,8 @@ u32 sub_0804FE4C() {
return 1;
}
-void nullsub_104() {}
+void nullsub_104() {
+}
u32 sub_0804FE54() {
return 1;
@@ -6430,155 +6434,166 @@ u32 sub_0804FE54() {
extern EntityData gUnk_080FAFE4;
extern EntityData gUnk_080FB004;
-void sub_0804FE58(void)
-{
-
- sub_0805B4D0(1);
- if (CheckGlobalFlag(LV2_CLEAR) && !CheckLocalFlag(LV1_CLEAR)) {
- LoadRoomEntityList(&gUnk_080FAFE4);
- }
- if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
- LoadRoomEntityList(&gUnk_080FB004);
- }
- if (GetInventoryValue(0x2)) {
- SetGlobalFlag(WHITE_SWORD_END);
- }
+void sub_0804FE58(void) {
+
+ sub_0805B4D0(1);
+ if (CheckGlobalFlag(LV2_CLEAR) && !CheckLocalFlag(LV1_CLEAR)) {
+ LoadRoomEntityList(&gUnk_080FAFE4);
+ }
+ if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
+ LoadRoomEntityList(&gUnk_080FB004);
+ }
+ if (GetInventoryValue(0x2)) {
+ SetGlobalFlag(WHITE_SWORD_END);
+ }
}
extern EntityData gUnk_080FB004;
-void sub_0804FEAC(void)
-{
- if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
- LoadRoomEntityList(&gUnk_080FB004);
- }
+void sub_0804FEAC(void) {
+ if ((gUnk_02002A40.windcrests & 0x1000000) == 0) {
+ LoadRoomEntityList(&gUnk_080FB004);
+ }
}
u32 sub_0804FECC() {
return 1;
}
-void nullsub_464() {}
+void nullsub_464() {
+}
u32 sub_0804FED4() {
return 1;
}
-void sub_0804FED8(void)
-{
- SetTileType(0x176, 0x66f, 1);
+void sub_0804FED8(void) {
+ SetTileType(0x176, 0x66f, 1);
}
u32 sub_0804FEEC() {
return 1;
}
-void nullsub_465() {}
+void nullsub_465() {
+}
u32 sub_0804FEF4() {
return 1;
}
-void nullsub_466() {}
+void nullsub_466() {
+}
u32 sub_0804FEFC() {
return 1;
}
-void nullsub_467() {}
+void nullsub_467() {
+}
u32 sub_0804FF04() {
return 1;
}
-void nullsub_468() {}
+void nullsub_468() {
+}
u32 sub_0804FF0C() {
return 1;
}
-void nullsub_469() {}
+void nullsub_469() {
+}
u32 sub_0804FF14() {
return 1;
}
-void nullsub_470() {}
+void nullsub_470() {
+}
u32 sub_0804FF1C() {
return 1;
}
-void nullsub_471() {}
+void nullsub_471() {
+}
u32 sub_0804FF24() {
return 1;
}
-void nullsub_472() {}
+void nullsub_472() {
+}
u32 sub_0804FF2C() {
return 1;
}
-void nullsub_473() {}
+void nullsub_473() {
+}
u32 sub_0804FF34() {
return 1;
}
-void nullsub_474() {}
+void nullsub_474() {
+}
u32 sub_0804FF3C() {
return 1;
}
-void nullsub_475() {}
+void nullsub_475() {
+}
u32 sub_0804FF44() {
return 1;
}
-void nullsub_476() {}
+void nullsub_476() {
+}
u32 sub_0804FF4C() {
return 1;
}
-void nullsub_477() {}
+void nullsub_477() {
+}
u32 sub_0804FF54() {
return 1;
}
-void nullsub_478() {}
+void nullsub_478() {
+}
u32 sub_0804FF5C() {
return 1;
}
-void sub_0804FF60(void)
-{
- if (!CheckLocalFlag(0x70)) {
- SetLocalFlag(0x70);
- }
+void sub_0804FF60(void) {
+ if (!CheckLocalFlag(0x70)) {
+ SetLocalFlag(0x70);
+ }
}
u32 sub_0804FF74() {
return 1;
}
-void nullsub_105() {}
+void nullsub_105() {
+}
u32 sub_0804FF7C() {
return 1;
}
-void nullsub_106() {}
-
+void nullsub_106() {
+}
-void sub_0804FF84(u32 arg0)
-{
- ((struct_02000000 * )0x02000000)->brightnessPref = arg0;
- gUsedPalettes = (u32)-1;
+void sub_0804FF84(u32 arg0) {
+ ((struct_02000000*)0x02000000)->brightnessPref = arg0;
+ gUsedPalettes = (u32)-1;
}
diff --git a/src/sub_08050024.c b/src/sub_08050024.c
index e71c3c93..ad3235aa 100644
--- a/src/sub_08050024.c
+++ b/src/sub_08050024.c
@@ -21,65 +21,58 @@ void sub_08050024() {
return;
}
-void sub_08050038(u32 arg0)
-{
- if ((gFadeControl.fadeType & 1) != 0) {
- gFadeControl.field_0xe = arg0;
- }
- else {
- gFadeControl.fadeDuration = arg0;
- }
+void sub_08050038(u32 arg0) {
+ if ((gFadeControl.fadeType & 1) != 0) {
+ gFadeControl.field_0xe = arg0;
+ } else {
+ gFadeControl.fadeDuration = arg0;
+ }
}
-void DoFade(u32 fadeType, u32 fadeSpeed)
-{
- gFadeControl.fadeSpeed = fadeSpeed;
- gFadeControl.fadeType = fadeType;
- gFadeControl.active = 1;
- gFadeControl.fadeDuration = 0x100;
- gFadeControl.field_0xe = 0;
- if ((gFadeControl.fadeType & 2) != 0) {
- gFadeControl.field_0x2 = 0xf8;
- }
- else {
- gFadeControl.field_0x2 = 0;
- }
- if ((fadeType & 8) != 0) {
- gUnk_03000000.spritesOffset = 1;
- gScreen.bg.bg1xOffset |= 0x40;
- gScreen.affine.bg2Control |= 0x40;
- gScreen.affine.bg3Control |= 0x40;
- }
- if ((fadeType & 0x10) != 0) {
- sub_0801E1B8(gFadeControl.field_0x16, gFadeControl.field_0x18);
- sub_0801E1EC(gFadeControl.field_0x12, gFadeControl.field_0x14, gFadeControl.field_0x10);
- if ((fadeType & 1) == 0) {
- gFadeControl.fadeType &= 0xfffb;
- sub_08050008();
- gUsedPalettes = 0xffffffff;
+void DoFade(u32 fadeType, u32 fadeSpeed) {
+ gFadeControl.fadeSpeed = fadeSpeed;
+ gFadeControl.fadeType = fadeType;
+ gFadeControl.active = 1;
+ gFadeControl.fadeDuration = 0x100;
+ gFadeControl.field_0xe = 0;
+ if ((gFadeControl.fadeType & 2) != 0) {
+ gFadeControl.field_0x2 = 0xf8;
+ } else {
+ gFadeControl.field_0x2 = 0;
+ }
+ if ((fadeType & 8) != 0) {
+ gUnk_03000000.spritesOffset = 1;
+ gScreen.bg.bg1xOffset |= 0x40;
+ gScreen.affine.bg2Control |= 0x40;
+ gScreen.affine.bg3Control |= 0x40;
+ }
+ if ((fadeType & 0x10) != 0) {
+ sub_0801E1B8(gFadeControl.field_0x16, gFadeControl.field_0x18);
+ sub_0801E1EC(gFadeControl.field_0x12, gFadeControl.field_0x14, gFadeControl.field_0x10);
+ if ((fadeType & 1) == 0) {
+ gFadeControl.fadeType &= 0xfffb;
+ sub_08050008();
+ gUsedPalettes = 0xffffffff;
+ }
}
- }
}
-void sub_080500F4(u32 arg0)
-{
+void sub_080500F4(u32 arg0) {
gFadeControl.fadeSpeed = arg0;
gFadeControl.fadeType ^= 1;
gFadeControl.active = 1;
gFadeControl.fadeDuration = 0x100;
}
-void sub_08050110(u32 param_1, u32 param_2, u32 fadeType, u32 fadeSpeed)
-{
- if ((fadeType & 1) != 0) {
- gFadeControl.field_0x10 = 0x96;
- }
- else {
- gFadeControl.field_0x10 = 0;
- }
- gFadeControl.field_0x12 = param_1;
- gFadeControl.field_0x14 = param_2;
- gFadeControl.field_0x16 = 0x3f3f;
- gFadeControl.field_0x18 = 0;
- DoFade(fadeType, fadeSpeed);
+void sub_08050110(u32 param_1, u32 param_2, u32 fadeType, u32 fadeSpeed) {
+ if ((fadeType & 1) != 0) {
+ gFadeControl.field_0x10 = 0x96;
+ } else {
+ gFadeControl.field_0x10 = 0;
+ }
+ gFadeControl.field_0x12 = param_1;
+ gFadeControl.field_0x14 = param_2;
+ gFadeControl.field_0x16 = 0x3f3f;
+ gFadeControl.field_0x18 = 0;
+ DoFade(fadeType, fadeSpeed);
}
diff --git a/src/sub_08055E08.c b/src/sub_08055E08.c
index aeabdb1d..40c1f812 100644
--- a/src/sub_08055E08.c
+++ b/src/sub_08055E08.c
@@ -24,12 +24,13 @@ void sub_08055E08(void) {
}
void sub_08055E24(void) {
- gMenu.overlayType++;
- gUnk_02000070.unk0 = 1;
- sub_0804B0B0(gMenu.field_0xc[2], gMenu.field_0xc[3]);
- LoadRoomEntityList(&gUnk_080FF400);
- sub_08055B70(gMenu.field_0x4, 0, 0, 0);
- DoFade(4, 0x10);
+ gMenu.overlayType++;
+ gUnk_02000070.unk0 = 1;
+ sub_0804B0B0(gMenu.field_0xc[2], gMenu.field_0xc[3]);
+ LoadRoomEntityList(&gUnk_080FF400);
+ sub_08055B70(gMenu.field_0x4, 0, 0, 0);
+ DoFade(4, 0x10);
}
-void nullsub_493(void) {} \ No newline at end of file
+void nullsub_493(void) {
+}
diff --git a/src/sub_08070680.c b/src/sub_08070680.c
index 623b992d..a7717ff3 100644
--- a/src/sub_08070680.c
+++ b/src/sub_08070680.c
@@ -12,51 +12,49 @@ void sub_08070680(Entity* this) {
gUnk_0811B9E0[this->action](this);
}
+void sub_08070698(Entity* this) {
+ u32 uVar1;
+ int iVar2;
+ Entity* ent;
-void sub_08070698(Entity *this)
-{
- u32 uVar1;
- int iVar2;
- Entity *ent;
-
- gPlayerState.field_0x0[0] = 0xff;
- gPlayerState.field_0x16[0] = gPlayerEntity.x.HALF.HI;
- gPlayerState.field_0x16[1] = gPlayerEntity.y.HALF.HI;
- this->flags = this->flags | 0x80;
- this->spritePriority.b0 = 0xc;
- this->spritePriority.b1 = 1;
- this->spriteSettings.b.shadow = 1;
- this->field_0x16 = 0x20;
- this->flags2 = 8;
- this->damageType = 0x79;
- this->boundingBox = &gUnk_08114F88;
- this->spriteIndex = 1;
- gPlayerState.field_0x8 = 0x100;
- sub_0806FDA0(this);
- sub_080AE008(this, 1, 2);
- InitAnimationForceUpdate(this, 2);
- if (this->collisionLayer == 0) {
- sub_08016A30(this);
- }
- uVar1 = IsItemEquipped(0x10);
- if (uVar1 != 2) {
- sub_08077728();
- }
- sub_0807A108();
- sub_0807AEE4();
- iVar2 = sub_08078EFC();
- if (iVar2 == 0) {
- sub_0807921C();
- sub_0807A1B8();
- if (gPlayerState.swimState != 0) {
- gPlayerState.swimState = 1;
- sub_08079938();
- gPlayerState.field_0xa8 = 7;
- sub_0807ACCC(this);
- ent = FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0);
- if (ent != NULL) {
- DeleteEntity(ent);
- }
+ gPlayerState.field_0x0[0] = 0xff;
+ gPlayerState.field_0x16[0] = gPlayerEntity.x.HALF.HI;
+ gPlayerState.field_0x16[1] = gPlayerEntity.y.HALF.HI;
+ this->flags = this->flags | 0x80;
+ this->spritePriority.b0 = 0xc;
+ this->spritePriority.b1 = 1;
+ this->spriteSettings.b.shadow = 1;
+ this->field_0x16 = 0x20;
+ this->flags2 = 8;
+ this->damageType = 0x79;
+ this->boundingBox = &gUnk_08114F88;
+ this->spriteIndex = 1;
+ gPlayerState.field_0x8 = 0x100;
+ sub_0806FDA0(this);
+ sub_080AE008(this, 1, 2);
+ InitAnimationForceUpdate(this, 2);
+ if (this->collisionLayer == 0) {
+ sub_08016A30(this);
+ }
+ uVar1 = IsItemEquipped(0x10);
+ if (uVar1 != 2) {
+ sub_08077728();
+ }
+ sub_0807A108();
+ sub_0807AEE4();
+ iVar2 = sub_08078EFC();
+ if (iVar2 == 0) {
+ sub_0807921C();
+ sub_0807A1B8();
+ if (gPlayerState.swimState != 0) {
+ gPlayerState.swimState = 1;
+ sub_08079938();
+ gPlayerState.field_0xa8 = 7;
+ sub_0807ACCC(this);
+ ent = FindEntityInListByForm(0x6, 0xf, 0x6, 0xb, 0x0);
+ if (ent != NULL) {
+ DeleteEntity(ent);
+ }
+ }
}
- }
}
diff --git a/src/sub_0807C998.c b/src/sub_0807C998.c
index 8fdf37a3..7c2afd37 100644
--- a/src/sub_0807C998.c
+++ b/src/sub_0807C998.c
@@ -6,19 +6,17 @@ extern u16 gMetatilesBottom[];
extern u16 gMetatilesTop[];
extern u8 gUnk_08324AE4;
-void sub_0807C960(void* dest, u32 offset)
-{
+void sub_0807C960(void* dest, u32 offset) {
void* src;
- if (offset != -1) {
- src = &gUnk_08324AE4 + (offset & 0x7fffffff);
- if ((u32)dest >> 0x18 == 6) {
- LZ77UnCompVram(src, (void *)dest);
+ if (offset != -1) {
+ src = &gUnk_08324AE4 + (offset & 0x7fffffff);
+ if ((u32)dest >> 0x18 == 6) {
+ LZ77UnCompVram(src, (void*)dest);
+ } else {
+ LZ77UnCompWram(src, (void*)dest);
+ }
}
- else {
- LZ77UnCompWram(src, (void *)dest);
- }
- }
}
void sub_0807C998(u32* a1) {
diff --git a/src/sub_080A3B84.c b/src/sub_080A3B84.c
index b3646653..1fa55fb0 100644
--- a/src/sub_080A3B84.c
+++ b/src/sub_080A3B84.c
@@ -6,56 +6,54 @@
extern void (*const gUnk_081280C4[])();
-void DrawKinstoneMenu(void)
-{
- gScreenTransition.field_0x24[8] = 2;
- sub_080AD90C();
- gUnk_081280C4[gMenu.menuType]();
- sub_080A3B74();
- sub_080A4054();
- sub_0801C1D4();
- sub_0801C208();
- sub_0805E5C0();
- sub_080AD9B0();
- sub_080AD918();
- gScreenTransition.field_0x24[8] = 0;
+void DrawKinstoneMenu(void) {
+ gScreenTransition.field_0x24[8] = 2;
+ sub_080AD90C();
+ gUnk_081280C4[gMenu.menuType]();
+ sub_080A3B74();
+ sub_080A4054();
+ sub_0801C1D4();
+ sub_0801C208();
+ sub_0805E5C0();
+ sub_080AD9B0();
+ sub_080AD918();
+ gScreenTransition.field_0x24[8] = 0;
}
extern void gUnk_081280DC;
-void sub_080A3BD0(void)
-{
- s32 iVar1;
- s32 iVar2;
-
- gMenu.field_0x1 = 1;
- gMenu.unk2a = 0;
- sub_080A4D34();
- LoadPaletteGroup(0xcb);
- LoadGfxGroup(0x75);
-
- iVar1 = sub_080A4494();
- iVar2 = iVar1 + 7;
- if (iVar2 < 0) {
- iVar2 += 0x7;
- }
-
- iVar1 = (iVar2 >> 3) - 6;
- iVar1 = max(iVar1, 0);
- iVar1 = min(iVar1, 6);
-
- LoadGfxGroup(iVar1 + 0x76);
- gScreen.lcd.displayControl |= 0x1e00;
- gScreen.bg.bg1xOffset = 0x1c01;
- gScreen.affine.bg2Control = 0x1d02;
- gScreen.affine.bg3Control = 0x1e0b;
- gScreen.bg.bg2yOffset = 1;
- gScreen.affine.unk = 1;
- gScreen.affine.unk4 = 1;
- sub_080A4528();
- sub_080A4398();
- sub_0801E738(0);
- sub_080A70AC(&gUnk_081280DC);
- sub_080A7114(1);
- DoFade(6, 8);
+void sub_080A3BD0(void) {
+ s32 iVar1;
+ s32 iVar2;
+
+ gMenu.field_0x1 = 1;
+ gMenu.unk2a = 0;
+ sub_080A4D34();
+ LoadPaletteGroup(0xcb);
+ LoadGfxGroup(0x75);
+
+ iVar1 = sub_080A4494();
+ iVar2 = iVar1 + 7;
+ if (iVar2 < 0) {
+ iVar2 += 0x7;
+ }
+
+ iVar1 = (iVar2 >> 3) - 6;
+ iVar1 = max(iVar1, 0);
+ iVar1 = min(iVar1, 6);
+
+ LoadGfxGroup(iVar1 + 0x76);
+ gScreen.lcd.displayControl |= 0x1e00;
+ gScreen.bg.bg1xOffset = 0x1c01;
+ gScreen.affine.bg2Control = 0x1d02;
+ gScreen.affine.bg3Control = 0x1e0b;
+ gScreen.bg.bg2yOffset = 1;
+ gScreen.affine.unk = 1;
+ gScreen.affine.unk4 = 1;
+ sub_080A4528();
+ sub_080A4398();
+ sub_0801E738(0);
+ sub_080A70AC(&gUnk_081280DC);
+ sub_080A7114(1);
+ DoFade(6, 8);
}
diff --git a/src/sub_080A554C.c b/src/sub_080A554C.c
index d25d7eb9..4ec59e7f 100644
--- a/src/sub_080A554C.c
+++ b/src/sub_080A554C.c
@@ -6,8 +6,7 @@ extern void (*const gUnk_08128BF8[])(void);
extern u8 gUnk_02000090;
-u32 sub_080A554C(u32 arg0)
-{
+u32 sub_080A554C(u32 arg0) {
u32 i;
if (arg0 != 0) {
@@ -19,8 +18,7 @@ u32 sub_080A554C(u32 arg0)
return 17;
}
-void sub_080A5574(void)
-{
- gUnk_08128BF8[gMenu.menuType]();
- sub_080A57F4();
+void sub_080A5574(void) {
+ gUnk_08128BF8[gMenu.menuType]();
+ sub_080A57F4();
}
diff --git a/src/tmc.code-workspace b/src/tmc.code-workspace
index edfe8a81..f890504e 100644
--- a/src/tmc.code-workspace
+++ b/src/tmc.code-workspace
@@ -1,13 +1,7 @@
{
- "folders": [
- {
- "path": ".."
- }
- ],
- "settings": {
- "files.associations": {
- "algorithm": "cpp",
- "ios": "c"
- }
- }
-} \ No newline at end of file
+ "folders" : [ { "path" : ".." } ], "settings" : {
+ "files.associations" : {
+ "algorithm" : "cpp", "ios" : "c"
+ }
+ }
+}
diff --git a/src/trig.c b/src/trig.c
index a406599f..bb53c2fe 100644
--- a/src/trig.c
+++ b/src/trig.c
@@ -1,72 +1,71 @@
#include "global.h"
// Values of sin(x*(π/128)) as Q8.8 fixed-point numbers from x = 0 to x = 319
-const s16 gSineTable[] =
-{
- Q_8_8(0), // sin(0*(π/128))
- Q_8_8(0.0234375), // sin(1*(π/128))
- Q_8_8(0.046875), // sin(2*(π/128))
- Q_8_8(0.0703125), // sin(3*(π/128))
- Q_8_8(0.09765625), // sin(4*(π/128))
- Q_8_8(0.12109375), // sin(5*(π/128))
- Q_8_8(0.14453125), // sin(6*(π/128))
- Q_8_8(0.16796875), // sin(7*(π/128))
- Q_8_8(0.19140625), // sin(8*(π/128))
- Q_8_8(0.21875), // sin(9*(π/128))
- Q_8_8(0.2421875), // sin(10*(π/128))
- Q_8_8(0.265625), // sin(11*(π/128))
- Q_8_8(0.2890625), // sin(12*(π/128))
- Q_8_8(0.3125), // sin(13*(π/128))
- Q_8_8(0.3359375), // sin(14*(π/128))
- Q_8_8(0.359375), // sin(15*(π/128))
- Q_8_8(0.37890625), // sin(16*(π/128))
- Q_8_8(0.40234375), // sin(17*(π/128))
- Q_8_8(0.42578125), // sin(18*(π/128))
- Q_8_8(0.44921875), // sin(19*(π/128))
- Q_8_8(0.46875), // sin(20*(π/128))
- Q_8_8(0.4921875), // sin(21*(π/128))
- Q_8_8(0.51171875), // sin(22*(π/128))
- Q_8_8(0.53125), // sin(23*(π/128))
- Q_8_8(0.5546875), // sin(24*(π/128))
- Q_8_8(0.57421875), // sin(25*(π/128))
- Q_8_8(0.59375), // sin(26*(π/128))
- Q_8_8(0.61328125), // sin(27*(π/128))
- Q_8_8(0.6328125), // sin(28*(π/128))
- Q_8_8(0.65234375), // sin(29*(π/128))
- Q_8_8(0.66796875), // sin(30*(π/128))
- Q_8_8(0.6875), // sin(31*(π/128))
- Q_8_8(0.70703125), // sin(32*(π/128))
- Q_8_8(0.72265625), // sin(33*(π/128))
- Q_8_8(0.73828125), // sin(34*(π/128))
- Q_8_8(0.75390625), // sin(35*(π/128))
- Q_8_8(0.76953125), // sin(36*(π/128))
- Q_8_8(0.78515625), // sin(37*(π/128))
- Q_8_8(0.80078125), // sin(38*(π/128))
- Q_8_8(0.81640625), // sin(39*(π/128))
- Q_8_8(0.828125), // sin(40*(π/128))
- Q_8_8(0.84375), // sin(41*(π/128))
- Q_8_8(0.85546875), // sin(42*(π/128))
- Q_8_8(0.8671875), // sin(43*(π/128))
- Q_8_8(0.87890625), // sin(44*(π/128))
- Q_8_8(0.890625), // sin(45*(π/128))
- Q_8_8(0.90234375), // sin(46*(π/128))
- Q_8_8(0.9140625), // sin(47*(π/128))
- Q_8_8(0.921875), // sin(48*(π/128))
- Q_8_8(0.9296875), // sin(49*(π/128))
- Q_8_8(0.94140625), // sin(50*(π/128))
- Q_8_8(0.94921875), // sin(51*(π/128))
- Q_8_8(0.953125), // sin(52*(π/128))
- Q_8_8(0.9609375), // sin(53*(π/128))
- Q_8_8(0.96875), // sin(54*(π/128))
- Q_8_8(0.97265625), // sin(55*(π/128))
- Q_8_8(0.98046875), // sin(56*(π/128))
- Q_8_8(0.984375), // sin(57*(π/128))
- Q_8_8(0.98828125), // sin(58*(π/128))
- Q_8_8(0.9921875), // sin(59*(π/128))
- Q_8_8(0.9921875), // sin(60*(π/128))
- Q_8_8(0.99609375), // sin(61*(π/128))
- Q_8_8(0.99609375), // sin(62*(π/128))
- Q_8_8(0.99609375), // sin(63*(π/128))
+const s16 gSineTable[] = {
+ Q_8_8(0), // sin(0*(π/128))
+ Q_8_8(0.0234375), // sin(1*(π/128))
+ Q_8_8(0.046875), // sin(2*(π/128))
+ Q_8_8(0.0703125), // sin(3*(π/128))
+ Q_8_8(0.09765625), // sin(4*(π/128))
+ Q_8_8(0.12109375), // sin(5*(π/128))
+ Q_8_8(0.14453125), // sin(6*(π/128))
+ Q_8_8(0.16796875), // sin(7*(π/128))
+ Q_8_8(0.19140625), // sin(8*(π/128))
+ Q_8_8(0.21875), // sin(9*(π/128))
+ Q_8_8(0.2421875), // sin(10*(π/128))
+ Q_8_8(0.265625), // sin(11*(π/128))
+ Q_8_8(0.2890625), // sin(12*(π/128))
+ Q_8_8(0.3125), // sin(13*(π/128))
+ Q_8_8(0.3359375), // sin(14*(π/128))
+ Q_8_8(0.359375), // sin(15*(π/128))
+ Q_8_8(0.37890625), // sin(16*(π/128))
+ Q_8_8(0.40234375), // sin(17*(π/128))
+ Q_8_8(0.42578125), // sin(18*(π/128))
+ Q_8_8(0.44921875), // sin(19*(π/128))
+ Q_8_8(0.46875), // sin(20*(π/128))
+ Q_8_8(0.4921875), // sin(21*(π/128))
+ Q_8_8(0.51171875), // sin(22*(π/128))
+ Q_8_8(0.53125), // sin(23*(π/128))
+ Q_8_8(0.5546875), // sin(24*(π/128))
+ Q_8_8(0.57421875), // sin(25*(π/128))
+ Q_8_8(0.59375), // sin(26*(π/128))
+ Q_8_8(0.61328125), // sin(27*(π/128))
+ Q_8_8(0.6328125), // sin(28*(π/128))
+ Q_8_8(0.65234375), // sin(29*(π/128))
+ Q_8_8(0.66796875), // sin(30*(π/128))
+ Q_8_8(0.6875), // sin(31*(π/128))
+ Q_8_8(0.70703125), // sin(32*(π/128))
+ Q_8_8(0.72265625), // sin(33*(π/128))
+ Q_8_8(0.73828125), // sin(34*(π/128))
+ Q_8_8(0.75390625), // sin(35*(π/128))
+ Q_8_8(0.76953125), // sin(36*(π/128))
+ Q_8_8(0.78515625), // sin(37*(π/128))
+ Q_8_8(0.80078125), // sin(38*(π/128))
+ Q_8_8(0.81640625), // sin(39*(π/128))
+ Q_8_8(0.828125), // sin(40*(π/128))
+ Q_8_8(0.84375), // sin(41*(π/128))
+ Q_8_8(0.85546875), // sin(42*(π/128))
+ Q_8_8(0.8671875), // sin(43*(π/128))
+ Q_8_8(0.87890625), // sin(44*(π/128))
+ Q_8_8(0.890625), // sin(45*(π/128))
+ Q_8_8(0.90234375), // sin(46*(π/128))
+ Q_8_8(0.9140625), // sin(47*(π/128))
+ Q_8_8(0.921875), // sin(48*(π/128))
+ Q_8_8(0.9296875), // sin(49*(π/128))
+ Q_8_8(0.94140625), // sin(50*(π/128))
+ Q_8_8(0.94921875), // sin(51*(π/128))
+ Q_8_8(0.953125), // sin(52*(π/128))
+ Q_8_8(0.9609375), // sin(53*(π/128))
+ Q_8_8(0.96875), // sin(54*(π/128))
+ Q_8_8(0.97265625), // sin(55*(π/128))
+ Q_8_8(0.98046875), // sin(56*(π/128))
+ Q_8_8(0.984375), // sin(57*(π/128))
+ Q_8_8(0.98828125), // sin(58*(π/128))
+ Q_8_8(0.9921875), // sin(59*(π/128))
+ Q_8_8(0.9921875), // sin(60*(π/128))
+ Q_8_8(0.99609375), // sin(61*(π/128))
+ Q_8_8(0.99609375), // sin(62*(π/128))
+ Q_8_8(0.99609375), // sin(63*(π/128))
};
const s16 gCosineTable[] = {