summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2022-05-20 19:54:47 +0200
committerGitHub <noreply@github.com>2022-05-20 19:54:47 +0200
commitd7bbe43ba7734da2e28614debeaf521b4bcb5013 (patch)
tree1d582b7b9e482d86d6e7a6f4d65b5122f1fd22bf /src
parent0e51a51fb1d9a3d076039604ec29c9024ccf2719 (diff)
Document `eventChkInf` usage of freed carpenters flags (#1210)
* Document `eventChkInf` usage of freed carpenters flags * +`()`
Diffstat (limited to 'src')
-rw-r--r--src/code/z_map_exp.c9
-rw-r--r--src/overlays/actors/ovl_Bg_Spot09_Obj/z_bg_spot09_obj.c7
-rw-r--r--src/overlays/actors/ovl_En_Daiku/z_en_daiku.c18
-rw-r--r--src/overlays/actors/ovl_En_Ge1/z_en_ge1.c10
-rw-r--r--src/overlays/actors/ovl_En_Ge2/z_en_ge2.c7
-rw-r--r--src/overlays/actors/ovl_En_Horse/z_en_horse.c7
-rw-r--r--src/overlays/actors/ovl_En_Mm2/z_en_mm2.c3
-rw-r--r--src/overlays/actors/ovl_En_Toryo/z_en_toryo.c3
8 files changed, 24 insertions, 40 deletions
diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c
index 1e0e818e2..144f830ec 100644
--- a/src/code/z_map_exp.c
+++ b/src/code/z_map_exp.c
@@ -118,16 +118,11 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
extendedMapIndex = 0x15;
}
} else if (globalCtx->sceneNum == SCENE_SPOT09) {
- if ((LINK_AGE_IN_YEARS == YEARS_ADULT) &&
- !CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK |
- EVENTCHKINF_93_MASK)) {
+ if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
extendedMapIndex = 0x16;
}
} else if (globalCtx->sceneNum == SCENE_SPOT12) {
- if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK |
- EVENTCHKINF_93_MASK)) {
+ if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
extendedMapIndex = 0x17;
}
}
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 bddc4f703..5c3f1a1ca 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
@@ -63,9 +63,7 @@ s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) {
return this->dyna.actor.params == 0;
}
- carpentersRescued =
- CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK);
+ carpentersRescued = GET_EVENTCHKINF_CARPENTERS_FREE_ALL();
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
switch (this->dyna.actor.params) {
@@ -140,8 +138,7 @@ void BgSpot09Obj_Init(Actor* thisx, GlobalContext* globalCtx) {
BgSpot09Obj* this = (BgSpot09Obj*)thisx;
osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", this->dyna.actor.params,
- gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX] &
- (EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK));
+ gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] & EVENTCHKINF_CARPENTERS_FREE_MASK_ALL);
this->dyna.actor.params &= 0xFF;
if ((this->dyna.actor.params < 0) || (this->dyna.actor.params >= 5)) {
osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",
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 5485bab99..8c518cf60 100644
--- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
+++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c
@@ -152,13 +152,13 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 noKill = true;
s32 isFree = false;
- if ((this->actor.params & 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_90)) {
+ if ((this->actor.params & 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) {
isFree = true;
- } else if ((this->actor.params & 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_91)) {
+ } else if ((this->actor.params & 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) {
isFree = true;
- } else if ((this->actor.params & 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_92)) {
+ } else if ((this->actor.params & 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) {
isFree = true;
- } else if ((this->actor.params & 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_93)) {
+ } else if ((this->actor.params & 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) {
isFree = true;
}
@@ -271,8 +271,8 @@ void EnDaiku_UpdateText(EnDaiku* this, GlobalContext* globalCtx) {
if (this->stateFlags & ENDAIKU_STATEFLAG_GERUDODEFEATED) {
freedCount = 0;
for (carpenterType = 0; carpenterType < 4; carpenterType++) {
- if (gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX] &
- (1 << (carpenterType + EVENTCHKINF_90_SHIFT))) {
+ if (gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
+ EVENTCHKINF_CARPENTERS_FREE_MASK(carpenterType)) {
freedCount++;
}
}
@@ -400,7 +400,8 @@ void EnDaiku_InitEscape(EnDaiku* this, GlobalContext* globalCtx) {
EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_RUN, &this->currentAnimIndex);
this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2);
- gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX] |= 1 << ((this->actor.params & 3) + EVENTCHKINF_90_SHIFT);
+ gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |=
+ EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3);
this->actor.gravity = -1.0f;
this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive;
@@ -495,8 +496,7 @@ void EnDaiku_EscapeSuccess(EnDaiku* this, GlobalContext* globalCtx) {
Play_ChangeCameraStatus(globalCtx, CAM_ID_MAIN, CAM_STAT_ACTIVE);
this->subCamActive = false;
- if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
Matrix_RotateY(BINANG_TO_RAD(this->initRot.y), MTXMODE_NEW);
Matrix_MultVec3f(&D_809E4148, &vec);
gerudoGuard =
diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
index 59ba65b31..30f0ba391 100644
--- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
+++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c
@@ -209,13 +209,11 @@ void EnGe1_SetAnimationIdle(EnGe1* this) {
}
s32 EnGe1_CheckCarpentersFreed(void) {
- u16 carpenterFlags = gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX];
-
- if (!((carpenterFlags & EVENTCHKINF_90_MASK) && (carpenterFlags & EVENTCHKINF_91_MASK) &&
- (carpenterFlags & EVENTCHKINF_92_MASK) && (carpenterFlags & EVENTCHKINF_93_MASK))) {
- return 0;
+ if (!(GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0)) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1)) &&
+ GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2)) && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3)))) {
+ return false;
}
- return 1;
+ return true;
}
/**
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 8421157ef..1adb43a52 100644
--- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
+++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c
@@ -223,10 +223,9 @@ s32 Ge2_DetectPlayerInUpdate(GlobalContext* globalCtx, EnGe2* this, Vec3f* pos,
}
s32 EnGe2_CheckCarpentersFreed(void) {
- if (CHECK_FLAG_ALL(
- gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX] &
- (EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK | 0xF0),
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] &
+ (EVENTCHKINF_CARPENTERS_FREE_MASK_ALL | 0xF0),
+ EVENTCHKINF_CARPENTERS_FREE_MASK_ALL)) {
return 1;
}
return 0;
diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c
index f3f052b8f..c5af12f99 100644
--- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c
+++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c
@@ -461,8 +461,7 @@ s32 EnHorse_BgCheckBridgeJumpPoint(EnHorse* this, GlobalContext* globalCtx) {
if (this->actor.speedXZ < 12.8f) {
return false;
}
- if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
return false;
}
@@ -3578,9 +3577,7 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx2) {
this->stateFlags &= ~ENHORSE_FLAG_24;
}
- if (globalCtx->sceneNum == SCENE_SPOT09 &&
- !CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (globalCtx->sceneNum == SCENE_SPOT09 && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
EnHorse_CheckBridgeJumps(this, globalCtx);
}
diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
index 3874979dd..9ed89f799 100644
--- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
+++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c
@@ -100,8 +100,7 @@ void EnMm2_ChangeAnim(EnMm2* this, s32 index, s32* currentIndex) {
}
void func_80AAEF70(EnMm2* this, GlobalContext* globalCtx) {
- if (!CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
this->actor.textId = 0x6086;
} else if (GET_INFTABLE(INFTABLE_17F)) {
if (GET_EVENTINF(EVENTINF_10)) {
diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
index 109574b20..a606b526f 100644
--- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
+++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c
@@ -259,8 +259,7 @@ s32 func_80B206A0(EnToryo* this, GlobalContext* globalCtx) {
if (textId == 0) {
if (this->stateFlags & 1) {
- if (CHECK_FLAG_ALL(gSaveContext.eventChkInf[EVENTCHKINF_90_91_92_93_INDEX],
- EVENTCHKINF_90_MASK | EVENTCHKINF_91_MASK | EVENTCHKINF_92_MASK | EVENTCHKINF_93_MASK)) {
+ if (GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
ret = 0x606C;
} else if (GET_INFTABLE(INFTABLE_170)) {
ret = 0x606B;