diff --git a/soh/include/alignment.h b/soh/include/alignment.h new file mode 100644 index 000000000..7a3b94ea2 --- /dev/null +++ b/soh/include/alignment.h @@ -0,0 +1,16 @@ +#ifndef ALIGNMENT_H +#define ALIGNMENT_H + +#define ALIGN8(val) (((val) + 7) & ~7) +#define ALIGN16(val) (((val) + 0xF) & ~0xF) +#define ALIGN32(val) (((val) + 0x1F) & ~0x1F) +#define ALIGN64(val) (((val) + 0x3F) & ~0x3F) +#define ALIGN256(val) (((val) + 0xFF) & ~0xFF) + +#ifdef __GNUC__ +#define ALIGNED8 __attribute__ ((aligned (8))) +#else +#define ALIGNED8 +#endif + +#endif diff --git a/soh/include/macros.h b/soh/include/macros.h index 2829257d1..2d69b83ea 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -3,49 +3,51 @@ #include +// Upstream TODO: Document reasoning for change +// #ifndef __GNUC__ +// #define __attribute__(x) +// #endif + +// #ifndef AVOID_UB +// #define BAD_RETURN(type) type +// #else +// #define BAD_RETURN(type) void +// #endif + +// #define UNUSED __attribute__((unused)) +// #define FALLTHROUGH __attribute__((fallthrough)) + #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) #define PHYSICAL_TO_VIRTUAL(addr) (void*)((uintptr_t)(addr) + 0x80000000) #define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000) +// Upstream TODO: Document reasoning for change //#define SEGMENTED_TO_VIRTUAL(addr) PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)] + SEGMENT_OFFSET(addr)) - #define SEGMENTED_TO_VIRTUAL(addr) addr -#define ALIGN16(val) (((val) + 0xF) & ~0xF) -#define ALIGN32(val) (((val) + 0x1F) & ~0x1F) -#define ALIGN64(val) (((val) + 0x3F) & ~0x3F) -#define ALIGN256(val) (((val) + 0xFF) & ~0xFF) - -#define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member)) - #define SQ(x) ((x)*(x)) #define ABS(x) ((x) >= 0 ? (x) : -(x)) #define DECR(x) ((x) == 0 ? 0 : --(x)) #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) -#define MEDIAN3(a1, a2, a3) \ - (((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \ - : (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3)))) #define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0)) #define GET_PLAYER(play) ((Player*)(play)->actorCtx.actorLists[ACTORCAT_PLAYER].head) -#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamera]) +#define GET_ACTIVE_CAM(play) ((play)->cameraPtrs[(play)->activeCamera]) // Upstream TODO: Camera -#define LINK_IS_ADULT (gSaveContext.linkAge == 0) -#define LINK_IS_CHILD (gSaveContext.linkAge == 1) - -#define CHECK_EQUIPMENT_AGE(i, j) (CVar_GetS32("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge))) -#define CHECK_SLOT_AGE(slotIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge)) -#define CHECK_ITEM_AGE(itemIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge)) +#define LINK_IS_ADULT (gSaveContext.linkAge == LINK_AGE_ADULT) +#define LINK_IS_CHILD (gSaveContext.linkAge == LINK_AGE_CHILD) #define YEARS_CHILD 5 #define YEARS_ADULT 17 #define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT) +#define CLOCK_TIME(hr, min) ((s32)(((hr) * 60 + (min)) * (f32)0x10000 / (24 * 60) + 0.5f)) + #define IS_DAY (gSaveContext.nightFlag == 0) #define IS_NIGHT (gSaveContext.nightFlag == 1) @@ -56,7 +58,15 @@ #define ALL_EQUIP_VALUE(equip) ((s32)(gSaveContext.inventory.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) #define CUR_EQUIP_VALUE(equip) ((s32)(gSaveContext.equips.equipment & gEquipMasks[equip]) >> gEquipShifts[equip]) -#define CHECK_OWNED_EQUIP(equip, value) ((gBitFlags[value] << gEquipShifts[equip]) & gSaveContext.inventory.equipment) +#define OWNED_EQUIP_FLAG(equip, value) (gBitFlags[value] << gEquipShifts[equip]) +#define OWNED_EQUIP_FLAG_ALT(equip, value) ((1 << (value)) << gEquipShifts[equip]) +#define CHECK_OWNED_EQUIP(equip, value) (OWNED_EQUIP_FLAG(equip, value) & gSaveContext.inventory.equipment) +#define CHECK_OWNED_EQUIP_ALT(equip, value) (gBitFlags[(value) + (equip) * 4] & gSaveContext.inventory.equipment) + +#define SWORD_EQUIP_TO_PLAYER(swordEquip) (swordEquip) +#define SHIELD_EQUIP_TO_PLAYER(shieldEquip) (shieldEquip) +#define TUNIC_EQUIP_TO_PLAYER(tunicEquip) ((tunicEquip) - 1) +#define BOOTS_EQUIP_TO_PLAYER(bootsEquip) ((bootsEquip) - 1) #define CUR_UPG_VALUE(upg) ((s32)(gSaveContext.inventory.upgrades & gUpgradeMasks[upg]) >> gUpgradeShifts[upg]) #define CAPACITY(upg, value) gUpgradeCapacities[upg][value] @@ -72,6 +82,21 @@ #define HIGH_SCORE(score) (gSaveContext.highScores[score]) +#define GET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTCHKINF(flag) (gSaveContext.eventChkInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + +#define GET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_ITEMGETINF(flag) (gSaveContext.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) + +#define GET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_INFTABLE(flag) (gSaveContext.infTable[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + +#define GET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] & (1 << ((flag) & 0xF))) +#define SET_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) +#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) + #define B_BTN_ITEM ((gSaveContext.buttonStatus[0] == ITEM_NONE) \ ? ITEM_NONE \ : (gSaveContext.equips.buttonItems[0] == ITEM_SWORD_KNIFE) \ @@ -82,15 +107,13 @@ ? gSaveContext.equips.buttonItems[(button) + 1] \ : ITEM_NONE) -#define DPAD_ITEM(button) ((gSaveContext.buttonStatus[(button) + 5] != BTN_DISABLED) \ - ? gSaveContext.equips.buttonItems[(button) + 4] \ - : ITEM_NONE) - #define CHECK_BTN_ALL(state, combo) (~((state) | ~(combo)) == 0) #define CHECK_BTN_ANY(state, combo) (((state) & (combo)) != 0) #define CHECK_FLAG_ALL(flags, mask) (((flags) & (mask)) == (mask)) +// #region SOH [General] +// Logging changes #ifndef NDEBUG #define LOG(exp, value, format) \ do { \ @@ -133,30 +156,8 @@ #define LOG_THREAD_ID() ((void)0) #define LOG_HUNGUP_THREAD() ((void)0) #endif +// #endregion -#define MATRIX_TOMTX(dest) Matrix_ToMtx(dest, __FILE__, __LINE__) -#define MATRIX_NEWMTX(gfxCtx) Matrix_NewMtx(gfxCtx, __FILE__, __LINE__) -#define MATRIX_CHECKFLOATS(mf) Matrix_CheckFloats(mf, __FILE__, __LINE__) - -#define ZELDA_ARENA_MALLOC_DEBUG(size) ZeldaArena_MallocDebug(size, __FILE__, __LINE__) -#define ZELDA_ARENA_MALLOC_RDEBUG(size) ZeldaArena_MallocRDebug(size, __FILE__, __LINE__) -#define ZELDA_ARENA_REALLOC_DEBUG(ptr, newSize) ZeldaArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) -#define ZELDA_ARENA_FREE_DEBUG(ptr) ZeldaArena_FreeDebug(ptr, __FILE__, __LINE__) - -#define SYSTEM_ARENA_MALLOC_DEBUG(size) SystemArena_MallocDebug(size, __FILE__, __LINE__) -#define SYSTEM_ARENA_MALLOC_RDEBUG(size) SystemArena_MallocRDebug(size, __FILE__, __LINE__) -#define SYSTEM_ARENA_REALLOC_DEBUG(ptr, newSize) SystemArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) -#define SYSTEM_ARENA_FREE_DEBUG(ptr) SystemArena_FreeDebug(ptr, __FILE__, __LINE__) - -#define DEBUG_ARENA_MALLOC_DEBUG(size) DebugArena_MallocDebug(size, __FILE__, __LINE__) -#define DEBUG_ARENA_MALLOC_RDEBUG(size) DebugArena_MallocRDebug(size, __FILE__, __LINE__) -#define DEBUG_ARENA_REALLOC_DEBUG(ptr, newSize) DebugArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) -#define DEBUG_ARENA_FREE_DEBUG(ptr) DebugArena_FreeDebug(ptr, __FILE__, __LINE__) - -#define GAMESTATE_ALLOC_MC(gameState, size) GameState_Alloc(gameState, size, __FILE__, __LINE__) -#define GAMESTATE_MALLOC_DEBUG(gameState, size) GameAlloc_MallocDebug(gameState, size, __FILE__, __LINE__) - -#define BGCHECK_POS_ERROR_CHECK(vec3f) BgCheck_PosErrorCheck(vec3f, __FILE__, __LINE__) #define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \ do { \ @@ -180,12 +181,17 @@ extern GraphicsContext* __gfxCtx; #define WORK_DISP __gfxCtx->work.p #define POLY_OPA_DISP __gfxCtx->polyOpa.p #define POLY_XLU_DISP __gfxCtx->polyXlu.p +// #region SOH [General] +// Upstream TODO: Document reasoning for these only existing in SoH #define WORLD_OVERLAY_DISP __gfxCtx->worldOverlay.p #define POLY_KAL_DISP __gfxCtx->polyKal.p +// #endregion #define OVERLAY_DISP __gfxCtx->overlay.p // __gfxCtx shouldn't be used directly. // Use the DISP macros defined above when writing to display buffers. +// #region SOH [General] +// Augmented to provide debug information in debug build and support interpolation #ifndef NDEBUG #define OPEN_DISPS(gfxCtx) \ { \ @@ -221,6 +227,7 @@ extern GraphicsContext* __gfxCtx; } \ (void)0 #endif +// #endregion /** * `x` vertex x @@ -237,11 +244,13 @@ extern GraphicsContext* __gfxCtx; #define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } } +// #region SOH [WiiU] #ifdef __WIIU__ #define ASSERT(expression) (void)((!!(expression)) || (_assert(#expression, __FILE__, (unsigned)(__LINE__)), 0)) #else #define ASSERT(expression) (void)((!!(expression)) || (__assert(#expression, __FILE__, (unsigned)(__LINE__)), 0)) #endif +// #endregion #define gDPSetTileCustom(pkt, fmt, siz, width, height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ do { \ @@ -256,14 +265,51 @@ extern GraphicsContext* __gfxCtx; ((height)-1) << G_TEXTURE_IMAGE_FRAC); \ } while (0) -#ifdef __GNUC__ -#define ALIGNED8 __attribute__ ((aligned (8))) -#else -#define ALIGNED8 -#endif +// #region SOH [General] +#define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member)) + +#define MEDIAN3(a1, a2, a3) \ + (((a2) >= (a1)) ? (((a3) >= (a2)) ? (a2) : (((a1) >= (a3)) ? (a1) : (a3))) \ + : (((a2) >= (a3)) ? (a2) : (((a3) >= (a1)) ? (a1) : (a3)))) + +#define MATRIX_TOMTX(dest) Matrix_ToMtx(dest, __FILE__, __LINE__) +#define MATRIX_NEWMTX(gfxCtx) Matrix_NewMtx(gfxCtx, __FILE__, __LINE__) +#define MATRIX_CHECKFLOATS(mf) Matrix_CheckFloats(mf, __FILE__, __LINE__) + +#define ZELDA_ARENA_MALLOC_DEBUG(size) ZeldaArena_MallocDebug(size, __FILE__, __LINE__) +#define ZELDA_ARENA_MALLOC_RDEBUG(size) ZeldaArena_MallocRDebug(size, __FILE__, __LINE__) +#define ZELDA_ARENA_REALLOC_DEBUG(ptr, newSize) ZeldaArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) +#define ZELDA_ARENA_FREE_DEBUG(ptr) ZeldaArena_FreeDebug(ptr, __FILE__, __LINE__) + +#define SYSTEM_ARENA_MALLOC_DEBUG(size) SystemArena_MallocDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_MALLOC_RDEBUG(size) SystemArena_MallocRDebug(size, __FILE__, __LINE__) +#define SYSTEM_ARENA_REALLOC_DEBUG(ptr, newSize) SystemArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) +#define SYSTEM_ARENA_FREE_DEBUG(ptr) SystemArena_FreeDebug(ptr, __FILE__, __LINE__) + +#define DEBUG_ARENA_MALLOC_DEBUG(size) DebugArena_MallocDebug(size, __FILE__, __LINE__) +#define DEBUG_ARENA_MALLOC_RDEBUG(size) DebugArena_MallocRDebug(size, __FILE__, __LINE__) +#define DEBUG_ARENA_REALLOC_DEBUG(ptr, newSize) DebugArena_ReallocDebug(ptr, newSize, __FILE__, __LINE__) +#define DEBUG_ARENA_FREE_DEBUG(ptr) DebugArena_FreeDebug(ptr, __FILE__, __LINE__) + +#define GAMESTATE_ALLOC_MC(gameState, size) GameState_Alloc(gameState, size, __FILE__, __LINE__) +#define GAMESTATE_MALLOC_DEBUG(gameState, size) GameAlloc_MallocDebug(gameState, size, __FILE__, __LINE__) + +#define BGCHECK_POS_ERROR_CHECK(vec3f) BgCheck_PosErrorCheck(vec3f, __FILE__, __LINE__) #define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1) +// #endregion +// #region SOH [Enhancements] +#define CHECK_EQUIPMENT_AGE(i, j) (CVar_GetS32("gTimelessEquipment", 0) || (gEquipAgeReqs[i][j] == 9) || (gEquipAgeReqs[i][j] == ((void)0, gSaveContext.linkAge))) +#define CHECK_SLOT_AGE(slotIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gSlotAgeReqs[slotIndex] == 9) || gSlotAgeReqs[slotIndex] == ((void)0, gSaveContext.linkAge)) +#define CHECK_ITEM_AGE(itemIndex) (CVar_GetS32("gTimelessEquipment", 0) || (gItemAgeReqs[itemIndex] == 9) || (gItemAgeReqs[itemIndex] == gSaveContext.linkAge)) + +#define DPAD_ITEM(button) ((gSaveContext.buttonStatus[(button) + 5] != BTN_DISABLED) \ + ? gSaveContext.equips.buttonItems[(button) + 4] \ + : ITEM_NONE) +// #endregion + +// #region SOH [Randomizer] #define NUM_TRIALS 6 #define NUM_SHOP_ITEMS 64 #define NUM_SCRUBS 46 @@ -277,5 +323,6 @@ extern GraphicsContext* __gfxCtx; #define GERUDO_FORTRESS_SMALL_KEY_MAX 4 #define GANONS_CASTLE_SMALL_KEY_MAX (ResourceMgr_IsSceneMasterQuest(SCENE_GANONTIKA) ? 3 : 2) #define TREASURE_GAME_SMALL_KEY_MAX 6 +// #endregion #endif diff --git a/soh/include/z64.h b/soh/include/z64.h index c376470e1..b83e650b7 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -24,6 +24,7 @@ #include "z64skin.h" #include "z64transition.h" #include "z64interface.h" +#include "alignment.h" #include "sequence.h" #include "sfx.h" #include diff --git a/soh/include/z64player.h b/soh/include/z64player.h index dab2e7752..1d3c3e971 100644 --- a/soh/include/z64player.h +++ b/soh/include/z64player.h @@ -2,6 +2,7 @@ #define Z64PLAYER_H #include "z64actor.h" +#include "alignment.h" #include "soh/Enhancements/item-tables/ItemTableTypes.h" struct Player; @@ -64,84 +65,85 @@ typedef enum { } PlayerMask; typedef enum { - /* 0x00 */ PLAYER_AP_NONE, - /* 0x01 */ PLAYER_AP_LAST_USED, - /* 0x02 */ PLAYER_AP_FISHING_POLE, - /* 0x03 */ PLAYER_AP_SWORD_MASTER, - /* 0x04 */ PLAYER_AP_SWORD_KOKIRI, - /* 0x05 */ PLAYER_AP_SWORD_BGS, - /* 0x06 */ PLAYER_AP_STICK, - /* 0x07 */ PLAYER_AP_HAMMER, - /* 0x08 */ PLAYER_AP_BOW, - /* 0x09 */ PLAYER_AP_BOW_FIRE, - /* 0x0A */ PLAYER_AP_BOW_ICE, - /* 0x0B */ PLAYER_AP_BOW_LIGHT, - /* 0x0C */ PLAYER_AP_BOW_0C, - /* 0x0D */ PLAYER_AP_BOW_0D, - /* 0x0E */ PLAYER_AP_BOW_0E, - /* 0x0F */ PLAYER_AP_SLINGSHOT, - /* 0x10 */ PLAYER_AP_HOOKSHOT, - /* 0x11 */ PLAYER_AP_LONGSHOT, - /* 0x12 */ PLAYER_AP_BOMB, - /* 0x13 */ PLAYER_AP_BOMBCHU, - /* 0x14 */ PLAYER_AP_BOOMERANG, - /* 0x15 */ PLAYER_AP_MAGIC_SPELL_15, - /* 0x16 */ PLAYER_AP_MAGIC_SPELL_16, - /* 0x17 */ PLAYER_AP_MAGIC_SPELL_17, - /* 0x18 */ PLAYER_AP_FARORES_WIND, - /* 0x19 */ PLAYER_AP_NAYRUS_LOVE, - /* 0x1A */ PLAYER_AP_DINS_FIRE, - /* 0x1B */ PLAYER_AP_NUT, - /* 0x1C */ PLAYER_AP_OCARINA_FAIRY, - /* 0x1D */ PLAYER_AP_OCARINA_TIME, - /* 0x1E */ PLAYER_AP_BOTTLE, - /* 0x1F */ PLAYER_AP_BOTTLE_FISH, - /* 0x20 */ PLAYER_AP_BOTTLE_FIRE, - /* 0x21 */ PLAYER_AP_BOTTLE_BUG, - /* 0x22 */ PLAYER_AP_BOTTLE_POE, - /* 0x23 */ PLAYER_AP_BOTTLE_BIG_POE, - /* 0x24 */ PLAYER_AP_BOTTLE_LETTER, - /* 0x25 */ PLAYER_AP_BOTTLE_POTION_RED, - /* 0x26 */ PLAYER_AP_BOTTLE_POTION_BLUE, - /* 0x27 */ PLAYER_AP_BOTTLE_POTION_GREEN, - /* 0x28 */ PLAYER_AP_BOTTLE_MILK, - /* 0x29 */ PLAYER_AP_BOTTLE_MILK_HALF, - /* 0x2A */ PLAYER_AP_BOTTLE_FAIRY, - /* 0x2B */ PLAYER_AP_LETTER_ZELDA, - /* 0x2C */ PLAYER_AP_WEIRD_EGG, - /* 0x2D */ PLAYER_AP_CHICKEN, - /* 0x2E */ PLAYER_AP_BEAN, - /* 0x2F */ PLAYER_AP_POCKET_EGG, - /* 0x30 */ PLAYER_AP_POCKET_CUCCO, - /* 0x31 */ PLAYER_AP_COJIRO, - /* 0x32 */ PLAYER_AP_ODD_MUSHROOM, - /* 0x33 */ PLAYER_AP_ODD_POTION, - /* 0x34 */ PLAYER_AP_SAW, - /* 0x35 */ PLAYER_AP_SWORD_BROKEN, - /* 0x36 */ PLAYER_AP_PRESCRIPTION, - /* 0x37 */ PLAYER_AP_FROG, - /* 0x38 */ PLAYER_AP_EYEDROPS, - /* 0x39 */ PLAYER_AP_CLAIM_CHECK, - /* 0x3A */ PLAYER_AP_MASK_KEATON, - /* 0x3B */ PLAYER_AP_MASK_SKULL, - /* 0x3C */ PLAYER_AP_MASK_SPOOKY, - /* 0x3D */ PLAYER_AP_MASK_BUNNY, - /* 0x3E */ PLAYER_AP_MASK_GORON, - /* 0x3F */ PLAYER_AP_MASK_ZORA, - /* 0x40 */ PLAYER_AP_MASK_GERUDO, - /* 0x41 */ PLAYER_AP_MASK_TRUTH, - /* 0x42 */ PLAYER_AP_LENS, - /* 0x43 */ PLAYER_AP_SHIELD_DEKU, - /* 0x44 */ PLAYER_AP_SHIELD_HYLIAN, - /* 0x45 */ PLAYER_AP_SHIELD_MIRROR, - /* 0x46 */ PLAYER_AP_TUNIC_KOKIRI, - /* 0x47 */ PLAYER_AP_TUNIC_GORON, - /* 0x48 */ PLAYER_AP_TUNIC_ZORA, - /* 0x49 */ PLAYER_AP_BOOTS_KOKIRI, - /* 0x4A */ PLAYER_AP_BOOTS_IRON, - /* 0x4B */ PLAYER_AP_BOOTS_HOVER, - /* 0x4C */ PLAYER_AP_MAX -} PlayerActionParam; + /* 0x00 */ PLAYER_IA_NONE, + /* 0x01 */ PLAYER_IA_LAST_USED, + /* 0x02 */ PLAYER_IA_FISHING_POLE, + /* 0x03 */ PLAYER_IA_SWORD_MASTER, + /* 0x04 */ PLAYER_IA_SWORD_KOKIRI, + /* 0x05 */ PLAYER_IA_SWORD_BGS, + /* 0x06 */ PLAYER_IA_STICK, + /* 0x07 */ PLAYER_IA_HAMMER, + /* 0x08 */ PLAYER_IA_BOW, + /* 0x09 */ PLAYER_IA_BOW_FIRE, + /* 0x0A */ PLAYER_IA_BOW_ICE, + /* 0x0B */ PLAYER_IA_BOW_LIGHT, + /* 0x0C */ PLAYER_IA_BOW_0C, + /* 0x0D */ PLAYER_IA_BOW_0D, + /* 0x0E */ PLAYER_IA_BOW_0E, + /* 0x0F */ PLAYER_IA_SLINGSHOT, + /* 0x10 */ PLAYER_IA_HOOKSHOT, + /* 0x11 */ PLAYER_IA_LONGSHOT, + /* 0x12 */ PLAYER_IA_BOMB, + /* 0x13 */ PLAYER_IA_BOMBCHU, + /* 0x14 */ PLAYER_IA_BOOMERANG, + /* 0x15 */ PLAYER_IA_MAGIC_SPELL_15, + /* 0x16 */ PLAYER_IA_MAGIC_SPELL_16, + /* 0x17 */ PLAYER_IA_MAGIC_SPELL_17, + /* 0x18 */ PLAYER_IA_FARORES_WIND, + /* 0x19 */ PLAYER_IA_NAYRUS_LOVE, + /* 0x1A */ PLAYER_IA_DINS_FIRE, + /* 0x1B */ PLAYER_IA_NUT, + /* 0x1C */ PLAYER_IA_OCARINA_FAIRY, + /* 0x1D */ PLAYER_IA_OCARINA_TIME, + /* 0x1E */ PLAYER_IA_BOTTLE, + /* 0x1F */ PLAYER_IA_BOTTLE_FISH, + /* 0x20 */ PLAYER_IA_BOTTLE_FIRE, + /* 0x21 */ PLAYER_IA_BOTTLE_BUG, + /* 0x22 */ PLAYER_IA_BOTTLE_POE, + /* 0x23 */ PLAYER_IA_BOTTLE_BIG_POE, + /* 0x24 */ PLAYER_IA_BOTTLE_LETTER, + /* 0x25 */ PLAYER_IA_BOTTLE_POTION_RED, + /* 0x26 */ PLAYER_IA_BOTTLE_POTION_BLUE, + /* 0x27 */ PLAYER_IA_BOTTLE_POTION_GREEN, + /* 0x28 */ PLAYER_IA_BOTTLE_MILK, + /* 0x29 */ PLAYER_IA_BOTTLE_MILK_HALF, + /* 0x2A */ PLAYER_IA_BOTTLE_FAIRY, + /* 0x2B */ PLAYER_IA_LETTER_ZELDA, + /* 0x2C */ PLAYER_IA_WEIRD_EGG, + /* 0x2D */ PLAYER_IA_CHICKEN, + /* 0x2E */ PLAYER_IA_BEAN, + /* 0x2F */ PLAYER_IA_POCKET_EGG, + /* 0x30 */ PLAYER_IA_POCKET_CUCCO, + /* 0x31 */ PLAYER_IA_COJIRO, + /* 0x32 */ PLAYER_IA_ODD_MUSHROOM, + /* 0x33 */ PLAYER_IA_ODD_POTION, + /* 0x34 */ PLAYER_IA_SAW, + /* 0x35 */ PLAYER_IA_SWORD_BROKEN, + /* 0x36 */ PLAYER_IA_PRESCRIPTION, + /* 0x37 */ PLAYER_IA_FROG, + /* 0x38 */ PLAYER_IA_EYEDROPS, + /* 0x39 */ PLAYER_IA_CLAIM_CHECK, + /* 0x3A */ PLAYER_IA_MASK_KEATON, + /* 0x3B */ PLAYER_IA_MASK_SKULL, + /* 0x3C */ PLAYER_IA_MASK_SPOOKY, + /* 0x3D */ PLAYER_IA_MASK_BUNNY, + /* 0x3E */ PLAYER_IA_MASK_GORON, + /* 0x3F */ PLAYER_IA_MASK_ZORA, + /* 0x40 */ PLAYER_IA_MASK_GERUDO, + /* 0x41 */ PLAYER_IA_MASK_TRUTH, + /* 0x42 */ PLAYER_IA_LENS, + // Upstream TODO: Document why these entries were added + /* 0x43 */ PLAYER_IA_SHIELD_DEKU, + /* 0x44 */ PLAYER_IA_SHIELD_HYLIAN, + /* 0x45 */ PLAYER_IA_SHIELD_MIRROR, + /* 0x46 */ PLAYER_IA_TUNIC_KOKIRI, + /* 0x47 */ PLAYER_IA_TUNIC_GORON, + /* 0x48 */ PLAYER_IA_TUNIC_ZORA, + /* 0x49 */ PLAYER_IA_BOOTS_KOKIRI, + /* 0x4A */ PLAYER_IA_BOOTS_IRON, + /* 0x4B */ PLAYER_IA_BOOTS_HOVER, + /* 0x4C */ PLAYER_IA_MAX +} PlayerItemAction; typedef enum { /* 0x00 */ PLAYER_LIMB_NONE, @@ -170,27 +172,59 @@ typedef enum { } PlayerLimb; typedef enum { - /* 0 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST - /* 1 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH - /* 2 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN - /* 3 */ PLAYER_BODYPART_R_FOOT, // PLAYER_LIMB_R_FOOT - /* 4 */ PLAYER_BODYPART_L_THIGH, // PLAYER_LIMB_L_THIGH - /* 5 */ PLAYER_BODYPART_L_SHIN, // PLAYER_LIMB_L_SHIN - /* 6 */ PLAYER_BODYPART_L_FOOT, // PLAYER_LIMB_L_FOOT - /* 7 */ PLAYER_BODYPART_HEAD, // PLAYER_LIMB_HEAD - /* 8 */ PLAYER_BODYPART_HAT, // PLAYER_LIMB_HAT - /* 9 */ PLAYER_BODYPART_COLLAR, // PLAYER_LIMB_COLLAR - /* 10 */ PLAYER_BODYPART_L_SHOULDER, // PLAYER_LIMB_L_SHOULDER - /* 11 */ PLAYER_BODYPART_L_FOREARM, // PLAYER_LIMB_L_FOREARM - /* 12 */ PLAYER_BODYPART_L_HAND, // PLAYER_LIMB_L_HAND - /* 13 */ PLAYER_BODYPART_R_SHOULDER, // PLAYER_LIMB_R_SHOULDER - /* 14 */ PLAYER_BODYPART_R_FOREARM, // PLAYER_LIMB_R_FOREARM - /* 15 */ PLAYER_BODYPART_R_HAND, // PLAYER_LIMB_R_HAND - /* 16 */ PLAYER_BODYPART_SHEATH, // PLAYER_LIMB_SHEATH - /* 17 */ PLAYER_BODYPART_TORSO, // PLAYER_LIMB_TORSO - /* 18 */ PLAYER_BODYPART_MAX + /* 0x00 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST + /* 0x01 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH + /* 0x02 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN + /* 0x03 */ PLAYER_BODYPART_R_FOOT, // PLAYER_LIMB_R_FOOT + /* 0x04 */ PLAYER_BODYPART_L_THIGH, // PLAYER_LIMB_L_THIGH + /* 0x05 */ PLAYER_BODYPART_L_SHIN, // PLAYER_LIMB_L_SHIN + /* 0x06 */ PLAYER_BODYPART_L_FOOT, // PLAYER_LIMB_L_FOOT + /* 0x07 */ PLAYER_BODYPART_HEAD, // PLAYER_LIMB_HEAD + /* 0x08 */ PLAYER_BODYPART_HAT, // PLAYER_LIMB_HAT + /* 0x09 */ PLAYER_BODYPART_COLLAR, // PLAYER_LIMB_COLLAR + /* 0x0A */ PLAYER_BODYPART_L_SHOULDER, // PLAYER_LIMB_L_SHOULDER + /* 0x0B */ PLAYER_BODYPART_L_FOREARM, // PLAYER_LIMB_L_FOREARM + /* 0x0C */ PLAYER_BODYPART_L_HAND, // PLAYER_LIMB_L_HAND + /* 0x0D */ PLAYER_BODYPART_R_SHOULDER, // PLAYER_LIMB_R_SHOULDER + /* 0x0E */ PLAYER_BODYPART_R_FOREARM, // PLAYER_LIMB_R_FOREARM + /* 0x0F */ PLAYER_BODYPART_R_HAND, // PLAYER_LIMB_R_HAND + /* 0x10 */ PLAYER_BODYPART_SHEATH, // PLAYER_LIMB_SHEATH + /* 0x11 */ PLAYER_BODYPART_TORSO, // PLAYER_LIMB_TORSO + /* 0x12 */ PLAYER_BODYPART_MAX } PlayerBodyPart; +typedef enum { + /* 0 */ PLAYER_MWA_FORWARD_SLASH_1H, + /* 1 */ PLAYER_MWA_FORWARD_SLASH_2H, + /* 2 */ PLAYER_MWA_FORWARD_COMBO_1H, + /* 3 */ PLAYER_MWA_FORWARD_COMBO_2H, + /* 4 */ PLAYER_MWA_RIGHT_SLASH_1H, + /* 5 */ PLAYER_MWA_RIGHT_SLASH_2H, + /* 6 */ PLAYER_MWA_RIGHT_COMBO_1H, + /* 7 */ PLAYER_MWA_RIGHT_COMBO_2H, + /* 8 */ PLAYER_MWA_LEFT_SLASH_1H, + /* 9 */ PLAYER_MWA_LEFT_SLASH_2H, + /* 10 */ PLAYER_MWA_LEFT_COMBO_1H, + /* 11 */ PLAYER_MWA_LEFT_COMBO_2H, + /* 12 */ PLAYER_MWA_STAB_1H, + /* 13 */ PLAYER_MWA_STAB_2H, + /* 14 */ PLAYER_MWA_STAB_COMBO_1H, + /* 15 */ PLAYER_MWA_STAB_COMBO_2H, + /* 16 */ PLAYER_MWA_FLIPSLASH_START, + /* 17 */ PLAYER_MWA_JUMPSLASH_START, + /* 18 */ PLAYER_MWA_FLIPSLASH_FINISH, + /* 19 */ PLAYER_MWA_JUMPSLASH_FINISH, + /* 20 */ PLAYER_MWA_BACKSLASH_RIGHT, + /* 21 */ PLAYER_MWA_BACKSLASH_LEFT, + /* 22 */ PLAYER_MWA_HAMMER_FORWARD, + /* 23 */ PLAYER_MWA_HAMMER_SIDE, + /* 24 */ PLAYER_MWA_SPIN_ATTACK_1H, + /* 25 */ PLAYER_MWA_SPIN_ATTACK_2H, + /* 26 */ PLAYER_MWA_BIG_SPIN_1H, + /* 27 */ PLAYER_MWA_BIG_SPIN_2H, + /* 28 */ PLAYER_MWA_MAX +} PlayerMeleeWeaponAnimation; + typedef enum { /* -1 */ PLAYER_DOORTYPE_AJAR = -1, /* 0 */ PLAYER_DOORTYPE_NONE, @@ -200,124 +234,125 @@ typedef enum { } PlayerDoorType; typedef enum { - /* 0 */ PLAYER_MODELGROUP_0, // unused (except with the `Player_OverrideLimbDrawPause` bug) - /* 1 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, // kokiri/master sword, shield not in hand - /* 2 */ PLAYER_MODELGROUP_SWORD, // kokiri/master sword and possibly shield - /* 3 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models - /* 4 */ PLAYER_MODELGROUP_4, // unused, same as PLAYER_MODELGROUP_DEFAULT - /* 5 */ PLAYER_MODELGROUP_BGS, // biggoron sword - /* 6 */ PLAYER_MODELGROUP_BOW_SLINGSHOT, // bow/slingshot - /* 7 */ PLAYER_MODELGROUP_EXPLOSIVES, // bombs, bombchus, same as PLAYER_MODELGROUP_DEFAULT - /* 8 */ PLAYER_MODELGROUP_BOOMERANG, - /* 9 */ PLAYER_MODELGROUP_HOOKSHOT, - /* 10 */ PLAYER_MODELGROUP_10, // stick/fishing pole (which are drawn separately) - /* 11 */ PLAYER_MODELGROUP_HAMMER, - /* 12 */ PLAYER_MODELGROUP_OCARINA, // ocarina - /* 13 */ PLAYER_MODELGROUP_OOT, // ocarina of time - /* 14 */ PLAYER_MODELGROUP_BOTTLE, // bottles (drawn separately) - /* 15 */ PLAYER_MODELGROUP_15, // "last used" - /* 16 */ PLAYER_MODELGROUP_MAX + /* 0x00 */ PLAYER_MODELGROUP_0, // unused (except with the `Player_OverrideLimbDrawPause` bug) + /* 0x01 */ PLAYER_MODELGROUP_CHILD_HYLIAN_SHIELD, // kokiri/master sword, shield not in hand + /* 0x02 */ PLAYER_MODELGROUP_SWORD, // kokiri/master sword and possibly shield + /* 0x03 */ PLAYER_MODELGROUP_DEFAULT, // non-specific models, for items that don't have particular link models + /* 0x04 */ PLAYER_MODELGROUP_4, // unused, same as PLAYER_MODELGROUP_DEFAULT + /* 0x05 */ PLAYER_MODELGROUP_BGS, // biggoron sword + /* 0x06 */ PLAYER_MODELGROUP_BOW_SLINGSHOT, // bow/slingshot + /* 0x07 */ PLAYER_MODELGROUP_EXPLOSIVES, // bombs, bombchus, same as PLAYER_MODELGROUP_DEFAULT + /* 0x08 */ PLAYER_MODELGROUP_BOOMERANG, + /* 0x09 */ PLAYER_MODELGROUP_HOOKSHOT, + /* 0x0A */ PLAYER_MODELGROUP_10, // stick/fishing pole (which are drawn separately) + /* 0x0B */ PLAYER_MODELGROUP_HAMMER, + /* 0x0C */ PLAYER_MODELGROUP_OCARINA, // ocarina + /* 0x0D */ PLAYER_MODELGROUP_OOT, // ocarina of time + /* 0x0E */ PLAYER_MODELGROUP_BOTTLE, // bottles (drawn separately) + /* 0x0F */ PLAYER_MODELGROUP_15, // "last used" + /* 0x10 */ PLAYER_MODELGROUP_MAX } PlayerModelGroup; typedef enum { - /* 0 */ PLAYER_MODELGROUPENTRY_ANIM, - /* 1 */ PLAYER_MODELGROUPENTRY_LEFT_HAND, - /* 2 */ PLAYER_MODELGROUPENTRY_RIGHT_HAND, - /* 3 */ PLAYER_MODELGROUPENTRY_SHEATH, - /* 4 */ PLAYER_MODELGROUPENTRY_WAIST, - /* 5 */ PLAYER_MODELGROUPENTRY_MAX + /* 0x00 */ PLAYER_MODELGROUPENTRY_ANIM, + /* 0x01 */ PLAYER_MODELGROUPENTRY_LEFT_HAND, + /* 0x02 */ PLAYER_MODELGROUPENTRY_RIGHT_HAND, + /* 0x03 */ PLAYER_MODELGROUPENTRY_SHEATH, + /* 0x04 */ PLAYER_MODELGROUPENTRY_WAIST, + /* 0x05 */ PLAYER_MODELGROUPENTRY_MAX } PlayerModelGroupEntry; typedef enum { // left hand - /* 0 */ PLAYER_MODELTYPE_LH_OPEN, // empty open hand - /* 1 */ PLAYER_MODELTYPE_LH_CLOSED, // empty closed hand - /* 2 */ PLAYER_MODELTYPE_LH_SWORD, // holding kokiri/master sword - /* 3 */ PLAYER_MODELTYPE_3, // unused, same as PLAYER_MODELTYPE_LH_SWORD - /* 4 */ PLAYER_MODELTYPE_LH_BGS, // holding bgs/broken giant knife (child: master sword) - /* 5 */ PLAYER_MODELTYPE_LH_HAMMER, // holding hammer (child: empty hand) - /* 6 */ PLAYER_MODELTYPE_LH_BOOMERANG, // holding boomerang (adult: empty hand) - /* 7 */ PLAYER_MODELTYPE_LH_BOTTLE, // holding bottle (bottle drawn separately) + /* 0x00 */ PLAYER_MODELTYPE_LH_OPEN, // empty open hand + /* 0x01 */ PLAYER_MODELTYPE_LH_CLOSED, // empty closed hand + /* 0x02 */ PLAYER_MODELTYPE_LH_SWORD, // holding kokiri/master sword + /* 0x03 */ PLAYER_MODELTYPE_LH_SWORD_2, // unused, same as PLAYER_MODELTYPE_LH_SWORD + /* 0x04 */ PLAYER_MODELTYPE_LH_BGS, // holding bgs/broken giant knife (child: master sword) + /* 0x05 */ PLAYER_MODELTYPE_LH_HAMMER, // holding hammer (child: empty hand) + /* 0x06 */ PLAYER_MODELTYPE_LH_BOOMERANG, // holding boomerang (adult: empty hand) + /* 0x07 */ PLAYER_MODELTYPE_LH_BOTTLE, // holding bottle (bottle drawn separately) // right hand - /* 8 */ PLAYER_MODELTYPE_RH_OPEN, // empty open hand - /* 9 */ PLAYER_MODELTYPE_RH_CLOSED, // empty closed hand - /* 10 */ PLAYER_MODELTYPE_RH_SHIELD, // holding a shield (including no shield) - /* 11 */ PLAYER_MODELTYPE_RH_BOW_SLINGSHOT, // holding bow/slingshot - /* 12 */ PLAYER_MODELTYPE_12, // unused, same as PLAYER_MODELTYPE_RH_BOW_SLINGSHOT - /* 13 */ PLAYER_MODELTYPE_RH_OCARINA, // holding ocarina (child: fairy ocarina, adult: OoT) - /* 14 */ PLAYER_MODELTYPE_RH_OOT, // holding OoT - /* 15 */ PLAYER_MODELTYPE_RH_HOOKSHOT, // holding hookshot (child: empty hand) + /* 0x08 */ PLAYER_MODELTYPE_RH_OPEN, // empty open hand + /* 0x09 */ PLAYER_MODELTYPE_RH_CLOSED, // empty closed hand + /* 0x0A */ PLAYER_MODELTYPE_RH_SHIELD, // holding a shield (including no shield) + /* 0x0B */ PLAYER_MODELTYPE_RH_BOW_SLINGSHOT, // holding bow/slingshot + /* 0x0C */ PLAYER_MODELTYPE_RH_BOW_SLINGSHOT_2, // unused, same as PLAYER_MODELTYPE_RH_BOW_SLINGSHOT + /* 0x0D */ PLAYER_MODELTYPE_RH_OCARINA, // holding ocarina (child: fairy ocarina, adult: OoT) + /* 0x0E */ PLAYER_MODELTYPE_RH_OOT, // holding OoT + /* 0x0F */ PLAYER_MODELTYPE_RH_HOOKSHOT, // holding hookshot (child: empty hand) // sheath - /* 16 */ PLAYER_MODELTYPE_SHEATH_16, // sheathed kokiri/master sword? - /* 17 */ PLAYER_MODELTYPE_SHEATH_17, // empty sheath? - /* 18 */ PLAYER_MODELTYPE_SHEATH_18, // sword sheathed and shield on back? - /* 19 */ PLAYER_MODELTYPE_SHEATH_19, // empty sheath and shield on back? + /* 0x10 */ PLAYER_MODELTYPE_SHEATH_16, // sheathed kokiri/master sword? + /* 0x11 */ PLAYER_MODELTYPE_SHEATH_17, // empty sheath? + /* 0x12 */ PLAYER_MODELTYPE_SHEATH_18, // sword sheathed and shield on back? + /* 0x13 */ PLAYER_MODELTYPE_SHEATH_19, // empty sheath and shield on back? // waist - /* 20 */ PLAYER_MODELTYPE_WAIST, - /* 21 */ PLAYER_MODELTYPE_MAX, + /* 0x14 */ PLAYER_MODELTYPE_WAIST, + /* 0x15 */ PLAYER_MODELTYPE_MAX, /* 0xFF */ PLAYER_MODELTYPE_RH_FF = 0xFF // disable shield collider, cutscene-specific } PlayerModelType; typedef enum { - /* 0 */ PLAYER_ANIMTYPE_0, - /* 1 */ PLAYER_ANIMTYPE_1, - /* 2 */ PLAYER_ANIMTYPE_2, - /* 3 */ PLAYER_ANIMTYPE_3, - /* 4 */ PLAYER_ANIMTYPE_4, - /* 5 */ PLAYER_ANIMTYPE_5, - /* 6 */ PLAYER_ANIMTYPE_MAX + /* 0x00 */ PLAYER_ANIMTYPE_0, + /* 0x01 */ PLAYER_ANIMTYPE_1, + /* 0x02 */ PLAYER_ANIMTYPE_2, + /* 0x03 */ PLAYER_ANIMTYPE_3, + /* 0x04 */ PLAYER_ANIMTYPE_4, + /* 0x05 */ PLAYER_ANIMTYPE_5, + /* 0x06 */ PLAYER_ANIMTYPE_MAX } PlayerAnimType; typedef enum { - /* 0 */ PLAYER_ANIMGROUP_0, - /* 1 */ PLAYER_ANIMGROUP_1, - /* 2 */ PLAYER_ANIMGROUP_2, - /* 3 */ PLAYER_ANIMGROUP_3, - /* 4 */ PLAYER_ANIMGROUP_4, - /* 5 */ PLAYER_ANIMGROUP_5, - /* 6 */ PLAYER_ANIMGROUP_6, - /* 7 */ PLAYER_ANIMGROUP_7, - /* 8 */ PLAYER_ANIMGROUP_8, - /* 9 */ PLAYER_ANIMGROUP_9, - /* 10 */ PLAYER_ANIMGROUP_10, - /* 11 */ PLAYER_ANIMGROUP_11, - /* 12 */ PLAYER_ANIMGROUP_12, - /* 13 */ PLAYER_ANIMGROUP_13, - /* 14 */ PLAYER_ANIMGROUP_14, - /* 15 */ PLAYER_ANIMGROUP_15, - /* 16 */ PLAYER_ANIMGROUP_16, - /* 17 */ PLAYER_ANIMGROUP_17, - /* 18 */ PLAYER_ANIMGROUP_18, - /* 19 */ PLAYER_ANIMGROUP_19, - /* 20 */ PLAYER_ANIMGROUP_20, - /* 21 */ PLAYER_ANIMGROUP_21, - /* 22 */ PLAYER_ANIMGROUP_22, - /* 23 */ PLAYER_ANIMGROUP_23, - /* 24 */ PLAYER_ANIMGROUP_24, - /* 25 */ PLAYER_ANIMGROUP_25, - /* 26 */ PLAYER_ANIMGROUP_26, - /* 27 */ PLAYER_ANIMGROUP_27, - /* 28 */ PLAYER_ANIMGROUP_28, - /* 29 */ PLAYER_ANIMGROUP_29, - /* 30 */ PLAYER_ANIMGROUP_30, - /* 31 */ PLAYER_ANIMGROUP_31, - /* 32 */ PLAYER_ANIMGROUP_32, - /* 33 */ PLAYER_ANIMGROUP_33, - /* 34 */ PLAYER_ANIMGROUP_34, - /* 35 */ PLAYER_ANIMGROUP_35, - /* 36 */ PLAYER_ANIMGROUP_36, - /* 37 */ PLAYER_ANIMGROUP_37, - /* 38 */ PLAYER_ANIMGROUP_38, - /* 39 */ PLAYER_ANIMGROUP_39, - /* 40 */ PLAYER_ANIMGROUP_40, - /* 41 */ PLAYER_ANIMGROUP_41, - /* 42 */ PLAYER_ANIMGROUP_42, - /* 43 */ PLAYER_ANIMGROUP_43, - /* 44 */ PLAYER_ANIMGROUP_44, - /* 45 */ PLAYER_ANIMGROUP_MAX + /* 0x00 */ PLAYER_ANIMGROUP_0, + /* 0x01 */ PLAYER_ANIMGROUP_1, + /* 0x02 */ PLAYER_ANIMGROUP_2, + /* 0x03 */ PLAYER_ANIMGROUP_3, + /* 0x04 */ PLAYER_ANIMGROUP_4, + /* 0x05 */ PLAYER_ANIMGROUP_5, + /* 0x06 */ PLAYER_ANIMGROUP_6, + /* 0x07 */ PLAYER_ANIMGROUP_7, + /* 0x08 */ PLAYER_ANIMGROUP_8, + /* 0x09 */ PLAYER_ANIMGROUP_9, + /* 0x0A */ PLAYER_ANIMGROUP_10, + /* 0x0B */ PLAYER_ANIMGROUP_11, + /* 0x0C */ PLAYER_ANIMGROUP_12, + /* 0x0D */ PLAYER_ANIMGROUP_13, + /* 0x0E */ PLAYER_ANIMGROUP_14, + /* 0x0F */ PLAYER_ANIMGROUP_15, + /* 0x10 */ PLAYER_ANIMGROUP_16, + /* 0x11 */ PLAYER_ANIMGROUP_17, + /* 0x12 */ PLAYER_ANIMGROUP_18, + /* 0x13 */ PLAYER_ANIMGROUP_19, + /* 0x14 */ PLAYER_ANIMGROUP_20, + /* 0x15 */ PLAYER_ANIMGROUP_21, + /* 0x16 */ PLAYER_ANIMGROUP_22, + /* 0x17 */ PLAYER_ANIMGROUP_23, + /* 0x18 */ PLAYER_ANIMGROUP_24, + /* 0x19 */ PLAYER_ANIMGROUP_25, + /* 0x1A */ PLAYER_ANIMGROUP_26, + /* 0x1B */ PLAYER_ANIMGROUP_27, + /* 0x1C */ PLAYER_ANIMGROUP_28, + /* 0x1D */ PLAYER_ANIMGROUP_29, + /* 0x1E */ PLAYER_ANIMGROUP_30, + /* 0x1F */ PLAYER_ANIMGROUP_31, + /* 0x20 */ PLAYER_ANIMGROUP_32, + /* 0x21 */ PLAYER_ANIMGROUP_33, + /* 0x22 */ PLAYER_ANIMGROUP_34, + /* 0x23 */ PLAYER_ANIMGROUP_35, + /* 0x24 */ PLAYER_ANIMGROUP_36, + /* 0x25 */ PLAYER_ANIMGROUP_37, + /* 0x26 */ PLAYER_ANIMGROUP_38, + /* 0x27 */ PLAYER_ANIMGROUP_39, + /* 0x28 */ PLAYER_ANIMGROUP_40, + /* 0x29 */ PLAYER_ANIMGROUP_41, + /* 0x2A */ PLAYER_ANIMGROUP_42, + /* 0x2B */ PLAYER_ANIMGROUP_43, + /* 0x2C */ PLAYER_ANIMGROUP_44, + /* 0x2D */ PLAYER_ANIMGROUP_MAX } PlayerAnimGroup; -#define PLAYER_LIMB_BUF_COUNT PLAYER_LIMB_MAX + 2 // 2 extra entries in limb buffers? +#define LIMB_BUF_COUNT(limbCount) ((ALIGN16((limbCount) * sizeof(Vec3s)) + sizeof(Vec3s) - 1) / sizeof(Vec3s)) +#define PLAYER_LIMB_BUF_COUNT LIMB_BUF_COUNT(PLAYER_LIMB_MAX) typedef struct { /* 0x00 */ f32 unk_00; @@ -361,6 +396,9 @@ typedef struct { /* 0x10 */ Vec3f base; } WeaponInfo; // size = 0x1C +// #region SOH [General] +// Supporting pendingFlag +// Upstream TODO: Rename these to be more obviously SoH specific typedef enum { FLAG_NONE, FLAG_SCENE_SWITCH, @@ -375,9 +413,10 @@ typedef struct { /* 0x00 */ s32 flagID; // which flag to set when Player_SetPendingFlag is called /* 0x04 */ FlagType flagType; // type of flag to set when Player_SetPendingFlag is called } PendingFlag; // size = 0x06 +// #endregion #define PLAYER_STATE1_0 (1 << 0) -#define PLAYER_STATE1_1 (1 << 1) +#define PLAYER_STATE1_SWINGING_BOTTLE (1 << 1) #define PLAYER_STATE1_2 (1 << 2) #define PLAYER_STATE1_3 (1 << 3) #define PLAYER_STATE1_4 (1 << 4) @@ -425,9 +464,9 @@ typedef struct { #define PLAYER_STATE2_13 (1 << 13) #define PLAYER_STATE2_14 (1 << 14) #define PLAYER_STATE2_15 (1 << 15) -#define PLAYER_STATE2_16 (1 << 16) +#define PLAYER_STATE2_DO_ACTION_ENTER (1 << 16) // Turns on the "Enter On A" DoAction #define PLAYER_STATE2_17 (1 << 17) -#define PLAYER_STATE2_18 (1 << 18) +#define PLAYER_STATE2_CRAWLING (1 << 18) // Crawling through a crawlspace #define PLAYER_STATE2_19 (1 << 19) #define PLAYER_STATE2_20 (1 << 20) #define PLAYER_STATE2_21 (1 << 21) @@ -448,24 +487,24 @@ typedef struct { #define PLAYER_STATE3_3 (1 << 3) #define PLAYER_STATE3_4 (1 << 4) #define PLAYER_STATE3_5 (1 << 5) -#define PLAYER_STATE3_6 (1 << 6) +#define PLAYER_STATE3_RESTORE_NAYRUS_LOVE (1 << 6) // Set by ocarina effects actors when destroyed to signal Nayru's Love may be restored (see `ACTOROVL_ALLOC_ABSOLUTE`) #define PLAYER_STATE3_7 (1 << 7) typedef void (*PlayerFunc674)(struct Player*, struct PlayState*); -typedef s32(*PlayerFunc82C)(struct Player*, struct PlayState*); +typedef s32 (*PlayerFunc82C)(struct Player*, struct PlayState*); typedef void (*PlayerFuncA74)(struct PlayState*, struct Player*); typedef struct Player { /* 0x0000 */ Actor actor; /* 0x014C */ s8 currentTunic; // current tunic from `PlayerTunic` - /* 0x014D */ s8 currentSwordItem; // current sword Item ID + /* 0x014D */ s8 currentSwordItemId; /* 0x014E */ s8 currentShield; // current shield from `PlayerShield` /* 0x014F */ s8 currentBoots; // current boots from `PlayerBoots` /* 0x0150 */ s8 heldItemButton; // Button index for the item currently used - /* 0x0151 */ s8 heldItemActionParam; // Action param for the item currently used + /* 0x0151 */ s8 heldItemAction; // Item action for the item currently used /* 0x0152 */ u8 heldItemId; // Item id for the item currently used /* 0x0153 */ s8 prevBoots; // previous boots from `PlayerBoots` - /* 0x0154 */ s8 itemActionParam; // the difference between this and heldItemActionParam is unclear + /* 0x0154 */ s8 itemAction; // the difference between this and heldItemAction is unclear /* 0x0155 */ char unk_155[0x003]; /* 0x0158 */ u8 modelGroup; /* 0x0159 */ u8 nextModelGroup; @@ -475,71 +514,71 @@ typedef struct Player { /* 0x015D */ u8 rightHandType; /* 0x015E */ u8 sheathType; /* 0x015F */ u8 currentMask; // current mask equipped from `PlayerMask` - /* 0x0160 */ Gfx** rightHandDLists; - /* 0x0164 */ Gfx** leftHandDLists; - /* 0x0168 */ Gfx** sheathDLists; - /* 0x016C */ Gfx** waistDLists; + /* 0x0160 */ Gfx** rightHandDLists; + /* 0x0164 */ Gfx** leftHandDLists; + /* 0x0168 */ Gfx** sheathDLists; + /* 0x016C */ Gfx** waistDLists; /* 0x0170 */ u8 giObjectLoading; /* 0x0174 */ DmaRequest giObjectDmaRequest; /* 0x0194 */ OSMesgQueue giObjectLoadQueue; /* 0x01AC */ OSMesg giObjectLoadMsg; - /* 0x01B0 */ void* giObjectSegment; // also used for title card textures + /* 0x01B0 */ void* giObjectSegment; // also used for title card textures /* 0x01B4 */ SkelAnime skelAnime; /* 0x01F8 */ Vec3s jointTable[PLAYER_LIMB_BUF_COUNT]; /* 0x0288 */ Vec3s morphTable[PLAYER_LIMB_BUF_COUNT]; /* 0x0318 */ Vec3s blendTable[PLAYER_LIMB_BUF_COUNT]; /* 0x03A8 */ s16 unk_3A8[2]; - /* 0x03AC */ Actor* heldActor; + /* 0x03AC */ Actor* heldActor; /* 0x03B0 */ Vec3f leftHandPos; /* 0x03BC */ Vec3s unk_3BC; - /* 0x03C4 */ Actor* unk_3C4; + /* 0x03C4 */ Actor* unk_3C4; /* 0x03C8 */ Vec3f unk_3C8; /* 0x03D4 */ char unk_3D4[0x058]; /* 0x042C */ s8 doorType; /* 0x042D */ s8 doorDirection; /* 0x042E */ s16 doorTimer; - /* 0x0430 */ Actor* doorActor; - /* 0x0434 */ s16 getItemId; + /* 0x0430 */ Actor* doorActor; + /* 0x0434 */ s16 getItemId; // Upstream TODO: Document why this is s16 while it's s8 upstream /* 0x0436 */ u16 getItemDirection; - /* 0x0438 */ Actor* interactRangeActor; + /* 0x0438 */ Actor* interactRangeActor; /* 0x043C */ s8 mountSide; /* 0x043D */ char unk_43D[0x003]; - /* 0x0440 */ Actor* rideActor; + /* 0x0440 */ Actor* rideActor; /* 0x0444 */ u8 csMode; /* 0x0445 */ u8 prevCsMode; /* 0x0446 */ u8 unk_446; /* 0x0447 */ u8 unk_447; - /* 0x0448 */ Actor* unk_448; + /* 0x0448 */ Actor* unk_448; /* 0x044C */ char unk_44C[0x004]; /* 0x0450 */ Vec3f unk_450; /* 0x045C */ Vec3f unk_45C; /* 0x0468 */ char unk_468[0x002]; - /* 0x046A */ s16 unk_46A; - /* 0x046C */ s16 unk_46C; + /* 0x046A */ s16 doorBgCamIndex; + /* 0x046C */ s16 subCamId; /* 0x046E */ char unk_46E[0x02A]; /* 0x0498 */ ColliderCylinder cylinder; - /* 0x04E4 */ ColliderQuad swordQuads[2]; + /* 0x04E4 */ ColliderQuad meleeWeaponQuads[2]; /* 0x05E4 */ ColliderQuad shieldQuad; - /* 0x0664 */ Actor* unk_664; + /* 0x0664 */ Actor* unk_664; /* 0x0668 */ char unk_668[0x004]; /* 0x066C */ s32 unk_66C; - /* 0x0670 */ s32 swordEffectIndex; + /* 0x0670 */ s32 meleeWeaponEffectIndex; /* 0x0674 */ PlayerFunc674 func_674; /* 0x0678 */ PlayerAgeProperties* ageProperties; /* 0x067C */ u32 stateFlags1; /* 0x0680 */ u32 stateFlags2; - /* 0x0684 */ Actor* unk_684; - /* 0x0688 */ Actor* boomerangActor; - /* 0x068C */ Actor* naviActor; + /* 0x0684 */ Actor* unk_684; + /* 0x0688 */ Actor* boomerangActor; + /* 0x068C */ Actor* naviActor; /* 0x0690 */ s16 naviTextId; /* 0x0692 */ u8 stateFlags3; /* 0x0693 */ s8 exchangeItemId; - /* 0x0694 */ Actor* targetActor; + /* 0x0694 */ Actor* targetActor; /* 0x0698 */ f32 targetActorDistance; /* 0x069C */ char unk_69C[0x004]; /* 0x06A0 */ f32 unk_6A0; /* 0x06A4 */ f32 unk_6A4; - /* 0x06A8 */ Actor* unk_6A8; + /* 0x06A8 */ Actor* unk_6A8; /* 0x06AC */ s8 unk_6AC; /* 0x06AD */ u8 unk_6AD; /* 0x06AE */ u16 unk_6AE; @@ -565,8 +604,8 @@ typedef struct Player { /* 0x083C */ s16 currentYaw; /* 0x083E */ s16 targetYaw; /* 0x0840 */ u16 unk_840; - /* 0x0842 */ s8 swordAnimation; - /* 0x0843 */ s8 swordState; + /* 0x0842 */ s8 meleeWeaponAnimation; + /* 0x0843 */ s8 swordState; // Upstream TODO: meleeWeaponState /* 0x0844 */ s8 unk_844; /* 0x0845 */ u8 unk_845; /* 0x0846 */ u8 unk_846; @@ -609,14 +648,14 @@ typedef struct Player { /* 0x08A2 */ s16 unk_8A2; /* 0x08A4 */ f32 unk_8A4; /* 0x08A8 */ f32 unk_8A8; - /* 0x08AC */ f32 windSpeed; - /* 0x08B0 */ s16 windDirection; - /* 0x08B4 */ WeaponInfo swordInfo[3]; - /* 0x0908 */ Vec3f bodyPartsPos[18]; + /* 0x08AC */ f32 windSpeed; // Pushing player, examples include water currents, floor conveyors, climbing sloped surfaces // Upstream TODO: pushedSpeed + /* 0x08B0 */ s16 windDirection; // Yaw direction of player being pushed // Upstream TODO: pushedYaw + /* 0x08B4 */ WeaponInfo meleeWeaponInfo[3]; + /* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX]; /* 0x09E0 */ MtxF mf_9E0; /* 0x0A20 */ MtxF shieldMf; /* 0x0A60 */ u8 isBurning; - /* 0x0A61 */ u8 flameTimers[18]; // one flame per body part + /* 0x0A61 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part /* 0x0A73 */ u8 unk_A73; /* 0x0A74 */ PlayerFuncA74 func_A74; /* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame) @@ -630,9 +669,15 @@ typedef struct Player { /* 0x0A86 */ s8 unk_A86; /* 0x0A87 */ u8 unk_A87; /* 0x0A88 */ Vec3f unk_A88; // previous body part 0 position - /* 0x0A95 */ PendingFlag pendingFlag; - /* 0x0AA1 */ u8 boomerangQuickRecall; // Has the player pressed the boomerang button while it's in the air still? - /* 0x0AA2 */ GetItemEntry getItemEntry; -} Player; // size = 0xAAA + // #region SOH [General] + // Upstream TODO: Rename these to be more obviously SoH specific + /* */ PendingFlag pendingFlag; + /* */ GetItemEntry getItemEntry; + // #endregion + // #region SOH [Enhancements] + // Upstream TODO: Rename this to make it more obvious it is apart of an enhancement + /* */ u8 boomerangQuickRecall; // Has the player pressed the boomerang button while it's in the air still? + // #endregion +} Player; // size = 0xA94 #endif diff --git a/soh/include/z64save.h b/soh/include/z64save.h index fddf9889a..52c7318a6 100644 --- a/soh/include/z64save.h +++ b/soh/include/z64save.h @@ -9,16 +9,42 @@ #include "soh/Enhancements/gameplaystats.h" #include "soh/Enhancements/randomizer/randomizer_entrance.h" +typedef enum { + /* 0x0 */ MAGIC_STATE_IDLE, // Regular gameplay + /* 0x1 */ MAGIC_STATE_CONSUME_SETUP, // Sets the speed at which magic border flashes + /* 0x2 */ MAGIC_STATE_CONSUME, // Consume magic until target is reached or no more magic is available + /* 0x3 */ MAGIC_STATE_METER_FLASH_1, // Flashes border and freezes Dark Link + /* 0x4 */ MAGIC_STATE_METER_FLASH_2, // Flashes border and draws yellow magic to preview target consumption + /* 0x5 */ MAGIC_STATE_RESET, // Reset colors and return to idle + /* 0x6 */ MAGIC_STATE_METER_FLASH_3, // Flashes border with no additional behaviour + /* 0x7 */ MAGIC_STATE_CONSUME_LENS, // Magic slowly consumed by lens. + /* 0x8 */ MAGIC_STATE_STEP_CAPACITY, // Step `magicCapacity` to full capacity + /* 0x9 */ MAGIC_STATE_FILL, // Add magic until magicFillTarget is reached. + /* 0xA */ MAGIC_STATE_ADD // Add requested magic +} MagicState; + +typedef enum { + /* 0 */ MAGIC_CONSUME_NOW, // Consume Magic immediately without preview + /* 1 */ MAGIC_CONSUME_WAIT_NO_PREVIEW, // Sets consume target but waits to consume. No yellow magic preview to target consumption. Unused + /* 2 */ MAGIC_CONSUME_NOW_ALT, // Identical behaviour to MAGIC_CONSUME_NOW. Unused + /* 3 */ MAGIC_CONSUME_LENS, // Lens consumption + /* 4 */ MAGIC_CONSUME_WAIT_PREVIEW, // Sets consume target but waits to consume. Draws yellow magic to target consumption + /* 5 */ MAGIC_ADD // Sets a target to add magic +} MagicChangeType; + +#define MAGIC_NORMAL_METER 0x30 +#define MAGIC_DOUBLE_METER (2 * MAGIC_NORMAL_METER) + typedef struct { - /* 0x00 */ u8 buttonItems[8]; - /* 0x04 */ u8 cButtonSlots[7]; - /* 0x08 */ u16 equipment; + /* 0x00 */ u8 buttonItems[8]; // SOH [Enhancements] Changed from 4 to 8 to support Dpad equips + /* 0x04 */ u8 cButtonSlots[7]; // SOH [Enhancements] Changed from 3 to 7 to support Dpad equips + /* 0x08 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each nibble is a piece `EquipValue*` } ItemEquips; // size = 0x0A typedef struct { /* 0x00 */ u8 items[24]; /* 0x18 */ s8 ammo[16]; - /* 0x28 */ u16 equipment; + /* 0x28 */ u16 equipment; // a mask where each nibble corresponds to a type of equipment `EquipmentType`, and each bit to an owned piece `EquipInv*` /* 0x2C */ u32 upgrades; /* 0x30 */ u32 questItems; /* 0x34 */ u8 dungeonItems[20]; @@ -49,11 +75,24 @@ typedef struct { } SavedSceneFlags; // size = 0x1C typedef struct { - /* 0x00 */ s16 scene; + /* 0x00 */ s16 scene; // Upstream TODO: sceneId /* 0x02 */ Vec3s pos; /* 0x08 */ s16 angle; } HorseData; // size = 0x0A +/** + * The respawn mode names refer to the perceived player movement when respawning + * "down": being on ground + * "return": coming from the ground + * "top": coming from the air + */ +typedef enum { + /* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */ + /* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */ + /* 0x02 */ RESPAWN_MODE_TOP, /* Farore's Wind */ + /* 0x03 */ RESPAWN_MODE_MAX +} RespawnMode; + typedef struct { /* 0x00 */ Vec3f pos; /* 0x0C */ s16 yaw; @@ -93,60 +132,71 @@ typedef struct { typedef struct { /* 0x0000 */ s32 entranceIndex; // start of `save` substruct, originally called "memory" - /* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child + /* 0x0004 */ s32 linkAge; // 0: Adult; 1: Child (see enum `LinkAge`) /* 0x0008 */ s32 cutsceneIndex; /* 0x000C */ u16 dayTime; // "zelda_time" /* 0x0010 */ s32 nightFlag; /* 0x0014 */ s32 totalDays; /* 0x0018 */ s32 bgsDayCount; // increments with totalDays, can be cleared with `Environment_ClearBgsDayCount` + /* 0x001C */ char newf[6]; // string "ZELDAZ". start of `info` substruct, originally called "information" /* 0x0022 */ u16 deaths; /* 0x0024 */ char playerName[8]; /* 0x002C */ s16 n64ddFlag; /* 0x002E */ s16 healthCapacity; // "max_life" /* 0x0030 */ s16 health; // "now_life" - /* 0x0032 */ s8 magicLevel; - /* 0x0033 */ s8 magic; + /* 0x0032 */ s8 magicLevel; // 0 for no magic/new load, 1 for magic, 2 for double magic + /* 0x0033 */ s8 magic; // current magic available for use /* 0x0034 */ s16 rupees; /* 0x0036 */ u16 swordHealth; /* 0x0038 */ u16 naviTimer; - /* 0x003A */ u8 magicAcquired; - /* 0x003C */ u8 doubleMagic; - /* 0x003D */ u8 doubleDefense; + /* 0x003A */ u8 isMagicAcquired; + /* 0x003B */ char unk_3B[0x01]; + /* 0x003C */ u8 isDoubleMagicAcquired; + /* 0x003D */ u8 isDoubleDefenseAcquired; /* 0x003E */ u8 bgsFlag; /* 0x003F */ u8 ocarinaGameRoundNum; /* 0x0040 */ ItemEquips childEquips; /* 0x004A */ ItemEquips adultEquips; - /* 0x0054 */ u32 unk_54; // this may be incorrect, currently used for alignement - /* 0x0066 */ s16 savedSceneNum; + /* 0x0054 */ u32 unk_54; // this may be incorrect, currently used for alignment + /* 0x0058 */ char unk_58[0x0E]; + /* 0x0066 */ s16 savedSceneNum; // Upstream TODO: sceneId /* 0x0068 */ ItemEquips equips; /* 0x0074 */ Inventory inventory; /* 0x00D4 */ SavedSceneFlags sceneFlags[124]; /* 0x0E64 */ FaroresWindData fw; + /* 0x0E8C */ char unk_E8C[0x10]; /* 0x0E9C */ s32 gsFlags[6]; + /* 0x0EB4 */ char unk_EB4[0x4]; /* 0x0EB8 */ s32 highScores[7]; /* 0x0ED4 */ u16 eventChkInf[14]; // "event_chk_inf" /* 0x0EF0 */ u16 itemGetInf[4]; // "item_get_inf" /* 0x0EF8 */ u16 infTable[30]; // "inf_table" + /* 0x0F34 */ char unk_F34[0x04]; /* 0x0F38 */ u32 worldMapAreaData; // "area_arrival" - /* 0x0F40 */ u8 scarecrowCustomSongSet; - /* 0x0F41 */ OcarinaNote scarecrowCustomSong[108]; + /* 0x0F3C */ char unk_F3C[0x4]; + /* 0x0F40 */ u8 scarecrowLongSongSet; + /* 0x0F41 */ OcarinaNote scarecrowLongSong[108]; // Upstream TODO: Audio + /* 0x12A1 */ char unk_12A1[0x24]; /* 0x12C5 */ u8 scarecrowSpawnSongSet; - /* 0x12C6 */ OcarinaNote scarecrowSpawnSong[16]; + /* 0x12C6 */ OcarinaNote scarecrowSpawnSong[16]; // Upstream TODO: Audio /* 0x1346 */ char unk_1346[0x02]; /* 0x1348 */ HorseData horseData; + /* 0x1352 */ u16 checksum; // "check_sum" /* 0x1354 */ s32 fileNum; // "file_no" /* 0x1358 */ char unk_1358[0x0004]; /* 0x135C */ s32 gameMode; - /* 0x1360 */ s32 sceneSetupIndex; + /* 0x1360 */ s32 sceneSetupIndex; // "counter" // Upstream TODO: sceneLayer /* 0x1364 */ s32 respawnFlag; // "restart_flag" - /* 0x1368 */ RespawnData respawn[3]; // "restart_data" + /* 0x1368 */ RespawnData respawn[RESPAWN_MODE_MAX]; // "restart_data" /* 0x13BC */ f32 entranceSpeed; /* 0x13C0 */ u16 entranceSound; - /* 0x13C3 */ u8 unk_13C3; + /* 0x13C2 */ char unk_13C2[0x0001]; + /* 0x13C3 */ u8 retainWeatherMode; /* 0x13C4 */ s16 dogParams; /* 0x13C6 */ u8 textTriggerFlags; /* 0x13C7 */ u8 showTitleCard; /* 0x13C8 */ s16 nayrusLoveTimer; + /* 0x13CA */ char unk_13CA[0x0002]; /* 0x13CC */ s16 rupeeAccumulator; /* 0x13CE */ s16 timer1State; /* 0x13D0 */ s16 timer1Value; @@ -154,64 +204,69 @@ typedef struct { /* 0x13D4 */ s16 timer2Value; /* 0x13D6 */ s16 timerX[2]; /* 0x13DA */ s16 timerY[2]; + /* 0x13DE */ char unk_13DE[0x0002]; /* 0x13E0 */ u8 seqId; /* 0x13E1 */ u8 natureAmbienceId; - /* 0x13E2 */ u8 buttonStatus[9]; + /* 0x13E2 */ u8 buttonStatus[9]; // SOH [Enhancements] Changed from 5 to 9 to support Dpad equips /* 0x13E7 */ u8 unk_13E7; // alpha related /* 0x13E8 */ u16 unk_13E8; // alpha type? /* 0x13EA */ u16 unk_13EA; // also alpha type? /* 0x13EC */ u16 unk_13EC; // alpha type counter? /* 0x13EE */ u16 unk_13EE; // previous alpha type? - /* 0x13F0 */ s16 unk_13F0; // magic related - /* 0x13F2 */ s16 unk_13F2; // magic related - /* 0x13F4 */ s16 unk_13F4; // magic related - /* 0x13F6 */ s16 unk_13F6; // magic related - /* 0x13F8 */ s16 unk_13F8; // magic related + /* 0x13F0 */ s16 magicState; // determines magic meter behavior on each frame + /* 0x13F2 */ s16 prevMagicState; // used to resume the previous state after adding or filling magic + /* 0x13F4 */ s16 magicCapacity; // maximum magic available + /* 0x13F6 */ s16 magicFillTarget; // target used to fill magic. Target can either be full capacity (Magic_Fill, magic upgrades), or the saved magic amount (loading a file, game over) + /* 0x13F8 */ s16 magicTarget; // target for magic to step to when adding or consuming magic /* 0x13FA */ u16 eventInf[4]; // "event_inf" /* 0x1402 */ u16 mapIndex; // intended for maps/minimaps but commonly used as the dungeon index /* 0x1404 */ u16 minigameState; /* 0x1406 */ u16 minigameScore; // "yabusame_total" + /* 0x1408 */ char unk_1408[0x0001]; /* 0x1409 */ u8 language; // NTSC 0: Japanese; 1: English | PAL 0: English; 1: German; 2: French /* 0x140A */ u8 audioSetting; + /* 0x140B */ char unk_140B[0x0001]; /* 0x140C */ u8 zTargetSetting; // 0: Switch; 1: Hold /* 0x140E */ u16 forcedSeqId; // immediately start playing the sequence if set - /* 0x1410 */ u8 unk_1410; // transition related + /* 0x1410 */ u8 cutsceneTransitionControl; // context dependent usage: can either trigger a delayed fade or control fill alpha + /* 0x1411 */ char unk_1411[0x0001]; /* 0x1412 */ u16 nextCutsceneIndex; /* 0x1414 */ u8 cutsceneTrigger; /* 0x1415 */ u8 chamberCutsceneNum; /* 0x1416 */ u16 nextDayTime; // "next_zelda_time" - /* 0x1418 */ u8 fadeDuration; - /* 0x1419 */ u8 unk_1419; // transition related + /* 0x1418 */ u8 transFadeDuration; + /* 0x1419 */ u8 transWipeSpeed; /* 0x141A */ u16 skyboxTime; /* 0x141C */ u8 dogIsLost; - /* 0x141D */ u8 nextTransition; + /* 0x141D */ u8 nextTransitionType; + /* 0x141E */ char unk_141E[0x0002]; /* 0x1420 */ s16 worldMapArea; /* 0x1422 */ s16 sunsSongState; // controls the effects of suns song /* 0x1424 */ s16 healthAccumulator; - uint32_t isMasterQuest; - RandoSetting randoSettings[300]; - ItemLocationRando itemLocations[RC_MAX]; - HintLocationRando hintLocations[50]; - EntranceOverride entranceOverrides[ENTRANCE_OVERRIDES_MAX_COUNT]; - char childAltarText[250]; - char adultAltarText[750]; - char ganonHintText[150]; - char ganonText[250]; - u8 seedIcons[5]; - u16 randomizerInf[9]; - u8 temporaryWeapon; - u16 adultTradeItems; - u8 pendingIceTrapCount; - u8 mqDungeonCount; - SohStats sohStats; + // #region SOH [General] + // Upstream TODO: Move these to their own struct or name to more obviously specific to SoH + /* */ uint32_t isMasterQuest; + /* */ u8 mqDungeonCount; + /* */ u8 pendingIceTrapCount; + /* */ SohStats sohStats; + /* */ u8 temporaryWeapon; + // #endregion + // #region SOH [Randomizer] + // Upstream TODO: Move these to their own struct or name to more obviously specific to Randomizer + /* */ RandoSetting randoSettings[300]; + /* */ ItemLocationRando itemLocations[RC_MAX]; + /* */ HintLocationRando hintLocations[50]; + /* */ EntranceOverride entranceOverrides[ENTRANCE_OVERRIDES_MAX_COUNT]; + /* */ char childAltarText[250]; + /* */ char adultAltarText[750]; + /* */ char ganonHintText[150]; + /* */ char ganonText[250]; + /* */ u8 seedIcons[5]; + /* */ u16 randomizerInf[9]; + /* */ u16 adultTradeItems; + // #endregion } SaveContext; // size = 0x1428 -typedef enum { - /* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */ - /* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */ - /* 0x02 */ RESPAWN_MODE_TOP /* Farore's Wind */ -} RespawnMode; - typedef enum { /* 0x00 */ BTN_ENABLED, /* 0xFF */ BTN_DISABLED = 0xFF @@ -243,4 +298,521 @@ typedef enum { /* 3 */ SUNSSONG_SPECIAL // time does not advance, but signals the song was played. used for freezing redeads } SunsSongState; +typedef enum { + /* 0 */ GAMEMODE_NORMAL, + /* 1 */ GAMEMODE_TITLE_SCREEN, + /* 2 */ GAMEMODE_FILE_SELECT, // Note: only instance type transitions swap to file select + /* 3 */ GAMEMODE_END_CREDITS +} GameMode; + +typedef enum { + /* 0 */ SCENE_LAYER_CHILD_DAY, + /* 1 */ SCENE_LAYER_CHILD_NIGHT, + /* 2 */ SCENE_LAYER_ADULT_DAY, + /* 3 */ SCENE_LAYER_ADULT_NIGHT, + /* 4 */ SCENE_LAYER_CUTSCENE_FIRST +} SceneLayer; + +#define IS_CUTSCENE_LAYER (gSaveContext.sceneLayer >= SCENE_LAYER_CUTSCENE_FIRST) + +typedef enum { + /* 0 */ LINK_AGE_ADULT, + /* 1 */ LINK_AGE_CHILD +} LinkAge; + + + +/* + * + * SaveContext flags + * + */ + + +/* + * SaveContext.eventChkInf + */ + +#define EVENTCHKINF_02 0x02 +#define EVENTCHKINF_03 0x03 +#define EVENTCHKINF_04 0x04 +#define EVENTCHKINF_05 0x05 +#define EVENTCHKINF_07 0x07 +#define EVENTCHKINF_09 0x09 +#define EVENTCHKINF_0A 0x0A +#define EVENTCHKINF_0B 0x0B +#define EVENTCHKINF_0C 0x0C +#define EVENTCHKINF_0F 0x0F +#define EVENTCHKINF_10 0x10 +#define EVENTCHKINF_11 0x11 +#define EVENTCHKINF_12 0x12 +#define EVENTCHKINF_TALON_WOKEN_IN_CASTLE 0x13 +#define EVENTCHKINF_TALON_RETURNED_FROM_CASTLE 0x14 +#define EVENTCHKINF_15 0x15 +#define EVENTCHKINF_16 0x16 +#define EVENTCHKINF_EPONA_OBTAINED 0x18 +#define EVENTCHKINF_1B 0x1B +#define EVENTCHKINF_1C 0x1C +#define EVENTCHKINF_1D 0x1D +#define EVENTCHKINF_1E 0x1E +#define EVENTCHKINF_20 0x20 +#define EVENTCHKINF_21 0x21 +#define EVENTCHKINF_22 0x22 +#define EVENTCHKINF_23 0x23 +#define EVENTCHKINF_25 0x25 +#define EVENTCHKINF_2A 0x2A +#define EVENTCHKINF_2B 0x2B +#define EVENTCHKINF_2C 0x2C +#define EVENTCHKINF_2D 0x2D +#define EVENTCHKINF_2F 0x2F +#define EVENTCHKINF_30 0x30 +#define EVENTCHKINF_31 0x31 +#define EVENTCHKINF_32 0x32 +#define EVENTCHKINF_33 0x33 +#define EVENTCHKINF_37 0x37 +#define EVENTCHKINF_38 0x38 +#define EVENTCHKINF_39 0x39 +#define EVENTCHKINF_3A 0x3A +#define EVENTCHKINF_3B 0x3B +#define EVENTCHKINF_3C 0x3C + +// 0x40 +#define EVENTCHKINF_40_INDEX 4 +#define EVENTCHKINF_40_SHIFT 0 +#define EVENTCHKINF_40_MASK (1 << EVENTCHKINF_40_SHIFT) +#define EVENTCHKINF_40 ((EVENTCHKINF_40_INDEX << 4) | EVENTCHKINF_40_SHIFT) + +#define EVENTCHKINF_41 0x41 +#define EVENTCHKINF_42 0x42 +#define EVENTCHKINF_43 0x43 +#define EVENTCHKINF_45 0x45 +#define EVENTCHKINF_48 0x48 +#define EVENTCHKINF_49 0x49 +#define EVENTCHKINF_4A 0x4A +#define EVENTCHKINF_4B 0x4B +#define EVENTCHKINF_4C 0x4C +#define EVENTCHKINF_4D 0x4D +#define EVENTCHKINF_4E 0x4E +#define EVENTCHKINF_4F 0x4F +#define EVENTCHKINF_50 0x50 +#define EVENTCHKINF_51 0x51 +#define EVENTCHKINF_52 0x52 +#define EVENTCHKINF_54 0x54 +#define EVENTCHKINF_55 0x55 +#define EVENTCHKINF_59 0x59 +#define EVENTCHKINF_5A 0x5A +#define EVENTCHKINF_5B 0x5B +#define EVENTCHKINF_5C 0x5C +#define EVENTCHKINF_65 0x65 +#define EVENTCHKINF_67 0x67 +#define EVENTCHKINF_68 0x68 +#define EVENTCHKINF_69 0x69 +#define EVENTCHKINF_TALON_WOKEN_IN_KAKARIKO 0x6A + +// 0x6B +#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX 6 +#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT 11 +#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK (1 << EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT) +#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO ((EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX << 4) | EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_SHIFT) + +#define EVENTCHKINF_6E 0x6E +#define EVENTCHKINF_6F 0x6F +#define EVENTCHKINF_70 0x70 +#define EVENTCHKINF_71 0x71 +#define EVENTCHKINF_72 0x72 +#define EVENTCHKINF_73 0x73 +#define EVENTCHKINF_74 0x74 +#define EVENTCHKINF_75 0x75 +#define EVENTCHKINF_76 0x76 +#define EVENTCHKINF_77 0x77 +#define EVENTCHKINF_78 0x78 +#define EVENTCHKINF_80 0x80 +#define EVENTCHKINF_82 0x82 +#define EVENTCHKINF_8C 0x8C +#define EVENTCHKINF_8D 0x8D +#define EVENTCHKINF_8E 0x8E +#define EVENTCHKINF_8F 0x8F + +// 0x90-0x93 +// carpenters freed from the gerudo +#define EVENTCHKINF_CARPENTERS_FREE_INDEX 9 +#define EVENTCHKINF_CARPENTERS_FREE_SHIFT(n) (0 + (n)) +#define EVENTCHKINF_CARPENTERS_FREE_MASK(n) (1 << EVENTCHKINF_CARPENTERS_FREE_SHIFT(n)) +#define EVENTCHKINF_CARPENTERS_FREE(n) ((EVENTCHKINF_CARPENTERS_FREE_INDEX << 4) | EVENTCHKINF_CARPENTERS_FREE_SHIFT(n)) +#define EVENTCHKINF_CARPENTERS_FREE_MASK_ALL (\ + EVENTCHKINF_CARPENTERS_FREE_MASK(0) \ + | EVENTCHKINF_CARPENTERS_FREE_MASK(1) \ + | EVENTCHKINF_CARPENTERS_FREE_MASK(2) \ + | EVENTCHKINF_CARPENTERS_FREE_MASK(3) ) +#define GET_EVENTCHKINF_CARPENTERS_FREE_ALL() \ + CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL) + +#define EVENTCHKINF_94 0x94 +#define EVENTCHKINF_95 0x95 +#define EVENTCHKINF_96 0x96 +#define EVENTCHKINF_9C 0x9C +#define EVENTCHKINF_A0 0xA0 +#define EVENTCHKINF_A1 0xA1 +#define EVENTCHKINF_A3 0xA3 +#define EVENTCHKINF_A4 0xA4 +#define EVENTCHKINF_A5 0xA5 +#define EVENTCHKINF_A6 0xA6 +#define EVENTCHKINF_A7 0xA7 +#define EVENTCHKINF_A8 0xA8 +#define EVENTCHKINF_A9 0xA9 +#define EVENTCHKINF_AA 0xAA +#define EVENTCHKINF_AC 0xAC +#define EVENTCHKINF_AD 0xAD +#define EVENTCHKINF_B0 0xB0 +#define EVENTCHKINF_B1 0xB1 +#define EVENTCHKINF_B2 0xB2 +#define EVENTCHKINF_B3 0xB3 +#define EVENTCHKINF_B4 0xB4 +#define EVENTCHKINF_B5 0xB5 +#define EVENTCHKINF_B6 0xB6 +#define EVENTCHKINF_B7 0xB7 +#define EVENTCHKINF_B8 0xB8 +#define EVENTCHKINF_B9 0xB9 +#define EVENTCHKINF_BA 0xBA +#define EVENTCHKINF_BB 0xBB +#define EVENTCHKINF_BC 0xBC +#define EVENTCHKINF_BD 0xBD +#define EVENTCHKINF_BE 0xBE +#define EVENTCHKINF_BF 0xBF +#define EVENTCHKINF_C0 0xC0 +#define EVENTCHKINF_C1 0xC1 +#define EVENTCHKINF_C3 0xC3 +#define EVENTCHKINF_C4 0xC4 +#define EVENTCHKINF_C5 0xC5 +#define EVENTCHKINF_C6 0xC6 +#define EVENTCHKINF_C7 0xC7 +#define EVENTCHKINF_C8 0xC8 +#define EVENTCHKINF_C9 0xC9 + +// 0xD0-0xD6 +#define EVENTCHKINF_SONGS_FOR_FROGS_INDEX 13 +#define EVENTCHKINF_SONGS_FOR_FROGS_CHOIR_SHIFT 0 +#define EVENTCHKINF_SONGS_FOR_FROGS_ZL_SHIFT 1 +#define EVENTCHKINF_SONGS_FOR_FROGS_EPONA_SHIFT 2 +#define EVENTCHKINF_SONGS_FOR_FROGS_SUNS_SHIFT 3 +#define EVENTCHKINF_SONGS_FOR_FROGS_SARIA_SHIFT 4 +#define EVENTCHKINF_SONGS_FOR_FROGS_SOT_SHIFT 5 +#define EVENTCHKINF_SONGS_FOR_FROGS_STORMS_SHIFT 6 +#define EVENTCHKINF_SONGS_FOR_FROGS_CHOIR_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_CHOIR_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_ZL_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_ZL_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_EPONA_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_EPONA_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SUNS_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_SUNS_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SARIA_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_SARIA_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SOT_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_SOT_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_STORMS_MASK (1 << EVENTCHKINF_SONGS_FOR_FROGS_STORMS_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_CHOIR ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_CHOIR_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_ZL ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_ZL_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_EPONA ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_EPONA_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SUNS ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_SUNS_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SARIA ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_SARIA_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_SOT ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_SOT_SHIFT) +#define EVENTCHKINF_SONGS_FOR_FROGS_STORMS ((EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) | EVENTCHKINF_SONGS_FOR_FROGS_STORMS_SHIFT) + +// 0xDA-0xDE +#define EVENTCHKINF_DA_DB_DC_DD_DE_INDEX 13 +#define EVENTCHKINF_DA_MASK (1 << 10) +#define EVENTCHKINF_DB_MASK (1 << 11) +#define EVENTCHKINF_DC_MASK (1 << 12) +#define EVENTCHKINF_DD_MASK (1 << 13) +#define EVENTCHKINF_DE_MASK (1 << 14) + + +/* + * SaveContext.itemGetInf + */ + +#define ITEMGETINF_TALON_BOTTLE 0x02 +#define ITEMGETINF_03 0x03 +#define ITEMGETINF_04 0x04 +#define ITEMGETINF_05 0x05 +#define ITEMGETINF_06 0x06 +#define ITEMGETINF_07 0x07 +#define ITEMGETINF_08 0x08 +#define ITEMGETINF_09 0x09 +#define ITEMGETINF_0A 0x0A +#define ITEMGETINF_0B 0x0B +#define ITEMGETINF_0C 0x0C +#define ITEMGETINF_0D 0x0D +#define ITEMGETINF_0E 0x0E +#define ITEMGETINF_0F 0x0F +#define ITEMGETINF_10 0x10 +#define ITEMGETINF_11 0x11 +#define ITEMGETINF_12 0x12 +#define ITEMGETINF_13 0x13 +#define ITEMGETINF_15 0x15 +#define ITEMGETINF_16 0x16 +#define ITEMGETINF_17 0x17 + +// 0x18-0x1A +#define ITEMGETINF_18_19_1A_INDEX 1 +#define ITEMGETINF_18_SHIFT 8 +#define ITEMGETINF_19_SHIFT 9 +#define ITEMGETINF_1A_SHIFT 10 +#define ITEMGETINF_18_MASK (1 << ITEMGETINF_18_SHIFT) +#define ITEMGETINF_19_MASK (1 << ITEMGETINF_19_SHIFT) +#define ITEMGETINF_1A_MASK (1 << ITEMGETINF_1A_SHIFT) +#define ITEMGETINF_18 ((ITEMGETINF_18_19_1A_INDEX << 4) | ITEMGETINF_18_SHIFT) +#define ITEMGETINF_19 ((ITEMGETINF_18_19_1A_INDEX << 4) | ITEMGETINF_19_SHIFT) +#define ITEMGETINF_1A ((ITEMGETINF_18_19_1A_INDEX << 4) | ITEMGETINF_1A_SHIFT) + +#define ITEMGETINF_1B 0x1B +#define ITEMGETINF_1C 0x1C +#define ITEMGETINF_1D 0x1D +#define ITEMGETINF_1E 0x1E +#define ITEMGETINF_1F 0x1F +#define ITEMGETINF_23 0x23 +#define ITEMGETINF_24 0x24 +#define ITEMGETINF_25 0x25 +#define ITEMGETINF_26 0x26 +#define ITEMGETINF_2A 0x2A +#define ITEMGETINF_2C 0x2C +#define ITEMGETINF_2E 0x2E +#define ITEMGETINF_30 0x30 +#define ITEMGETINF_31 0x31 +#define ITEMGETINF_38 0x38 +#define ITEMGETINF_39 0x39 +#define ITEMGETINF_3A 0x3A +#define ITEMGETINF_3B 0x3B +#define ITEMGETINF_3F 0x3F + + +/* + * SaveContext.infTable + */ + +#define INFTABLE_00 0x00 +#define INFTABLE_01 0x01 +#define INFTABLE_03 0x03 +#define INFTABLE_05 0x05 +#define INFTABLE_0C 0x0C +#define INFTABLE_0E 0x0E +#define INFTABLE_10 0x10 +#define INFTABLE_15 0x15 +#define INFTABLE_17 0x17 +#define INFTABLE_19 0x19 +#define INFTABLE_1E 0x1E +#define INFTABLE_22 0x22 +#define INFTABLE_24 0x24 +#define INFTABLE_26 0x26 +#define INFTABLE_28 0x28 +#define INFTABLE_2A 0x2A +#define INFTABLE_2B 0x2B +#define INFTABLE_2E 0x2E +#define INFTABLE_2F 0x2F +#define INFTABLE_30 0x30 +#define INFTABLE_41 0x41 +#define INFTABLE_47 0x47 +#define INFTABLE_51 0x51 +#define INFTABLE_59 0x59 +#define INFTABLE_61 0x61 +#define INFTABLE_66 0x66 +#define INFTABLE_6A 0x6A +#define INFTABLE_6C 0x6C +#define INFTABLE_71 0x71 +#define INFTABLE_76 0x76 +#define INFTABLE_77 0x77 +#define INFTABLE_TALKED_TO_TALON_IN_RANCH_HOUSE 0x7E +#define INFTABLE_84 0x84 +#define INFTABLE_85 0x85 +#define INFTABLE_8B 0x8B +#define INFTABLE_8C 0x8C +#define INFTABLE_8D 0x8D +#define INFTABLE_8E 0x8E +#define INFTABLE_94 0x94 +#define INFTABLE_97 0x97 +#define INFTABLE_9A 0x9A +#define INFTABLE_A2 0xA2 +#define INFTABLE_AB 0xAB +#define INFTABLE_B0 0xB0 +#define INFTABLE_B1 0xB1 +#define INFTABLE_B4 0xB4 +#define INFTABLE_B6 0xB6 +#define INFTABLE_B7 0xB7 +#define INFTABLE_B8 0xB8 +#define INFTABLE_B9 0xB9 +#define INFTABLE_BC 0xBC +#define INFTABLE_C0 0xC0 +#define INFTABLE_C1 0xC1 +#define INFTABLE_C2 0xC2 +#define INFTABLE_C3 0xC3 +#define INFTABLE_C4 0xC4 +#define INFTABLE_C5 0xC5 +#define INFTABLE_C6 0xC6 +#define INFTABLE_C7 0xC7 +#define INFTABLE_C8 0xC8 +#define INFTABLE_C9 0xC9 +#define INFTABLE_CA 0xCA +#define INFTABLE_CB 0xCB +#define INFTABLE_CC 0xCC +#define INFTABLE_CD 0xCD +#define INFTABLE_CE 0xCE +#define INFTABLE_D0 0xD0 +#define INFTABLE_D2 0xD2 +#define INFTABLE_D4 0xD4 +#define INFTABLE_D6 0xD6 +#define INFTABLE_D8 0xD8 +#define INFTABLE_D9 0xD9 +#define INFTABLE_E0 0xE0 +#define INFTABLE_E3 0xE3 +#define INFTABLE_E6 0xE6 +#define INFTABLE_EB 0xEB +#define INFTABLE_F0 0xF0 +#define INFTABLE_F4 0xF4 +#define INFTABLE_F8 0xF8 +#define INFTABLE_FC 0xFC +#define INFTABLE_109 0x109 +#define INFTABLE_10A 0x10A +#define INFTABLE_10B 0x10B +#define INFTABLE_10C 0x10C +#define INFTABLE_10D 0x10D +#define INFTABLE_10E 0x10E +#define INFTABLE_10F 0x10F +#define INFTABLE_113 0x113 +#define INFTABLE_11A 0x11A +#define INFTABLE_11E 0x11E +#define INFTABLE_124 0x124 +#define INFTABLE_129 0x129 +#define INFTABLE_12A 0x12A +#define INFTABLE_138 0x138 +#define INFTABLE_139 0x139 +#define INFTABLE_140 0x140 +#define INFTABLE_141 0x141 +#define INFTABLE_142 0x142 +#define INFTABLE_143 0x143 +#define INFTABLE_144 0x144 +#define INFTABLE_145 0x145 +#define INFTABLE_146 0x146 +#define INFTABLE_147 0x147 +#define INFTABLE_160 0x160 +#define INFTABLE_161 0x161 +#define INFTABLE_162 0x162 +#define INFTABLE_163 0x163 +#define INFTABLE_164 0x164 +#define INFTABLE_166 0x166 +#define INFTABLE_16A 0x16A +#define INFTABLE_16C 0x16C +#define INFTABLE_170 0x170 +#define INFTABLE_171 0x171 +#define INFTABLE_172 0x172 +#define INFTABLE_176 0x176 +#define INFTABLE_178 0x178 +#define INFTABLE_17C 0x17C +#define INFTABLE_17F 0x17F +#define INFTABLE_190 0x190 +#define INFTABLE_191 0x191 +#define INFTABLE_192 0x192 +#define INFTABLE_193 0x193 +#define INFTABLE_195 0x195 +#define INFTABLE_196 0x196 +#define INFTABLE_197 0x197 +#define INFTABLE_198 0x198 + +// 0x199-0x19F +#define INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX 25 +#define INFTABLE_199_MASK (1 << 9) +#define INFTABLE_19A_MASK (1 << 10) +#define INFTABLE_19B_MASK (1 << 11) +#define INFTABLE_19C_MASK (1 << 12) +#define INFTABLE_19D_MASK (1 << 13) +#define INFTABLE_19E_MASK (1 << 14) +#define INFTABLE_19F_MASK (1 << 15) + +// 0x1A0-0x1AF +#define INFTABLE_1AX_INDEX 26 +#define INFTABLE_1A0_SHIFT 0 +#define INFTABLE_1A1_SHIFT 1 +#define INFTABLE_1A2_SHIFT 2 +#define INFTABLE_1A3_SHIFT 3 +#define INFTABLE_1A4_SHIFT 4 +#define INFTABLE_1A5_SHIFT 5 +#define INFTABLE_1A6_SHIFT 6 +#define INFTABLE_1A7_SHIFT 7 +#define INFTABLE_1A8_SHIFT 8 +#define INFTABLE_1A9_SHIFT 9 +#define INFTABLE_1AB_SHIFT 11 +#define INFTABLE_1AD_SHIFT 13 + +// 0x1D0-0x1DF +#define INFTABLE_1DX_INDEX 29 + + +/* + * SaveContext.eventInf + */ + +// 0x00-0x0F +// horses related +#define EVENTINF_HORSES_INDEX 0 +#define EVENTINF_HORSES_STATE_SHIFT 0 +#define EVENTINF_HORSES_HORSETYPE_SHIFT 4 +#define EVENTINF_HORSES_05_SHIFT 5 +#define EVENTINF_HORSES_06_SHIFT 6 +#define EVENTINF_HORSES_08_SHIFT 8 +#define EVENTINF_HORSES_0A_SHIFT 10 +#define EVENTINF_HORSES_0F_SHIFT 15 // unused? +#define EVENTINF_HORSES_STATE_MASK (0xF << EVENTINF_HORSES_STATE_SHIFT) +#define EVENTINF_HORSES_HORSETYPE_MASK (1 << EVENTINF_HORSES_HORSETYPE_SHIFT) +#define EVENTINF_HORSES_05_MASK (1 << EVENTINF_HORSES_05_SHIFT) +#define EVENTINF_HORSES_06_MASK (1 << EVENTINF_HORSES_06_SHIFT) +#define EVENTINF_HORSES_0F_MASK (1 << EVENTINF_HORSES_0F_SHIFT) +#define EVENTINF_HORSES_05 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_05_SHIFT) +#define EVENTINF_HORSES_06 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_06_SHIFT) +// Used in z_en_ta (Talon) to store Cucco game winning status +// and in z_en_ge1 (Gerudo) to store archery in-progress status +#define EVENTINF_HORSES_08 ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_08_SHIFT) +#define EVENTINF_CUCCO_GAME_WON EVENTINF_HORSES_08 +// Used in z_en_ta (Talon) and z_en_ma3 (Malon) to store minigame finishing status +#define EVENTINF_HORSES_0A ((EVENTINF_HORSES_INDEX << 4) | EVENTINF_HORSES_0A_SHIFT) +#define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A + +typedef enum { + /* 0 */ EVENTINF_HORSES_STATE_0, + /* 1 */ EVENTINF_HORSES_STATE_1, + /* 2 */ EVENTINF_HORSES_STATE_2, + /* 3 */ EVENTINF_HORSES_STATE_3, + /* 4 */ EVENTINF_HORSES_STATE_4, + /* 5 */ EVENTINF_HORSES_STATE_5, + /* 6 */ EVENTINF_HORSES_STATE_6, + /* 7 */ EVENTINF_HORSES_STATE_7 +} EventInfHorsesState; + +// "InRaceSeq" +#define GET_EVENTINF_HORSES_STATE() \ + ((gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & EVENTINF_HORSES_STATE_MASK) >> EVENTINF_HORSES_STATE_SHIFT) +#define SET_EVENTINF_HORSES_STATE(v) \ + gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ + (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_STATE_MASK) | \ + ((v) << EVENTINF_HORSES_STATE_SHIFT) + +#define GET_EVENTINF_HORSES_HORSETYPE() \ + ((gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & EVENTINF_HORSES_HORSETYPE_MASK) >> EVENTINF_HORSES_HORSETYPE_SHIFT) +#define SET_EVENTINF_HORSES_HORSETYPE(v) \ + gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ + (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_HORSETYPE_MASK) | \ + ((v) << EVENTINF_HORSES_HORSETYPE_SHIFT) + +#define SET_EVENTINF_HORSES_0F(v) \ + gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ + (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_HORSES_0F_MASK) | ((v) << EVENTINF_HORSES_0F_SHIFT) + + +#define EVENTINF_10 0x10 + +// 0x20-0x24 +#define EVENTINF_20_21_22_23_24_INDEX 2 +#define EVENTINF_20_MASK (1 << 0) +#define EVENTINF_21_MASK (1 << 1) +#define EVENTINF_22_MASK (1 << 2) +#define EVENTINF_23_MASK (1 << 3) +#define EVENTINF_24_MASK (1 << 4) + +#define EVENTINF_30 0x30 + + + #endif diff --git a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp index f00b25b1d..7356390d9 100644 --- a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp +++ b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp @@ -347,18 +347,18 @@ CrowdControl::EffectResult CrowdControl::ExecuteEffect(std::string effectId, uin if (dryRun == 0) CMD_EXECUTE(EFFECT_REMOVE_HEART_CONTAINER); return EffectResult::Success; } else if (effectId == EFFECT_FILL_MAGIC) { - if (!gSaveContext.magicAcquired) { + if (!gSaveContext.isMagicAcquired) { return EffectResult::Failure; } - if (gSaveContext.magic >= (gSaveContext.doubleMagic + 1) + 0x30) { + if (gSaveContext.magic >= (gSaveContext.isDoubleMagicAcquired + 1) + 0x30) { return EffectResult::Failure; } if (dryRun == 0) CMD_EXECUTE(EFFECT_FILL_MAGIC); return EffectResult::Success; } else if (effectId == EFFECT_EMPTY_MAGIC) { - if (!gSaveContext.magicAcquired || gSaveContext.magic <= 0) { + if (!gSaveContext.isMagicAcquired || gSaveContext.magic <= 0) { return EffectResult::Failure; } diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index c31e88d4c..cb642f916 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -355,7 +355,7 @@ static bool EntranceHandler(std::shared_ptr Console, const std::v gPlayState->nextEntranceIndex = entrance; gPlayState->sceneLoadFlag = 0x14; gPlayState->fadeTransition = 11; - gSaveContext.nextTransition = 11; + gSaveContext.nextTransitionType = 11; } static bool VoidHandler(std::shared_ptr Console, const std::vector& args) { @@ -366,7 +366,7 @@ static bool VoidHandler(std::shared_ptr Console, const std::vecto gPlayState->sceneLoadFlag = 0x14; gPlayState->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex; gPlayState->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; } else { SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; @@ -379,7 +379,7 @@ static bool ReloadHandler(std::shared_ptr Console, const std::vec gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; gPlayState->sceneLoadFlag = 0x14; gPlayState->fadeTransition = 11; - gSaveContext.nextTransition = 11; + gSaveContext.nextTransitionType = 11; } else { SohImGui::GetConsole()->SendErrorMessage("gPlayState == nullptr"); return CMD_FAILED; diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp index dbdcd6059..94b696321 100644 --- a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -341,11 +341,11 @@ void DrawInfoTab() { ImGui::SliderScalar("Health", ImGuiDataType_S16, &gSaveContext.health, &healthMin, &healthMax); UIWidgets::InsertHelpHoverText("Current health. 16 units per full heart"); - bool doubleDefense = gSaveContext.doubleDefense != 0; - if (ImGui::Checkbox("Double Defense", &doubleDefense)) { - gSaveContext.doubleDefense = doubleDefense; + bool isDoubleDefenseAcquired = gSaveContext.isDoubleDefenseAcquired != 0; + if (ImGui::Checkbox("Double Defense", &isDoubleDefenseAcquired)) { + gSaveContext.isDoubleDefenseAcquired = isDoubleDefenseAcquired; gSaveContext.inventory.defenseHearts = - gSaveContext.doubleDefense ? 20 : 0; // Set to get the border drawn in the UI + gSaveContext.isDoubleDefenseAcquired ? 20 : 0; // Set to get the border drawn in the UI } UIWidgets::InsertHelpHoverText("Is double defense unlocked?"); @@ -361,30 +361,30 @@ void DrawInfoTab() { if (ImGui::BeginCombo("Magic Level", magicName.c_str())) { if (ImGui::Selectable("Double")) { gSaveContext.magicLevel = 2; - gSaveContext.magicAcquired = true; - gSaveContext.doubleMagic = true; + gSaveContext.isMagicAcquired = true; + gSaveContext.isDoubleMagicAcquired = true; } if (ImGui::Selectable("Single")) { gSaveContext.magicLevel = 1; - gSaveContext.magicAcquired = true; - gSaveContext.doubleMagic = false; + gSaveContext.isMagicAcquired = true; + gSaveContext.isDoubleMagicAcquired = false; } if (ImGui::Selectable("None")) { gSaveContext.magicLevel = 0; - gSaveContext.magicAcquired = false; - gSaveContext.doubleMagic = false; + gSaveContext.isMagicAcquired = false; + gSaveContext.isDoubleMagicAcquired = false; } ImGui::EndCombo(); } UIWidgets::InsertHelpHoverText("Current magic level"); - gSaveContext.unk_13F4 = gSaveContext.magicLevel * 0x30; // Set to get the bar drawn in the UI - if (gSaveContext.magic > gSaveContext.unk_13F4) { - gSaveContext.magic = gSaveContext.unk_13F4; // Clamp magic to new max + gSaveContext.magicCapacity = gSaveContext.magicLevel * 0x30; // Set to get the bar drawn in the UI + if (gSaveContext.magic > gSaveContext.magicCapacity) { + gSaveContext.magic = gSaveContext.magicCapacity; // Clamp magic to new max } const uint8_t magicMin = 0; - const uint8_t magicMax = gSaveContext.unk_13F4; + const uint8_t magicMax = gSaveContext.magicCapacity; ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); ImGui::SliderScalar("Magic", ImGuiDataType_S8, &gSaveContext.magic, &magicMin, &magicMax); UIWidgets::InsertHelpHoverText("Current magic. 48 units per magic level"); @@ -1392,7 +1392,7 @@ void DrawPlayerTab() { const char* curTunic; const char* curBoots; - switch (player->currentSwordItem) { + switch (player->currentSwordItemId) { case ITEM_SWORD_KOKIRI: curSword = "Kokiri Sword"; break; @@ -1521,17 +1521,17 @@ void DrawPlayerTab() { ImGui::PushItemWidth(ImGui::GetFontSize() * 15); if (ImGui::BeginCombo("Sword", curSword)) { if (ImGui::Selectable("None")) { - player->currentSwordItem = ITEM_NONE; + player->currentSwordItemId = ITEM_NONE; gSaveContext.equips.buttonItems[0] = ITEM_NONE; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE); } if (ImGui::Selectable("Kokiri Sword")) { - player->currentSwordItem = ITEM_SWORD_KOKIRI; + player->currentSwordItemId = ITEM_SWORD_KOKIRI; gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI); } if (ImGui::Selectable("Master Sword")) { - player->currentSwordItem = ITEM_SWORD_MASTER; + player->currentSwordItemId = ITEM_SWORD_MASTER; gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_MASTER); } @@ -1540,20 +1540,20 @@ void DrawPlayerTab() { if (gSaveContext.swordHealth < 8) { gSaveContext.swordHealth = 8; } - player->currentSwordItem = ITEM_SWORD_BGS; + player->currentSwordItemId = ITEM_SWORD_BGS; gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; } else { if (gSaveContext.swordHealth < 8) { gSaveContext.swordHealth = 8; } - player->currentSwordItem = ITEM_SWORD_BGS; + player->currentSwordItemId = ITEM_SWORD_BGS; gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; } Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_BGS); } if (ImGui::Selectable("Fishing Pole")) { - player->currentSwordItem = ITEM_FISHING_POLE; + player->currentSwordItemId = ITEM_FISHING_POLE; gSaveContext.equips.buttonItems[0] = ITEM_FISHING_POLE; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_MASTER); } diff --git a/soh/soh/Enhancements/randomizer/randomizer.cpp b/soh/soh/Enhancements/randomizer/randomizer.cpp index a67b65934..72055d921 100644 --- a/soh/soh/Enhancements/randomizer/randomizer.cpp +++ b/soh/soh/Enhancements/randomizer/randomizer.cpp @@ -1465,7 +1465,7 @@ ItemObtainability Randomizer::GetItemObtainabilityFromRandomizerGet(RandomizerGe case RG_GERUDO_MEMBERSHIP_CARD: return !CHECK_QUEST_ITEM(QUEST_GERUDO_CARD) ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; case RG_DOUBLE_DEFENSE: - return !gSaveContext.doubleDefense ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; + return !gSaveContext.isDoubleDefenseAcquired ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; case RG_GOLD_SKULLTULA_TOKEN: return gSaveContext.inventory.gsTokens < 100 ? CAN_OBTAIN : CANT_OBTAIN_ALREADY_HAVE; case RG_PROGRESSIVE_STRENGTH: diff --git a/soh/soh/Enhancements/randomizer/randomizer_grotto.c b/soh/soh/Enhancements/randomizer/randomizer_grotto.c index f45384211..4326f646b 100644 --- a/soh/soh/Enhancements/randomizer/randomizer_grotto.c +++ b/soh/soh/Enhancements/randomizer/randomizer_grotto.c @@ -163,7 +163,7 @@ s16 Grotto_OverrideSpecialEntrance(s16 nextEntranceIndex) { gSaveContext.respawnFlag = 2; nextEntranceIndex = grotto.entranceIndex; gPlayState->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; // Otherwise return 0x7FFF and let the game handle it } else { nextEntranceIndex = 0x7FFF; diff --git a/soh/soh/SaveManager.cpp b/soh/soh/SaveManager.cpp index 70a14824d..9d04d3b09 100644 --- a/soh/soh/SaveManager.cpp +++ b/soh/soh/SaveManager.cpp @@ -385,9 +385,9 @@ void SaveManager::InitFileNormal() { gSaveContext.rupees = 0; gSaveContext.swordHealth = 0; gSaveContext.naviTimer = 0; - gSaveContext.magicAcquired = 0; - gSaveContext.doubleMagic = 0; - gSaveContext.doubleDefense = 0; + gSaveContext.isMagicAcquired = 0; + gSaveContext.isDoubleMagicAcquired = 0; + gSaveContext.isDoubleDefenseAcquired = 0; gSaveContext.bgsFlag = 0; gSaveContext.ocarinaGameRoundNum = 0; for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); button++) { @@ -483,15 +483,15 @@ void SaveManager::InitFileNormal() { gSaveContext.infTable[flag] = 0; } gSaveContext.worldMapAreaData = 0; - gSaveContext.scarecrowCustomSongSet = 0; - for (int i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++) { - gSaveContext.scarecrowCustomSong[i].noteIdx = 0; - gSaveContext.scarecrowCustomSong[i].unk_01 = 0; - gSaveContext.scarecrowCustomSong[i].unk_02 = 0; - gSaveContext.scarecrowCustomSong[i].volume = 0; - gSaveContext.scarecrowCustomSong[i].vibrato = 0; - gSaveContext.scarecrowCustomSong[i].tone = 0; - gSaveContext.scarecrowCustomSong[i].semitone = 0; + gSaveContext.scarecrowLongSongSet = 0; + for (int i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++) { + gSaveContext.scarecrowLongSong[i].noteIdx = 0; + gSaveContext.scarecrowLongSong[i].unk_01 = 0; + gSaveContext.scarecrowLongSong[i].unk_02 = 0; + gSaveContext.scarecrowLongSong[i].volume = 0; + gSaveContext.scarecrowLongSong[i].vibrato = 0; + gSaveContext.scarecrowLongSong[i].tone = 0; + gSaveContext.scarecrowLongSong[i].semitone = 0; } gSaveContext.scarecrowSpawnSongSet = 0; for (int i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowSpawnSong); i++) { @@ -534,9 +534,9 @@ void SaveManager::InitFileDebug() { gSaveContext.rupees = 150; gSaveContext.swordHealth = 8; gSaveContext.naviTimer = 0; - gSaveContext.magicAcquired = 1; - gSaveContext.doubleMagic = 0; - gSaveContext.doubleDefense = 0; + gSaveContext.isMagicAcquired = 1; + gSaveContext.isDoubleMagicAcquired = 0; + gSaveContext.isDoubleDefenseAcquired = 0; gSaveContext.bgsFlag = 0; gSaveContext.ocarinaGameRoundNum = 0; for (int button = 0; button < ARRAY_COUNT(gSaveContext.childEquips.buttonItems); button++) { @@ -794,9 +794,9 @@ void SaveManager::LoadBaseVersion1() { SaveManager::Instance->LoadData("rupees", gSaveContext.rupees); SaveManager::Instance->LoadData("swordHealth", gSaveContext.swordHealth); SaveManager::Instance->LoadData("naviTimer", gSaveContext.naviTimer); - SaveManager::Instance->LoadData("magicAcquired", gSaveContext.magicAcquired); - SaveManager::Instance->LoadData("doubleMagic", gSaveContext.doubleMagic); - SaveManager::Instance->LoadData("doubleDefense", gSaveContext.doubleDefense); + SaveManager::Instance->LoadData("isMagicAcquired", gSaveContext.isMagicAcquired); + SaveManager::Instance->LoadData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired); + SaveManager::Instance->LoadData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired); SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag); SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum); SaveManager::Instance->LoadStruct("childEquips", []() { @@ -892,9 +892,9 @@ void SaveManager::LoadBaseVersion1() { SaveManager::Instance->LoadData("", gSaveContext.infTable[i]); }); SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData); - SaveManager::Instance->LoadData("scarecrowCustomSongSet", gSaveContext.scarecrowCustomSongSet); - SaveManager::Instance->LoadArray("scarecrowCustomSong", sizeof(gSaveContext.scarecrowCustomSong), [](size_t i) { - SaveManager::Instance->LoadData("", ((u8*)&gSaveContext.scarecrowCustomSong)[i]); + SaveManager::Instance->LoadData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet); + SaveManager::Instance->LoadArray("scarecrowLongSong", sizeof(gSaveContext.scarecrowLongSong), [](size_t i) { + SaveManager::Instance->LoadData("", ((u8*)&gSaveContext.scarecrowLongSong)[i]); }); SaveManager::Instance->LoadData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet); SaveManager::Instance->LoadArray("scarecrowSpawnSong", sizeof(gSaveContext.scarecrowSpawnSong), [](size_t i) { @@ -935,9 +935,9 @@ void SaveManager::LoadBaseVersion2() { SaveManager::Instance->LoadData("rupees", gSaveContext.rupees); SaveManager::Instance->LoadData("swordHealth", gSaveContext.swordHealth); SaveManager::Instance->LoadData("naviTimer", gSaveContext.naviTimer); - SaveManager::Instance->LoadData("magicAcquired", gSaveContext.magicAcquired); - SaveManager::Instance->LoadData("doubleMagic", gSaveContext.doubleMagic); - SaveManager::Instance->LoadData("doubleDefense", gSaveContext.doubleDefense); + SaveManager::Instance->LoadData("isMagicAcquired", gSaveContext.isMagicAcquired); + SaveManager::Instance->LoadData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired); + SaveManager::Instance->LoadData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired); SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag); SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum); SaveManager::Instance->LoadStruct("childEquips", []() { @@ -1048,16 +1048,16 @@ void SaveManager::LoadBaseVersion2() { SaveManager::Instance->LoadData("", gSaveContext.infTable[i]); }); SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData); - SaveManager::Instance->LoadData("scarecrowCustomSongSet", gSaveContext.scarecrowCustomSongSet); - SaveManager::Instance->LoadArray("scarecrowCustomSong", ARRAY_COUNT(gSaveContext.scarecrowCustomSong), [](size_t i) { + SaveManager::Instance->LoadData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet); + SaveManager::Instance->LoadArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) { SaveManager::Instance->LoadStruct("", [&i]() { - SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowCustomSong[i].noteIdx); - SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowCustomSong[i].unk_01); - SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowCustomSong[i].unk_02); - SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowCustomSong[i].volume); - SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowCustomSong[i].vibrato); - SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowCustomSong[i].tone); - SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowCustomSong[i].semitone); + SaveManager::Instance->LoadData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx); + SaveManager::Instance->LoadData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01); + SaveManager::Instance->LoadData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02); + SaveManager::Instance->LoadData("volume", gSaveContext.scarecrowLongSong[i].volume); + SaveManager::Instance->LoadData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato); + SaveManager::Instance->LoadData("tone", gSaveContext.scarecrowLongSong[i].tone); + SaveManager::Instance->LoadData("semitone", gSaveContext.scarecrowLongSong[i].semitone); }); }); SaveManager::Instance->LoadData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet); @@ -1108,9 +1108,9 @@ void SaveManager::SaveBase() { SaveManager::Instance->SaveData("rupees", gSaveContext.rupees); SaveManager::Instance->SaveData("swordHealth", gSaveContext.swordHealth); SaveManager::Instance->SaveData("naviTimer", gSaveContext.naviTimer); - SaveManager::Instance->SaveData("magicAcquired", gSaveContext.magicAcquired); - SaveManager::Instance->SaveData("doubleMagic", gSaveContext.doubleMagic); - SaveManager::Instance->SaveData("doubleDefense", gSaveContext.doubleDefense); + SaveManager::Instance->SaveData("isMagicAcquired", gSaveContext.isMagicAcquired); + SaveManager::Instance->SaveData("isDoubleMagicAcquired", gSaveContext.isDoubleMagicAcquired); + SaveManager::Instance->SaveData("isDoubleDefenseAcquired", gSaveContext.isDoubleDefenseAcquired); SaveManager::Instance->SaveData("bgsFlag", gSaveContext.bgsFlag); SaveManager::Instance->SaveData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum); SaveManager::Instance->SaveStruct("childEquips", []() { @@ -1217,16 +1217,16 @@ void SaveManager::SaveBase() { SaveManager::Instance->SaveData("", gSaveContext.infTable[i]); }); SaveManager::Instance->SaveData("worldMapAreaData", gSaveContext.worldMapAreaData); - SaveManager::Instance->SaveData("scarecrowCustomSongSet", gSaveContext.scarecrowCustomSongSet); - SaveManager::Instance->SaveArray("scarecrowCustomSong", ARRAY_COUNT(gSaveContext.scarecrowCustomSong), [](size_t i) { + SaveManager::Instance->SaveData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet); + SaveManager::Instance->SaveArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) { SaveManager::Instance->SaveStruct("", [&i]() { - SaveManager::Instance->SaveData("noteIdx", gSaveContext.scarecrowCustomSong[i].noteIdx); - SaveManager::Instance->SaveData("unk_01", gSaveContext.scarecrowCustomSong[i].unk_01); - SaveManager::Instance->SaveData("unk_02", gSaveContext.scarecrowCustomSong[i].unk_02); - SaveManager::Instance->SaveData("volume", gSaveContext.scarecrowCustomSong[i].volume); - SaveManager::Instance->SaveData("vibrato", gSaveContext.scarecrowCustomSong[i].vibrato); - SaveManager::Instance->SaveData("tone", gSaveContext.scarecrowCustomSong[i].tone); - SaveManager::Instance->SaveData("semitone", gSaveContext.scarecrowCustomSong[i].semitone); + SaveManager::Instance->SaveData("noteIdx", gSaveContext.scarecrowLongSong[i].noteIdx); + SaveManager::Instance->SaveData("unk_01", gSaveContext.scarecrowLongSong[i].unk_01); + SaveManager::Instance->SaveData("unk_02", gSaveContext.scarecrowLongSong[i].unk_02); + SaveManager::Instance->SaveData("volume", gSaveContext.scarecrowLongSong[i].volume); + SaveManager::Instance->SaveData("vibrato", gSaveContext.scarecrowLongSong[i].vibrato); + SaveManager::Instance->SaveData("tone", gSaveContext.scarecrowLongSong[i].tone); + SaveManager::Instance->SaveData("semitone", gSaveContext.scarecrowLongSong[i].semitone); }); }); SaveManager::Instance->SaveData("scarecrowSpawnSongSet", gSaveContext.scarecrowSpawnSongSet); @@ -1600,9 +1600,9 @@ void CopyV0Save(SaveContext_v0& src, SaveContext& dst) { dst.rupees = src.rupees; dst.swordHealth = src.swordHealth; dst.naviTimer = src.naviTimer; - dst.magicAcquired = src.magicAcquired; - dst.doubleMagic = src.doubleMagic; - dst.doubleDefense = src.doubleDefense; + dst.isMagicAcquired = src.magicAcquired; + dst.isDoubleMagicAcquired = src.doubleMagic; + dst.isDoubleDefenseAcquired = src.doubleDefense; dst.bgsFlag = src.bgsFlag; dst.ocarinaGameRoundNum = src.ocarinaGameRoundNum; for (size_t i = 0; i < ARRAY_COUNT(src.childEquips.buttonItems); i++) { @@ -1680,8 +1680,8 @@ void CopyV0Save(SaveContext_v0& src, SaveContext& dst) { dst.infTable[i] = src.infTable[i]; } dst.worldMapAreaData = src.worldMapAreaData; - dst.scarecrowCustomSongSet = src.scarecrowCustomSongSet; - memcpy(&dst.scarecrowCustomSong[0], &src.scarecrowCustomSong[0], sizeof(src.scarecrowCustomSong)); + dst.scarecrowLongSongSet = src.scarecrowCustomSongSet; + memcpy(&dst.scarecrowLongSong[0], &src.scarecrowCustomSong[0], sizeof(src.scarecrowCustomSong)); dst.scarecrowSpawnSongSet = src.scarecrowSpawnSongSet; memcpy(&dst.scarecrowSpawnSong[0], &src.scarecrowSpawnSong[0], sizeof(src.scarecrowSpawnSong)); dst.horseData.scene = src.horseData.scene; diff --git a/soh/src/code/game.c b/soh/src/code/game.c index 699f1b22d..2b824c1ab 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -381,8 +381,8 @@ void GameState_Update(GameState* gameState) { // Inf Magic if (CVar_GetS32("gInfiniteMagic", 0) != 0) { - if (gSaveContext.magicAcquired && gSaveContext.magic != (gSaveContext.doubleMagic + 1) * 0x30) { - gSaveContext.magic = (gSaveContext.doubleMagic + 1) * 0x30; + if (gSaveContext.isMagicAcquired && gSaveContext.magic != (gSaveContext.isDoubleMagicAcquired + 1) * 0x30) { + gSaveContext.magic = (gSaveContext.isDoubleMagicAcquired + 1) * 0x30; } } @@ -440,7 +440,7 @@ void GameState_Update(GameState* gameState) { gPlayState->nextEntranceIndex = gSaveContext.entranceIndex; gPlayState->sceneLoadFlag = 0x14; gPlayState->fadeTransition = 11; - gSaveContext.nextTransition = 11; + gSaveContext.nextTransitionType = 11; warped = true; if (gPlayState->linkAgeOnLoad == 1) { gPlayState->linkAgeOnLoad = 0; @@ -451,7 +451,7 @@ void GameState_Update(GameState* gameState) { } if (gPlayState) { - if (warped && gPlayState->sceneLoadFlag != 0x0014 && gSaveContext.nextTransition == 255) { + if (warped && gPlayState->sceneLoadFlag != 0x0014 && gSaveContext.nextTransitionType == 255) { GET_PLAYER(gPlayState)->actor.shape.rot.y = playerYaw; GET_PLAYER(gPlayState)->actor.world.pos = playerPos; warped = false; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 3d8ef6753..cc475f1c5 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -1423,7 +1423,7 @@ s32 func_8002DF38(PlayState* play, Actor* actor, u8 csMode) { player->csMode = csMode; player->unk_448 = actor; - player->unk_46A = 0; + player->doorBgCamIndex = 0; return true; } @@ -1432,7 +1432,7 @@ s32 func_8002DF54(PlayState* play, Actor* actor, u8 csMode) { Player* player = GET_PLAYER(play); func_8002DF38(play, actor, csMode); - player->unk_46A = 1; + player->doorBgCamIndex = 1; return true; } @@ -4529,7 +4529,7 @@ void func_800355B8(PlayState* play, Vec3f* pos) { u8 func_800355E4(PlayState* play, Collider* collider) { Player* player = GET_PLAYER(play); - if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) { + if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->meleeWeaponAnimation == 0x16)) { return true; } else { return false; diff --git a/soh/src/code/z_common_data.c b/soh/src/code/z_common_data.c index 53334fb84..aa0e3cca3 100644 --- a/soh/src/code/z_common_data.c +++ b/soh/src/code/z_common_data.c @@ -14,6 +14,6 @@ void SaveContext_Init(void) { gSaveContext.nextDayTime = 0xFFFF; gSaveContext.skyboxTime = 0; gSaveContext.dogIsLost = true; - gSaveContext.nextTransition = 0xFF; + gSaveContext.nextTransitionType = 0xFF; gSaveContext.unk_13EE = 50; } diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index 9eeb3bfa8..8aff4abd7 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -562,7 +562,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB csCtx->state = CS_STATE_UNSKIPPABLE_EXEC; Audio_SetCutsceneFlag(0); - gSaveContext.unk_1410 = 1; + gSaveContext.cutsceneTransitionControl = 1; osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); // "Future fork designation=No. [%d]" @@ -635,7 +635,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x02CA; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } break; case 9: @@ -665,7 +665,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x010E; play->sceneLoadFlag = 0x14; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 14: play->nextEntranceIndex = 0x0457; @@ -695,7 +695,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x0324; play->sceneLoadFlag = 0x14; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 19: play->nextEntranceIndex = 0x013D; @@ -853,7 +853,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x01ED; play->sceneLoadFlag = 0x14; play->fadeTransition = 15; - gSaveContext.nextTransition = 15; + gSaveContext.nextTransitionType = 15; break; case 49: play->nextEntranceIndex = 0x058C; @@ -985,7 +985,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF4; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 71: gSaveContext.equips.equipment |= 0x0100; @@ -1003,7 +1003,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF0; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 73: play->linkAgeOnLoad = 1; @@ -1017,7 +1017,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->sceneLoadFlag = 0x14; gSaveContext.cutsceneIndex = 0xFFF3; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; break; case 75: play->linkAgeOnLoad = 1; @@ -1109,7 +1109,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x0610; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } break; case 97: @@ -1122,27 +1122,27 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x0580; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } break; case 98: play->nextEntranceIndex = 0x0564; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; break; case 99: play->nextEntranceIndex = 0x0608; play->sceneLoadFlag = 0x14; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 100: play->nextEntranceIndex = 0x00EE; gSaveContext.cutsceneIndex = 0xFFF8; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; break; case 101: play->nextEntranceIndex = 0x01F5; @@ -1248,7 +1248,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->nextEntranceIndex = 0x0594; play->sceneLoadFlag = 0x14; play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 116: if (gSaveContext.eventChkInf[12] & 0x100) { @@ -1260,7 +1260,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB play->sceneLoadFlag = 0x14; play->fadeTransition = 3; } - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; break; case 117: gSaveContext.gameMode = 3; @@ -1275,7 +1275,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517; Play_TriggerVoidOut(play); gSaveContext.respawnFlag = -2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; break; case 119: gSaveContext.dayTime = 0x8000; @@ -1357,7 +1357,7 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm } break; case 9: - gSaveContext.unk_1410 = 1; + gSaveContext.cutsceneTransitionControl = 1; break; case 10: case 11: @@ -1371,7 +1371,7 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm } break; case 12: - gSaveContext.unk_1410 = 255.0f - (155.0f * temp); + gSaveContext.cutsceneTransitionControl = 255.0f - (155.0f * temp); break; case 13: play->envCtx.screenFillColor[0] = 0; diff --git a/soh/src/code/z_elf_message.c b/soh/src/code/z_elf_message.c index 5bf7e9723..ea1f504a8 100644 --- a/soh/src/code/z_elf_message.c +++ b/soh/src/code/z_elf_message.c @@ -54,7 +54,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) { return ((msg->byte0 & 1) == 1) == (CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST) != 0); case (ELF_MSG_CONDITION_MAGIC << 4): - return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.magicAcquired) != 0); + return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.isMagicAcquired) != 0); } } diff --git a/soh/src/code/z_fbdemo_fade.c b/soh/src/code/z_fbdemo_fade.c index 5cec2c4d9..5ad05316d 100644 --- a/soh/src/code/z_fbdemo_fade.c +++ b/soh/src/code/z_fbdemo_fade.c @@ -51,16 +51,16 @@ void TransitionFade_Update(void* thisx, s32 updateRate) { break; case 1: this->fadeTimer += updateRate; - if (this->fadeTimer >= gSaveContext.fadeDuration) { - this->fadeTimer = gSaveContext.fadeDuration; + if (this->fadeTimer >= gSaveContext.transFadeDuration) { + this->fadeTimer = gSaveContext.transFadeDuration; this->isDone = 1; } - if (!gSaveContext.fadeDuration) { + if (!gSaveContext.transFadeDuration) { // "Divide by 0! Zero is included in ZCommonGet fade_speed" osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST); } - alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.fadeDuration); + alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.transFadeDuration); this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha; break; case 2: diff --git a/soh/src/code/z_fbdemo_wipe1.c b/soh/src/code/z_fbdemo_wipe1.c index d4502f8e7..da473d8af 100644 --- a/soh/src/code/z_fbdemo_wipe1.c +++ b/soh/src/code/z_fbdemo_wipe1.c @@ -67,14 +67,14 @@ void TransitionWipe_Update(void* thisx, s32 updateRate) { u8 unk1419; if (this->direction != 0) { - unk1419 = gSaveContext.unk_1419; + unk1419 = gSaveContext.transWipeSpeed; this->texY += (unk1419 * 3) / updateRate; if (this->texY >= 0x264) { this->texY = 0x264; this->isDone = 1; } } else { - unk1419 = gSaveContext.unk_1419; + unk1419 = gSaveContext.transWipeSpeed; this->texY -= (unk1419 * 3) / updateRate; if (this->texY < 0x14E) { this->texY = 0x14D; diff --git a/soh/src/code/z_kaleido_setup.c b/soh/src/code/z_kaleido_setup.c index 83622820c..704640863 100644 --- a/soh/src/code/z_kaleido_setup.c +++ b/soh/src/code/z_kaleido_setup.c @@ -15,7 +15,7 @@ void KaleidoSetup_Update(PlayState* play) { if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && play->gameOverCtx.state == GAMEOVER_INACTIVE && play->sceneLoadFlag == 0 && play->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 && gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) && - play->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 && + play->shootingGalleryStatus <= 1 && gSaveContext.magicState != 8 && gSaveContext.magicState != 9 && (play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) { if (CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) == 2 && !CHECK_BTN_ALL(input->press.button, BTN_START)) { diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 1718a487d..37e7e2c67 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -295,7 +295,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) sLightningFlashAlpha = 0; - gSaveContext.unk_1410 = 0; + gSaveContext.cutsceneTransitionControl = 0; envCtx->adjAmbientColor[0] = envCtx->adjAmbientColor[1] = envCtx->adjAmbientColor[2] = envCtx->adjLight1Color[0] = envCtx->adjLight1Color[1] = envCtx->adjLight1Color[2] = envCtx->adjFogColor[0] = envCtx->adjFogColor[1] = @@ -326,7 +326,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) play->envCtx.unk_F2[0] = 0; - if (gSaveContext.unk_13C3 != 0) { + if (gSaveContext.retainWeatherMode != 0) { if (((void)0, gSaveContext.sceneSetupIndex) < 4) { switch (gWeatherMode) { case 1: @@ -378,7 +378,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused) D_8011FB38 = 0; D_8011FB34 = 0; gSkyboxBlendingEnabled = false; - gSaveContext.unk_13C3 = 0; + gSaveContext.retainWeatherMode = 0; R_ENV_LIGHT1_DIR(0) = 80; R_ENV_LIGHT1_DIR(1) = 80; R_ENV_LIGHT1_DIR(2) = 80; @@ -2531,7 +2531,7 @@ void Environment_WarpSongLeave(PlayState* play) { play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; switch (play->nextEntranceIndex) { case 0x147: diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 54854c387..14acf64a1 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -2917,7 +2917,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { // "Recording complete!!!!!!!!!" osSyncPrintf("録音終了!!!!!!!!! message->info->status=%d \n", msgCtx->ocarinaStaff->state); - gSaveContext.scarecrowCustomSongSet = true; + gSaveContext.scarecrowLongSongSet = true; } Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -2930,10 +2930,10 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf("録音終了!!!!!!!!!録音終了\n"); osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("\n====================================================================\n"); - memcpy(gSaveContext.scarecrowCustomSong, gScarecrowCustomSongPtr, - sizeof(gSaveContext.scarecrowCustomSong)); - for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++) { - osSyncPrintf("%d, ", gSaveContext.scarecrowCustomSong[i]); + memcpy(gSaveContext.scarecrowLongSong, gScarecrowCustomSongPtr, + sizeof(gSaveContext.scarecrowLongSong)); + for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++) { + osSyncPrintf("%d, ", gSaveContext.scarecrowLongSong[i]); } osSyncPrintf(VT_RST); osSyncPrintf("\n====================================================================\n"); @@ -3310,7 +3310,7 @@ void Message_Draw(PlayState* play) { OPEN_DISPS(play->state.gfxCtx); - watchVar = gSaveContext.scarecrowCustomSongSet; + watchVar = gSaveContext.scarecrowLongSongSet; Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx); if (BREG(0) != 0 && play->msgCtx.textId != 0) { plusOne = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP); diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index f7af5b728..c23e2565f 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -987,7 +987,7 @@ void func_80083108(PlayState* play) { } Interface_ChangeAlpha(50); - } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) { + } else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) { if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { gSaveContext.buttonStatus[0] = BTN_DISABLED; gSaveContext.buttonStatus[1] = BTN_DISABLED; @@ -2222,7 +2222,7 @@ u8 Item_Give(PlayState* play, u8 item) { PerformAutosave(play, item); return item; } else if (item == ITEM_MAGIC_SMALL) { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { if (play != NULL) { Magic_Fill(play); } @@ -2241,7 +2241,7 @@ u8 Item_Give(PlayState* play, u8 item) { PerformAutosave(play, item); return item; } else if (item == ITEM_MAGIC_LARGE) { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { if (play != NULL) { Magic_Fill(play); } @@ -2365,16 +2365,16 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { slot = SLOT(item); if (item == RG_MAGIC_SINGLE) { - gSaveContext.magicAcquired = true; - gSaveContext.unk_13F6 = 0x30; + gSaveContext.isMagicAcquired = true; + gSaveContext.magicFillTarget = 0x30; Magic_Fill(play); return RG_NONE; } else if (item == RG_MAGIC_DOUBLE) { - if (!gSaveContext.magicAcquired) { - gSaveContext.magicAcquired = true; + if (!gSaveContext.isMagicAcquired) { + gSaveContext.isMagicAcquired = true; } - gSaveContext.doubleMagic = true; - gSaveContext.unk_13F6 = 0x60; + gSaveContext.isDoubleMagicAcquired = true; + gSaveContext.magicFillTarget = 0x60; gSaveContext.magicLevel = 0; Magic_Fill(play); return RG_NONE; @@ -2389,7 +2389,7 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) { } if (item == RG_DOUBLE_DEFENSE) { - gSaveContext.doubleDefense = true; + gSaveContext.isDoubleDefenseAcquired = true; gSaveContext.inventory.defenseHearts = 20; gSaveContext.healthAccumulator = 0x140; return RG_NONE; @@ -3063,7 +3063,7 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) { // clang-format off if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if ((gSaveContext.doubleDefense != 0) && (healthChange < 0)) { + } else if ((gSaveContext.isDoubleDefenseAcquired != 0) && (healthChange < 0)) { healthChange >>= 1; osSyncPrintf("ハート減少半分!!=%d\n", healthChange); // "Heart decrease halved!!=%d" } @@ -3220,29 +3220,29 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) { } void Magic_Fill(PlayState* play) { - if (gSaveContext.magicAcquired) { - gSaveContext.unk_13F2 = gSaveContext.unk_13F0; - gSaveContext.unk_13F6 = (gSaveContext.doubleMagic + 1) * 0x30; - gSaveContext.unk_13F0 = 9; + if (gSaveContext.isMagicAcquired) { + gSaveContext.prevMagicState = gSaveContext.magicState; + gSaveContext.magicFillTarget = (gSaveContext.isDoubleMagicAcquired + 1) * 0x30; + gSaveContext.magicState = 9; } } void func_800876C8(PlayState* play) { - if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9)) { - if (gSaveContext.unk_13F0 == 10) { - gSaveContext.unk_13F2 = gSaveContext.unk_13F0; + if ((gSaveContext.magicState != 8) && (gSaveContext.magicState != 9)) { + if (gSaveContext.magicState == 10) { + gSaveContext.prevMagicState = gSaveContext.magicState; } - gSaveContext.unk_13F0 = 5; + gSaveContext.magicState = 5; } } s32 func_80087708(PlayState* play, s16 arg1, s16 arg2) { - if (!gSaveContext.magicAcquired) { + if (!gSaveContext.isMagicAcquired) { return 0; } if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0) { - if (gSaveContext.unk_13F4 != 0) { + if (gSaveContext.magicCapacity != 0) { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } return 0; @@ -3251,66 +3251,66 @@ s32 func_80087708(PlayState* play, s16 arg1, s16 arg2) { switch (arg2) { case 0: case 2: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { - if (gSaveContext.unk_13F0 == 7) { + if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) { + if (gSaveContext.magicState == 7) { play->actorCtx.lensActive = false; } - gSaveContext.unk_13F8 = gSaveContext.magic - arg1; - gSaveContext.unk_13F0 = 1; + gSaveContext.magicTarget = gSaveContext.magic - arg1; + gSaveContext.magicState = 1; return 1; } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 1: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { - if (gSaveContext.unk_13F0 == 7) { + if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) { + if (gSaveContext.magicState == 7) { play->actorCtx.lensActive = false; } - gSaveContext.unk_13F8 = gSaveContext.magic - arg1; - gSaveContext.unk_13F0 = 6; + gSaveContext.magicTarget = gSaveContext.magic - arg1; + gSaveContext.magicState = 6; return 1; } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 3: - if (gSaveContext.unk_13F0 == 0) { + if (gSaveContext.magicState == 0) { if (gSaveContext.magic != 0) { play->interfaceCtx.unk_230 = 80; - gSaveContext.unk_13F0 = 7; + gSaveContext.magicState = 7; return 1; } else { return 0; } } else { - if (gSaveContext.unk_13F0 == 7) { + if (gSaveContext.magicState == 7) { return 1; } else { return 0; } } case 4: - if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) { - if (gSaveContext.unk_13F0 == 7) { + if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) { + if (gSaveContext.magicState == 7) { play->actorCtx.lensActive = false; } - gSaveContext.unk_13F8 = gSaveContext.magic - arg1; - gSaveContext.unk_13F0 = 4; + gSaveContext.magicTarget = gSaveContext.magic - arg1; + gSaveContext.magicState = 4; return 1; } else { Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); return 0; } case 5: - if (gSaveContext.unk_13F4 >= gSaveContext.magic) { - gSaveContext.unk_13F8 = gSaveContext.magic + arg1; + if (gSaveContext.magicCapacity >= gSaveContext.magic) { + gSaveContext.magicTarget = gSaveContext.magic + arg1; - if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4) { - gSaveContext.unk_13F8 = gSaveContext.unk_13F4; + if (gSaveContext.magicTarget >= gSaveContext.magicCapacity) { + gSaveContext.magicTarget = gSaveContext.magicCapacity; } - gSaveContext.unk_13F0 = 10; + gSaveContext.magicState = 10; return 1; } break; @@ -3359,23 +3359,23 @@ void Interface_UpdateMagicBar(PlayState* play) { s16 borderChangeB; s16 temp; - switch (gSaveContext.unk_13F0) { + switch (gSaveContext.magicState) { case 8: temp = gSaveContext.magicLevel * 0x30; - if (gSaveContext.unk_13F4 != temp) { - if (gSaveContext.unk_13F4 < temp) { - gSaveContext.unk_13F4 += 8; - if (gSaveContext.unk_13F4 > temp) { - gSaveContext.unk_13F4 = temp; + if (gSaveContext.magicCapacity != temp) { + if (gSaveContext.magicCapacity < temp) { + gSaveContext.magicCapacity += 8; + if (gSaveContext.magicCapacity > temp) { + gSaveContext.magicCapacity = temp; } } else { - gSaveContext.unk_13F4 -= 8; - if (gSaveContext.unk_13F4 <= temp) { - gSaveContext.unk_13F4 = temp; + gSaveContext.magicCapacity -= 8; + if (gSaveContext.magicCapacity <= temp) { + gSaveContext.magicCapacity = temp; } } } else { - gSaveContext.unk_13F0 = 9; + gSaveContext.magicState = 9; } break; @@ -3388,31 +3388,31 @@ void Interface_UpdateMagicBar(PlayState* play) { } // "Storage MAGIC_NOW=%d (%d)" - osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6); - if (gSaveContext.magic >= gSaveContext.unk_13F6) { - gSaveContext.magic = gSaveContext.unk_13F6; - gSaveContext.unk_13F0 = gSaveContext.unk_13F2; - gSaveContext.unk_13F2 = 0; + osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.magicFillTarget); + if (gSaveContext.magic >= gSaveContext.magicFillTarget) { + gSaveContext.magic = gSaveContext.magicFillTarget; + gSaveContext.magicState = gSaveContext.prevMagicState; + gSaveContext.prevMagicState = 0; } break; case 1: sMagicBorderRatio = 2; - gSaveContext.unk_13F0 = 2; + gSaveContext.magicState = 2; break; case 2: gSaveContext.magic -= 2; if (gSaveContext.magic <= 0) { gSaveContext.magic = 0; - gSaveContext.unk_13F0 = 3; + gSaveContext.magicState = 3; if (CVar_GetS32("gHudColors", 1) == 2) { sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori); } else { sMagicBorder = sMagicBorder_ori; } - } else if (gSaveContext.magic == gSaveContext.unk_13F8) { - gSaveContext.unk_13F0 = 3; + } else if (gSaveContext.magic == gSaveContext.magicTarget) { + gSaveContext.magicState = 3; if (CVar_GetS32("gHudColors", 1) == 2) { sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori); } else { @@ -3464,7 +3464,7 @@ void Interface_UpdateMagicBar(PlayState* play) { } else { sMagicBorder = sMagicBorder_ori; } - gSaveContext.unk_13F0 = 0; + gSaveContext.magicState = 0; break; case 7: @@ -3484,7 +3484,7 @@ void Interface_UpdateMagicBar(PlayState* play) { play->actorCtx.lensActive = false; Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - gSaveContext.unk_13F0 = 0; + gSaveContext.magicState = 0; if (CVar_GetS32("gHudColors", 1) == 2) { sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori); } else { @@ -3539,15 +3539,15 @@ void Interface_UpdateMagicBar(PlayState* play) { case 10: gSaveContext.magic += 4; Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (gSaveContext.magic >= gSaveContext.unk_13F8) { - gSaveContext.magic = gSaveContext.unk_13F8; - gSaveContext.unk_13F0 = gSaveContext.unk_13F2; - gSaveContext.unk_13F2 = 0; + if (gSaveContext.magic >= gSaveContext.magicTarget) { + gSaveContext.magic = gSaveContext.magicTarget; + gSaveContext.magicState = gSaveContext.prevMagicState; + gSaveContext.prevMagicState = 0; } break; default: - gSaveContext.unk_13F0 = 0; + gSaveContext.magicState = 0; break; } } @@ -3663,13 +3663,13 @@ void Interface_DrawMagicBar(PlayState* play) { OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, PosX_Start, magicBarY, 8, 16, 1 << 10, 1 << 10); - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, PosX_MidEnd, magicBarY, gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, PosX_MidEnd, magicBarY, gSaveContext.magicCapacity, 16, 1 << 10, 1 << 10); gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 16, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2, - ((rMagicBarX + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE, + gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.magicCapacity) + 8) << 2, magicBarY << 2, + ((rMagicBarX + gSaveContext.magicCapacity) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE, 256, 0, 1 << 10, 1 << 10); gDPPipeSync(OVERLAY_DISP++); @@ -3677,7 +3677,7 @@ void Interface_DrawMagicBar(PlayState* play) { ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE); gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); - if (gSaveContext.unk_13F0 == 4) { + if (gSaveContext.magicState == 4) { // Yellow part of the bar indicating the amount of magic to be subtracted if (CVar_GetS32("gHudColors", 1) == 2) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).r, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).g, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).b, interfaceCtx->magicAlpha); @@ -3702,7 +3702,7 @@ void Interface_DrawMagicBar(PlayState* play) { } gSPWideTextureRectangle(OVERLAY_DISP++, rMagicFillX << 2, (magicBarY + 3) << 2, - (rMagicFillX + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, + (rMagicFillX + gSaveContext.magicTarget) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } else { // Fill the whole bar with the normal magic color @@ -4164,7 +4164,7 @@ void Interface_DrawItemButtons(PlayState* play) { if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) { temp = 0; } else if ((player->stateFlags1 & 0x00200000) || (func_8008F2F8(play) == 4) || - (player->stateFlags2 & 0x00040000)) { + (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) { temp = 70; } else { temp = interfaceCtx->healthAlpha; @@ -5194,7 +5194,7 @@ void Interface_Draw(PlayState* play) { Interface_DrawLineupTick(play); } - if (fullUi || gSaveContext.unk_13F0 > 0) { + if (fullUi || gSaveContext.magicState > 0) { Interface_DrawMagicBar(play); } @@ -6367,15 +6367,15 @@ void Interface_Update(PlayState* play) { (msgCtx->msgMode == MSGMODE_NONE) && (play->sceneLoadFlag == 0) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionMode == 0) && ((play->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(play))) { - if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) { - gSaveContext.magicLevel = gSaveContext.doubleMagic + 1; - gSaveContext.unk_13F0 = 8; + if ((gSaveContext.isMagicAcquired != 0) && (gSaveContext.magicLevel == 0)) { + gSaveContext.magicLevel = gSaveContext.isDoubleMagicAcquired + 1; + gSaveContext.magicState = 8; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("魔法スター─────ト!!!!!!!!!\n"); // "Magic Start!!!!!!!!!" osSyncPrintf("MAGIC_MAX=%d\n", gSaveContext.magicLevel); osSyncPrintf("MAGIC_NOW=%d\n", gSaveContext.magic); - osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6); - osSyncPrintf("Z_MAGIC_NOW_MAX=%d\n", gSaveContext.unk_13F4); + osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget); + osSyncPrintf("Z_MAGIC_NOW_MAX=%d\n", gSaveContext.magicCapacity); osSyncPrintf(VT_RST); } @@ -6463,18 +6463,18 @@ void Interface_Update(PlayState* play) { if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) { gSaveContext.nextDayTime = 0; play->fadeTransition = 4; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; play->unk_11DE9 = 1; } else { gSaveContext.nextDayTime = 0x8001; play->fadeTransition = 5; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; play->unk_11DE9 = 1; } if (play->sceneNum == SCENE_SPOT13) { play->fadeTransition = 14; - gSaveContext.nextTransition = 14; + gSaveContext.nextTransitionType = 14; } gSaveContext.respawnFlag = -2; diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index 830a22098..9d35a528c 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -214,7 +214,7 @@ void GivePlayerRandoRewardSongOfTime(PlayState* play, RandomizerCheck check) { Player* player = GET_PLAYER(play); if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(play, player) && - !Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransition == 0xFF && !gSaveContext.pendingIceTrapCount) { + !Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == 0xFF && !gSaveContext.pendingIceTrapCount) { GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME); GiveItemEntryWithoutActor(play, getItemEntry); player->pendingFlag.flagID = 0x1F; @@ -556,7 +556,7 @@ void Play_Init(GameState* thisx) { if (CVar_GetS32("gSceneTransitions", 255)!= 255){ play->transitionMode = CVar_GetS32("gSceneTransitions", 0); - gSaveContext.nextTransition = CVar_GetS32("gSceneTransitions", 0); + gSaveContext.nextTransitionType = CVar_GetS32("gSceneTransitions", 0); play->fadeTransition = CVar_GetS32("gSceneTransitions", 0); } @@ -571,12 +571,12 @@ void Play_Init(GameState* thisx) { play->unk_11DE9 = 0; if (gSaveContext.gameMode != 1) { - if (gSaveContext.nextTransition == 0xFF) { + if (gSaveContext.nextTransitionType == 0xFF) { play->fadeTransition = (gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In } else { - play->fadeTransition = gSaveContext.nextTransition; - gSaveContext.nextTransition = 0xFF; + play->fadeTransition = gSaveContext.nextTransitionType; + gSaveContext.nextTransitionType = 0xFF; } } else { play->fadeTransition = 6; @@ -777,21 +777,21 @@ void Play_Update(PlayState* play) { play->transitionCtx.transitionType | 0x80); } - gSaveContext.unk_1419 = 14; + gSaveContext.transWipeSpeed = 14; if ((play->transitionCtx.transitionType == 8) || (play->transitionCtx.transitionType == 9)) { - gSaveContext.unk_1419 = 28; + gSaveContext.transWipeSpeed = 28; } - gSaveContext.fadeDuration = 60; + gSaveContext.transFadeDuration = 60; if ((play->transitionCtx.transitionType == 4) || (play->transitionCtx.transitionType == 5)) { - gSaveContext.fadeDuration = 20; + gSaveContext.transFadeDuration = 20; } else if ((play->transitionCtx.transitionType == 6) || (play->transitionCtx.transitionType == 7)) { - gSaveContext.fadeDuration = 150; + gSaveContext.transFadeDuration = 150; } else if (play->transitionCtx.transitionType == 17) { - gSaveContext.fadeDuration = 2; + gSaveContext.transFadeDuration = 2; } if ((play->transitionCtx.transitionType == 3) || @@ -954,7 +954,7 @@ void Play_Update(PlayState* play) { break; case 11: - if (gSaveContext.unk_1410 != 0) { + if (gSaveContext.cutsceneTransitionControl != 0) { play->transitionMode = 3; } break; @@ -1029,9 +1029,9 @@ void Play_Update(PlayState* play) { break; case 17: - if (gSaveContext.unk_1410 != 0) { - play->envCtx.screenFillColor[3] = gSaveContext.unk_1410; - if (gSaveContext.unk_1410 < 0x65) { + if (gSaveContext.cutsceneTransitionControl != 0) { + play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl; + if (gSaveContext.cutsceneTransitionControl < 0x65) { gTrnsnUnkState = 0; R_UPDATE_RATE = 3; play->sceneLoadFlag = 0; @@ -2177,11 +2177,11 @@ void Play_PerformSave(PlayState* play) { gSaveContext.savedSceneNum = play->sceneNum; if (gSaveContext.temporaryWeapon) { gSaveContext.equips.buttonItems[0] = ITEM_NONE; - GET_PLAYER(play)->currentSwordItem = ITEM_NONE; + GET_PLAYER(play)->currentSwordItemId = ITEM_NONE; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE); Save_SaveFile(); gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; - GET_PLAYER(play)->currentSwordItem = ITEM_SWORD_KOKIRI; + GET_PLAYER(play)->currentSwordItemId = ITEM_SWORD_KOKIRI; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI); } else { Save_SaveFile(); diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index 29cdb05ca..6e9e9df80 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -332,7 +332,7 @@ void Player_SetBootData(PlayState* play, Player* this) { s32 Player_InBlockingCsMode(PlayState* play, Player* this) { return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->sceneLoadFlag == 0x14) || (this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) || - ((gSaveContext.unk_13F0 != 0) && (Player_ActionToMagicSpell(this, this->itemActionParam) >= 0)); + ((gSaveContext.magicState != 0) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0)); } s32 Player_InCsMode(PlayState* play) { @@ -361,8 +361,8 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { void Player_SetModelsForHoldingShield(Player* this) { if ((this->stateFlags1 & 0x400000) && - ((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) { - if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK) || + ((this->itemAction < 0) || (this->itemAction == this->heldItemAction))) { + if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK) || !Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) { this->rightHandType = 10; this->rightHandDLists = &sPlayerDListGroups[10][gSaveContext.linkAge]; @@ -373,7 +373,7 @@ void Player_SetModelsForHoldingShield(Player* this) { } this->sheathDLists = &sPlayerDListGroups[this->sheathType][gSaveContext.linkAge]; this->modelAnimType = 2; - this->itemActionParam = -1; + this->itemAction = -1; } } } @@ -408,8 +408,8 @@ void Player_SetModelGroup(Player* this, s32 modelGroup) { } void func_8008EC70(Player* this) { - this->itemActionParam = this->heldItemActionParam; - Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemActionParam)); + this->itemAction = this->heldItemAction; + Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemAction)); this->unk_6AD = 0; } @@ -418,8 +418,8 @@ void Player_SetEquipmentData(PlayState* play, Player* this) { this->currentShield = CUR_EQUIP_VALUE(EQUIP_SHIELD); this->currentTunic = CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1; this->currentBoots = CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1; - this->currentSwordItem = B_BTN_ITEM; - Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemActionParam)); + this->currentSwordItemId = B_BTN_ITEM; + Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemAction)); Player_SetBootData(play, this); } } @@ -429,10 +429,10 @@ void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 action if (item != ITEM_BOTTLE) { this->heldItemId = item; - this->heldItemActionParam = actionParam; + this->heldItemAction = actionParam; } - this->itemActionParam = actionParam; + this->itemAction = actionParam; } void func_8008EDF0(Player* this) { @@ -478,8 +478,8 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y Vec3f diff; s32 pad; - if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_860 != 0)) { - Math_Vec3f_Diff(&this->swordInfo[0].tip, pos, &diff); + if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_860 != 0)) { + Math_Vec3f_Diff(&this->meleeWeaponInfo[0].tip, pos, &diff); return ((SQ(diff.x) + SQ(diff.z)) <= SQ(xzRange)) && (0.0f <= diff.y) && (diff.y <= yRange); } else { return false; @@ -525,7 +525,7 @@ s32 Player_HasMirrorShieldSetToDraw(PlayState* play) { } s32 Player_ActionToMagicSpell(Player* this, s32 actionParam) { - s32 magicSpell = actionParam - PLAYER_AP_MAGIC_SPELL_15; + s32 magicSpell = actionParam - PLAYER_IA_MAGIC_SPELL_15; if ((magicSpell >= 0) && (magicSpell < 6)) { return magicSpell; @@ -535,7 +535,7 @@ s32 Player_ActionToMagicSpell(Player* this, s32 actionParam) { } s32 Player_HoldsHookshot(Player* this) { - return (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) || (this->heldItemActionParam == PLAYER_AP_LONGSHOT); + return (this->heldItemAction == PLAYER_IA_HOOKSHOT) || (this->heldItemAction == PLAYER_IA_LONGSHOT); } s32 func_8008F128(Player* this) { @@ -543,7 +543,7 @@ s32 func_8008F128(Player* this) { } s32 Player_ActionToSword(s32 actionParam) { - s32 sword = actionParam - PLAYER_AP_FISHING_POLE; + s32 sword = actionParam - PLAYER_IA_FISHING_POLE; if ((sword > 0) && (sword < 6)) { return sword; @@ -553,11 +553,11 @@ s32 Player_ActionToSword(s32 actionParam) { } s32 Player_GetSwordHeld(Player* this) { - return Player_ActionToSword(this->heldItemActionParam); + return Player_ActionToSword(this->heldItemAction); } s32 Player_HoldsTwoHandedWeapon(Player* this) { - if ((this->heldItemActionParam >= PLAYER_AP_SWORD_BGS) && (this->heldItemActionParam <= PLAYER_AP_HAMMER)) { + if ((this->heldItemAction >= PLAYER_IA_SWORD_BGS) && (this->heldItemAction <= PLAYER_IA_HAMMER)) { return 1; } else { return 0; @@ -565,11 +565,11 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) { } s32 Player_HoldsBrokenKnife(Player* this) { - return (this->heldItemActionParam == PLAYER_AP_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f); + return (this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f); } s32 Player_ActionToBottle(Player* this, s32 actionParam) { - s32 bottle = actionParam - PLAYER_AP_BOTTLE; + s32 bottle = actionParam - PLAYER_IA_BOTTLE; if ((bottle >= 0) && (bottle < 13)) { return bottle; @@ -579,11 +579,11 @@ s32 Player_ActionToBottle(Player* this, s32 actionParam) { } s32 Player_GetBottleHeld(Player* this) { - return Player_ActionToBottle(this, this->heldItemActionParam); + return Player_ActionToBottle(this, this->heldItemAction); } s32 Player_ActionToExplosive(Player* this, s32 actionParam) { - s32 explosive = actionParam - PLAYER_AP_BOMB; + s32 explosive = actionParam - PLAYER_IA_BOMB; if ((explosive >= 0) && (explosive < 2)) { return explosive; @@ -593,14 +593,14 @@ s32 Player_ActionToExplosive(Player* this, s32 actionParam) { } s32 Player_GetExplosiveHeld(Player* this) { - return Player_ActionToExplosive(this, this->heldItemActionParam); + return Player_ActionToExplosive(this, this->heldItemAction); } s32 func_8008F2BC(Player* this, s32 actionParam) { s32 sword = 0; - if (actionParam != PLAYER_AP_LAST_USED) { - sword = actionParam - PLAYER_AP_SWORD_MASTER; + if (actionParam != PLAYER_IA_LAST_USED) { + sword = actionParam - PLAYER_IA_SWORD_MASTER; if ((sword < 0) || (sword >= 3)) { goto return_neg; } @@ -857,7 +857,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p s32 temp3; if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & 0x80) && - (Player_ActionToMagicSpell(this, this->itemActionParam) < 0)) { + (Player_ActionToMagicSpell(this, this->itemAction) < 0)) { s32 pad; sp7C = D_80126058[gSaveContext.linkAge]; @@ -931,7 +931,7 @@ s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s if (limbIndex == PLAYER_LIMB_ROOT) { D_80160014 = this->leftHandType; D_80160018 = this->rightHandType; - D_80160000 = &this->swordInfo[2].base; + D_80160000 = &this->meleeWeaponInfo[2].base; if (!LINK_IS_ADULT) { if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) { @@ -1157,15 +1157,15 @@ void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) { Matrix_MultVec3f(&D_801260A4[1], &newBasePos[1]); Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]); - if (func_80090480(play, NULL, &this->swordInfo[0], &newTipPos[0], &newBasePos[0]) && + if (func_80090480(play, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) && !(this->stateFlags1 & 0x400000)) { - EffectBlure_AddVertex(Effect_GetByIndex(this->swordEffectIndex), &this->swordInfo[0].tip, - &this->swordInfo[0].base); + EffectBlure_AddVertex(Effect_GetByIndex(this->meleeWeaponEffectIndex), &this->meleeWeaponInfo[0].tip, + &this->meleeWeaponInfo[0].base); } - if ((this->swordState > 0) && ((this->swordAnimation < 0x18) || (this->stateFlags2 & 0x20000))) { - func_80090480(play, &this->swordQuads[0], &this->swordInfo[1], &newTipPos[1], &newBasePos[1]); - func_80090480(play, &this->swordQuads[1], &this->swordInfo[2], &newTipPos[2], &newBasePos[2]); + if ((this->swordState > 0) && ((this->meleeWeaponAnimation < 0x18) || (this->stateFlags2 & 0x20000))) { + func_80090480(play, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]); + func_80090480(play, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]); } } @@ -1321,7 +1321,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void Math_Vec3f_Copy(&this->leftHandPos, D_80160000); - if (this->itemActionParam == PLAYER_AP_STICK) { + if (this->itemAction == PLAYER_IA_STICK) { Vec3f sp124[3]; OPEN_DISPS(play->state.gfxCtx); @@ -1330,10 +1330,10 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void D_80126080.x = this->unk_85C * 5000.0f; func_80090A28(this, sp124); if (this->swordState != 0) { - EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex), 7); // default sword type + EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), 7); // default sword type func_800906D4(play, this, sp124); } else { - Math_Vec3f_Copy(&this->swordInfo[0].tip, &sp124[0]); + Math_Vec3f_Copy(&this->meleeWeaponInfo[0].tip, &sp124[0]); } } @@ -1354,15 +1354,15 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void } else { D_80126080.x = sSwordLengths[Player_GetSwordHeld(this)]; if (CVar_GetS32("gSeperateSwords", 0) != 0) - EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex), sSwordTypes[Player_GetSwordHeld(this)]); + EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), sSwordTypes[Player_GetSwordHeld(this)]); else - EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex),1); //default sword type + EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex),1); //default sword type } func_80090A28(this, spE4); func_800906D4(play, this, spE4); } else if ((*dList != NULL) && (this->leftHandType == 7)) { - Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemActionParam)]; + Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemAction)]; OPEN_DISPS(play->state.gfxCtx); @@ -1451,8 +1451,8 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void } if (this->actor.scale.y >= 0.0f) { - if ((this->heldItemActionParam == PLAYER_AP_HOOKSHOT) || - (this->heldItemActionParam == PLAYER_AP_LONGSHOT)) { + if ((this->heldItemAction == PLAYER_IA_HOOKSHOT) || + (this->heldItemAction == PLAYER_IA_LONGSHOT)) { Matrix_MultVec3f(&D_80126184, &this->unk_3C8); if (heldActor != NULL) { @@ -1468,7 +1468,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void if (func_8002DD78(this) != 0) { Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY); Player_DrawHookshotReticle( - play, this, (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 38600.0f : 77600.0f); + play, this, (this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f); } } } diff --git a/soh/src/code/z_sram.c b/soh/src/code/z_sram.c index 797a96177..9cdc54b01 100644 --- a/soh/src/code/z_sram.c +++ b/soh/src/code/z_sram.c @@ -217,14 +217,14 @@ void Sram_OpenSave() { gSaveContext.health = 0x30; } - if (gSaveContext.scarecrowCustomSongSet) { + if (gSaveContext.scarecrowLongSongSet) { osSyncPrintf(VT_FGCOL(BLUE)); osSyncPrintf("\n====================================================================\n"); - memcpy(gScarecrowCustomSongPtr, gSaveContext.scarecrowCustomSong, sizeof(gSaveContext.scarecrowCustomSong)); + memcpy(gScarecrowCustomSongPtr, gSaveContext.scarecrowLongSong, sizeof(gSaveContext.scarecrowLongSong)); ptr = (u8*)gScarecrowCustomSongPtr; - for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++, ptr++) { + for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++, ptr++) { osSyncPrintf("%d, ", *ptr); } diff --git a/soh/src/code/z_vr_box.c b/soh/src/code/z_vr_box.c index 70e6fe31d..457cad3db 100644 --- a/soh/src/code/z_vr_box.c +++ b/soh/src/code/z_vr_box.c @@ -604,7 +604,7 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) { { case SKYBOX_NORMAL_SKY: phi_v1 = 0; - if (gSaveContext.unk_13C3 != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 && + if (gSaveContext.retainWeatherMode != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 && gWeatherMode < 6) { phi_v1 = 1; } diff --git a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index 3b5cc77ec..9e913a846 100644 --- a/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/soh/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -85,7 +85,7 @@ void ArmsHook_Wait(ArmsHook* this, PlayState* play) { if (this->actor.parent == NULL) { Player* player = GET_PLAYER(play); // get correct timer length for hookshot or longshot - s32 length = (player->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 13 : 26; + s32 length = (player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26; ArmsHook_SetupAction(this, ArmsHook_Shoot); func_8002D9A4(&this->actor, 20.0f); @@ -121,7 +121,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) { Player* player = (Player*)this->actor.parent; if (Player_HoldsHookshot(player)) { - if ((player->itemActionParam != player->heldItemActionParam) || (player->actor.flags & ACTOR_FLAG_8) || + if ((player->itemAction != player->heldItemAction) || (player->actor.flags & ACTOR_FLAG_8) || ((player->stateFlags1 & 0x4000080))) { this->timer = 0; ArmsHook_DetachHookFromActor(this); diff --git a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 635afbd5d..5a3d9a7d3 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/soh/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -209,12 +209,12 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) { } if (play->sceneNum == SCENE_DAIYOUSEI_IZUMI) { - if (!gSaveContext.magicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) { + if (!gSaveContext.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) { Actor_Kill(&this->actor); return; } } else { - if (!gSaveContext.magicAcquired) { + if (!gSaveContext.isMagicAcquired) { Actor_Kill(&this->actor); return; } @@ -253,7 +253,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { } else { switch (this->fountainType) { case FAIRY_UPGRADE_MAGIC: - if (!gSaveContext.magicAcquired || BREG(2)) { + if (!gSaveContext.isMagicAcquired || BREG(2)) { // "Spin Attack speed UP" osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 回転切り速度UP ☆☆☆☆☆ \n" VT_RST); this->givingSpell = true; @@ -261,7 +261,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { } break; case FAIRY_UPGRADE_DOUBLE_MAGIC: - if (!gSaveContext.doubleMagic) { + if (!gSaveContext.isDoubleMagicAcquired) { // "Magic Meter doubled" osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 魔法ゲージメーター倍増 ☆☆☆☆☆ \n" VT_RST); this->givingSpell = true; @@ -269,7 +269,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) { } break; case FAIRY_UPGRADE_HALF_DAMAGE: - if (!gSaveContext.doubleDefense) { + if (!gSaveContext.isDoubleDefenseAcquired) { // "Damage halved" osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ ダメージ半減 ☆☆☆☆☆ \n" VT_RST); this->givingSpell = true; @@ -495,7 +495,7 @@ void BgDyYoseizo_HealPlayer_NoReward(BgDyYoseizo* this, PlayState* play) { this->refillTimer = 200; } - if (((gSaveContext.healthCapacity == gSaveContext.health) && (gSaveContext.magic == gSaveContext.unk_13F4)) || + if (((gSaveContext.healthCapacity == gSaveContext.health) && (gSaveContext.magic == gSaveContext.magicCapacity)) || (this->refillTimer == 1)) { this->healingTimer--; if (this->healingTimer == 90) { @@ -738,21 +738,21 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { switch (actionIndex) { case FAIRY_UPGRADE_MAGIC: - gSaveContext.magicAcquired = true; - gSaveContext.unk_13F6 = 0x30; + gSaveContext.isMagicAcquired = true; + gSaveContext.magicFillTarget = 0x30; Interface_ChangeAlpha(9); break; case FAIRY_UPGRADE_DOUBLE_MAGIC: - if (!gSaveContext.magicAcquired) { - gSaveContext.magicAcquired = true; + if (!gSaveContext.isMagicAcquired) { + gSaveContext.isMagicAcquired = true; } - gSaveContext.doubleMagic = true; - gSaveContext.unk_13F6 = 0x60; + gSaveContext.isDoubleMagicAcquired = true; + gSaveContext.magicFillTarget = 0x60; gSaveContext.magicLevel = 0; Interface_ChangeAlpha(9); break; case FAIRY_UPGRADE_HALF_DAMAGE: - gSaveContext.doubleDefense = true; + gSaveContext.isDoubleDefenseAcquired = true; Interface_ChangeAlpha(9); break; } @@ -780,8 +780,8 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { itemPos.x, itemPos.y, itemPos.z, 0, 0, 0, sExItemTypes[actionIndex]); if (this->item != NULL) { - if (gSaveContext.magicAcquired == 0) { - gSaveContext.magicAcquired = 1; + if (gSaveContext.isMagicAcquired == 0) { + gSaveContext.isMagicAcquired = 1; } else { Magic_Fill(play); } diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 1161127cc..17dc96371 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -127,7 +127,7 @@ void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) { Player* player = GET_PLAYER(play); if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) && - (player->swordAnimation == 22 || player->swordAnimation == 23)) { + (player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23)) { this->collider.base.acFlags &= ~AC_HIT; if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) || (this->collider.elements[1].info.bumperFlags & BUMP_HIT)) { diff --git a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 242e667ea..30c160b51 100644 --- a/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/soh/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -89,7 +89,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) { uint32_t kokiriSwordBitMask = 1 << 0; if (!(gSaveContext.inventory.equipment & kokiriSwordBitMask)) { Player* player = GET_PLAYER(gPlayState); - player->currentSwordItem = ITEM_NONE; + player->currentSwordItemId = ITEM_NONE; gSaveContext.equips.buttonItems[0] = ITEM_NONE; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE); } diff --git a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index a261b39b5..d9fa609fc 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/soh/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -282,8 +282,8 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) { webPos.y = this->dyna.actor.world.pos.y - 50.0f; webPos.z = this->dyna.actor.world.pos.z; if (Player_IsBurningStickInRange(play, &webPos, 70.0f, 50.0f) != 0) { - this->dyna.actor.home.pos.x = player->swordInfo[0].tip.x; - this->dyna.actor.home.pos.z = player->swordInfo[0].tip.z; + this->dyna.actor.home.pos.x = player->meleeWeaponInfo[0].tip.x; + this->dyna.actor.home.pos.z = player->meleeWeaponInfo[0].tip.z; BgYdanSp_BurnWeb(this, play); return; } @@ -402,11 +402,11 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) { if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->trisCollider.base.acFlags & 2)) { this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f; BgYdanSp_BurnWeb(this, play); - } else if (player->heldItemActionParam == PLAYER_AP_STICK && player->unk_860 != 0) { - func_8002DBD0(&this->dyna.actor, &sp30, &player->swordInfo[0].tip); + } else if (player->heldItemAction == PLAYER_IA_STICK && player->unk_860 != 0) { + func_8002DBD0(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip); if (fabsf(sp30.x) < 100.0f && sp30.z < 1.0f && sp30.y < 200.0f) { OnePointCutscene_Init(play, 3020, 40, &this->dyna.actor, MAIN_CAM); - Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->swordInfo[0].tip); + Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->meleeWeaponInfo[0].tip); BgYdanSp_BurnWeb(this, play); } } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index 1f00f27a7..817bafa15 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -1188,7 +1188,7 @@ void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) { this->csTimer = 0; this->csState = 100; this->unk_198 = 1; - gSaveContext.magic = gSaveContext.unk_13F4; + gSaveContext.magic = gSaveContext.magicCapacity; gSaveContext.health = gSaveContext.healthCapacity; } else { this->actionFunc = BossGanon_SetupTowerCutscene; @@ -3962,7 +3962,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { switch (this->unk_1C2) { case 0: - if ((player->stateFlags1 & 2) && + if ((player->stateFlags1 & PLAYER_STATE1_SWINGING_BOTTLE) && (ABS((s16)(player->actor.shape.rot.y - (s16)(ganondorf->actor.yawTowardsPlayer + 0x8000))) < 0x2000) && (sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f)) { @@ -4003,7 +4003,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) { } // if a spin attack is used - if (player->swordAnimation >= 0x18) { + if (player->meleeWeaponAnimation >= 0x18) { this->actor.speedXZ = 20.0f; } break; @@ -4447,7 +4447,7 @@ void func_808E2544(Actor* thisx, PlayState* play) { this->actor.world.rot.x = (Math_CosS(this->unk_1A2 * 0x3400) * sp84 * 0.1f) + this->actor.shape.rot.x; this->actor.world.rot.y = (Math_SinS(this->unk_1A2 * 0x1A00) * sp84) + this->actor.shape.rot.y; - if ((player->swordState != 0) && (player->swordAnimation >= 0x18) && (this->actor.xzDistToPlayer < 80.0f)) { + if ((player->swordState != 0) && (player->meleeWeaponAnimation >= 0x18) && (this->actor.xzDistToPlayer < 80.0f)) { this->unk_1C2 = 0xC; this->actor.speedXZ = -30.0f; func_8002D908(&this->actor); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 421826f95..0efb308f5 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -1668,7 +1668,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) { temp_f12 = this->unk_1B8.z - player->actor.world.pos.z; temp_a0_2 = Math_Atan2S(temp_f12, temp_f14) - player->actor.shape.rot.y; if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) && - (player->swordState != 0) && (player->heldItemActionParam == PLAYER_AP_SWORD_MASTER)) { + (player->swordState != 0) && (player->heldItemAction == PLAYER_IA_SWORD_MASTER)) { func_80064520(play, &play->csCtx); gSaveContext.sohStats.gameComplete = true; gSaveContext.sohStats.timestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME; diff --git a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index d1753aee1..dff65b42f 100644 --- a/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/soh/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -915,7 +915,7 @@ void GivePlayerRandoRewardImpa(Actor* impa, PlayState* play, RandomizerCheck che gSaveContext.eventChkInf[5] |= 0x200; play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; // In entrance rando have impa bring link back to the front of castle grounds if (Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) { play->nextEntranceIndex = 0x0138; diff --git a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 91625301f..289f700c1 100644 --- a/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/soh/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -417,7 +417,7 @@ void func_80996C60(DoorShutter* this, PlayState* play) { DoorShutter_SetupAction(this, func_80997004); this->unk_16C = sp38; this->unk_170 = 0.0f; - Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->unk_46A, 0.0f, 12, sp34, 10); + Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->doorBgCamIndex, 0.0f, 12, sp34, 10); } } diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index bc54d7bd6..acc093e3f 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -589,7 +589,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) { osSyncPrintf("\n\n\nおわりおわり"); play->sceneLoadFlag = 0x14; play->fadeTransition = 7; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } Math_StepToF(&this->unk_194, 2.0f, 0.01f); @@ -907,7 +907,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) { play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 7; + gSaveContext.nextTransitionType = 7; } if (this->warpTimer >= 141) { f32 screenFillAlpha; diff --git a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 6368ef19c..b3039f848 100644 --- a/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/soh/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -270,7 +270,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) { EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]); } - if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == PLAYER_AP_STICK) && + if (((this->actor.params & 1) == 1) && (player->heldItemAction == PLAYER_IA_STICK) && (this->swordDownTimer <= 0) && ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) < SQ(120.0f)) || @@ -306,9 +306,9 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) { minAnimSpeed = 0.0f; if ((this->flightParamsIdx != 0) && (this->timer < 12)) { - swordTip.x = player->swordInfo[0].tip.x + Math_SinS(player->actor.shape.rot.y) * 10.0f; - swordTip.y = player->swordInfo[0].tip.y; - swordTip.z = player->swordInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f; + swordTip.x = player->meleeWeaponInfo[0].tip.x + Math_SinS(player->actor.shape.rot.y) * 10.0f; + swordTip.y = player->meleeWeaponInfo[0].tip.y; + swordTip.z = player->meleeWeaponInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f; yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410); if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) { @@ -320,7 +320,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) { } } - this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->swordInfo[0].tip.y); + this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->meleeWeaponInfo[0].tip.y); EnButte_Turn(this); @@ -336,11 +336,11 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) { distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z); - if (!((player->heldItemActionParam == PLAYER_AP_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) && + if (!((player->heldItemAction == PLAYER_IA_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) && (this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) { EnButte_SetupFlyAround(this); } else if (distSqFromHome > SQ(240.0f)) { - distSqFromSword = Math3D_Dist2DSq(player->swordInfo[0].tip.x, player->swordInfo[0].tip.z, + distSqFromSword = Math3D_Dist2DSq(player->meleeWeaponInfo[0].tip.x, player->meleeWeaponInfo[0].tip.z, this->actor.world.pos.x, this->actor.world.pos.z); if (distSqFromSword < SQ(60.0f)) { EnButte_SetupTransformIntoFairy(this); diff --git a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index 3e85b72a8..bfb7507cc 100644 --- a/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/soh/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -470,7 +470,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { switch (this->work[FHGFIRE_FIRE_MODE]) { case FHGFIRE_LIGHT_GREEN: canBottleReflect1 = - ((player->stateFlags1 & 2) && + ((player->stateFlags1 & PLAYER_STATE1_SWINGING_BOTTLE) && (ABS((s16)(player->actor.shape.rot.y - (s16)(bossGnd->actor.yawTowardsPlayer + 0x8000))) < 0x2000) && (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f)) @@ -510,7 +510,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { this->work[FHGFIRE_RETURN_COUNT] = 100; } - if (!canBottleReflect2 && (player->swordAnimation >= 24)) { + if (!canBottleReflect2 && (player->meleeWeaponAnimation >= 24)) { this->actor.speedXZ = 20.0f; this->work[FHGFIRE_RETURN_COUNT] = 4; } else { diff --git a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c index dff83254f..0bd71ea3b 100644 --- a/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/soh/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -320,7 +320,7 @@ void func_80A2F9C0(EnGb* this, PlayState* play) { gSaveContext.infTable[0xB] |= 0x40; } func_80A2F180(this); - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); Rupees_ChangeBy(10); this->actionFunc = func_80A2F83C; } @@ -332,7 +332,7 @@ void func_80A2FA50(EnGb* this, PlayState* play) { gSaveContext.infTable[0xB] |= 0x40; } func_80A2F180(this); - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); Rupees_ChangeBy(50); HIGH_SCORE(HS_POE_POINTS) += 100; if (HIGH_SCORE(HS_POE_POINTS) != 1000) { diff --git a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 426fd4ccd..ccb9cb7bc 100644 --- a/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/soh/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -283,7 +283,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { angleToLink = ABS(angleToLink); if (func_800354B4(play, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, play); return true; } else if (play->gameplayFrames & 1) { @@ -296,7 +296,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); return true; - } else if (player->swordAnimation == 0x11) { + } else if (player->meleeWeaponAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, play); return true; } else if ((thisx->xzDistToPlayer < 90.0f) && (play->gameplayFrames & 1)) { @@ -1138,7 +1138,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) { if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) && (ABS(this->actor.yDistToPlayer) < 50.0f)) { if (func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, play); } else if (play->gameplayFrames & 1) { EnGeldB_SetupBlock(this); @@ -1159,7 +1159,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) { } } else if ((this->timer == 0) && func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnGeldB_SetupSpinDodge(this, play); } else if (!EnGeldB_DodgeRanged(play, this)) { if ((play->gameplayFrames & 1)) { diff --git a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 5e872cff8..26d1cb3ba 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/soh/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -368,7 +368,7 @@ void EnHeishi1_Kick(EnHeishi1* this, PlayState* play) { this->loadStarted = true; sHeishi1PlayerIsCaught = false; play->fadeTransition = 0x2E; - gSaveContext.nextTransition = 0x2E; + gSaveContext.nextTransitionType = 0x2E; } } } diff --git a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 768e7ca71..f93292542 100644 --- a/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/soh/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -208,7 +208,7 @@ void func_80A55D00(EnHeishi3* this, PlayState* play) { play->sceneLoadFlag = 0x14; this->respawnFlag = 1; play->fadeTransition = 0x2E; - gSaveContext.nextTransition = 0x2E; + gSaveContext.nextTransitionType = 0x2E; } } diff --git a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c index a7b81c8f1..cf9c3fe19 100644 --- a/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/soh/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -596,7 +596,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { case 0x70F3: Rupees_ChangeBy(beggarRewards[this->actor.textId - 0x70F0]); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_17); - Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE); break; case 0x7016: gSaveContext.infTable[12] |= 1; diff --git a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index 463829dd9..95e493eee 100644 --- a/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/soh/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -180,13 +180,13 @@ void func_80A8F660(EnKakasi* this, PlayState* play) { this->unk_196 = TEXT_STATE_DONE; if (!LINK_IS_ADULT) { this->unk_194 = false; - if (gSaveContext.scarecrowCustomSongSet) { + if (gSaveContext.scarecrowLongSongSet) { this->actor.textId = 0x407A; this->unk_196 = TEXT_STATE_EVENT; } } else { this->unk_194 = true; - if (gSaveContext.scarecrowCustomSongSet) { + if (gSaveContext.scarecrowLongSongSet) { this->actor.textId = 0x4079; this->unk_196 = TEXT_STATE_EVENT; } @@ -342,7 +342,7 @@ void EnKakasi_Draw(Actor* thisx, PlayState* play) { if (BREG(3) != 0) { osSyncPrintf("\n\n"); // "flag!" - osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowCustomSongSet); + osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowLongSongSet); } func_80093D18(play->state.gfxCtx); SkelAnime_DrawFlexOpa(play, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount, diff --git a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 77cb939b4..af2c416f1 100644 --- a/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/soh/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -287,7 +287,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) { u8 i; if (hitItem->toucher.dmgFlags & 0x700) { - this->cutType = sCutTypes[player->swordAnimation]; + this->cutType = sCutTypes[player->meleeWeaponAnimation]; } else { this->cutType = CUT_POST; } diff --git a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 6ca779d41..d7fdc8c4b 100644 --- a/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/soh/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -85,7 +85,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { this->unk_1CA = 0; if (player->stateFlags2 & 0x20000) { - if (!gSaveContext.magicAcquired || gSaveContext.unk_13F0 || + if (!gSaveContext.isMagicAcquired || gSaveContext.magicState || (((this->actor.params & 0xFF00) >> 8) && !(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 0)))) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, @@ -132,7 +132,7 @@ void func_80A9F350(EnMThunder* this, PlayState* play) { Player* player = GET_PLAYER(play); if (player->stateFlags2 & 0x20000) { - if (player->swordAnimation >= 0x18) { + if (player->meleeWeaponAnimation >= 0x18) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, @@ -158,7 +158,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (this->unk_1CA == 0) { if (player->unk_858 >= 0.1f) { - if ((gSaveContext.unk_13F0) || (((this->actor.params & 0xFF00) >> 8) && + if ((gSaveContext.magicState) || (((this->actor.params & 0xFF00) >> 8) && !(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 4)))) { func_80A9F350(this, play); func_80A9EFE0(this, func_80A9F350); @@ -182,7 +182,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { } if (player->unk_858 <= 0.15f) { - if ((player->unk_858 >= 0.1f) && (player->swordAnimation >= 0x18)) { + if ((player->unk_858 >= 0.1f) && (player->meleeWeaponAnimation >= 0x18)) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, @@ -193,7 +193,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { } else { player->stateFlags2 &= ~0x20000; if ((this->actor.params & 0xFF00) >> 8) { - gSaveContext.unk_13F0 = 1; + gSaveContext.magicState = 1; } if (player->unk_858 < 0.85f) { this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7]; diff --git a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c index c73c33e99..5e10d0b9a 100644 --- a/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/soh/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -109,8 +109,8 @@ void EnMag_InitMq(Actor* thisx, PlayState* play) { gSaveContext.unk_13E7 = 0; this->globalState = MAG_STATE_DISPLAY; sDelayTimer = 20; - gSaveContext.fadeDuration = 1; - gSaveContext.unk_1419 = 255; + gSaveContext.transFadeDuration = 1; + gSaveContext.transWipeSpeed = 255; } Font_LoadOrderedFont(&this->font); @@ -199,8 +199,8 @@ void EnMag_InitVanilla(Actor* thisx, PlayState* play) { gSaveContext.unk_13E7 = 0; this->globalState = MAG_STATE_DISPLAY; sDelayTimer = 20; - gSaveContext.fadeDuration = 1; - gSaveContext.unk_1419 = 255; + gSaveContext.transFadeDuration = 1; + gSaveContext.transWipeSpeed = 255; } Font_LoadOrderedFont(&this->font); @@ -242,8 +242,8 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) { this->globalState = MAG_STATE_DISPLAY; sDelayTimer = 20; - gSaveContext.fadeDuration = 1; - gSaveContext.unk_1419 = 255; + gSaveContext.transFadeDuration = 1; + gSaveContext.transWipeSpeed = 255; } } else if (this->globalState >= MAG_STATE_DISPLAY) { if (sDelayTimer == 0) { @@ -413,8 +413,8 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) { this->globalState = MAG_STATE_DISPLAY; sDelayTimer = 20; - gSaveContext.fadeDuration = 1; - gSaveContext.unk_1419 = 255; + gSaveContext.transFadeDuration = 1; + gSaveContext.transWipeSpeed = 255; } } else if (this->globalState >= MAG_STATE_DISPLAY) { if (sDelayTimer == 0) { diff --git a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c index bbecb2505..c971f8844 100644 --- a/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/soh/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -630,7 +630,7 @@ void func_80ACB274(EnOwl* this, PlayState* play) { void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) { EnOwl_LookAtLink(this, play); - if (!gSaveContext.magicAcquired && !gSaveContext.n64ddFlag) { + if (!gSaveContext.isMagicAcquired && !gSaveContext.n64ddFlag) { if (func_80ACA558(this, play, 0x3062)) { Audio_PlayFanfare(NA_BGM_OWL); this->actionFunc = func_80ACB274; diff --git a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 2bb126290..973e2ff71 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/soh/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -349,7 +349,7 @@ void func_80AD97C8(EnPoSisters* this, PlayState* play) { f32 sp20; if (this->unk_195 == 0 || this->actionFunc != func_80ADAAA4) { - if ((player->swordState == 0 || player->swordAnimation >= 24) && + if ((player->swordState == 0 || player->meleeWeaponAnimation >= 24) && player->actor.world.pos.y - player->actor.floorHeight < 1.0f) { Math_StepToF(&this->unk_294, 110.0f, 3.0f); } else { diff --git a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c index c1d9a3a7a..975714fa0 100644 --- a/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/soh/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -479,8 +479,8 @@ void func_80AFD968(EnSkb* this, PlayState* play) { if (this->unk_283 == 0) { if ((this->actor.colChkInfo.damageEffect == 0xD) || ((this->actor.colChkInfo.damageEffect == 0xE) && - ((player->swordAnimation >= 4 && player->swordAnimation <= 11) || - (player->swordAnimation == 20 || player->swordAnimation == 21)))) { + ((player->meleeWeaponAnimation >= 4 && player->meleeWeaponAnimation <= 11) || + (player->meleeWeaponAnimation == 20 || player->meleeWeaponAnimation == 21)))) { BodyBreak_Alloc(&this->bodyBreak, 2, play); this->unk_283 = 1; } diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 151d4e84e..b50398b45 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -732,7 +732,7 @@ s32 func_80B0DFFC(EnSw* this, PlayState* play) { false, false, true, &sp5C)) { sp4C = false; } else if (((play->state.frames % 4) == 2) && - !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->unk_46C, &sp50, &sp60, true, + !BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->subCamId, &sp50, &sp60, true, false, false, true, &sp5C)) { sp4C = false; } else if (((play->state.frames % 4) == 3) && @@ -949,7 +949,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (limbIndex == 1) { Matrix_MultVec3f(&sp7C, &this->unk_454); Matrix_MultVec3f(&sp70, &this->unk_460); - Matrix_MultVec3f(&sp64, &this->unk_46C); + Matrix_MultVec3f(&sp64, &this->subCamId); Matrix_MultVec3f(&sp58, &this->unk_478); Matrix_MultVec3f(&sp4C, &this->unk_484); } diff --git a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h index c766e9f9e..0d0ae96a1 100644 --- a/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h +++ b/soh/src/overlays/actors/ovl_En_Sw/z_en_sw.h @@ -43,7 +43,7 @@ typedef struct EnSw { /* 0x0448 */ Vec3f unk_448; /* 0x0454 */ Vec3f unk_454; /* 0x0460 */ Vec3f unk_460; - /* 0x046C */ Vec3f unk_46C; + /* 0x046C */ Vec3f subCamId; /* 0x0478 */ Vec3f unk_478; /* 0x0484 */ Vec3f unk_484; /* 0x0490 */ char unk_490[0x48]; diff --git a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 7e43d16d2..93fb532eb 100644 --- a/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/soh/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -671,10 +671,10 @@ void func_80B15424(EnTa* this, PlayState* play) { if (gSaveContext.eventInf[0] & 0x100) { play->fadeTransition = 46; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } else { play->fadeTransition = 38; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; } play->sceneLoadFlag = 0x14; diff --git a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c index 025626b81..002c5540b 100644 --- a/soh/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/soh/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -496,7 +496,7 @@ void EnTest_Idle(EnTest* this, PlayState* play) { if ((player->swordState != 0) && (ABS(yawDiff) >= 0x1F40)) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (Rand_ZeroOne() > 0.7f && player->swordAnimation != 0x11) { + if (Rand_ZeroOne() > 0.7f && player->meleeWeaponAnimation != 0x11) { EnTest_SetupJumpBack(this); } else { func_808627C4(this, play); @@ -627,7 +627,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if (ABS(yawDiff) >= 0x1F40) { this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if ((Rand_ZeroOne() > 0.7f) && (player->swordAnimation != 0x11)) { + if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) { EnTest_SetupJumpBack(this); } else { EnTest_SetupStopAndBlock(this); @@ -663,7 +663,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { EnTest_SetupJumpslash(this); return; } - } else if (player->heldItemActionParam != PLAYER_AP_NONE) { + } else if (player->heldItemAction != PLAYER_IA_NONE) { if (this->actor.isTargeted) { if ((play->gameplayFrames % 2) != 0) { func_808627C4(this, play); @@ -1238,7 +1238,7 @@ void func_808621D4(EnTest* this, PlayState* play) { (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); } else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) && - (player->swordAnimation != 0x11)) { + (player->meleeWeaponAnimation != 0x11)) { EnTest_SetupJumpBack(this); } else { EnTest_SetupStopAndBlock(this); @@ -1277,7 +1277,7 @@ void func_80862418(EnTest* this, PlayState* play) { (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); } else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) && - (player->swordAnimation != 0x11)) { + (player->meleeWeaponAnimation != 0x11)) { EnTest_SetupJumpBack(this); } else { EnTest_SetupStopAndBlock(this); @@ -1323,7 +1323,7 @@ void EnTest_Stunned(EnTest* this, PlayState* play) { ((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) && (this->actor.xzDistToPlayer < 80.0f))) { EnTest_SetupJumpUp(this); - } else if ((Rand_ZeroOne() > 0.7f) && (player->swordAnimation != 0x11)) { + } else if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) { EnTest_SetupJumpBack(this); } else { EnTest_SetupStopAndBlock(this); @@ -1459,7 +1459,7 @@ void func_808628C8(EnTest* this, PlayState* play) { if (!EnTest_ReactToProjectile(play, this)) { EnTest_ChooseAction(this, play); } - } else if (player->heldItemActionParam != PLAYER_AP_NONE) { + } else if (player->heldItemAction != PLAYER_IA_NONE) { if ((play->gameplayFrames % 2) != 0) { EnTest_SetupIdle(this); } else { diff --git a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 7f24cc4e6..d5a8209df 100644 --- a/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/soh/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -128,16 +128,16 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) { sInput.cur.button = sInput.press.button = sInput.rel.button = 0; sInput.cur.stick_x = sInput.cur.stick_y = 0; this->currentShield = PLAYER_SHIELD_HYLIAN; - this->heldItemActionParam = this->heldItemId = PLAYER_AP_SWORD_MASTER; + this->heldItemAction = this->heldItemId = PLAYER_IA_SWORD_MASTER; Player_SetModelGroup(this, 2); play->playerInit(this, play, &gDarkLinkSkel); this->actor.naviEnemyId = 0x26; this->cylinder.base.acFlags = AC_ON | AC_TYPE_PLAYER; - this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY; - this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; - this->swordQuads[0].base.colType = this->swordQuads[1].base.colType = COLTYPE_METAL; - this->swordQuads[0].info.toucher.damage = this->swordQuads[1].info.toucher.damage = 8; - this->swordQuads[0].info.bumperFlags = this->swordQuads[1].info.bumperFlags = BUMP_ON; + this->meleeWeaponQuads[0].base.atFlags = this->meleeWeaponQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY; + this->meleeWeaponQuads[0].base.acFlags = this->meleeWeaponQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; + this->meleeWeaponQuads[0].base.colType = this->meleeWeaponQuads[1].base.colType = COLTYPE_METAL; + this->meleeWeaponQuads[0].info.toucher.damage = this->meleeWeaponQuads[1].info.toucher.damage = 8; + this->meleeWeaponQuads[0].info.bumperFlags = this->meleeWeaponQuads[1].info.bumperFlags = BUMP_ON; this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY; this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER; this->actor.colChkInfo.damageTable = &sDamageTable; @@ -162,11 +162,11 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) { s32 pad; Player* this = (Player*)thisx; - Effect_Delete(play, this->swordEffectIndex); + Effect_Delete(play, this->meleeWeaponEffectIndex); func_800F5B58(); Collider_DestroyCylinder(play, &this->cylinder); - Collider_DestroyQuad(play, &this->swordQuads[0]); - Collider_DestroyQuad(play, &this->swordQuads[1]); + Collider_DestroyQuad(play, &this->meleeWeaponQuads[0]); + Collider_DestroyQuad(play, &this->meleeWeaponQuads[1]); Collider_DestroyQuad(play, &this->shieldQuad); } @@ -280,16 +280,16 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Handles Dark Link's sword clanking on Link's sword - if ((this->swordQuads[0].base.acFlags & AC_BOUNCED) || (this->swordQuads[1].base.acFlags & AC_BOUNCED)) { - this->swordQuads[0].base.acFlags &= ~AC_BOUNCED; - this->swordQuads[1].base.acFlags &= ~AC_BOUNCED; - this->swordQuads[0].base.atFlags |= AT_BOUNCED; - this->swordQuads[1].base.atFlags |= AT_BOUNCED; + if ((this->meleeWeaponQuads[0].base.acFlags & AC_BOUNCED) || (this->meleeWeaponQuads[1].base.acFlags & AC_BOUNCED)) { + this->meleeWeaponQuads[0].base.acFlags &= ~AC_BOUNCED; + this->meleeWeaponQuads[1].base.acFlags &= ~AC_BOUNCED; + this->meleeWeaponQuads[0].base.atFlags |= AT_BOUNCED; + this->meleeWeaponQuads[1].base.atFlags |= AT_BOUNCED; this->cylinder.base.acFlags &= ~AC_HIT; - if (sLastSwordAnim != this->swordAnimation) { + if (sLastSwordAnim != this->meleeWeaponAnimation) { sStaggerCount++; - sLastSwordAnim = this->swordAnimation; + sLastSwordAnim = this->meleeWeaponAnimation; } /*! @bug * This code is needed to reset sCounterState, and should run regardless @@ -304,8 +304,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } } if ((sCounterState != 0) && (this->swordState != 0)) { - CollisionCheck_SetAC(play, &play->colChkCtx, &this->swordQuads[0].base); - CollisionCheck_SetAC(play, &play->colChkCtx, &this->swordQuads[1].base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->meleeWeaponQuads[0].base); + CollisionCheck_SetAC(play, &play->colChkCtx, &this->meleeWeaponQuads[1].base); } // Ignores hits when jumping on Link's sword @@ -328,7 +328,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Handles Dark Link's initial reaction to jumpslashes if (((player->swordState != 0) || (player->actor.velocity.y > -3.0f)) && - (player->swordAnimation == JUMPSLASH_START)) { + (player->meleeWeaponAnimation == JUMPSLASH_START)) { this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (play->gameplayFrames % 2) { @@ -382,13 +382,13 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Handles Dark Link's reaction to sword attack other than jumpslashes if (func_800354B4(play, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.world.rot.y)) { - if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) { + if ((player->meleeWeaponAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) { // Handles the reaction to a one-handed stab. If the conditions are satisfied, // Dark Link jumps on Link's sword. Otherwise he backflips away. if ((this->swordState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) && - (player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) && + (player->meleeWeaponAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) && Actor_IsTargeted(play, &this->actor)) { sStickTilt = 0.0f; @@ -414,17 +414,17 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sStickAngle = thisx->yawTowardsPlayer; input->cur.button = BTN_B; - if (player->swordAnimation <= FORWARD_COMBO_2H) { + if (player->meleeWeaponAnimation <= FORWARD_COMBO_2H) { sStickTilt = 0.0f; - } else if (player->swordAnimation <= RIGHT_COMBO_2H) { + } else if (player->meleeWeaponAnimation <= RIGHT_COMBO_2H) { sStickTilt = 127.0f; sStickAngle += 0x4000; - } else if (player->swordAnimation <= LEFT_COMBO_2H) { + } else if (player->meleeWeaponAnimation <= LEFT_COMBO_2H) { sStickTilt = 127.0f; sStickAngle -= 0x4000; - } else if (player->swordAnimation <= HAMMER_SIDE) { + } else if (player->meleeWeaponAnimation <= HAMMER_SIDE) { input->cur.button = BTN_R; - } else if (player->swordAnimation <= BIG_SPIN_2H) { + } else if (player->meleeWeaponAnimation <= BIG_SPIN_2H) { EnTorch2_Backflip(this, input, &this->actor); } else { EnTorch2_Backflip(this, input, &this->actor); @@ -457,8 +457,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { - if ((player->swordState == 0) || (player->swordAnimation < SPIN_ATTACK_1H) || - (player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToPlayer >= 280.0f)) { + if ((player->swordState == 0) || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) || + (player->meleeWeaponAnimation > BIG_SPIN_2H) || (this->actor.xzDistToPlayer >= 280.0f)) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; if (!this->actor.isTargeted) { @@ -557,8 +557,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { // Causes Dark Link to shield in place when Link is using magic attacks other than the spin attack - if ((gSaveContext.unk_13F0 == 3) && (player->swordState == 0 || (player->swordAnimation < SPIN_ATTACK_1H) || - (player->swordAnimation > BIG_SPIN_2H))) { + if ((gSaveContext.magicState == 3) && (player->swordState == 0 || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) || + (player->meleeWeaponAnimation > BIG_SPIN_2H))) { sStickTilt = 0.0f; input->cur.stick_x = 0; input->cur.stick_y = 0; @@ -589,12 +589,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { if ((this->actor.colChkInfo.health == 0) && sDeathFlag) { this->csMode = 0x18; this->unk_448 = &player->actor; - this->unk_46A = 1; + this->doorBgCamIndex = 1; sDeathFlag = false; } if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) && (this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & 0x04000000) && - !(this->swordQuads[0].base.atFlags & AT_HIT) && !(this->swordQuads[1].base.atFlags & AT_HIT)) { + !(this->meleeWeaponQuads[0].base.atFlags & AT_HIT) && !(this->meleeWeaponQuads[1].base.atFlags & AT_HIT)) { if (!Actor_ApplyDamage(&this->actor)) { func_800F5B58(); @@ -704,8 +704,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->skelAnime.curFrame = player->skelAnime.curFrame - player->skelAnime.playSpeed; this->skelAnime.playSpeed = player->skelAnime.playSpeed; LinkAnimation_Update(play, &this->skelAnime); - Collider_ResetQuadAT(play, &this->swordQuads[0].base); - Collider_ResetQuadAT(play, &this->swordQuads[1].base); + Collider_ResetQuadAT(play, &this->meleeWeaponQuads[0].base); + Collider_ResetQuadAT(play, &this->meleeWeaponQuads[1].base); } } if (sStaggerTimer != 0) { diff --git a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c index fa3701dd6..478cd036d 100644 --- a/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/soh/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -294,7 +294,7 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { playerYawDiff = ABS(playerYawDiff); if (func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x2EE0, this->actor.shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnWf_SetupBlocking(this); return true; } @@ -311,7 +311,7 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { if ((this->actor.bgCheckFlags & 8) && (ABS(wallYawDiff) < 0x2EE0) && (this->actor.xzDistToPlayer < 120.0f)) { EnWf_SetupSomersaultAndAttack(this); return true; - } else if (player->swordAnimation == 0x11) { + } else if (player->meleeWeaponAnimation == 0x11) { EnWf_SetupBlocking(this); return true; } else if ((this->actor.xzDistToPlayer < 80.0f) && (play->gameplayFrames % 2) != 0) { @@ -1021,7 +1021,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) { if ((ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer < 60.0f) && (ABS(this->actor.yDistToPlayer) < 50.0f)) { if (func_800354B4(play, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnWf_SetupBlocking(this); } else if ((play->gameplayFrames % 2) != 0) { EnWf_SetupBlocking(this); @@ -1044,7 +1044,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) { } } else if (this->actionTimer == 0) { if (func_800354B4(play, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) { - if (player->swordAnimation == 0x11) { + if (player->meleeWeaponAnimation == 0x11) { EnWf_SetupBlocking(this); } else if ((play->gameplayFrames % 2) != 0) { EnWf_SetupBlocking(this); diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index fc77c5695..c881f2705 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -1808,7 +1808,7 @@ void func_80B5772C(EnZl3* this, PlayState* play) { } void func_80B57754(EnZl3* this, PlayState* play) { - if (gSaveContext.unk_13F0 == 0) { + if (gSaveContext.magicState == 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_OCEFF_WIPE4, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1); func_80B56DA4(this); diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index 8e07c56d4..b13333bca 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -5122,7 +5122,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) { Player* player = GET_PLAYER(play); if (gSaveContext.temporaryWeapon) { - player->currentSwordItem = ITEM_NONE; + player->currentSwordItemId = ITEM_NONE; gSaveContext.equips.buttonItems[0] = ITEM_NONE; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE); gSaveContext.temporaryWeapon = false; diff --git a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c index 73b31a90f..87231ec94 100644 --- a/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c +++ b/soh/src/overlays/actors/ovl_Item_Ocarina/z_item_ocarina.c @@ -175,7 +175,7 @@ void ItemOcarina_StartSoTCutscene(ItemOcarina* this, PlayState* play) { } else { play->sceneLoadFlag = 0x14; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; play->nextEntranceIndex = 0x050F; gSaveContext.nextCutsceneIndex = 0; } diff --git a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index f887d18c6..b8b6f5258 100644 --- a/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/soh/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -176,8 +176,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { if (dmgFlags & 0x20820) { interactionType = 1; } - } else if (player->heldItemActionParam == PLAYER_AP_STICK) { - Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame); + } else if (player->heldItemAction == PLAYER_IA_STICK) { + Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &this->actor.world.pos, &tipToFlame); tipToFlame.y -= 67.0f; if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) { interactionType = -1; diff --git a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c index f2a0a2221..47ab5bb47 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c +++ b/soh/src/overlays/actors/ovl_Oceff_Spot/z_oceff_spot.c @@ -72,7 +72,7 @@ void OceffSpot_Destroy(Actor* thisx, PlayState* play) { LightContext_RemoveLight(play, &play->lightCtx, this->lightNode2); func_800876C8(play); if ((gSaveContext.nayrusLoveTimer != 0) && (play->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } } diff --git a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 852d85dc7..d7a26ec7b 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/soh/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -62,7 +62,7 @@ void OceffStorm_Destroy(Actor* thisx, PlayState* play) { func_800876C8(play); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } } diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index 4234f3cb2..20418881a 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -42,7 +42,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play) { func_800876C8(play); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } } diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c index 634f58a38..bec266db4 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe2/z_oceff_wipe2.c @@ -42,7 +42,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play) { func_800876C8(play); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } } diff --git a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c index 09a5a5aaf..3638b31b2 100644 --- a/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c +++ b/soh/src/overlays/actors/ovl_Oceff_Wipe3/z_oceff_wipe3.c @@ -45,7 +45,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play) { func_800876C8(play); if (gSaveContext.nayrusLoveTimer != 0) { - player->stateFlags3 |= 0x40; + player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } } diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index ab26ee623..3190e5eeb 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -980,77 +980,77 @@ static u8 D_80853E7C[] = { // Used to map item IDs to action params static s8 sItemActionParams[] = { - PLAYER_AP_STICK, - PLAYER_AP_NUT, - PLAYER_AP_BOMB, - PLAYER_AP_BOW, - PLAYER_AP_BOW_FIRE, - PLAYER_AP_DINS_FIRE, - PLAYER_AP_SLINGSHOT, - PLAYER_AP_OCARINA_FAIRY, - PLAYER_AP_OCARINA_TIME, - PLAYER_AP_BOMBCHU, - PLAYER_AP_HOOKSHOT, - PLAYER_AP_LONGSHOT, - PLAYER_AP_BOW_ICE, - PLAYER_AP_FARORES_WIND, - PLAYER_AP_BOOMERANG, - PLAYER_AP_LENS, - PLAYER_AP_BEAN, - PLAYER_AP_HAMMER, - PLAYER_AP_BOW_LIGHT, - PLAYER_AP_NAYRUS_LOVE, - PLAYER_AP_BOTTLE, - PLAYER_AP_BOTTLE_POTION_RED, - PLAYER_AP_BOTTLE_POTION_GREEN, - PLAYER_AP_BOTTLE_POTION_BLUE, - PLAYER_AP_BOTTLE_FAIRY, - PLAYER_AP_BOTTLE_FISH, - PLAYER_AP_BOTTLE_MILK, - PLAYER_AP_BOTTLE_LETTER, - PLAYER_AP_BOTTLE_FIRE, - PLAYER_AP_BOTTLE_BUG, - PLAYER_AP_BOTTLE_BIG_POE, - PLAYER_AP_BOTTLE_MILK_HALF, - PLAYER_AP_BOTTLE_POE, - PLAYER_AP_WEIRD_EGG, - PLAYER_AP_CHICKEN, - PLAYER_AP_LETTER_ZELDA, - PLAYER_AP_MASK_KEATON, - PLAYER_AP_MASK_SKULL, - PLAYER_AP_MASK_SPOOKY, - PLAYER_AP_MASK_BUNNY, - PLAYER_AP_MASK_GORON, - PLAYER_AP_MASK_ZORA, - PLAYER_AP_MASK_GERUDO, - PLAYER_AP_MASK_TRUTH, - PLAYER_AP_SWORD_MASTER, - PLAYER_AP_POCKET_EGG, - PLAYER_AP_POCKET_CUCCO, - PLAYER_AP_COJIRO, - PLAYER_AP_ODD_MUSHROOM, - PLAYER_AP_ODD_POTION, - PLAYER_AP_SAW, - PLAYER_AP_SWORD_BROKEN, - PLAYER_AP_PRESCRIPTION, - PLAYER_AP_FROG, - PLAYER_AP_EYEDROPS, - PLAYER_AP_CLAIM_CHECK, - PLAYER_AP_BOW_FIRE, - PLAYER_AP_BOW_ICE, - PLAYER_AP_BOW_LIGHT, - PLAYER_AP_SWORD_KOKIRI, - PLAYER_AP_SWORD_MASTER, - PLAYER_AP_SWORD_BGS, - PLAYER_AP_SHIELD_DEKU, - PLAYER_AP_SHIELD_HYLIAN, - PLAYER_AP_SHIELD_MIRROR, - PLAYER_AP_TUNIC_KOKIRI, - PLAYER_AP_TUNIC_GORON, - PLAYER_AP_TUNIC_ZORA, - PLAYER_AP_BOOTS_KOKIRI, - PLAYER_AP_BOOTS_IRON, - PLAYER_AP_BOOTS_HOVER, + PLAYER_IA_STICK, + PLAYER_IA_NUT, + PLAYER_IA_BOMB, + PLAYER_IA_BOW, + PLAYER_IA_BOW_FIRE, + PLAYER_IA_DINS_FIRE, + PLAYER_IA_SLINGSHOT, + PLAYER_IA_OCARINA_FAIRY, + PLAYER_IA_OCARINA_TIME, + PLAYER_IA_BOMBCHU, + PLAYER_IA_HOOKSHOT, + PLAYER_IA_LONGSHOT, + PLAYER_IA_BOW_ICE, + PLAYER_IA_FARORES_WIND, + PLAYER_IA_BOOMERANG, + PLAYER_IA_LENS, + PLAYER_IA_BEAN, + PLAYER_IA_HAMMER, + PLAYER_IA_BOW_LIGHT, + PLAYER_IA_NAYRUS_LOVE, + PLAYER_IA_BOTTLE, + PLAYER_IA_BOTTLE_POTION_RED, + PLAYER_IA_BOTTLE_POTION_GREEN, + PLAYER_IA_BOTTLE_POTION_BLUE, + PLAYER_IA_BOTTLE_FAIRY, + PLAYER_IA_BOTTLE_FISH, + PLAYER_IA_BOTTLE_MILK, + PLAYER_IA_BOTTLE_LETTER, + PLAYER_IA_BOTTLE_FIRE, + PLAYER_IA_BOTTLE_BUG, + PLAYER_IA_BOTTLE_BIG_POE, + PLAYER_IA_BOTTLE_MILK_HALF, + PLAYER_IA_BOTTLE_POE, + PLAYER_IA_WEIRD_EGG, + PLAYER_IA_CHICKEN, + PLAYER_IA_LETTER_ZELDA, + PLAYER_IA_MASK_KEATON, + PLAYER_IA_MASK_SKULL, + PLAYER_IA_MASK_SPOOKY, + PLAYER_IA_MASK_BUNNY, + PLAYER_IA_MASK_GORON, + PLAYER_IA_MASK_ZORA, + PLAYER_IA_MASK_GERUDO, + PLAYER_IA_MASK_TRUTH, + PLAYER_IA_SWORD_MASTER, + PLAYER_IA_POCKET_EGG, + PLAYER_IA_POCKET_CUCCO, + PLAYER_IA_COJIRO, + PLAYER_IA_ODD_MUSHROOM, + PLAYER_IA_ODD_POTION, + PLAYER_IA_SAW, + PLAYER_IA_SWORD_BROKEN, + PLAYER_IA_PRESCRIPTION, + PLAYER_IA_FROG, + PLAYER_IA_EYEDROPS, + PLAYER_IA_CLAIM_CHECK, + PLAYER_IA_BOW_FIRE, + PLAYER_IA_BOW_ICE, + PLAYER_IA_BOW_LIGHT, + PLAYER_IA_SWORD_KOKIRI, + PLAYER_IA_SWORD_MASTER, + PLAYER_IA_SWORD_BGS, + PLAYER_IA_SHIELD_DEKU, + PLAYER_IA_SHIELD_HYLIAN, + PLAYER_IA_SHIELD_MIRROR, + PLAYER_IA_TUNIC_KOKIRI, + PLAYER_IA_TUNIC_GORON, + PLAYER_IA_TUNIC_ZORA, + PLAYER_IA_BOOTS_KOKIRI, + PLAYER_IA_BOOTS_IRON, + PLAYER_IA_BOOTS_HOVER, }; static u8 sMaskMemory; @@ -1317,17 +1317,17 @@ void func_808322FC(Player* this) { void func_80832318(Player* this) { this->stateFlags2 &= ~PLAYER_STATE2_17; this->swordState = 0; - this->swordInfo[0].active = this->swordInfo[1].active = this->swordInfo[2].active = 0; + this->meleeWeaponInfo[0].active = this->meleeWeaponInfo[1].active = this->meleeWeaponInfo[2].active = 0; } void func_80832340(PlayState* play, Player* this) { Camera* camera; - if (this->unk_46C != SUBCAM_NONE) { - camera = play->cameraPtrs[this->unk_46C]; + if (this->subCamId != SUBCAM_NONE) { + camera = play->cameraPtrs[this->subCamId]; if ((camera != NULL) && (camera->csId == 1100)) { - OnePointCutscene_EndCutscene(play, this->unk_46C); - this->unk_46C = SUBCAM_NONE; + OnePointCutscene_EndCutscene(play, this->subCamId); + this->subCamId = SUBCAM_NONE; } } @@ -1346,7 +1346,7 @@ void func_808323B4(PlayState* play, Player* this) { } if (Player_GetExplosiveHeld(this) >= 0) { - func_8083399C(play, this, PLAYER_AP_NONE); + func_8083399C(play, this, PLAYER_IA_NONE); this->heldItemId = ITEM_NONE_FE; } } @@ -1370,7 +1370,7 @@ void func_80832440(PlayState* play, Player* this) { func_8005B1A4(Play_GetCamera(play, 0)); this->stateFlags1 &= ~(PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_20 | PLAYER_STATE1_21); - this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_18); + this->stateFlags2 &= ~(PLAYER_STATE2_4 | PLAYER_STATE2_7 | PLAYER_STATE2_CRAWLING); this->actor.shape.rot.x = 0; this->actor.shape.yOffset = 0.0f; @@ -1379,7 +1379,7 @@ void func_80832440(PlayState* play, Player* this) { } s32 func_80832528(PlayState* play, Player* this) { - if (this->heldItemActionParam >= PLAYER_AP_FISHING_POLE) { + if (this->heldItemAction >= PLAYER_IA_FISHING_POLE) { func_80835F44(play, this, ITEM_NONE); return 1; } else { @@ -1463,7 +1463,7 @@ void func_808327F8(Player* this, f32 arg1) { // Gameplay stats: Count footsteps // Only count while game isn't complete and don't count Link's idle animations or crawling in crawlspaces if (!gSaveContext.sohStats.gameComplete && !(this->stateFlags2 & PLAYER_STATE2_28) && - !(this->stateFlags2 & PLAYER_STATE2_18)) { + !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) { gSaveContext.sohStats.count[COUNT_STEPS]++; } } @@ -1832,11 +1832,11 @@ void func_80833664(PlayState* play, Player* this, s8 actionParam) { s8 Player_ItemToActionParam(s32 item) { if (item >= ITEM_NONE_FE) { - return PLAYER_AP_NONE; + return PLAYER_IA_NONE; } else if (item == ITEM_LAST_USED) { - return PLAYER_AP_LAST_USED; + return PLAYER_IA_LAST_USED; } else if (item == ITEM_FISHING_POLE) { - return PLAYER_AP_FISHING_POLE; + return PLAYER_IA_FISHING_POLE; } else { return sItemActionParams[item]; } @@ -1855,7 +1855,7 @@ void func_80833790(PlayState* play, Player* this) { void func_8083379C(PlayState* play, Player* this) { this->stateFlags1 |= PLAYER_STATE1_3; - if (this->heldItemActionParam != PLAYER_AP_SLINGSHOT) { + if (this->heldItemAction != PLAYER_IA_SLINGSHOT) { this->unk_860 = -1; } else { this->unk_860 = -2; @@ -1917,7 +1917,7 @@ void func_8083399C(PlayState* play, Player* this, s8 actionParam) { this->unk_85C = 0.0f; this->unk_858 = 0.0f; - this->heldItemActionParam = this->itemActionParam = actionParam; + this->heldItemAction = this->itemAction = actionParam; this->modelGroup = this->nextModelGroup; this->stateFlags1 &= ~(PLAYER_STATE1_3 | PLAYER_STATE1_24); @@ -1932,16 +1932,16 @@ void func_80833A20(Player* this, s32 newSwordState) { u16 voiceSfx; if (this->swordState == 0) { - if ((this->heldItemActionParam == PLAYER_AP_SWORD_BGS) && (gSaveContext.swordHealth > 0.0f)) { + if ((this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth > 0.0f)) { itemSfx = NA_SE_IT_HAMMER_SWING; } else { itemSfx = NA_SE_IT_SWORD_SWING; } voiceSfx = NA_SE_VO_LI_SWORD_N; - if (this->heldItemActionParam == PLAYER_AP_HAMMER) { + if (this->heldItemAction == PLAYER_IA_HAMMER) { itemSfx = NA_SE_IT_HAMMER_SWING; - } else if (this->swordAnimation >= 0x18) { + } else if (this->meleeWeaponAnimation >= 0x18) { itemSfx = 0; voiceSfx = NA_SE_VO_LI_SWORD_L; } else if (this->unk_845 >= 3) { @@ -1953,11 +1953,11 @@ void func_80833A20(Player* this, s32 newSwordState) { func_808328EC(this, itemSfx); } - if ((this->swordAnimation < 0x10) || (this->swordAnimation >= 0x14)) { + if ((this->meleeWeaponAnimation < 0x10) || (this->meleeWeaponAnimation >= 0x14)) { func_80832698(this, voiceSfx); } - if (this->heldItemActionParam >= PLAYER_AP_SWORD_MASTER && this->heldItemActionParam <= PLAYER_AP_SWORD_BGS) { + if (this->heldItemAction >= PLAYER_IA_SWORD_MASTER && this->heldItemAction <= PLAYER_IA_SWORD_BGS) { gSaveContext.sohStats.count[COUNT_SWORD_SWINGS]++; } } @@ -2002,7 +2002,7 @@ void func_80833C3C(Player* this) { } s32 func_80833C50(Player* this, s32 item) { - if ((item < ITEM_NONE_FE) && (Player_ItemToActionParam(item) == this->itemActionParam)) { + if ((item < ITEM_NONE_FE) && (Player_ItemToActionParam(item) == this->itemAction)) { return 1; } else { return 0; @@ -2063,7 +2063,7 @@ void func_80833DF8(Player* this, PlayState* play) { func_808328EC(this, NA_SE_PL_CHANGE_ARMS); } } else { - maskActionParam = this->currentMask - 1 + PLAYER_AP_MASK_KEATON; + maskActionParam = this->currentMask - 1 + PLAYER_IA_MASK_KEATON; bool hasOnDpad = false; if (CVar_GetS32("gDpadEquips", 0) != 0) { for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) { @@ -2078,7 +2078,7 @@ void func_80833DF8(Player* this, PlayState* play) { } if (!(this->stateFlags1 & (PLAYER_STATE1_11 | PLAYER_STATE1_29)) && !func_8008F128(this)) { - if (this->itemActionParam >= PLAYER_AP_FISHING_POLE) { + if (this->itemAction >= PLAYER_IA_FISHING_POLE) { bool hasOnDpad = false; if (CVar_GetS32("gDpadEquips", 0) != 0) { for (int buttonIndex = 0; buttonIndex < 4; buttonIndex++) { @@ -2107,7 +2107,7 @@ void func_80833DF8(Player* this, PlayState* play) { } item = func_80833CDC(play, i); - if ((item < ITEM_NONE_FE) && (Player_ItemToActionParam(item) == this->heldItemActionParam)) { + if ((item < ITEM_NONE_FE) && (Player_ItemToActionParam(item) == this->heldItemAction)) { D_80853618 = true; } } else { @@ -2132,10 +2132,10 @@ void func_808340DC(Player* this, PlayState* play) { nextAnimType = gPlayerModelTypes[this->nextModelGroup][PLAYER_MODELGROUPENTRY_ANIM]; sp38 = D_80854164[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType]; - if ((sp37 == PLAYER_AP_BOTTLE) || (sp37 == PLAYER_AP_BOOMERANG) || - ((sp37 == PLAYER_AP_NONE) && - ((this->heldItemActionParam == PLAYER_AP_BOTTLE) || (this->heldItemActionParam == PLAYER_AP_BOOMERANG)))) { - sp38 = (sp37 == PLAYER_AP_NONE) ? -PLAYER_D_808540F4_13 : PLAYER_D_808540F4_13; + if ((sp37 == PLAYER_IA_BOTTLE) || (sp37 == PLAYER_IA_BOOMERANG) || + ((sp37 == PLAYER_IA_NONE) && + ((this->heldItemAction == PLAYER_IA_BOTTLE) || (this->heldItemAction == PLAYER_IA_BOOMERANG)))) { + sp38 = (sp37 == PLAYER_IA_NONE) ? -PLAYER_D_808540F4_13 : PLAYER_D_808540F4_13; } this->unk_15A = ABS(sp38); @@ -2157,7 +2157,7 @@ void func_808340DC(Player* this, PlayState* play) { startFrame = frameCount; } - if (sp37 != PLAYER_AP_NONE) { + if (sp37 != PLAYER_IA_NONE) { playSpeed *= 2.0f; } @@ -2168,7 +2168,7 @@ void func_808340DC(Player* this, PlayState* play) { void func_80834298(Player* this, PlayState* play) { if ((this->actor.category == ACTORCAT_PLAYER) && !(this->stateFlags1 & PLAYER_STATE1_8) && - ((this->heldItemActionParam == this->itemActionParam) || (this->stateFlags1 & PLAYER_STATE1_22)) && + ((this->heldItemAction == this->itemAction) || (this->stateFlags1 & PLAYER_STATE1_22)) && (gSaveContext.health != 0) && (play->csCtx.state == CS_STATE_IDLE) && (this->csMode == 0) && (play->shootingGalleryStatus == 0) && (play->activeCamera == MAIN_CAM) && (play->sceneLoadFlag != 0x14) && (gSaveContext.timer1State != 10)) { @@ -2187,7 +2187,7 @@ s32 func_80834380(PlayState* play, Player* this, s32* itemPtr, s32* typePtr) { if (this->stateFlags1 & PLAYER_STATE1_23) { *typePtr = ARROW_NORMAL_HORSE; } else { - *typePtr = this->heldItemActionParam - 6; + *typePtr = this->heldItemAction - 6; } } else { *itemPtr = ITEM_SLINGSHOT; @@ -2209,8 +2209,8 @@ s32 func_8083442C(Player* this, PlayState* play) { s32 arrowType; s32 magicArrowType; - if ((this->heldItemActionParam >= PLAYER_AP_BOW_FIRE) && (this->heldItemActionParam <= PLAYER_AP_BOW_0E) && - (gSaveContext.unk_13F0 != 0)) { + if ((this->heldItemAction >= PLAYER_IA_BOW_FIRE) && (this->heldItemAction <= PLAYER_IA_BOW_0E) && + (gSaveContext.magicState != 0)) { func_80078884(NA_SE_SY_ERROR); } else { func_80833638(this, func_808351D4); @@ -2244,8 +2244,8 @@ s32 func_8083442C(Player* this, PlayState* play) { } void func_80834594(PlayState* play, Player* this) { - if (this->heldItemActionParam != PLAYER_AP_NONE) { - if (func_8008F2BC(this, this->heldItemActionParam) >= 0) { + if (this->heldItemAction != PLAYER_IA_NONE) { + if (func_8008F2BC(this, this->heldItemAction) >= 0) { func_808328EC(this, NA_SE_IT_SWORD_PUTAWAY); } else { func_808328EC(this, NA_SE_PL_CHANGE_ARMS); @@ -2254,9 +2254,9 @@ void func_80834594(PlayState* play, Player* this) { func_80835F44(play, this, this->heldItemId); - if (func_8008F2BC(this, this->heldItemActionParam) >= 0) { + if (func_8008F2BC(this, this->heldItemAction) >= 0) { func_808328EC(this, NA_SE_IT_SWORD_PICKOUT); - } else if (this->heldItemActionParam != PLAYER_AP_NONE) { + } else if (this->heldItemAction != PLAYER_IA_NONE) { func_808328EC(this, NA_SE_PL_CHANGE_ARMS); } } @@ -2266,7 +2266,7 @@ void func_80834644(PlayState* play, Player* this) { func_80834594(play, this); } - func_80833638(this, D_80853EDC[this->heldItemActionParam]); + func_80833638(this, D_80853EDC[this->heldItemAction]); this->unk_834 = 0; this->unk_6AC = 0; func_808323B4(play, this); @@ -2279,10 +2279,10 @@ LinkAnimationHeader* func_808346C4(PlayState* play, Player* this) { if (this->unk_870 < 0.5f) { return D_808543A4[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } else { return D_808543AC[Player_HoldsTwoHandedWeapon(this) && - !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK))]; + !(CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK))]; } } @@ -2291,7 +2291,7 @@ s32 func_80834758(PlayState* play, Player* this) { f32 frame; if (!(this->stateFlags1 & (PLAYER_STATE1_22 | PLAYER_STATE1_23 | PLAYER_STATE1_29)) && - (play->shootingGalleryStatus == 0) && (this->heldItemActionParam == this->itemActionParam) && + (play->shootingGalleryStatus == 0) && (this->heldItemAction == this->itemAction) && (this->currentShield != PLAYER_SHIELD_NONE) && !Player_IsChildWithHylianShield(this) && func_80833BCC(this) && CHECK_BTN_ALL(sControlInput->cur.button, BTN_R)) { @@ -2317,7 +2317,7 @@ s32 func_8083485C(Player* this, PlayState* play) { void func_80834894(Player* this) { func_80833638(this, func_80834C74); - if (this->itemActionParam < 0) { + if (this->itemAction < 0) { func_8008EC70(this); } @@ -2359,10 +2359,10 @@ s32 func_808349DC(Player* this, PlayState* play) { s32 func_80834A2C(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime2) || - ((Player_ItemToActionParam(this->heldItemId) == this->heldItemActionParam) && + ((Player_ItemToActionParam(this->heldItemId) == this->heldItemAction) && (D_80853614 = (D_80853614 || ((this->modelAnimType != PLAYER_ANIMTYPE_3) && (play->shootingGalleryStatus == 0)))))) { - func_80833638(this, D_80853EDC[this->heldItemActionParam]); + func_80833638(this, D_80853EDC[this->heldItemAction]); this->unk_834 = 0; this->unk_6AC = 0; D_80853618 = D_80853614; @@ -2413,7 +2413,7 @@ s32 func_80834C74(Player* this, PlayState* play) { D_80853614 = D_80853618; if (D_80853614 || LinkAnimation_Update(play, &this->skelAnime2)) { - func_80833638(this, D_80853EDC[this->heldItemActionParam]); + func_80833638(this, D_80853EDC[this->heldItemAction]); LinkAnimation_PlayLoop(play, &this->skelAnime2, D_80853914[PLAYER_ANIMGROUP_0][this->modelAnimType]); this->unk_6AC = 0; this->func_82C(this, play); @@ -2426,7 +2426,7 @@ s32 func_80834C74(Player* this, PlayState* play) { s32 func_80834D2C(Player* this, PlayState* play) { LinkAnimationHeader* anim; - if (this->heldItemActionParam != PLAYER_AP_BOOMERANG) { + if (this->heldItemAction != PLAYER_IA_BOOMERANG) { if (!func_8083442C(this, play)) { return 0; } @@ -2838,7 +2838,7 @@ s32 func_80835C58(PlayState* play, Player* this, PlayerFunc674 func, s32 flags) this->func_674 = func; - if ((this->itemActionParam != this->heldItemActionParam) && + if ((this->itemAction != this->heldItemAction) && (!(flags & 1) || !(this->stateFlags1 & PLAYER_STATE1_22))) { func_8008EC70(this); } @@ -2873,12 +2873,12 @@ void func_80835DAC(PlayState* play, Player* this, PlayerFunc674 func, s32 flags) void func_80835DE4(PlayState* play, Player* this, PlayerFunc674 func, s32 flags) { s32 temp; - if (this->itemActionParam >= 0) { - temp = this->itemActionParam; - this->itemActionParam = this->heldItemActionParam; + if (this->itemAction >= 0) { + temp = this->itemAction; + this->itemAction = this->heldItemAction; func_80835C58(play, this, func, flags); - this->itemActionParam = temp; - Player_SetModels(this, Player_ActionToModelGroup(this, this->itemActionParam)); + this->itemAction = temp; + Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } } @@ -2916,20 +2916,20 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { actionParam = Player_ItemToActionParam(item); - if (((this->heldItemActionParam == this->itemActionParam) && + if (((this->heldItemAction == this->itemAction) && (!(this->stateFlags1 & PLAYER_STATE1_22) || (Player_ActionToSword(actionParam) != 0) || - (actionParam == PLAYER_AP_NONE))) || - ((this->itemActionParam < 0) && - ((Player_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_AP_NONE)))) { + (actionParam == PLAYER_IA_NONE))) || + ((this->itemAction < 0) && + ((Player_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_IA_NONE)))) { - if ((actionParam == PLAYER_AP_NONE) || !(this->stateFlags1 & PLAYER_STATE1_27) || + if ((actionParam == PLAYER_IA_NONE) || !(this->stateFlags1 & PLAYER_STATE1_27) || ((this->actor.bgCheckFlags & 1) && - ((actionParam == PLAYER_AP_HOOKSHOT) || (actionParam == PLAYER_AP_LONGSHOT))) || - ((actionParam >= PLAYER_AP_SHIELD_DEKU) && (actionParam <= PLAYER_AP_BOOTS_HOVER))) { + ((actionParam == PLAYER_IA_HOOKSHOT) || (actionParam == PLAYER_IA_LONGSHOT))) || + ((actionParam >= PLAYER_IA_SHIELD_DEKU) && (actionParam <= PLAYER_IA_BOOTS_HOVER))) { if ((play->bombchuBowlingStatus == 0) && - (((actionParam == PLAYER_AP_STICK) && (AMMO(ITEM_STICK) == 0)) || - ((actionParam == PLAYER_AP_BEAN) && (AMMO(ITEM_BEAN) == 0)) || + (((actionParam == PLAYER_IA_STICK) && (AMMO(ITEM_STICK) == 0)) || + ((actionParam == PLAYER_IA_BEAN) && (AMMO(ITEM_BEAN) == 0)) || (temp = Player_ActionToExplosive(this, actionParam), ((temp >= 0) && ((AMMO(sExplosiveInfos[temp].itemId) == 0) || (play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) { @@ -2937,8 +2937,8 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { return; } - if (actionParam >= PLAYER_AP_BOOTS_KOKIRI) { - u16 bootsValue = actionParam - PLAYER_AP_BOOTS_KOKIRI + 1; + if (actionParam >= PLAYER_IA_BOOTS_KOKIRI) { + u16 bootsValue = actionParam - PLAYER_IA_BOOTS_KOKIRI + 1; if (CUR_EQUIP_VALUE(EQUIP_BOOTS) == bootsValue) { Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_KOKIRI + 1); } else { @@ -2950,8 +2950,8 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { return; } - if (actionParam >= PLAYER_AP_TUNIC_KOKIRI) { - u16 tunicValue = actionParam - PLAYER_AP_TUNIC_KOKIRI + 1; + if (actionParam >= PLAYER_IA_TUNIC_KOKIRI) { + u16 tunicValue = actionParam - PLAYER_IA_TUNIC_KOKIRI + 1; if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == tunicValue) { Inventory_ChangeEquipment(EQUIP_TUNIC, PLAYER_TUNIC_KOKIRI + 1); } else { @@ -2962,12 +2962,12 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { return; } - if (actionParam >= PLAYER_AP_SHIELD_DEKU) { + if (actionParam >= PLAYER_IA_SHIELD_DEKU) { // Changing shields through action commands is unimplemented return; } - if (actionParam == PLAYER_AP_LENS) { + if (actionParam == PLAYER_IA_LENS) { if (func_80087708(play, 0, 3)) { if (play->actorCtx.lensActive) { Actor_DisableLens(play); @@ -2981,7 +2981,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { return; } - if (actionParam == PLAYER_AP_NUT) { + if (actionParam == PLAYER_IA_NUT) { if (AMMO(ITEM_NUT) != 0) { func_8083C61C(play, this); } else { @@ -2992,10 +2992,10 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { temp = Player_ActionToMagicSpell(this, actionParam); if (temp >= 0) { - if (((actionParam == PLAYER_AP_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) || - ((gSaveContext.unk_13F4 != 0) && (gSaveContext.unk_13F0 == 0) && + if (((actionParam == PLAYER_IA_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) || + ((gSaveContext.magicCapacity != 0) && (gSaveContext.magicState == 0) && (gSaveContext.magic >= sMagicSpellCosts[temp]))) { - this->itemActionParam = actionParam; + this->itemAction = actionParam; this->unk_6AD = 4; } else { func_80078884(NA_SE_SY_ERROR); @@ -3003,39 +3003,39 @@ void func_80835F44(PlayState* play, Player* this, s32 item) { return; } - if (actionParam >= PLAYER_AP_MASK_KEATON) { + if (actionParam >= PLAYER_IA_MASK_KEATON) { if (this->currentMask != PLAYER_MASK_NONE) { this->currentMask = PLAYER_MASK_NONE; } else { - this->currentMask = actionParam - PLAYER_AP_MASK_KEATON + 1; + this->currentMask = actionParam - PLAYER_IA_MASK_KEATON + 1; } sMaskMemory = this->currentMask; func_808328EC(this, NA_SE_PL_CHANGE_ARMS); return; } - if (((actionParam >= PLAYER_AP_OCARINA_FAIRY) && (actionParam <= PLAYER_AP_OCARINA_TIME)) || - (actionParam >= PLAYER_AP_BOTTLE_FISH)) { + if (((actionParam >= PLAYER_IA_OCARINA_FAIRY) && (actionParam <= PLAYER_IA_OCARINA_TIME)) || + (actionParam >= PLAYER_IA_BOTTLE_FISH)) { if (!func_8008E9C4(this) || - ((actionParam >= PLAYER_AP_BOTTLE_POTION_RED) && (actionParam <= PLAYER_AP_BOTTLE_FAIRY))) { + ((actionParam >= PLAYER_IA_BOTTLE_POTION_RED) && (actionParam <= PLAYER_IA_BOTTLE_FAIRY))) { func_8002D53C(play, &play->actorCtx.titleCtx); this->unk_6AD = 4; - this->itemActionParam = actionParam; + this->itemAction = actionParam; } return; } - if ((actionParam != this->heldItemActionParam) || + if ((actionParam != this->heldItemAction) || ((this->heldActor == 0) && (Player_ActionToExplosive(this, actionParam) >= 0))) { this->nextModelGroup = Player_ActionToModelGroup(this, actionParam); nextAnimType = gPlayerModelTypes[this->nextModelGroup][PLAYER_MODELGROUPENTRY_ANIM]; - if ((this->heldItemActionParam >= 0) && (Player_ActionToMagicSpell(this, actionParam) < 0) && + if ((this->heldItemAction >= 0) && (Player_ActionToMagicSpell(this, actionParam) < 0) && (item != this->heldItemId) && (D_80854164[gPlayerModelTypes[this->modelGroup][PLAYER_MODELGROUPENTRY_ANIM]][nextAnimType] != PLAYER_D_808540F4_0) && (!CVar_GetS32("gSeparateArrows", 0) || - actionParam < PLAYER_AP_BOW || actionParam > PLAYER_AP_BOW_0E || - this->heldItemActionParam < PLAYER_AP_BOW || this->heldItemActionParam > PLAYER_AP_BOW_0E)) { + actionParam < PLAYER_IA_BOW || actionParam > PLAYER_IA_BOW_0E || + this->heldItemAction < PLAYER_IA_BOW || this->heldItemAction > PLAYER_IA_BOW_0E)) { this->heldItemId = item; this->stateFlags1 |= PLAYER_STATE1_8; } else { @@ -3092,7 +3092,7 @@ s32 func_808365C8(Player* this) { ((this->stateFlags1 & PLAYER_STATE1_8) && ((this->heldItemId == ITEM_LAST_USED) || (this->heldItemId == ITEM_NONE)))) && (!(func_80834A2C == this->func_82C) || - (Player_ItemToActionParam(this->heldItemId) == this->heldItemActionParam)); + (Player_ItemToActionParam(this->heldItemId) == this->heldItemAction)); } s32 func_80836670(Player* this, PlayState* play) { @@ -3245,7 +3245,7 @@ void func_80836BEC(Player* this, PlayState* play) { if (cond || (this->unk_66C != 0) || (this->stateFlags1 & (PLAYER_STATE1_12 | PLAYER_STATE1_25))) { if (!cond) { if (!(this->stateFlags1 & PLAYER_STATE1_25) && - ((this->heldItemActionParam != PLAYER_AP_FISHING_POLE) || (this->unk_860 == 0)) && + ((this->heldItemAction != PLAYER_IA_FISHING_POLE) || (this->unk_860 == 0)) && CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) { if (this->actor.category == ACTORCAT_PLAYER) { @@ -3476,7 +3476,7 @@ s32 func_808375D8(Player* this) { s8 temp2; s32 i; - if ((this->heldItemActionParam == PLAYER_AP_STICK) || Player_HoldsBrokenKnife(this)) { + if ((this->heldItemAction == PLAYER_IA_STICK) || Player_HoldsBrokenKnife(this)) { return 0; } @@ -3508,7 +3508,7 @@ s32 func_808375D8(Player* this) { void func_80837704(PlayState* play, Player* this) { LinkAnimationHeader* anim; - if ((this->swordAnimation >= 4) && (this->swordAnimation < 8)) { + if ((this->meleeWeaponAnimation >= 4) && (this->meleeWeaponAnimation < 8)) { anim = D_80854358[Player_HoldsTwoHandedWeapon(this)]; } else { anim = D_80854350[Player_HoldsTwoHandedWeapon(this)]; @@ -3532,7 +3532,7 @@ s32 func_80837818(Player* this) { s32 sp1C = this->unk_84B[this->unk_846]; s32 sp18; - if (this->heldItemActionParam == PLAYER_AP_HAMMER) { + if (this->heldItemAction == PLAYER_IA_HAMMER) { if (sp1C < 0) { sp1C = 0; } @@ -3557,7 +3557,7 @@ s32 func_80837818(Player* this) { } } } - if (this->heldItemActionParam == PLAYER_AP_STICK) { + if (this->heldItemAction == PLAYER_IA_STICK) { sp18 = 0; } } @@ -3570,12 +3570,12 @@ s32 func_80837818(Player* this) { } void func_80837918(Player* this, s32 quadIndex, u32 flags) { - this->swordQuads[quadIndex].info.toucher.dmgFlags = flags; + this->meleeWeaponQuads[quadIndex].info.toucher.dmgFlags = flags; if (flags == 2) { - this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD; + this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD; } else { - this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST; + this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST; } } @@ -3595,7 +3595,7 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { func_80832318(this); } - if ((arg2 != this->swordAnimation) || !(this->unk_845 < 3)) { + if ((arg2 != this->meleeWeaponAnimation) || !(this->unk_845 < 3)) { this->unk_845 = 0; } @@ -3604,7 +3604,7 @@ void func_80837948(PlayState* play, Player* this, s32 arg2) { arg2 += 2; } - this->swordAnimation = arg2; + this->meleeWeaponAnimation = arg2; func_808322D0(play, this, D_80854190[arg2].unk_00); if ((arg2 != 16) && (arg2 != 17)) { @@ -3956,18 +3956,18 @@ s32 func_808382DC(Player* this, PlayState* play) { if (this->unk_870 < 0.5f) { anim = D_808543BC[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && - (this->heldItemActionParam != PLAYER_AP_STICK))]; + (this->heldItemAction != PLAYER_IA_STICK))]; } else { anim = D_808543B4[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && - (this->heldItemActionParam != PLAYER_AP_STICK))]; + (this->heldItemAction != PLAYER_IA_STICK))]; } LinkAnimation_PlayOnce(play, &this->skelAnime2, anim); } else { func_80832264(play, this, D_808543C4[Player_HoldsTwoHandedWeapon(this) && !(CVar_GetS32("gShieldTwoHanded", 0) && - (this->heldItemActionParam != PLAYER_AP_STICK))]); + (this->heldItemAction != PLAYER_IA_STICK))]); } } @@ -3985,8 +3985,8 @@ s32 func_808382DC(Player* this, PlayState* play) { } if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & PLAYER_STATE1_26) || - (this->csMode != 0) || (this->swordQuads[0].base.atFlags & AT_HIT) || - (this->swordQuads[1].base.atFlags & AT_HIT)) { + (this->csMode != 0) || (this->meleeWeaponQuads[0].base.atFlags & AT_HIT) || + (this->meleeWeaponQuads[1].base.atFlags & AT_HIT)) { return 0; } @@ -4248,7 +4248,7 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) gSaveContext.respawnFlag = 2; play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex; play->fadeTransition = 3; - gSaveContext.nextTransition = 3; + gSaveContext.nextTransitionType = 3; } else if (play->nextEntranceIndex >= 0x7FF9) { // handle dynamic exits if (gSaveContext.n64ddFlag) { @@ -4265,14 +4265,14 @@ s32 func_80839034(PlayState* play, Player* this, CollisionPoly* poly, u32 bgId) Play_TriggerVoidOut(play); gSaveContext.respawnFlag = -2; } - gSaveContext.unk_13C3 = 1; + gSaveContext.retainWeatherMode = 1; func_800994A0(play); } play->sceneLoadFlag = 0x14; } if (!(this->stateFlags1 & (PLAYER_STATE1_23 | PLAYER_STATE1_29)) && - !(this->stateFlags2 & PLAYER_STATE2_18) && !func_808332B8(this) && + !(this->stateFlags2 & PLAYER_STATE2_CRAWLING) && !func_808332B8(this) && (temp = func_80041D4C(&play->colCtx, poly, bgId), (temp != 10)) && ((sp34 < 100) || (this->actor.bgCheckFlags & 1))) { @@ -4459,7 +4459,7 @@ s32 func_80839800(Player* this, PlayState* play) { } if (doorShutter->dyna.actor.category == ACTORCAT_DOOR) { - this->unk_46A = play->transiActorCtx.list[(u16)doorShutter->dyna.actor.params >> 10] + this->doorBgCamIndex = play->transiActorCtx.list[(u16)doorShutter->dyna.actor.params >> 10] .sides[(doorDirection > 0) ? 0 : 1] .effects; @@ -4934,7 +4934,7 @@ s32 func_8083AD4C(PlayState* play, Player* this) { s32 func_8083ADD4(PlayState* play, Player* this) { if (this->unk_6AD == 3) { func_80835C58(play, this, func_80852E14, 0); - if (this->unk_46A != 0) { + if (this->doorBgCamIndex != 0) { this->stateFlags1 |= PLAYER_STATE1_29; } func_80832318(this); @@ -4972,7 +4972,7 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) { LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_link_magic_tame, 0.83f); if (magicSpell == 5) { - this->unk_46C = OnePointCutscene_Init(play, 1100, -101, NULL, MAIN_CAM); + this->subCamId = OnePointCutscene_Init(play, 1100, -101, NULL, MAIN_CAM); } else { func_80835EA4(play, 10); } @@ -5010,7 +5010,7 @@ s32 func_8083B040(Player* this, PlayState* play) { if (!func_8083ADD4(play, this)) { if (this->unk_6AD == 4) { - sp2C = Player_ActionToMagicSpell(this, this->itemActionParam); + sp2C = Player_ActionToMagicSpell(this, this->itemAction); if (sp2C >= 0) { if ((sp2C != 3) || (gSaveContext.respawn[RESPAWN_MODE_TOP].data <= 0)) { func_8083AF44(play, this, sp2C); @@ -5025,13 +5025,13 @@ s32 func_8083B040(Player* this, PlayState* play) { return 1; } - sp2C = this->itemActionParam - PLAYER_AP_LETTER_ZELDA; + sp2C = this->itemAction - PLAYER_IA_LETTER_ZELDA; if ((sp2C >= 0) || - (sp28 = Player_ActionToBottle(this, this->itemActionParam) - 1, + (sp28 = Player_ActionToBottle(this, this->itemAction) - 1, ((sp28 >= 0) && (sp28 < 6) && - ((this->itemActionParam > PLAYER_AP_BOTTLE_POE) || + ((this->itemAction > PLAYER_IA_BOTTLE_POE) || ((this->targetActor != NULL) && - (((this->itemActionParam == PLAYER_AP_BOTTLE_POE) && (this->exchangeItemId == EXCH_ITEM_POE)) || + (((this->itemAction == PLAYER_IA_BOTTLE_POE) && (this->exchangeItemId == EXCH_ITEM_POE)) || (this->exchangeItemId == EXCH_ITEM_BLUE_FIRE))))))) { if ((play->actorCtx.titleCtx.delayTimer == 0) && (play->actorCtx.titleCtx.alpha == 0)) { @@ -5059,10 +5059,10 @@ s32 func_8083B040(Player* this, PlayState* play) { if ((targetActor != NULL) && ((this->exchangeItemId == sp2C) || (this->exchangeItemId == EXCH_ITEM_BLUE_FIRE) || ((this->exchangeItemId == EXCH_ITEM_POE) && - (this->itemActionParam == PLAYER_AP_BOTTLE_BIG_POE)) || + (this->itemAction == PLAYER_IA_BOTTLE_BIG_POE)) || ((this->exchangeItemId == EXCH_ITEM_BEAN) && - (this->itemActionParam == PLAYER_AP_BOTTLE_BUG))) && - ((this->exchangeItemId != EXCH_ITEM_BEAN) || (this->itemActionParam == PLAYER_AP_BEAN))) { + (this->itemAction == PLAYER_IA_BOTTLE_BUG))) && + ((this->exchangeItemId != EXCH_ITEM_BEAN) || (this->itemAction == PLAYER_IA_BEAN))) { if (this->exchangeItemId == EXCH_ITEM_BEAN) { Inventory_ChangeAmmo(ITEM_BEAN, -1); func_80835DE4(play, this, func_8084279C, 0); @@ -5096,7 +5096,7 @@ s32 func_8083B040(Player* this, PlayState* play) { return 1; } - sp2C = Player_ActionToBottle(this, this->itemActionParam); + sp2C = Player_ActionToBottle(this, this->itemAction); if (sp2C >= 0) { if (sp2C == 0xC) { func_80835DE4(play, this, func_8084EED8, 0); @@ -5420,7 +5420,7 @@ s32 func_8083C1DC(Player* this, PlayState* play) { if (func_8083BC7C(this, play)) { return 1; } - if ((this->unk_837 == 0) && (this->heldItemActionParam >= PLAYER_AP_SWORD_MASTER)) { + if ((this->unk_837 == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) { func_80835F44(play, this, ITEM_NONE); } else { this->stateFlags2 ^= PLAYER_STATE2_20; @@ -5501,8 +5501,8 @@ void func_8083C50C(Player* this) { s32 func_8083C544(Player* this, PlayState* play) { if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) { if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetSwordHeld(this) != 0) && (this->unk_844 == 1) && - (this->heldItemActionParam != PLAYER_AP_STICK)) { - if ((this->heldItemActionParam != PLAYER_AP_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) { + (this->heldItemAction != PLAYER_IA_STICK)) { + if ((this->heldItemAction != PLAYER_IA_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) { func_808377DC(play, this); return 1; } @@ -5549,7 +5549,7 @@ s32 func_8083C6B8(PlayState* play, Player* this) { return 1; } - if (this->heldItemActionParam == PLAYER_AP_FISHING_POLE) { + if (this->heldItemAction == PLAYER_IA_FISHING_POLE) { sp24 = this->actor.world.pos; sp24.y += 50.0f; @@ -6400,16 +6400,16 @@ s32 func_8083E5A8(Player* this, PlayState* play) { if ((this->heldActor == NULL) || Player_HoldsHookshot(this)) { if ((interactedActor->id == ACTOR_BG_TOKI_SWD) && LINK_IS_ADULT) { - s32 sp24 = this->itemActionParam; + s32 sp24 = this->itemAction; - this->itemActionParam = PLAYER_AP_NONE; + this->itemAction = PLAYER_IA_NONE; this->modelAnimType = PLAYER_ANIMTYPE_0; - this->heldItemActionParam = this->itemActionParam; + this->heldItemAction = this->itemAction; func_80836898(play, this, func_8083A0F4); - if (sp24 == PLAYER_AP_SWORD_MASTER) { - this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_AP_LAST_USED); - func_8083399C(play, this, PLAYER_AP_LAST_USED); + if (sp24 == PLAYER_IA_SWORD_MASTER) { + this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_IA_LAST_USED); + func_8083399C(play, this, PLAYER_IA_LAST_USED); } else { func_80835F44(play, this, ITEM_LAST_USED); } @@ -6621,7 +6621,7 @@ s32 func_8083F0C8(Player* this, PlayState* play, u32 arg2) { ((this->actor.world.pos.z - tempZ) * COLPOLY_GET_NORMAL(wallPoly->normal.x)); if (fabsf(temp) < 8.0f) { - this->stateFlags2 |= PLAYER_STATE2_16; + this->stateFlags2 |= PLAYER_STATE2_DO_ACTION_ENTER; if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) { f32 wallPolyNormX = COLPOLY_GET_NORMAL(wallPoly->normal.x); @@ -6629,7 +6629,7 @@ s32 func_8083F0C8(Player* this, PlayState* play, u32 arg2) { f32 wallDistance = this->wallDistance; func_80836898(play, this, func_8083A40C); - this->stateFlags2 |= PLAYER_STATE2_18; + this->stateFlags2 |= PLAYER_STATE2_CRAWLING; this->actor.shape.rot.y = this->currentYaw = this->actor.wallYaw + 0x8000; this->actor.world.pos.x = tempX + (wallDistance * wallPolyNormX); this->actor.world.pos.z = tempZ + (wallDistance * wallPolyNormZ); @@ -7893,7 +7893,7 @@ s32 func_808428D8(Player* this, PlayState* play) { func_80832264(play, this, &gPlayerAnim_link_normal_defense_kiru); this->unk_84F = 1; - this->swordAnimation = 0xC; + this->meleeWeaponAnimation = 0xC; this->currentYaw = this->actor.shape.rot.y + this->unk_6BE; if (!CVar_GetS32("gCrouchStabHammerFix", 0)) { @@ -7943,7 +7943,7 @@ void func_80842A88(PlayState* play, Player* this) { } s32 func_80842AC4(PlayState* play, Player* this) { - if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_85C > 0.5f)) { + if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_85C > 0.5f)) { if (AMMO(ITEM_STICK) != 0) { EffectSsStick_Spawn(play, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND], this->actor.shape.rot.y + 0x8000); @@ -7959,7 +7959,7 @@ s32 func_80842AC4(PlayState* play, Player* this) { } s32 func_80842B7C(PlayState* play, Player* this) { - if (this->heldItemActionParam == PLAYER_AP_SWORD_BGS) { + if (this->heldItemAction == PLAYER_IA_SWORD_BGS) { if (!gSaveContext.bgsFlag && (gSaveContext.swordHealth > 0.0f)) { if ((gSaveContext.swordHealth -= 1.0f) <= 0.0f) { EffectSsStick_Spawn(play, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND], @@ -8020,26 +8020,26 @@ s32 func_80842DF4(PlayState* play, Player* this) { s32 sp48; if (this->swordState > 0) { - if (this->swordAnimation < 0x18) { - if (!(this->swordQuads[0].base.atFlags & AT_BOUNCED) && !(this->swordQuads[1].base.atFlags & AT_BOUNCED)) { + if (this->meleeWeaponAnimation < 0x18) { + if (!(this->meleeWeaponQuads[0].base.atFlags & AT_BOUNCED) && !(this->meleeWeaponQuads[1].base.atFlags & AT_BOUNCED)) { if (this->skelAnime.curFrame >= 2.0f) { - phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->swordInfo[0].tip, &this->swordInfo[0].base, &sp50); + phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->meleeWeaponInfo[0].tip, &this->meleeWeaponInfo[0].base, &sp50); if (phi_f2 != 0.0f) { phi_f2 = (phi_f2 + 10.0f) / phi_f2; } - sp68.x = this->swordInfo[0].tip.x + (sp50.x * phi_f2); - sp68.y = this->swordInfo[0].tip.y + (sp50.y * phi_f2); - sp68.z = this->swordInfo[0].tip.z + (sp50.z * phi_f2); + sp68.x = this->meleeWeaponInfo[0].tip.x + (sp50.x * phi_f2); + sp68.y = this->meleeWeaponInfo[0].tip.y + (sp50.y * phi_f2); + sp68.z = this->meleeWeaponInfo[0].tip.z + (sp50.z * phi_f2); - if (BgCheck_EntityLineTest1(&play->colCtx, &sp68, &this->swordInfo[0].tip, &sp5C, &sp78, true, + if (BgCheck_EntityLineTest1(&play->colCtx, &sp68, &this->meleeWeaponInfo[0].tip, &sp5C, &sp78, true, false, false, true, &sp74) && !SurfaceType_IsIgnoredByEntities(&play->colCtx, sp78, sp74) && (func_80041D4C(&play->colCtx, sp78, sp74) != 6) && (func_8002F9EC(play, &this->actor, sp78, sp74, &sp5C) == 0)) { - if (this->heldItemActionParam == PLAYER_AP_HAMMER) { + if (this->heldItemAction == PLAYER_IA_HAMMER) { func_80832630(play); func_80842A28(play, this); func_80842D20(play, this); @@ -8073,18 +8073,18 @@ s32 func_80842DF4(PlayState* play, Player* this) { } } - temp1 = (this->swordQuads[0].base.atFlags & AT_HIT) || (this->swordQuads[1].base.atFlags & AT_HIT); + temp1 = (this->meleeWeaponQuads[0].base.atFlags & AT_HIT) || (this->meleeWeaponQuads[1].base.atFlags & AT_HIT); if (temp1) { - if (this->swordAnimation < 0x18) { - Actor* at = this->swordQuads[temp1 ? 1 : 0].base.at; + if (this->meleeWeaponAnimation < 0x18) { + Actor* at = this->meleeWeaponQuads[temp1 ? 1 : 0].base.at; if ((at != NULL) && (at->id != ACTOR_EN_KANBAN)) { func_80832630(play); } } - if ((func_80842AC4(play, this) == 0) && (this->heldItemActionParam != PLAYER_AP_HAMMER)) { + if ((func_80842AC4(play, this) == 0) && (this->heldItemAction != PLAYER_IA_HAMMER)) { func_80842B7C(play, this); if (this->actor.colChkInfo.atHitEffect == 1) { @@ -8176,7 +8176,7 @@ void func_80843188(Player* this, PlayState* play) { ANIMMODE_ONCE, 0.0f); func_80832F54(play, this, 4); } else { - if (this->itemActionParam < 0) { + if (this->itemAction < 0) { func_8008EC70(this); } func_8083A098(this, D_80853914[PLAYER_ANIMGROUP_22][this->modelAnimType], play); @@ -8727,8 +8727,8 @@ void func_80844AF4(Player* this, PlayState* play) { } if (func_80843E64(play, this) >= 0) { - this->swordAnimation += 2; - func_80837948(play, this, this->swordAnimation); + this->meleeWeaponAnimation += 2; + func_80837948(play, this, this->meleeWeaponAnimation); this->unk_845 = 3; func_808328A0(this); } @@ -9550,7 +9550,7 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe this->getItemEntry = (GetItemEntry)GET_ITEM_NONE; this->ageProperties = &sAgeProperties[gSaveContext.linkAge]; Actor_ProcessInitChain(&this->actor, sInitChain); - this->swordEffectIndex = TOTAL_EFFECT_COUNT; + this->meleeWeaponEffectIndex = TOTAL_EFFECT_COUNT; this->currentYaw = this->actor.world.rot.y; func_80834644(play, this); @@ -9561,15 +9561,15 @@ void Player_InitCommon(Player* this, PlayState* play, FlexSkeletonHeader* skelHe this->morphTable2, PLAYER_LIMB_MAX); this->skelAnime2.baseTransl = D_80854730; - Effect_Add(play, &this->swordEffectIndex, EFFECT_BLURE2, 0, 0, &blureSword); + Effect_Add(play, &this->meleeWeaponEffectIndex, EFFECT_BLURE2, 0, 0, &blureSword); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, this->ageProperties->unk_04); - this->unk_46C = SUBCAM_NONE; + this->subCamId = SUBCAM_NONE; Collider_InitCylinder(play, &this->cylinder); Collider_SetCylinder(play, &this->cylinder, &this->actor, &D_80854624); - Collider_InitQuad(play, &this->swordQuads[0]); - Collider_SetQuad(play, &this->swordQuads[0], &this->actor, &D_80854650); - Collider_InitQuad(play, &this->swordQuads[1]); - Collider_SetQuad(play, &this->swordQuads[1], &this->actor, &D_80854650); + Collider_InitQuad(play, &this->meleeWeaponQuads[0]); + Collider_SetQuad(play, &this->meleeWeaponQuads[0], &this->actor, &D_80854650); + Collider_InitQuad(play, &this->meleeWeaponQuads[1]); + Collider_SetQuad(play, &this->meleeWeaponQuads[1], &this->actor, &D_80854650); Collider_InitQuad(play, &this->shieldQuad); Collider_SetQuad(play, &this->shieldQuad, &this->actor, &D_808546A0); } @@ -9605,7 +9605,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { thisx->room = -1; this->ageProperties = &sAgeProperties[gSaveContext.linkAge]; - this->itemActionParam = this->heldItemActionParam = -1; + this->itemAction = this->heldItemAction = -1; this->heldItemId = ITEM_NONE; func_80835F44(play, this, ITEM_NONE); @@ -9699,9 +9699,9 @@ void Player_Init(Actor* thisx, PlayState* play2) { } if (gSaveContext.nayrusLoveTimer != 0) { - gSaveContext.unk_13F0 = 3; + gSaveContext.magicState = 3; func_80846A00(play, this, 1); - this->stateFlags3 &= ~PLAYER_STATE3_6; + this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } if (gSaveContext.entranceSound != 0) { @@ -9787,11 +9787,11 @@ void func_808473D4(PlayState* play, Player* this) { if (!Player_InBlockingCsMode(play, this)) { if (this->stateFlags1 & PLAYER_STATE1_20) { doAction = DO_ACTION_RETURN; - } else if ((this->heldItemActionParam == PLAYER_AP_FISHING_POLE) && (this->unk_860 != 0)) { + } else if ((this->heldItemAction == PLAYER_IA_FISHING_POLE) && (this->unk_860 != 0)) { if (this->unk_860 == 2) { doAction = DO_ACTION_REEL; } - } else if ((func_8084E3C4 != this->func_674) && !(this->stateFlags2 & PLAYER_STATE2_18)) { + } else if ((func_8084E3C4 != this->func_674) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) { if ((this->doorType != PLAYER_DOORTYPE_NONE) && (!(this->stateFlags1 & PLAYER_STATE1_11) || ((heldActor != NULL) && (heldActor->id == ACTOR_EN_RU1)))) { @@ -9832,7 +9832,7 @@ void func_808473D4(PlayState* play, Player* this) { } else if ((this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_21)) || ((this->stateFlags1 & PLAYER_STATE1_23) && (this->stateFlags2 & PLAYER_STATE2_22))) { doAction = DO_ACTION_DOWN; - } else if (this->stateFlags2 & PLAYER_STATE2_16) { + } else if (this->stateFlags2 & PLAYER_STATE2_DO_ACTION_ENTER) { doAction = DO_ACTION_ENTER; } else if ((this->stateFlags1 & PLAYER_STATE1_11) && (this->getItemId == GI_NONE) && (heldActor != NULL)) { @@ -9863,7 +9863,7 @@ void func_808473D4(PlayState* play, Player* this) { } else if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_2) && func_80833BCC(this) && (sp20 > 0)) { doAction = DO_ACTION_JUMP; - } else if ((this->heldItemActionParam >= PLAYER_AP_SWORD_MASTER) || + } else if ((this->heldItemAction >= PLAYER_IA_SWORD_MASTER) || ((this->stateFlags2 & PLAYER_STATE2_20) && (play->actorCtx.targetCtx.arrowPointedActor == NULL))) { doAction = DO_ACTION_PUTAWAY; @@ -9940,7 +9940,7 @@ void func_80847BA0(PlayState* play, Player* this) { D_80853604 = this->unk_A7A; - if (this->stateFlags2 & PLAYER_STATE2_18) { + if (this->stateFlags2 & PLAYER_STATE2_CRAWLING) { spB0 = 10.0f; spAC = 15.0f; spA8 = 30.0f; @@ -10042,7 +10042,7 @@ void func_80847BA0(PlayState* play, Player* this) { D_80854798.y = 18.0f; D_80854798.z = this->ageProperties->unk_38 + 10.0f; - if (!(this->stateFlags2 & PLAYER_STATE2_18) && + if (!(this->stateFlags2 & PLAYER_STATE2_CRAWLING) && func_80839768(play, this, &D_80854798, &spA0, &sp9C, &D_80858AA8)) { this->actor.bgCheckFlags |= 0x200; if (this->actor.wallPoly != spA0) { @@ -10249,7 +10249,7 @@ void Player_UpdateCamAndSeqModes(PlayState* play, Player* this) { } } else if (this->stateFlags1 & PLAYER_STATE1_19) { camMode = CAM_MODE_FREEFALL; - } else if ((this->swordState != 0) && (this->swordAnimation >= 0) && (this->swordAnimation < 0x18)) { + } else if ((this->swordState != 0) && (this->meleeWeaponAnimation >= 0) && (this->meleeWeaponAnimation < 0x18)) { camMode = CAM_MODE_STILL; } else { camMode = CAM_MODE_NORMAL; @@ -10304,7 +10304,7 @@ void func_80848A04(PlayState* play, Player* this) { this->unk_85C = temp; } - func_8002836C(play, &this->swordInfo[0].tip, &D_808547A4, &D_808547B0, &D_808547BC, &D_808547C0, temp * 200.0f, + func_8002836C(play, &this->meleeWeaponInfo[0].tip, &D_808547A4, &D_808547B0, &D_808547BC, &D_808547C0, temp * 200.0f, 0, 8); } @@ -10586,9 +10586,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_808473D4(play, this); func_80836BEC(this, play); - if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_860 != 0)) { + if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_860 != 0)) { func_80848A04(play, this); - } else if ((this->heldItemActionParam == PLAYER_AP_FISHING_POLE) && (this->unk_860 < 0)) { + } else if ((this->heldItemAction == PLAYER_IA_FISHING_POLE) && (this->unk_860 < 0)) { this->unk_860++; } @@ -10600,10 +10600,10 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_80848C74(play, this); } - if ((this->stateFlags3 & PLAYER_STATE3_6) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.unk_13F0 == 0)) { - gSaveContext.unk_13F0 = 3; + if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.magicState == 0)) { + gSaveContext.magicState = 3; func_80846A00(play, this, 1); - this->stateFlags3 &= ~PLAYER_STATE3_6; + this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE; } if (this->stateFlags2 & PLAYER_STATE2_15) { @@ -10766,7 +10766,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Math_StepToF(&this->windSpeed, 0.0f, (this->stateFlags1 & PLAYER_STATE1_27) ? 0.5f : 1.0f); } - if (!Player_InBlockingCsMode(play, this) && !(this->stateFlags2 & PLAYER_STATE2_18)) { + if (!Player_InBlockingCsMode(play, this) && !(this->stateFlags2 & PLAYER_STATE2_CRAWLING)) { func_8083D53C(play, this); if ((this->actor.category == ACTORCAT_PLAYER) && (gSaveContext.health == 0)) { @@ -10822,10 +10822,10 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { this->stateFlags2 &= ~(PLAYER_STATE2_1 | PLAYER_STATE2_21); } - this->stateFlags1 &= ~(PLAYER_STATE1_1 | PLAYER_STATE1_9 | PLAYER_STATE1_12 | PLAYER_STATE1_22); + this->stateFlags1 &= ~(PLAYER_STATE1_SWINGING_BOTTLE | PLAYER_STATE1_9 | PLAYER_STATE1_12 | PLAYER_STATE1_22); this->stateFlags2 &= ~(PLAYER_STATE2_0 | PLAYER_STATE2_2 | PLAYER_STATE2_3 | PLAYER_STATE2_5 | PLAYER_STATE2_6 | PLAYER_STATE2_8 | PLAYER_STATE2_9 | PLAYER_STATE2_12 | PLAYER_STATE2_14 | - PLAYER_STATE2_16 | PLAYER_STATE2_22 | PLAYER_STATE2_26); + PLAYER_STATE2_DO_ACTION_ENTER | PLAYER_STATE2_22 | PLAYER_STATE2_26); this->stateFlags3 &= ~PLAYER_STATE3_4; func_80847298(this); @@ -10936,8 +10936,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { Collider_ResetCylinderAC(play, &this->cylinder.base); - Collider_ResetQuadAT(play, &this->swordQuads[0].base); - Collider_ResetQuadAT(play, &this->swordQuads[1].base); + Collider_ResetQuadAT(play, &this->meleeWeaponQuads[0].base); + Collider_ResetQuadAT(play, &this->meleeWeaponQuads[1].base); Collider_ResetQuadAC(play, &this->shieldQuad.base); Collider_ResetQuadAT(play, &this->shieldQuad.base); @@ -11195,7 +11195,7 @@ void Player_Draw(Actor* thisx, PlayState* play2) { if (projectedHeadPos.z < -4.0f) { overrideLimbDraw = func_800902F0; } - } else if (this->stateFlags2 & PLAYER_STATE2_18) { + } else if (this->stateFlags2 & PLAYER_STATE2_CRAWLING) { if (this->actor.projectedPos.z < 0.0f) { overrideLimbDraw = func_80090440; } @@ -11257,11 +11257,11 @@ void Player_Draw(Actor* thisx, PlayState* play2) { void Player_Destroy(Actor* thisx, PlayState* play) { Player* this = (Player*)thisx; - Effect_Delete(play, this->swordEffectIndex); + Effect_Delete(play, this->meleeWeaponEffectIndex); Collider_DestroyCylinder(play, &this->cylinder); - Collider_DestroyQuad(play, &this->swordQuads[0]); - Collider_DestroyQuad(play, &this->swordQuads[1]); + Collider_DestroyQuad(play, &this->meleeWeaponQuads[0]); + Collider_DestroyQuad(play, &this->meleeWeaponQuads[1]); Collider_DestroyQuad(play, &this->shieldQuad); func_800876C8(play); @@ -11504,8 +11504,8 @@ s32 func_8084B3CC(PlayState* play, Player* this) { } void func_8084B498(Player* this) { - this->itemActionParam = - (INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY) ? PLAYER_AP_OCARINA_FAIRY : PLAYER_AP_OCARINA_TIME; + this->itemAction = + (INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY) ? PLAYER_IA_OCARINA_FAIRY : PLAYER_IA_OCARINA_TIME; } s32 func_8084B4D4(PlayState* play, Player* this) { @@ -11559,7 +11559,7 @@ void func_8084B530(Player* this, PlayState* play) { if (this->skelAnime.moveFlags != 0) { func_80832DBC(this); if ((this->targetActor->category == ACTORCAT_NPC) && - (this->heldItemActionParam != PLAYER_AP_FISHING_POLE)) { + (this->heldItemAction != PLAYER_IA_FISHING_POLE)) { func_808322D0(play, this, &gPlayerAnim_link_normal_talk_free); } else { func_80832284(play, this, func_80833338(this)); @@ -12014,7 +12014,7 @@ void func_8084C81C(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { func_8083C0E8(this, play); - this->stateFlags2 &= ~PLAYER_STATE2_18; + this->stateFlags2 &= ~PLAYER_STATE2_CRAWLING; return; } @@ -12980,7 +12980,7 @@ static u8 D_808549FC[] = { void func_8084EAC0(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->unk_850 == 0) { - if (this->itemActionParam == PLAYER_AP_BOTTLE_POE) { + if (this->itemAction == PLAYER_IA_BOTTLE_POE) { s32 rand = Rand_S16Offset(-1, 3); if (rand == 0) { @@ -12997,9 +12997,9 @@ void func_8084EAC0(Player* this, PlayState* play) { gSaveContext.healthAccumulator = rand * 0x10; } } else { - s32 sp28 = D_808549FC[this->itemActionParam - PLAYER_AP_BOTTLE_POTION_RED]; + s32 sp28 = D_808549FC[this->itemAction - PLAYER_IA_BOTTLE_POTION_RED]; - if (CVar_GetS32("gRedPotionEffect", 0) && this->itemActionParam == PLAYER_AP_BOTTLE_POTION_RED) { + if (CVar_GetS32("gRedPotionEffect", 0) && this->itemAction == PLAYER_IA_BOTTLE_POTION_RED) { if (CVar_GetS32("gRedPercentRestore", 0)) { gSaveContext.healthAccumulator = (gSaveContext.healthCapacity * CVar_GetS32("gRedPotionHealth", 100) / 100 + 15) / 16 * 16; @@ -13007,7 +13007,7 @@ void func_8084EAC0(Player* this, PlayState* play) { gSaveContext.healthAccumulator = CVar_GetS32("gRedPotionHealth", 20) * 16; } } else if (CVar_GetS32("gBluePotionEffects", 0) && - this->itemActionParam == PLAYER_AP_BOTTLE_POTION_BLUE) { + this->itemAction == PLAYER_IA_BOTTLE_POTION_BLUE) { if (CVar_GetS32("gBlueHealthPercentRestore", 0)) { gSaveContext.healthAccumulator = (gSaveContext.healthCapacity * CVar_GetS32("gBluePotionHealth", 100) / 100 + 15) / 16 * 16; @@ -13016,7 +13016,7 @@ void func_8084EAC0(Player* this, PlayState* play) { } if (CVar_GetS32("gBlueManaPercentRestore", 0)) { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { Magic_Fill(play); } @@ -13025,7 +13025,7 @@ void func_8084EAC0(Player* this, PlayState* play) { 16 * 16, 5); } else { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { Magic_Fill(play); } @@ -13033,9 +13033,9 @@ void func_8084EAC0(Player* this, PlayState* play) { ; } } else if (CVar_GetS32("gGreenPotionEffect", 0) && - this->itemActionParam == PLAYER_AP_BOTTLE_POTION_GREEN) { + this->itemAction == PLAYER_IA_BOTTLE_POTION_GREEN) { if (CVar_GetS32("gGreenPercentRestore", 0)) { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { Magic_Fill(play); } @@ -13044,15 +13044,15 @@ void func_8084EAC0(Player* this, PlayState* play) { 16 * 16, 5); } else { - if (gSaveContext.unk_13F0 != 10) { + if (gSaveContext.magicState != 10) { Magic_Fill(play); } func_80087708(play, CVar_GetS32("gGreenPotionMana", 100), 5); ; } - } else if (CVar_GetS32("gMilkEffect", 0) && (this->itemActionParam == PLAYER_AP_BOTTLE_MILK || - this->itemActionParam == PLAYER_AP_BOTTLE_MILK_HALF)) { + } else if (CVar_GetS32("gMilkEffect", 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK || + this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF)) { if (CVar_GetS32("gMilkPercentRestore", 0)) { gSaveContext.healthAccumulator = (gSaveContext.healthCapacity * CVar_GetS32("gMilkHealth", 100) / 100 + 15) / 16 * 16; @@ -13060,7 +13060,7 @@ void func_8084EAC0(Player* this, PlayState* play) { gSaveContext.healthAccumulator = CVar_GetS32("gMilkHealth", 5) * 16; } if (CVar_GetS32("gSeparateHalfMilkEffect", 0) && - this->itemActionParam == PLAYER_AP_BOTTLE_MILK_HALF) { + this->itemAction == PLAYER_IA_BOTTLE_MILK_HALF) { if (CVar_GetS32("gHalfMilkPercentRestore", 0)) { gSaveContext.healthAccumulator = (gSaveContext.healthCapacity * CVar_GetS32("gHalfMilkHealth", 100) / 100 + 15) / 16 * @@ -13092,10 +13092,10 @@ void func_8084EAC0(Player* this, PlayState* play) { func_8083C0E8(this, play); func_8005B1A4(Play_GetCamera(play, 0)); } else if (this->unk_850 == 1) { - if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.unk_13F0 != 9)) { + if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != 9)) { func_80832B78(play, this, &gPlayerAnim_link_bottle_drink_demo_end); this->unk_850 = 2; - Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_IA_BOTTLE); } func_80832698(this, NA_SE_VO_LI_DRINK - SFX_FLAG); } else if ((this->unk_850 == 2) && LinkAnimation_OnFrame(&this->skelAnime, 29.0f)) { @@ -13174,7 +13174,7 @@ void func_8084ECA4(Player* this, PlayState* play) { } if (this->skelAnime.curFrame <= 7.0f) { - this->stateFlags1 |= PLAYER_STATE1_1; + this->stateFlags1 |= PLAYER_STATE1_SWINGING_BOTTLE; } } @@ -13189,7 +13189,7 @@ void func_8084EED8(Player* this, PlayState* play) { if (LinkAnimation_OnFrame(&this->skelAnime, 37.0f)) { Player_SpawnFairy(play, this, &this->leftHandPos, &D_80854A1C, FAIRY_REVIVE_BOTTLE); - Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_IA_BOTTLE); func_8002F7DC(&this->actor, NA_SE_EV_BOTTLE_CAP_OPEN); func_8002F7DC(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG); } else if (LinkAnimation_OnFrame(&this->skelAnime, 47.0f)) { @@ -13227,14 +13227,14 @@ void func_8084EFC0(Player* this, PlayState* play) { } if (LinkAnimation_OnFrame(&this->skelAnime, 76.0f)) { - BottleDropInfo* dropInfo = &D_80854A28[this->itemActionParam - PLAYER_AP_BOTTLE_FISH]; + BottleDropInfo* dropInfo = &D_80854A28[this->itemAction - PLAYER_IA_BOTTLE_FISH]; Actor_Spawn(&play->actorCtx, play, dropInfo->actorId, (Math_SinS(this->actor.shape.rot.y) * 5.0f) + this->leftHandPos.x, this->leftHandPos.y, (Math_CosS(this->actor.shape.rot.y) * 5.0f) + this->leftHandPos.z, 0x4000, this->actor.shape.rot.y, 0, dropInfo->actorParams); - Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_AP_BOTTLE); + Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_IA_BOTTLE); return; } @@ -13263,7 +13263,7 @@ void func_8084F104(Player* this, PlayState* play) { } else { GetItemEntry giEntry = ItemTable_Retrieve(D_80854528[this->exchangeItemId - 1]); - if (this->itemActionParam >= PLAYER_AP_LETTER_ZELDA) { + if (this->itemAction >= PLAYER_IA_LETTER_ZELDA) { if (giEntry.gi >= 0) { this->unk_862 = giEntry.gi; } else { @@ -13274,7 +13274,7 @@ void func_8084F104(Player* this, PlayState* play) { if (this->unk_850 == 0) { Message_StartTextbox(play, this->actor.textId, &this->actor); - if ((this->itemActionParam == PLAYER_AP_CHICKEN) || (this->itemActionParam == PLAYER_AP_POCKET_CUCCO)) { + if ((this->itemAction == PLAYER_IA_CHICKEN) || (this->itemAction == PLAYER_IA_POCKET_CUCCO)) { func_8002F7DC(&this->actor, NA_SE_EV_CHICKEN_CRY_M); } @@ -13449,7 +13449,7 @@ void func_8084F88C(Player* this, PlayState* play) { func_80078884(NA_SE_OC_ABYSS); } else { play->fadeTransition = 2; - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; gSaveContext.seqId = (u8)NA_BGM_DISABLED; gSaveContext.natureAmbienceId = 0xFF; } @@ -13679,14 +13679,14 @@ s32 func_80850224(Player* this, PlayState* play) { static Vec3f D_80854A40 = { 0.0f, 40.0f, 45.0f }; void func_808502D0(Player* this, PlayState* play) { - struct_80854190* sp44 = &D_80854190[this->swordAnimation]; + struct_80854190* sp44 = &D_80854190[this->meleeWeaponAnimation]; this->stateFlags2 |= PLAYER_STATE2_5; if (!func_80842DF4(play, this)) { func_8084285C(this, 0.0f, sp44->unk_0C, sp44->unk_0D); - if ((this->stateFlags2 & PLAYER_STATE2_30) && (this->heldItemActionParam != PLAYER_AP_HAMMER) && + if ((this->stateFlags2 & PLAYER_STATE2_30) && (this->heldItemAction != PLAYER_IA_HAMMER) && LinkAnimation_OnFrame(&this->skelAnime, 0.0f)) { this->linearVelocity = 15.0f; this->stateFlags2 &= ~PLAYER_STATE2_30; @@ -13723,8 +13723,8 @@ void func_808502D0(Player* this, PlayState* play) { this->skelAnime.moveFlags = sp43; this->stateFlags3 |= PLAYER_STATE3_3; } - } else if (this->heldItemActionParam == PLAYER_AP_HAMMER) { - if ((this->swordAnimation == 0x16) || (this->swordAnimation == 0x13)) { + } else if (this->heldItemAction == PLAYER_IA_HAMMER) { + if ((this->meleeWeaponAnimation == 0x16) || (this->meleeWeaponAnimation == 0x13)) { static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f }; Vec3f shockwavePos; f32 sp2C; @@ -13735,8 +13735,8 @@ void func_808502D0(Player* this, PlayState* play) { Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800); func_80836AB8(this, 1); - if ((((this->swordAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) || - ((this->swordAnimation == 0x13) && LinkAnimation_OnFrame(&this->skelAnime, 2.0f))) && + if ((((this->meleeWeaponAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) || + ((this->meleeWeaponAnimation == 0x13) && LinkAnimation_OnFrame(&this->skelAnime, 2.0f))) && (sp2C > -40.0f) && (sp2C < 40.0f)) { func_80842A28(play, this); EffectSsBlast_SpawnWhiteShockwave(play, &shockwavePos, &zeroVec, &zeroVec); @@ -13850,7 +13850,7 @@ static struct_80832924 D_80854A8C[][2] = { void func_808507F4(Player* this, PlayState* play) { if (LinkAnimation_Update(play, &this->skelAnime)) { if (this->unk_84F < 0) { - if ((this->itemActionParam == PLAYER_AP_NAYRUS_LOVE) || (gSaveContext.unk_13F0 == 0)) { + if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || (gSaveContext.magicState == 0)) { func_80839FFC(this, play); func_8005B1A4(Play_GetCamera(play, 0)); } @@ -13861,7 +13861,7 @@ void func_808507F4(Player* this, PlayState* play) { if (func_80846A00(play, this, this->unk_84F) != NULL) { this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29; if ((this->unk_84F != 0) || (gSaveContext.respawn[RESPAWN_MODE_TOP].data <= 0)) { - gSaveContext.unk_13F0 = 1; + gSaveContext.magicState = 1; } } else { func_800876C8(play); @@ -14605,7 +14605,7 @@ void func_80851CA4(PlayState* play, Player* this, CsCmdActorAction* arg2) { void func_80851D2C(PlayState* play, Player* this, CsCmdActorAction* arg2) { func_80850F1C(play, this, &gPlayerAnim_link_normal_okarina_start); func_8084B498(this); - Player_SetModels(this, Player_ActionToModelGroup(this, this->itemActionParam)); + Player_SetModels(this, Player_ActionToModelGroup(this, this->itemAction)); } static struct_80832924 D_808551B8[] = { @@ -14859,9 +14859,9 @@ void func_80852648(PlayState* play, Player* this, CsCmdActorAction* arg2) { LinkAnimation_Update(play, &this->skelAnime); if (LinkAnimation_OnFrame(&this->skelAnime, 10.0f)) { - this->heldItemActionParam = this->itemActionParam = PLAYER_AP_NONE; + this->heldItemAction = this->itemAction = PLAYER_IA_NONE; this->heldItemId = ITEM_NONE; - this->modelGroup = this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_AP_NONE); + this->modelGroup = this->nextModelGroup = Player_ActionToModelGroup(this, PLAYER_IA_NONE); this->leftHandDLists = D_80125E08; Inventory_ChangeEquipment(EQUIP_SWORD, 2); gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; @@ -14922,7 +14922,7 @@ void func_808528C8(PlayState* play, Player* this, CsCmdActorAction* arg2) { func_8084285C(this, 0.0f, 99.0f, this->skelAnime.endFrame - 8.0f); } - if (this->heldItemActionParam != PLAYER_AP_SWORD_MASTER) { + if (this->heldItemAction != PLAYER_IA_SWORD_MASTER) { func_80846720(play, this, 1); } } @@ -15046,7 +15046,7 @@ void func_80852E14(Player* this, PlayState* play) { s32 Player_IsDroppingFish(PlayState* play) { Player* this = GET_PLAYER(play); - return (func_8084EFC0 == this->func_674) && (this->itemActionParam == PLAYER_AP_BOTTLE_FISH); + return (func_8084EFC0 == this->func_674) && (this->itemAction == PLAYER_IA_BOTTLE_FISH); } s32 Player_StartFishing(PlayState* play) { @@ -15057,7 +15057,7 @@ s32 Player_StartFishing(PlayState* play) { gSaveContext.temporaryWeapon = true; } if (this->heldItemId == ITEM_NONE) { - this->currentSwordItem = ITEM_SWORD_KOKIRI; + this->currentSwordItemId = ITEM_SWORD_KOKIRI; gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI); } @@ -15156,7 +15156,7 @@ void func_80853148(PlayState* play, Actor* actor) { if (func_808332B8(this)) { func_80836898(play, this, func_8083A2F8); func_80832C6C(play, this, &gPlayerAnim_link_swimer_swim_wait); - } else if ((actor->category != ACTORCAT_NPC) || (this->heldItemActionParam == PLAYER_AP_FISHING_POLE)) { + } else if ((actor->category != ACTORCAT_NPC) || (this->heldItemAction == PLAYER_IA_FISHING_POLE)) { func_8083A2F8(play, this); if (!func_8008E9C4(this)) { diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 9d75c5753..6c8882814 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -2155,30 +2155,30 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.unk_13EE = 0x32; gSaveContext.nayrusLoveTimer = 0; gSaveContext.healthAccumulator = 0; - gSaveContext.unk_13F0 = 0; - gSaveContext.unk_13F2 = 0; + gSaveContext.magicState = 0; + gSaveContext.prevMagicState = 0; gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX; gSaveContext.skyboxTime = 0; - gSaveContext.nextTransition = 0xFF; + gSaveContext.nextTransitionType = 0xFF; gSaveContext.nextCutsceneIndex = 0xFFEF; gSaveContext.cutsceneTrigger = 0; gSaveContext.chamberCutsceneNum = 0; gSaveContext.nextDayTime = 0xFFFF; - gSaveContext.unk_13C3 = 0; + gSaveContext.retainWeatherMode = 0; for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED; } gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC = - gSaveContext.unk_13F4 = 0; + gSaveContext.magicCapacity = 0; - gSaveContext.unk_13F6 = gSaveContext.magic; + gSaveContext.magicFillTarget = gSaveContext.magic; gSaveContext.magic = 0; gSaveContext.magicLevel = gSaveContext.magic; osSyncPrintf(VT_FGCOL(GREEN)); - osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.unk_13F6), gSaveContext.magic); + osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.magicFillTarget), gSaveContext.magic); osSyncPrintf(VT_RST); gSaveContext.naviTimer = 0; diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 278975528..743bb43c9 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -22,9 +22,9 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) { osSyncPrintf(VT_RST); if (gSaveContext.fileNum == 0xFF) { Sram_InitDebugSave(); - gSaveContext.unk_13F6 = gSaveContext.magic; + gSaveContext.magicFillTarget = gSaveContext.magic; gSaveContext.magic = 0; - gSaveContext.unk_13F4 = 0; + gSaveContext.magicCapacity = 0; gSaveContext.magicLevel = gSaveContext.magic; } for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { @@ -63,9 +63,9 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) { osSyncPrintf(VT_RST); if (gSaveContext.fileNum == 0xFF) { Sram_InitDebugSave(); - gSaveContext.unk_13F6 = gSaveContext.magic; + gSaveContext.magicFillTarget = gSaveContext.magic; gSaveContext.magic = 0; - gSaveContext.unk_13F4 = 0; + gSaveContext.magicCapacity = 0; gSaveContext.magicLevel = gSaveContext.magic; } for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) { diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index c13ec7908..22821a5ac 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -4218,20 +4218,20 @@ void KaleidoScope_Update(PlayState* play) if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) { Grotto_ForceGrottoReturn(); } - gSaveContext.nextTransition = 2; + gSaveContext.nextTransitionType = 2; gSaveContext.health = 0x30; Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA); gSaveContext.healthAccumulator = 0; - gSaveContext.unk_13F0 = 0; - gSaveContext.unk_13F2 = 0; + gSaveContext.magicState = 0; + gSaveContext.prevMagicState = 0; osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic); - osSyncPrintf("Z_MAGIC_NOW_NOW=%d → ", gSaveContext.unk_13F6); - gSaveContext.unk_13F4 = 0; - gSaveContext.unk_13F6 = gSaveContext.magic; + osSyncPrintf("Z_MAGIC_NOW_NOW=%d → ", gSaveContext.magicFillTarget); + gSaveContext.magicCapacity = 0; + gSaveContext.magicFillTarget = gSaveContext.magic; gSaveContext.magicLevel = gSaveContext.magic = 0; osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic); - osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6); + osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget); osSyncPrintf(VT_RST); } else { play->state.running = 0;