Ovl_En_Fsn Ok and Documented (#204)

* First decomp pass: Matched everything w/ data

* Minor cleanup of func_80AE2F78

* Documented

* Format

* Some cleanup and PR suggestions

* Format

* Add the word player to a few functions to specify it is the player trying to buy

* Add controller macros

* Move common shopkeeper defines

* name unk274 and add note to unk27A

* Remove macros and just use flag defines

* Convert Controller Macros to take globalCtx

* Fix merge conflicts
This commit is contained in:
Derek Hensley
2021-07-19 19:26:47 -04:00
committed by GitHub
parent b5c931e432
commit 594a3ceaff
20 changed files with 1846 additions and 191 deletions
+7 -7
View File
@@ -824,7 +824,7 @@ s32 func_800B8708(GlobalContext* globalCtx);
// void func_800B8804(void);
// void func_800B882C(void);
// void func_800B886C(void);
void func_800B8898(GlobalContext* globalCtx, Actor* actor, UNK_PTR param_3, UNK_PTR param_4);
void func_800B8898(GlobalContext* globalCtx, Actor* actor, s16* arg2, s16* arg3);
s32 func_800B8934(GlobalContext* globalCtx, Actor* actor);
u32 Actor_HasParent(Actor* actor, GlobalContext* globalCtx);
UNK_TYPE4 func_800B8A1C(Actor* actor, GlobalContext* globalCtx, s32 iParm3, f32 fParm4, f32 param_5);
@@ -2164,7 +2164,7 @@ UNK_TYPE func_80114E90(void);
// void func_801152B8(void);
// void func_801153C8(void);
// void func_80115428(void);
// void func_8011552C(void);
void func_8011552C(GlobalContext* globalCtx, s16 arg1);
// void func_801155B4(void);
// void func_80115764(void);
void func_80115844(GlobalContext* globalCtx, s16 param_2);
@@ -2238,14 +2238,14 @@ u32 func_801233E4(GlobalContext* globalCtx);
// void func_801234D4(void);
s32 func_80123590(GlobalContext* globalCtx, Actor* actor);
// void func_8012364C(void);
// void func_80123810(void);
s32 func_80123810(GlobalContext* globalCtx);
// void func_80123960(void);
// void func_801239AC(void);
// void func_80123AA4(void);
// void func_80123BD4(void);
// void func_80123C58(void);
// void func_80123C90(void);
// void func_80123D50(void);
void func_80123D50(GlobalContext* globalCtx, Player* player, UNK_TYPE arg2, UNK_TYPE arg3);
void func_80123DA4(Player* player);
// void func_80123DC0(void);
// void func_80123E90(void);
@@ -2706,7 +2706,7 @@ void func_8013AED4(u16* param_1, u16 param_2, u16 param_3);
// void func_8013B878(void);
// void func_8013BB34(void);
// void func_8013BB7C(void);
UNK_TYPE func_8013BC6C(SkelAnime* skelAnime, UNK_PTR arg1, s32 arg2);
UNK_TYPE func_8013BC6C(SkelAnime* skelAnime, ActorAnimationEntryS* arg1, s32 arg2);
// void func_8013BD40(void);
// void func_8013BEDC(void);
// void func_8013C068(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
@@ -2888,7 +2888,7 @@ void func_8014ADBC(GlobalContext* globalCtx, UNK_PTR puParm2);
// void func_80150A84(void);
void func_80150D08(GlobalContext* globalCtx, u32 uParm2);
// void func_801514B0(void);
void func_801518B0(GlobalContext* globalCtx, u32 uParm2, Actor* uParm3);
void func_801518B0(GlobalContext* globalCtx, u16 textId, Actor* Actor);
void func_80151938(GlobalContext* globalCtx, u16 textId);
void func_80151A68(GlobalContext* globalCtx, u16 param_2);
void func_80151BB4(GlobalContext* globalCtx, u32 uParm2);
@@ -2896,7 +2896,7 @@ void func_80151BB4(GlobalContext* globalCtx, u32 uParm2);
// void func_80151DA4(void);
void func_80152434(GlobalContext* globalCtx, u16 arg2);
// void func_80152464(void);
s32 func_80152498(MessageContext* msgCtx);
u8 func_80152498(MessageContext* msgCtx);
// void func_8015268C(void);
// void func_80152C64(void);
// void func_80152CAC(void);
+5
View File
@@ -52,6 +52,11 @@
#define CAPACITY(upg, value) gUpgradeCapacities[upg][value]
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg) - 4)
#define CONTROLLER1(globalCtx) (&(globalCtx)->state.input[0])
#define CONTROLLER2(globalCtx) (&(globalCtx)->state.input[1])
#define CONTROLLER3(globalCtx) (&(globalCtx)->state.input[2])
#define CONTROLLER4(globalCtx) (&(globalCtx)->state.input[3])
#define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0)
#define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0)
+1 -1
View File
@@ -1403,7 +1403,7 @@ extern u32 gGsFlagsMask[];
extern u32 gGsFlagsShift[];
extern void* gItemIcons[];
extern u8 gItemSlots[];
extern u16 gItemPrices[];
extern s16 gItemPrices[];
extern u16 gScenesPerRegion[11][27];
extern u32 D_801C2410[];
extern s16 gLinkFormObjectIndexes[8];
+2 -1
View File
@@ -949,7 +949,8 @@ typedef struct {
/* 0x11F10 */ s32 unk11F10;
/* 0x11F14 */ UNK_TYPE1 pad11F14[0xE];
/* 0x11F22 */ u8 unk11F22;
/* 0x11F23 */ UNK_TYPE1 pad11F23[0xFE];
/* 0x11F23 */ UNK_TYPE1 pad11F23[0xFD];
/* 0x12020 */ u8 unk12020;
/* 0x12021 */ u8 choiceIndex;
/* 0x12022 */ UNK_TYPE1 unk12022;
/* 0x12023 */ s8 unk12023;
+11 -1
View File
@@ -31,7 +31,8 @@ typedef enum {
/* 0x15 */ ITEM_POTION_BLUE,
/* 0x16 */ ITEM_FAIRY,
/* 0x38 */ ITEM_MASK_ALL_NIGHT = 0x38,
/* 0x3B */ ITEM_MASK_GARO = 0x3B,
/* 0x3A */ ITEM_MASK_KEATON = 0x3A,
/* 0x3B */ ITEM_MASK_GARO,
/* 0x46 */ ITEM_MASK_BREMEN = 0x46,
/* 0x4D */ ITEM_SWORD_KOKIRI = 0x4D,
/* 0x4E */ ITEM_SWORD_RAZOR,
@@ -68,6 +69,13 @@ typedef enum {
typedef enum {
/* 0x00 */ GI_NONE,
/* 0x01 */ GI_RUPEE_GREEN,
/* 0x02 */ GI_RUPEE_BLUE,
/* 0x03 */ GI_RUPEE_10,
/* 0x04 */ GI_RUPEE_RED,
/* 0x05 */ GI_RUPEE_PURPLE,
/* 0x06 */ GI_RUPEE_SILVER,
/* 0x07 */ GI_RUPEE_GOLD,
/* 0x0C */ GI_HEART_PIECE = 0x0C,
/* 0x0D */ GI_HEART_CONTAINER,
/* 0x16 */ GI_BOMBS_10 = 0x16,
@@ -92,12 +100,14 @@ typedef enum {
/* 0x5E */ GI_FAIRY,
/* 0x60 */ GI_MILK_BOTTLE = 0x60,
/* 0x7E */ GI_MASK_ALL_NIGHT = 0x7E,
/* 0x80 */ GI_MASK_KEATON = 0x80,
/* 0x8C */ GI_MASK_BREMEN = 0x8C,
/* 0x9B */ GI_SWORD_GREAT_FAIRY = 0x9B,
/* 0x9C */ GI_SWORD_KOKIRI,
/* 0x9D */ GI_SWORD_RAZOR,
/* 0x9E */ GI_SWORD_GILDED,
/* 0x9F */ GI_SHIELD_HERO_2, // Code that treats this as hero's shield is unused, so take with a grain of salt
/* 0xA1 */ GI_LETTER_TO_MAMA = 0xA1,
/* 0xA9 */ GI_BOTTLE = 0xA9
} GetItemID;