diff --git a/include/z64save.h b/include/z64save.h index 68f6028ca3..cdd2d62fc5 100644 --- a/include/z64save.h +++ b/include/z64save.h @@ -464,6 +464,17 @@ typedef enum LinkAge { * SaveContext.eventChkInf */ +#define EVENTCHKINF_INDEX(flag) ((flag) >> 4) +#define EVENTCHKINF_MASK(flag) (1 << ((flag) & 0xF)) + +#define GET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX(flag)] & EVENTCHKINF_MASK(flag)) +#define SET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX(flag)] |= EVENTCHKINF_MASK(flag)) +#define CLEAR_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX(flag)] &= ~EVENTCHKINF_MASK(flag)) + +// EVENTCHKINF 0x00-0x0F +#define EVENTCHKINF_INDEX_0 0 +#define EVENTCHKINF_00_UNUSED 0x00 // flag is set in the debug save, but has no functionality +#define EVENTCHKINF_01_UNUSED 0x01 // flag is set in the debug save, but has no functionality #define EVENTCHKINF_MIDO_DENIED_DEKU_TREE_ACCESS 0x02 #define EVENTCHKINF_03 0x03 #define EVENTCHKINF_04 0x04 @@ -507,11 +518,9 @@ typedef enum LinkAge { #define EVENTCHKINF_3B 0x3B #define EVENTCHKINF_DEFEATED_NABOORU_KNUCKLE 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) +// EVENTCHKINF 0x40 +#define EVENTCHKINF_INDEX_40 EVENTCHKINF_INDEX(EVENTCHKINF_40) +#define EVENTCHKINF_40 0x40 #define EVENTCHKINF_41 0x41 #define EVENTCHKINF_42 0x42 @@ -540,11 +549,9 @@ typedef enum LinkAge { #define EVENTCHKINF_RESTORED_LAKE_HYLIA 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) +// EVENTCHKINF 0x6B +#define EVENTCHKINF_INDEX_TALON_RETURNED_FROM_KAKARIKO EVENTCHKINF_INDEX(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO) +#define EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO 0x6B #define EVENTCHKINF_6E 0x6E #define EVENTCHKINF_6F 0x6F @@ -564,19 +571,19 @@ typedef enum LinkAge { #define EVENTCHKINF_PAID_BACK_SPOOKY_MASK 0x8E #define EVENTCHKINF_PAID_BACK_BUNNY_HOOD 0x8F -// 0x90-0x93 +// EVENTCHKINF 0x90-0x93 // carpenters freed from the gerudo -#define EVENTCHKINF_CARPENTERS_FREE_INDEX 9 +#define EVENTCHKINF_INDEX_CARPENTERS_FREE 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(n) ((EVENTCHKINF_INDEX_CARPENTERS_FREE << 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.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL) + CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE], EVENTCHKINF_CARPENTERS_FREE_MASK_ALL) #define EVENTCHKINF_94 0x94 #define EVENTCHKINF_95 0x95 @@ -620,48 +627,35 @@ typedef enum LinkAge { #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) +// EVENTCHKINF 0xD0-0xD6 +#define EVENTCHKINF_INDEX_SONGS_FOR_FROGS EVENTCHKINF_INDEX(EVENTCHKINF_SONGS_FOR_FROGS_CHOIR) +#define EVENTCHKINF_SONGS_FOR_FROGS_CHOIR 0xD0 +#define EVENTCHKINF_SONGS_FOR_FROGS_ZL 0xD1 +#define EVENTCHKINF_SONGS_FOR_FROGS_EPONA 0xD2 +#define EVENTCHKINF_SONGS_FOR_FROGS_SUNS 0xD3 +#define EVENTCHKINF_SONGS_FOR_FROGS_SARIA 0xD4 +#define EVENTCHKINF_SONGS_FOR_FROGS_SOT 0xD5 +#define EVENTCHKINF_SONGS_FOR_FROGS_STORMS 0xD6 -// 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) - - -#define GET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define CLEAR_EVENTCHKINF(flag) (gSaveContext.save.info.eventChkInf[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) +// EVENTCHKINF 0xDA-0xDE +#define EVENTCHKINF_INDEX_DA_DB_DC_DD_DE EVENTCHKINF_INDEX(EVENTCHKINF_DA) +#define EVENTCHKINF_DA 0xDA +#define EVENTCHKINF_DB 0xDB +#define EVENTCHKINF_DC 0xDC +#define EVENTCHKINF_DD 0xDD +#define EVENTCHKINF_DE 0xDE /* * SaveContext.itemGetInf */ +#define ITEMGETINF_INDEX(flag) ((flag) >> 4) +#define ITEMGETINF_MASK(flag) (1 << ((flag) & 0xF)) + +#define GET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[ITEMGETINF_INDEX(flag)] & ITEMGETINF_MASK(flag)) +#define SET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[ITEMGETINF_INDEX(flag)] |= ITEMGETINF_MASK(flag)) + #define ITEMGETINF_TALON_BOTTLE 0x02 #define ITEMGETINF_03 0x03 #define ITEMGETINF_04 0x04 @@ -684,17 +678,11 @@ typedef enum LinkAge { #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) +// ITEMGETINF 0x18-0x1A +#define ITEMGETINF_INDEX_18_19_1A 1 +#define ITEMGETINF_18 0x18 +#define ITEMGETINF_19 0x19 +#define ITEMGETINF_1A 0x1A #define ITEMGETINF_1B 0x1B #define ITEMGETINF_1C 0x1C @@ -720,14 +708,19 @@ typedef enum LinkAge { #define ITEMGETINF_3F 0x3F -#define GET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_ITEMGETINF(flag) (gSaveContext.save.info.itemGetInf[(flag) >> 4] |= (1 << ((flag) & 0xF))) - - /* * SaveContext.infTable */ +#define INFTABLE_INDEX(flag) ((flag) >> 4) +#define INFTABLE_MASK(flag) (1 << ((flag) & 0xF)) + +#define GET_INFTABLE(flag) (gSaveContext.save.info.infTable[INFTABLE_INDEX(flag)] & INFTABLE_MASK(flag)) +#define SET_INFTABLE(flag) (gSaveContext.save.info.infTable[INFTABLE_INDEX(flag)] |= INFTABLE_MASK(flag)) +#define CLEAR_INFTABLE(flag) (gSaveContext.save.info.infTable[INFTABLE_INDEX(flag)] &= ~INFTABLE_MASK(flag)) + +// INFTABLE 0x0-0xF +#define INFTABLE_INDEX_0 0 #define INFTABLE_00 0x00 #define INFTABLE_01 0x01 #define INFTABLE_03 0x03 @@ -855,18 +848,18 @@ typedef enum LinkAge { #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) +// INFTABLE 0x199-0x19F +#define INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F 25 +#define INFTABLE_199 0x199 +#define INFTABLE_19A 0x19A +#define INFTABLE_19B 0x19B +#define INFTABLE_19C 0x19C +#define INFTABLE_19D 0x19D +#define INFTABLE_19E 0x19E +#define INFTABLE_19F 0x19F -// 0x1A0-0x1AF -#define INFTABLE_1AX_INDEX 26 +// INFTABLE 0x1A0-0x1AF +#define INFTABLE_INDEX_1AX 26 #define INFTABLE_1A0_SHIFT 0 #define INFTABLE_1A1_SHIFT 1 #define INFTABLE_1A2_SHIFT 2 @@ -880,24 +873,27 @@ typedef enum LinkAge { #define INFTABLE_1AB_SHIFT 11 #define INFTABLE_1AD_SHIFT 13 -// 0x1D0-0x1DF -#define INFTABLE_1DX_INDEX 29 - - -#define GET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] & (1 << ((flag) & 0xF))) -#define SET_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] |= (1 << ((flag) & 0xF))) -#define CLEAR_INFTABLE(flag) (gSaveContext.save.info.infTable[(flag) >> 4] &= ~(1 << ((flag) & 0xF))) +// INFTABLE 0x1D0-0x1DF +#define INFTABLE_INDEX_1DX INFTABLE_INDEX(INFTABLE_1D0) +#define INFTABLE_1D0 0x1D0 /* * SaveContext.eventInf */ +#define EVENTINF_INDEX(flag) ((flag) >> 4) +#define EVENTINF_MASK(flag) (1 << ((flag) & 0xF)) + +#define GET_EVENTINF(flag) (gSaveContext.eventInf[EVENTINF_INDEX(flag)] & EVENTINF_MASK(flag)) +#define SET_EVENTINF(flag) (gSaveContext.eventInf[EVENTINF_INDEX(flag)] |= EVENTINF_MASK(flag)) +#define CLEAR_EVENTINF(flag) (gSaveContext.eventInf[EVENTINF_INDEX(flag)] &= ~EVENTINF_MASK(flag)) + // EVENTINF 0x00-0x0F // Ingo Race, Lon Lon Ranch minigames, and Horseback Archery minigame flags -#define EVENTINF_HORSES_INDEX 0 +#define EVENTINF_INDEX_HORSES 0 // EVENTINF 0x00-0x03 reserved for IngoRaceState -#define EVENTINF_INGO_RACE_STATE_MASK (0xF << 0) +#define EVENTINF_INGO_RACE_STATE_MASK (0xF << 0x00) typedef enum IngoRaceState { /* 0 */ INGO_RACE_STATE_OFFER_RENTAL, /* 1 */ INGO_RACE_STATE_HORSE_RENTAL_PERIOD, @@ -909,39 +905,35 @@ typedef enum IngoRaceState { /* 7 */ INGO_RACE_STATE_REMATCH } IngoRaceState; -#define EVENTINF_INGO_RACE_HORSETYPE 4 -#define EVENTINF_INGO_RACE_HORSETYPE_MASK (1 << EVENTINF_INGO_RACE_HORSETYPE) -#define EVENTINF_INGO_RACE_LOST_ONCE 5 -#define EVENTINF_INGO_RACE_LOST_ONCE_MASK (1 << EVENTINF_INGO_RACE_LOST_ONCE) -#define EVENTINF_INGO_RACE_SECOND_RACE 6 -#define EVENTINF_INGO_RACE_SECOND_RACE_MASK (1 << EVENTINF_INGO_RACE_SECOND_RACE) +#define EVENTINF_INGO_RACE_HORSETYPE 0x04 +#define EVENTINF_INGO_RACE_LOST_ONCE 0x05 +#define EVENTINF_INGO_RACE_SECOND_RACE 0x06 // 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 8 +#define EVENTINF_HORSES_08 0x08 #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 10 +#define EVENTINF_HORSES_0A 0x0A #define EVENTINF_CUCCO_GAME_FINISHED EVENTINF_HORSES_0A -#define EVENTINF_INGO_RACE_0F 15 // unused? -#define EVENTINF_INGO_RACE_0F_MASK (1 << EVENTINF_INGO_RACE_0F) +#define EVENTINF_INGO_RACE_0F 0x0F // unused? // "InRaceSeq" -#define GET_EVENTINF_INGO_RACE_STATE() (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & EVENTINF_INGO_RACE_STATE_MASK) +#define GET_EVENTINF_INGO_RACE_STATE() (gSaveContext.eventInf[EVENTINF_INDEX_HORSES] & EVENTINF_INGO_RACE_STATE_MASK) #define SET_EVENTINF_INGO_RACE_STATE(v) \ - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ - (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~EVENTINF_INGO_RACE_STATE_MASK) | (v) + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] = \ + (gSaveContext.eventInf[EVENTINF_INDEX_HORSES] & ~EVENTINF_INGO_RACE_STATE_MASK) | (v) #define GET_EVENTINF_INGO_RACE_FLAG(flag) \ - ((gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & (1 << ((flag) & 0xF))) >> ((flag) & 0xF)) + ((gSaveContext.eventInf[EVENTINF_INDEX_HORSES] & EVENTINF_MASK(flag)) >> ((flag) & 0xF)) #define SET_EVENTINF_INGO_RACE_FLAG(flag) \ - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ - (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & 0xFFFF) | (1 << ((flag) & 0xF)) + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] = \ + (gSaveContext.eventInf[EVENTINF_INDEX_HORSES] & 0xFFFF) | EVENTINF_MASK(flag) #define WRITE_EVENTINF_INGO_RACE_FLAG(flag, v) \ - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = \ - (gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & ~(1 << ((flag) & 0xF))) | ((v) << ((flag) & 0xF)) + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] = \ + (gSaveContext.eventInf[EVENTINF_INDEX_HORSES] & ~EVENTINF_MASK(flag)) | ((v) << ((flag) & 0xF)) #define GET_EVENTINF_INGO_RACE_HORSETYPE() GET_EVENTINF_INGO_RACE_FLAG(EVENTINF_INGO_RACE_HORSETYPE) #define WRITE_EVENTINF_INGO_RACE_HORSETYPE(v) WRITE_EVENTINF_INGO_RACE_FLAG(EVENTINF_INGO_RACE_HORSETYPE, v) @@ -952,7 +944,7 @@ typedef enum IngoRaceState { #define EVENTINF_MARATHON_ACTIVE 0x10 // EVENTINF 0x20-0x24 -#define EVENTINF_20_21_22_23_24_INDEX 2 +#define EVENTINF_INDEX_20_21_22_23_24 2 #define EVENTINF_20_MASK (1 << 0) #define EVENTINF_21_MASK (1 << 1) #define EVENTINF_22_MASK (1 << 2) @@ -961,10 +953,6 @@ typedef enum IngoRaceState { #define EVENTINF_30 0x30 -#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))) - extern SaveContext gSaveContext; diff --git a/src/code/z_inventory.c b/src/code/z_inventory.c index b452a92e16..2f89c0565b 100644 --- a/src/code/z_inventory.c +++ b/src/code/z_inventory.c @@ -299,7 +299,7 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) { if (equipment == EQUIP_TYPE_SWORD) { gSaveContext.save.info.equips.buttonItems[0] = ITEM_NONE; - gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 1; + gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] = 1; } Player_SetEquipmentData(play, player); diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index 1c82288b7a..916add81f2 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -496,7 +496,7 @@ void Minimap_Draw(PlayState* play) { (LINK_AGE_IN_YEARS != YEARS_ADULT)) { if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && - (gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] & + (gSaveContext.save.info.infTable[INFTABLE_INDEX_1AX] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, @@ -513,7 +513,7 @@ void Minimap_Draw(PlayState* play) { } if ((play->sceneId == SCENE_ZORAS_FOUNTAIN) && - (gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] & gBitFlags[INFTABLE_1A9_SHIFT])) { + (gSaveContext.save.info.infTable[INFTABLE_INDEX_1AX] & gBitFlags[INFTABLE_1A9_SHIFT])) { gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 65e92e33f7..7987cccd1c 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -852,7 +852,7 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE)) { if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || - (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { + (gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] == 0)) { gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; sp28 = true; @@ -876,7 +876,7 @@ void func_80083108(PlayState* play) { (gSaveContext.save.info.equips.buttonItems[0] == ITEM_BOMBCHU) || (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE)) { if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || - (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { + (gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] == 0)) { gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; sp28 = true; @@ -1346,7 +1346,7 @@ void func_80084BF4(PlayState* play, u16 flag) { } } else if (gSaveContext.save.info.equips.buttonItems[0] == ITEM_NONE) { if ((gSaveContext.save.info.equips.buttonItems[0] != ITEM_NONE) || - (gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] == 0)) { + (gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] == 0)) { gSaveContext.save.info.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; Interface_LoadItemIcon1(play, 0); } @@ -3545,11 +3545,11 @@ void Interface_Draw(PlayState* play) { for (svar1 = 0; svar1 < ARRAY_COUNT(gSpoilingItems); svar1++) { if (INV_CONTENT(ITEM_TRADE_ADULT) == gSpoilingItems[svar1]) { #if OOT_VERSION >= NTSC_1_1 - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] &= - (u16) ~(EVENTINF_INGO_RACE_STATE_MASK | EVENTINF_INGO_RACE_HORSETYPE_MASK | - EVENTINF_INGO_RACE_LOST_ONCE_MASK | EVENTINF_INGO_RACE_SECOND_RACE_MASK | - EVENTINF_INGO_RACE_0F_MASK); - PRINTF("EVENT_INF=%x\n", gSaveContext.eventInf[EVENTINF_HORSES_INDEX]); + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] &= + (u16) ~(EVENTINF_INGO_RACE_STATE_MASK | EVENTINF_MASK(EVENTINF_INGO_RACE_HORSETYPE) | + EVENTINF_MASK(EVENTINF_INGO_RACE_LOST_ONCE) | + EVENTINF_MASK(EVENTINF_INGO_RACE_SECOND_RACE) | EVENTINF_MASK(EVENTINF_INGO_RACE_0F)); + PRINTF("EVENT_INF=%x\n", gSaveContext.eventInf[EVENTINF_INDEX_HORSES]); #endif play->nextEntranceIndex = spoilingItemEntrances[svar1]; INV_CONTENT(gSpoilingItemReverts[svar1]) = gSpoilingItemReverts[svar1]; diff --git a/src/code/z_sram.c b/src/code/z_sram.c index 0fcee6f032..cd3a2f13e6 100644 --- a/src/code/z_sram.c +++ b/src/code/z_sram.c @@ -162,7 +162,7 @@ void Sram_InitNewSave(void) { gSaveContext.save.info.horseData.pos.z = 5497; gSaveContext.save.info.horseData.angle = -0x6AD9; gSaveContext.save.info.playerData.magicLevel = 0; - gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 1; + gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] = 1; gSaveContext.save.info.sceneFlags[SCENE_WATER_TEMPLE].swch = 0x40000000; } @@ -325,8 +325,15 @@ void Sram_InitDebugSave(void) { gSaveContext.save.info.horseData.pos.y = 72; gSaveContext.save.info.horseData.pos.z = 5497; gSaveContext.save.info.horseData.angle = -0x6AD9; - gSaveContext.save.info.infTable[0] |= 0x5009; - gSaveContext.save.info.eventChkInf[0] |= 0x123F; + gSaveContext.save.info.infTable[INFTABLE_INDEX_0] |= INFTABLE_MASK(INFTABLE_00) | INFTABLE_MASK(INFTABLE_03) | + INFTABLE_MASK(INFTABLE_0C) | INFTABLE_MASK(INFTABLE_0E); + + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_0] |= + EVENTCHKINF_MASK(EVENTCHKINF_00_UNUSED) | EVENTCHKINF_MASK(EVENTCHKINF_01_UNUSED) | + EVENTCHKINF_MASK(EVENTCHKINF_MIDO_DENIED_DEKU_TREE_ACCESS) | EVENTCHKINF_MASK(EVENTCHKINF_03) | + EVENTCHKINF_MASK(EVENTCHKINF_04) | EVENTCHKINF_MASK(EVENTCHKINF_05) | EVENTCHKINF_MASK(EVENTCHKINF_09) | + EVENTCHKINF_MASK(EVENTCHKINF_0C); + SET_EVENTCHKINF(EVENTCHKINF_80); SET_EVENTCHKINF(EVENTCHKINF_C4); @@ -498,8 +505,8 @@ void Sram_OpenSave(SramContext* sramCtx) { // if zelda cutscene has been watched but lullaby was not obtained, restore cutscene and take away letter if (GET_EVENTCHKINF(EVENTCHKINF_40) && !CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) { - i = gSaveContext.save.info.eventChkInf[EVENTCHKINF_40_INDEX] & ~EVENTCHKINF_40_MASK; - gSaveContext.save.info.eventChkInf[EVENTCHKINF_40_INDEX] = i; + i = gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_40] & ~EVENTCHKINF_MASK(EVENTCHKINF_40); + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_40] = i; INV_CONTENT(ITEM_ZELDAS_LETTER) = ITEM_CHICKEN; diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 9ec48c5084..c8877e0e64 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -696,7 +696,8 @@ static s16 sDemoEffectLightColors[] = { DEMO_EFFECT_LIGHT_GREEN, DEMO_EFFECT_LIG static s16 sExItemTypes[] = { EXITEM_MAGIC_WIND, EXITEM_MAGIC_FIRE, EXITEM_MAGIC_DARK }; -static s16 sItemGetFlags[] = { ITEMGETINF_18_MASK, ITEMGETINF_19_MASK, ITEMGETINF_1A_MASK }; +static s16 sItemGetFlagMasks[] = { ITEMGETINF_MASK(ITEMGETINF_18), ITEMGETINF_MASK(ITEMGETINF_19), + ITEMGETINF_MASK(ITEMGETINF_1A) }; static u8 sItemIds[] = { ITEM_FARORES_WIND, ITEM_DINS_FIRE, ITEM_NAYRUS_LOVE }; @@ -808,7 +809,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) { this->itemSpawned = true; gSaveContext.healthAccumulator = 0x140; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_HEARTS_MAGIC); - gSaveContext.save.info.itemGetInf[ITEMGETINF_18_19_1A_INDEX] |= sItemGetFlags[cueIdTemp]; + gSaveContext.save.info.itemGetInf[ITEMGETINF_INDEX_18_19_1A] |= sItemGetFlagMasks[cueIdTemp]; Item_Give(play, sItemIds[cueIdTemp]); } } else { diff --git a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c index 2839607d85..23bfb153fd 100644 --- a/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c @@ -138,7 +138,7 @@ void BgSpot09Obj_Init(Actor* thisx, PlayState* play) { BgSpot09Obj* this = (BgSpot09Obj*)thisx; PRINTF("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params, - gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & EVENTCHKINF_CARPENTERS_FREE_MASK_ALL); this->dyna.actor.params &= 0xFF; if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) { diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 2fac588608..f106e270c2 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -270,7 +270,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) { freedCount = 0; for (carpenterType = 0; carpenterType < 4; carpenterType++) { - if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & + if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) { freedCount++; } @@ -399,7 +399,7 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex); this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); - gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] |= EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET_U(this->actor.params, 0, 2)); this->actor.gravity = -1.0f; diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index b683415f80..6cf0808a4f 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -108,22 +108,22 @@ static EnFrPointers sEnFrPointers = { }; #define FROG_HAS_SONG_BEEN_PLAYED(frogSongIndex) \ - (gSaveContext.save.info.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] & \ + (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_SONGS_FOR_FROGS] & \ sFrogSongIndexToEventChkInfSongsForFrogsMask[frogSongIndex]) #define FROG_SET_SONG_PLAYED(frogSongIndex) \ - gSaveContext.save.info.eventChkInf[EVENTCHKINF_SONGS_FOR_FROGS_INDEX] |= \ + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_SONGS_FOR_FROGS] |= \ sFrogSongIndexToEventChkInfSongsForFrogsMask[frogSongIndex]; static u16 sFrogSongIndexToEventChkInfSongsForFrogsMask[] = { - EVENTCHKINF_SONGS_FOR_FROGS_ZL_MASK, // FROG_ZL - EVENTCHKINF_SONGS_FOR_FROGS_EPONA_MASK, // FROG_EPONA - EVENTCHKINF_SONGS_FOR_FROGS_SARIA_MASK, // FROG_SARIA - EVENTCHKINF_SONGS_FOR_FROGS_SUNS_MASK, // FROG_SUNS - EVENTCHKINF_SONGS_FOR_FROGS_SOT_MASK, // FROG_SOT - EVENTCHKINF_SONGS_FOR_FROGS_STORMS_MASK, // FROG_STORMS - EVENTCHKINF_SONGS_FOR_FROGS_CHOIR_MASK, // FROG_CHOIR_SONG - 0, // FROG_NO_SONG + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_ZL), // FROG_ZL + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_EPONA), // FROG_EPONA + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_SARIA), // FROG_SARIA + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_SUNS), // FROG_SUNS + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_SOT), // FROG_SOT + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_STORMS), // FROG_STORMS + EVENTCHKINF_MASK(EVENTCHKINF_SONGS_FOR_FROGS_CHOIR), // FROG_CHOIR_SONG + 0, // FROG_NO_SONG }; static u8 sFrogToFrogSongIndex[] = { diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 8c466a25f7..ad1b7a1caa 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -225,7 +225,7 @@ s32 Ge2_DetectPlayerInUpdate(PlayState* play, EnGe2* this, Vec3f* pos, s16 yRot, } s32 EnGe2_CheckCarpentersFreed(void) { - if (CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & + if (CHECK_FLAG_ALL(gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_CARPENTERS_FREE] & (EVENTCHKINF_CARPENTERS_FREE_MASK_ALL | 0xF0), EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)) { return 1; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 2c20a18560..2aa163d0fb 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -605,7 +605,7 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { switch (ENHY_GET_TYPE(&this->actor)) { case ENHY_TYPE_DOG_LADY: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { - return (this->talonEventChkInf & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) + return (this->talonEventChkInf & EVENTCHKINF_MASK(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) ? 0x508D : (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B); } else if (play->sceneId == SCENE_MARKET_DAY) { @@ -738,7 +738,7 @@ u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { if (!LINK_IS_ADULT) { return GET_EVENTCHKINF(EVENTCHKINF_80) ? 0x505F : (GET_INFTABLE(INFTABLE_163) ? 0x505E : 0x505D); } else { - return (this->talonEventChkInf & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) + return (this->talonEventChkInf & EVENTCHKINF_MASK(EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO)) ? 0x5062 : (GET_INFTABLE(INFTABLE_164) ? 0x5061 : 0x5060); } @@ -1165,7 +1165,7 @@ void EnHy_WaitForObjects(EnHy* this, PlayState* play) { } if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { - this->talonEventChkInf = gSaveContext.save.info.eventChkInf[EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_INDEX]; + this->talonEventChkInf = gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_TALON_RETURNED_FROM_KAKARIKO]; } EnHy_InitSetProperties(this); diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index b5e543f450..7ce346f633 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -500,7 +500,7 @@ void EnIn_Init(Actor* thisx, PlayState* play) { respawnPos = respawn->pos; // hardcoded coords for lon lon entrance if (D_80A7B998 == 0 && respawnPos.x == 1107.0f && respawnPos.y == 0.0f && respawnPos.z == -3740.0f) { - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = 0; + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] = 0; D_80A7B998 = 1; } this->actionFunc = EnIn_WaitForObject; @@ -586,7 +586,7 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) { case INGO_RACE_STATE_RACING: EnIn_ChangeAnim(this, ENIN_ANIM_2); this->actionFunc = func_80A7A4C8; - gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = 0; + gSaveContext.eventInf[EVENTINF_INDEX_HORSES] = 0; break; case INGO_RACE_STATE_HORSE_RENTAL_PERIOD: this->actor.attentionRangeType = ATTENTION_RANGE_3; diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index 01c3788df9..dbe5e1b15c 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -64,9 +64,9 @@ void EnMu_Interact(EnMu* this, PlayState* play) { s32 randomIndex; s32 i; - textFlags = gSaveContext.eventInf[EVENTINF_20_21_22_23_24_INDEX] & + textFlags = gSaveContext.eventInf[EVENTINF_INDEX_20_21_22_23_24] & (EVENTINF_20_MASK | EVENTINF_21_MASK | EVENTINF_22_MASK | EVENTINF_23_MASK | EVENTINF_24_MASK); - gSaveContext.eventInf[EVENTINF_20_21_22_23_24_INDEX] &= + gSaveContext.eventInf[EVENTINF_INDEX_20_21_22_23_24] &= ~(EVENTINF_20_MASK | EVENTINF_21_MASK | EVENTINF_22_MASK | EVENTINF_23_MASK | EVENTINF_24_MASK); randomIndex = (play->state.frames + (s32)(Rand_ZeroOne() * 5.0f)) % 5; @@ -95,7 +95,7 @@ void EnMu_Interact(EnMu* this, PlayState* play) { textFlags |= bitmask[randomIndex]; this->defaultTextId = textIdOffset[randomIndex] | 0x7000; textFlags &= EVENTINF_20_MASK | EVENTINF_21_MASK | EVENTINF_22_MASK | EVENTINF_23_MASK | EVENTINF_24_MASK | 0xE0; - gSaveContext.eventInf[EVENTINF_20_21_22_23_24_INDEX] |= textFlags; + gSaveContext.eventInf[EVENTINF_INDEX_20_21_22_23_24] |= textFlags; } u16 EnMu_GetTextId(PlayState* play, Actor* thisx) { diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index 88ec34a096..144c76b2cb 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -66,8 +66,8 @@ static Vec3f sKakarikoPosList[] = { }; static s16 sKakarikoFlagList[] = { - INFTABLE_199_MASK, INFTABLE_19A_MASK, INFTABLE_19B_MASK, INFTABLE_19C_MASK, - INFTABLE_19D_MASK, INFTABLE_19E_MASK, INFTABLE_19F_MASK, + INFTABLE_MASK(INFTABLE_199), INFTABLE_MASK(INFTABLE_19A), INFTABLE_MASK(INFTABLE_19B), INFTABLE_MASK(INFTABLE_19C), + INFTABLE_MASK(INFTABLE_19D), INFTABLE_MASK(INFTABLE_19E), INFTABLE_MASK(INFTABLE_19F), }; static u8 sLowerRiverSpawned = false; @@ -162,7 +162,7 @@ void EnNiw_Init(Actor* thisx, PlayState* play) { fabsf(this->actor.world.pos.z - sKakarikoPosList[i].z) < 40.0f) { this->unk_2AA = i; PRINTF(VT_FGCOL(YELLOW) " 通常鶏index %d\n" VT_RST, this->unk_2AA); - if (gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] & + if (gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] & sKakarikoFlagList[i]) { this->actor.world.pos.x = 300.0f; this->actor.world.pos.y = 100.0f; diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index c58a8663f8..0415f95bb9 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -43,8 +43,8 @@ static s16 sMissingCuccoTextIds[] = { }; static s16 D_80ABB3B4[] = { - INFTABLE_199_MASK, INFTABLE_19A_MASK, INFTABLE_19B_MASK, INFTABLE_19C_MASK, - INFTABLE_19D_MASK, INFTABLE_19E_MASK, INFTABLE_19F_MASK, + INFTABLE_MASK(INFTABLE_199), INFTABLE_MASK(INFTABLE_19A), INFTABLE_MASK(INFTABLE_19B), INFTABLE_MASK(INFTABLE_19C), + INFTABLE_MASK(INFTABLE_19D), INFTABLE_MASK(INFTABLE_19E), INFTABLE_MASK(INFTABLE_19F), }; static ColliderCylinderInit sCylinderInit = { @@ -210,7 +210,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { if ((fabsf(currentCucco->actor.world.pos.x - 330.0f) < 90.0f) && (fabsf(currentCucco->actor.world.pos.z - 1610.0f) < 190.0f)) { if (this->unk_26C == 0) { - gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] |= + gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] |= D_80ABB3B4[currentCucco->unk_2AA]; if (BREG(1) != 0) { // "GET inside the chicken fence!" @@ -219,7 +219,7 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { } this->cuccosInPen++; } else if (this->unk_26C == 0) { - gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &= + gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] &= ~D_80ABB3B4[currentCucco->unk_2AA]; } } @@ -276,12 +276,13 @@ void func_80ABA244(EnNiwLady* this, PlayState* play) { this->unk_262 = TEXT_STATE_EVENT; this->unk_26A = this->cuccosInPen; PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更前 ☆☆ %x\n" VT_RST, - gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]); - gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX] &= - (u16) ~(INFTABLE_199_MASK | INFTABLE_19A_MASK | INFTABLE_19B_MASK | INFTABLE_19C_MASK | - INFTABLE_19D_MASK | INFTABLE_19E_MASK | INFTABLE_19F_MASK); + gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F]); + gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F] &= + (u16) ~(INFTABLE_MASK(INFTABLE_199) | INFTABLE_MASK(INFTABLE_19A) | INFTABLE_MASK(INFTABLE_19B) | + INFTABLE_MASK(INFTABLE_19C) | INFTABLE_MASK(INFTABLE_19D) | INFTABLE_MASK(INFTABLE_19E) | + INFTABLE_MASK(INFTABLE_19F)); PRINTF(VT_FGCOL(CYAN) "☆☆☆☆☆ 柵内BIT変更後 ☆☆ %x\n" VT_RST, - gSaveContext.save.info.infTable[INFTABLE_199_19A_19B_19C_19D_19E_19F_INDEX]); + gSaveContext.save.info.infTable[INFTABLE_INDEX_199_19A_19B_19C_19D_19E_19F]); PRINTF("\n\n"); this->actionFunc = func_80ABA654; return; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index e4ad439806..1c8a222c06 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -74,7 +74,12 @@ static EnSthActionFunc sRewardObtainedWaitActions[6] = { }; static u16 sEventFlags[6] = { - 0, EVENTCHKINF_DA_MASK, EVENTCHKINF_DB_MASK, EVENTCHKINF_DC_MASK, EVENTCHKINF_DD_MASK, EVENTCHKINF_DE_MASK, + 0, + EVENTCHKINF_MASK(EVENTCHKINF_DA), + EVENTCHKINF_MASK(EVENTCHKINF_DB), + EVENTCHKINF_MASK(EVENTCHKINF_DC), + EVENTCHKINF_MASK(EVENTCHKINF_DD), + EVENTCHKINF_MASK(EVENTCHKINF_DE), }; static s16 sGetItemIds[6] = { @@ -156,7 +161,7 @@ void EnSth_SetupAfterObjectLoaded(EnSth* this, PlayState* play) { this->eventFlag = sEventFlags[this->actor.params]; params = &this->actor.params; - if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] & this->eventFlag) { + if (gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_DA_DB_DC_DD_DE] & this->eventFlag) { EnSth_SetupAction(this, sRewardObtainedWaitActions[*params]); } else { EnSth_SetupAction(this, EnSth_RewardUnobtainedWait); @@ -256,7 +261,7 @@ void EnSth_GiveReward(EnSth* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; EnSth_SetupAction(this, EnSth_RewardObtainedTalk); - gSaveContext.save.info.eventChkInf[EVENTCHKINF_DA_DB_DC_DD_DE_INDEX] |= this->eventFlag; + gSaveContext.save.info.eventChkInf[EVENTCHKINF_INDEX_DA_DB_DC_DD_DE] |= this->eventFlag; } else { EnSth_GivePlayerItem(this, play); } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 3676becdc4..0c10cbc4d6 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -10760,7 +10760,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; if (play->sceneId <= SCENE_INSIDE_GANONS_CASTLE_COLLAPSE) { - gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneId]; + gSaveContext.save.info.infTable[INFTABLE_INDEX_1AX] |= gBitFlags[play->sceneId]; } startMode = PLAYER_GET_START_MODE(thisx); diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 33c98159c9..e633b06e2e 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -466,7 +466,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { Inventory_ChangeEquipment(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP]); if (pauseCtx->cursorY[PAUSE_EQUIP] == 0) { - gSaveContext.save.info.infTable[INFTABLE_1DX_INDEX] = 0; + gSaveContext.save.info.infTable[INFTABLE_INDEX_1DX] = 0; gSaveContext.save.info.equips.buttonItems[0] = cursorItem; if ((pauseCtx->cursorX[PAUSE_EQUIP] == 3) && (gSaveContext.save.info.playerData.bgsFlag != 0)) {