1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-17 04:20:44 +00:00

Defines for SaveContext flags (eventChkInf, itemGetInf, infTable, eventInf) (#1094)

* script-assisted `itemGetInf` flags

* comment near non-trivial `itemGetInf` usage

* Run formatter

* Try something with the itemgetinf flags that can't use the packed value

* Add defines for `eventChkInf` (direct access)

* Add defines for `eventChkInf` (access through `Flags_GetEventChkInf`)

* Add defines for `eventChkInf` (access through `Flags_SetEventChkInf`)

* Add defines for `infTable` (direct access)

* Add defines for `infTable` (used by `Flags_GetInfTable`)

* Add defines for `infTable` (used by `Flags_SetInfTable`)

* Add defines for `eventInf`

* parenthesis cleanup near `GET_EVENTCHKINF` usage

* parenthesis cleanup near `GET_ITEMGETINF` usage

* parenthesis cleanup near `GET_INFTABLE` usage

* fixup one `eventInf` usage

* parenthesis cleanup near `GET_EVENTINF` usage

* parenthesis cleanup near `Flags_GetEventChkInf` usage

* slight `z64save.h` formatting improvement

* Improve itemGetInf flags in z_bg_dy_yoseizo

* Questionable improvement in z_en_ge2

* Questionable improvement in z_en_daiku

* Questionable improvement in z_en_mu

* Run formatter

* Parentheses around `gSaveContext` macros arguments

* Move individual flags define to the end of z64save.h, and improve comments separating the groups
This commit is contained in:
Dragorn421 2022-04-29 20:19:48 +02:00 committed by GitHub
parent 16790bc253
commit 6336df5fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
146 changed files with 1931 additions and 1315 deletions

View file

@ -890,7 +890,7 @@ void func_80986BE4(DemoIm* this, s32 arg1) {
}
void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
if (gSaveContext.eventChkInf[4] & 1) {
if (GET_EVENTCHKINF(EVENTCHKINF_40)) {
this->action = 24;
this->drawConfig = 1;
this->unk_280 = 1;
@ -902,14 +902,14 @@ void func_80986C30(DemoIm* this, GlobalContext* globalCtx) {
if (func_80986A5C(this, globalCtx)) {
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(gZeldasCourtyardLullabyCs);
gSaveContext.cutsceneTrigger = 1;
gSaveContext.eventChkInf[5] |= 0x200;
SET_EVENTCHKINF(EVENTCHKINF_59);
Item_Give(globalCtx, ITEM_SONG_LULLABY);
func_80985F54(this);
}
}
void func_80986CC8(DemoIm* this) {
if (gSaveContext.eventChkInf[4] & 1) {
if (GET_EVENTCHKINF(EVENTCHKINF_40)) {
this->action = 26;
this->drawConfig = 1;
this->unk_280 = 1;
@ -919,7 +919,7 @@ void func_80986CC8(DemoIm* this) {
void func_80986CFC(DemoIm* this, GlobalContext* globalCtx) {
if (func_80986A5C(this, globalCtx)) {
gSaveContext.eventChkInf[4] |= 0x1000;
SET_EVENTCHKINF(EVENTCHKINF_4C);
this->action = 19;
}
}
@ -928,9 +928,9 @@ void func_80986D40(DemoIm* this, GlobalContext* globalCtx) {
if (gSaveContext.sceneSetupIndex == 6) {
this->action = 19;
this->drawConfig = 1;
} else if (gSaveContext.eventChkInf[8] & 1) {
} else if (GET_EVENTCHKINF(EVENTCHKINF_80)) {
Actor_Kill(&this->actor);
} else if (!(gSaveContext.eventChkInf[5] & 0x200)) {
} else if (!GET_EVENTCHKINF(EVENTCHKINF_59)) {
this->action = 23;
} else {
this->action = 20;