diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2022-04-24 00:41:17 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-23 16:41:17 +0200 |
| commit | 1e03b662f2a1d7ea5221695facb33b09eb6c0754 (patch) | |
| tree | 0e29b3ea1b642b83d9f537dfaf913c50dcc0e022 /src/code | |
| parent | 924c10d2d308e8cbc98b3dbfcfdc5c2c91536cc4 (diff) | |
Parameter/Item Misc Cleanup (#1201)
* Misc parameter cleanup
* More cleanup
* More cleanup
* ia4, more readable
* More comments
* PR Suggestion
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_demo.c | 4 | ||||
| -rw-r--r-- | src/code/z_message_PAL.c | 6 | ||||
| -rw-r--r-- | src/code/z_parameter.c | 167 | ||||
| -rw-r--r-- | src/code/z_play.c | 4 |
4 files changed, 100 insertions, 81 deletions
diff --git a/src/code/z_demo.c b/src/code/z_demo.c index 697618917..91510b466 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -392,10 +392,10 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* } break; case 28: - globalCtx->unk_11DE9 = 1; + globalCtx->unk_11DE9 = true; break; case 29: - globalCtx->unk_11DE9 = 0; + globalCtx->unk_11DE9 = false; break; case 30: Flags_SetEnv(globalCtx, 3); diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index 7d3fe7325..a9bac80d9 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -1592,7 +1592,7 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { if (textId == 0xC2 || textId == 0xFA) { // Increments text id based on piece of heart count, assumes the piece of heart text is all // in order and that you don't have more than the intended amount of heart pieces. - textId += (gSaveContext.inventory.questItems & 0xF0000000 & 0xF0000000) >> 0x1C; + 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)) { @@ -3259,8 +3259,8 @@ void Message_Update(GlobalContext* globalCtx) { } else { msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; } - if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) { - gSaveContext.inventory.questItems ^= 0x40000000; + if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == (4 << QUEST_HEART_PIECE_COUNT)) { + gSaveContext.inventory.questItems ^= (4 << QUEST_HEART_PIECE_COUNT); gSaveContext.healthCapacity += 0x10; gSaveContext.health += 0x10; } diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index f8f5bb6be..1073d14ad 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -134,12 +134,28 @@ static s16 sMagicBorderG = 255; static s16 sMagicBorderB = 255; static s16 sExtraItemBases[] = { - ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOMB, ITEM_BOW, - ITEM_BOW, ITEM_BOW, ITEM_SEEDS, ITEM_BOMBCHU, ITEM_BOMBCHU, ITEM_STICK, ITEM_STICK, ITEM_NUT, ITEM_NUT, + ITEM_STICK, // ITEM_STICKS_5 + ITEM_STICK, // ITEM_STICKS_10 + ITEM_NUT, // ITEM_NUTS_5 + ITEM_NUT, // ITEM_NUTS_10 + ITEM_BOMB, // ITEM_BOMBS_5 + ITEM_BOMB, // ITEM_BOMBS_10 + ITEM_BOMB, // ITEM_BOMBS_20 + ITEM_BOMB, // ITEM_BOMBS_30 + ITEM_BOW, // ITEM_ARROWS_SMALL + ITEM_BOW, // ITEM_ARROWS_MEDIUM + ITEM_BOW, // ITEM_ARROWS_LARGE + ITEM_SEEDS, // ITEM_SEEDS_30 + ITEM_BOMBCHU, // ITEM_BOMBCHUS_5 + ITEM_BOMBCHU, // ITEM_BOMBCHUS_20 + ITEM_STICK, // ITEM_STICK_UPGRADE_20 + ITEM_STICK, // ITEM_STICK_UPGRADE_30 + ITEM_NUT, // ITEM_NUT_UPGRADE_30 + ITEM_NUT, // ITEM_NUT_UPGRADE_40 }; static s16 D_80125A58 = 0; -static s16 D_80125A5C = 0; +static s16 D_80125A5C = false; static Gfx sSetupDL_80125A60[] = { gsDPPipeSync(), @@ -596,7 +612,7 @@ void func_80082850(GlobalContext* globalCtx, s16 maxAlpha) { break; } - if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 0xFF)) { + if ((globalCtx->roomCtx.curRoom.unk_03 == 1) && (interfaceCtx->minimapAlpha >= 255)) { interfaceCtx->minimapAlpha = 255; } } @@ -606,7 +622,7 @@ void func_80083108(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; s16 i; - s16 sp28 = 0; + s16 sp28 = false; if ((gSaveContext.cutsceneIndex < 0xFFF0) || ((globalCtx->sceneNum == SCENE_SPOT20) && (gSaveContext.cutsceneIndex == 0xFFF0))) { @@ -708,7 +724,7 @@ void func_80083108(GlobalContext* globalCtx) { } else if (msgCtx->msgMode == MSGMODE_NONE) { if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { if (gSaveContext.buttonStatus[0] != BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[0] = BTN_DISABLED; @@ -718,20 +734,20 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] != ITEM_HOOKSHOT) && (gSaveContext.equips.buttonItems[i] != ITEM_LONGSHOT)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; } } else { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -760,7 +776,7 @@ void func_80083108(GlobalContext* globalCtx) { gSaveContext.equips.buttonItems[0] = ITEM_NONE; } else { gSaveContext.equips.buttonItems[0] = ITEM_BOW; - sp28 = 1; + sp28 = true; } } } else { @@ -776,25 +792,25 @@ void func_80083108(GlobalContext* globalCtx) { gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0]; } } - sp28 = 1; + sp28 = true; } if (sp28) { Interface_LoadItemIcon1(globalCtx, 0); - sp28 = 0; + sp28 = false; } for (i = 1; i < 4; i++) { if ((gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_FAIRY) && (gSaveContext.equips.buttonItems[i] != ITEM_OCARINA_TIME)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -814,14 +830,14 @@ void func_80083108(GlobalContext* globalCtx) { (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[29] == 0)) { gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - sp28 = 1; + sp28 = true; if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); } } } else if ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) { - sp28 = 1; + sp28 = true; if (((gSaveContext.buttonStatus[0] & 0xFF) == BTN_DISABLED) || ((gSaveContext.buttonStatus[0] & 0xFF) == BTN_ENABLED)) { @@ -837,7 +853,7 @@ void func_80083108(GlobalContext* globalCtx) { (gSaveContext.equips.buttonItems[0] == ITEM_NONE)) { if ((gSaveContext.equips.buttonItems[0] != ITEM_NONE) || (gSaveContext.infTable[29] == 0)) { gSaveContext.equips.buttonItems[0] = gSaveContext.buttonStatus[0]; - sp28 = 1; + sp28 = true; if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { Interface_LoadItemIcon1(globalCtx, 0); @@ -845,7 +861,7 @@ void func_80083108(GlobalContext* globalCtx) { } } else { if (gSaveContext.buttonStatus[0] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[0] = BTN_DISABLED; @@ -857,7 +873,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -868,7 +884,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_BOTTLE) && (gSaveContext.equips.buttonItems[i] <= ITEM_POE)) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -881,7 +897,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -892,7 +908,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -905,7 +921,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -916,7 +932,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_HOOKSHOT) || (gSaveContext.equips.buttonItems[i] == ITEM_LONGSHOT)) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -929,7 +945,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -940,7 +956,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_FAIRY) || (gSaveContext.equips.buttonItems[i] == ITEM_OCARINA_TIME)) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -952,7 +968,7 @@ void func_80083108(GlobalContext* globalCtx) { for (i = 1; i < 4; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -963,7 +979,7 @@ void func_80083108(GlobalContext* globalCtx) { for (i = 1; i < 4; i++) { if (gSaveContext.equips.buttonItems[i] == ITEM_FARORES_WIND) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -976,7 +992,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; @@ -987,7 +1003,7 @@ void func_80083108(GlobalContext* globalCtx) { if ((gSaveContext.equips.buttonItems[i] == ITEM_DINS_FIRE) || (gSaveContext.equips.buttonItems[i] == ITEM_NAYRUS_LOVE)) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -1006,13 +1022,13 @@ void func_80083108(GlobalContext* globalCtx) { if ((globalCtx->sceneNum != SCENE_TAKARAYA) || (gSaveContext.equips.buttonItems[i] != ITEM_LENS)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_DISABLED; } else { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -1033,7 +1049,7 @@ void func_80083108(GlobalContext* globalCtx) { !((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK))) { if (gSaveContext.buttonStatus[i] == BTN_DISABLED) { - sp28 = 1; + sp28 = true; } gSaveContext.buttonStatus[i] = BTN_ENABLED; @@ -1304,7 +1320,10 @@ void func_80084BF4(GlobalContext* globalCtx, u16 flag) { } u8 Item_Give(GlobalContext* globalCtx, u8 item) { - static s16 sAmmoRefillCounts[] = { 5, 10, 20, 30, 5, 10, 30, 0, 5, 20, 1, 5, 20, 50, 200, 10 }; + static s16 sAmmoRefillCounts[] = { 5, 10, 20, 30 }; // Sticks, nuts, bombs + static s16 sArrowRefillCounts[] = { 5, 10, 30 }; + static s16 sBombchuRefillCounts[] = { 5, 20 }; + static s16 sRupeeRefillCounts[] = { 1, 5, 20, 50, 200, 10 }; s16 i; s16 slot; s16 temp; @@ -1586,17 +1605,17 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } else if ((item == ITEM_BOMBCHUS_5) || (item == ITEM_BOMBCHUS_20)) { if (gSaveContext.inventory.items[slot] == ITEM_NONE) { INV_CONTENT(ITEM_BOMBCHU) = ITEM_BOMBCHU; - AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8]; + AMMO(ITEM_BOMBCHU) += sBombchuRefillCounts[item - ITEM_BOMBCHUS_5]; return ITEM_NONE; } else { - AMMO(ITEM_BOMBCHU) += sAmmoRefillCounts[item - ITEM_BOMBCHUS_5 + 8]; + AMMO(ITEM_BOMBCHU) += sBombchuRefillCounts[item - ITEM_BOMBCHUS_5]; if (AMMO(ITEM_BOMBCHU) > 50) { AMMO(ITEM_BOMBCHU) = 50; } return ITEM_NONE; } } else if ((item >= ITEM_ARROWS_SMALL) && (item <= ITEM_ARROWS_LARGE)) { - AMMO(ITEM_BOW) += sAmmoRefillCounts[item - ITEM_ARROWS_SMALL + 4]; + AMMO(ITEM_BOW) += sArrowRefillCounts[item - ITEM_ARROWS_SMALL]; if ((AMMO(ITEM_BOW) >= CUR_CAPACITY(UPG_QUIVER)) || (AMMO(ITEM_BOW) < 0)) { AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); @@ -1659,7 +1678,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { } return ITEM_NONE; } else if ((item == ITEM_HEART_PIECE_2) || (item == ITEM_HEART_PIECE)) { - gSaveContext.inventory.questItems += 1 << (QUEST_HEART_PIECE + 4); + gSaveContext.inventory.questItems += 1 << QUEST_HEART_PIECE_COUNT; return ITEM_NONE; } else if (item == ITEM_HEART_CONTAINER) { gSaveContext.healthCapacity += 0x10; @@ -1696,7 +1715,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) { return item; } else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_INVALID_8)) { - Rupees_ChangeBy(sAmmoRefillCounts[item - ITEM_RUPEE_GREEN + 10]); + Rupees_ChangeBy(sRupeeRefillCounts[item - ITEM_RUPEE_GREEN]); return ITEM_NONE; } else if (item == ITEM_BOTTLE) { temp = SLOT(item); @@ -1942,26 +1961,26 @@ s32 Inventory_ReplaceItem(GlobalContext* globalCtx, u16 oldItem, u16 newItem) { break; } } - return 1; + return true; } } - return 0; + return false; } s32 Inventory_HasEmptyBottle(void) { u8* items = gSaveContext.inventory.items; if (items[SLOT_BOTTLE_1] == ITEM_BOTTLE) { - return 1; + return true; } else if (items[SLOT_BOTTLE_2] == ITEM_BOTTLE) { - return 1; + return true; } else if (items[SLOT_BOTTLE_3] == ITEM_BOTTLE) { - return 1; + return true; } else if (items[SLOT_BOTTLE_4] == ITEM_BOTTLE) { - return 1; + return true; } else { - return 0; + return false; } } @@ -1969,15 +1988,15 @@ s32 Inventory_HasSpecificBottle(u8 bottleItem) { u8* items = gSaveContext.inventory.items; if (items[SLOT_BOTTLE_1] == bottleItem) { - return 1; + return true; } else if (items[SLOT_BOTTLE_2] == bottleItem) { - return 1; + return true; } else if (items[SLOT_BOTTLE_3] == bottleItem) { - return 1; + return true; } else if (items[SLOT_BOTTLE_4] == bottleItem) { - return 1; + return true; } else { - return 0; + return false; } } @@ -2019,11 +2038,11 @@ s32 Inventory_ConsumeFairy(GlobalContext* globalCtx) { } osSyncPrintf("妖精使用=%d\n", bottleSlot); // "Fairy Usage=%d" gSaveContext.inventory.items[bottleSlot + i] = ITEM_BOTTLE; - return 1; + return true; } } - return 0; + return false; } void func_80086D5C(s32* buf, u16 size) { @@ -2092,11 +2111,11 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) { func_800F4524(&D_801333D4, NA_SE_VO_NA_HELLO_2, 32); } - interfaceCtx->naviCalling = 1; + interfaceCtx->naviCalling = true; sCUpInvisible = 0; sCUpTimer = 10; } else if ((naviCallState == 0x1F) && interfaceCtx->naviCalling) { - interfaceCtx->naviCalling = 0; + interfaceCtx->naviCalling = false; } } @@ -2119,7 +2138,7 @@ void Interface_LoadActionLabelB(GlobalContext* globalCtx, u16 action) { &interfaceCtx->loadQueue, NULL, "../z_parameter.c", 2228); osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK); - interfaceCtx->unk_1FA = 1; + interfaceCtx->unk_1FA = true; } s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { @@ -2133,7 +2152,7 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { // clang-format off if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if ((gSaveContext.doubleDefense != 0) && (healthChange < 0)) { + } else if (gSaveContext.doubleDefense && (healthChange < 0)) { healthChange >>= 1; osSyncPrintf("ハート減少半分!!=%d\n", healthChange); // "Heart decrease halved!!=%d" } @@ -2163,9 +2182,9 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) { if (gSaveContext.health <= 0) { gSaveContext.health = 0; - return 0; + return false; } else { - return 1; + return true; } } @@ -2602,7 +2621,7 @@ void Interface_DrawMagicBar(GlobalContext* globalCtx) { void func_80088AA0(s16 arg0) { gSaveContext.timerX[1] = 140; gSaveContext.timerY[1] = 80; - D_80125A5C = 0; + D_80125A5C = false; gSaveContext.timer2Value = arg0; if (arg0 != 0) { @@ -2625,7 +2644,7 @@ void func_80088AF0(GlobalContext* globalCtx) { void func_80088B34(s16 arg0) { gSaveContext.timerX[0] = 140; gSaveContext.timerY[0] = 80; - D_80125A5C = 0; + D_80125A5C = false; gSaveContext.timer1Value = arg0; if (arg0 != 0) { @@ -3491,11 +3510,11 @@ void Interface_Draw(GlobalContext* globalCtx) { if (gSaveContext.timer1Value == 0) { gSaveContext.timer1State = 10; - if (D_80125A5C != 0) { + if (D_80125A5C) { gSaveContext.health = 0; globalCtx->damagePlayer(globalCtx, -(gSaveContext.health + 2)); } - D_80125A5C = 0; + D_80125A5C = false; } else if (gSaveContext.timer1Value > 60) { if (timerDigits[4] == 1) { Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, @@ -3791,7 +3810,7 @@ void Interface_Draw(GlobalContext* globalCtx) { } void Interface_Update(GlobalContext* globalCtx) { - static u8 D_80125B60 = 0; + static u8 D_80125B60 = false; static s16 sPrevTimeIncrement = 0; MessageContext* msgCtx = &globalCtx->msgCtx; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; @@ -3856,9 +3875,9 @@ void Interface_Update(GlobalContext* globalCtx) { alpha = 0; } - alpha1 = 0xFF - alpha; - if (alpha1 >= 0xFF) { - alpha1 = 0xFF; + alpha1 = 255 - alpha; + if (alpha1 >= 255) { + alpha1 = 255; } osSyncPrintf("case 50 : alpha=%d alpha1=%d\n", alpha, alpha1); @@ -3907,7 +3926,7 @@ void Interface_Update(GlobalContext* globalCtx) { } gSaveContext.unk_13EC++; - if (alpha1 == 0xFF) { + if (alpha1 == 255) { gSaveContext.unk_13E8 = 0; } @@ -4060,7 +4079,7 @@ void Interface_Update(GlobalContext* globalCtx) { gSaveContext.timer1State = 1; gSaveContext.timerX[0] = 140; gSaveContext.timerY[0] = 80; - D_80125A5C = 1; + D_80125A5C = true; } } else { if (((D_80125A58 == 0) || (D_80125A58 == 3)) && (gSaveContext.timer1State < 5)) { @@ -4112,15 +4131,15 @@ void Interface_Update(GlobalContext* globalCtx) { // handle suns song in areas where time moves if (globalCtx->envCtx.timeIncrement != 0) { if (gSaveContext.sunsSongState != SUNSSONG_SPEED_TIME) { - D_80125B60 = 0; + D_80125B60 = false; if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) { - D_80125B60 = 1; + D_80125B60 = true; } gSaveContext.sunsSongState = SUNSSONG_SPEED_TIME; sPrevTimeIncrement = gTimeIncrement; gTimeIncrement = 400; - } else if (D_80125B60 == 0) { + } else if (!D_80125B60) { if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime <= 0xC001)) { gSaveContext.sunsSongState = SUNSSONG_INACTIVE; gTimeIncrement = sPrevTimeIncrement; @@ -4136,12 +4155,12 @@ void Interface_Update(GlobalContext* globalCtx) { gSaveContext.nextDayTime = 0; globalCtx->fadeTransition = 4; gSaveContext.nextTransition = 2; - globalCtx->unk_11DE9 = 1; + globalCtx->unk_11DE9 = true; } else { gSaveContext.nextDayTime = 0x8001; globalCtx->fadeTransition = 5; gSaveContext.nextTransition = 3; - globalCtx->unk_11DE9 = 1; + globalCtx->unk_11DE9 = true; } if (globalCtx->sceneNum == SCENE_SPOT13) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 7a3fed57c..7138b9a7b 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -334,7 +334,7 @@ void Gameplay_Init(GameState* thisx) { globalCtx->sceneLoadFlag = -0x14; globalCtx->unk_11E16 = 0xFF; globalCtx->unk_11E18 = 0; - globalCtx->unk_11DE9 = 0; + globalCtx->unk_11DE9 = false; if (gSaveContext.gameMode != 1) { if (gSaveContext.nextTransition == 0xFF) { @@ -856,7 +856,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { LOG_NUM("1", 1, "../z_play.c", 3637); } - if (globalCtx->unk_11DE9 == 0) { + if (!globalCtx->unk_11DE9) { Actor_UpdateAll(globalCtx, &globalCtx->actorCtx); } |
