1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-05 15:34:41 +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

@ -1605,7 +1605,7 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) {
textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> QUEST_HEART_PIECE_COUNT;
} else if (msgCtx->textId == 0xC && CHECK_OWNED_EQUIP(EQUIP_SWORD, 2)) {
textId = 0xB; // Traded Giant's Knife for Biggoron Sword
} else if (msgCtx->textId == 0xB4 && (gSaveContext.eventChkInf[9] & 0x40)) {
} else if (msgCtx->textId == 0xB4 && GET_EVENTCHKINF(EVENTCHKINF_96)) {
textId = 0xB5; // Destroyed Gold Skulltula
}
// Ocarina Staff + Dialog
@ -2456,7 +2456,9 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) {
if (msgCtx->disableWarpSongs || interfaceCtx->restrictions.warpSongs == 3) {
Message_StartTextbox(globalCtx, 0x88C, NULL); // "You can't warp here!"
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_04;
} else if ((gSaveContext.eventInf[0] & 0xF) != 1) {
} else if ((gSaveContext.eventInf[EVENTINF_0X_INDEX] &
(EVENTINF_00_MASK | EVENTINF_01_MASK | EVENTINF_02_MASK | EVENTINF_03_MASK)) !=
EVENTINF_00_MASK) {
Message_StartTextbox(globalCtx, msgCtx->lastPlayedSong + 0x88D,
NULL); // "Warp to [place name]?"
globalCtx->msgCtx.ocarinaMode = OCARINA_MODE_01;
@ -3217,8 +3219,10 @@ void Message_Update(GlobalContext* globalCtx) {
if (Message_ShouldAdvance(globalCtx)) {
osSyncPrintf("OCARINA_MODE=%d -> ", globalCtx->msgCtx.ocarinaMode);
globalCtx->msgCtx.ocarinaMode = (msgCtx->choiceIndex == 0) ? OCARINA_MODE_02 : OCARINA_MODE_04;
osSyncPrintf("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ", gSaveContext.eventInf[0] & 0xF, 1,
globalCtx->msgCtx.ocarinaMode);
osSyncPrintf("InRaceSeq=%d(%d) OCARINA_MODE=%d --> ",
gSaveContext.eventInf[EVENTINF_0X_INDEX] &
(EVENTINF_00_MASK | EVENTINF_01_MASK | EVENTINF_02_MASK | EVENTINF_03_MASK),
1, globalCtx->msgCtx.ocarinaMode);
Message_CloseTextbox(globalCtx);
osSyncPrintf("OCARINA_MODE=%d\n", globalCtx->msgCtx.ocarinaMode);
}