diff --git a/include/z64audio.h b/include/z64audio.h index fe63f75702..d2f3d6360f 100644 --- a/include/z64audio.h +++ b/include/z64audio.h @@ -857,9 +857,9 @@ typedef struct { /* 0x1E38 */ OSMesg externalLoadMsgBuf[16]; /* 0x1E78 */ OSMesgQueue preloadSampleQueue; /* 0x1E90 */ OSMesg preloadSampleMsgBuf[16]; - /* 0x1ED0 */ OSMesgQueue currAudioFrameDmaQueue; - /* 0x1EE8 */ OSMesg currAudioFrameDmaMsgBuf[64]; - /* 0x1FE8 */ OSIoMesg currAudioFrameDmaIoMsgBuf[64]; + /* 0x1ED0 */ OSMesgQueue curAudioFrameDmaQueue; + /* 0x1EE8 */ OSMesg curAudioFrameDmaMsgBuf[64]; + /* 0x1FE8 */ OSIoMesg curAudioFrameDmaIoMsgBuf[64]; /* 0x25E8 */ OSMesgQueue syncDmaQueue; /* 0x2600 */ OSMesg syncDmaMesg; /* 0x2604 */ OSIoMesg syncDmaIoMesg; diff --git a/include/z64camera.h b/include/z64camera.h index c7ff017e32..48d4f1cc7c 100644 --- a/include/z64camera.h +++ b/include/z64camera.h @@ -170,7 +170,7 @@ typedef enum { /* 0x20 */ CAM_SET_START1, // Scene/room door transitions that snap the camera to a fixed location (example: ganon's towers doors climbing up) /* 0x21 */ CAM_SET_FREE0, // Full manual control is given over the camera /* 0x22 */ CAM_SET_FREE2, // Various OnePoint Cutscenes, 10 total (example: falling chest) - /* 0x23 */ CAM_SET_PIVOT_CORNER, // Inside the carpenter jail cells from theives hideout "CIRCLE4" + /* 0x23 */ CAM_SET_PIVOT_CORNER, // Inside the carpenter jail cells from thieves hideout "CIRCLE4" /* 0x24 */ CAM_SET_PIVOT_WATER_SURFACE, // Player diving from the surface of the water to underwater "CIRCLE5" /* 0x25 */ CAM_SET_CS_0, // Various cutscenes "DEMO0" /* 0x26 */ CAM_SET_CS_TWISTED_HALLWAY, // Never set to, but checked in twisting hallway (Forest Temple) "DEMO1" diff --git a/include/z64environment.h b/include/z64environment.h index ca76e3d9bf..0269c443d4 100644 --- a/include/z64environment.h +++ b/include/z64environment.h @@ -51,7 +51,7 @@ typedef enum { typedef enum { /* 0 */ LIGHTNING_OFF, // no lightning - /* 1 */ LIGHTNING_ON, // request ligtning strikes at random intervals + /* 1 */ LIGHTNING_ON, // request lightning strikes at random intervals /* 2 */ LIGHTNING_LAST // request one lightning strike before turning off } LightningState; diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index fd61dc9846..4b586c8c5e 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -1172,7 +1172,7 @@ SampleCacheEntry* AudioHeap_AllocTemporarySampleCacheEntry(u32 size) { index = -1; for (i = 0; i < gAudioCtx.preloadSampleStackTop; i++) { preload = &gAudioCtx.preloadSampleStack[i]; - if (preload->isFree == false) { + if (!preload->isFree) { startRamAddr = preload->ramAddr; endRamAddr = preload->ramAddr + preload->sample->size - 1; @@ -1408,7 +1408,7 @@ void AudioHeap_ApplySampleBankCacheInternal(s32 apply, s32 sampleBankId) { } fakematch = &change.oldAddr; - if ((apply != false) && (apply == true)) { + if (apply && (apply == true)) { u32 temp = change.newAddr; change.newAddr = *fakematch; // = change.oldAddr diff --git a/src/code/audio_load.c b/src/code/audio_load.c index b32b47963e..f30527d971 100644 --- a/src/code/audio_load.c +++ b/src/code/audio_load.c @@ -192,8 +192,8 @@ void* AudioLoad_DmaSampleData(u32 devAddr, u32 size, s32 arg2, u8* dmaIndexRef, dma->ttl = 3; dma->devAddr = dmaDevAddr; dma->sizeUnused = transfer; - AudioLoad_Dma(&gAudioCtx.currAudioFrameDmaIoMsgBuf[gAudioCtx.curAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, - dmaDevAddr, dma->ramAddr, transfer, &gAudioCtx.currAudioFrameDmaQueue, medium, "SUPERDMA"); + AudioLoad_Dma(&gAudioCtx.curAudioFrameDmaIoMsgBuf[gAudioCtx.curAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, + dmaDevAddr, dma->ramAddr, transfer, &gAudioCtx.curAudioFrameDmaQueue, medium, "SUPERDMA"); *dmaIndexRef = dmaIndex; return (devAddr - dmaDevAddr) + dma->ramAddr; } @@ -1166,8 +1166,8 @@ void AudioLoad_Init(void* heap, u32 heapSize) { gAudioCtx.rspTask[0].task.t.data_size = 0; gAudioCtx.rspTask[1].task.t.data_size = 0; osCreateMesgQueue(&gAudioCtx.syncDmaQueue, &gAudioCtx.syncDmaMesg, 1); - osCreateMesgQueue(&gAudioCtx.currAudioFrameDmaQueue, gAudioCtx.currAudioFrameDmaMsgBuf, - ARRAY_COUNT(gAudioCtx.currAudioFrameDmaMsgBuf)); + osCreateMesgQueue(&gAudioCtx.curAudioFrameDmaQueue, gAudioCtx.curAudioFrameDmaMsgBuf, + ARRAY_COUNT(gAudioCtx.curAudioFrameDmaMsgBuf)); osCreateMesgQueue(&gAudioCtx.externalLoadQueue, gAudioCtx.externalLoadMsgBuf, ARRAY_COUNT(gAudioCtx.externalLoadMsgBuf)); osCreateMesgQueue(&gAudioCtx.preloadSampleQueue, gAudioCtx.preloadSampleMsgBuf, @@ -1824,7 +1824,7 @@ s32 AudioLoad_ProcessSamplePreloads(s32 resetStatus) { preloadIndex >>= 24; preload = &gAudioCtx.preloadSampleStack[preloadIndex]; - if (preload->isFree == false) { + if (!preload->isFree) { sample = preload->sample; key = (u32)sample->sampleAddr + sample->size + sample->medium; if (key == preload->endAndMediumKey) { diff --git a/src/code/audio_synthesis.c b/src/code/audio_synthesis.c index ca7467f91c..51b2c2e5ab 100644 --- a/src/code/audio_synthesis.c +++ b/src/code/audio_synthesis.c @@ -1326,7 +1326,7 @@ Acmd* AudioSynth_ApplyHaasEffect(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS aDMEMMove(cmd++, DMEM_TEMP, DMEM_HAAS_TEMP + haasEffectDelaySize, size); } - if (haasEffectDelaySize) { // != 0 + if ((u32)haasEffectDelaySize != 0) { // Save excessive samples for next iteration aSaveBuffer(cmd++, DMEM_HAAS_TEMP + size, synthState->synthesisBuffers->haasEffectDelayState, ALIGN16(haasEffectDelaySize)); diff --git a/src/code/code_800AD920.c b/src/code/code_800AD920.c index 3bc30b1c5d..94479e164a 100644 --- a/src/code/code_800AD920.c +++ b/src/code/code_800AD920.c @@ -27,7 +27,7 @@ void func_800AD950(struct_80166500* this) { void func_800AD958(struct_80166500* this, Gfx** gfxp) { Gfx* gfx = *gfxp; u16* tex = D_0E000000; - s32 fmt = this->useRgba == false ? G_IM_FMT_IA : G_IM_FMT_RGBA; + s32 fmt = !this->useRgba ? G_IM_FMT_IA : G_IM_FMT_RGBA; s32 y; s32 height = 6; diff --git a/src/code/code_800E4FE0.c b/src/code/code_800E4FE0.c index 7b575d025a..53cd7d2467 100644 --- a/src/code/code_800E4FE0.c +++ b/src/code/code_800E4FE0.c @@ -46,7 +46,7 @@ AudioTask* func_800E5000(void) { s32 pad; s32 j; s32 sp5C; - s16* currAiBuffer; + s16* curAiBuffer; OSTask_t* task; s32 index; u32 sp4C; @@ -88,21 +88,21 @@ AudioTask* func_800E5000(void) { sp5C = gAudioCtx.curAudioFrameDmaCount; for (i = 0; i < gAudioCtx.curAudioFrameDmaCount; i++) { - if (osRecvMesg(&gAudioCtx.currAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0) { + if (osRecvMesg(&gAudioCtx.curAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK) == 0) { sp5C--; } } if (sp5C != 0) { for (i = 0; i < sp5C; i++) { - osRecvMesg(&gAudioCtx.currAudioFrameDmaQueue, NULL, OS_MESG_BLOCK); + osRecvMesg(&gAudioCtx.curAudioFrameDmaQueue, NULL, OS_MESG_BLOCK); } } - sp48 = MQ_GET_COUNT(&gAudioCtx.currAudioFrameDmaQueue); + sp48 = MQ_GET_COUNT(&gAudioCtx.curAudioFrameDmaQueue); if (sp48 != 0) { for (i = 0; i < sp48; i++) { - osRecvMesg(&gAudioCtx.currAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK); + osRecvMesg(&gAudioCtx.curAudioFrameDmaQueue, NULL, OS_MESG_NOBLOCK); } } @@ -133,7 +133,7 @@ AudioTask* func_800E5000(void) { gAudioCtx.curAbiCmdBuf = gAudioCtx.abiCmdBufs[gAudioCtx.rspTaskIndex]; index = gAudioCtx.curAiBufIndex; - currAiBuffer = gAudioCtx.aiBuffers[index]; + curAiBuffer = gAudioCtx.aiBuffers[index]; gAudioCtx.aiBufLengths[index] = (s16)((((gAudioCtx.audioBufferParameters.samplesPerFrameTarget - samplesRemainingInAi) + @@ -162,7 +162,7 @@ AudioTask* func_800E5000(void) { } gAudioCtx.curAbiCmdBuf = - AudioSynth_Update(gAudioCtx.curAbiCmdBuf, &abiCmdCnt, currAiBuffer, gAudioCtx.aiBufLengths[index]); + AudioSynth_Update(gAudioCtx.curAbiCmdBuf, &abiCmdCnt, curAiBuffer, gAudioCtx.aiBufLengths[index]); // Update audioRandom to the next random number gAudioCtx.audioRandom = (gAudioCtx.audioRandom + gAudioCtx.totalTaskCount) * osGetCount(); diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index f316798a5c..4fa6b50a96 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -140,7 +140,7 @@ void Audio_RemoveMatchingSfxRequests(u8 aspect, SfxBankEntry* cmp) { break; } if (remove) { - req->sfxId = 0; + req->sfxId = NA_SE_NONE; } } } @@ -158,9 +158,11 @@ void Audio_ProcessSfxRequest(void) { req = &sSfxRequests[gSfxRequestReadIndex]; evictIndex = 0x80; - if (req->sfxId == 0) { + + if (req->sfxId == NA_SE_NONE) { return; } + bankId = SFX_BANK(req->sfxId); if ((1 << bankId) & D_801333F0) { AudioDebug_ScrPrt("SE", req->sfxId); diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 0897474572..f3575870e3 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -1610,7 +1610,7 @@ void BgCheck_Allocate(CollisionContext* colCtx, PlayState* play, CollisionHeader customNodeListMax = sceneSubdivisionList[i].nodeListMax; } } - if (useCustomSubdivisions == false) { + if (!useCustomSubdivisions) { colCtx->subdivAmount.x = 16; colCtx->subdivAmount.y = 4; colCtx->subdivAmount.z = 16; @@ -2296,7 +2296,7 @@ s32 BgCheck_CheckLineImpl(CollisionContext* colCtx, u16 xpFlags1, u16 xpFlags2, sectorMin.z += colCtx->subdivLength.z; sectorMax.z += colCtx->subdivLength.z; } - } else if (BgCheck_PosInStaticBoundingBox(colCtx, posA) == false) { + } else if (!BgCheck_PosInStaticBoundingBox(colCtx, posA)) { return false; } else { result = @@ -2722,7 +2722,7 @@ s32 DynaPoly_SetBgActor(PlayState* play, DynaCollisionContext* dyna, Actor* acto } } - if (foundSlot == false) { + if (!foundSlot) { osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf("DynaPolyInfo_setActor():ダイナミックポリゴン 空きインデックスはありません\n"); osSyncPrintf(VT_RST); @@ -2788,7 +2788,7 @@ void DynaPoly_DeleteBgActor(PlayState* play, DynaCollisionContext* dyna, s32 bgI osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("DynaPolyInfo_delReserve():index %d\n", bgId); osSyncPrintf(VT_RST); - if (DynaPoly_IsBgIdBgActor(bgId) == false) { + if (!DynaPoly_IsBgIdBgActor(bgId)) { if (bgId == -1) { osSyncPrintf(VT_FGCOL(GREEN)); @@ -3178,8 +3178,8 @@ f32 BgCheck_RaycastDownDyna(DynaRaycastDown* dynaRaycastDown) { if (dynaRaycastDown->actor == dynaRaycastDown->colCtx->dyna.bgActors[i].actor || dynaRaycastDown->pos->y < dynaRaycastDown->colCtx->dyna.bgActors[i].minY || - Math3D_XZInSphere(&dynaRaycastDown->colCtx->dyna.bgActors[i].boundingSphere, dynaRaycastDown->pos->x, - dynaRaycastDown->pos->z) == false) { + !Math3D_XZInSphere(&dynaRaycastDown->colCtx->dyna.bgActors[i].boundingSphere, dynaRaycastDown->pos->x, + dynaRaycastDown->pos->z)) { continue; } diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 7c4d4259a6..e4d758f151 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -3537,7 +3537,7 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a return 0; } - if (intersect2 == false) { + if (!intersect2) { if (frac1 < 0.0f || 1.0f < frac1) { return 0; } @@ -3564,7 +3564,7 @@ s32 CollisionCheck_CylSideVsLineSeg(f32 radius, f32 height, f32 offset, Vec3f* a ((frac2 * itemStep.y + actorToItem.y < 0.0f) || (height < frac2 * itemStep.y + actorToItem.y))) { intersect2 = false; } - if (intersect1 == false && intersect2 == false) { + if (!intersect1 && !intersect2) { return 0; } else if ((intersect1 == true) && (intersect2 == true)) { out1->x = frac1 * itemStep.x + actorToItem.x + actorPos->x; diff --git a/src/code/z_effect.c b/src/code/z_effect.c index a72fbc4947..dd5436bc2a 100644 --- a/src/code/z_effect.c +++ b/src/code/z_effect.c @@ -109,7 +109,7 @@ void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* switch (type) { case EFFECT_SPARK: for (i = 0; i < SPARK_COUNT; i++) { - if (sEffectContext.sparks[i].status.active == false) { + if (!sEffectContext.sparks[i].status.active) { slotFound = true; *pIndex = i; effect = &sEffectContext.sparks[i].effect; @@ -121,7 +121,7 @@ void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* case EFFECT_BLURE1: case EFFECT_BLURE2: for (i = 0; i < BLURE_COUNT; i++) { - if (sEffectContext.blures[i].status.active == false) { + if (!sEffectContext.blures[i].status.active) { slotFound = true; *pIndex = i + SPARK_COUNT; effect = &sEffectContext.blures[i].effect; @@ -132,7 +132,7 @@ void Effect_Add(PlayState* play, s32* pIndex, s32 type, u8 arg3, u8 arg4, void* break; case EFFECT_SHIELD_PARTICLE: for (i = 0; i < SHIELD_PARTICLE_COUNT; i++) { - if (sEffectContext.shieldParticles[i].status.active == false) { + if (!sEffectContext.shieldParticles[i].status.active) { slotFound = true; *pIndex = i + SPARK_COUNT + BLURE_COUNT; effect = &sEffectContext.shieldParticles[i].effect; diff --git a/src/code/z_message_PAL.c b/src/code/z_message_PAL.c index b0805ba3b4..b076757bdd 100644 --- a/src/code/z_message_PAL.c +++ b/src/code/z_message_PAL.c @@ -183,7 +183,7 @@ void Message_CloseTextbox(PlayState* play) { msgCtx->stateTimer = 2; msgCtx->msgMode = MSGMODE_TEXT_CLOSING; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_DEFAULT; - Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } } @@ -743,10 +743,9 @@ u16 Message_DrawItemIcon(PlayState* play, u16 itemId, Gfx** p, u16 i) { MessageContext* msgCtx = &play->msgCtx; // clang-format off - if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultReverb); } // clang-format on @@ -860,7 +859,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { play->msgCtx.textPosX = R_TEXT_INIT_XPOS; - if (sTextIsCredits == false) { + if (!sTextIsCredits) { msgCtx->textPosY = R_TEXT_INIT_YPOS; } else { msgCtx->textPosY = YREG(1); @@ -898,7 +897,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_BOX_BREAK: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { if (!sTextboxSkipped) { - Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_AWAIT_NEXT; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); @@ -916,7 +915,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { case MESSAGE_TEXTID: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_HAS_NEXT; if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_DONE; Font_LoadMessageBoxIcon(font, TEXTBOX_ICON_TRIANGLE); @@ -948,6 +947,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { if (character) {} } + FALLTHROUGH; case MESSAGE_QUICKTEXT_DISABLE: break; case MESSAGE_AWAIT_BUTTON_PRESS: @@ -996,10 +996,9 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { break; case MESSAGE_BACKGROUND: // clang-format off - if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultFreqAndVolScale, - &gSfxDefaultReverb); + if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { \ + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } // clang-format on gDPPipeSync(gfx++); @@ -1113,7 +1112,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { return; case MESSAGE_PERSISTENT: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING) { - Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->msgMode = MSGMODE_TEXT_DONE; msgCtx->textboxEndType = TEXTBOX_ENDTYPE_PERSISTENT; @@ -1133,7 +1132,7 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { default: if (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING && i + 1 == msgCtx->textDrawPos && msgCtx->textDelayTimer == msgCtx->textDelay) { - Audio_PlaySfxGeneral(0, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, + Audio_PlaySfxGeneral(NA_SE_NONE, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } Message_DrawTextChar(play, &font->charTexBuf[charTexIdx], &gfx); @@ -1755,7 +1754,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { s32 textId; s16 j; s16 i; - s16 noStop; + s16 noStopDoAction; s32 k; osSyncPrintf(VT_FGCOL(GREEN)); @@ -1781,7 +1780,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { // "Ocarina Number" osSyncPrintf(VT_FGCOL(RED) "☆☆☆☆☆ オカリナ番号=%d(%d) ☆☆☆☆☆\n" VT_RST, ocarinaActionId, 2); - noStop = false; + noStopDoAction = false; if (ocarinaActionId >= 0x893) { Message_OpenText(play, ocarinaActionId); // You played the [song name] textId = ocarinaActionId + 0x86E; @@ -1805,7 +1804,7 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { } } else { msgCtx->ocarinaAction = ocarinaActionId; - noStop = true; + noStopDoAction = true; if (ocarinaActionId >= OCARINA_ACTION_PLAYBACK_MINUET) { osSyncPrintf("222222222\n"); Message_OpenText(play, 0x86D); // Play using [A] and [C]. @@ -1835,11 +1834,11 @@ void Message_StartOcarinaImpl(PlayState* play, u16 ocarinaActionId) { msgCtx->msgMode = MSGMODE_TEXT_CONTINUING; } msgCtx->textboxColorAlphaCurrent = msgCtx->textboxColorAlphaTarget; - if (noStop == false) { + if (!noStopDoAction) { Interface_LoadActionLabelB(play, DO_ACTION_STOP); - noStop = gSaveContext.hudVisibilityMode; + noStopDoAction = gSaveContext.hudVisibilityMode; Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_B_ALT); - gSaveContext.hudVisibilityMode = noStop; + gSaveContext.hudVisibilityMode = noStopDoAction; } // "Music Performance Start" osSyncPrintf("演奏開始\n"); @@ -2091,7 +2090,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { msgCtx->stateTimer = 20; msgCtx->msgMode = MSGMODE_SONG_DEMONSTRATION_SELECT_INSTRUMENT; } else { - AudioOcarina_Start((1 << (msgCtx->ocarinaAction + 0x11)) + 0x8000); + AudioOcarina_Start((1 << (msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET)) + 0x8000); // "Performance Check" osSyncPrintf("演奏チェック=%d\n", msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET); msgCtx->msgMode = MSGMODE_SONG_PLAYBACK; @@ -2470,9 +2469,9 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_SONG_PLAYED_ACT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { - if (msgCtx->lastPlayedSong < OCARINA_SONG_SARIAS && - (msgCtx->ocarinaAction < OCARINA_ACTION_PLAYBACK_MINUET || - msgCtx->ocarinaAction >= OCARINA_ACTION_PLAYBACK_SARIA)) { + if ((msgCtx->lastPlayedSong <= OCARINA_SONG_PRELUDE) && + !(msgCtx->ocarinaAction >= OCARINA_ACTION_PLAYBACK_MINUET && + msgCtx->ocarinaAction <= OCARINA_ACTION_PLAYBACK_PRELUDE)) { if (msgCtx->disableWarpSongs || interfaceCtx->restrictions.warpSongs == 3) { Message_StartTextbox(play, 0x88C, NULL); // "You can't warp here!" play->msgCtx.ocarinaMode = OCARINA_MODE_04; @@ -2500,7 +2499,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf(VT_FGCOL(YELLOW)); osSyncPrintf("Ocarina_PC_Wind=%d(%d) ☆☆☆ ", OCARINA_ACTION_CHECK_MINUET, msgCtx->ocarinaAction - OCARINA_ACTION_CHECK_MINUET); - if (msgCtx->lastPlayedSong + OCARINA_ACTION_CHECK_MINUET == msgCtx->ocarinaAction) { + if (msgCtx->lastPlayedSong == (msgCtx->ocarinaAction - OCARINA_ACTION_CHECK_MINUET)) { play->msgCtx.ocarinaMode = OCARINA_MODE_03; } else { play->msgCtx.ocarinaMode = msgCtx->lastPlayedSong - 1; @@ -2509,7 +2508,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) { osSyncPrintf(VT_FGCOL(GREEN)); osSyncPrintf("Ocarina_C_Wind=%d(%d) ☆☆☆ ", OCARINA_ACTION_PLAYBACK_MINUET, msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET); - if (msgCtx->lastPlayedSong + OCARINA_ACTION_PLAYBACK_MINUET == msgCtx->ocarinaAction) { + if (msgCtx->lastPlayedSong == (msgCtx->ocarinaAction - OCARINA_ACTION_PLAYBACK_MINUET)) { play->msgCtx.ocarinaMode = OCARINA_MODE_03; } else { play->msgCtx.ocarinaMode = OCARINA_MODE_04; @@ -2535,7 +2534,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { if (sOcarinaButtonIndexBufPos != 0 && msgCtx->ocarinaStaff->pos == 1) { sOcarinaButtonIndexBufPos = 0; } - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { msgCtx->lastOcarinaButtonIndex = sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; @@ -2548,7 +2548,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_SONG_PLAYBACK: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; sOcarinaButtonIndexBufPos++; @@ -2595,7 +2596,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_SCARECROW_LONG_RECORDING_ONGOING: msgCtx->ocarinaStaff = AudioOcarina_GetRecordingStaff(); osSyncPrintf("\nonpu_pt=%d, locate=%d", sOcarinaButtonIndexBufPos, msgCtx->ocarinaStaff->pos); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { if (sOcarinaButtonIndexBufLen >= 8) { for (buttonIndexPos = sOcarinaButtonIndexBufLen - 8, i = 0; i < 8; i++, buttonIndexPos++) { sOcarinaButtonIndexBuf[buttonIndexPos] = sOcarinaButtonIndexBuf[buttonIndexPos + 1]; @@ -2646,7 +2648,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_SCARECROW_LONG_PLAYBACK: case MSGMODE_SCARECROW_SPAWN_PLAYBACK: msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { if (sOcarinaButtonIndexBufLen >= 8) { for (buttonIndexPos = sOcarinaButtonIndexBufLen - 8, i = 0; i < 8; i++, buttonIndexPos++) { sOcarinaButtonIndexBuf[buttonIndexPos] = sOcarinaButtonIndexBuf[buttonIndexPos + 1]; @@ -2681,7 +2684,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_SCARECROW_SPAWN_RECORDING_ONGOING: msgCtx->ocarinaStaff = AudioOcarina_GetRecordingStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { msgCtx->lastOcarinaButtonIndex = sOcarinaButtonIndexBuf[sOcarinaButtonIndexBufPos] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBufPos++; @@ -2738,7 +2742,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; sOcarinaButtonIndexBufPos++; @@ -2761,7 +2766,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { case MSGMODE_MEMORY_GAME_LEFT_SKULLKID_WAIT: case MSGMODE_MEMORY_GAME_RIGHT_SKULLKID_WAIT: msgCtx->ocarinaStaff = AudioOcarina_GetPlaybackStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; sOcarinaButtonIndexBufPos++; @@ -2771,7 +2777,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { Audio_PlaySfxGeneral(NA_SE_SY_METRONOME_LV - SFX_FLAG, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; sOcarinaButtonIndexBufPos++; @@ -2796,7 +2803,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_MEMORY_GAME_ROUND_SUCCESS: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos - 1] = msgCtx->ocarinaStaff->buttonIndex; sOcarinaButtonIndexBuf[msgCtx->ocarinaStaff->pos] = OCARINA_BTN_INVALID; sOcarinaButtonIndexBufPos++; @@ -2835,7 +2843,8 @@ void Message_DrawMain(PlayState* play, Gfx** p) { break; case MSGMODE_FROGS_PLAYING: msgCtx->ocarinaStaff = AudioOcarina_GetPlayingStaff(); - if (msgCtx->ocarinaStaff->pos && sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1) { + if (((u32)msgCtx->ocarinaStaff->pos != 0) && + (sOcarinaButtonIndexBufPos == msgCtx->ocarinaStaff->pos - 1)) { msgCtx->lastOcarinaButtonIndex = msgCtx->ocarinaStaff->buttonIndex; msgCtx->ocarinaStaff->pos = sOcarinaButtonIndexBufPos = 0; Message_ResetOcarinaNoteState(); @@ -3318,7 +3327,7 @@ void Message_Update(PlayState* play) { // Later, if the ocarina has not been played and another textbox is closed, this handling // for Saria's song will be carried out. player->naviTextId = -0xE0; - player->naviActor->flags |= 0x10000; + player->naviActor->flags |= ACTOR_FLAG_16; } if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY_DONE && (play->msgCtx.ocarinaMode == OCARINA_MODE_01 || play->msgCtx.ocarinaMode == OCARINA_MODE_0B)) { diff --git a/src/code/z_play.c b/src/code/z_play.c index 825dad33b6..4eeaa8111d 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -514,7 +514,7 @@ void Play_Update(PlayState* this) { } } - if (this->transitionMode) { // != TRANS_MODE_OFF + if ((u32)this->transitionMode != TRANS_MODE_OFF) { switch (this->transitionMode) { case TRANS_MODE_SETUP: if (this->transitionTrigger != TRANS_TRIGGER_END) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 624e94d39f..5f799970aa 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1322,7 +1322,7 @@ void func_80090A28(Player* this, Vec3f* vecs) { D_8012608C.x = D_80126080.x; if (this->unk_845 >= 3) { - this->unk_845 += 1; + this->unk_845++; D_8012608C.x *= 1.0f + ((9 - this->unk_845) * 0.1f); } diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 1f7a0caaee..7dd457a30d 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -109,7 +109,7 @@ void ArrowFire_Hit(ArrowFire* this, PlayState* play) { timer = this->timer; if (timer != 0) { - this->timer -= 1; + this->timer--; if (this->timer >= 8) { offset = ((this->timer - 8) * (1.0f / 24.0f)); diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 11fb51b52b..42394e71aa 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -110,7 +110,7 @@ void ArrowIce_Hit(ArrowIce* this, PlayState* play) { timer = this->timer; if (timer != 0) { - this->timer -= 1; + this->timer--; if (this->timer >= 8) { offset = ((this->timer - 8) * (1.0f / 24.0f)); diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 5e14ddf5e2..1be30f4fe3 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -109,7 +109,7 @@ void ArrowLight_Hit(ArrowLight* this, PlayState* play) { timer = this->timer; if (timer != 0) { - this->timer -= 1; + this->timer--; if (this->timer >= 8) { offset = ((this->timer - 8) * (1.0f / 24.0f)); diff --git a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c index f72d62ae43..ae3ead0668 100644 --- a/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c +++ b/src/overlays/actors/ovl_Bg_Gate_Shutter/z_bg_gate_shutter.c @@ -116,7 +116,7 @@ void BgGateShutter_Update(Actor* thisx, PlayState* play) { BgGateShutter* this = (BgGateShutter*)thisx; if (this->unk_178 != 0) { - this->unk_178 -= 1; + this->unk_178--; } this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c index af5940506d..1df1bf5fcd 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -127,7 +127,7 @@ void func_8087BAE4(BgHaka* this, PlayState* play) { s32 pad; if (this->dyna.actor.params != 0) { - this->dyna.actor.params -= 1; + this->dyna.actor.params--; } if (this->dyna.unk_150 != 0.0f) { this->dyna.unk_150 = 0.0f; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index ef2738418e..6584633071 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -112,7 +112,7 @@ void func_80889B5C(BgHidanKousi* this, PlayState* play) { } void func_80889BC0(BgHidanKousi* this, PlayState* play) { - this->unk_168 -= 1; + this->unk_168--; if (this->dyna.actor.category == func_8005B198() || (this->unk_168 <= 0)) { BgHidanKousi_SetupAction(this, func_80889C18); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index 4c5a89bd70..3cf8ba1fb3 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -83,8 +83,8 @@ void func_80899894(BgJyaKanaami* this, PlayState* play) { if (this->dyna.actor.world.pos.x > -1000.0f && this->unk_16A == 0) { OnePointCutscene_Init(play, 3450, -99, &this->dyna.actor, CAM_ID_MAIN); } - this->unk_16A += 1; - if (this->unk_16A >= 0xA) { + this->unk_16A++; + if (this->unk_16A >= 10) { func_8089993C(this); } } diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 17e15dffbe..5a42618da2 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -89,11 +89,11 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) { if (!Flags_GetSwitch(play, this->actor.params)) { if (this->framesUntilDisable != -1) { if (this->framesUntilDisable != 0) { - this->framesUntilDisable -= 1; + this->framesUntilDisable--; } if (this->framesUntilDisable == 0) { this->framesUntilDisable = -1; - D_8089C1A0 -= 1; + D_8089C1A0--; } } } @@ -102,7 +102,7 @@ void BgMenkuriEye_Update(Actor* thisx, PlayState* play) { this->collider.base.acFlags &= ~AC_HIT; if (this->framesUntilDisable == -1) { Actor_PlaySfx(&this->actor, NA_SE_EN_AMOS_DAMAGE); - D_8089C1A0 += 1; + D_8089C1A0++; D_8089C1A0 = CLAMP_MAX(D_8089C1A0, 4); } this->framesUntilDisable = 416; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index e27736f9b5..bf5f5d3236 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -312,7 +312,7 @@ void func_808B5240(BgSpot16Bombstone* this, PlayState* play) { func_800287AC(play, &position, &sVelocity, &sAcceleration, D_808B5EB0[index][4], D_808B5EB0[index][5], D_808B5EB0[index][6]); - this->unk_158 += 1; + this->unk_158++; } } @@ -345,7 +345,7 @@ void BgSpot16Bombstone_SpawnFragments(BgSpot16Bombstone* this, PlayState* play) EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -420, 0x31, 0xF, 0xF, 0, scale, 2, 0x40, 160, KAKERA_COLOR_NONE, OBJECT_BOMBIWA, object_bombiwa_DL_0009E0); - index += 1; + index++; } while (index != ARRAY_COUNT(D_808B6074)); } } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index a054896a0e..8531ca1b31 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -277,7 +277,7 @@ void BgSpot18Obj_Update(Actor* thisx, PlayState* play) { BgSpot18Obj* this = (BgSpot18Obj*)thisx; if (this->unk_168 > 0) { - this->unk_168 -= 1; + this->unk_168--; } this->actionFunc(this, play); } diff --git a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 2940b79a26..d06cf76e94 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -1476,7 +1476,7 @@ void BossFd_UpdateEffects(BossFd* this, PlayState* play) { if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) { this->timers[3] = 50; func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30); - if (player->isBurning == false) { + if (!player->isBurning) { for (i2 = 0; i2 < PLAYER_BODYPART_MAX; i2++) { player->flameTimers[i2] = Rand_S16Offset(0, 200); } diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 8448bf2260..b79795f444 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -2820,23 +2820,9 @@ void BossVa_Update(Actor* thisx, PlayState* play2) { BossVa_UpdateEffects(play); for (i = 2; i >= 0; i--) { - if ((play->envCtx.adjAmbientColor[i] - 1) > 0) { - play->envCtx.adjAmbientColor[i] -= 1; - } else { - play->envCtx.adjAmbientColor[i] = 0; - } - - if ((play->envCtx.adjLight1Color[i] - 10) > 0) { - play->envCtx.adjLight1Color[i] -= 10; - } else { - play->envCtx.adjLight1Color[i] = 0; - } - - if ((play->envCtx.adjFogColor[i] - 10) > 0) { - play->envCtx.adjFogColor[i] -= 10; - } else { - play->envCtx.adjFogColor[i] = 0; - } + play->envCtx.adjAmbientColor[i] = MAX(play->envCtx.adjAmbientColor[i] - 1, 0); + play->envCtx.adjLight1Color[i] = MAX(play->envCtx.adjLight1Color[i] - 10, 0); + play->envCtx.adjFogColor[i] = MAX(play->envCtx.adjFogColor[i] - 10, 0); } if (this->onCeiling > 0) { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 0fa6c24dc6..570f054b91 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -1036,7 +1036,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { } } this->light.rotation += 6; - this->light.scaleFlag += 1; + this->light.scaleFlag++; break; case 3: diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index f9c3e5132e..d36f08fc79 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -591,7 +591,7 @@ void DoorShutter_Idle(DoorShutter* this, PlayState* play) { if (this->unlockTimer != 0) { Flags_SetSwitch(play, DOORSHUTTER_GET_SWITCH_FLAG(&this->dyna.actor)); if (this->doorType != SHUTTER_BOSS) { - gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; + gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B); diff --git a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c index c8eeeae28a..c4c19eff69 100644 --- a/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c +++ b/src/overlays/actors/ovl_Efc_Erupc/z_efc_erupc.c @@ -212,7 +212,7 @@ void EfcErupc_UpdateEffects(EfcErupc* this, PlayState* play) { cur->vel.x += cur->accel.x; cur->vel.y += cur->accel.y; cur->vel.z += cur->accel.z; - cur->animTimer += 1; + cur->animTimer++; index = cur->animTimer % 4; color = &effectColors[index]; cur->color.r = color->r; diff --git a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c index 54d7d804e6..172dd438e5 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -136,7 +136,7 @@ void EffDust_UpdateFunc_8099DB28(EffDust* this, PlayState* play) { this->initialPositions[i].y = -800.0f * Math_SinS(theta); this->initialPositions[i].z = -800.0f * Math_SinS(fi) * Math_CosS(theta); this->distanceTraveled[i] = 0.0f; - this->index += 1; + this->index++; } } } @@ -165,7 +165,7 @@ void EffDust_UpdateFunc_8099DD74(EffDust* this, PlayState* play) { this->initialPositions[i].y = 400.0f * Math_SinS(theta); this->initialPositions[i].z = 400.0f * Math_SinS(fi) * Math_CosS(theta); this->distanceTraveled[i] = 0.0f; - this->index += 1; + this->index++; } } } @@ -180,7 +180,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, PlayState* play) { if (parent == NULL || parent->update == NULL || !(player->stateFlags1 & PLAYER_STATE1_12)) { if (this->life != 0) { - this->life -= 1; + this->life--; } else { Actor_Kill(&this->actor); } @@ -248,7 +248,7 @@ void EffDust_UpdateFunc_8099DFC0(EffDust* this, PlayState* play) { } this->distanceTraveled[i] = 0.0f; - this->index += 1; + this->index++; } } } diff --git a/src/overlays/actors/ovl_En_Cow/z_en_cow.c b/src/overlays/actors/ovl_En_Cow/z_en_cow.c index 0b7484a02d..c3879516eb 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -160,7 +160,7 @@ void EnCow_Destroy(Actor* thisx, PlayState* play) { void func_809DF494(EnCow* this, PlayState* play) { if (this->unk_278 > 0) { - this->unk_278 -= 1; + this->unk_278--; } else { this->unk_278 = Rand_ZeroFloat(500.0f) + 40.0f; Animation_Change(&this->skelAnime, &gCowBodyChewAnim, 1.0f, this->skelAnime.curFrame, @@ -174,8 +174,8 @@ void func_809DF494(EnCow* this, PlayState* play) { } } - this->unk_27A += 1; - if (this->unk_27A >= 0x31) { + this->unk_27A++; + if (this->unk_27A > 48) { this->unk_27A = 0; } 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 2a9a0588cd..16834a0bed 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -164,7 +164,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { if (isFree == true && play->sceneId == SCENE_THIEVES_HIDEOUT) { noKill = false; - } else if (isFree == false && play->sceneId == SCENE_CARPENTERS_TENT) { + } else if (!isFree && play->sceneId == SCENE_CARPENTERS_TENT) { noKill = false; } diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 88416d60aa..1f21ece101 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -369,7 +369,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { run = false; if (runDist <= 10.0f) { - if (this->pathContinue == false) { + if (!this->pathContinue) { this->waypoint++; if (this->waypoint >= path->count) { @@ -416,7 +416,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; - if (this->run == false) { + if (!this->run) { if (angleStepDiff == 0) { this->run = true; } else { diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index ba5a20ce05..e18f49c9e7 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -226,7 +226,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Animation_PlayOnceSetSpeed(&this->skelAnime, sDoorAnims[this->openAnim], (player->stateFlags1 & PLAYER_STATE1_27) ? 0.75f : 1.5f); if (this->lockTimer != 0) { - gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; + gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; Flags_SetSwitch(play, ENDOOR_GET_LOCKED_SWITCH_FLAG(&this->actor)); Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } diff --git a/src/overlays/actors/ovl_En_Ds/z_en_ds.c b/src/overlays/actors/ovl_En_Ds/z_en_ds.c index 6817b084ca..92a4d4f7cb 100644 --- a/src/overlays/actors/ovl_En_Ds/z_en_ds.c +++ b/src/overlays/actors/ovl_En_Ds/z_en_ds.c @@ -104,7 +104,7 @@ void EnDs_TalkAfterBrewOddPotion(EnDs* this, PlayState* play) { void EnDs_BrewOddPotion3(EnDs* this, PlayState* play) { if (this->brewTimer > 0) { - this->brewTimer -= 1; + this->brewTimer--; } else { this->actionFunc = EnDs_TalkAfterBrewOddPotion; Message_ContinueTextbox(play, 0x504D); @@ -116,7 +116,7 @@ void EnDs_BrewOddPotion3(EnDs* this, PlayState* play) { void EnDs_BrewOddPotion2(EnDs* this, PlayState* play) { if (this->brewTimer > 0) { - this->brewTimer -= 1; + this->brewTimer--; } else { this->actionFunc = EnDs_BrewOddPotion3; this->brewTimer = 60; @@ -126,7 +126,7 @@ void EnDs_BrewOddPotion2(EnDs* this, PlayState* play) { void EnDs_BrewOddPotion1(EnDs* this, PlayState* play) { if (this->brewTimer > 0) { - this->brewTimer -= 1; + this->brewTimer--; } else { this->actionFunc = EnDs_BrewOddPotion2; this->brewTimer = 20; diff --git a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c index f24274e4c1..8d27e89e34 100644 --- a/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c +++ b/src/overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.c @@ -295,7 +295,7 @@ void EnExRuppy_WaitInGame(EnExRuppy* this, PlayState* play) { } void EnExRuppy_Kill(EnExRuppy* this, PlayState* play) { - this->invisible += 1; + this->invisible++; this->invisible &= 1; // Net effect is this->invisible = !this->invisible; if (this->timer == 0) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 0fe3dc394c..d0b965fe2b 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -352,7 +352,7 @@ void EnFr_DivingIntoWater(EnFr* this, PlayState* play) { vec.z = this->actor.world.pos.z; EffectSsGSplash_Spawn(play, &vec, NULL, NULL, 1, 1); - if (this->isBelowWaterSurfaceCurrent == false) { + if (!this->isBelowWaterSurfaceCurrent) { Actor_PlaySfx(&this->actor, NA_SE_EV_DIVE_INTO_WATER_L); } else { Actor_PlaySfx(&this->actor, NA_SE_EV_BOMB_DROP_WATER); @@ -594,7 +594,7 @@ s32 EnFr_SetupJumpingUp(EnFr* this, s32 frogIndex) { EnFr* frog = sEnFrPointers.frogs[frogIndex]; u8 semitone; - if (frog != NULL && frog->isJumpingUp == false) { + if ((frog != NULL) && !frog->isJumpingUp) { semitone = frog->growingScaleIndex == 3 ? sLargeFrogNotes[frogIndex] : sSmallFrogNotes[frogIndex]; if (this->songIndex == FROG_CHOIR_SONG) { frog->isJumpingToFrogSong = true; @@ -756,7 +756,7 @@ void EnFr_ChildSong(EnFr* this, PlayState* play) { void EnFr_ChildSongFirstTime(EnFr* this, PlayState* play) { EnFr* frog = sEnFrPointers.frogs[sSongToFrog[this->songIndex]]; - if (frog->isActive == false) { + if (!frog->isActive) { this->actor.textId = 0x40A9; EnFr_SetupReward(this, play, true); } diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index a7789dfbb0..957f2df07c 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -685,7 +685,7 @@ void EnFz_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->actor, 50.0f); EnFz_ApplyDamage(this, play); this->actionFunc(this, play); - if (this->isDespawning == false) { + if (!this->isDespawning) { Collider_UpdateCylinder(&this->actor, &this->collider1); Collider_UpdateCylinder(&this->actor, &this->collider2); if (this->isFreezing) { diff --git a/src/overlays/actors/ovl_En_Guest/z_en_guest.c b/src/overlays/actors/ovl_En_Guest/z_en_guest.c index 4ebf845e31..332638be11 100644 --- a/src/overlays/actors/ovl_En_Guest/z_en_guest.c +++ b/src/overlays/actors/ovl_En_Guest/z_en_guest.c @@ -113,7 +113,7 @@ void func_80A5046C(EnGuest* this) { if (this->unk_2CA != 0) { this->unk_2CA--; } else { - this->unk_30E += 1; + this->unk_30E++; if (this->unk_30E >= 3) { this->unk_30E = 0; this->unk_30D = 0; diff --git a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c index 8f03ea0943..bc613eaf5f 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -215,9 +215,9 @@ void EnHeishi3_Update(Actor* thisx, PlayState* play) { s32 pad; Actor_SetFocus(&this->actor, 60.0f); - this->unk_274 += 1; + this->unk_274++; if (this->caughtTimer != 0) { - this->caughtTimer -= 1; + this->caughtTimer--; } this->actionFunc(this, play); this->actor.shape.rot = this->actor.world.rot; diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 6d9269d403..5da716f969 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -355,7 +355,7 @@ void EnHeishi4_Update(Actor* thisx, PlayState* play) { this->headRot = this->interactInfo.headRot; this->torsoRot = this->interactInfo.torsoRot; } - this->unk_27E += 1; + this->unk_27E++; this->actionFunc(this, play); Actor_MoveXZGravity(thisx); Actor_UpdateBgCheckInfo(play, thisx, 10.0f, 10.0f, 30.0f, 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 97b802c8b7..63be1fc35d 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -1366,7 +1366,7 @@ void EnHorse_MountedGallop(EnHorse* this, PlayState* play) { if (this->noInputTimer <= 0.0f) { EnHorse_UpdateSpeed(this, play, 0.3f, -0.5f, 10.0f, 0.06f, 8.0f, 0x190); } else if (this->noInputTimer > 0.0f) { - this->noInputTimer -= 1; + this->noInputTimer--; this->actor.speed = 8.0f; } if (this->actor.speed < 6.0f) { @@ -3033,7 +3033,7 @@ void EnHorse_MountDismount(EnHorse* this, PlayState* play) { Actor_SetRideActor(play, &this->actor, mountSide); } - if (this->playerControlled == false && Actor_IsMounted(play, &this->actor) == true) { + if (!this->playerControlled && Actor_IsMounted(play, &this->actor) == true) { this->noInputTimer = 55; this->noInputTimerMax = 55; this->playerControlled = 1; @@ -3205,8 +3205,8 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { } // too close to jump - if ((movingFast == false && intersectDist < 80.0f) || (movingFast == true && intersectDist < 150.0f)) { - if (movingFast == false) { + if ((!movingFast && intersectDist < 80.0f) || (movingFast == true && intersectDist < 150.0f)) { + if (!movingFast) { this->stateFlags |= ENHORSE_FORCE_REVERSING; } else if (movingFast == true) { this->stateFlags |= ENHORSE_FORCE_REVERSING; @@ -3218,7 +3218,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { dynaPoly = DynaPoly_GetActor(&play->colCtx, bgId); if ((this->stateFlags & ENHORSE_FLAG_26) && ((dynaPoly && dynaPoly->actor.id != ACTOR_BG_UMAJUMP) || dynaPoly == NULL)) { - if (movingFast == false) { + if (!movingFast) { this->stateFlags |= ENHORSE_FORCE_REVERSING; } else if (movingFast == true) { this->stateFlags |= ENHORSE_FORCE_REVERSING; @@ -3275,7 +3275,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { obstaclePos = startPos; obstaclePos.y = this->actor.world.pos.y + 120.0f; - if (movingFast == false) { + if (!movingFast) { obstaclePos.x += (276.0f * Math_SinS(this->actor.world.rot.y)); obstaclePos.z += (276.0f * Math_CosS(this->actor.world.rot.y)); } else { @@ -3308,7 +3308,7 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, PlayState* play) { this->stateFlags |= ENHORSE_FORCE_REVERSING; EnHorse_StartBraking(this, play); } - } else if (movingFast == false && obstacleHeight > 19.0f && obstacleHeight <= 40.0f) { + } else if (!movingFast && obstacleHeight > 19.0f && obstacleHeight <= 40.0f) { EnHorse_Stub1(this); this->postDrawFunc = EnHorse_LowJumpInit; } else if ((movingFast == true && this->actor.speed < 13.8f && obstacleHeight > 19.0f && obstacleHeight <= 72.0f) || diff --git a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c index 751fe90d33..83aee17eb4 100644 --- a/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c +++ b/src/overlays/actors/ovl_En_Horse_Ganon/z_en_horse_ganon.c @@ -120,7 +120,7 @@ void func_80A686A8(EnHorseGanon* this, PlayState* play) { func_80A68660(D_80A69248, this->unk_1EC, &vec); if (Math3D_Vec3f_DistXYZ(&vec, &this->actor.world.pos) <= 400.0f) { - this->unk_1EC += 1; + this->unk_1EC++; if (this->unk_1EC >= 14) { this->unk_1EC = 0; func_80A68660(D_80A69248, 0, &vec); diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index f330c77f7f..1b9198b147 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -180,7 +180,7 @@ s16 EnKz_UpdateTalkState(PlayState* play, Actor* thisx) { void EnKz_UpdateEyes(EnKz* this) { if (DECR(this->blinkTimer) == 0) { - this->eyeIdx += 1; + this->eyeIdx++; if (this->eyeIdx >= 3) { this->blinkTimer = Rand_S16Offset(30, 30); this->eyeIdx = 0; diff --git a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c index 9a19f69bcf..a793a16957 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -211,7 +211,7 @@ s32 func_80AA08C4(EnMa1* this, PlayState* play) { void EnMa1_UpdateEyes(EnMa1* this) { if (DECR(this->blinkTimer) == 0) { - this->eyeIndex += 1; + this->eyeIndex++; if (this->eyeIndex >= 3) { this->blinkTimer = Rand_S16Offset(30, 30); this->eyeIndex = 0; diff --git a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c index 27c6c3f776..8bd61ffafa 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -175,7 +175,7 @@ s32 func_80AA1C68(EnMa2* this) { void EnMa2_UpdateEyes(EnMa2* this) { if ((!func_80AA1C68(this)) && (DECR(this->blinkTimer) == 0)) { - this->eyeIndex += 1; + this->eyeIndex++; if (this->eyeIndex >= 3) { this->blinkTimer = Rand_S16Offset(30, 30); this->eyeIndex = 0; diff --git a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c index d051638d98..43c19df76f 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -229,7 +229,7 @@ s32 func_80AA2F28(EnMa3* this) { void EnMa3_UpdateEyes(EnMa3* this) { if ((!func_80AA2F28(this)) && (DECR(this->blinkTimer) == 0)) { - this->eyeIndex += 1; + this->eyeIndex++; if (this->eyeIndex >= 3) { this->blinkTimer = Rand_S16Offset(30, 30); this->eyeIndex = 0; diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 249696eaad..3046a0cf3b 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -308,7 +308,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, 90.0f); this->actor.flags &= ~ACTOR_FLAG_0; - this->actor.naviEnemyId += 1; // NAVI_ENEMY_MOBLIN_CLUB + this->actor.naviEnemyId += NAVI_ENEMY_MOBLIN_CLUB - NAVI_ENEMY_MOBLIN; EnMb_SetupClubWaitPlayerNear(this); break; default: /* Spear Patrol */ diff --git a/src/overlays/actors/ovl_En_Ms/z_en_ms.c b/src/overlays/actors/ovl_En_Ms/z_en_ms.c index 6c36870ebf..4ab1c0f6d7 100644 --- a/src/overlays/actors/ovl_En_Ms/z_en_ms.c +++ b/src/overlays/actors/ovl_En_Ms/z_en_ms.c @@ -161,7 +161,7 @@ void EnMs_Update(Actor* thisx, PlayState* play) { EnMs* this = (EnMs*)thisx; s32 pad; - this->activeTimer += 1; + this->activeTimer++; Actor_SetFocus(&this->actor, 20.0f); this->actor.targetArrowOffset = 500.0f; Actor_SetScale(&this->actor, 0.015f); diff --git a/src/overlays/actors/ovl_En_Ny/z_en_ny.c b/src/overlays/actors/ovl_En_Ny/z_en_ny.c index 4f4ae38d6d..b9544ad9fd 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -230,7 +230,7 @@ void EnNy_Move(EnNy* this, PlayState* play) { func_80ABCD40(this); stoneTimer = this->stoneTimer; this->stoneTimer--; - if ((stoneTimer <= 0) || (this->hitPlayer != false)) { + if ((stoneTimer <= 0) || this->hitPlayer) { EnNy_SetupTurnToStone(this); } else { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0xA, this->unk_1F4, 0); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 718436a8d0..aaf1edd13a 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -1248,7 +1248,7 @@ void EnSkj_Appear(EnSkj* this) { void EnSkj_OcarinaGameIdle(EnSkj* this, PlayState* play) { EnSkj_Appear(this); - if ((EnSkj_IsLeavingGame(this) == false) && (this->minigameState != 0)) { + if (!EnSkj_IsLeavingGame(this) && (this->minigameState != 0)) { EnSkj_SetupPlayOcarinaGame(this); } } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index 187e051d1c..9c089e9ebb 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -111,7 +111,7 @@ void func_80B11A94(EnSyatekiNiw* this, PlayState* play, s16 arg2) { this->unk_264 = -10000.0f; } - this->unk_28E += 1; + this->unk_28E++; this->unk_254 = 3; if (!(this->unk_28E & 1)) { this->unk_264 = 0.0f; diff --git a/src/overlays/actors/ovl_En_Tite/z_en_tite.c b/src/overlays/actors/ovl_En_Tite/z_en_tite.c index 67a1eebc10..2f5d32da8a 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -196,7 +196,7 @@ void EnTite_Init(Actor* thisx, PlayState* play) { if (this->actor.params == TEKTITE_BLUE) { this->unk_2DC |= UPDBGCHECKINFO_FLAG_6; // Don't use the actor engine's ripple spawning code thisx->colChkInfo.health = 4; - thisx->naviEnemyId += 1; // NAVI_ENEMY_BLUE_TEKTITE + thisx->naviEnemyId += NAVI_ENEMY_BLUE_TEKTITE - NAVI_ENEMY_RED_TEKTITE; } EnTite_SetupIdle(this); } diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 9e4abfd767..412edf6921 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -1904,7 +1904,7 @@ void func_80B57AE0(EnZl3* this, PlayState* play) { f32 zDiff; this->unk_344 = 0; - this->unk_314 += 1; + this->unk_314++; this->unk_360 = 0.0f; this->unk_364 = 0.0f; this->unk_368 = 0.0f; @@ -1947,7 +1947,7 @@ void func_80B57CB4(EnZl3* this, PlayState* play) { Vec3f* thisPos = &this->actor.world.pos; f32 temp_f0; - this->unk_344 += 1; + this->unk_344++; temp_f0 = Environment_LerpWeightAccelDecel(this->unk_346, 0, this->unk_344, 3, 3); thisPos->x = unk_348->x + (temp_f0 * (unk_354->x - unk_348->x)); thisPos->y = (unk_348->y + (temp_f0 * (unk_354->y - unk_348->y))) + this->unk_360; @@ -2002,7 +2002,7 @@ void func_80B57F1C(EnZl3* this, PlayState* play) { if (func_80B57D80(this, play) == 0) { func_80B54E14(this, &gZelda2Anime2Anim_009BE4, 0, -8.0f, 0); this->action = 34; - this->unk_314 -= 1; + this->unk_314--; func_80B57AE0(this, play); } } @@ -2248,7 +2248,7 @@ void func_80B58C08(EnZl3* this, PlayState* play) { s32 sp28; f32 temp_f0; - this->unk_344 += 1; + this->unk_344++; unk_344 = this->unk_344; unk_346 = this->unk_346; diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index 9f471da245..fc096037e1 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -81,7 +81,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) { void EffectSsExtra_Update(PlayState* play, u32 index, EffectSs* this) { if (this->rTimer != 0) { - this->rTimer -= 1; + this->rTimer--; } else { this->velocity.y = 0.0f; } diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index d91e8d6081..8a2d924180 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -379,7 +379,7 @@ void func_809AA230(EffectSs* this, PlayState* play) { this->velocity.z *= func_809A9818(0.9f, 0.2f); if (this->rReg8 > 0) { - this->rReg8 -= 1; + this->rReg8--; } } } diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index 194d883b2d..d38c65308f 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -1640,7 +1640,7 @@ void FileSelect_Main(GameState* thisx) { if (this->stickAdjY < -30) { if (this->stickYDir == -1) { - this->inputTimerY -= 1; + this->inputTimerY--; if (this->inputTimerY < 0) { this->inputTimerY = 2; } else { @@ -1652,7 +1652,7 @@ void FileSelect_Main(GameState* thisx) { } } else if (this->stickAdjY > 30) { if (this->stickYDir == 1) { - this->inputTimerY -= 1; + this->inputTimerY--; if (this->inputTimerY < 0) { this->inputTimerY = 2; } else { diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index bf16fe77af..38a2053065 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -79,7 +79,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) { OPEN_DISPS(gfxCtx, "../z_kaleido_collect.c", 248); - if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) && + if ((((u32)pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 5) || (pauseCtx->unk_1E4 == 8)) && (pauseCtx->pageIndex == PAUSE_QUEST)) { pauseCtx->cursorColorSet = 0; diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index d700d25a24..edeaf20077 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -172,7 +172,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { while (cursorMoveResult == 0) { if (pauseCtx->stickAdjX < -30) { if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) { - pauseCtx->cursorX[PAUSE_EQUIP] -= 1; + pauseCtx->cursorX[PAUSE_EQUIP]--; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1; if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { @@ -192,7 +192,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } else { pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; - pauseCtx->cursorY[PAUSE_EQUIP] += 1; + pauseCtx->cursorY[PAUSE_EQUIP]++; if (pauseCtx->cursorY[PAUSE_EQUIP] >= 4) { pauseCtx->cursorY[PAUSE_EQUIP] = 0; @@ -214,7 +214,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } else if (pauseCtx->stickAdjX > 30) { if (pauseCtx->cursorX[PAUSE_EQUIP] < 3) { - pauseCtx->cursorX[PAUSE_EQUIP] += 1; + pauseCtx->cursorX[PAUSE_EQUIP]++; pauseCtx->cursorPoint[PAUSE_EQUIP] += 1; if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { @@ -228,7 +228,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } else { pauseCtx->cursorX[PAUSE_EQUIP] = cursorX; - pauseCtx->cursorY[PAUSE_EQUIP] += 1; + pauseCtx->cursorY[PAUSE_EQUIP]++; if (pauseCtx->cursorY[PAUSE_EQUIP] >= 4) { pauseCtx->cursorY[PAUSE_EQUIP] = 0; @@ -262,7 +262,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { while (cursorMoveResult == 0) { if (pauseCtx->stickAdjY > 30) { if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) { - pauseCtx->cursorY[PAUSE_EQUIP] -= 1; + pauseCtx->cursorY[PAUSE_EQUIP]--; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4; if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { @@ -284,7 +284,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) { } } else if (pauseCtx->stickAdjY < -30) { if (pauseCtx->cursorY[PAUSE_EQUIP] < 3) { - pauseCtx->cursorY[PAUSE_EQUIP] += 1; + pauseCtx->cursorY[PAUSE_EQUIP]++; pauseCtx->cursorPoint[PAUSE_EQUIP] += 4; if (pauseCtx->cursorX[PAUSE_EQUIP] == 0) { diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index 5f2c0dcd38..f5d07cf52d 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -131,7 +131,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { while (moveCursorResult == 0) { if (pauseCtx->stickAdjX < -30) { if (pauseCtx->cursorX[PAUSE_ITEM] != 0) { - pauseCtx->cursorX[PAUSE_ITEM] -= 1; + pauseCtx->cursorX[PAUSE_ITEM]--; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { @@ -139,7 +139,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } } else { pauseCtx->cursorX[PAUSE_ITEM] = cursorX; - pauseCtx->cursorY[PAUSE_ITEM] += 1; + pauseCtx->cursorY[PAUSE_ITEM]++; if (pauseCtx->cursorY[PAUSE_ITEM] >= 4) { pauseCtx->cursorY[PAUSE_ITEM] = 0; @@ -163,7 +163,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } } else if (pauseCtx->stickAdjX > 30) { if (pauseCtx->cursorX[PAUSE_ITEM] < 5) { - pauseCtx->cursorX[PAUSE_ITEM] += 1; + pauseCtx->cursorX[PAUSE_ITEM]++; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { @@ -171,7 +171,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } } else { pauseCtx->cursorX[PAUSE_ITEM] = cursorX; - pauseCtx->cursorY[PAUSE_ITEM] += 1; + pauseCtx->cursorY[PAUSE_ITEM]++; if (pauseCtx->cursorY[PAUSE_ITEM] >= 4) { pauseCtx->cursorY[PAUSE_ITEM] = 0; @@ -287,7 +287,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { while (moveCursorResult == 0) { if (pauseCtx->stickAdjY > 30) { if (pauseCtx->cursorY[PAUSE_ITEM] != 0) { - pauseCtx->cursorY[PAUSE_ITEM] -= 1; + pauseCtx->cursorY[PAUSE_ITEM]--; pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { @@ -301,7 +301,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) { } } else if (pauseCtx->stickAdjY < -30) { if (pauseCtx->cursorY[PAUSE_ITEM] < 3) { - pauseCtx->cursorY[PAUSE_ITEM] += 1; + pauseCtx->cursorY[PAUSE_ITEM]++; pauseCtx->cursorPoint[PAUSE_ITEM] += 6; if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]] != ITEM_NONE) { diff --git a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index 05b29ef639..be18623bdf 100644 --- a/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -790,7 +790,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) { gDPSetCombineMode(POLY_OPA_DISP++, G_CC_MODULATEIA, G_CC_MODULATEIA); - if (!pauseCtx->pageIndex) { // pageIndex == PAUSE_ITEM + if ((u32)pauseCtx->pageIndex == PAUSE_ITEM) { pauseCtx->unk_1F4 = pauseCtx->unk_204 + 314.0f; Matrix_Translate(0.0f, (f32)WREG(2) / 100.0f, -pauseCtx->unk_1F0 / 10.0f, MTXMODE_NEW); @@ -1120,11 +1120,11 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, 20, 30, 40, 0); if ((pauseCtx->state == 6) && (pauseCtx->namedItem != PAUSE_ITEM_NONE) && (pauseCtx->nameDisplayTimer < WREG(89)) && - (!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 2) || ((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 7)) || - (pauseCtx->unk_1E4 == 8)) && + (((u32)pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 2) || + ((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 7)) || (pauseCtx->unk_1E4 == 8)) && (pauseCtx->cursorSpecialPos == 0)) { - if (!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 2) || ((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 7)) || - (pauseCtx->unk_1E4 == 8)) { + if (((u32)pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 2) || + ((pauseCtx->unk_1E4 >= 4) && (pauseCtx->unk_1E4 <= 7)) || (pauseCtx->unk_1E4 == 8)) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = -63; pauseCtx->infoPanelVtx[17].v.ob[0] = pauseCtx->infoPanelVtx[19].v.ob[0] = @@ -1243,7 +1243,7 @@ void KaleidoScope_DrawInfoPanel(PlayState* play) { } } } else { - if (!pauseCtx->pageIndex) { // pageIndex == PAUSE_ITEM + if ((u32)pauseCtx->pageIndex == PAUSE_ITEM) { pauseCtx->infoPanelVtx[16].v.ob[0] = pauseCtx->infoPanelVtx[18].v.ob[0] = WREG(49 + gSaveContext.language); @@ -2504,7 +2504,7 @@ void KaleidoScope_Update(PlayState* play) { (((pauseCtx->state >= 4) && (pauseCtx->state <= 7)) || ((pauseCtx->state >= 0xA) && (pauseCtx->state <= 0x12)))) { - if ((!pauseCtx->unk_1E4 || (pauseCtx->unk_1E4 == 8)) && (pauseCtx->state == 6)) { + if ((((u32)pauseCtx->unk_1E4 == 0) || (pauseCtx->unk_1E4 == 8)) && (pauseCtx->state == 6)) { pauseCtx->stickAdjX = input->rel.stick_x; pauseCtx->stickAdjY = input->rel.stick_y; KaleidoScope_UpdateCursorSize(play);