clang-format and newlines

This commit is contained in:
theo3
2020-11-13 23:27:50 -08:00
parent 8fd7481395
commit 3079c016b4
236 changed files with 4010 additions and 4415 deletions
Executable → Regular
+7 -8
View File
@@ -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:
+10 -12
View File
@@ -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;
}
}
Executable → Regular
+3 -3
View File
@@ -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;
+7 -7
View File
@@ -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);
}
}
+39 -47
View File
@@ -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]]();
}
+2 -4
View File
@@ -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]();
}
+84 -96
View File
@@ -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];
Entity* sub_08077C0C(ItemBehavior* beh, u32 arg1) {
u8 bVar1;
Entity* pEVar3;
if (sub_08077C94(beh, bVar1) != 0) {
return NULL;
}
else {
return CreatePlayerBomb(beh, bVar1);
}
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\"");
}
+68 -82
View File
@@ -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;
}
}
}
}
+33 -37
View File
@@ -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;
}
}
+38 -41
View File
@@ -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);
}
+3 -6
View File
@@ -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;
+42 -50
View File
@@ -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;
}
+1 -1
View File
@@ -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);
}
+1 -3
View File
@@ -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;
}
-2
View File
@@ -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
-2
View File
@@ -20,8 +20,6 @@ void BladeTrap(Entity* ent) {
sub_0806F69C(ent);
}
puVar3 = &(ent->field_0x74.HWORD);
uVar1 = *puVar3;
*puVar3 = uVar1 - 1;
+1 -1
View File
@@ -665,4 +665,4 @@ const BoundingBox gUnk_080CD174 = {
const BoundingBox gUnk_080CD17C = {
0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x16, 0x16,
};
// clang-format on
// clang-format on
+20 -22
View File
@@ -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) {
}
+2 -3
View File
@@ -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,
+3 -4
View File
@@ -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,
+1 -1
View File
@@ -52,4 +52,4 @@ void sub_0803EB44(Entity* this) {
InitAnimationForceUpdate(this, this->animationState << 2);
sub_0803EE8C(this);
}
}
}
+4 -4
View File
@@ -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;
+2 -2
View File
@@ -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);
-1
View File
@@ -50,4 +50,3 @@ void (*const gUnk_080CB588[])(Entity*) = {
HangingSeed_Hang,
};
// clang-format on
+1 -1
View File
@@ -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);
+78 -93
View File
@@ -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,
+34 -40
View File
@@ -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,
+4 -17
View File
@@ -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,
};
+1 -1
View File
@@ -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) {
+1 -1
View File
@@ -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;
}
+1 -4
View File
@@ -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
+52 -54
View File
@@ -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 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 nullsub_152() {
}
void sub_080316DC(Entity *this){
this->previousActionFlag = 1;
this->field_0x1d = 0x3c;
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_080316E8(Entity *this){
void sub_080316DC(Entity* this) {
this->previousActionFlag = 1;
this->field_0x1d = 0x3c;
}
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;
}
}
Executable → Regular
+2 -4
View File
@@ -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;
}
+2 -4
View File
@@ -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;
+13 -14
View File
@@ -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) {
+15 -16
View File
@@ -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();
}
+16 -20
View File
@@ -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;
}
+38 -55
View File
@@ -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;
+13 -45
View File
@@ -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);
}
+54 -59
View File
@@ -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 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 Item11(Entity* this) {
if (this->currentHealth) {
this->hurtBlinkTime = 0;
gUnk_080B3DD0[this->action](this);
} else {
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);
}
sub_0801766C(this);
}
void sub_08018DE8(Entity *this)
{
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);
}
sub_0801766C(this);
}
void sub_08018DE8(Entity* this) {
u8 bVar1;
bVar1 = this->attachedEntity->field_0x3a & 4;
if (bVar1 == 0) {
gPlayerState.field_0x1c = bVar1;
+1 -1
View File
@@ -47,7 +47,7 @@ void sub_0804B058(EntityData* dat) {
}
uVar2++;
dat++;
} while (*(u8*)dat!= 0xff);
} while (*(u8*)dat != 0xff);
}
}
+4 -7
View File
@@ -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);
+37 -42
View File
@@ -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);
}
+58 -43
View File
@@ -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) {
+22 -17
View File
@@ -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;
+8 -9
View File
@@ -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);
}
+4 -3
View File
@@ -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;
+49 -59
View File
@@ -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 (5 < ++this->field_0xf) {
this->field_0xf = 0;
if (sub_0805C920(this)) {
this->action = 2;
this->actionDelay = 1;
PlaySFX(0x11a);
}
LoadPaletteGroup(gUnk_08108D20[this->field_0xf]);
}
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);
}
}
if (sub_0805C920(this) == 0) {
this->action = 3;
}
}
void sub_0805C908(Entity* this) {
if (this->field_0xf == 0) {
PlaySFX(0x11a);
this->action = 1;
} else {
sub_0805C8B4(this);
}
}
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);
}
}
u32 sub_0805C920(Entity *this)
{
return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67);
u32 sub_0805C920(Entity* this) {
return CheckLocalFlagByOffset(0x300, (this->entityType).form + 0x67);
}
+4 -6
View File
@@ -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);
}
+8 -8
View File
@@ -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:
+21 -24
View File
@@ -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) {
+29 -24
View File
@@ -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;
}
+22 -40
View File
@@ -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);
+4 -4
View File
@@ -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));
}
+24 -68
View File
@@ -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;
}
+14 -14
View File
@@ -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;
+15 -21
View File
@@ -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;
+20 -28
View File
@@ -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) {
+45 -50
View File
@@ -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 };
+1 -1
View File
@@ -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);
}
+12 -15
View File
@@ -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);
}
}
+4 -5
View File
@@ -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);
}
+7 -10
View File
@@ -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;
+4 -4
View File
@@ -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);
}
+20 -28
View File
@@ -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;
}
}
+11 -14
View File
@@ -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);
}
}
+80 -94
View File
@@ -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 sub_08069584(Entity *this)
{
if (gScreenTransition.field_0x24[8] != 0) {
this->action = 3;
void GoronMerchant(Entity* this) {
if ((this->flags & 2) != 0) {
gUnk_08111B98[this->action](this);
} else {
gUnk_08111B88[this->action](this);
sub_0806ED78(this);
}
else {
this->action = 1;
}
InitAnimationForceUpdate(this, 2);
}
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;
void sub_08069584(Entity* this) {
if (gScreenTransition.field_0x24[8] != 0) {
this->action = 3;
} else {
this->action = 1;
}
}
if (this->animIndex != this->animationState) {
InitAnimationForceUpdate(this, this->animationState);
}
InitAnimationForceUpdate(this, 2);
}
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_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->animIndex != this->animationState) {
InitAnimationForceUpdate(this, this->animationState);
}
}
void sub_0806961C(Entity *this)
{
if (gScreenTransition.field_0x24[8] == 2) {
void sub_080695E8(Entity* this) {
UpdateAnimationSingleFrame(this);
}
sub_0806FD3C(this);
if ((gTextBox.doTextBox & 0x7f) == 0) {
this->action = 1;
this->interactType = gTextBox.doTextBox & 0x7f;
sub_0805E584(this);
InitAnimationForceUpdate(this, this->animationState);
}
}
void sub_0806963C(Entity *this)
{
this->action = 1;
this->spriteSettings.b.draw = TRUE;
sub_0807DD50(this);
void sub_0806961C(Entity* this) {
if (gScreenTransition.field_0x24[8] == 2) {
UpdateAnimationSingleFrame(this);
}
sub_0806FD3C(this);
}
void sub_08069654(Entity* this) {
void sub_0806963C(Entity* this) {
this->action = 1;
this->spriteSettings.b.draw = TRUE;
sub_0807DD50(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;
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;
}
temp2 = gRoomVars.field_0x7;
if (temp2 > 0x70) {
iVar3 = 1;
} else {
iVar3 = 0;
}
if (temp2 > 0x72) {
iVar3 = 2;
}
temp = CheckGlobalFlag(0x3e);
uVar1 = (-temp | temp) >> 0x1f;
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];
if (CheckGlobalFlag(0x3f)) {
uVar1 = 2;
}
if (CheckGlobalFlag(0x40)) {
uVar1 = 3;
}
if (CheckGlobalFlag(0x41)) {
uVar1 = 4;
}
return gUnk_08111BA0[uVar1 * 3 + iVar3];
}
+2 -1
View File
@@ -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);
}
+2 -4
View File
@@ -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);
}
}
+32 -37
View File
@@ -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_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_08062B70(Entity *this)
{
if ((gTextBox.doTextBox & 0x7f) == 0) {
InitializeAnimation(this, 2);
void sub_08062AF0(Entity* this) {
this->action = 1;
sub_0805E584(this);
}
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_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);
}
}
+42 -50
View File
@@ -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);
}
if ((-1 < this->height.WORD) &&
((gPlayerEntity.collisionLayer == 0 || (this->collisionLayer == gPlayerEntity.collisionLayer)))) {
sub_0806ED78(this);
}
sub_0800451C(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);
}
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;
}
+10 -11
View File
@@ -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);
}
+23 -29
View File
@@ -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);
+20 -27
View File
@@ -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
+5 -5
View File
@@ -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++;
+1 -2
View File
@@ -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;
+4 -5
View File
@@ -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;
}
}
}
}
+1 -2
View File
@@ -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;
}
+1 -1
View File
@@ -108,4 +108,4 @@ void sub_08098E88(Entity* this) {
PositionRelative(this, ent2, 0, -0x20000);
ent2->spriteOffsetY = 0x10;
}
}
}
+1 -1
View File
@@ -141,4 +141,4 @@ void sub_0809D178(Entity* this) {
} else {
GetNextFrame(this);
}
}
}
+20 -15
View File
@@ -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);
}
}
}
+10 -13
View File
@@ -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);
}
+51 -63
View File
@@ -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_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_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) {
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_0809EE08(Entity *this)
{
this->action = 2;
this->field_0x74.HWORD = *((u8 *)&this->field_0x7c + 3) << 2;
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_0809EE24(Entity *this)
{
this->action = 3;
InitializeAnimation(this, this->entityType.form + 4);
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_0809EE34(Entity *this)
{
this->action = 1;
this->field_0x74.HWORD = this->actionDelay << 2;
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_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;
}
+2 -2
View File
@@ -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);
}
}
}
+1 -1
View File
@@ -41,4 +41,4 @@ void sub_08092000(Entity* this) {
this->spriteSettings.b.draw = TRUE;
SetFlag(this->field_0x86.HWORD);
}
}
}
Executable → Regular
+12 -15
View File
@@ -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 {
Executable → Regular
+1 -3
View File
@@ -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);
}
}
+36 -41
View File
@@ -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 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);
void nullsub_127(Entity* this) {
}
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);
}
+2 -1
View File
@@ -142,4 +142,5 @@ void sub_0809EC08(Entity* this) {
}
}
void nullsub_126(Entity* this) { }
void nullsub_126(Entity* this) {
}
+25 -28
View File
@@ -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;
+16 -19
View File
@@ -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();
}
+75 -82
View File
@@ -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_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);
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;
void sub_080A0684(Entity* this) {
if ((this->cutsceneBeh.HWORD != 0xffff) && CheckFlags(this->cutsceneBeh.HWORD)) {
DeleteThisEntity();
}
ent = CreateFx(this, 0x11, 0x40);
if (ent != NULL) {
ent->x.HALF.HI -= 0xc;
ent->y.HALF.HI -= 0xc;
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);
}
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_080A074C(Entity* this) {
u8 bVar1;
Entity* ent;
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);
}
}
void sub_080A07F0(Entity *this)
{
sub_0806F69C(this);
if (--this->actionDelay == 0) {
DeleteThisEntity();
}
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_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_080A07F0(Entity* this) {
sub_0806F69C(this);
if (--this->actionDelay == 0) {
DeleteThisEntity();
}
}
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_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);
}
+33 -36
View File
@@ -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);
}
}
+6 -6
View File
@@ -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;
}
+13 -17
View File
@@ -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) {
+12 -14
View File
@@ -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);
}
}
+11 -12
View File
@@ -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();
}
}
+6 -7
View File
@@ -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) {
}
+8 -9
View File
@@ -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;
Executable → Regular
+5 -6
View File
@@ -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;
}

Some files were not shown because too many files have changed in this diff Show More