decomp figurine menu

This commit is contained in:
Henny022p
2022-01-17 03:11:40 +01:00
parent 8ad65efb7c
commit 4517e77563
18 changed files with 1063 additions and 1393 deletions
+3 -3
View File
@@ -198,7 +198,7 @@ void OctorokBoss_Hit_SubAction0(Entity* this) {
GET_HELPER(this)->fallingStonesTimer = 0;
if (GET_BOSS_PHASE(this) == 4) {
this->subAction = 4;
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
sub_08078B48();
SoundReq(SFX_BOSS_DIE);
} else {
@@ -505,7 +505,7 @@ ASM_FUNC("asm/non_matching/octorokBoss/OctorokBoss_Init.inc", void OctorokBoss_I
void OctorokBoss_Intro(Entity* this) {
sub_08078B48();
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
sub_08036F60(this);
OctorokBoss_Intro_SubActions[this->subAction](this);
sub_0805EC9C(this, this->field_0x76.HWORD, this->field_0x74.HWORD, GET_ANGLE(this));
@@ -579,7 +579,7 @@ void OctorokBoss_Intro_SubAction5(Entity* this) {
this->subAction = 0;
gRoomControls.unk5 = gPlayerEntity.animationState;
OctorokBoss_SetAttackTimer(this);
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
SoundReq(BGM_BOSS_THEME);
}
} else {
+2 -2
View File
@@ -323,7 +323,7 @@ static void GameMain_ChangeRoom(void) {
sub_080300C4();
gMain.substate = GAMEMAIN_UPDATE;
SetPlayerControl(0);
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
#if defined(USA) || defined(DEMO_USA)
if (gArea.inventoryGfxIdx != 0xff) {
sub_0801855C();
@@ -1233,7 +1233,7 @@ static void InitRoomTransition(void) {
bool32 CanDispEzloMessage(void) {
s32 tmp = PL_STATE_WALK;
if (!(gInput.heldKeys & SELECT_BUTTON) || gPlayerState.controlMode != CONTROL_ENABLED || gUnk_02034490[0] ||
if (!(gInput.heldKeys & SELECT_BUTTON) || gPlayerState.controlMode != CONTROL_ENABLED || gUnk_02034490.unk0 ||
gUnk_0200AF00.filler0[1])
return 0;
+2 -2
View File
@@ -24,7 +24,7 @@ void OcarinaUse(ItemBehavior* this, u32 arg1) {
gPlayerEntity.field_0x7a.HWORD = 2;
gPlayerState.flags |= PL_USE_OCARINA;
gPlayerState.field_0x27[0] = -1;
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
gPlayerState.field_0xa = (8 >> arg1) | gPlayerState.field_0xa;
gPlayerState.keepFacing = (8 >> arg1) | gPlayerState.keepFacing;
ResetPlayerVelocity();
@@ -41,7 +41,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe
gPlayerEntity.flags |= 0x80;
gPlayerState.flags &= ~PL_USE_OCARINA;
gPlayerState.field_0x27[0] = 0;
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
CreateBird();
ResetPlayerEventPriority();
sub_08077E78(this, arg1);
+1 -1
View File
@@ -306,7 +306,7 @@ void sub_0805A76C(Manager15* this) {
gPlayerEntity.animationState = 4;
RequestPriorityDuration((Entity*)this, 600);
SetPlayerControl(0xFF);
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
gRoomControls.camera_target = NULL;
sub_08077B20();
}
+2 -2
View File
@@ -83,7 +83,7 @@ void Manager7_Main(Manager7* this) {
tmp2 = &gUnk_081080A4[tmp << 4];
switch (this->manager.unk_0e) {
case 0:
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
LoadResourceAsync(&gGlobalGfxAndPalettes[tmp2[0]], tmp2[1], 0x1000);
LoadPaletteGroup(gUnk_081081E4[tmp]);
this->manager.unk_0e++;
@@ -100,7 +100,7 @@ void Manager7_Main(Manager7* this) {
this->manager.unk_0e++;
break;
case 8:
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
this->manager.unk_0e++;
break;
}
+2 -2
View File
@@ -49,7 +49,7 @@ void sub_08066358(Entity* this) {
}
this->speed = 0x80;
this->cutsceneBeh.HWORD = 1;
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
sub_080788E0(this);
}
} else {
@@ -96,7 +96,7 @@ void sub_0806643C(Entity* this) {
void sub_08066474(void) {
if (gPlayerEntity.action != 0xf) {
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
}
}
+1 -1
View File
@@ -33,7 +33,7 @@ void sub_0809F514(Entity* this) {
this->spriteSettings.draw = 0;
this->field_0x68.HALF.LO = 12;
gRoomControls.camera_target = this;
gUnk_02034490[0] = 255;
gUnk_02034490.unk0 = 255;
sub_0809F7BC(this);
}
+1 -1
View File
@@ -24,7 +24,7 @@ Entity* sub_080A276C(Entity* parent, u32 type, u32 type2) {
PrependEntityToList(e, 6);
CopyPosition(&gPlayerEntity, e);
gPriorityHandler.sys_priority = 6;
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
e->field_0x68.HALF.HI = gPlayerEntity.flags;
e->field_0x68.HALF.LO = gPlayerEntity.spriteSettings.draw;
e->field_0x6a.HALF.LO = gPlayerEntity.iframes;
+3 -3
View File
@@ -325,7 +325,7 @@ extern Entity* gPlayerClones[];
extern ScriptExecutionContext gPlayerScriptExecutionContext;
NONMATCH("asm/non_matching/playerItemPacciCane/CheckPlayerInactive.inc", u32 CheckPlayerInactive(void)) {
if (!((gInput.newKeys & START_BUTTON) == 0 || gFadeControl.active || gUnk_02034490[0] ||
if (!((gInput.newKeys & START_BUTTON) == 0 || gFadeControl.active || gUnk_02034490.unk0 ||
(gMessage.doTextBox & 0x7F) || gSave.stats.health == 0 || !gSave.fillerD0[34] ||
gPlayerState.controlMode != 0 || gPriorityHandler.priority_timer != 0)) {
u32 tmp = gPlayerState.framestate ? gPlayerState.framestate : gPlayerState.framestate_last;
@@ -1145,7 +1145,7 @@ static void PortalStandUpdate(Entity* this) {
static void PortalActivateInit(Entity* this) {
gRoomControls.camera_target = NULL;
gUnk_02034490[0] = 1;
gUnk_02034490.unk0 = 1;
this->subAction = 3;
this->field_0xf = 0x1e;
gPlayerState.animation = 0x738;
@@ -1228,7 +1228,7 @@ static void sub_080717F8(Entity* this) {
this->x.HALF.HI = gArea.curPortalX + sOffsets[gArea.curPortalExitDirection * 2];
this->y.HALF.HI = gArea.curPortalY + sOffsets[gArea.curPortalExitDirection * 2 + 1];
gArea.unk1A = 0xb4;
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
this->action = PLAYER_MINISH;
this->subAction = 0;
gPlayerState.flags = (gPlayerState.flags & ~PL_USE_PORTAL) | PL_MINISH;
+3 -3
View File
@@ -4,13 +4,12 @@
#include "common.h"
#include "message.h"
#include "save.h"
#include "structures.h"
extern void (*const gUnk_0811B9D8[])(Entity*);
void sub_080704FC(Entity*);
extern u8 gUnk_02034490[0x18];
void PlayerItemPacciCane(Entity* this) {
gUnk_0811B9D8[this->action](this);
}
@@ -25,6 +24,7 @@ void sub_080704D4(Entity* this) {
ASM_FUNC("asm/non_matching/playerItemPacciCane/sub_080704FC.inc", void sub_080704FC(Entity* this))
// TODO This name sounds like this does not belong in this file
void ClearMenuSavestate(void) {
MemClear(gUnk_02034490, sizeof(gUnk_02034490));
MemClear(&gUnk_02034490, sizeof(gUnk_02034490));
}
+3 -3
View File
@@ -450,11 +450,11 @@ void sub_0807DF28(void) {
void sub_0807DF38(void) {
gUnk_0200AF00.filler0[1] = 0xff;
gUnk_02034490[0] = 0xff;
gUnk_02034490.unk0 = 0xff;
}
void sub_0807DF50(void) {
gUnk_02034490[0] = 0;
gUnk_02034490.unk0 = 0;
gUnk_0200AF00.filler0[1] = 0;
RecoverUI(0);
ResetPlayerAnimationAndAction();
@@ -1158,7 +1158,7 @@ void ScriptCommand_0807E9F0(Entity* entity, ScriptExecutionContext* context) {
switch (gFuseInfo._0) {
case 2:
gPlayerState.controlMode = CONTROL_DISABLED;
gUnk_02034490[0] = tmp;
gUnk_02034490.unk0 = tmp;
context->condition = tmp;
break;
case 1:
+327
View File
@@ -13,6 +13,7 @@
#include "npc.h"
#include "enemy.h"
#include "functions.h"
#include "structures.h"
extern const u32 gUnk_080CA06C[];
extern const u8 gGlobalGfxAndPalettes[];
@@ -44,6 +45,14 @@ u32 sub_080A44E0(struct_02036540*, u8*, u32);
struct_02036540* sub_0805F2C8(void);
void sub_0805F300(struct_02036540*);
u32 sub_0805F76C(u8*, struct_02036540*);
void sub_080A4978(void);
void sub_080A4B44(void);
void sub_080A4DA8(u32);
u32 sub_080A4CBC(u32);
void sub_080A4BA0(u32, u32);
void sub_0805F46C(u32, const u16**);
void sub_080A4DB8(u32);
void sub_08056250(void);
extern void (*const gUnk_081280C4[])(void);
extern const u8 gUnk_081280EE[];
@@ -89,6 +98,30 @@ typedef struct {
extern u8 gTextGfxBuffer[];
extern u8 gUnk_02002AC0[];
extern const struct {
u8 filler[7];
u8 unk7;
} gUnk_080FC3E4[];
extern u32 gUnk_02002B0E;
extern const KeyButtonLayout gUnk_0812813C;
extern const u16* gUnk_08128190;
extern u8 gUnk_020344A0[8];
typedef struct {
u8 unk0;
u8 unk1;
u16 unk2;
u16 unk4;
u16 unk6;
} struct_08128AD8;
extern const struct_08128AD8 gUnk_08128AD8[];
extern const struct {
u8 unk0;
u8 filler[3];
void (*func)(void);
} gUnk_08128A38[];
void Subtask_KinstoneMenu(void) {
#if !(defined(DEMO_USA) || defined(DEMO_JP))
gRoomTransition.player_status.field_0x24[8] = 2;
@@ -626,3 +659,297 @@ void sub_080A4528(void) {
entity->hitbox = NULL;
}
}
extern void (*const gUnk_0812815C[])(void);
extern void (*const gUnk_0812814C[])(void);
void Subtask_FigurineMenu(void) {
#ifndef DEMO
FlushSprites();
if (gUnk_02032EC0.field_0x3 == 0xff) {
gUnk_0812815C[gMenu.menuType]();
} else {
gUnk_0812814C[gMenu.menuType]();
}
UpdateEntities();
sub_0801C1D4();
DrawOAMCmd();
DrawEntities();
sub_080A4978();
CopyOAM();
sub_080A4B44();
#endif
}
void sub_080A4608(void) {
s32 iVar2;
SetBgmVolume(0x80);
sub_080A4DA8(3);
SetColor(0, gPaletteBuffer[0xfb]);
SetColor(0x15c, gPaletteBuffer[0xd3]);
MemClear(&gBG0Buffer, 0x800);
MemClear(&gBG3Buffer, 0x1000);
gScreen.controls.window0HorizontalDimensions = 0xf0;
gScreen.controls.window0VerticalDimensions = 0x7898;
gScreen.controls.windowInsideControl = 0x1f;
gScreen.controls.windowOutsideControl = 0x1d;
gScreen.bg1.updated = 1;
for (iVar2 = 0; iVar2 < 0x10; iVar2++) {
gMenu.unk10.a[iVar2] = 0xee;
}
{
int r0, r1, r2;
r1 = gUnk_02032EC0.field_0x3;
r0 = gSave.unk6;
r2 = 0x88;
if (r0 == 0) {
r2 = 0x82;
}
if (r2 < r1) {
r1 = 1;
}
gMenu.unk1c = r1;
}
SetFade(4, 8);
}
void sub_080A46C0(void) {
SetBgmVolume(0x100);
SoundReq(SFX_MENU_CANCEL);
ClearRoomFlag(2);
Subtask_Exit();
}
void sub_080A46DC(void) {
sub_080A4608();
sub_080A7114(1);
}
void sub_080A46EC(void) {
if (gFadeControl.active == 0) {
CreateObject(0xa2, gUnk_080FC3E4[gMenu.unk1c].unk7, 0);
sub_080A7114(2);
}
}
void sub_080A4720(void) {
u32 bVar1;
Sound sound;
if (gMenu.field_0x0 != 0) {
gMenu.unk20 += 1;
switch (gMenu.unk20) {
case 0x40:
gMenu.unk21 = WriteBit(&gUnk_02002B0E, gMenu.unk1c);
gMenu.column_idx = 1;
default:
bVar1 = gMenu.unk20 >> 2;
if (0x10 < bVar1) {
bVar1 = 0x20 - bVar1;
}
gScreen.controls.layerBrightness = bVar1;
gScreen.controls.layerFXControl = 0xbf;
break;
case 0x80:
gScreen.controls.layerBrightness = 0;
gScreen.controls.layerFXControl = 0;
gScreen.lcd.displayControl |= 0x2000;
sub_080A7114(3);
sub_080A70AC((KeyButtonLayout*)&gUnk_0812813C);
gMenu.column_idx = 0x15;
if (gMenu.unk21 == 0) {
sound = SFX_109;
} else {
sound = SFX_MENU_ERROR;
}
SoundReq(sound);
return;
}
}
}
void sub_080A47D0(void) {
s32 uVar1;
s32 t;
uVar1 = gMenu.unk1f;
switch (gInput.unk4) {
case 2:
case 8:
sub_080A46C0();
break;
case 0x10:
uVar1 += 8;
break;
case 0x20:
uVar1 -= 8;
break;
}
t = gMenu.unk1e;
if (uVar1 < 0) {
uVar1 = 0;
}
if (t < uVar1) {
uVar1 = t;
}
gMenu.unk1f = uVar1;
gScreen.bg1.yOffset = uVar1 - 0x70;
}
void sub_080A4830(void) {
sub_080A4608();
gScreen.lcd.displayControl |= 0x2000;
sub_080A70AC(&gUnk_0812813C);
gMenu.column_idx = 0xff;
sub_080A7114(1);
}
ASM_FUNC("asm/non_matching/subtask/sub_080A4864.inc", void sub_080A4864(Entity* this))
void sub_080A4934(void) {
sub_080A7114(1);
}
void sub_080A4940(void) {
sub_080A46C0();
}
u32 sub_080A4948(s32 param_1) {
s32 iVar1;
u32 uVar2;
uVar2 = 0;
iVar1 = gSave.unk6 == 0 ? 0x82 : 0x88;
if ((0 < param_1) || (iVar1 >= param_1)) {
if (ReadBit((u32*)&gSave.stats.filler4[4], param_1)) {
uVar2 = 1;
}
}
return uVar2;
}
ASM_FUNC("asm/non_matching/subtask/sub_080A4978.inc", void sub_080A4978(void))
void sub_080A4B44(void) {
u32 uVar1;
uVar1 = gMenu.unk1c;
if ((gMenu.column_idx & 0x10) != 0) {
gMenu.unk1e = sub_080A4CBC(uVar1);
}
if ((gMenu.column_idx & 4) != 0) {
sub_080A4BA0(uVar1, 2);
}
if ((gMenu.column_idx & 8) != 0) {
sub_080A4BA0(uVar1 - 2, 0);
sub_080A4BA0(uVar1 - 1, 1);
sub_080A4BA0(uVar1 + 1, 3);
sub_080A4BA0(uVar1 + 2, 4);
}
}
ASM_FUNC("asm/non_matching/subtask/sub_080A4BA0.inc", void sub_080A4BA0(u32 unk1, u32 unk2))
u32 sub_080A4CBC(u32 param_1) {
s32 iVar1;
const u16* psVar2;
u32 uVar3;
if (gMenu.unk1a.HALF.LO != param_1) {
gMenu.unk1a.HALF.LO = param_1;
MemClear(&gBG1Buffer, 0x800);
MemCopy(&gBG1Buffer, (void*)0x600e000, 0x800);
iVar1 = sub_080A4948(param_1);
if (iVar1 != 0) {
sub_0805F46C(param_1 + 0x900, &gUnk_08128190);
}
gScreen.bg1.updated = 1;
}
psVar2 = gUnk_08128190 + 0x80;
for (uVar3 = 0; uVar3 < 0x14; uVar3++) {
if (*psVar2 == 0)
break;
psVar2 += 0x20;
}
return uVar3 << 3;
}
void sub_080A4D34(void) {
s32 iVar1;
LoadGfxGroups();
LoadPaletteGroup(0xb5);
if (gSave.stats.health <= 8) {
iVar1 = 2;
} else {
s32 missingHealth = gSave.stats.maxHealth - gSave.stats.health;
if (missingHealth < 9) {
iVar1 = 0;
} else {
iVar1 = 1;
}
}
LoadGfxGroup(iVar1 + 0x56);
gScreen.bg3.xOffset = 0;
gScreen.bg3.yOffset = 0;
gScreen.bg3.control = 0x1e0b;
gScreen.bg3.updated = 1;
}
void sub_080A4D88(void) {
MemClear(gUnk_020344A0, sizeof(gUnk_020344A0));
MenuFadeIn(1, 0);
SetBgmVolume(0x80);
}
void sub_080A4DA8(u32 param_1) {
sub_080A4D34();
sub_080A4DB8(param_1);
}
void sub_080A4DB8(u32 param_1) {
const struct_08128AD8* ptr;
sub_08056250();
MemClear(&gBG0Buffer, 0x800);
MemClear(&gBG1Buffer, 0x800);
MemClear(&gBG2Buffer, 0x800);
MemClear(gUnk_0200AF00.filler25 + 0xf, 0x300);
MemClear(&gMenu, sizeof(gMenu));
gMenu.unk2e.HWORD = 0xffff;
gMenu.field_0x3 = gUnk_02034490.unk2[param_1];
ptr = &gUnk_08128AD8[gUnk_08128A38[param_1].unk0];
gScreen.lcd.displayControl = ptr->unk2 | 0x1940;
gScreen.bg0.xOffset = 0;
gScreen.bg0.yOffset = 0;
gScreen.bg0.updated = 1;
gScreen.bg1.xOffset = 0;
gScreen.bg1.yOffset = 0;
gScreen.bg1.control = ptr->unk4;
gScreen.bg1.updated = 1;
gScreen.bg2.xOffset = 0;
gScreen.bg2.yOffset = 0;
gScreen.bg2.control = ptr->unk6;
gScreen.bg2.updated = 1;
gScreen.bg3.xOffset = 0;
gScreen.bg3.yOffset = 0;
gScreen.bg3.control = 0x1e0b;
if (ptr->unk0 != 0) {
LoadPaletteGroup(ptr->unk0);
}
if (ptr->unk1 != 0) {
LoadGfxGroup(ptr->unk1);
}
}
void sub_080A4E84(u8 param_1) {
gUnk_02034490.unk14 = param_1;
}
void sub_080A4E90(u8 param_1) {
gUnk_02034490.unk11 = param_1;
gUnk_02034490.unk12 = 0;
}