Rename objects

This commit is contained in:
octorock
2022-07-23 12:43:43 +02:00
parent ccba86d292
commit 852effa474
671 changed files with 5779 additions and 5277 deletions
+15 -15
View File
@@ -58,10 +58,10 @@ void sub_0805ECEC(int param_1, u32 param_2, u32 param_3, u32 param_4) {
temp[2] = param_4;
}
void InitPlayerMacro(u32 param_1) {
gPlayerState.field_0x9c = param_1;
gPlayerState.field_0x98 = 0;
gPlayerState.field_0x9a = 0;
void InitPlayerMacro(PlayerMacroEntry* playerMacro) {
gPlayerState.playerInput.playerMacro = playerMacro;
gPlayerState.playerInput.playerMacroWaiting = 0;
gPlayerState.playerInput.playerMacroHeldKeys = 0;
}
ASM_FUNC("asm/non_matching/code_0805EC04/UpdatePlayerInput.inc", void UpdatePlayerInput())
@@ -74,29 +74,29 @@ u32 ConvInputToState(u32 keys) {
result = 0;
}
if (keys & R_BUTTON) {
result |= 0x20;
result |= 0x8000;
result |= 0x80;
result |= PLAYER_INPUT_20;
result |= PLAYER_INPUT_8000;
result |= PLAYER_INPUT_80;
}
if (keys & A_BUTTON) {
result |= 0x8;
result |= 0x41;
result |= PLAYER_INPUT_8;
result |= PLAYER_INPUT_40 | PLAYER_INPUT_1;
}
if (keys & B_BUTTON) {
result |= 0x10;
result |= 0x2;
result |= PLAYER_INPUT_10;
result |= PLAYER_INPUT_2;
}
if (keys & DPAD_RIGHT) {
result |= 0x100;
result |= PLAYER_INPUT_RIGHT;
}
if (keys & DPAD_LEFT) {
result |= 0x200;
result |= PLAYER_INPUT_LEFT;
}
if (keys & DPAD_UP) {
result |= 0x400;
result |= PLAYER_INPUT_UP;
}
if (keys & DPAD_DOWN) {
result |= 0x800;
result |= PLAYER_INPUT_DOWN;
}
return result;
}
+2 -2
View File
@@ -297,7 +297,7 @@ void sub_080179EC(Entity* a1, Entity* a2) {
Entity* sub_08017A90(Entity* a1, Entity* parent) {
Entity* e;
e = (Entity*)CreateObject(OBJECT_99, 0, 0);
e = (Entity*)CreateObject(HIT_SWITCH, 0, 0);
if (e != NULL) {
e->animationState = (a1->direction >> 3) & 3;
e->spriteOffsetX = a1->x.HALF.HI - parent->x.HALF.HI;
@@ -384,7 +384,7 @@ s32 sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSettings* settings)
s32 sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((gPlayerState.flags & (PL_BUSY | PL_MINISH | PL_BURNING | PL_IN_MINECART)) == 0) {
Entity* e = CreateObject(OBJECT_42, 1, 0);
Entity* e = CreateObject(LINK_FIRE, 1, 0);
if (e != NULL) {
e->child = org;
gPlayerState.flags |= PL_BURNING;
+11 -7
View File
@@ -291,7 +291,6 @@ void LoadGfxGroup(u32 group) {
}
}
// regalloc
void sub_0801D898(void* dest, void* src, u32 word, u32 size) {
u32 v6;
u32 i;
@@ -303,7 +302,8 @@ void sub_0801D898(void* dest, void* src, u32 word, u32 size) {
size &= (short)~0x8000;
do {
DmaSet(3, src, dest, word | 0x80000000) src += word * 2;
DmaCopy16(3, src, dest, word * 2);
src += word * 2;
dest += v6 * 2;
} while (--size);
}
@@ -344,8 +344,8 @@ void DispReset(bool32 refresh) {
gMain.interruptFlag = 1;
gUnk_03003DE0 = 0;
gFadeControl.active = 0;
gScreen._6d = 0;
gScreen._6c = 0;
gScreen.vBlankDMA.readyBackup = FALSE;
gScreen.vBlankDMA.ready = FALSE;
DmaStop(0);
REG_DISPCNT = 0;
ClearOAM();
@@ -516,7 +516,7 @@ void sub_0801E0E0(u32 textIndex) {
void sub_0801E104(void) {
gScreen.lcd.displayControl &= ~0x6000;
gScreen._6c = 0;
gScreen.vBlankDMA.ready = FALSE;
}
void sub_0801E120(void) {
@@ -534,7 +534,9 @@ void sub_0801E154(u32 a1) {
void sub_0801E160(u32 a1, u32 a2, u32 a3) {
MemClear(&gUnk_02017AA0[gUnk_03003DE4[0]], sizeof(gUnk_02017AA0[gUnk_03003DE4[0]]));
sub_0801E290(a1, a2, a3);
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0]], 0x4000040, 0xA2600001);
SetVBlankDMA((u16*)&gUnk_02017AA0[gUnk_03003DE4[0]], (u16*)REG_ADDR_WIN0H,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x1);
}
void sub_0801E1B8(u32 a1, u32 a2) {
@@ -549,7 +551,9 @@ void sub_0801E1EC(u32 a1, u32 a2, u32 a3) {
MemClear(&gUnk_02017AA0[gUnk_03003DE4[0]], sizeof(gUnk_02017AA0[gUnk_03003DE4[0]]));
sub_0801E24C(a3, 0);
sub_0801E290(a1, a2, a3);
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0]], 0x4000040, 0xA2600001);
SetVBlankDMA((u16*)&gUnk_02017AA0[gUnk_03003DE4[0]], (u16*)REG_ADDR_WIN0H,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x1);
}
ASM_FUNC("asm/non_matching/common/sub_0801E24C.inc", void sub_0801E24C(u32 a1, u32 a2));
+2 -2
View File
@@ -48,10 +48,10 @@ void sub_0805FA98(void) {
switch (gInput.newKeys) {
case DPAD_UP:
gGenericMenu.unk10.a[1] -= 1;
gGenericMenu.unk10.a[1]--;
break;
case DPAD_DOWN:
gGenericMenu.unk10.a[1] += 1;
gGenericMenu.unk10.a[1]++;
break;
case L_BUTTON:
gGenericMenu.unk10.a[0] ^= 1;
+4 -4
View File
@@ -147,12 +147,12 @@ void AcroBandit_OnGrabbed(Entity* this) {
}
void AcroBandit_Type0(Entity* this) {
static void (*const actionFuncs[])(Entity*) = {
static void (*const AcroBandit_Type0_Actions[])(Entity*) = {
AcroBandit_Type0Action0, AcroBandit_Type0Action1, AcroBandit_Type0Action2,
AcroBandit_Type0Action3, AcroBandit_Type0Action4, AcroBandit_Type0Action5,
AcroBandit_Type0Action6, AcroBandit_Type0Action7, AcroBandit_Type0Action8,
};
actionFuncs[this->action](this);
AcroBandit_Type0_Actions[this->action](this);
}
void AcroBandit_Type0Action0(Entity* this) {
@@ -350,12 +350,12 @@ static void sub_08031E48(Entity* this, Entity* child) {
}
void AcroBandit_Type1(Entity* this) {
static void (*const actionFuncs[])(Entity*) = {
static void (*const AcroBandit_Type1_Actions[])(Entity*) = {
AcroBandit_Type1Init, AcroBandit_Type1Action1, AcroBandit_Type1Action2, AcroBandit_Type1Action3,
AcroBandit_Type1Action4, AcroBandit_Type1Action5, AcroBandit_Type1Action6, AcroBandit_Type1Action7,
AcroBandit_Type1Action8, AcroBandit_Type1Action9,
};
actionFuncs[this->action](this);
AcroBandit_Type1_Actions[this->action](this);
}
void AcroBandit_Type1Init(Entity* this) {
+1 -1
View File
@@ -289,7 +289,7 @@ void sub_0802CBC4(Entity* this) {
}
FreeCarryEntity(this);
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
ent = CreateObjectWithParent(this, SMOKE_PARTICLE, 0, 0);
if (ent != NULL) {
ent->collisionLayer = this->collisionLayer;
}
+1 -1
View File
@@ -588,7 +588,7 @@ void sub_0802B048(Entity* this) {
if (this->parent->next != NULL) {
this->parent->field_0x80.HALF.HI = 0;
}
ent = CreateObjectWithParent(this, OBJECT_20, 0, 0);
ent = CreateObjectWithParent(this, SMOKE_PARTICLE, 0, 0);
if (ent != NULL) {
this->collisionLayer = 1;
} else {
+1 -1
View File
@@ -42,7 +42,7 @@ void Bombarossa_OnCollision(BombarossaEntity* this) {
Entity* ent;
switch (super->contactFlags & 0x7f) {
default:
ent = CreateObject(OBJECT_20, 0, 0);
ent = CreateObject(SMOKE_PARTICLE, 0, 0);
if (ent != NULL) {
CopyPosition(super, ent);
}
+7 -7
View File
@@ -405,12 +405,12 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
if (tmp) {
tmp->child = super;
}
tmp = CreateObjectWithParent(super, OBJECT_49, 1, 0);
tmp = CreateObjectWithParent(super, CHUCHU_BOSS_START_PARTICLE, 1, 0);
if (tmp) {
tmp->child = super->child;
}
if (super->type != 0) {
tmp = CreateObjectWithParent(super, OBJECT_49, 3, 0);
tmp = CreateObjectWithParent(super, CHUCHU_BOSS_START_PARTICLE, 3, 0);
if (tmp) {
tmp->child = super->child;
}
@@ -603,7 +603,7 @@ void sub_080263B4(ChuchuBossEntity* this) {
this->unk_7c = 0x78;
this->unk_84->unk_03++;
} else {
CreateObjectWithParent(super, OBJECT_49, super->type2, 0);
CreateObjectWithParent(super, CHUCHU_BOSS_START_PARTICLE, super->type2, 0);
}
}
}
@@ -926,7 +926,7 @@ void sub_080269CC(ChuchuBossEntity* this) {
pEVar7->unk_74.HALF.HI += 3;
InitScreenShake(0x20, 0);
SoundReq(SFX_10B);
entity = (GenericEntity*)CreateObjectWithParent(super, OBJECT_15, 0, 0);
entity = (GenericEntity*)CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
if (entity != NULL) {
entity->base.spriteIndex = 0xc9;
#ifdef EU
@@ -962,7 +962,7 @@ void sub_080269CC(ChuchuBossEntity* this) {
pEVar7->unk_78.HALF.HI = 0x98;
this->unk_7c = gUnk_080CC278[Random() & 3];
this->unk_84->unk_03++;
entity = (GenericEntity*)CreateObjectWithParent(&pEVar7->base, OBJECT_49, 10, 0);
entity = (GenericEntity*)CreateObjectWithParent(&pEVar7->base, CHUCHU_BOSS_START_PARTICLE, 10, 0);
if (entity != NULL) {
*(u32*)&entity->cutsceneBeh = this->unk_7c;
}
@@ -1702,7 +1702,7 @@ bool32 sub_08027AA4(ChuchuBossEntity* this) {
switch (super->contactFlags & 0x7f) {
case 19:
SoundReq(SFX_WATER_SPLASH);
CreateObjectWithParent(super, OBJECT_49, 9, super->type2);
CreateObjectWithParent(super, CHUCHU_BOSS_START_PARTICLE, 9, super->type2);
SoundReq(SFX_155);
pHelper = this->unk_84;
super->iframes = 3;
@@ -1823,7 +1823,7 @@ void sub_08027C9C(ChuchuBossEntity* this, u32 param_2) {
}
Entity* sub_08027D20(ChuchuBossEntity* this) {
Entity* r4 = CreateObjectWithParent(super, OBJECT_15, 0, 0);
Entity* r4 = CreateObjectWithParent(super, CHUCHU_BOSS_PARTICLE, 0, 0);
if (r4 != NULL) {
r4->spriteIndex = 0xc9;
#ifdef EU
+2 -2
View File
@@ -277,7 +277,7 @@ void sub_08044498(DustEntity* this) {
u32 xdiff, ydiff;
uVar4 = COORD_TO_TILE(&gPlayerEntity);
tmp = (gPlayerState.field_0x92 & 0xf00);
tmp = (gPlayerState.playerInput.field_0x92 & 0xf00);
if (tmp != this->unk_75 || uVar4 != this->unk_76) {
this->unk_75 = tmp;
this->unk_76 = uVar4;
@@ -320,7 +320,7 @@ void sub_08044550(DustEntity* this) {
void sub_080445C0(DustEntity* this) {
Entity* pEVar1;
pEVar1 = CreateObject(OBJECT_21, 1, 1);
pEVar1 = CreateObject(DIRT_PARTICLE, 1, 1);
if (pEVar1 != NULL) {
CopyPosition(super, pEVar1);
}
+11 -11
View File
@@ -17,9 +17,9 @@ void sub_08045178(Entity*, Entity*, int, int);
void FireballGuy_OnTick(Entity*);
void FireballGuy_OnCollision(Entity*);
void FireballGuy_OnGrabbed(Entity*);
void sub_080453E8(Entity*);
void sub_08045430(Entity*);
void sub_08045454(Entity*);
void FireballGuy_Init(Entity*);
void FireballGuy_Action1(Entity*);
void FireballGuy_Action2(Entity*);
static void (*const FireballGuy_Functions[])(Entity*) = {
FireballGuy_OnTick, FireballGuy_OnCollision, GenericKnockback, GenericDeath, GenericConfused, FireballGuy_OnGrabbed,
@@ -30,12 +30,12 @@ void FireballGuy(Entity* this) {
}
void FireballGuy_OnTick(Entity* this) {
static void (*const actionFuncs[])(Entity*) = {
sub_080453E8,
sub_08045430,
sub_08045454,
static void (*const FireballGuy_Actions[])(Entity*) = {
FireballGuy_Init,
FireballGuy_Action1,
FireballGuy_Action2,
};
actionFuncs[this->action](this);
FireballGuy_Actions[this->action](this);
}
void FireballGuy_OnCollision(Entity* this) {
@@ -49,7 +49,7 @@ void FireballGuy_OnCollision(Entity* this) {
void FireballGuy_OnGrabbed(Entity* this) {
}
void sub_080453E8(Entity* this) {
void FireballGuy_Init(Entity* this) {
this->action = 1;
this->timer = 0;
this->spriteSettings.draw = 1;
@@ -61,7 +61,7 @@ void sub_080453E8(Entity* this) {
sub_08045524(this);
}
void sub_08045430(Entity* this) {
void FireballGuy_Action1(Entity* this) {
ProcessMovement2(this);
GetNextFrame(this);
if (GravityUpdate(this, Q_8_8(24.0)) == 0)
@@ -69,7 +69,7 @@ void sub_08045430(Entity* this) {
}
/* Split FireballGuy into new ones */
void sub_08045454(Entity* this) {
void FireballGuy_Action2(Entity* this) {
// Entity count per form
static const u8 typeEntityCount[4] = { 2, 3, 4, 5 };
static const PosOffset gUnk_080D1810[4] = { { 6, 0 }, { -6, 0 }, { 0, 6 }, { 0, -6 } };
+3 -3
View File
@@ -377,7 +377,7 @@ void sub_08037B10(GibdoEntity* this) {
void Gibdo_CreateObjects(GibdoEntity* this) {
Entity* object;
object = CreateObject(OBJECT_2A, 3, 0);
object = CreateObject(FLAME, 3, 0);
if (object != NULL) {
object->type2 = super->timer;
object->spritePriority.b0 = 3;
@@ -387,7 +387,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) {
}
this->field_0x80 = object;
object = CreateObject(OBJECT_2A, 3, 0);
object = CreateObject(FLAME, 3, 0);
if (object != NULL) {
object->type2 = super->timer;
object->spritePriority.b0 = 3;
@@ -397,7 +397,7 @@ void Gibdo_CreateObjects(GibdoEntity* this) {
}
this->field_0x84 = object;
object = CreateObject(OBJECT_2A, 3, 0);
object = CreateObject(FLAME, 3, 0);
if (object != NULL) {
object->type2 = super->timer;
object->spritePriority.b0 = 3;
+2 -2
View File
@@ -537,7 +537,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D86C.inc", void sub_0802D86C(GleerokE
super->timer = 0;
do {
CreateObjectWithParent(super, OBJECT_67, 0, super->timer);
CreateObjectWithParent(super, GLEEROK_PARTICLE, 0, super->timer);
} while (++super->timer < 8);
SoundReq(SFX_150);
@@ -1021,7 +1021,7 @@ void sub_0802E1D0(GleerokEntity* this) {
InitScreenShake(240, 0);
} else {
for (this->unk_7c.HALF_U.LO = 0; this->unk_7c.HALF_U.LO < 4; this->unk_7c.HALF_U.LO++) {
CreateObjectWithParent(super, OBJECT_67, 1, this->unk_7c.HALF_U.LO);
CreateObjectWithParent(super, GLEEROK_PARTICLE, 1, this->unk_7c.HALF_U.LO);
}
this->unk_74 = 0;
this->unk_75 = 0x10;
+4 -4
View File
@@ -617,13 +617,13 @@ void sub_080473F0(GyorgMaleEntity* this) {
if (tmp2 < -1) {
super->direction -= 2;
} else {
super->direction -= 1;
super->direction--;
}
} else {
if (tmp2 > 1) {
super->direction += 2;
} else {
super->direction += 1;
super->direction++;
}
}
}
@@ -1105,9 +1105,9 @@ u32 sub_08047F68(GyorgMaleEntity* this) {
approx += 2;
}
if (distSquared < gUnk_080D1C04[approx]) {
approx -= 1;
approx--;
} else {
approx += 1;
approx++;
}
if (distSquared < gUnk_080D1C04[approx]) {
s32 tmp = gUnk_080D1C04[approx - 1];
+15 -15
View File
@@ -12,12 +12,12 @@ extern Entity* gUnk_020000B0;
void Keaton_OnTick(Entity*);
void Keaton_OnCollision(Entity*);
void Keaton_OnGrabbed(Entity*);
void sub_08032468(Entity*);
void sub_0803248C(Entity*);
void sub_080324CC(Entity*);
void sub_080324FC(Entity*);
void sub_08032574(Entity*);
void sub_080325C4(Entity*);
void Keaton_Init(Entity*);
void Keaton_Action1(Entity*);
void Keaton_Action2(Entity*);
void Keaton_Action3(Entity*);
void Keaton_Action4(Entity*);
void Keaton_Action5(Entity*);
static void (*const Keaton_Functions[])(Entity*) = {
Keaton_OnTick, Keaton_OnCollision, GenericKnockback, GenericDeath, GenericConfused, Keaton_OnGrabbed,
@@ -41,10 +41,10 @@ void Keaton(Entity* this) {
}
void Keaton_OnTick(Entity* this) {
static void (*const actionFuncs[])(Entity*) = {
sub_08032468, sub_0803248C, sub_080324CC, sub_080324FC, sub_08032574, sub_080325C4,
static void (*const Keaton_Actions[])(Entity*) = {
Keaton_Init, Keaton_Action1, Keaton_Action2, Keaton_Action3, Keaton_Action4, Keaton_Action5,
};
actionFuncs[this->action](this);
Keaton_Actions[this->action](this);
}
void Keaton_OnCollision(Entity* this) {
@@ -69,7 +69,7 @@ void Keaton_OnCollision(Entity* this) {
void Keaton_OnGrabbed(Entity* this) {
}
void sub_08032468(Entity* this) {
void Keaton_Init(Entity* this) {
sub_0804A720(this);
this->animationState = 0;
InitAnimationForceUpdate(this, 0);
@@ -77,7 +77,7 @@ void sub_08032468(Entity* this) {
sub_08032740(this);
}
void sub_0803248C(Entity* this) {
void Keaton_Action1(Entity* this) {
if (!sub_080325E8(this) && !sub_0803271C(this)) {
this->timer--;
if (this->timer == 0) {
@@ -90,7 +90,7 @@ void sub_0803248C(Entity* this) {
}
}
void sub_080324CC(Entity* this) {
void Keaton_Action2(Entity* this) {
if (!sub_080325E8(this)) {
UpdateAnimationSingleFrame(this);
if (this->frame & ANIM_DONE) {
@@ -100,7 +100,7 @@ void sub_080324CC(Entity* this) {
}
}
void sub_080324FC(Entity* this) {
void Keaton_Action3(Entity* this) {
if (this->timer != 0) {
this->timer--;
if (this->timer == 0) {
@@ -128,7 +128,7 @@ void sub_080324FC(Entity* this) {
}
}
void sub_08032574(Entity* this) {
void Keaton_Action4(Entity* this) {
if (this->child && (this->child->contactFlags & 0x80)) {
sub_0803275C(this);
return;
@@ -145,7 +145,7 @@ void sub_08032574(Entity* this) {
}
}
void sub_080325C4(Entity* this) {
void Keaton_Action5(Entity* this) {
this->timer--;
if ((this->timer == 0) && !sub_080325E8(this)) {
sub_08032784(this);
+2 -2
View File
@@ -182,7 +182,7 @@ void sub_0803A274(Entity* this) {
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 2);
pEVar1->parent = this;
*(Entity**)&this->field_0x74 = pEVar1;
pEVar1 = CreateObject(OBJECT_7E, 1, 0);
pEVar1 = CreateObject(MAZAAL_OBJECT, 1, 0);
pEVar1->parent = this;
pEVar1->child = this->child;
PositionRelative(this->parent, this, Q_16_16(16.0), Q_16_16(32.0));
@@ -193,7 +193,7 @@ void sub_0803A274(Entity* this) {
pEVar1 = CreateEnemy(MAZAAL_BRACELET, 3);
pEVar1->parent = this;
*(Entity**)&this->field_0x74 = pEVar1;
pEVar1 = CreateObject(OBJECT_7E, 2, 0);
pEVar1 = CreateObject(MAZAAL_OBJECT, 2, 0);
pEVar1->parent = this;
pEVar1->child = this->child;
this->spriteSettings.flipX = 1;
+1 -1
View File
@@ -138,7 +138,7 @@ void sub_08033F3C(Entity* this) {
InitializeAnimation(this, 0);
pEVar1 = CreateEnemy(MAZAAL_HEAD, 1);
pEVar1->parent = this;
pEVar2 = CreateObject(OBJECT_7E, 0, 0);
pEVar2 = CreateObject(MAZAAL_OBJECT, 0, 0);
pEVar2->parent = this;
if (gRoomTransition.field_0x39 == 0) {
this->action = 0xd;
+1 -1
View File
@@ -1058,7 +1058,7 @@ void OctorokBoss_SetAttackTimer(OctorokBossEntity* this) {
this->unk_80 = 0;
attackPatterns = OctorokBoss_Phase4AttackPatterns[this->phase4AttackPattern];
this->currentAttack = attackPatterns[this->nextAttackIndex];
this->nextAttackIndex += 1;
this->nextAttackIndex++;
if (this->currentAttack != END_OF_ATTACK_PATTERN) {
return;
}
+5 -5
View File
@@ -58,7 +58,7 @@ void Pesto_OnCollision(Entity* this) {
this->z.HALF.HI = -0x10;
this->field_0x82.HALF.LO = 0;
this->field_0x78.HWORD = -0x10;
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
/* fallthrough */
case 2:
this->field_0x82.HALF.HI &= ~0x80;
@@ -337,8 +337,8 @@ void sub_080244E8(Entity* this) {
case 0:
if (--this->timer == 0) {
if (sub_080B1B44(COORD_TO_TILE(this), 1) == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x82.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->field_0x82.HALF.LO++;
this->subtimer = 0;
this->speed = 0;
} else {
@@ -426,7 +426,7 @@ void sub_080244E8(Entity* this) {
if (EntityInRectRadius(this, this->child, 6, 6)) {
Entity* ent;
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = 12;
this->field_0x82.HALF.HI &= ~0x80;
ent = this->child;
@@ -480,7 +480,7 @@ void sub_080244E8(Entity* this) {
}
break;
case 1 ... 2:
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = 192;
this->subtimer = 8;
this->speed = 0x80;
+4 -4
View File
@@ -84,7 +84,7 @@ void Puffstool_OnCollide(Entity* this) {
break;
default:
if (this->hitType == 0x82 && this->iframes < 0) {
Entity* ent = CreateObject(OBJECT_21, 2, 0);
Entity* ent = CreateObject(DIRT_PARTICLE, 2, 0);
if (ent != NULL) {
ent->spritePriority.b0 = 3;
CopyPosition(this, ent);
@@ -335,7 +335,7 @@ void sub_080255AC(Entity* this) {
tmp = Random() & 0xf;
if (tmp < 8) {
tmp -= 1;
tmp--;
}
tmp -= 7;
@@ -551,7 +551,7 @@ void sub_08025B18(Entity* this) {
for (; i < 9; i++, offset += 2) {
sub_08025AB8((((x + offset[0]) >> 4) & 0x3fU) | ((((y + offset[1]) >> 4) & 0x3fU) << 6), layer);
ent = CreateObject(OBJECT_21, 2, 0);
ent = CreateObject(DIRT_PARTICLE, 2, 0);
if (ent != NULL) {
PositionRelative(this, ent, Q_16_16(offset[0]), Q_16_16(offset[1]));
ent->x.HALF.HI &= -0x10;
@@ -565,7 +565,7 @@ void sub_08025B18(Entity* this) {
void sub_08025BD4(Entity* this) {
if (this->field_0x82.HALF.LO && (this->frame & 1) == 0) {
Entity* ent = CreateObject(OBJECT_21, 0, 0);
Entity* ent = CreateObject(DIRT_PARTICLE, 0, 0);
if (ent != NULL) {
PositionRelative(this, ent, Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 0]),
Q_16_16(gUnk_080CC0BA[this->animationState * 2 + 1]));
+1 -1
View File
@@ -235,7 +235,7 @@ void sub_08033B44(SpinyBeetleEntity* this) {
this->tileIndex = GetTileIndex(this->tile, super->collisionLayer);
if (this->tileIndex != 0x4022) {
stop += 1;
stop++;
} else {
switch (DirectionRound(super->direction) >> 2) {
case 0:
+1 -1
View File
@@ -60,7 +60,7 @@ void TreeItem(Entity* this) {
}
break;
case 0 ...(FAIRY_INDEX - 1):
itemEntity = CreateObject(OBJECT_96, 0x7, gTreeItemDrops[this->field_0x68.HALF.LO]);
itemEntity = CreateObject(GRAVEYARD_KEY, 0x7, gTreeItemDrops[this->field_0x68.HALF.LO]);
if (itemEntity) {
CopyPosition(this, itemEntity);
itemEntity->y.HALF.HI += 16;
+8 -8
View File
@@ -486,12 +486,12 @@ static void sub_08042B20(Entity* this) {
entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i];
if ((-0xa <= entity->z.HALF.HI) && ((entity->spriteSettings.draw) == 1)) {
if (i == 0) {
object = CreateObject(OBJECT_AF, 0, 0);
object = CreateObject(VAATI3_ARM, 0, 0);
if (object != NULL) {
object->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4];
}
*(Entity**)&((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->field_0x68 = object;
object = CreateObject(OBJECT_AF, 2, 0);
object = CreateObject(VAATI3_ARM, 2, 0);
if (object != NULL) {
CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[4], object);
}
@@ -582,7 +582,7 @@ static void sub_08042D24(Entity* this) {
this->subAction = 2;
this->hitType = 0x3d;
((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->hitType = 0x3d;
entity = CreateObject(OBJECT_AF, 1, 0);
entity = CreateObject(VAATI3_ARM, 1, 0);
if (entity != NULL) {
entity->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
}
@@ -602,7 +602,7 @@ static void sub_08042D6C(Entity* this) {
if (i != 2) {
entity->flags = entity->flags | ENT_COLLIDE;
}
if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) {
if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(VAATI3_ARM, 2, 0), object != NULL)) {
CopyPosition(entity, object);
SoundReq(SFX_166);
}
@@ -796,7 +796,7 @@ static void sub_08043130(Entity* this) {
for (i = 1; i < 4; i++) {
ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i];
if (ptr->unk04.HALF.HI != 0) {
ptr->unk04.HALF.HI -= 1;
ptr->unk04.HALF.HI--;
}
}
} else {
@@ -1276,9 +1276,9 @@ static void sub_08043C40(Entity* this, VaatiArm_HeapStruct1* heapStruct) {
iVar3 = (u8*)(int)((VaatiArm_HeapStruct*)this->myHeap) + offset;
if (puVar6[i] != iVar3[0xc]) {
if (puVar6[i] < iVar3[0xc]) {
iVar3[0xc] -= 1;
iVar3[0xc]--;
} else {
iVar3[0xc] += 1;
iVar3[0xc]++;
}
}
}
@@ -1412,7 +1412,7 @@ static void sub_08043EB8(Entity* this) {
pEVar4->collisionFlags = pEVar4->collisionFlags & 0xef;
pEVar4->hitType = 0x3a;
pEVar4->hitbox = (Hitbox*)&gUnk_080FD450;
pEVar4 = CreateObject(OBJECT_AF, 0, 0);
pEVar4 = CreateObject(VAATI3_ARM, 0, 0);
if (pEVar4 != NULL) {
pEVar4->parent = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3];
}
+1 -1
View File
@@ -181,7 +181,7 @@ void VaatiEyesMacroFunction0Type2(Entity* this) {
}
}
this->y.HALF.HI++;
this->spriteOffsetY -= 1;
this->spriteOffsetY--;
}
void VaatiEyesMacroFunction0Type3(Entity* this) {
+18 -18
View File
@@ -186,21 +186,21 @@ void VaatiTransfiguredType0Action1(Entity* this) {
break;
case 0:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->speed = 0x180;
this->timer = 20;
}
break;
case 1:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->speed = 0xc0;
this->timer = 12;
}
break;
case 2:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->speed = 0;
if (this->animationState < 2) {
this->timer = (Random() & 0x7f) + 64;
@@ -240,7 +240,7 @@ void VaatiTransfiguredType0Action1(Entity* this) {
if (--this->field_0x82.HALF.LO == 0) {
this->field_0x82.HALF.LO = 4;
object = CreateObject(OBJECT_9B, 0, ((this->direction + 0x12) & 0x1c) >> 2);
object = CreateObject(VAATI2_PARTICLE, 0, ((this->direction + 0x12) & 0x1c) >> 2);
if (object != NULL) {
object->parent = this;
object->x.HALF.HI += (Random() & 0xf) - 7;
@@ -347,7 +347,7 @@ void VaatiTransfiguredType0Action3(Entity* this) {
this->field_0x86.HALF.LO = 0;
sub_080408EC(this);
} else {
if (((this->timer & 1) != 0) && (pEVar3 = CreateObject(OBJECT_9B, 1, 0xff), pEVar3 != NULL)) {
if (((this->timer & 1) != 0) && (pEVar3 = CreateObject(VAATI2_PARTICLE, 1, 0xff), pEVar3 != NULL)) {
pEVar3->parent = this;
CopyPosition(this, pEVar3);
pEVar3->x.HALF.HI += (Random() & 0xf) - 7;
@@ -376,7 +376,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
switch (this->field_0x80.HALF.LO) {
case 0:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->field_0x74.HALF.LO = 0;
this->timer = 128;
this->subtimer = 0;
@@ -387,7 +387,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
case 1:
if (GravityUpdate(this, Q_8_8(40)) != 0)
break;
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
switch (this->cutsceneBeh.HALF.LO) {
case 1:
case 3:
@@ -409,7 +409,7 @@ void VaatiTransfiguredType0Action4(Entity* this) {
break;
case 2:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = gUnk_080D0ABF[((u32)this->animationState << 1 | 1)];
} else {
if ((this->timer & 7) == 0) {
@@ -444,7 +444,7 @@ void VaatiTransfiguredType0Action5(Entity* this) {
switch (this->field_0x80.HALF.LO) {
case 0:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = 64;
if (1 < this->animationState) {
this->timer = 128;
@@ -454,7 +454,7 @@ void VaatiTransfiguredType0Action5(Entity* this) {
break;
case 1:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = gUnk_080D0ABF[(this->animationState << 1 | 1)];
} else {
if (this->subtimer) {
@@ -497,7 +497,7 @@ void VaatiTransfiguredType0Action6(Entity* this) {
switch (this->field_0x80.HALF.LO) {
case 0:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = 128;
if (1 < this->animationState) {
this->subtimer = 1;
@@ -506,7 +506,7 @@ void VaatiTransfiguredType0Action6(Entity* this) {
break;
case 1:
if (--this->timer == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->timer = gUnk_080D0ABF[(this->animationState << 1) | 1];
} else {
if (this->subtimer) {
@@ -746,7 +746,7 @@ void VaatiTransfiguredType4Action1(Entity* this) {
}
} else {
if (this->field_0x80.HALF.LO == 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->spriteSettings.draw = 1;
}
if (--this->timer == 0) {
@@ -781,7 +781,7 @@ void VaatiTransfiguredType5Action1(Entity* this) {
if (this->parent->action != 6) {
return;
}
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 1);
break;
@@ -815,7 +815,7 @@ void VaatiTransfiguredType5Action2(Entity* this) {
if (this->field_0x80.HALF.LO == 0) {
if (this->parent->parent->action != 6) {
if ((this->frame & ANIM_DONE) != 0) {
this->field_0x80.HALF.LO += 1;
this->field_0x80.HALF.LO++;
InitializeAnimation(this, 3);
}
}
@@ -904,7 +904,7 @@ void sub_08040770(Entity* this) {
if (EntityWithinDistance(this, tmp5, tmp6, 0x1c)) {
if (this->animationState != 2) {
if (tmp & 8) {
tmp2 += 1;
tmp2++;
} else {
tmp2 += 3;
}
@@ -936,7 +936,7 @@ void sub_08040770(Entity* this) {
} else {
if (this->field_0x86.HALF.HI & 0x7f) {
if (this->field_0x86.HALF.HI & 0x80) {
tmp2 += 1;
tmp2++;
} else {
tmp2 += 3;
}
@@ -952,7 +952,7 @@ void sub_08040770(Entity* this) {
}
this->field_0x86.HALF.HI = tmp3;
if (tmp3 & 0x80) {
tmp2 += 1;
tmp2++;
} else {
tmp2 += 3;
}
+2 -2
View File
@@ -65,7 +65,7 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) {
if (this->field_0x80.HALF.HI == 0) {
this->action = 3;
this->field_0x80.HALF.HI += 1;
this->field_0x80.HALF.HI++;
InitializeAnimation(this, (this->type << 3) | (this->timer + 2));
InitializeAnimation(this->parent, (this->parent->type << 3) | (this->timer + 2));
}
@@ -80,7 +80,7 @@ void VaatiTransfiguredEye_OnCollision(Entity* this) {
if (this->timer != 0 && (pEVar4->field_0x80.HALF.HI != 0)) {
pEVar4->field_0x76.HALF.LO |= (1 << this->type2);
if (this->cutsceneBeh.HALF.HI == 0) {
this->cutsceneBeh.HALF.HI += 1;
this->cutsceneBeh.HALF.HI++;
InitializeAnimation(this, this->type << 3 | 6);
InitializeAnimation(this->parent, this->parent->type << 3 | 6);
}
+6 -6
View File
@@ -327,7 +327,7 @@ void VaatiWrathType0Action5(Entity* this) {
if (this->field_0x78.HALF.HI == 0) {
if (this->subAction == 2) {
if ((gRoomTransition.field_0x39 & 3) == 0) {
object = CreateObject(OBJECT_B5, 0, 0);
object = CreateObject(VAATI3_PLAYER_OBJECT, 0, 0);
if (object != NULL) {
object->parent = this;
((VaatiWrathHeapStruct*)this->myHeap)->object5b = object;
@@ -639,10 +639,10 @@ void sub_08041D14(Entity* this) {
this->timer--;
} else {
if (gEntCount < 0x46) {
pEVar1 = CreateObject(OBJECT_B6, 0, 0);
pEVar1 = CreateObject(VAATI3_DEATH, 0, 0);
pEVar1->parent = this;
this->child = pEVar1;
pEVar1 = CreateObject(OBJECT_B6, 1, 0);
pEVar1 = CreateObject(VAATI3_DEATH, 1, 0);
pEVar1->parent = this;
this->subAction = 3;
this->timer = 150;
@@ -680,7 +680,7 @@ void sub_08041D84(Entity* this) {
}
void sub_08041E20(Entity* this) {
this->subtimer += 1;
this->subtimer++;
sub_08041E78(this);
GetNextFrame(((VaatiWrathHeapStruct*)this->myHeap)->type2);
if (gFadeControl.active == 0) {
@@ -1052,7 +1052,7 @@ void VaatiWrathType2(Entity* this) {
InitializeAnimation(this, 0x12);
}
sub_0806FA90(((VaatiWrathHeapStruct*)this->myHeap)->type0, this, 0, -1);
this->spriteOffsetY += 1;
this->spriteOffsetY++;
if (this->animIndex == 0x12) {
uVar1 = GetFacingDirection(this, &gPlayerEntity);
this->x.HALF.HI = gUnk_080D0EB0[uVar1] + this->x.HALF.HI;
@@ -1069,6 +1069,6 @@ void VaatiWrathType3(Entity* this) {
InitializeAnimation(this, 0x1c);
}
sub_0806FA90(((VaatiWrathHeapStruct*)this->myHeap)->type0, this, 0, -1);
this->spriteOffsetY += 1;
this->spriteOffsetY++;
GetNextFrame(this);
}
+1 -1
View File
@@ -33,7 +33,7 @@ void sub_0802A250(Entity* this) {
InitializeAnimation(this, 0);
UpdateSpriteForCollisionLayer(this);
ent = CreateObject(OBJECT_66, 0, 0);
ent = CreateObject(WATER_DROP_OBJECT, 0, 0);
if (ent != NULL) {
ent->parent = this;
}
+2 -2
View File
@@ -30,7 +30,7 @@ void WizzrobeIce_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeIce_Functions);
if (super->contactFlags == 0x87) {
Entity* obj = CreateObject(OBJECT_2A, 3, 0);
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;
obj->spriteOffsetY = -4;
@@ -99,7 +99,7 @@ void WizzrobeIce_Action2(WizzrobeEntity* this) {
case 0:
switch (--super->timer) {
case 0:
this->timer2 += 1;
this->timer2++;
super->timer = 56;
super->subtimer = 0;
super->child->spriteSettings.draw = 0;
+1 -1
View File
@@ -37,7 +37,7 @@ void WizzrobeWind_OnCollision(WizzrobeEntity* this) {
}
EnemyFunctionHandlerAfterCollision(super, WizzrobeWind_Functions);
if (super->contactFlags == 0x87) {
Entity* obj = CreateObject(OBJECT_2A, 3, 0);
Entity* obj = CreateObject(FLAME, 3, 0);
if (obj != NULL) {
obj->spritePriority.b0 = 3;
obj->spriteOffsetY = -4;
+2 -2
View File
@@ -53,7 +53,7 @@ bool32 EnemyInit(GenericEntity* this) {
if ((this->field_0x6c.HALF.HI & 0x20) != 0) {
u32 uVar4 = gUnk_080D3E74[super->id >> 3] >> ((super->id & 7) << 1) & 3;
if (uVar4 != 0) {
Entity* object = CreateObject(OBJECT_A9, uVar4 - 1, 0);
Entity* object = CreateObject(MULLDOZER_SPAWN_POINT, uVar4 - 1, 0);
if (object != NULL) {
object->timer = super->flags;
object->subtimer = super->spriteSettings.draw;
@@ -128,7 +128,7 @@ void CreateDeathFx(GenericEntity* parent, u32 parentId, u32 fixedItem) {
int tmp = parent->base.gustJarState & 2;
if (tmp == 0) {
sub_08049CF4(&(parent->base));
gSave.unk50 += 1;
gSave.unk50++;
parent->base.gustJarState |= 2;
parent->base.timer = 255;
SetDefaultPriority(&(parent->base), 3);
+1 -1
View File
@@ -49,7 +49,7 @@ void sub_0804AAD4(void) {
MemClear(&gUnk_02018EB0, 0x28);
gUnk_02018EB0.unk_14 = NULL;
EraseAllEntities();
CreateObject(OBJECT_3D, gArea.portal_type, 0);
CreateObject(MINISH_PORTAL_CLOSEUP, gArea.portal_type, 0);
gArea.filler[8]++;
}
+25 -25
View File
@@ -5,17 +5,17 @@
* @brief File select task
*/
#include "fileselect.h"
#include "main.h"
#include "common.h"
#include "screen.h"
#include "fileselect.h"
#include "functions.h"
#include "game.h"
#include "item.h"
#include "main.h"
#include "menu.h"
#include "message.h"
#include "object.h"
#include "functions.h"
#include "screen.h"
#include "subtask.h"
#include "item.h"
#include "game.h"
#include "ui.h"
// copy, erase, start
@@ -99,7 +99,7 @@ extern void (*const gUnk_080FC9B0[])(void);
extern void (*const gUnk_080FC9BC[])(void);
extern void (*const gUnk_080FC9C8[])(void);
static void sub_08050624(u32);
static void ResetEmptyOrDeletedSaveFile(u32);
static void sub_0805066C(void);
static void HideButtonR(void);
static void ShowButtonR(void);
@@ -216,10 +216,10 @@ static void HandleFileScreenEnter(void) {
gUI.lastState = 8;
SetFileSelectState(STATE_NONE);
InitDMA();
sub_08050624(0);
sub_08050624(1);
sub_08050624(2);
sub_08056208();
ResetEmptyOrDeletedSaveFile(0);
ResetEmptyOrDeletedSaveFile(1);
ResetEmptyOrDeletedSaveFile(2);
InitVBlankDMA();
sub_080503A8(0x5);
LoadPaletteGroup(0x9);
for (i = 0; i < 26; i++) {
@@ -247,18 +247,18 @@ static void HandleFileScreenExit(void) {
}
}
static void sub_08050624(u32 idx) {
SaveFile* saveFile = &gMapDataBottomSpecial.saves[idx];
int status = ReadSaveFile(idx, saveFile);
static void ResetEmptyOrDeletedSaveFile(u32 index) {
SaveFile* saveFile = &gMapDataBottomSpecial.saves[index];
int status = ReadSaveFile(index, saveFile);
switch (status) {
case SAVE_DELETED:
SetFileStatusDeleted(idx);
SetFileStatusDeleted(index);
// fallthrough
case SAVE_EMPTY:
sub_0805194C(idx);
ResetSaveFile(index);
break;
}
gMapDataBottomSpecial.saveStatus[idx] = status;
gMapDataBottomSpecial.saveStatus[index] = status;
}
static void sub_0805066C(void) {
@@ -378,14 +378,14 @@ void sub_08050888(void) {
if (!gFadeControl.active) {
switch (gMapDataBottomSpecial.saveStatus[gMapDataBottomSpecial.unk7]) {
case SAVE_EMPTY:
sub_0805194C(gMapDataBottomSpecial.unk7);
ResetSaveFile(gMapDataBottomSpecial.unk7);
gChooseFileState.subState = 2;
break;
case SAVE_VALID:
gChooseFileState.subState = 2;
break;
default:
sub_0805194C(gMapDataBottomSpecial.unk7);
ResetSaveFile(gMapDataBottomSpecial.unk7);
CreateDialogBox(0, gMapDataBottomSpecial.unk7 + 1);
gChooseFileState.timer = 30;
gChooseFileState.subState = 1;
@@ -834,7 +834,7 @@ void sub_08050FFC(void) {
switch (HandleSave(0)) {
case SAVE_ERROR:
gMenu.transitionTimer = 30;
sub_0805194C(gMapDataBottomSpecial.unk6);
ResetSaveFile(gMapDataBottomSpecial.unk6);
CreateDialogBox(9, 0);
case SAVE_OK:
SetMenuType(3);
@@ -903,7 +903,7 @@ void sub_080513C0(void) {
case 0:
break;
case -1:
sub_0805194C(gMapDataBottomSpecial.unk6);
ResetSaveFile(gMapDataBottomSpecial.unk6);
CreateDialogBox(6, 0);
gMenu.transitionTimer = 30;
gMenu.overlayType = 2;
@@ -1083,7 +1083,7 @@ void sub_080515D4(void) {
void sub_080516E0(void) {
if (HandleSave(1)) {
sub_0805194C(gMapDataBottomSpecial.unk6);
ResetSaveFile(gMapDataBottomSpecial.unk6);
sub_08050AFC(gMapDataBottomSpecial.unk6);
gMenu.transitionTimer = 2;
SetFileSelectState(0);
@@ -1192,7 +1192,7 @@ void sub_08051874(void) {
SetFileSelectState(0);
break;
case -1:
sub_0805194C(gMapDataBottomSpecial.unk7);
ResetSaveFile(gMapDataBottomSpecial.unk7);
CreateDialogBox(3, 0);
gMenu.transitionTimer = 30;
SetMenuType(3);
@@ -1223,12 +1223,12 @@ void HandleFileStart(void) {
}
}
void sub_0805194C(u32 save_idx) {
void ResetSaveFile(u32 save_idx) {
SaveFile* save;
gMapDataBottomSpecial.saveStatus[save_idx] = 0;
save = &gMapDataBottomSpecial.saves[save_idx];
MemClear(save, sizeof(*save));
MemClear(save, sizeof(SaveFile));
save->msg_speed = 1;
save->brightness = 1;
save->stats.health = 24;
+1 -1
View File
@@ -2682,7 +2682,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
droptable.s.arrows += 3;
}
if (gSave.stats.rupees <= 10) {
droptable.s.rupee5 += 1;
droptable.s.rupee5++;
}
ptr2 = &gDroptableModifiers[DROPTABLE_NONE];
r0 = gSave.stats.hasAllFigurines;
+10 -14
View File
@@ -22,15 +22,10 @@ void ram_IntrMain(void);
static void sub_080171F0(void);
static void HandlePlayerLife(Entity* this);
struct {
u8 ready;
u16* src;
u16* dest;
u32 size;
} extern gUnk_02022730;
extern VBlankDMA gVBlankDMA;
void sub_08016CA8(BgSettings* bg);
void sub_08016BF8(void);
void PerformVBlankDMA(void);
void DispCtrlSet(void);
void DummyIntr(void) {
@@ -49,10 +44,10 @@ void VBlankIntr(void) {
m4aSoundVSync();
if (gMain.interruptFlag == 0) {
DispCtrlSet();
DmaCopy32(0, &gScreen._6c, &gUnk_02022730, 16);
DmaCopy32(0, &gScreen.vBlankDMA, &gVBlankDMA, sizeof(VBlankDMA));
gMain.interruptFlag = 1;
}
sub_08016BF8();
PerformVBlankDMA();
INTR_CHECK |= 1;
}
@@ -61,13 +56,14 @@ void HBlankIntr(void) {
m4aSoundMain();
}
void sub_08016BF8(void) {
if (gUnk_02022730.ready) {
const u16* src = gUnk_02022730.src;
u16* dest = gUnk_02022730.dest;
s32 size, i = size = gUnk_02022730.size;
void PerformVBlankDMA(void) {
if (gVBlankDMA.ready) {
const u16* src = gVBlankDMA.src;
u16* dest = gVBlankDMA.dest;
s32 size, i = size = gVBlankDMA.size;
DmaSet(0, src, dest, size);
// TODO Why is it copied again?
i = size & 0x3fff;
if (i == 0) {
i = 0x4000;
+6 -6
View File
@@ -41,7 +41,7 @@ void sub_08075A0C(ItemBehavior* this, u32 idx) {
this->behaviorID = 0x10;
ForceEquipItem(ITEM_LANTERN_ON, itemSlot);
tmp = &gUnk_08126EEC[gPlayerEntity.animationState & 6];
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_45, 1, 0);
object = CreateObjectWithParent(&gPlayerEntity, LAMP_PARTICLE, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
@@ -60,7 +60,7 @@ void sub_08075ADC(ItemBehavior* this, u32 idx) {
(this->field_0x5[9] & 1) == 0 || (gPlayerState.flags & (PL_DISABLE_ITEMS | PL_CAPTURED)) != 0 ||
sub_08079D48() == 0) {
this->field_0xf = 0;
this->stateID += 1;
this->stateID++;
gPlayerState.flags |= PL_USE_LANTERN;
bVar1 = 8 >> idx;
gPlayerState.field_0x3[1] = gPlayerState.field_0x3[1] & ~((bVar1 << 4) | bVar1);
@@ -95,9 +95,9 @@ void sub_08075B54(ItemBehavior* this, u32 idx) {
(sub_080B1BA4(TILE(gPlayerEntity.x.HALF.HI + tmp[0], gPlayerEntity.y.HALF.HI + tmp[1]),
gPlayerEntity.collisionLayer, 0x40) != 0)) {
this->field_0xf = 0xf;
this->stateID += 1;
this->stateID++;
gPlayerEntity.field_0x7a.HWORD = 2;
object = CreateObjectWithParent(&gPlayerEntity, OBJECT_45, 1, 0);
object = CreateObjectWithParent(&gPlayerEntity, LAMP_PARTICLE, 1, 0);
if (object != NULL) {
object->spriteVramOffset = gPlayerEntity.spriteVramOffset;
object->x.HALF.HI = tmp[0] + object->x.HALF.HI;
@@ -123,10 +123,10 @@ void sub_08075C9C(ItemBehavior* this, u32 idx) {
}
if ((this->field_0x5[9] & 0x80) != 0) {
this->field_0xf = 0;
this->stateID -= 1;
this->stateID--;
gPlayerState.field_0xa = (~(8 >> idx)) & gPlayerState.field_0xa;
gPlayerState.keepFacing = (~(8 >> idx)) & gPlayerState.keepFacing;
} else {
gPlayerEntity.field_0x7a.HWORD += 1;
gPlayerEntity.field_0x7a.HWORD++;
}
}
+1 -1
View File
@@ -138,7 +138,7 @@ void sub_080772A8(ItemBehavior* this, u32 idx) {
gPlayerEntity.frameDuration = 1;
if (sub_0807B5B0(&gPlayerEntity)) {
SoundReq(SFX_108);
CreateObjectWithParent(&gPlayerEntity, OBJECT_1E, this->field_0x5[9], 0);
CreateObjectWithParent(&gPlayerEntity, MOLE_MITTS_PARTICLE, this->field_0x5[9], 0);
} else {
sub_08077DF4(this, 0x51c);
effect = CreateFx(&gPlayerEntity, FX_STARS_STRIKE, 0);
+1 -1
View File
@@ -156,7 +156,7 @@ void sub_08076A88(ItemBehavior* this, u32 idx) {
return;
}
ptr = gUnk_0811BE38;
if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.field_0x90) == 0) {
if ((*(u16*)&ptr[(gPlayerEntity.animationState & 0xfe)] & gPlayerState.playerInput.field_0x90) == 0) {
this->field_0x5[6] = (this->field_0x5[5] & 0xe) * 4;
if ((gPlayerState.field_0xd != 0xff) && (gPlayerState.field_0xd != this->field_0x5[6])) {
if (((gPlayerState.field_0xd - this->field_0x5[6]) & 0x1f) < 0x10) {
+1 -1
View File
@@ -148,7 +148,7 @@ void sub_08075580(ItemBehavior* this, u32 idx) {
this->field_0x5[2] = 0x50;
}
sub_08077DF4(this, 0x168);
CreateObject(OBJECT_43, 0, 0);
CreateObject(SWORD_PARTICLE, 0, 0);
return;
}
sub_080759B8(this, idx);
+4 -3
View File
@@ -91,12 +91,12 @@ void sub_08076488(ItemBehavior* this, u32 idx) {
bVar1 = ~(8 >> idx);
gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing;
gPlayerState.field_0xa = bVar1 & gPlayerState.field_0xa;
this->stateID += 1;
this->stateID++;
this->field_0xf = 0;
}
}
} else {
this->field_0x5[2] -= 1;
this->field_0x5[2]--;
}
gPlayerState.framestate = PL_STATE_HOLD;
}
@@ -108,7 +108,8 @@ void sub_08076518(ItemBehavior* this, u32 index) {
if (gPlayerEntity.knockbackDuration != 0) {
PlayerCancelHoldItem(this, index);
} else {
if ((gPlayerState.field_0x92 & 0x8018) != 0) {
if ((gPlayerState.playerInput.field_0x92 & (PLAYER_INPUT_8000 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) !=
0) {
sub_0806F948(&gPlayerEntity);
gPlayerState.heldObject = 5;
this->field_0x18->subAction = 2;
+42 -45
View File
@@ -1,18 +1,25 @@
#include "sound.h"
#include "functions.h"
/**
* @file main.c
*
* @brief Contains the main game loop.
*/
#include "main.h"
#include "screen.h"
#include "common.h"
#include "save.h"
#include "message.h"
#include "interrupts.h"
#include "functions.h"
#include "game.h"
#include "interrupts.h"
#include "message.h"
#include "save.h"
#include "screen.h"
#include "sound.h"
extern u32 gRand;
static void InitOverlays(void);
static bool32 SoftResetKeysPressed(void);
/*static*/ u32 CheckHeaderValid(void);
/*static*/ void InitSaveHeader(void);
void (*const sTaskHandlers[])(void) = {
[TASK_TITLE] = TitleTask,
@@ -26,16 +33,15 @@ void (*const sTaskHandlers[])(void) = {
[TASK_STAFFROLL] = StaffrollTask, [TASK_DEBUG] = DebugTask,
};
/*static*/ void sub_080560B8(void);
void AgbMain(void) {
// Initialization
InitOverlays();
InitSound();
InitDMA();
InitSaveData();
sub_080560B8();
sub_08056208();
gUnk_02000010.field_0x4 = 193;
InitSaveHeader();
InitVBlankDMA();
gUnk_02000010.field_0x4 = 0xc1;
InitFade();
DmaCopy32(3, BG_PLTT, gPaletteBuffer, BG_PLTT_SIZE);
SetBrightness(1);
@@ -44,7 +50,9 @@ void AgbMain(void) {
gRand = 0x1234567;
MemClear(&gMain, sizeof(gMain));
SetTask(TASK_TITLE);
while (1) {
// Game Loop
while (TRUE) {
ReadKeyInput();
if (SoftResetKeysPressed()) {
DoSoftReset();
@@ -71,7 +79,7 @@ void AgbMain(void) {
}
}
gMain.ticks.HWORD++;
gMain.ticks++;
sTaskHandlers[gMain.task]();
MessageMain();
FadeMain();
@@ -144,18 +152,7 @@ void DoSoftReset(void) {
SoftReset(RESET_ALL & ~(RESET_EWRAM | RESET_SIO_REGS));
}
typedef struct {
int signature;
u8 saveFileId;
u8 msg_speed;
u8 brightness;
u8 language;
u8 name[6];
u8 invalid;
u8 initialized;
} Defaults;
const Defaults sDefaultSettings = {
const SaveHeader sDefaultSettings = {
.signature = SIGNATURE,
.saveFileId = 0,
.msg_speed = 1,
@@ -171,19 +168,19 @@ const Defaults sDefaultSettings = {
};
// single misplaced ldr
NONMATCH("asm/non_matching/sub_080560B8.inc", /*static*/ void sub_080560B8(void)) {
NONMATCH("asm/non_matching/InitSaveHeader.inc", /*static*/ void InitSaveHeader(void)) {
u32 b;
if (!CheckHeaderValid()) {
switch ((s32)Read_02000000(gSaveHeader)) {
switch ((s32)ReadSaveHeader(gSaveHeader)) {
case 1:
if (CheckHeaderValid())
break;
case 0:
case -1:
default:
MemCopy(&sDefaultSettings, gSaveHeader, sizeof *gSaveHeader);
Write_02000000(gSaveHeader);
MemCopy(&sDefaultSettings, gSaveHeader, sizeof(SaveHeader));
WriteSaveHeader(gSaveHeader);
break;
}
}
@@ -220,8 +217,8 @@ END_NONMATCH
void InitDMA(void) {
SoundReq(SONG_VSYNC_OFF);
gScreen._6d = gScreen._6c;
gScreen._6c = 0;
gScreen.vBlankDMA.readyBackup = gScreen.vBlankDMA.ready;
gScreen.vBlankDMA.ready = FALSE;
DmaStop(0);
@@ -231,27 +228,27 @@ void InitDMA(void) {
DmaWait(3);
}
void sub_08056208(void) {
void InitVBlankDMA(void) {
SoundReq(SONG_VSYNC_ON);
gScreen._6c = gScreen._6d;
gScreen._6d = 0;
gScreen.vBlankDMA.ready = gScreen.vBlankDMA.readyBackup;
gScreen.vBlankDMA.readyBackup = FALSE;
}
void sub_0805622C(struct BgAffineDstData* a1, u32 a2, u32 a3) {
gScreen._70 = a1;
gScreen._74 = a2;
gScreen._78 = a3;
gScreen._6c = 1;
void SetVBlankDMA(u16* src, u16* dest, u32 size) {
gScreen.vBlankDMA.src = src;
gScreen.vBlankDMA.dest = dest;
gScreen.vBlankDMA.size = size;
gScreen.vBlankDMA.ready = TRUE;
gUnk_03003DE4[0] ^= 1;
}
void sub_08056250(void) {
gScreen._6c = 0;
void DisableVBlankDMA(void) {
gScreen.vBlankDMA.ready = FALSE;
}
void SetSleepMode(void) {
u32 restore;
Main* m;
Main* main;
REG_DISPCNT = DISPCNT_FORCED_BLANK;
REG_KEYCNT = KEY_AND_INTR | L_BUTTON | R_BUTTON | SELECT_BUTTON;
@@ -263,9 +260,9 @@ void SetSleepMode(void) {
REG_IME = 0;
REG_IE = restore;
REG_IME = 1;
m = &gMain;
*(vu8*)&m->sleepStatus; // force a read
m->sleepStatus = 0;
main = &gMain;
*(vu8*)&main->sleepStatus; // force a read
main->sleepStatus = 0;
}
// Convert AABB to screen coordinates and check if it's within the viewport
+1 -1
View File
@@ -41,7 +41,7 @@ void AngryStatueManager_Init(AngryStatueManager* this) {
object->parent = (Entity*)this;
ResolveCollisionLayer(object);
this->field_0x20[counter] = object;
counter += 1;
counter++;
objectData += 3;
}
super->action = 1;
+1 -1
View File
@@ -45,7 +45,7 @@ void CameraTargetManager_Action1(CameraTargetManager* this) {
super->timer = 30;
}
super->parent = gRoomControls.camera_target;
object = CreateObject(OBJECT_69, 0, 0);
object = CreateObject(CUTSCENE_ORCHESTRATOR, 0, 0);
if (object != NULL) {
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
object->y.HALF.HI = this->field_0x3a + gRoomControls.origin_y;
+2 -2
View File
@@ -72,8 +72,8 @@ void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) {
this->itemActive[count] = 1;
}
}
count += 1;
spawnData += 1;
count++;
spawnData++;
}
}
for (count = 0; count < 3; ++count) {
+2 -2
View File
@@ -87,14 +87,14 @@ void sub_0805B048(HoleManager* this) {
}
if (!tmp->unk_10)
return;
obj = CreateObject(OBJECT_28, tmp->unk_10->unk_00, tmp->unk_10->unk_01);
obj = CreateObject(PARALLAX_ROOM_VIEW, tmp->unk_10->unk_00, tmp->unk_10->unk_01);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.origin_x;
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.origin_y;
}
if (super->type != 0xa || CheckLocalFlag(0x4B))
return;
obj = CreateObject(OBJECT_28, 3, 3);
obj = CreateObject(PARALLAX_ROOM_VIEW, 3, 3);
if (obj) {
obj->x.HALF.HI = tmp->unk_10->unk_04 + gRoomControls.origin_x;
obj->y.HALF.HI = tmp->unk_10->unk_06 + gRoomControls.origin_y;
@@ -62,13 +62,13 @@ void sub_08057F20(HorizontalMinishPathBackgroundManager* this) {
}
}
void sub_08058004(u32 unk1, void* unk2, void* unk3) {
void sub_08058004(u32 unk1, void* src, void* dest) {
u32 tmp = 0x20;
unk2 += (unk1 >> 4) << 2;
src += (unk1 >> 4) << 2;
for (tmp; tmp != 0; tmp--) {
DmaSet(3, unk2, unk3, 0x80000020);
unk2 += 0x100;
unk3 += 0x40;
DmaCopy16(3, src, dest, 0x20 * 2);
src += 0x100;
dest += 0x40;
}
}
@@ -94,7 +94,7 @@ void sub_08058034(void) {
void sub_08058084(u16* unk1, u16* unk2) {
u32 tmp;
for (tmp = 0; tmp < 0x20; tmp++, unk1 += 0x20, unk2 += 0x80) {
DmaSet(3, unk1, unk2, 0x80000020);
DmaCopy16(3, unk1, unk2, 0x20 * 2);
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
*
* @brief Keeps track in its bitfield of whether 0x10 x 0x10 rects at certain positions are on the screen.
*
* Spawns OBJECT_1C objects that check this and unsets the value in the bitfield.
* Spawns HOUSE_SIGN objects that check this and unsets the value in the bitfield.
* Creates the signs on the houses in hyrule town.
*/
#include "manager/houseSignManager.h"
@@ -57,7 +57,7 @@ void HouseSignManager_Main(HouseSignManager* this) {
u32 bitfieldFlag = 1 << type2;
if ((((this->bitfield & bitfieldFlag) == 0) &&
(CheckRectOnScreen(spawnData->x, spawnData->y, 0x10, 0x10) != 0))) {
Entity* object = CreateObject(OBJECT_1C, spawnData->type, type2);
Entity* object = CreateObject(HOUSE_SIGN, spawnData->type, type2);
if (object != NULL) {
object->frameIndex = spawnData->frameIndex;
object->x.HALF.HI = gRoomControls.origin_x + spawnData->x;
+1 -1
View File
@@ -24,7 +24,7 @@ void HyruleTownBellManager_Main(HyruleTownBellManager* this) {
}
} else {
if (--super->timer == 0) {
Entity* object = CreateObject(OBJECT_96, 1, 0);
Entity* object = CreateObject(GRAVEYARD_KEY, 1, 0);
if (object != NULL) {
object->x.HALF.HI = roomControls->origin_x + 0x1f8;
object->y.HALF.HI = roomControls->origin_y + 0x140;
+1 -1
View File
@@ -144,7 +144,7 @@ void sub_0805BE94(LightLevelSetManager* this) {
}
void sub_0805BEC4(LightLevelSetManager* this) {
Entity* object = CreateObject(OBJECT_2A, 1, 0);
Entity* object = CreateObject(FLAME, 1, 0);
if (object != NULL) {
*(s8*)(&object->flags + 1) = ((*(s8*)(&object->flags + 1)) & (-0x10)) | 3;
object->x.HALF.HI = this->field_0x38 + gRoomControls.origin_x;
+28 -26
View File
@@ -13,9 +13,9 @@
#include "main.h"
#include "screen.h"
extern void sub_08056250(void);
extern void DisableVBlankDMA(void);
void (*const gUnk_08107C5C[])(LightRayManager*);
void (*const LightRayManager_Actions[])(LightRayManager*);
void (*const gUnk_08107C48[])(LightRayManager*);
const u16 gUnk_08107C1C[];
const u16 gUnk_08107C30[];
@@ -35,22 +35,22 @@ typedef struct {
#define ZS(this) ((u8*)&this->speed)
void LightRayManager_Main(LightRayManager* this) {
u8 bVar1;
u8 gfxGroup;
u8* pbVar2;
gUnk_08107C5C[super->action](this);
LightRayManager_Actions[super->action](this);
gUnk_08107C48[this->unk_21](this);
bVar1 = gLightRayManagerGfxGroups[this->unk_21];
if ((bVar1 != 0) && (this->unk_20 != bVar1)) {
this->unk_20 = bVar1;
LoadGfxGroup(bVar1);
gfxGroup = gLightRayManagerGfxGroups[this->unk_21];
if ((gfxGroup != 0) && (this->gfxGroup != gfxGroup)) {
this->gfxGroup = gfxGroup;
LoadGfxGroup(gfxGroup);
}
}
static void sub_080570B8(LightRayManager* this) {
static void LightRayManager_EnterRoom(LightRayManager* this) {
u8* pbVar1;
LoadGfxGroup(this->unk_20);
LoadGfxGroup(this->gfxGroup);
this->unk_34 = NULL;
pbVar1 = &this->unk_21;
if (*pbVar1 == 3) {
@@ -60,15 +60,15 @@ static void sub_080570B8(LightRayManager* this) {
}
}
static void sub_080570F8(void) {
static void LightRayManager_ExitRoom(void) {
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
gScreen.controls.layerFXControl = 0;
sub_08056250();
DisableVBlankDMA();
}
void sub_08057118(LightRayManager* this) {
void LightRayManager_Init(LightRayManager* this) {
super->timer = 0;
this->unk_20 = 0;
this->gfxGroup = 0;
this->unk_21 = 0;
this->unk_22 = 0;
super->action = 1;
@@ -76,10 +76,10 @@ void sub_08057118(LightRayManager* this) {
gScreen.lcd.displayControl |= DISPCNT_BG3_ON;
gScreen.controls.layerFXControl = 0x3648;
gScreen.controls.alphaBlend = 0x1000;
RegisterTransitionManager(this, sub_080570B8, sub_080570F8);
RegisterTransitionManager(this, LightRayManager_EnterRoom, LightRayManager_ExitRoom);
}
void sub_08057174(LightRayManager* this) {
void LightRayManager_Action1(LightRayManager* this) {
LightRayManagerProp* prop = GetCurrentRoomProperty(super->type);
s32 temp;
s32 x;
@@ -114,7 +114,7 @@ void sub_08057174(LightRayManager* this) {
if (this->unk_21 == 0) {
super->action = 2;
super->timer = 0;
this->unk_20 = 0;
this->gfxGroup = 0;
}
break;
case 6:
@@ -149,7 +149,7 @@ void sub_08057174(LightRayManager* this) {
}
}
void sub_0805728C(LightRayManager* this) {
void LightRayManager_Action2(LightRayManager* this) {
if (--super->subtimer == 0) {
super->subtimer = 8;
gScreen.controls.alphaBlend = gUnk_08107C1C[super->timer++];
@@ -161,7 +161,7 @@ void sub_0805728C(LightRayManager* this) {
}
}
void sub_080572D4(LightRayManager* this) {
void LightRayManager_Action3(LightRayManager* this) {
if (--super->subtimer == 0) {
super->subtimer = 8;
gScreen.controls.alphaBlend = gUnk_08107C1C[super->timer--];
@@ -170,7 +170,7 @@ void sub_080572D4(LightRayManager* this) {
super->action = 1;
this->unk_22 = 0;
this->unk_21 = 0;
gScreen._6c = 0;
gScreen.vBlankDMA.ready = FALSE;
}
}
}
@@ -183,7 +183,9 @@ void sub_0805732C(u32 param_1, u32 param_2) {
*ptr = gSineTable[(param_2 + index) & 0xff] * param_1 / 0x100 + gScreen.bg3.xOffset;
}
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], REG_ADDR_BG3HOFS, 0xa2600001UL);
SetVBlankDMA(&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], (u16*)REG_ADDR_BG3HOFS,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x1);
}
void nullsub_494() {
@@ -253,9 +255,9 @@ void (*const gUnk_08107C48[])(LightRayManager*) = {
nullsub_494, nullsub_494, sub_080573AC, nullsub_494, sub_08057450,
};
void (*const gUnk_08107C5C[])(LightRayManager*) = {
sub_08057118,
sub_08057174,
sub_0805728C,
sub_080572D4,
void (*const LightRayManager_Actions[])(LightRayManager*) = {
LightRayManager_Init,
LightRayManager_Action1,
LightRayManager_Action2,
LightRayManager_Action3,
};
+2 -2
View File
@@ -57,7 +57,7 @@ void sub_080582A0(u32 unk, u32* unk2, u16* unk3) {
int i = 0x20;
unk2 += unk >> 4;
for (; i != 0; i--) {
DmaSet(3, unk2, unk3, 0x80000020);
DmaCopy16(3, unk2, unk3, 0x20 * 2);
unk2 += 0x40;
unk3 += 0x20;
}
@@ -75,7 +75,7 @@ void sub_080582D0(void) {
void sub_080582F8(u8* unk, u8* unk2) {
u32 i;
for (i = 0; i < 0x20; i++, unk += 0x40, unk2 += 0x100) {
DmaSet(3, unk, unk2, 0x80000020);
DmaCopy16(3, unk, unk2, 0x20 * 2);
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ void MinishSizedEntranceManager_Main(MinishSizedEntranceManager* this) {
} else {
this->field_0x20 &= ~(1 << count);
}
spawnData += 1;
spawnData++;
}
}
+1 -1
View File
@@ -185,7 +185,7 @@ void sub_08057E7C(u32 unk1) {
LoadPaletteGroup(gUnk_081081E4[unk1]);
tmp2 = &gUnk_081080A4[unk1 << 4];
for (tmp = 0; tmp < 8; tmp++, tmp2 += 2) {
DmaSet(3, &gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x84000400);
DmaCopy32(3, &gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x400 * 4);
}
gRoomVars.unk_10[0] = unk1;
}
+4 -4
View File
@@ -129,7 +129,7 @@ void sub_08058F44(u32 unk0, u32 unk1, u32 unk2) {
void sub_08058F84(u32 unk0, u32 unk1) {
Entity* tmp;
tmp = CreateObject(OBJECT_21, 0, 0);
tmp = CreateObject(DIRT_PARTICLE, 0, 0);
if (!tmp)
return;
tmp->x.HALF.HI = gRoomControls.origin_x + unk0;
@@ -363,12 +363,12 @@ void MiscManager_TypeB(MiscManager* this) {
}
}
u32 sub_080593CC(MiscManager* this) {
bool32 sub_080593CC(MiscManager* this) {
if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.swim_state != 0 && gPlayerEntity.animationState == 0 &&
(gPlayerState.field_0x90 & 0xF00) == 0x400) {
(gPlayerState.playerInput.field_0x90 & PLAYER_INPUT_ANY_DIRECTION) == PLAYER_INPUT_UP) {
return EntityWithinDistance(&gPlayerEntity, this->unk_38, this->unk_3a + 0xC, 6);
}
return 0;
return FALSE;
}
void MiscManager_TypeC(MiscManager* this) {
+3 -1
View File
@@ -44,7 +44,9 @@ void RollingBarrelManager_Main(RollingBarrelManager* this) {
u32 tmp;
RollingBarrelManager_Actions[super->action](this);
sub_08058BC8(this);
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4[0] * 0xA0], 0x04000020, 0xA2600008);
SetVBlankDMA((u16*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0xA0], (u16*)REG_ADDR_BG2PA,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x8);
}
void RollingBarrelManager_Init(RollingBarrelManager* this) {
super->action = 1;
+6 -4
View File
@@ -137,7 +137,7 @@ void SteamOverlayManager_Action3(SteamOverlayManager* this) {
gScreen.controls.alphaBlend = gUnk_08108588[super->timer--];
if (super->timer == 0xFF) {
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
sub_08056250();
DisableVBlankDMA();
DeleteThisEntity();
}
}
@@ -165,7 +165,9 @@ void sub_0805A114(u32 unk0, u32 unk1) {
}
*p++ = gScreen.bg3.xOffset + ((gSineTable[(unk1 + tmp) & 0xFF] * unk0) >> 8);
}
sub_0805622C((struct BgAffineDstData*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], 0x0400001C, 0xA2600001);
SetVBlankDMA((u16*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0x500], (u16*)REG_ADDR_BG3HOFS,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x1);
}
void sub_0805A1D8(SteamOverlayManager* this) {
@@ -175,7 +177,7 @@ void sub_0805A1D8(SteamOverlayManager* this) {
gScreen.bg3.yOffset = gRoomControls.bg3OffsetY.HALF.HI;
if (gScreen.lcd.displayControl & DISPCNT_BG3_ON) {
sub_0805A114(6, this->unk_20 >> 1);
if (this->unk_22 == 0 && (gMain.ticks.HWORD & 0x1F) == 0) {
if (this->unk_22 == 0 && (gMain.ticks & 0x1F) == 0) {
this->unk_24++;
this->unk_24 &= 3;
gScreen.controls.alphaBlend = gUnk_0810859A[this->unk_24];
@@ -189,5 +191,5 @@ void nullsub_495(void* this) {
void sub_0805A25C(void* this) {
gScreen.controls.layerFXControl = 0;
gScreen.lcd.displayControl &= ~DISPCNT_BG3_ON;
sub_08056250();
DisableVBlankDMA();
}
+3 -3
View File
@@ -191,7 +191,7 @@ void TempleOfDropletsManager_Type2_Action4(TempleOfDropletsManager* this) {
void sub_0805A4CC(TempleOfDropletsManager* this, u32 unk_0) {
Entity* tmp;
tmp = CreateObject(OBJECT_8E, unk_0, 0);
tmp = CreateObject(LIGHT_RAY, unk_0, 0);
if (tmp) {
tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x;
tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y - 0x30;
@@ -493,13 +493,13 @@ extern struct { u8 unk_00[0x20]; } gUnk_085A97A0[];
void sub_0805AA58(TempleOfDropletsManager* this) {
if (--super->timer == 0) {
super->timer = 8;
this->unk_21 += 1;
this->unk_21++;
this->unk_21 &= 3;
LoadPalettes(gUnk_085A97A0[this->unk_21].unk_00, 5, 1);
}
if (--super->subtimer == 0) {
super->subtimer = 16;
this->unk_22 += 1;
this->unk_22++;
this->unk_22 &= 0xF;
gScreen.controls.alphaBlend = gUnk_081085B8[this->unk_22];
}
+1 -1
View File
@@ -72,7 +72,7 @@ void Vaati3StartManager_Type0_Action1(Vaati3StartManager* this) {
super->timer = 120;
SetPlayerControl(2);
sub_08078B48();
object = CreateObject(OBJECT_64, 0, 0);
object = CreateObject(THUNDERBOLD, 0, 0);
if (object != NULL) {
object->x.HALF.HI = gRoomControls.origin_x + 0x88;
object->y.HALF.HI = gRoomControls.origin_y + 0x48;
+9 -8
View File
@@ -9,6 +9,7 @@
#include "common.h"
#include "functions.h"
#include "game.h"
#include "main.h"
#include "room.h"
#include "screen.h"
@@ -22,8 +23,6 @@ void sub_0805DA08(u32, u32, u32);
static const u8 gUnk_08108D74[] = { 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x0 };
extern struct BgAffineDstData gUnk_02017AA0[];
extern u8 gUnk_03003DE4[0xC];
extern void sub_0805622C(struct BgAffineDstData*, u32, u32);
void VaatiAppearingManager_Main(VaatiAppearingManager* this) {
static void (*const VaatiAppearingManager_Actions[])(VaatiAppearingManager*) = {
@@ -121,7 +120,7 @@ void VaatiAppearingManager_Action2(VaatiAppearingManager* this) {
}
break;
case 2:
this->field_0x20 += 1;
this->field_0x20++;
if (--super->timer != 0) {
return;
}
@@ -140,16 +139,16 @@ void VaatiAppearingManager_Action2(VaatiAppearingManager* this) {
void VaatiAppearingManager_Action3(VaatiAppearingManager* this) {
if ((gInput.heldKeys & 0x40) != 0) {
this->field_0x20 -= 1;
this->field_0x20--;
}
if ((gInput.heldKeys & 0x80) != 0) {
this->field_0x20 += 1;
this->field_0x20++;
}
if ((gInput.heldKeys & 0x20) != 0) {
this->field_0x28 -= 1;
this->field_0x28--;
}
if ((gInput.heldKeys & 0x10) != 0) {
this->field_0x28 += 1;
this->field_0x28++;
}
}
@@ -168,7 +167,9 @@ void sub_0805DA08(u32 x, u32 y, u32 param_3) {
affineDstData->pa = ((gSineTable[(param_3 + i + y) & 0xff] * x) >> 8) + gScreen.bg3.xOffset;
affineDstData = (struct BgAffineDstData*)&affineDstData->pb;
}
sub_0805622C(&gUnk_02017AA0[gUnk_03003DE4[0] * 0xa0], REG_ADDR_BG3HOFS, 0xa2600001);
SetVBlankDMA((u16*)&gUnk_02017AA0[gUnk_03003DE4[0] * 0xa0], (u16*)REG_ADDR_BG3HOFS,
((DMA_ENABLE | DMA_START_HBLANK | DMA_16BIT | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_RELOAD) << 16) +
0x1);
}
void CreateVaatiApparateManager(VaatiAppearingManager* this, u32 type) {
+5 -6
View File
@@ -17,7 +17,6 @@ extern const struct {
u8 filler[7];
u8 unk7;
} gUnk_080FC3E4[];
extern u32 gUnk_02002B0E;
void sub_080A4DA8(u32);
void sub_080A4B44(void);
@@ -146,10 +145,10 @@ void FigurineMenu0_Type2(void) {
Sound sound;
if (gMenu.field_0x0 != 0) {
gFigurineMenu.unk20 += 1;
gFigurineMenu.unk20++;
switch (gFigurineMenu.unk20) {
case 0x40:
gFigurineMenu.duplicate = WriteBit(&gUnk_02002B0E, gFigurineMenu.figure_idx);
gFigurineMenu.duplicate = WriteBit(&gSave.stats.filler4[4], gFigurineMenu.figure_idx);
gMenu.column_idx = 1;
default:
bVar1 = gFigurineMenu.unk20 >> 2;
@@ -329,7 +328,7 @@ void FigurineMenu_080A4978(void) {
r0 += 0x20;
gOamCmd.y = r0;
DrawDirect(sub_080A4978_draw_constant, 1);
r0 = gMain.ticks.HWORD & 0x10;
r0 = gMain.ticks & 0x10;
r4 = (r0) ? 4 : 2;
gOamCmd.x = 0xe8;
gOamCmd.y = 0x1a;
@@ -339,7 +338,7 @@ void FigurineMenu_080A4978(void) {
DrawDirect(sub_080A4978_draw_constant, r4 + 1);
}
}
if (gMain.ticks.HWORD & 0x10) {
if (gMain.ticks & 0x10) {
if (gMenu.column_idx & 0x10) {
if (gFigurineMenu.unk1e) {
gOamCmd.y = 0x10;
@@ -589,7 +588,7 @@ void sub_080A4DA8(u32 param_1) {
void sub_080A4DB8(u32 param_1) {
const struct_08128AD8* ptr;
sub_08056250();
DisableVBlankDMA();
MemClear(&gBG0Buffer, 0x800);
MemClear(&gBG1Buffer, 0x800);
MemClear(&gBG2Buffer, 0x800);
+11 -14
View File
@@ -43,7 +43,6 @@ typedef struct {
extern const u32 gUnk_080CA06C[];
extern const u8 gGlobalGfxAndPalettes[];
extern u8 gTextGfxBuffer[];
extern u8 gUnk_02002AC0[];
u32 sub_080A44E0(WStruct*, u8*, u32);
u32 sub_080A4418(u32, u32);
@@ -180,11 +179,11 @@ NONMATCH("asm/non_matching/menu/kinstone_menu/KinstoneMenu_Type1.inc", void Kins
switch (gInput.unk4) {
case 0x20:
case 0x40:
tmp3 -= 1;
tmp3--;
break;
case 0x10:
case 0x80:
tmp3 += 1;
tmp3++;
break;
case 1:
if (gMenu.column_idx == 2) {
@@ -301,13 +300,11 @@ void KinstoneMenu_Type5(void) {
kinstoneMenu_Type5_Overlays[gMenu.overlayType]();
}
extern u8 gUnk_02002C81[];
void KinstoneMenu_Type5_Overlay0(void) {
gMenu.column_idx = 5;
WriteBit((u32*)gUnk_02002C81, gFuseInfo._3);
if (99 < ++gUnk_02002C81[-298]) {
gUnk_02002C81[-299] = 1;
WriteBit(gSave.unk241, gFuseInfo._3);
if (++gSave.unk117 > 99) {
gSave.didAllFusions = 1;
}
KinstoneMenu_080A4468();
SoundReq(SFX_TASK_COMPLETE);
@@ -324,7 +321,7 @@ void KinstoneMenu_Type5_Overlay1(void) {
}
void KinstoneMenu_Type5_Overlay2(void) {
gMenu.transitionTimer -= 1;
gMenu.transitionTimer--;
if (gMenu.transitionTimer != 0) {
gKinstoneMenu.unk18 += gKinstoneMenu.unk1a;
gKinstoneMenu.unk1a += 0x20;
@@ -332,7 +329,7 @@ void KinstoneMenu_Type5_Overlay2(void) {
gMenu.column_idx = 6;
gMenu.overlayType = 3;
gMenu.transitionTimer = 79;
CreateObject(OBJECT_B3, 1, 0);
CreateObject(KINSTONE_SPARK, 1, 0);
SoundReq(SFX_1CA);
}
}
@@ -359,7 +356,7 @@ void KinstoneMenu_080A4054(void) {
KinstoneMenu_080A4080();
for (uVar2 = 0; uVar2 < 0x10; uVar2++) {
if (gMapDataBottomSpecial[uVar2].unk_01 != 0) {
gMapDataBottomSpecial[uVar2].unk_01 -= 1;
gMapDataBottomSpecial[uVar2].unk_01--;
}
}
}
@@ -398,7 +395,7 @@ void KinstoneMenu_080A4080(void) {
gOamCmd.x = 0xb8;
gOamCmd._8 = 0x4a0;
DrawDirect(t, 1);
uVar1 = gMain.ticks.HWORD >> 2 & 0xe;
uVar1 = gMain.ticks >> 2 & 0xe;
temp = &gUnk_08128110[uVar1];
gOamCmd.x = 10 - temp[0];
gOamCmd._8 = 0x4e0;
@@ -439,7 +436,7 @@ NONMATCH("asm/non_matching/menu/kinstone_menu/KinstoneMenu_080A414C.inc", void K
switch (gMenu.column_idx) {
case 3:
case 4:
uVar3 -= 1;
uVar3--;
break;
default:
break;
@@ -609,7 +606,7 @@ u32 KinstoneMenu_080A4494(void) {
psVar1->charColor = 0;
psVar1->bgColor = 5;
psVar1->unk1 = 0;
sub_080A44E0(psVar1, gUnk_02002AC0, 0x80);
sub_080A44E0(psVar1, gSave.name, 0x80);
#if NON_MATCHING
ret = sub_080A44E0(psVar1, sub_08002632(gFuseInfo.ent) >> 0x20, 0xa0);
#else
+1 -1
View File
@@ -511,7 +511,7 @@ void PauseMenu_ItemMenu_Draw(void) {
entry = &gItemMenuTable[slot];
gOamCmd.x = entry->x;
gOamCmd.y = entry->y;
tmp = entry->type + ((gMain.ticks.HWORD & 0x10) != 0 ? 3 : 4);
tmp = entry->type + ((gMain.ticks & 0x10) != 0 ? 3 : 4);
DrawDirect(sub_080A5384_draw_constant0, tmp);
}
{
+3 -3
View File
@@ -185,7 +185,7 @@ void sub_0806D164(Entity* this) {
puVar2 = &ptr[-0x4000];
for (index = 0x20, ptr = &puVar1[(xOffset >> 4) * 4]; index != 0; index--) {
DmaSet(3, ptr, puVar2, 0x80000020);
DmaCopy16(3, ptr, puVar2, 0x20 * 2);
ptr += 0x100;
puVar2 += 0x40;
}
@@ -341,11 +341,11 @@ void sub_0806D41C(Entity* this) {
if ((gRoomTransition.frameCount & 1) == 0) {
if (CheckPlayerProximity(this->x.HALF.HI - 0x20, this->y.HALF.HI, 0x40, 0x40) != 0) {
if (this->spriteOffsetY > -8) {
this->spriteOffsetY -= 1;
this->spriteOffsetY--;
}
} else {
if (this->spriteOffsetY < 0) {
this->spriteOffsetY += 1;
this->spriteOffsetY++;
}
}
}
+10 -10
View File
@@ -15,8 +15,8 @@ extern void (*gUnk_081115C0[])(Entity*);
extern void (*gUnk_081115D0[])(Entity*);
extern u16 gUnk_081115DC[];
extern u8 gUnk_08111618[];
extern u32* gUnk_081115EC[];
extern u8 BladeBrothers_EquippedItem[];
extern PlayerMacroEntry* BladeBrothers_PlayerMacros[];
extern u8 gUnk_08111623[];
extern u8 gUnk_0811162B[];
extern u16 gUnk_08111664[];
@@ -98,7 +98,7 @@ void sub_08068AA4(Entity* this) {
this->type2++;
this->type2 &= 7;
if (this->type2 == 0) {
this->type2 += 1;
this->type2++;
}
ChangeObjPalette(this, gUnk_081115DC[this->type2]);
}
@@ -139,14 +139,14 @@ void sub_08068B70(Entity* this) {
}
}
void sub_08068B84(Entity* this) {
void BladeBrothers_StartPlayerDemonstration(Entity* this, ScriptExecutionContext* context) {
u8 p;
if (gUnk_08111618) {}
if (p = this->timer, gUnk_08111618[p]) {
ForceEquipItem(gUnk_08111618[this->timer], 0);
if (BladeBrothers_EquippedItem) {}
if (p = this->timer, BladeBrothers_EquippedItem[p]) {
ForceEquipItem(BladeBrothers_EquippedItem[this->timer], 0);
}
InitPlayerMacro(gUnk_081115EC[this->timer]);
InitPlayerMacro(BladeBrothers_PlayerMacros[this->timer]);
}
void sub_08068BB4(Entity* this) {
@@ -190,7 +190,7 @@ void sub_08068C28(Entity* this) {
}
}
void sub_08068C6C(Entity* this) {
void BladeBrothers_GetScroll(Entity* this) {
InitItemGetSequence(gUnk_0811162B[this->timer] & 0xffffff7f, 0, 0);
}
@@ -380,7 +380,7 @@ void sub_08068F3C(Entity* this) {
void BladeBrothers_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 0;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 4);
+1 -1
View File
@@ -121,7 +121,7 @@ void sub_080636F4(Entity* this) {
void Brocco_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
this->y.HALF.HI -= 4;
InitAnimationForceUpdate(this, 2);
+2 -2
View File
@@ -170,7 +170,7 @@ void sub_080675D4(Entity* this) {
static const Hitbox gUnk_08110E94 = { 0, 3, { 5, 3, 3, 5 }, 12, 20 };
void sub_080676D8(Entity* this) {
this->subAction += 1;
this->subAction++;
}
void sub_080676E0(Entity* this, ScriptExecutionContext* context) {
@@ -208,7 +208,7 @@ void sub_080676E0(Entity* this, ScriptExecutionContext* context) {
void CastorWildsStatue_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
this->y.HALF.HI -= 0x18;
InitializeAnimation(this, 1);
+4 -4
View File
@@ -175,7 +175,7 @@ void sub_08067904(Entity* this) {
return;
}
this->field_0x70.HALF.HI -= 1;
this->field_0x70.HALF.HI--;
if (this->field_0x70.HALF.HI == 0) {
sub_08067B70(this);
return;
@@ -405,7 +405,7 @@ u32 sub_08067D20(Entity* this) {
Entity* entity;
int iVar4;
if (this->field_0x74.HALF.HI != 0) {
this->field_0x74.HALF.HI -= 1;
this->field_0x74.HALF.HI--;
} else {
entity = sub_08049DF4(2);
if (entity != NULL) {
@@ -425,7 +425,7 @@ u32 sub_08067D74(Entity* this) {
if (this->type != 5) {
if (this->timer != 0) {
this->timer -= 1;
this->timer--;
}
entity = sub_08049DF4(2);
if (entity != NULL) {
@@ -454,7 +454,7 @@ void sub_08067DDC(Entity* this) {
void Cat_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 5);
} else {
+3 -3
View File
@@ -14,7 +14,7 @@ void Cucco(Entity* this) {
}
void Cucco_Init(Entity* this) {
this->action += 1;
this->action++;
this->field_0x68.HALF.LO = sub_0801E99C(this);
sub_080787A8(this, this->field_0x68.HALF.LO);
SetDefaultPriority(this, PRIO_MESSAGE);
@@ -24,7 +24,7 @@ void Cucco_Init(Entity* this) {
void sub_0806E4EC(Entity* this) {
if (this->subAction == 0) {
this->subAction += 1;
this->subAction++;
this->timer = (Random() & 0x1f) + 60;
InitAnimationForceUpdate(this, 0);
}
@@ -122,7 +122,7 @@ void Cucco_ShowMessage(Entity* this) {
void Cucco_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 1);
} else {
+3 -3
View File
@@ -22,7 +22,7 @@ void CuccoChick(Entity* this) {
}
void CuccoChick_Init(Entity* this) {
this->action += 1;
this->action++;
this->field_0x68.HALF.LO = sub_0801E99C(this);
sub_080787A8(this, this->field_0x68.HALF.LO);
SetDefaultPriority(this, PRIO_MESSAGE);
@@ -32,7 +32,7 @@ void CuccoChick_Init(Entity* this) {
void sub_0806E764(Entity* this) {
if (this->subAction == 0) {
this->subAction += 1;
this->subAction++;
this->timer = (Random() & 0x1f) + 30;
this->frameIndex = 0;
}
@@ -96,7 +96,7 @@ void sub_0806E884(Entity* this) {
void CuccoChick_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
this->frameIndex = 1;
} else {
+1 -1
View File
@@ -39,7 +39,7 @@ void sub_08064828(Entity* this) {
void Din_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
+4 -4
View File
@@ -88,7 +88,7 @@ void sub_08069C40(Entity* this) {
}
this->timer = 30;
} else {
this->timer -= 1;
this->timer--;
if (this->timer == 0) {
this->action = 2;
this->timer = (Random() & 0x1f) + 30;
@@ -132,7 +132,7 @@ void sub_08069D00(Entity* this) {
void sub_08069D54(Entity* this) {
u16 collisions;
if (!sub_08069F90(this)) {
this->timer -= 1;
this->timer--;
if (this->timer != 0) {
UpdateAnimationSingleFrame(this);
ProcessMovement0(this);
@@ -170,7 +170,7 @@ void sub_08069DF8(Entity* this) {
if (sub_08069F90(this)) {
this->action = 1;
} else {
this->timer -= 1;
this->timer--;
if (this->timer != 0) {
sub_08069D00(this);
return;
@@ -359,7 +359,7 @@ void sub_0806A144(Entity* this) {
void Dog_Fusion(Entity* this) {
if (this->action == 0) {
if (sub_08069EF0(this) != 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, 0x23);
+1 -1
View File
@@ -8,7 +8,7 @@ extern ScreenTransitionData gUnk_0813AD38;
void Emma(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
sub_0807DD50(this);
} else {
+1 -1
View File
@@ -6,7 +6,7 @@ const u8 gUnk_08114144[];
// Ezlo as a cap in the Minish Woods, is destroyed as soon as link wears ezlo
void Ezlo(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
sub_0807DD50(this);
}
+1 -1
View File
@@ -39,7 +39,7 @@ void sub_08064A28(Entity* this) {
void Farore_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
+1 -1
View File
@@ -110,7 +110,7 @@ void sub_0805FF2C(Entity* this, ScriptExecutionContext* context) {
void Festari_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE);
InitAnimationForceUpdate(this, 8);
+2 -2
View File
@@ -229,7 +229,7 @@ void sub_08065F20(Entity* this) {
if (this->interactType != 0) {
this->interactType = 0;
MessageFromTarget(0);
this->animIndex += 1;
this->animIndex++;
if (gSpriteAnimations_GhostBrothers[this->animIndex] == 0) {
this->animIndex = 0;
}
@@ -285,7 +285,7 @@ void sub_08065F64(Entity* this) {
void GhostBrothers_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 2);
} else {
+1 -1
View File
@@ -36,7 +36,7 @@ void Gina(Entity* this) {
void Gina_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 2);
} else {
+2 -2
View File
@@ -58,7 +58,7 @@ void sub_080697EC(Entity* this) {
InitializeAnimation(this, tmp);
}
} else {
this->subtimer -= 1;
this->subtimer--;
}
}
if (this->interactType != 0) {
@@ -72,7 +72,7 @@ void sub_08069838(Entity* this) {
if (LoadExtraSpriteData(this, &gUnk_08111C3C) == 0) {
return;
}
this->action += 1;
this->action++;
this->field_0x68.HALF.LO = 0;
this->field_0x68.HALF.HI = 0;
sub_0807DD64(this);
+4 -4
View File
@@ -27,7 +27,7 @@ void sub_0806CAF4(Entity* this) {
Entity* npc;
if (this->action == 0) {
this->action += 1;
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
npc = CreateNPC(GREGAL, 1, 0);
if (npc != NULL) {
@@ -52,7 +52,7 @@ void sub_0806CAF4(Entity* this) {
void sub_0806CB80(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->animationState = 2;
this->frameIndex = 0;
SetDefaultPriority(this, PRIO_MESSAGE);
@@ -64,7 +64,7 @@ void sub_0806CB80(Entity* this) {
void sub_0806CBB4(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->animationState = 2;
SetDefaultPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, 0x11);
@@ -161,7 +161,7 @@ void sub_0806CD58(Entity* this) {
void Gregal_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE);
InitAnimationForceUpdate(this, 6);
+1 -1
View File
@@ -111,7 +111,7 @@ void HurdyGurdyMan_Fusion(Entity* this) {
if (this->action == 0) {
uVar1 = LoadExtraSpriteData(this, gUnk_081144F0);
if (uVar1 != 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
SetDefaultPriority(this, PRIO_MESSAGE);
InitializeAnimation(this, 10);
+2 -2
View File
@@ -229,7 +229,7 @@ void sub_080626E0(Entity* this, ScriptExecutionContext* context) {
s32 uVar4;
if (context->unk_18 == 0) {
context->unk_18 += 1;
context->unk_18++;
context->unk_19 = 10;
context->postScriptActions |= 2;
sVar1 = *(s16*)&context->intVariable;
@@ -332,7 +332,7 @@ void sub_08062948(Entity* this, ScriptExecutionContext* context) {
s32 iVar4;
if (context->unk_18 == 0) {
context->unk_18 += 1;
context->unk_18++;
context->unk_12 = (Random() & 0x3f) + 0x20;
uVar3 = Random() & 0x18;
switch (this->direction) {
+2 -2
View File
@@ -52,7 +52,7 @@ void sub_08066688(Entity* this) {
if (this->subtimer == 0) {
this->subtimer = 16;
} else {
this->subtimer -= 1;
this->subtimer--;
tmp = this->animIndex;
}
}
@@ -112,7 +112,7 @@ void sub_0806673C(Entity* this) {
void KingDaltus_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
+1 -1
View File
@@ -7,7 +7,7 @@ void KingGustaf(Entity* this) {
s32 speed;
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteRendering.alphaBlend = 1;
this->collisionLayer = 2;
SetDefaultPriority(this, PRIO_MESSAGE);
+1 -1
View File
@@ -6,7 +6,7 @@
void Marcy(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
sub_0807DD64(this);
}
+1 -1
View File
@@ -25,7 +25,7 @@ void MinishEzlo(Entity* this) {
if (LoadExtraSpriteData(this, gUnk_0810C48C) == 0) {
return;
}
this->action += 1;
this->action++;
this->animationState = this->timer * 2;
SetDefaultPriority(this, PRIO_MESSAGE);
sub_0807DD50(this);
+2 -2
View File
@@ -38,7 +38,7 @@ void sub_08066808(Entity* this) {
if (this->subtimer == 0) {
this->subtimer = 16;
} else {
this->subtimer -= 1;
this->subtimer--;
tmp = this->animIndex;
}
}
@@ -107,7 +107,7 @@ void sub_08066904(Entity* this) {
void MinisterPotho_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
+1 -1
View File
@@ -266,7 +266,7 @@ void MountainMinish_Head(Entity* this) {
void MountainMinish_Fusion(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, gUnk_08111358) != 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 6);
}
+1 -1
View File
@@ -39,7 +39,7 @@ void sub_08064928(Entity* this) {
void Nayru_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 6);
} else {
+7 -7
View File
@@ -15,8 +15,8 @@ typedef struct {
s8 unk_04;
} gUnk_0810C89C_struct;
extern void script_Object3ELeftStoneOpening; // Cutscene data type?
extern void script_Object3ERightStoneOpening; // Cutscene data type?
extern void script_MinishVillageObjectLeftStoneOpening; // Cutscene data type?
extern void script_MinishVillageObjectRightStoneOpening; // Cutscene data type?
const Hitbox gUnk_08114154;
const u8 gUnk_0811415C[];
@@ -137,15 +137,15 @@ void sub_0806DB44(Entity* this, ScriptExecutionContext* context) {
void sub_0806DB84(Entity* this, ScriptExecutionContext* context) {
Entity* ent;
this->hitbox = (Hitbox*)&gUnk_08114154;
ent = CreateObject(OBJECT_3E, 4, 0);
ent = CreateObject(MINISH_VILLAGE_OBJECT, 4, 0);
if (ent != NULL) {
PositionRelative(this, ent, Q_16_16(-8.0), 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ELeftStoneOpening);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_MinishVillageObjectLeftStoneOpening);
}
ent = CreateObject(OBJECT_3E, 5, 0);
ent = CreateObject(MINISH_VILLAGE_OBJECT, 5, 0);
if (ent != NULL) {
PositionRelative(this, ent, Q_16_16(8.0), 0);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_Object3ERightStoneOpening);
*(ScriptExecutionContext**)&ent->cutsceneBeh = StartCutscene(ent, &script_MinishVillageObjectRightStoneOpening);
}
}
@@ -209,7 +209,7 @@ void sub_0806DCC0(void) {
void NPC4E_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
switch (this->type) {
case 1:
case 2:
+1 -1
View File
@@ -2,7 +2,7 @@
void NPC4F(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
InitAnimationForceUpdate(this, this->type);
}
UpdateAnimationSingleFrame(this);
+2 -2
View File
@@ -534,7 +534,7 @@ u32 sub_08061230(Entity* this) {
}
this->contactFlags = this->contactFlags & 0x7f;
if (this->iframes != 0) {
this->iframes += 1;
this->iframes++;
}
return 0;
}
@@ -557,7 +557,7 @@ void sub_08061358(Entity* this) {
sub_08060E70(this, 0);
break;
case 1:
this->timer -= 1;
this->timer--;
if (this->timer != 0) {
return;
}
+2 -2
View File
@@ -130,7 +130,7 @@ void sub_0806B540(Entity* this) {
if (CheckLocalFlag(0x3f) != 0) {
return;
}
context->unk_18 += 1;
context->unk_18++;
SetLocalFlag(0x3f);
break;
case 1:
@@ -169,7 +169,7 @@ void sub_0806B60C(Entity* this) {
void Percy_Fusion(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, gUnk_08112E1C) != 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitializeAnimation(this, 2);
}
+1 -1
View File
@@ -15,7 +15,7 @@ void sub_0806EABC(Entity* this, u32 param);
void Phonograph(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
this->field_0x68.HWORD = 1;
this->field_0x6a.HWORD = 0xffff;
+1 -1
View File
@@ -92,7 +92,7 @@ void PicolyteBottle_Action2(PicolyteBottleEntity* this) {
} else {
if (super->timer != 0) {
super->timer = 0;
obj = CreateObject(OBJECT_35, 2, super->subtimer);
obj = CreateObject(CARLOV_OBJECT, 2, super->subtimer);
if (obj != NULL) {
obj->parent = super;
super->child = obj;
+1 -1
View File
@@ -18,7 +18,7 @@ void Pita(Entity* this) {
#endif
};
if (this->action == 0) {
this->action += 1;
this->action++;
SetDefaultPriority(this, PRIO_MESSAGE);
SortEntityAbove(this, this);
this->hitbox = (Hitbox*)&gUnk_0810C428;
+2 -2
View File
@@ -150,7 +150,7 @@ void sub_08060528(Entity* this) {
sub_080788E0(this);
EnqueueSFX(SFX_PLY_JUMP);
} else {
this->field_0x6a.HWORD -= 1;
this->field_0x6a.HWORD--;
}
}
GravityUpdate(this, Q_8_8(24.0));
@@ -272,7 +272,7 @@ END_NONMATCH
void Postman_Fusion(Entity* this) {
if (this->action == 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
InitAnimationForceUpdate(this, 2);
} else {
+2 -2
View File
@@ -84,7 +84,7 @@ void sub_0806A458(Entity* this) {
switch (this->subAction) {
case 0:
if (--this->timer == 0) {
this->subAction += 1;
this->subAction++;
}
break;
case 1:
@@ -168,7 +168,7 @@ void sub_0806A5E8(Entity* this) {
InitializeAnimation(this, 0x10);
this->timer = (Random() & 0x3f) + 60;
}
this->timer -= 1;
this->timer--;
if (this->timer == 0) {
this->timer = (Random() & 0x3f) + 120;
SoundReq(SFX_REM_SLEEP);
+2 -4
View File
@@ -6,9 +6,7 @@ extern void (*SittingPersion_Actions[])(Entity*);
extern Dialog gUnk_0810CC08[];
extern SpriteLoadData gUnk_0810CB78[];
extern u8 gUnk_02002B0E[];
extern u16 gUnk_0810CC04[];
extern u8 gUnk_02002B0E[];
extern u16 gUnk_0810CBE4[][4];
extern u8 gUnk_0810CBC0[];
extern u8 gUnk_0810CD88[][4];
@@ -90,7 +88,7 @@ void sub_0806387C(Entity* this) {
if (CheckLocalFlag(SHOP05_OPEN) == 0) {
r5 = 0;
for (r4 = 1; r4 <= 0x82; r4++) {
if (ReadBit(gUnk_02002B0E, r4)) {
if (ReadBit(&gSave.stats.filler4[4], r4)) {
r5++;
}
}
@@ -151,7 +149,7 @@ void sub_080639D0(Entity* this) {
void SittingPerson_Fusion(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, &gUnk_0810CB78[this->type * 3]) != 0) {
this->action += 1;
this->action++;
this->spriteSettings.draw = 1;
this->spriteSettings.flipX = 0;
this->y.HALF.HI -= 4;
+1 -1
View File
@@ -11,7 +11,7 @@ void SmallTownMinish(Entity* this) {
static const Hitbox gUnk_081142FC = { -2, 1, { 0, 0, 0, 0 }, 6, 6 };
static const u8 gUnk_08114304[] = { -2, 1, 6, 6 };
if (this->action == 0) {
this->action += 1;
this->action++;
this->hitbox = (Hitbox*)&gUnk_081142FC;
sub_0807DD50(this);
sub_08078850(this, 1, 0, gUnk_08114304);
+6 -6
View File
@@ -130,7 +130,7 @@ void sub_0806522C(Entity* this) {
void sub_08065250(Entity* this) {
switch (sub_08056338()) {
case 0:
this->subAction += 1;
this->subAction++;
this->timer = 30;
this->subtimer = 0;
CreateSpeechBubbleExclamationMark(this, 8, 0xffffffe8);
@@ -152,7 +152,7 @@ void sub_0806528C(Entity* this) {
void sub_080652B0(Entity* this) {
if ((gMessage.doTextBox & 0x7f) == 0) {
this->subAction += 1;
this->subAction++;
this->timer = 10;
gRoomVars.animFlags = this->subtimer;
CreateItemEntity(ITEM_QST_DOGFOOD, 0, 0);
@@ -161,10 +161,10 @@ void sub_080652B0(Entity* this) {
void sub_080652E4(Entity* this) {
if (this->timer != 0) {
this->timer -= 1;
this->timer--;
} else {
if (gPlayerEntity.action != PLAYER_ITEMGET) {
this->subAction += 1;
this->subAction++;
MessageNoOverlap(TEXT_INDEX(TEXT_STOCKWELL, 0x19), this);
}
}
@@ -172,7 +172,7 @@ void sub_080652E4(Entity* this) {
void sub_08065314(Entity* this) {
if ((gMessage.doTextBox & 0x7f) == 0) {
this->subAction += 1;
this->subAction++;
MenuFadeIn(3, 3);
}
}
@@ -252,7 +252,7 @@ void sub_08065370(Entity* this, ScriptExecutionContext* context) {
SetLocalFlag(localFlag);
}
if (gSave.unk5C <= -2) {
gSave.unk5C += 1;
gSave.unk5C++;
}
if (gSave.unk5C >= 10) {

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