mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-22 06:52:03 +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:
parent
16790bc253
commit
6336df5fcd
146 changed files with 1931 additions and 1315 deletions
|
@ -364,7 +364,7 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
|
||||
switch (thisx->params & 0x3F) {
|
||||
case 8:
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x402A;
|
||||
}
|
||||
break;
|
||||
|
@ -379,7 +379,7 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
return 0x402D;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x4007;
|
||||
}
|
||||
break;
|
||||
|
@ -389,8 +389,8 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
return 0x402E;
|
||||
}
|
||||
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
return (gSaveContext.infTable[18] & 0x10) ? 0x4009 : 0x4008;
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return GET_INFTABLE(INFTABLE_124) ? 0x4009 : 0x4008;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -398,10 +398,10 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
return 0x402D;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 2) {
|
||||
return (gSaveContext.infTable[18] & 0x200) ? 0x400B : 0x402F;
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_31)) {
|
||||
return GET_INFTABLE(INFTABLE_129) ? 0x400B : 0x402F;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x400A;
|
||||
}
|
||||
break;
|
||||
|
@ -410,7 +410,7 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
return 0x402E;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x400C;
|
||||
}
|
||||
break;
|
||||
|
@ -420,10 +420,10 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
return 0x402D;
|
||||
}
|
||||
|
||||
if (gSaveContext.eventChkInf[3] & 8) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_33)) {
|
||||
return 0x4010;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x400F;
|
||||
}
|
||||
break;
|
||||
|
@ -432,7 +432,7 @@ u16 func_80B61024(GlobalContext* globalCtx, Actor* thisx) {
|
|||
if (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) {
|
||||
return 0x402E;
|
||||
}
|
||||
if (gSaveContext.eventChkInf[3] & 1) {
|
||||
if (GET_EVENTCHKINF(EVENTCHKINF_30)) {
|
||||
return 0x4011;
|
||||
}
|
||||
break;
|
||||
|
@ -457,13 +457,13 @@ s16 func_80B61298(GlobalContext* globalCtx, Actor* thisx) {
|
|||
case 0x4021:
|
||||
return 0;
|
||||
case 0x4008:
|
||||
gSaveContext.infTable[18] |= 0x10;
|
||||
SET_INFTABLE(INFTABLE_124);
|
||||
break;
|
||||
case 0x402F:
|
||||
gSaveContext.infTable[18] |= 0x200;
|
||||
SET_INFTABLE(INFTABLE_129);
|
||||
break;
|
||||
}
|
||||
gSaveContext.eventChkInf[3] |= 1;
|
||||
SET_EVENTCHKINF(EVENTCHKINF_30);
|
||||
return 0;
|
||||
|
||||
case TEXT_STATE_CHOICE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue