diff --git a/include/macros.h b/include/macros.h index b80d4817f1..30a19882df 100644 --- a/include/macros.h +++ b/include/macros.h @@ -26,11 +26,15 @@ #define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera] +#define LINK_IS_ADULT (gSaveContext.linkAge == 0) +#define LINK_IS_CHILD (gSaveContext.linkAge == 1) + #define YEARS_CHILD 5 #define YEARS_ADULT 17 -#define LINK_IS_CHILD (gSaveContext.linkAge != 0) -#define LINK_IS_ADULT (gSaveContext.linkAge == 0) -#define LINK_AGE_IN_YEARS (LINK_IS_CHILD ? YEARS_CHILD : YEARS_ADULT) +#define LINK_AGE_IN_YEARS (!LINK_IS_ADULT ? YEARS_CHILD : YEARS_ADULT) + +#define IS_DAY (gSaveContext.nightFlag == 0) +#define IS_NIGHT (gSaveContext.nightFlag == 1) #define SLOT(item) gItemSlots[item] #define INV_CONTENT(item) gSaveContext.inventory.items[SLOT(item)] diff --git a/src/code/audio_heap.c b/src/code/audio_heap.c index 70bb628055..2899141f57 100644 --- a/src/code/audio_heap.c +++ b/src/code/audio_heap.c @@ -999,7 +999,7 @@ void* func_800E0540(s32 poolIdx, s32 id, u32 size) { gAudioContext.unk_2D60[sp18].poolIndex = poolIdx; gAudioContext.unk_2D60[sp18].id = id; gAudioContext.unk_2D60[sp18].size = size; - // @bug UB: missing return. "ret" is in v0 at this point, but doing an + //! @bug UB: missing return. "ret" is in v0 at this point, but doing an // explicit return uses an additional register. // return ret; } diff --git a/src/code/audio_seqplayer.c b/src/code/audio_seqplayer.c index 6b1ff361e3..d7b09e5f54 100644 --- a/src/code/audio_seqplayer.c +++ b/src/code/audio_seqplayer.c @@ -1231,7 +1231,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { case 0xE4: if (scriptState->value != -1) { data = (*channel->dynTable)[scriptState->value]; - // @bug: Missing a stack depth check here + //! @bug: Missing a stack depth check here scriptState->stack[scriptState->depth++] = scriptState->pc; offset = (u16)((data[0] << 8) + data[1]); scriptState->pc = player->seqData + offset; @@ -1254,7 +1254,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { channel->panChannelWeight = data[-2]; channel->reverb = data[-1]; channel->reverbIndex = data[0]; - //@bug: Not marking reverb state as changed + //! @bug: Not marking reverb state as changed channel->changes.s.pan = true; break; case 0xE8: @@ -1267,7 +1267,7 @@ void Audio_SequenceChannelProcessScript(SequenceChannel* channel) { channel->panChannelWeight = Audio_M64ReadU8(scriptState); channel->reverb = Audio_M64ReadU8(scriptState); channel->reverbIndex = Audio_M64ReadU8(scriptState); - //@bug: Not marking reverb state as changed + //! @bug: Not marking reverb state as changed channel->changes.s.pan = true; break; case 0xEC: diff --git a/src/code/code_800430A0.c b/src/code/code_800430A0.c index 6b7623b793..742aa2ea06 100644 --- a/src/code/code_800430A0.c +++ b/src/code/code_800430A0.c @@ -29,7 +29,7 @@ void func_800430A0(CollisionContext* colCtx, s32 bgId, Actor* actor) { pos.y <= -BGCHECK_XYZ_ABSMAX || BGCHECK_XYZ_ABSMAX <= pos.z || pos.z <= -BGCHECK_XYZ_ABSMAX) { osSyncPrintf(VT_FGCOL(RED)); - // @bug file and line are not passed to osSyncPrintf + //! @bug file and line are not passed to osSyncPrintf // Position is not valid osSyncPrintf( "BGCheckCollection_typicalActorPos():位置が妥当ではありません。\npos (%f,%f,%f) file:%s line:%d\n", diff --git a/src/code/code_800F7260.c b/src/code/code_800F7260.c index db3180fb1c..c924a726a0 100644 --- a/src/code/code_800F7260.c +++ b/src/code/code_800F7260.c @@ -227,7 +227,7 @@ void func_800F7680(void) { if (gSoundBanks[phi_s5][phi_a1].unk_28 == sp50->sfxId) { sp55 = D_80130594[D_801333CC][phi_s5]; } else { - //!@bug possibly uninitialized sp43 ? confirm when matching + //! @bug possibly uninitialized sp43 ? confirm when matching if (sp55 == 0) { phi_s1 = phi_a1; flag1 = gSoundBanks[phi_s5][phi_a1].unk_28 & 0xFFFF; diff --git a/src/code/graph.c b/src/code/graph.c index 2ad106782c..ea477077ee 100644 --- a/src/code/graph.c +++ b/src/code/graph.c @@ -322,7 +322,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { GfxPool* pool = &gGfxPools[gfxCtx->gfxPoolIdx & 1]; if (pool->headMagic != GFXPOOL_HEAD_MAGIC) { - // @bug (?) : devs might've forgotten "problem = true;" + //! @bug (?) : devs might've forgotten "problem = true;" osSyncPrintf("%c", 7); // Dynamic area head is destroyed osSyncPrintf(VT_COL(RED, WHITE) "ダイナミック領域先頭が破壊されています\n" VT_RST); diff --git a/src/code/sys_math3d.c b/src/code/sys_math3d.c index 620ddee942..b3509751a1 100644 --- a/src/code/sys_math3d.c +++ b/src/code/sys_math3d.c @@ -626,7 +626,7 @@ s32 Math3D_PointRelativeToCubeVertices(Vec3f* point, Vec3f* min, Vec3f* max) { ret |= 0x10; } - // @BUG: The next 2 conditions are the same check. + //! @bug: The next 2 conditions are the same check. if ((-min->x - min->y + max->z) < (-point->x - point->y + point->z)) { ret |= 0x20; } @@ -726,7 +726,7 @@ s32 Math3D_LineVsCube(Vec3f* min, Vec3f* max, Vec3f* a, Vec3f* b) { triVtx1.y = min->y; triVtx1.z = max->z; triVtx2.x = max->x; - // @Bug trVtx1.y should be triVtx2.y, prevents a tri on the cube from being checked. + //! @bug trVtx1.y should be triVtx2.y, prevents a tri on the cube from being checked. triVtx1.y = min->y; triVtx2.z = max->z; if (Math3D_TriLineIntersect(&triVtx0, &triVtx1, &triVtx2, 0.0f, 0.0f, 1.0f, -max->z, a, b, &intersectPoint, 0)) { diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 4a8c2b33fd..20282d0035 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1819,7 +1819,7 @@ void func_8002FBAC(GlobalContext* globalCtx) { spF0 = gSaveContext.respawn[RESPAWN_MODE_TOP].data; if (spF0 != 0) { - f32 spD8 = (LINK_IS_ADULT) ? 80.0f : 60.0f; + f32 spD8 = LINK_IS_ADULT ? 80.0f : 60.0f; f32 spD4 = 1.0f; s32 spD0 = 0xFF; s32 spCC = spF0 - 40; @@ -4239,7 +4239,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 1: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { if (Flags_GetInfTable(0x10)) { retTextId = 0x1046; @@ -4286,7 +4286,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 2: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else { @@ -4303,7 +4303,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 3: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else { @@ -4322,7 +4322,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 4: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else { @@ -4339,7 +4339,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 5: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1044; } else if (Flags_GetInfTable(0x22)) { @@ -4356,7 +4356,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 6: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1042; } else if (Flags_GetInfTable(0x24)) { @@ -4373,7 +4373,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 7: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else if (Flags_GetInfTable(0x26)) { @@ -4390,7 +4390,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 8: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1043; } else if (Flags_GetInfTable(0x28)) { @@ -4409,7 +4409,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 9: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x1049; } else { @@ -4424,7 +4424,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 10: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104A; } else { @@ -4441,7 +4441,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 11: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104B; } else { @@ -4456,7 +4456,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 12: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104C; } else { @@ -4471,7 +4471,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 13: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x9)) { retTextId = 0x104D; } else { @@ -4653,7 +4653,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { retTextId = 0x5002; break; case 38: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4672,7 +4672,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 39: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4689,7 +4689,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 40: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetEventChkInf(0x23)) { @@ -4708,7 +4708,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 41: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF0)) { @@ -4725,7 +4725,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 42: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF4)) { @@ -4742,7 +4742,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 43: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x25)) { retTextId = 0x3027; } else if (Flags_GetInfTable(0xF8)) { @@ -4834,7 +4834,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 55: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x37)) { retTextId = 0x402B; } else if (Flags_GetEventChkInf(0x31)) { @@ -4896,7 +4896,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } break; case 72: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x14)) { retTextId = 0x2040; } else if (Flags_GetInfTable(0x94)) { @@ -4906,7 +4906,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) { } } else { if (!Flags_GetEventChkInf(0x18)) { - if (gSaveContext.nightFlag != 0) { + if (!IS_DAY) { retTextId = 0x204E; } else if (Flags_GetInfTable(0x9A)) { retTextId = 0x2031; diff --git a/src/code/z_bgcheck.c b/src/code/z_bgcheck.c index 32c951d12a..c8be7361b2 100644 --- a/src/code/z_bgcheck.c +++ b/src/code/z_bgcheck.c @@ -274,7 +274,7 @@ void CollisionPoly_GetVerticesByBgId(CollisionPoly* poly, s32 bgId, CollisionCon osSyncPrintf(VT_RST); if (dest != NULL) { - // @bug: dest[2] x and y are not set to 0 + //! @bug: dest[2] x and y are not set to 0 dest[0].x = dest[0].y = dest[0].z = dest[1].x = dest[1].y = dest[1].z = dest[2].z = 0.0f; } } else { diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 2bca956d51..5f643a09c1 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -2143,7 +2143,7 @@ s32 Camera_Parallel3(Camera* camera) { if (val & 2) { camera->unk_14C |= 0x10; } - // @bug doesn't return + //! @bug doesn't return } s32 Camera_Parallel4(Camera* camera) { @@ -6106,7 +6106,7 @@ s32 Camera_Demo7(Camera* camera) { camera->unk_14C |= 0x1000; camera->animState++; } - // @bug doesn't return + //! @bug doesn't return } s32 Camera_Demo8(Camera* camera) { @@ -7153,7 +7153,7 @@ s32 Camera_CheckWater(Camera* camera) { } func_800F6828(0); } - // @BUG: doesn't always return a value, but sometimes does. + //! @bug: doesn't always return a value, but sometimes does. } /** @@ -7723,7 +7723,7 @@ s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags) { return -2; } } - if (((setting == CAM_SET_SPOT05A) || (setting == CAM_SET_SPOT05B)) && (LINK_IS_ADULT) && + if (((setting == CAM_SET_SPOT05A) || (setting == CAM_SET_SPOT05B)) && LINK_IS_ADULT && (camera->globalCtx->sceneNum == SCENE_SPOT05)) { camera->unk_14A |= 0x10; return -5; @@ -7799,7 +7799,7 @@ s32 Camera_ChangeDataIdx(Camera* camera, s32 camDataIdx) { camera->unk_14A |= 4; Camera_CopyModeValuesToPREG(camera, camera->mode); } else if (settingChangeSuccessful < -1) { - // @bug: This is likely checking the wrong value. The actual return of Camera_ChangeSettingFlags or + //! @bug: This is likely checking the wrong value. The actual return of Camera_ChangeSettingFlags or // camDataIdx would make more sense. osSyncPrintf(VT_COL(RED, WHITE) "camera: error: illegal camera ID (%d) !! (%d|%d|%d)\n" VT_RST, camDataIdx, camera->thisIdx, 0x32, newCameraSetting); diff --git a/src/code/z_debug.c b/src/code/z_debug.c index 6cb76f846a..21b0fee3ee 100644 --- a/src/code/z_debug.c +++ b/src/code/z_debug.c @@ -151,13 +151,13 @@ void func_8006390C(Input* input) { gGameInfo->dpadLast = dpad; } - increment = (CHECK_BTN_ANY(dpad, BTN_DRIGHT)) + increment = CHECK_BTN_ANY(dpad, BTN_DRIGHT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? 1000 : CHECK_BTN_ALL(input->cur.button, BTN_A) ? 100 : CHECK_BTN_ALL(input->cur.button, BTN_B) ? 10 : 1) - : (CHECK_BTN_ANY(dpad, BTN_DLEFT)) + : CHECK_BTN_ANY(dpad, BTN_DLEFT) ? (CHECK_BTN_ALL(input->cur.button, BTN_A | BTN_B) ? -1000 : CHECK_BTN_ALL(input->cur.button, BTN_A) diff --git a/src/code/z_demo.c b/src/code/z_demo.c index a8d5b318b4..5b25120bda 100644 --- a/src/code/z_demo.c +++ b/src/code/z_demo.c @@ -367,7 +367,7 @@ void func_80064824(GlobalContext* globalCtx, CutsceneContext* csCtx, CsCmdBase* gSaveContext.unk_1422 = 1; break; case 34: - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { gSaveContext.dayTime -= D_8011FB40; } else { gSaveContext.dayTime -= D_8011FB40 * 2; @@ -523,7 +523,7 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt globalCtx->fadeTransition = 11; } else { if (gSaveContext.sceneSetupIndex < 4) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->linkAgeOnLoad = 0; } else { globalCtx->linkAgeOnLoad = 1; diff --git a/src/code/z_elf_message.c b/src/code/z_elf_message.c index 481732170e..eb81dec6dd 100644 --- a/src/code/z_elf_message.c +++ b/src/code/z_elf_message.c @@ -36,10 +36,10 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) { gSaveContext.inventory.equipment) != 0); case 0x20: return ((msg->byte0 & 1) == 1) == - ((CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET)) != 0); + (CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET) != 0); case 0x30: return ((msg->byte0 & 1) == 1) == - ((CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST)) != 0); + (CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST) != 0); case 0x40: return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.magicAcquired) != 0); } @@ -141,7 +141,7 @@ u16 ElfMessage_GetSariaText(GlobalContext* globalCtx) { Player* player = PLAYER; ElfMessage* msgs; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Actor_FindNearby(globalCtx, &player->actor, ACTOR_EN_SA, 4, 800.0f) == NULL) { msgs = sChildSariaMsgs; } else { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index dbc0b1f989..6393c2f436 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1275,7 +1275,7 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3 params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_MAGIC_SMALL; - } else if (LINK_IS_CHILD && (AMMO(ITEM_SLINGSHOT) < 6)) { + } else if (!LINK_IS_ADULT && (AMMO(ITEM_SLINGSHOT) < 6)) { params = 0xA * 0x10; dropTableIndex = 0x0; dropId = ITEM00_SEEDS; diff --git a/src/code/z_horse.c b/src/code/z_horse.c index 12f69871cb..1ba9e37dc3 100644 --- a/src/code/z_horse.c +++ b/src/code/z_horse.c @@ -112,7 +112,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) { } } } else if (!Flags_GetEventChkInf(0x18)) { - if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag != 0)) { + if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && !IS_DAY) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1); } } diff --git a/src/code/z_onepointdemo.c b/src/code/z_onepointdemo.c index d3f995642d..53626f5100 100644 --- a/src/code/z_onepointdemo.c +++ b/src/code/z_onepointdemo.c @@ -964,7 +964,7 @@ s32 OnePointCutscene_SetInfo(GlobalContext* globalCtx, s16 camIdx, s16 csId, Act break; case 9908: if (func_800C0CB8(globalCtx)) { - D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = LINK_IS_CHILD ? 100.0f : 120.0f; + D_801231B4[0].eyeTargetInit.z = D_801231B4[1].eyeTargetInit.z = !LINK_IS_ADULT ? 100.0f : 120.0f; if (player->stateFlags1 & 0x08000000) { D_801231B4[2].atTargetInit.z = 0.0f; diff --git a/src/code/z_play.c b/src/code/z_play.c index 116c3becfe..f1fffbd1b1 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -261,18 +261,18 @@ void Gameplay_Init(GameState* thisx) { gSaveContext.nayrusLoveTimer = 0; func_800876C8(globalCtx); gSaveContext.sceneSetupIndex = (gSaveContext.cutsceneIndex & 0xF) + 4; - } else if (LINK_IS_CHILD && gSaveContext.nightFlag == 0) { + } else if (!LINK_IS_ADULT && IS_DAY) { gSaveContext.sceneSetupIndex = 0; - } else if (LINK_IS_CHILD && gSaveContext.nightFlag != 0) { + } else if (!LINK_IS_ADULT && !IS_DAY) { gSaveContext.sceneSetupIndex = 1; - } else if (LINK_IS_ADULT && gSaveContext.nightFlag == 0) { + } else if (LINK_IS_ADULT && IS_DAY) { gSaveContext.sceneSetupIndex = 2; } else { gSaveContext.sceneSetupIndex = 3; } tempSetupIndex = gSaveContext.sceneSetupIndex; - if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && LINK_IS_CHILD && + if ((gEntranceTable[((void)0, gSaveContext.entranceIndex)].scene == SCENE_SPOT00) && !LINK_IS_ADULT && gSaveContext.sceneSetupIndex < 4) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) { diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 0b745243fa..8540caeb87 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -262,7 +262,7 @@ void Player_SetBootData(GlobalContext* globalCtx, Player* this) { currentBoots = this->currentBoots; if (currentBoots == PLAYER_BOOTS_NORMAL) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { currentBoots = PLAYER_BOOTS_NORMAL_CHILD; } } else if (currentBoots == PLAYER_BOOTS_IRON) { @@ -314,7 +314,7 @@ s32 func_8008E9C4(Player* this) { } s32 Player_IsChildWithHylianShield(Player* this) { - return LINK_IS_CHILD && (this->currentShield == PLAYER_SHIELD_HYLIAN); + return gSaveContext.linkAge != 0 && (this->currentShield == PLAYER_SHIELD_HYLIAN); } s32 Player_ActionToModelGroup(Player* this, s32 actionParam) { @@ -825,7 +825,7 @@ s32 func_8008FCC8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p D_80160018 = this->rightHandType; D_80160000 = &this->swordInfo[2].base; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) { pos->x *= 0.64f; pos->z *= 0.64f; @@ -917,11 +917,11 @@ s32 func_80090014(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p if ((this->sheathType == 18) || (this->sheathType == 19)) { dLists += this->currentShield * 4; - if ((LINK_IS_CHILD) && (this->currentShield < PLAYER_SHIELD_HYLIAN) && + if (!LINK_IS_ADULT && (this->currentShield < PLAYER_SHIELD_HYLIAN) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists += 16; } - } else if ((LINK_IS_CHILD) && ((this->sheathType == 16) || (this->sheathType == 17)) && + } else if (!LINK_IS_ADULT && ((this->sheathType == 16) || (this->sheathType == 17)) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI)) { dLists = D_80125D68; } @@ -1298,7 +1298,7 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* Matrix_Scale(1.0f, this->unk_858, 1.0f, MTXMODE_APPLY); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Matrix_RotateZ(this->unk_858 * -0.2f, MTXMODE_APPLY); } @@ -1404,7 +1404,7 @@ s32 func_80091880(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p s32 dListOffset = 0; Gfx** dLists; - if ((modelGroup == 2) && LINK_IS_CHILD && (ptr[1] == 2)) { + if ((modelGroup == 2) && !LINK_IS_ADULT && (ptr[1] == 2)) { modelGroup = 1; } @@ -1551,7 +1551,7 @@ void func_8009214C(GlobalContext* globalCtx, u8* segment, SkelAnime* skelAnime, gSegments[4] = VIRTUAL_TO_PHYSICAL(segment + 0x3800); gSegments[6] = VIRTUAL_TO_PHYSICAL(segment + 0x8800); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (shield == PLAYER_SHIELD_DEKU) { srcTable = D_040020D0; } else { diff --git a/src/code/z_scene_table.c b/src/code/z_scene_table.c index 09d502f374..a33237aecc 100644 --- a/src/code/z_scene_table.c +++ b/src/code/z_scene_table.c @@ -926,14 +926,14 @@ Gfx sDefaultDisplayList[] = { void func_800994A0(GlobalContext* globalCtx) { s16 computedEntranceIndex; - if (gSaveContext.nightFlag != 0) { - if (LINK_IS_CHILD) { + if (!IS_DAY) { + if (!LINK_IS_ADULT) { computedEntranceIndex = globalCtx->nextEntranceIndex + 1; } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 3; } } else { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { computedEntranceIndex = globalCtx->nextEntranceIndex; } else { computedEntranceIndex = globalCtx->nextEntranceIndex + 2; diff --git a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c index f560bc5478..e79bd7b6a5 100644 --- a/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c +++ b/src/overlays/actors/ovl_Arms_Hook/z_arms_hook.c @@ -24,7 +24,7 @@ const ActorInit Arms_Hook_InitVars = { (ActorFunc)ArmsHook_Draw, }; -ColliderQuadInit sQuadInit = { +static ColliderQuadInit sQuadInit = { { COLTYPE_NONE, AT_ON | AT_TYPE_PLAYER, @@ -108,9 +108,9 @@ s32 ArmsHook_AttachToPlayer(ArmsHook* this, Player* player) { if (this->actor.child != NULL) { player->actor.parent = NULL; this->actor.child = NULL; - return 1; + return true; } - return 0; + return false; } void ArmsHook_DetachHookFromActor(ArmsHook* this) { @@ -284,8 +284,8 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) { Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - } else if ((CHECK_BTN_ANY(globalCtx->state.input[0].press.button, - (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN)))) { + } else if (CHECK_BTN_ANY(globalCtx->state.input[0].press.button, + (BTN_A | BTN_B | BTN_R | BTN_CUP | BTN_CLEFT | BTN_CRIGHT | BTN_CDOWN))) { this->timer = 0; } } 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 d2c363b0ab..bf26aa0d29 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -195,11 +195,9 @@ void ArrowIce_Draw(Actor* thisx, GlobalContext* globalCtx) { ArrowIce* this = THIS; s32 pad; Actor* tranform; - u32 stateFrames; - EnArrow* arrow; + u32 stateFrames = globalCtx->state.frames; + EnArrow* arrow = (EnArrow*)this->actor.parent; - stateFrames = globalCtx->state.frames; - arrow = (EnArrow*)this->actor.parent; if (1) {} if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { 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 8dbf3f8dd6..2866b09072 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -63,9 +63,8 @@ void ArrowLight_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) { - EnArrow* arrow; + EnArrow* arrow = (EnArrow*)this->actor.parent; - arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { Actor_Kill(&this->actor); return; @@ -148,11 +147,10 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) { } void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) { - EnArrow* arrow; + EnArrow* arrow = (EnArrow*)this->actor.parent; f32 distanceScaled; s32 pad; - arrow = (EnArrow*)this->actor.parent; if ((arrow == NULL) || (arrow->actor.update == NULL)) { Actor_Kill(&this->actor); return; @@ -194,12 +192,10 @@ void ArrowLight_Update(Actor* thisx, GlobalContext* globalCtx) { void ArrowLight_Draw(Actor* thisx, GlobalContext* globalCtx) { ArrowLight* this = THIS; s32 pad; - u32 stateFrames; - EnArrow* arrow; + u32 stateFrames = globalCtx->state.frames; + EnArrow* arrow = (EnArrow*)this->actor.parent; Actor* tranform; - stateFrames = globalCtx->state.frames; - arrow = (EnArrow*)this->actor.parent; if (1) {} if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 11fd1955e0..26e257bf92 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -66,7 +66,7 @@ static ColliderCylinderInit sCylinderInit = { }; static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_STOP), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; static Gfx* sDLists[] = { @@ -113,7 +113,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - this->unk_168 = (thisx->params >> 8) & 0x3F; + this->switchFlag = (thisx->params >> 8) & 0x3F; thisx->params &= 0xFF; if (thisx->params == 2) { thisx->flags |= 0x30; @@ -127,7 +127,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->dyna.actor, &sCylinderInit); thisx->world.pos.y += -79.0f; if (Flags_GetClear(globalCtx, thisx->room)) { - Flags_SetSwitch(globalCtx, this->unk_168); + Flags_SetSwitch(globalCtx, this->switchFlag); this->actionFunc = func_8086C6EC; } else { if (BgBdanObjects_GetContactRu1(this, 4)) { @@ -140,7 +140,7 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = func_8086C618; thisx->world.pos.y = thisx->home.pos.y + -70.0f; } else { - Flags_SetSwitch(globalCtx, this->unk_168); + Flags_SetSwitch(globalCtx, this->switchFlag); this->timer = 0; this->actionFunc = func_8086C054; } @@ -149,11 +149,11 @@ void BgBdanObjects_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 1) { CollisionHeader_GetVirtual(&gJabuElevatorCol, &colHeader); this->timer = 512; - this->unk_168 = 0; + this->switchFlag = 0; this->actionFunc = func_8086C874; } else { CollisionHeader_GetVirtual(&gJabuLoweringPlatformCol, &colHeader); - if (Flags_GetSwitch(globalCtx, this->unk_168)) { + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->actionFunc = BgBdanObjects_DoNothing; thisx->world.pos.y = thisx->home.pos.y - 400.0f; } else { @@ -283,7 +283,7 @@ void func_8086C55C(BgBdanObjects* this, GlobalContext* globalCtx) { this->timer--; if (this->timer == 0) { - Flags_UnsetSwitch(globalCtx, this->unk_168); + Flags_UnsetSwitch(globalCtx, this->switchFlag); } else if (this->timer == -40) { this->timer = 0; this->actionFunc = func_8086C3D8; @@ -307,7 +307,7 @@ void func_8086C618(BgBdanObjects* this, GlobalContext* globalCtx) { Collider_UpdateCylinder(&this->dyna.actor, &this->collider); CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (Flags_GetClear(globalCtx, this->dyna.actor.room)) { - Flags_SetSwitch(globalCtx, this->unk_168); + Flags_SetSwitch(globalCtx, this->switchFlag); this->dyna.actor.home.rot.y = (s16)(this->dyna.actor.shape.rot.y + 0x2000) & 0xC000; this->actionFunc = func_8086C6EC; } else { @@ -352,21 +352,21 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - if (this->unk_168 == 0) { + if (this->switchFlag == 0) { if (func_8004356C(&this->dyna)) { this->cameraSetting = globalCtx->cameraPtrs[MAIN_CAM]->setting; Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], CAM_SET_NORMAL2); func_8005AD1C(globalCtx->cameraPtrs[MAIN_CAM], 4); - this->unk_168 = 10; + this->switchFlag = 10; } } else { Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], CAM_SET_NORMAL2); if (!func_8004356C(&this->dyna)) { - if (this->unk_168 != 0) { - this->unk_168--; + if (this->switchFlag != 0) { + this->switchFlag--; } } - if (this->unk_168 == 0) { + if (this->switchFlag == 0) { do { } while (0); Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], this->cameraSetting); @@ -381,7 +381,7 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) { } void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx) { - if (Flags_GetSwitch(globalCtx, this->unk_168)) { + if (Flags_GetSwitch(globalCtx, this->switchFlag)) { this->timer = 100; this->actionFunc = func_8086C9F0; } @@ -390,7 +390,7 @@ void func_8086C9A8(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086C9F0(BgBdanObjects* this, GlobalContext* globalCtx) { if (this->timer == 0) { if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y, 0.5f)) { - Flags_UnsetSwitch(globalCtx, this->unk_168); + Flags_UnsetSwitch(globalCtx, this->switchFlag); this->actionFunc = func_8086C9A8; } func_8002F948(&this->dyna.actor, NA_SE_EV_WATER_LEVEL_DOWN - SFX_FLAG); @@ -415,7 +415,7 @@ void func_8086CABC(BgBdanObjects* this, GlobalContext* globalCtx) { void func_8086CB10(BgBdanObjects* this, GlobalContext* globalCtx) { if (func_8004356C(&this->dyna)) { - Flags_SetSwitch(globalCtx, this->unk_168); + Flags_SetSwitch(globalCtx, this->switchFlag); this->timer = 50; this->actionFunc = func_8086CB8C; this->dyna.actor.home.pos.y -= 200.0f; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h index 8d479ea3fc..593747ec49 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.h @@ -11,7 +11,7 @@ typedef void (*BgBdanObjectsActionFunc)(struct BgBdanObjects*, GlobalContext*); typedef struct BgBdanObjects { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ BgBdanObjectsActionFunc actionFunc; - /* 0x0168 */ u8 unk_168; + /* 0x0168 */ u8 switchFlag; /* 0x016A */ s16 timer; /* 0x016C */ ColliderCylinder collider; /* 0x01B8 */ s32 cameraSetting; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 8af05499ec..ce58666e1f 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -91,7 +91,8 @@ static InitChainEntry sInitChain[] = { static Vec3f D_8086E0E0 = { 0.0f, 140.0f, 0.0f }; -void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, CollisionHeader* collision, DynaPolyMoveFlag flag) { +void BgBdanSwitch_InitDynaPoly(BgBdanSwitch* this, GlobalContext* globalCtx, CollisionHeader* collision, + DynaPolyMoveFlag flag) { s16 pad1; CollisionHeader* colHeader = NULL; s16 pad2; @@ -105,7 +106,7 @@ void func_8086D010(BgBdanSwitch* this, GlobalContext* globalCtx, CollisionHeader } } -void func_8086D098(BgBdanSwitch* this, GlobalContext* globalCtx) { +void BgBdanSwitch_InitCollision(BgBdanSwitch* this, GlobalContext* globalCtx) { Actor* actor = &this->dyna.actor; Collider_InitJntSph(globalCtx, &this->collider); Collider_SetJntSph(globalCtx, &this->collider, actor, &sJntSphInit, this->colliderItems); @@ -157,13 +158,14 @@ void BgBdanSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { case BLUE: case YELLOW_HEAVY: case YELLOW: - func_8086D010(this, globalCtx, &gJabuFloorSwitchCol, DPM_PLAYER); + BgBdanSwitch_InitDynaPoly(this, globalCtx, &gJabuFloorSwitchCol, DPM_PLAYER); break; case YELLOW_TALL_1: case YELLOW_TALL_2: - func_8086D098(this, globalCtx); + BgBdanSwitch_InitCollision(this, globalCtx); this->dyna.actor.flags |= 1; this->dyna.actor.targetMode = 4; + break; } flag = Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); @@ -213,6 +215,7 @@ void BgBdanSwitch_Destroy(Actor* thisx, GlobalContext* globalCtx) { case YELLOW_TALL_1: case YELLOW_TALL_2: Collider_DestroyJntSph(globalCtx, &this->collider); + break; } } @@ -258,6 +261,7 @@ void func_8086D5E0(BgBdanSwitch* this, GlobalContext* globalCtx) { func_8086D67C(this); func_8086D4B4(this, globalCtx); } + break; } } @@ -299,6 +303,7 @@ void func_8086D754(BgBdanSwitch* this, GlobalContext* globalCtx) { if (!Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { func_8086D7FC(this); } + break; } } @@ -421,6 +426,7 @@ void func_8086DB68(BgBdanSwitch* this, GlobalContext* globalCtx) { func_8086DC30(this); func_8086D4B4(this, globalCtx); } + break; } } @@ -457,6 +463,7 @@ void func_8086DCE8(BgBdanSwitch* this, GlobalContext* globalCtx) { func_8086DDA8(this); func_8086D548(this, globalCtx); } + break; } } @@ -525,5 +532,6 @@ void BgBdanSwitch_Draw(Actor* thisx, GlobalContext* globalCtx) { break; case BLUE: func_8086DF58(this, globalCtx, gJabuBlueFloorSwitchDL); + break; } } diff --git a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c index 78b195308b..13308d39ae 100644 --- a/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c +++ b/src/overlays/actors/ovl_Bg_Bowl_Wall/z_bg_bowl_wall.c @@ -198,18 +198,18 @@ void BgBowlWall_Update(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc(this, globalCtx); } -void BgBowlWall_Draw(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void BgBowlWall_Draw(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; BgBowlWall* this = THIS; u32 frames; - OPEN_DISPS(globalCtx2->state.gfxCtx, "../z_bg_bowl_wall.c", 441); + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_bowl_wall.c", 441); - func_80093D84(globalCtx2->state.gfxCtx); + func_80093D84(globalCtx->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x8, - Gfx_TexScroll(globalCtx2->state.gfxCtx, 0, -2 * (frames = globalCtx2->state.frames), 16, 16)); + Gfx_TexScroll(globalCtx->state.gfxCtx, 0, -2 * (frames = globalCtx->state.frames), 16, 16)); gDPPipeSync(POLY_OPA_DISP++); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx2->state.gfxCtx, "../z_bg_bowl_wall.c", 453), + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_bowl_wall.c", 453), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); if (this->dyna.actor.params == 0) { @@ -218,5 +218,5 @@ void BgBowlWall_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_OPA_DISP++, gBowlingRound2WallDL); } - CLOSE_DISPS(globalCtx2->state.gfxCtx, "../z_bg_bowl_wall.c", 464); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_bowl_wall.c", 464); } diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 611d98b707..858f29b2fc 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -19,7 +19,7 @@ void BgDodoago_Draw(Actor* thisx, GlobalContext* globalCtx); void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx); void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx); -void func_8087227C(BgDodoago* this, GlobalContext* globalCtx); +void BgDodoago_DoNothing(BgDodoago* this, GlobalContext* globalCtx); void func_80872288(BgDodoago* this, GlobalContext* globalCtx); const ActorInit Bg_Dodoago_InitVars = { @@ -119,7 +119,7 @@ void BgDodoago_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); if (Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x3F))) { - BgDodoago_SetupAction(this, func_8087227C); + BgDodoago_SetupAction(this, BgDodoago_DoNothing); this->dyna.actor.shape.rot.x = 0x1333; globalCtx->roomCtx.unk_74[0] = globalCtx->roomCtx.unk_74[1] = 0xFF; return; @@ -175,22 +175,19 @@ void func_80871CF4(BgDodoago* this, GlobalContext* globalCtx) { sHasParent = true; D_80872824 = 0x32; } - } else { + } else if (Flags_GetEventChkInf(0xB0)) { + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[0]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[1]); + Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[2]); + this->colliders[0].dim.pos.z += 200; + this->colliders[1].dim.pos.z += 215; + this->colliders[1].dim.pos.x += 90; + this->colliders[2].dim.pos.z += 215; + this->colliders[2].dim.pos.x -= 90; - if (Flags_GetEventChkInf(0xB0)) { - Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[0]); - Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[1]); - Collider_UpdateCylinder(&this->dyna.actor, &this->colliders[2]); - this->colliders[0].dim.pos.z += 0xC8; - this->colliders[1].dim.pos.z += 0xD7; - this->colliders[1].dim.pos.x += 0x5A; - this->colliders[2].dim.pos.z += 0xD7; - this->colliders[2].dim.pos.x -= 0x5A; - - CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliders[0].base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); - CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[2].base); - } + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->colliders[0].base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[1].base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->colliders[2].base); } } @@ -215,7 +212,7 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) { D_80872824--; return; } - + if (D_80872824 == 0x6C) { for (i = 10; i >= 0; i--) { currentPos.x = D_808725CC[i].x + this->dyna.actor.world.pos.x; @@ -240,7 +237,7 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) { func_800AA000(500.0f, 0x78, 0x14, 0xA); if (Math_SmoothStepToS(&this->dyna.actor.shape.rot.x, 0x1333, 0x6E - this->unk_164, 0x3E8, 0x32) == 0) { - BgDodoago_SetupAction(this, func_8087227C); + BgDodoago_SetupAction(this, BgDodoago_DoNothing); Audio_PlaySoundGeneral(NA_SE_EV_STONE_BOUND, &this->dyna.actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8); } else { @@ -249,7 +246,7 @@ void func_80871FB8(BgDodoago* this, GlobalContext* globalCtx) { } } -void func_8087227C(BgDodoago* this, GlobalContext* globalCtx) { +void BgDodoago_DoNothing(BgDodoago* this, GlobalContext* globalCtx) { } void func_80872288(BgDodoago* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c index 3bd16c4a9e..d5d9a23671 100644 --- a/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c +++ b/src/overlays/actors/ovl_Bg_Dy_Yoseizo/z_bg_dy_yoseizo.c @@ -316,11 +316,12 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, GlobalContext* globalCtx) { void BgDyYoseizo_SetupSpinGrow_NoReward(BgDyYoseizo* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairySittingTransitionAnim); - Animation_Change(&this->skelAnime, &gGreatFairySittingTransitionAnim, 1.0f, 0.0f, this->frameCount, 2, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairySittingTransitionAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyLayingDownTransitionAnim); - Animation_Change(&this->skelAnime, &gGreatFairyLayingDownTransitionAnim, 1.0f, 0.0f, this->frameCount, 2, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyLayingDownTransitionAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_LAUGH_0); @@ -373,10 +374,12 @@ void BgDyYoseizo_SetupGreetPlayer_NoReward(BgDyYoseizo* this, GlobalContext* glo if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairySittingAnim); - Animation_Change(&this->skelAnime, &gGreatFairySittingAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairySittingAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_LOOP, + -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyLayingSidewaysAnim); - Animation_Change(&this->skelAnime, &gGreatFairyLayingSidewaysAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyLayingSidewaysAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_LOOP, + -10.0f); } this->actor.textId = 0xDB; @@ -409,10 +412,12 @@ void BgDyYoseizo_GreetPlayer_NoReward(BgDyYoseizo* this, GlobalContext* globalCt void BgDyYoseizo_SetupHealPlayer_NoReward(BgDyYoseizo* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairyGivingUpgradeAnim); - Animation_Change(&this->skelAnime, &gGreatFairyGivingUpgradeAnim, 1.0f, 0.0f, this->frameCount, 2, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyGivingUpgradeAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_ONCE, + -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyAnim_005810); - Animation_Change(&this->skelAnime, &gGreatFairyAnim_005810, 1.0f, 0.0f, this->frameCount, 2, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAnim_005810, 1.0f, 0.0f, this->frameCount, ANIMMODE_ONCE, + -10.0f); } Audio_PlayActorSound2(&this->actor, NA_SE_VO_FR_SMILE_0); @@ -437,10 +442,12 @@ void BgDyYoseizo_HealPlayer_NoReward(BgDyYoseizo* this, GlobalContext* globalCtx if ((this->frameCount <= curFrame) && !(this->animationChanged)) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairyAfterUpgradeAnim); - Animation_Change(&this->skelAnime, &gGreatFairyAfterUpgradeAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAfterUpgradeAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_LOOP, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyAfterSpellAnim); - Animation_Change(&this->skelAnime, &gGreatFairyAfterSpellAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAfterSpellAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_LOOP, + -10.0f); } this->healingTimer = 150; this->animationChanged = true; @@ -514,12 +521,12 @@ void BgDyYoseizo_SayFarewell_NoReward(BgDyYoseizo* this, GlobalContext* globalCt void BgDyYoseizo_SetupSpinShrink(BgDyYoseizo* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairyJewelFountainSpinShrinkAnim); - Animation_Change(&this->skelAnime, &gGreatFairyJewelFountainSpinShrinkAnim, 1.0f, 0.0f, this->frameCount, 2, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyJewelFountainSpinShrinkAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairySpellFountainSpinShrinkAnim); - Animation_Change(&this->skelAnime, &gGreatFairySpellFountainSpinShrinkAnim, 1.0f, 0.0f, this->frameCount, 2, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairySpellFountainSpinShrinkAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } this->vanishTimer = 5; @@ -578,12 +585,12 @@ void BgDyYoseizo_SetupSpinGrow_Reward(BgDyYoseizo* this, GlobalContext* globalCt if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairySittingTransitionAnim); - Animation_Change(&this->skelAnime, &gGreatFairySittingTransitionAnim, 1.0f, 0.0f, this->frameCount, 2, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairySittingTransitionAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyLayingDownTransitionAnim); Animation_Change(&this->skelAnime, &gGreatFairyLayingDownTransitionAnim, 1.0f, 0.0f, this->frameCount, - 2, -10.0f); + ANIMMODE_ONCE, -10.0f); } Audio_PlayActorSound2(&this->actor, NA_SE_EV_GREAT_FAIRY_APPEAR); @@ -621,11 +628,12 @@ void BgDyYoseizo_SpinGrowSetupGive_Reward(BgDyYoseizo* this, GlobalContext* glob if ((this->frameCount <= curFrame) && !this->animationChanged) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairySittingAnim); - Animation_Change(&this->skelAnime, &gGreatFairySittingAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairySittingAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_LOOP, + -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyLayingSidewaysAnim); - Animation_Change(&this->skelAnime, &gGreatFairyLayingSidewaysAnim, 1.0f, 0.0f, this->frameCount, 0, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyLayingSidewaysAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_LOOP, -10.0f); } this->animationChanged = true; } @@ -635,11 +643,12 @@ void BgDyYoseizo_SpinGrowSetupGive_Reward(BgDyYoseizo* this, GlobalContext* glob this->finishedSpinGrow = this->animationChanged = false; if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairyGivingUpgradeAnim); - Animation_Change(&this->skelAnime, &gGreatFairyGivingUpgradeAnim, 1.0f, 0.0f, this->frameCount, 2, - -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyGivingUpgradeAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_ONCE, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyAnim_005810); - Animation_Change(&this->skelAnime, &gGreatFairyAnim_005810, 1.0f, 0.0f, this->frameCount, 2, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAnim_005810, 1.0f, 0.0f, this->frameCount, ANIMMODE_ONCE, + -10.0f); } this->mouthState = 1; this->actionFunc = BgDyYoseizo_Give_Reward; @@ -674,10 +683,12 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, GlobalContext* globalCtx) { if ((this->frameCount <= curFrame) && !this->animationChanged) { if (globalCtx->sceneNum == SCENE_DAIYOUSEI_IZUMI) { this->frameCount = Animation_GetLastFrame(&gGreatFairyAfterUpgradeAnim); - Animation_Change(&this->skelAnime, &gGreatFairyAfterUpgradeAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAfterUpgradeAnim, 1.0f, 0.0f, this->frameCount, + ANIMMODE_LOOP, -10.0f); } else { this->frameCount = Animation_GetLastFrame(&gGreatFairyAfterSpellAnim); - Animation_Change(&this->skelAnime, &gGreatFairyAfterSpellAnim, 1.0f, 0.0f, this->frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gGreatFairyAfterSpellAnim, 1.0f, 0.0f, this->frameCount, ANIMMODE_LOOP, + -10.0f); } this->animationChanged = true; } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index ffa122f8ea..03de92d657 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -47,8 +47,8 @@ void BgGndDarkmeiro_ToggleBlock(BgGndDarkmeiro* this, GlobalContext* globalCtx) } } -void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; CollisionHeader* colHeader = NULL; BgGndDarkmeiro* this = THIS; @@ -61,7 +61,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { break; case DARKMEIRO_CLEAR_BLOCK: CollisionHeader_GetVirtual(&gClearBlockCol, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(globalCtx2, &globalCtx2->colCtx.dyna, &this->dyna.actor, colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if (((this->dyna.actor.params >> 8) & 0x3F) == 0x3F) { this->updateFunc = BgGndDarkmeiro_UpdateStaticBlock; this->dyna.actor.draw = BgGndDarkmeiro_DrawStaticBlock; @@ -69,8 +69,8 @@ void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFlags = this->timer1 = this->timer2 = 0; thisx->draw = BgGndDarkmeiro_DrawSwitchBlock; this->updateFunc = BgGndDarkmeiro_UpdateSwitchBlock; - if (!Flags_GetSwitch(globalCtx2, (this->dyna.actor.params >> 8) & 0x3F)) { - func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + if (!Flags_GetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F)) { + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } else { this->timer1 = 64; this->actionFlags |= 2; @@ -81,30 +81,30 @@ void BgGndDarkmeiro_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFlags = this->timer1 = this->timer2 = 0; this->updateFunc = BgGndDarkmeiro_UpdateBlockTimer; thisx->draw = NULL; - if (Flags_GetSwitch(globalCtx2, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { + if (Flags_GetSwitch(globalCtx, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { this->timer1 = 64; this->actionFlags |= 4; } - if (Flags_GetSwitch(globalCtx2, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { + if (Flags_GetSwitch(globalCtx, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { this->timer2 = 64; this->actionFlags |= 8; } if ((this->timer1 != 0) || (this->timer2 != 0)) { - Flags_SetSwitch(globalCtx2, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); } else { - Flags_UnsetSwitch(globalCtx2, (this->dyna.actor.params >> 8) & 0x3F); + Flags_UnsetSwitch(globalCtx, (this->dyna.actor.params >> 8) & 0x3F); } break; } } -void BgGndDarkmeiro_Destroy(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void BgGndDarkmeiro_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; BgGndDarkmeiro* this = THIS; if ((this->dyna.actor.params & 0xFF) == 1) { if (1) {} - DynaPoly_DeleteBgActor(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } } @@ -170,9 +170,9 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, GlobalContext* globa BgGndDarkmeiro_ToggleBlock(this, globalCtx); } -void BgGndDarkmeiro_Update(Actor* thisx, GlobalContext* globalCtx) { +void BgGndDarkmeiro_Update(Actor* thisx, GlobalContext* globalCtx2) { BgGndDarkmeiro* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; this->updateFunc(this, globalCtx2); } 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 273ed52576..de108c6488 100644 --- a/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c +++ b/src/overlays/actors/ovl_Bg_Haka/z_bg_haka.c @@ -70,7 +70,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (this->dyna.unk_150 != 0.0f) { - if (globalCtx->sceneNum == SCENE_SPOT02 && LINK_IS_CHILD && !gSaveContext.nightFlag) { + if (globalCtx->sceneNum == SCENE_SPOT02 && !LINK_IS_ADULT && !gSaveContext.nightFlag) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; if (!Gameplay_InCsMode(globalCtx)) { @@ -79,7 +79,7 @@ void func_8087B7E8(BgHaka* this, GlobalContext* globalCtx) { this->actionFunc = func_8087BAE4; } } else if (0.0f < this->dyna.unk_150 || - (globalCtx->sceneNum == SCENE_SPOT06 && LINK_IS_CHILD && !Flags_GetSwitch(globalCtx, 0x23))) { + (globalCtx->sceneNum == SCENE_SPOT06 && !LINK_IS_ADULT && !Flags_GetSwitch(globalCtx, 0x23))) { this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~0x10; } else { @@ -106,7 +106,7 @@ void func_8087B938(BgHaka* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; if (this->dyna.actor.params == 1) { func_80078884(NA_SE_SY_CORRECT_CHIME); - } else if (gSaveContext.nightFlag && globalCtx->sceneNum == SCENE_SPOT02) { + } else if (!IS_DAY && globalCtx->sceneNum == SCENE_SPOT02) { Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_POH, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, 0, this->dyna.actor.shape.rot.y, 0, 1); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 114408d79e..0a5e10fae0 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -95,14 +95,14 @@ void BgHidanHamstep_SetupAction(BgHidanHamstep* this, s32 action) { this->actionFunc = sActionFuncs[action]; } -s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx) { +s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx2) { BgHidanHamstep* step = this; s32 i; Vec3f pos; f32 sin; f32 cos; s16 params; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; pos = pos; // Required to match pos.y = this->dyna.actor.home.pos.y - 100.0f; @@ -113,11 +113,11 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, GlobalContext* globalCtx) pos.x = (((i * 160.0f) + 60.0f) * sin) + this->dyna.actor.home.pos.x; pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; - params = ((i + 1) & 0xFF); + params = (i + 1) & 0xFF; params |= (this->dyna.actor.params & 0xFF00); step = (BgHidanHamstep*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, &step->dyna.actor, globalCtx2, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, + &globalCtx->actorCtx, &step->dyna.actor, globalCtx, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, params); if (step == NULL) { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 002d35af56..b5778aae32 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -198,8 +198,8 @@ void BgIceShelter_Destroy(Actor* thisx, GlobalContext* globalCtx) { Collider_DestroyCylinder(globalCtx, &this->cylinder1); } -s16 D_80891794[] = { 0x0000, 0x4000, 0x2000, 0x6000, 0x1000, 0x5000, 0x3000, 0x7000 }; -s16 D_808917A4[] = { 0x0000, 0x003C, 0x0018, 0x0054, 0x0030, 0x000C, 0x0048, 0x0024 }; +static s16 D_80891794[] = { 0x0000, 0x4000, 0x2000, 0x6000, 0x1000, 0x5000, 0x3000, 0x7000 }; +static s16 D_808917A4[] = { 0x0000, 0x003C, 0x0018, 0x0054, 0x0030, 0x000C, 0x0048, 0x0024 }; void func_80890B8C(BgIceShelter* this, GlobalContext* globalCtx, f32 chance, f32 scale) { f32 cos; diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 132237d74c..7561441baf 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -46,7 +46,7 @@ void BgInGate_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - if ((globalCtx->sceneNum != SCENE_SPOT20 || LINK_IS_CHILD) || + if ((globalCtx->sceneNum != SCENE_SPOT20 || !LINK_IS_ADULT) || (((gSaveContext.eventChkInf[1] & 0x100)) && (gSaveContext.cutsceneIndex != 0xFFF0))) { Actor_Kill(&this->dyna.actor); return; diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index e1229cf301..066afcc74a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -133,23 +133,23 @@ void BgJyaLift_SetFinalPosY(BgJyaLift* this) { this->dyna.actor.world.pos.y = 973.0f; } -void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx) { +void BgJyaLift_Update(Actor* thisx, GlobalContext* globalCtx2) { BgJyaLift* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; if (this->actionFunc != NULL) { this->actionFunc(this, globalCtx); } if ((this->dyna.unk_160 & 4) && ((this->unk_16B & 4) == 0)) { - Camera_ChangeSetting(globalCtx2->cameraPtrs[MAIN_CAM], CAM_SET_TEPPEN); + Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], CAM_SET_TEPPEN); } else if (((this->dyna.unk_160) & 4) == 0 && ((this->unk_16B & 4)) && - (globalCtx2->cameraPtrs[MAIN_CAM]->setting == CAM_SET_TEPPEN)) { - Camera_ChangeSetting(globalCtx2->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0); + (globalCtx->cameraPtrs[MAIN_CAM]->setting == CAM_SET_TEPPEN)) { + Camera_ChangeSetting(globalCtx->cameraPtrs[MAIN_CAM], CAM_SET_DUNGEON0); } this->unk_16B = this->dyna.unk_160; // Spirit Temple room 5 is the main room with the statue room 25 is directly above room 5 - if ((globalCtx2->roomCtx.curRoom.num != 5) && (globalCtx2->roomCtx.curRoom.num != 25)) { + if ((globalCtx->roomCtx.curRoom.num != 5) && (globalCtx->roomCtx.curRoom.num != 25)) { Actor_Kill(thisx); } } diff --git a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c index d40a69b726..1e26704f31 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Break/z_bg_spot00_break.c @@ -51,7 +51,7 @@ void BgSpot00Break_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index e86cb37faa..1c44e60feb 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -66,22 +66,22 @@ void BgSpot00Hanebasi_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); if (this->dyna.actor.params == DT_DRAWBRIDGE) { - if ((LINK_IS_ADULT) && (gSaveContext.sceneSetupIndex < 4)) { + if (LINK_IS_ADULT && (gSaveContext.sceneSetupIndex < 4)) { Actor_Kill(&this->dyna.actor); return; } if ((gSaveContext.sceneSetupIndex != 6) && ((gSaveContext.sceneSetupIndex == 4) || (gSaveContext.sceneSetupIndex == 5) || - ((LINK_IS_CHILD) && (gSaveContext.nightFlag != 0)))) { + (!LINK_IS_ADULT && !IS_DAY))) { this->dyna.actor.shape.rot.x = -0x4000; } else { this->dyna.actor.shape.rot.x = 0; } if (gSaveContext.sceneSetupIndex != 6) { - if ((CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) && (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) && - (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) && (!(gSaveContext.eventChkInf[8] & 1))) { + if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1)) { this->dyna.actor.shape.rot.x = -0x4000; } } @@ -140,8 +140,8 @@ void BgSpot00Hanebasi_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, GlobalContext* globalCtx) { BgSpot00Hanebasi* child = (BgSpot00Hanebasi*)this->dyna.actor.child; - if ((gSaveContext.sceneSetupIndex >= 4) || (!(CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD))) || - (!(CHECK_QUEST_ITEM(QUEST_GORON_RUBY))) || (!(CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE))) || + if ((gSaveContext.sceneSetupIndex >= 4) || !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) || + !CHECK_QUEST_ITEM(QUEST_GORON_RUBY) || !CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) || (gSaveContext.eventChkInf[8] & 1)) { if (this->dyna.actor.shape.rot.x != 0) { if (Flags_GetEnv(globalCtx, 0) || ((gSaveContext.sceneSetupIndex < 4) && (gSaveContext.nightFlag == 0))) { @@ -153,8 +153,7 @@ void BgSpot00Hanebasi_DrawbridgeWait(BgSpot00Hanebasi* this, GlobalContext* glob if (this) {} // required to match } - - if ((this->dyna.actor.shape.rot.x == 0) && (gSaveContext.sceneSetupIndex < 4) && (LINK_IS_CHILD) && + if ((this->dyna.actor.shape.rot.x == 0) && (gSaveContext.sceneSetupIndex < 4) && !LINK_IS_ADULT && (gSaveContext.nightFlag != 0)) { this->actionFunc = BgSpot00Hanebasi_DrawbridgeRiseAndFall; this->destAngle = -0x4000; @@ -214,9 +213,8 @@ void BgSpot00Hanebasi_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.params == DT_DRAWBRIDGE) { if (globalCtx->sceneNum == SCENE_SPOT00) { - if ((CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) && (CHECK_QUEST_ITEM(QUEST_GORON_RUBY)) && - (CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE)) && (!(gSaveContext.eventChkInf[8] & 1)) && - (gSaveContext.linkAge == 1)) { + if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && + CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !(gSaveContext.eventChkInf[8] & 1) && LINK_IS_CHILD) { Player* player = PLAYER; if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) && @@ -321,7 +319,7 @@ void BgSpot00Hanebasi_Draw(Actor* thisx, GlobalContext* globalCtx) { thisx->child->child->world.pos.z = newPos.z; if (gSaveContext.sceneSetupIndex != 12) { - if ((gSaveContext.sceneSetupIndex >= 4) || ((LINK_IS_CHILD) && (thisx->shape.rot.x < -0x2000))) { + if ((gSaveContext.sceneSetupIndex >= 4) || (!LINK_IS_ADULT && (thisx->shape.rot.x < -0x2000))) { BgSpot00Hanebasi_DrawTorches(thisx, globalCtx); } else { sTorchFlameScale = 0.0f; diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c index 61f1054752..9b55aa402a 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idosoko/z_bg_spot01_idosoko.c @@ -48,7 +48,7 @@ void BgSpot01Idosoko_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); CollisionHeader_GetVirtual(&gKakarikoBOTWStoneCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Actor_Kill(&this->dyna.actor); } else { BgSpot01Idosoko_SetupAction(this, func_808ABF54); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 2adea7d611..f99297ceb3 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -107,7 +107,7 @@ void func_808AC2BC(BgSpot01Objects2* this, GlobalContext* globalCtx) { case 3: // Shooting Gallery, spawns Carpenter Sabooro during the day CollisionHeader_GetVirtual(&D_06001C58, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { func_808AC22C(globalCtx->setupPathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0); Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 3df341db46..0d71d6541c 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -164,7 +164,7 @@ void func_808ACA08(BgSpot02Objects* this, GlobalContext* globalCtx) { } if (globalCtx->csCtx.frames == 402) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_8002F7DC(&player->actor, NA_SE_VO_LI_DEMO_DAMAGE_KID); } else { func_8002F7DC(&player->actor, NA_SE_VO_LI_DEMO_DAMAGE); diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index acdb582ac9..212147b06d 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -177,7 +177,7 @@ void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, thisx, colHeader); this->actionFunc = BgSpot06Objects_DoNothing; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Actor_Kill(thisx); } break; diff --git a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c index 29d1b8cbd4..68d5b94654 100644 --- a/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot07_Taki/z_bg_spot07_taki.c @@ -100,7 +100,7 @@ void BgSpot07Taki_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, ((frames * -1) & 0x7F), ((frames * 1) & 0x7F), 32, 32, 1, ((frames * 1) & 0x7F), ((frames * 1) & 0x7F), 32, 32)); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); if (this->dyna.actor.params == 0) { gSPSegment(POLY_XLU_DISP++, 0x09, diff --git a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c index 2da429ca92..45ec1ef6a5 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Doughnut/z_bg_spot16_doughnut.c @@ -72,7 +72,7 @@ void BgSpot16Doughnut_Init(Actor* thisx, GlobalContext* globalCtx) { break; } osSyncPrintf(VT_FGCOL(CYAN) "%f" VT_RST "\n", this->actor.scale.x); - if (LINK_IS_CHILD || gSaveContext.eventChkInf[2] & 0x8000) { + if (!LINK_IS_ADULT || gSaveContext.eventChkInf[2] & 0x8000) { this->fireFlag &= ~1; } else { this->fireFlag |= 1; diff --git a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c index 1f6c16a98c..87ec59a566 100644 --- a/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c +++ b/src/overlays/actors/ovl_Bg_Toki_Swd/z_bg_toki_swd.c @@ -102,9 +102,9 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) { globalCtx->csCtx.segment = D_808BBD90; gSaveContext.cutsceneTrigger = 1; } - if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20))) { + if (!LINK_IS_ADULT || ((gSaveContext.eventChkInf[5] & 0x20))) { if (Actor_HasParent(&this->actor, globalCtx)) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Item_Give(globalCtx, ITEM_SWORD_MASTER); globalCtx->csCtx.segment = D_808BB2F0; } else { @@ -135,7 +135,7 @@ void func_808BB0AC(BgTokiSwd* this, GlobalContext* globalCtx) { // if sword has a parent it has been pulled/placed from the pedestal if (Actor_HasParent(&this->actor, globalCtx)) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Audio_PlayActorSound2(&this->actor, NA_SE_IT_SWORD_PUTAWAY_STN); this->actor.draw = NULL; // sword has been pulled, dont draw sword } else { @@ -161,22 +161,22 @@ void BgTokiSwd_Update(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } -void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void BgTokiSwd_Draw(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; BgTokiSwd* this = THIS; s32 pad[3]; - OPEN_DISPS(globalCtx2->state.gfxCtx, "../z_bg_toki_swd.c", 727); + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 727); - func_80093D18(globalCtx2->state.gfxCtx); + func_80093D18(globalCtx->state.gfxCtx); - func_8002EBCC(&this->actor, globalCtx2, 0); + func_8002EBCC(&this->actor, globalCtx, 0); gSPSegment(POLY_OPA_DISP++, 0x08, - Gfx_TexScroll(globalCtx2->state.gfxCtx, 0, -(globalCtx2->gameplayFrames % 0x80), 32, 32)); - gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx2->state.gfxCtx, "../z_bg_toki_swd.c", 742), + Gfx_TexScroll(globalCtx->state.gfxCtx, 0, -(globalCtx->gameplayFrames % 0x80), 32, 32)); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 742), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, D_06001BD0); - CLOSE_DISPS(globalCtx2->state.gfxCtx, "../z_bg_toki_swd.c", 776); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_toki_swd.c", 776); } diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index 77ddc45f05..8dd0cad79e 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -69,7 +69,7 @@ void BgTreemouth_Init(Actor* thisx, GlobalContext* globalCtx) { ActorShape_Init(&thisx->shape, 0.0f, NULL, 0.0f); Actor_SetFocus(thisx, 50.0f); - if ((gSaveContext.sceneSetupIndex < 4) && LINK_IS_CHILD) { + if ((gSaveContext.sceneSetupIndex < 4) && !LINK_IS_ADULT) { BgTreemouth_SetupAction(this, func_808BC8B8); } else if (LINK_IS_ADULT || (gSaveContext.sceneSetupIndex == 7)) { this->unk_168 = 0.0f; @@ -138,7 +138,7 @@ void func_808BC864(BgTreemouth* this, GlobalContext* globalCtx) { void func_808BC8B8(BgTreemouth* this, GlobalContext* globalCtx) { if ((!(Flags_GetEventChkInf(5))) || LINK_IS_ADULT) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0xC)) { if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x7530)) { this->dyna.actor.flags |= 1; diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c index a4c16b94ca..0b916c2fc6 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth_cutscene_data.c @@ -2,7 +2,7 @@ #include "z64cutscene_commands.h" // clang-format off -CutsceneData D_808BCE20[] = { +static CutsceneData D_808BCE20[] = { CS_BEGIN_CUTSCENE(12, 3000), CS_UNK_DATA_LIST(0x00000015, 1), CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x00000000, 0x00000000), @@ -62,7 +62,7 @@ CutsceneData D_808BCE20[] = { CS_END(), }; -CutsceneData D_808BD2A0[] = { +static CutsceneData D_808BD2A0[] = { CS_BEGIN_CUTSCENE(9, 3000), CS_UNK_DATA_LIST(0x00000015, 1), CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x00000000, 0x00000000), @@ -102,7 +102,7 @@ CutsceneData D_808BD2A0[] = { CS_END(), }; -CutsceneData D_808BD520[] = { +static CutsceneData D_808BD520[] = { CS_BEGIN_CUTSCENE(8, 3000), CS_UNK_DATA_LIST(0x00000015, 1), CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x00000000, 0x00000000), @@ -137,7 +137,7 @@ CutsceneData D_808BD520[] = { CS_END(), }; -CutsceneData D_808BD790[] = { +static CutsceneData D_808BD790[] = { CS_BEGIN_CUTSCENE(8, 3000), CS_UNK_DATA_LIST(0x00000015, 1), CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x0000000F, 0xFFFFFFDE, 0x00000000, 0x00000000, 0x00000000), diff --git a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 14bb5d6f83..4689e41872 100644 --- a/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -49,7 +49,7 @@ const ActorInit Boss_Dodongo_InitVars = { static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 12, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x0C, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3000.0f, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 8200.0f, ICHAIN_STOP), }; @@ -259,7 +259,7 @@ void BossDodongo_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BossDodongo_SetupIntroCutscene(BossDodongo* this, GlobalContext* globalCtx) { s16 frames = Animation_GetLastFrame(&D_0600F0D8); - Animation_Change(&this->skelAnime, &D_0600F0D8, 1.0f, 0.0f, frames, 0, -10.0f); + Animation_Change(&this->skelAnime, &D_0600F0D8, 1.0f, 0.0f, frames, ANIMMODE_LOOP, -10.0f); this->actionFunc = BossDodongo_IntroCutscene; this->csState = 0; this->unk_1BC = 1; @@ -528,7 +528,8 @@ void BossDodongo_SetupBlowFire(BossDodongo* this) { void BossDodongo_SetupInhale(BossDodongo* this) { this->actor.speedXZ = 0.0f; - Animation_Change(&this->skelAnime, &D_06008EEC, 1.0f, 0.0f, Animation_GetLastFrame(&D_06008EEC), 2, -5.0f); + Animation_Change(&this->skelAnime, &D_06008EEC, 1.0f, 0.0f, Animation_GetLastFrame(&D_06008EEC), ANIMMODE_ONCE, + -5.0f); this->actionFunc = BossDodongo_Inhale; this->unk_1DA = 100; this->unk_1AC = 0; 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 988f02d30e..7b2de23950 100644 --- a/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -61,7 +61,7 @@ const ActorInit Boss_Fd_InitVars = { static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 33, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x21, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 0096487469..992f6d8903 100644 --- a/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -69,7 +69,7 @@ static Vec3f sHoleLocations[] = { static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 33, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x21, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; @@ -951,8 +951,8 @@ void BossFd2_UpdateFace(BossFd2* this, GlobalContext* globalCtx) { } } -void BossFd2_Update(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void BossFd2_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; BossFd2* this = THIS; s16 i; @@ -962,7 +962,7 @@ void BossFd2_Update(Actor* thisx, GlobalContext* globalCtx) { this->work[FD2_VAR_TIMER]++; this->work[FD2_UNK_TIMER]++; - this->actionFunc(this, globalCtx2); + this->actionFunc(this, globalCtx); for (i = 0; i < ARRAY_COUNT(this->timers); i++) { if (this->timers[i] != 0) { @@ -978,16 +978,16 @@ void BossFd2_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->deathState == DEATH_START) { if (this->work[FD2_INVINC_TIMER] == 0) { - BossFd2_CollisionCheck(this, globalCtx2); + BossFd2_CollisionCheck(this, globalCtx); } - CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); if (!this->disableAT) { - CollisionCheck_SetAT(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } - BossFd2_UpdateFace(this, globalCtx2); + BossFd2_UpdateFace(this, globalCtx); this->fwork[FD2_TEX1_SCROLL_X] += 4.0f; this->fwork[FD2_TEX1_SCROLL_Y] = 120.0f; this->fwork[FD2_TEX2_SCROLL_X] += 3.0f; diff --git a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 08d5acde20..00463ea08f 100644 --- a/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -201,7 +201,7 @@ static void* sMouthTex_ci8_16x16[] = { gPhantomGanonMouthTex, gPhantomGanonSmile static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 43, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x2B, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index 85fadc6863..6718f16d74 100644 --- a/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -333,7 +333,7 @@ void BossGoma_ClearPixels(u8* clearPixelTable, s16 i) { static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 1, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x01, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -2000, ICHAIN_STOP), }; @@ -843,7 +843,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { this->subCameraAt.z = this->actor.world.pos.z; if (this->framesUntilNextAction < 0) { - // @bug ? unreachable, timer is >= 0 + //! @bug ? unreachable, timer is >= 0 SkelAnime_Update(&this->skelanime); Math_ApproachZeroF(&this->actor.speedXZ, 1.0f, 2.0f); } else { @@ -1080,7 +1080,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { for (i = 0; i < 4; i++) { BossGoma_ClearPixels(sClearPixelTableFirstPass, this->decayingProgress); - // @bug this allows this->decayingProgress = 0x100 = 256 which is out of bounds when accessing + //! @bug this allows this->decayingProgress = 0x100 = 256 which is out of bounds when accessing // sClearPixelTableFirstPass, though timers may prevent this from ever happening? if (this->decayingProgress < 0x100) { this->decayingProgress++; @@ -1154,7 +1154,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { for (i = 0; i < 4; i++) { BossGoma_ClearPixels(sClearPixelTableSecondPass, this->decayingProgress); - // @bug same as sClearPixelTableFirstPass + //! @bug same as sClearPixelTableFirstPass if (this->decayingProgress < 0x100) { this->decayingProgress++; } @@ -1164,7 +1164,7 @@ void BossGoma_Defeated(BossGoma* this, GlobalContext* globalCtx) { case 3: for (i = 0; i < 4; i++) { BossGoma_ClearPixels(sClearPixelTableSecondPass, this->decayingProgress); - // @bug same as sClearPixelTableFirstPass + //! @bug same as sClearPixelTableFirstPass if (this->decayingProgress < 0x100) { this->decayingProgress++; } diff --git a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index bdca1fa490..4040957074 100644 --- a/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -259,7 +259,7 @@ static AnimationHeader* sHandPushoffPoses[] = { &gBongoLeftHandPushoffPoseAnim, static AnimationHeader* sHandHangPoses[] = { &gBongoLeftHandHangPoseAnim, &gBongoRightHandHangPoseAnim }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 41, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x29, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 20, ICHAIN_STOP), }; @@ -1862,7 +1862,7 @@ void BossSst_HandCrush(BossSst* this, GlobalContext* globalCtx) { player->actor.world.pos = this->actor.world.pos; if (this->timer == 0) { this->timer = 20; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S_KID); } else { func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S); diff --git a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 750a4381c5..b2c0ac469d 100644 --- a/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -687,9 +687,9 @@ void func_8096865C(Actor* thisx, GlobalContext* globalCtx) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1242); } -void func_809688C4(Actor* thisx, GlobalContext* globalCtx) { +void func_809688C4(Actor* thisx, GlobalContext* globalCtx2) { Demo6K* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; u32 frames = globalCtx->state.frames; s32 i; @@ -710,7 +710,7 @@ void func_809688C4(Actor* thisx, GlobalContext* globalCtx) { Matrix_Scale(this->unk_234[i] * D_8096931C[(frames + i) & 3], this->unk_234[i] * D_8096931C[(frames + i) & 3], this->unk_234[i] * D_8096931C[(frames + i) & 3], MTXMODE_APPLY); - func_800D1FD4(&globalCtx2->mf_11DA0); + func_800D1FD4(&globalCtx->mf_11DA0); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_6k.c", 1297), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffFlash1DL); diff --git a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c index 8691275712..d121b19560 100644 --- a/src/overlays/actors/ovl_Demo_Du/z_demo_du.c +++ b/src/overlays/actors/ovl_Demo_Du/z_demo_du.c @@ -504,8 +504,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo04(DemoDu* this, GlobalContext* globalCtx) { void DemoDu_CsGoronsRuby_AdvanceTo05(DemoDu* this, s32 animFinished) { if (animFinished) { - Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0, - 0.0f); + Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), + ANIMMODE_LOOP, 0.0f); this->updateIndex = CS_GORONSRUBY_SUBSCENE(5); } } @@ -524,8 +524,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo06(DemoDu* this, GlobalContext* globalCtx) { void DemoDu_CsGoronsRuby_AdvanceTo07(DemoDu* this, s32 animFinished) { if (animFinished) { - Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0, - 0.0f); + Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), + ANIMMODE_LOOP, 0.0f); this->updateIndex = CS_GORONSRUBY_SUBSCENE(7); } } @@ -552,8 +552,8 @@ void DemoDu_CsGoronsRuby_AdvanceTo09(DemoDu* this, s32 animFinished) { void DemoDu_CsGoronsRuby_AdvanceTo10(DemoDu* this, s32 animFinished) { if (animFinished) { - Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), 0, - 0.0f); + Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), + ANIMMODE_LOOP, 0.0f); this->updateIndex = CS_GORONSRUBY_SUBSCENE(10); } } @@ -584,7 +584,7 @@ void DemoDu_CsGoronsRuby_AdvanceTo13(DemoDu* this, GlobalContext* globalCtx) { if ((npcAction != NULL) && (npcAction->action != 6)) { Animation_Change(&this->skelAnime, &gDaruniaIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gDaruniaIdleAnim), - 0, 0.0f); + ANIMMODE_LOOP, 0.0f); this->updateIndex = CS_GORONSRUBY_SUBSCENE(13); } } @@ -703,7 +703,7 @@ void DemoDu_InitCs_AfterGanon(DemoDu* this, GlobalContext* globalCtx) { f32 lastFrame = Animation_GetLastFrame(&gDaruniaSageFormationAnim); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gDaruniaSkel, NULL, NULL, NULL, 0); - Animation_Change(&this->skelAnime, &gDaruniaSageFormationAnim, 1.0f, 0.0f, lastFrame, 2, 0.0f); + Animation_Change(&this->skelAnime, &gDaruniaSageFormationAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, 0.0f); this->updateIndex = CS_CHAMBERAFTERGANON_SUBSCENE(0); this->actor.shape.shadowAlpha = 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 2ed9f68415..fb062b5e3d 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -111,7 +111,7 @@ static s16 sEffectTypeObjects[] = { static u8 sTimewarpVertexSizeIndices[] = { 1, 1, 2, 0, 1, 1, 2, 0, 1, 2, 0, 2, 1, 0, 1, 0, 2, 0, 2, 2, 0 }; -Color_RGB8 sJewelSparkleColors[5][2] = { +static Color_RGB8 sJewelSparkleColors[5][2] = { { { 255, 255, 255 }, { 100, 255, 0 } }, { { 255, 255, 255 }, { 200, 0, 150 } }, { { 255, 255, 255 }, { 0, 100, 255 } }, { { 0, 0, 0 }, { 0, 0, 0 } }, { { 223, 0, 0 }, { 0, 0, 0 } }, @@ -141,7 +141,7 @@ f32 DemoEffect_InterpolateCsFrames(GlobalContext* globalCtx, s32 csActionId) { */ void DemoEffect_InitJewel(GlobalContext* globalCtx, DemoEffect* this) { this->initDrawFunc = DemoEffect_DrawJewel; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->initUpdateFunc = DemoEffect_UpdateJewelChild; } else { this->initUpdateFunc = DemoEffect_UpdateJewelAdult; @@ -175,8 +175,8 @@ void DemoEffect_InitGetItem(DemoEffect* this) { /** * Main Actor Init function */ -void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; DemoEffect* this = THIS; s32 effectType; s32 lightEffect; @@ -413,7 +413,7 @@ void DemoEffect_Init(Actor* thisx, GlobalContext* globalCtx) { } lightRing = (DemoEffect*)Actor_SpawnAsChild( - &globalCtx2->actorCtx, &crystalLight->actor, globalCtx2, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, + &globalCtx->actorCtx, &crystalLight->actor, globalCtx, ACTOR_DEMO_EFFECT, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, DEMO_EFFECT_LIGHTRING_TRIFORCE); if (lightRing != NULL) { @@ -1664,9 +1664,9 @@ s32 DemoEffect_CheckCsAction(DemoEffect* this, GlobalContext* globalCtx, s32 csA /** * Draw function for the Jewel Actor. */ -void DemoEffect_DrawJewel(Actor* thisx, GlobalContext* globalCtx) { +void DemoEffect_DrawJewel(Actor* thisx, GlobalContext* globalCtx2) { DemoEffect* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; u32 frames = this->jewel.timer; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2543); @@ -1678,21 +1678,21 @@ void DemoEffect_DrawJewel(Actor* thisx, GlobalContext* globalCtx) { switch (this->jewel.type) { case DEMO_EFFECT_JEWEL_KOKIRI: gSPSegment(POLY_XLU_DISP++, 9, - Gfx_TwoTexScroll(globalCtx2->state.gfxCtx, 0, (frames * 4) % 256, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (frames * 4) % 256, (256 - ((frames * 2) % 256)) - 1, 64, 64, 1, (frames * 2) % 256, (256 - (frames % 256)) - 1, 16, 16)); break; case DEMO_EFFECT_JEWEL_GORON: gSPSegment(POLY_XLU_DISP++, 9, - Gfx_TwoTexScroll(globalCtx2->state.gfxCtx, 0, (frames * 4) % 128, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (frames * 4) % 128, (256 - ((frames * 2) % 256)) - 1, 32, 64, 1, (frames * 2) % 256, (256 - (frames % 256)) - 1, 16, 8)); break; case DEMO_EFFECT_JEWEL_ZORA: gSPSegment(POLY_XLU_DISP++, 9, - Gfx_TwoTexScroll(globalCtx2->state.gfxCtx, 0, (frames * 4) % 256, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (frames * 4) % 256, (256 - ((frames * 2) % 256)) - 1, 32, 32, 1, (frames * 2) % 256, (256 - (frames % 256)) - 1, 16, 16)); break; @@ -1938,24 +1938,24 @@ void DemoEffect_DrawLgtShower(Actor* thisx, GlobalContext* globalCtx) { /** * Draw function for the Light Ring Actor. */ -void DemoEffect_DrawLightRing(Actor* thisx, GlobalContext* globalCtx) { +void DemoEffect_DrawLightRing(Actor* thisx, GlobalContext* globalCtx2) { DemoEffect* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; u32 frames = this->lightRing.timer; - OPEN_DISPS(globalCtx2->state.gfxCtx, "../z_demo_effect.c", 2956); + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2956); - func_80093D84(globalCtx2->state.gfxCtx); + func_80093D84(globalCtx->state.gfxCtx); gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, 170, 255, 255, this->lightRing.alpha); gDPSetEnvColor(POLY_XLU_DISP++, 0, 100, 255, 255); - gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx2->state.gfxCtx, "../z_demo_effect.c", 2963), + gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2963), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 8, - Gfx_TwoTexScroll(globalCtx2->state.gfxCtx, 0, (frames * 5) % 64, 512 - ((frames * 2) % 512) - 1, 16, 128, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (frames * 5) % 64, 512 - ((frames * 2) % 512) - 1, 16, 128, 1, 0, 0, 8, 1024)); gSPDisplayList(POLY_XLU_DISP++, gGoldenGoddessLightRingDL); - CLOSE_DISPS(globalCtx2->state.gfxCtx, "../z_demo_effect.c", 2978); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_effect.c", 2978); } /** diff --git a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c index 6a7bfe67a9..0e2d98b93c 100644 --- a/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c +++ b/src/overlays/actors/ovl_Demo_Gt/z_demo_gt.c @@ -1063,11 +1063,11 @@ void func_8098085C(DemoGt* this, GlobalContext* globalCtx) { } } -void func_809809C0(DemoGt* this, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void func_809809C0(DemoGt* this, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; DemoGt* this2 = this; - s32 gameplayFrames = globalCtx2->gameplayFrames; - u16 frames = globalCtx2->csCtx.frames; + s32 gameplayFrames = globalCtx->gameplayFrames; + u16 frames = globalCtx->csCtx.frames; Vec3f sp54; s16 pad[3]; @@ -1081,7 +1081,7 @@ void func_809809C0(DemoGt* this, GlobalContext* globalCtx) { sp54.z = this2->dyna.actor.world.pos.z + 23.0f; if (ABS(gameplayFrames % 12) == 0) { - DemoGt_SpawnExplosionNoSound(globalCtx2, &sp54, &sp40, &sp34, 2.0f); + DemoGt_SpawnExplosionNoSound(globalCtx, &sp54, &sp40, &sp34, 2.0f); } } } @@ -1245,9 +1245,9 @@ void DemoGt_Update16(DemoGt* this, GlobalContext* globalCtx) { } } -void DemoGt_Draw4(DemoGt* this, GlobalContext* globalCtx) { +void DemoGt_Draw4(DemoGt* this, GlobalContext* globalCtx2) { GraphicsContext* gfxCtx; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; u16 frames = globalCtx->csCtx.frames; s32 pad; s16 sp76; @@ -1268,7 +1268,7 @@ void DemoGt_Draw4(DemoGt* this, GlobalContext* globalCtx) { sp6C = kREG(61); sp68 = (s16)((s32)kREG(58)) + 0x4000; sp6A = kREG(58); - gfxCtx = globalCtx2->state.gfxCtx; + gfxCtx = globalCtx->state.gfxCtx; sp60 = Graph_Alloc(gfxCtx, sizeof(Mtx)); sp44 = 1.0f - Math_CosS(sp76); @@ -1288,8 +1288,8 @@ void DemoGt_Draw4(DemoGt* this, GlobalContext* globalCtx) { Matrix_Translate(sp48.x, sp48.y, sp48.z, MTXMODE_APPLY); Matrix_ToMtx(sp60, "../z_demo_gt_part4_1.c", 232); - if (!FrameAdvance_IsEnabled(globalCtx2)) { - func_80980F8C(this, globalCtx2); + if (!FrameAdvance_IsEnabled(globalCtx)) { + func_80980F8C(this, globalCtx); } Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c index 7ee3501b8d..4a35a7e2ed 100644 --- a/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c +++ b/src/overlays/actors/ovl_Demo_Ik/z_demo_ik.c @@ -200,7 +200,7 @@ void DemoIk_Type1Init(DemoIk* this, GlobalContext* globalCtx) { } ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, phi_f0); SkelAnime_Init(globalCtx, &this->skelAnime, skeleton, NULL, this->jointTable, this->morphTable, 2); - Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), 2, 0.0f); + Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); } void func_8098393C(DemoIk* this) { @@ -338,7 +338,7 @@ void DemoIk_Type2Init(DemoIk* this, GlobalContext* globalCtx) { } SkelAnime_InitFlex(globalCtx, &this->skelAnime, skeleton, NULL, this->jointTable, this->morphTable, 2); - Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), 2, 0.0f); + Animation_Change(&this->skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(animation), ANIMMODE_ONCE, 0.0f); this->actionMode = 3; this->drawMode = 0; } diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c index bf026a8440..db5e5bb274 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im_cutscene_data.c @@ -2,7 +2,7 @@ #include "z64cutscene_commands.h" // clang-format off -CutsceneData D_8098786C[] = { +static CutsceneData D_8098786C[] = { CS_BEGIN_CUTSCENE(32, 3000), CS_UNK_DATA_LIST(0x00000020, 1), CS_UNK_DATA(0x00010000, 0x0BB80000, 0x00000000, 0x00000000, 0xFFFFFFFC, 0x00000002, 0x00000000, 0xFFFFFFFC, 0x00000002, 0x00000000, 0x00000000, 0x00000000), diff --git a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c index 597cf1f5d2..4ed2c16432 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -328,14 +328,14 @@ void DemoKankyo_SetupType(DemoKankyo* this, GlobalContext* globalCtx) { if (this->warpTimer == 1) { if (globalCtx->sceneNum == SCENE_TOKINOMA) { D_8098CF84 = 25; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->csCtx.segment = gChildWarpInToTCS; } else { globalCtx->csCtx.segment = gAdultWarpInToTCS; } } else { D_8098CF84 = 32; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->csCtx.segment = gChildWarpInCS; } else { globalCtx->csCtx.segment = gAdultWarpInCS; @@ -349,13 +349,13 @@ void DemoKankyo_SetupType(DemoKankyo* this, GlobalContext* globalCtx) { break; case DEMOKANKYO_WARP_IN: if (globalCtx->sceneNum == SCENE_TOKINOMA) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->csCtx.segment = gChildWarpOutToTCS; } else { globalCtx->csCtx.segment = gAdultWarpOutToTCS; } } else { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { globalCtx->csCtx.segment = gChildWarpOutCS; } else { globalCtx->csCtx.segment = gAdultWarpOutCS; @@ -446,7 +446,7 @@ void DemoKankyo_Draw(Actor* thisx, GlobalContext* globalCtx) { } else if (!Actor_IsFacingAndNearPlayer(&this->actor, 300.0f, 0x7530)) { break; } else { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (globalCtx->csCtx.frames < 170 || globalCtx->csCtx.state == CS_STATE_IDLE) { break; } diff --git a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c index 19b0a2e8a1..a15046e989 100644 --- a/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c +++ b/src/overlays/actors/ovl_Demo_Shd/z_demo_shd_gfxdata.c @@ -1,7 +1,7 @@ #include "ultra64.h" #include "global.h" -UNK_TYPE D_80991680[] = { +static UNK_TYPE D_80991680[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -61,7 +61,7 @@ UNK_TYPE D_80991680[] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }; -UNK_TYPE D_80991E80[] = { +static UNK_TYPE D_80991E80[] = { 0x2F3E56AB, 0xA4582102, 0x10417AB0, 0x805C312A, 0x32376DD4, 0xA2633907, 0x0B387DA2, 0x6D81470C, 0x3C5C60AC, 0xA5571801, 0x154C97B9, 0x68533236, 0x304276D6, 0x9B533108, 0x154A96B7, 0x7C9B400B, 0x3E756FAE, 0xAF5D1301, 0x1D59B4BF, 0x53432C38, 0x2F487DCC, 0x8A4A2406, 0x1F5DB0C8, 0x90B55110, 0x408B7FAA, 0xB76D1503, 0x286ACCBE, @@ -121,7 +121,7 @@ UNK_TYPE D_80991E80[] = { 0x242B4FB8, 0xB66A2E06, 0x0D3E66AA, 0x9B663322, 0x3B2D6CDD, 0xB47B450A, 0x062B6E9C, 0x6E705D17, }; -Vtx D_80992680[] = { +static Vtx D_80992680[] = { VTX(405, 1572, -1643, 401, -3470, 0x00, 0x78, 0x00, 0xFF), VTX(470, 1488, -1799, 512, -3755, 0x00, 0x78, 0x00, 0xFF), VTX(207, 1312, -1162, 251, -3368, 0x00, 0x78, 0x00, 0xFF), @@ -156,7 +156,7 @@ Vtx D_80992680[] = { VTX(1915, 295, 1153, 410, 2901, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80992880[] = { +static Vtx D_80992880[] = { VTX(1905, 295, 1026, 410, 2617, 0x00, 0x78, 0x00, 0xFF), VTX(1940, 295, 1047, 512, 2674, 0x00, 0x78, 0x00, 0xFF), VTX(1905, 220, 1026, 396, 2481, 0x00, 0x78, 0x00, 0xFF), VTX(1940, 220, 1047, 512, 2560, 0x00, 0x78, 0x00, 0xFF), VTX(1658, 220, 1169, 101, 2487, 0x00, 0x78, 0x00, 0xFF), VTX(1658, 220, 1215, 0, 2560, 0x00, 0x78, 0x00, 0xFF), @@ -175,7 +175,7 @@ Vtx D_80992880[] = { VTX(1915, -200, 1153, 410, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(1968, -200, 1172, 512, 4096, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80992A80[] = { +static Vtx D_80992A80[] = { VTX(1915, 295, 1153, 410, 2901, 0x00, 0x78, 0x00, 0xFF), VTX(1968, -200, 1172, 512, 4096, 0x00, 0x78, 0x00, 0xFF), VTX(1968, 295, 1172, 512, 2958, 0x00, 0x78, 0x00, 0xFF), @@ -204,13 +204,13 @@ Vtx D_80992A80[] = { VTX(-76, 820, -1633, 0, -4096, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80992C20[] = { +static Vtx D_80992C20[] = { VTX(1658, 295, 1169, 205, 1308, 0x00, 0x78, 0x00, 0xFF), VTX(1763, 295, 1241, 205, 1451, 0x00, 0x78, 0x00, 0xFF), VTX(1915, 295, 1153, 819, 1451, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80992C50[] = { +static Vtx D_80992C50[] = { VTX(-389, 800, -1884, 102, 4096, 0x2E, 0x00, 0x92, 0xFF), VTX(-989, 800, -2131, 512, 4096, 0x2E, 0x00, 0x92, 0xFF), VTX(-389, 1312, -1884, 102, 3589, 0x2B, 0x29, 0x98, 0xFF), @@ -245,7 +245,7 @@ Vtx D_80992C50[] = { VTX(112, 20, 1211, 256, -12288, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80992E50[] = { +static Vtx D_80992E50[] = { VTX(-1481, 1314, -1874, 512, 2676, 0x4D, 0x56, 0x1F, 0xFF), VTX(-2157, 1810, -1555, 512, 1661, 0x49, 0x56, 0x28, 0xFF), VTX(-1708, 1312, -1303, 181, 2088, 0x47, 0x53, 0x31, 0xFF), @@ -278,7 +278,7 @@ Vtx D_80992E50[] = { VTX(-2717, 2160, -1291, 512, 850, 0x48, 0x55, 0x2A, 0xFF), }; -Vtx D_80993030[] = { +static Vtx D_80993030[] = { VTX(-5196, 1149, 2080, 512, -2955, 0x00, 0x78, 0x00, 0xFF), VTX(-5194, 351, 2079, 512, -3868, 0x00, 0x78, 0x00, 0xFF), VTX(-4653, 291, 1728, 0, -3868, 0x00, 0x78, 0x00, 0xFF), @@ -312,7 +312,7 @@ Vtx D_80993030[] = { VTX(-4488, 1519, 3360, 512, -6384, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_80993220[] = { +static Vtx D_80993220[] = { VTX(-4488, 1519, 3360, 512, -6384, 0x00, 0x78, 0x00, 0xFF), VTX(-3980, 1539, 3206, 512, -6678, 0x00, 0x78, 0x00, 0xFF), VTX(-4281, 1193, 2801, 0, -6531, 0x00, 0x78, 0x00, 0xFF), @@ -323,13 +323,13 @@ Vtx D_80993220[] = { VTX(-4183, 1090, 2614, 0, -7266, 0x00, 0x78, 0x00, 0xFF), }; -Vtx D_809932A0[] = { +static Vtx D_809932A0[] = { VTX(117, 20, 1458, 1024, -6144, 0x00, 0x78, 0x00, 0xFF), VTX(112, 20, 1211, 512, -6144, 0x00, 0x78, 0x00, 0xFF), VTX(-261, 20, 1460, 1024, -5941, 0x00, 0x78, 0x00, 0xFF), }; -Gfx D_809932D0[] = { +static Gfx D_809932D0[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(65535, 65535, 0, G_TX_RENDERTILE, G_ON), @@ -347,7 +347,7 @@ Gfx D_809932D0[] = { gsSPEndDisplayList(), }; -Gfx D_80993390[] = { +static Gfx D_80993390[] = { gsSPVertex(D_80992680, 32, 0), gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0), gsSP2Triangles(4, 6, 5, 0, 7, 8, 9, 0), @@ -387,7 +387,7 @@ Gfx D_80993390[] = { gsSPEndDisplayList(), }; -Gfx D_809934B8[] = { +static Gfx D_809934B8[] = { gsSPVertex(D_80992C50, 32, 0), gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0), gsSP2Triangles(4, 5, 3, 0, 5, 6, 3, 0), diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 66f7435ebe..cbb916d55b 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -96,8 +96,8 @@ static DoorKillerTextureEntry sDoorTextures[4] = { { OBJECT_GAMEPLAY_KEEP, gWoodenDoorTex }, }; -void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; f32 randF; DoorKiller* this = THIS; s32 bankIndex; @@ -106,7 +106,7 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx) { // Look in the object bank for one of the four objects containing door textures bankIndex = -1; for (i = 0; bankIndex < 0; i++) { - bankIndex = Object_GetIndex(&globalCtx2->objectCtx, sDoorTextures[i].objectId); + bankIndex = Object_GetIndex(&globalCtx->objectCtx, sDoorTextures[i].objectId); this->textureEntryIndex = i; } osSyncPrintf("bank_ID = %d\n", bankIndex); @@ -125,19 +125,18 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx) { case DOOR_KILLER_DOOR: // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. - SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_06001BC8, NULL, this->jointTable, this->jointTable, 9); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06001BC8, NULL, this->jointTable, this->jointTable, 9); this->actionFunc = DoorKiller_SetProperties; - DoorKiller_SetProperties(this, globalCtx2); + DoorKiller_SetProperties(this, globalCtx); // manually set the overall rotation of the door this->jointTable[1].x = this->jointTable[1].z = 0x4000; // Set a cylinder collider to detect link attacks and larger sphere collider to detect explosions - Collider_InitCylinder(globalCtx2, &this->colliderCylinder); - Collider_SetCylinder(globalCtx2, &this->colliderCylinder, &this->actor, &sCylinderInit); - Collider_InitJntSph(globalCtx2, &this->colliderJntSph); - Collider_SetJntSph(globalCtx2, &this->colliderJntSph, &this->actor, &sJntSphInit, - this->colliderJntSphItems); + Collider_InitCylinder(globalCtx, &this->colliderCylinder); + Collider_SetCylinder(globalCtx, &this->colliderCylinder, &this->actor, &sCylinderInit); + Collider_InitJntSph(globalCtx, &this->colliderJntSph); + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, this->colliderJntSphItems); this->colliderJntSph.elements[0].dim.worldSphere.radius = 80; this->colliderJntSph.elements[0].dim.worldSphere.center.x = (s16)this->actor.world.pos.x; this->colliderJntSph.elements[0].dim.worldSphere.center.y = (s16)this->actor.world.pos.y + 50; @@ -145,7 +144,7 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx) { // If tied to a switch flag and that switch flag is already set, kill the actor. if ((((this->actor.params >> 8) & 0x3F) != 0x3F) && - Flags_GetSwitch(globalCtx2, ((this->actor.params >> 8) & 0x3F))) { + Flags_GetSwitch(globalCtx, ((this->actor.params >> 8) & 0x3F))) { Actor_Kill(&this->actor); } break; @@ -154,7 +153,7 @@ void DoorKiller_Init(Actor* thisx, GlobalContext* globalCtx) { case DOOR_KILLER_RUBBLE_PIECE_3: case DOOR_KILLER_RUBBLE_PIECE_4: this->actionFunc = DoorKiller_SetProperties; - DoorKiller_SetProperties(this, globalCtx2); + DoorKiller_SetProperties(this, globalCtx); this->actor.gravity = -0.6f; this->actor.minVelocityY = -6.0f; 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 1fb6b0905d..60750709e9 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -211,9 +211,9 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, GlobalContext* globalCtx) { return false; } -void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { +void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx2) { DoorShutter* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 phi_a3; s32 pad; s32 objectIndex; @@ -228,7 +228,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { ShutterSceneInfo* phi_v1; for (phi_v1 = &sSceneInfo[0], i = 0; i < ARRAY_COUNT(sSceneInfo) - 1; i++, phi_v1++) { - if (globalCtx2->sceneNum == phi_v1->sceneNum) { + if (globalCtx->sceneNum == phi_v1->sceneNum) { break; } } @@ -237,7 +237,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { BossDoorInfo* phi_v1_2; for (phi_v1_2 = &D_80998288[0], i = 0; i < ARRAY_COUNT(D_80998288) - 1; i++, phi_v1_2++) { - if (globalCtx2->sceneNum == phi_v1_2->dungeonScene || globalCtx2->sceneNum == phi_v1_2->bossScene) { + if (globalCtx->sceneNum == phi_v1_2->dungeonScene || globalCtx->sceneNum == phi_v1_2->bossScene) { break; } } @@ -245,8 +245,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { } else { this->dyna.actor.room = -1; } - if (this->requiredObjBankIndex = objectIndex = - Object_GetIndex(&globalCtx2->objectCtx, sObjectInfo[phi_a3].objectId), + if (this->requiredObjBankIndex = objectIndex = Object_GetIndex(&globalCtx->objectCtx, sObjectInfo[phi_a3].objectId), (s8)objectIndex < 0) { Actor_Kill(&this->dyna.actor); return; @@ -254,7 +253,7 @@ void DoorShutter_Init(Actor* thisx, GlobalContext* globalCtx) { DoorShutter_SetupAction(this, DoorShutter_SetupType); this->unk_16B = phi_a3; if (this->doorType == SHUTTER_KEY_LOCKED || this->doorType == SHUTTER_BOSS) { - if (!Flags_GetSwitch(globalCtx2, this->dyna.actor.params & 0x3F)) { + if (!Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { this->unk_16E = 10; } Actor_SetFocus(&this->dyna.actor, 60.0f); 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 79d7ad5c4d..0dee0a37f8 100644 --- a/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c +++ b/src/overlays/actors/ovl_Eff_Dust/z_eff_dust.c @@ -308,9 +308,9 @@ void EffDust_DrawFunc_8099E4F4(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(gfxCtx, "../z_eff_dust.c", 458); } -void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx) { +void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx2) { EffDust* this = THIS; - GlobalContext* globalCtx2; + GlobalContext* globalCtx = globalCtx2; GraphicsContext* gfxCtx = globalCtx->state.gfxCtx; f32* distanceTraveled; Vec3f* initialPositions; @@ -320,8 +320,6 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx) { OPEN_DISPS(gfxCtx, "../z_eff_dust.c", 472); - globalCtx2 = globalCtx; - func_80093D18(gfxCtx); gDPPipeSync(POLY_XLU_DISP++); @@ -355,7 +353,7 @@ void EffDust_DrawFunc_8099E784(Actor* thisx, GlobalContext* globalCtx) { Matrix_Scale(*distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, *distanceTraveled * this->scalingFactor, MTXMODE_APPLY); - func_800D1FD4(&globalCtx2->mf_11DA0); + func_800D1FD4(&globalCtx->mf_11DA0); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_eff_dust.c", 506), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_En_Am/z_en_am.c b/src/overlays/actors/ovl_En_Am/z_en_am.c index 27a40c24bf..55e3256028 100644 --- a/src/overlays/actors/ovl_En_Am/z_en_am.c +++ b/src/overlays/actors/ovl_En_Am/z_en_am.c @@ -158,7 +158,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 19, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x13, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -4000, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; @@ -936,7 +936,7 @@ void EnAm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } } -Vec3f sIcePosOffsets[] = { +static Vec3f sIcePosOffsets[] = { { 20.0f, 40.0f, 0.0f }, { 10.0f, 60.0f, 10.0f }, { -10.0f, 60.0f, 10.0f }, { -20.0f, 40.0f, 0.0f }, { 10.0f, 60.0f, -10.0f }, { -10.0f, 60.0f, -10.0f }, { 0.0f, 40.0f, -20.0f }, { 10.0f, 20.0f, 10.0f }, { 10.0f, 20.0f, -10.0f }, { 0.0f, 40.0f, 20.0f }, { -10.0f, 20.0f, 10.0f }, { -10.0f, 20.0f, -10.0f }, diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 3eb821ec72..5517d16a5b 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -81,7 +81,7 @@ void EnAni_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, &this->collider); Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { EnAni_SetupAction(this, func_809B064C); } else { EnAni_SetupAction(this, func_809B07F8); @@ -120,15 +120,15 @@ void func_809B0524(EnAni* this, GlobalContext* globalCtx) { void func_809B0558(EnAni* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { this->actor.parent = NULL; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { EnAni_SetupAction(this, func_809B04F0); } else { EnAni_SetupAction(this, func_809B0524); } gSaveContext.itemGetInf[1] |= 0x20; - return; + } else { + func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); } - func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f); } void func_809B05F0(EnAni* this, GlobalContext* globalCtx) { @@ -149,15 +149,14 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { if (!textId) {} if (textId2 == 0) { - textId = gSaveContext.nightFlag ? 0x5051 : 0x5050; // "...all I can do is look at the stars." - // "...all I can do is look at Death Mountain." + textId = !IS_DAY ? 0x5051 : 0x5050; } yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx)) { - if (this->actor.textId == 0x5056) { // "To get a good view..." + if (this->actor.textId == 0x5056) { EnAni_SetupAction(this, func_809B04F0); - } else if (this->actor.textId == 0x5055) { // "...I'll give you this as a memento." + } else if (this->actor.textId == 0x5055) { EnAni_SetupAction(this, func_809B05F0); } else { EnAni_SetupAction(this, func_809B04F0); @@ -165,9 +164,9 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) { } else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && -80.0f < this->actor.yDistToPlayer) { if (gSaveContext.itemGetInf[1] & 0x20) { - EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." + EnAni_SetText(this, globalCtx, 0x5056); } else { - EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." + EnAni_SetText(this, globalCtx, 0x5055); } } else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { EnAni_SetText(this, globalCtx, textId); @@ -181,9 +180,9 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (func_8002F194(&this->actor, globalCtx)) { - if (this->actor.textId == 0x5056) { // "To get a good view..." + if (this->actor.textId == 0x5056) { EnAni_SetupAction(this, func_809B0524); - } else if (this->actor.textId == 0x5055) { // "...I'll give you this as a memento." + } else if (this->actor.textId == 0x5055) { EnAni_SetupAction(this, func_809B05F0); } else { EnAni_SetupAction(this, func_809B0524); @@ -191,16 +190,15 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) { } else if (yawDiff > -0x36B0 && yawDiff < 0 && this->actor.xzDistToPlayer < 150.0f && -80.0f < this->actor.yDistToPlayer) { if (gSaveContext.itemGetInf[1] & 0x20) { - EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..." + EnAni_SetText(this, globalCtx, 0x5056); } else { - EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento." + EnAni_SetText(this, globalCtx, 0x5055); } } else if (yawDiff > -0x3E8 && yawDiff < 0x36B0 && this->actor.xzDistToPlayer < 350.0f) { if (!(gSaveContext.eventChkInf[2] & 0x8000)) { - textId = 0x5052; // "...Something is happening on Death Mountain!" + textId = 0x5052; } else { - textId = (gSaveContext.itemGetInf[1] & 0x20) ? 0x5054 : 0x5053; // "I don't feel like getting down..." - // "...Death Mountain is back to normal!" + textId = (gSaveContext.itemGetInf[1] & 0x20) ? 0x5054 : 0x5053; } EnAni_SetText(this, globalCtx, textId); } diff --git a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c index 126d1fcf09..3e6c5c4cd1 100644 --- a/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c +++ b/src/overlays/actors/ovl_En_Anubice/z_en_anubice.c @@ -197,7 +197,7 @@ void EnAnubice_FindFlameCircles(EnAnubice* this, GlobalContext* globalCtx) { void EnAnubice_SetupIdle(EnAnubice* this, GlobalContext* globalCtx) { f32 lastFrame = Animation_GetLastFrame(&gAnubiceIdleAnim); - Animation_Change(&this->skelAnime, &gAnubiceIdleAnim, 1.0f, 0.0f, (s16)lastFrame, 0, -10.0f); + Animation_Change(&this->skelAnime, &gAnubiceIdleAnim, 1.0f, 0.0f, (s16)lastFrame, ANIMMODE_LOOP, -10.0f); this->actionFunc = EnAnubice_Idle; this->actor.velocity.x = this->actor.velocity.z = this->actor.gravity = 0.0f; @@ -262,7 +262,7 @@ void EnAnubis_SetupShootFireball(EnAnubice* this, GlobalContext* globalCtx) { f32 lastFrame = Animation_GetLastFrame(&gAnubiceAttackingAnim); this->animLastFrame = lastFrame; - Animation_Change(&this->skelAnime, &gAnubiceAttackingAnim, 1.0f, 0.0f, lastFrame, 2, -10.0f); + Animation_Change(&this->skelAnime, &gAnubiceAttackingAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, -10.0f); this->actionFunc = EnAnubis_ShootFireball; this->actor.velocity.x = this->actor.velocity.z = 0.0f; } @@ -292,7 +292,7 @@ void EnAnubice_SetupDie(EnAnubice* this, GlobalContext* globalCtx) { f32 lastFrame = Animation_GetLastFrame(&gAnubiceFallDownAnim); this->animLastFrame = lastFrame; - Animation_Change(&this->skelAnime, &gAnubiceFallDownAnim, 1.0f, 0.0f, lastFrame, 2, -20.0f); + Animation_Change(&this->skelAnime, &gAnubiceFallDownAnim, 1.0f, 0.0f, lastFrame, ANIMMODE_ONCE, -20.0f); this->unk_256 = false; this->unk_258 = 0; diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index c2e2f14d14..af3574ecb8 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -86,7 +86,7 @@ void EnBa_SetupAction(EnBa* this, EnBaActionFunc actionFunc) { static Vec3f D_809B80E4 = { 0.01f, 0.01f, 0.01f }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 21, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x15, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1500, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneDownward, 2500, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 0, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_En_Bili/z_en_bili.c b/src/overlays/actors/ovl_En_Bili/z_en_bili.c index 031c93b54d..e3b1954ae8 100644 --- a/src/overlays/actors/ovl_En_Bili/z_en_bili.c +++ b/src/overlays/actors/ovl_En_Bili/z_en_bili.c @@ -109,7 +109,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 23, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x17, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 04f1333bbd..f0ce24195f 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -48,29 +48,29 @@ const ActorInit En_Bom_Bowl_Man_InitVars = { (ActorFunc)EnBomBowlMan_Draw, }; -void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) { +void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx2) { static f32 cuccoColliderDims[][3] = { { 16.0f, 46.0f, 0.0f }, { 36.0f, 56.0f, 0.0f } }; static Vec3f cuccoSpawnPos[] = { { 60, -60, -430 }, { 0, -120, -620 } }; static f32 cuccoScales[] = { 0.01f, 0.03f }; EnBomBowlMan* this = THIS; EnSyatekiNiw* cucco; s32 i; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f); - SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &gChuGirlSkel, &gChuGirlNoddingOffAnim, this->jointTable, + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gChuGirlSkel, &gChuGirlNoddingOffAnim, this->jointTable, this->morphTable, 11); // ☆ Man, my shoulders hurt~ ☆ osSyncPrintf(VT_FGCOL(GREEN) "☆ もー 肩こっちゃうよねぇ〜 \t\t ☆ \n" VT_RST); // ☆ Isn't there some sort of job that will pay better and be more relaxing? ☆ %d osSyncPrintf(VT_FGCOL(GREEN) "☆ もっとラクしてもうかるバイトないかしら? ☆ %d\n" VT_RST, - globalCtx2->bombchuBowlingStatus); + globalCtx->bombchuBowlingStatus); this->posCopy = this->actor.world.pos; this->actor.shape.yOffset = -60.0f; Actor_SetScale(&this->actor, 0.013f); for (i = 0; i < 2; i++) { - cucco = (EnSyatekiNiw*)Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_SYATEKI_NIW, cuccoSpawnPos[i].x, + cucco = (EnSyatekiNiw*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_SYATEKI_NIW, cuccoSpawnPos[i].x, cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, 1); if (cucco != NULL) { diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 3b35e692f2..c5daa2e490 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -90,8 +90,8 @@ void EnBox_ClipToGround(EnBox* this, GlobalContext* globalCtx) { } } -void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void EnBox_Init(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; EnBox* this = THIS; AnimationHeader* anim; CollisionHeader* colHeader; @@ -106,8 +106,8 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&gTreasureChestCol, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(globalCtx2, &globalCtx2->colCtx.dyna, &this->dyna.actor, colHeader); - func_8003ECA8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); + func_8003ECA8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->movementFlags = 0; this->type = thisx->params >> 12 & 0xF; @@ -117,17 +117,17 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->switchFlag = this->dyna.actor.world.rot.z; this->dyna.actor.minVelocityY = -50.0f; - if (globalCtx2) {} // helps the compiler store globalCtx2 into s1 + if (globalCtx) {} // helps the compiler store globalCtx2 into s1 - if (Flags_GetTreasure(globalCtx2, this->dyna.actor.params & 0x1F)) { + if (Flags_GetTreasure(globalCtx, this->dyna.actor.params & 0x1F)) { this->alpha = 255; this->iceSmokeTimer = 100; EnBox_SetupAction(this, EnBox_Open); this->movementFlags |= ENBOX_MOVE_STICK_TO_GROUND; animFrameStart = endFrame; } else if ((this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_BIG || this->type == ENBOX_TYPE_SWITCH_FLAG_FALL_SMALL) && - !Flags_GetSwitch(globalCtx2, this->switchFlag)) { - func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + !Flags_GetSwitch(globalCtx, this->switchFlag)) { + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); if (Rand_ZeroOne() < 0.5f) { this->movementFlags |= ENBOX_MOVE_FALL_ANGLE_SIDE; } @@ -137,9 +137,9 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->movementFlags |= ENBOX_MOVE_IMMOBILE; this->dyna.actor.flags |= 0x10; } else if ((this->type == ENBOX_TYPE_ROOM_CLEAR_BIG || this->type == ENBOX_TYPE_ROOM_CLEAR_SMALL) && - !Flags_GetClear(globalCtx2, this->dyna.actor.room)) { + !Flags_GetClear(globalCtx, this->dyna.actor.room)) { EnBox_SetupAction(this, EnBox_AppearOnRoomClear); - func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; @@ -147,14 +147,14 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { } else if (this->type == ENBOX_TYPE_9 || this->type == ENBOX_TYPE_10) { EnBox_SetupAction(this, func_809C9700); this->dyna.actor.flags |= 0x2000000; - func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; this->dyna.actor.flags |= 0x10; - } else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx2, this->switchFlag)) { + } else if (this->type == ENBOX_TYPE_SWITCH_FLAG_BIG && !Flags_GetSwitch(globalCtx, this->switchFlag)) { EnBox_SetupAction(this, EnBox_AppearOnSwitchFlag); - func_8003EBF8(globalCtx2, &globalCtx2->colCtx.dyna, this->dyna.bgId); + func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); this->movementFlags |= ENBOX_MOVE_IMMOBILE; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y - 50.0f; this->alpha = 0; @@ -171,7 +171,7 @@ void EnBox_Init(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.world.rot.y += 0x8000; this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; - SkelAnime_Init(globalCtx2, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5); + SkelAnime_Init(globalCtx, &this->skelanime, &gTreasureChestSkel, anim, this->jointTable, this->morphTable, 5); Animation_Change(&this->skelanime, anim, 1.5f, animFrameStart, endFrame, ANIMMODE_ONCE, 0.0f); switch (this->type) { 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 68728bce94..22635da9f6 100644 --- a/src/overlays/actors/ovl_En_Cow/z_en_cow.c +++ b/src/overlays/actors/ovl_En_Cow/z_en_cow.c @@ -119,7 +119,7 @@ void EnCow_Init(Actor* thisx, GlobalContext* globalCtx) { func_809DEE9C(this); this->actionFunc = func_809DF96C; if (globalCtx->sceneNum == SCENE_LINK_HOME) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c index 68cb90c51e..065ef0865a 100644 --- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c +++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c @@ -100,7 +100,7 @@ static u32 sDeathCount = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneScale, 3000, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 88, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x58, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -200, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 26ee6c7c21..9e1c928a9b 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -119,7 +119,7 @@ void EnCs_Init(Actor* thisx, GlobalContext* globalCtx) { EnCs* this = THIS; s32 pad; - if (gSaveContext.nightFlag != 0) { + if (!IS_DAY) { Actor_Kill(&this->actor); return; } 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 ff8685b7fc..2d4f27627f 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 @@ -61,7 +61,40 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit2 sColChkInit = { 0, 0, 0, 0, MASS_IMMOVABLE }; -static DamageTable sDamageTable = { 0 }; +static DamageTable sDamageTable = { + /* Deku nut */ DMG_ENTRY(0, 0x0), + /* Deku stick */ DMG_ENTRY(0, 0x0), + /* Slingshot */ DMG_ENTRY(0, 0x0), + /* Explosive */ DMG_ENTRY(0, 0x0), + /* Boomerang */ DMG_ENTRY(0, 0x0), + /* Normal arrow */ DMG_ENTRY(0, 0x0), + /* Hammer swing */ DMG_ENTRY(0, 0x0), + /* Hookshot */ DMG_ENTRY(0, 0x0), + /* Kokiri sword */ DMG_ENTRY(0, 0x0), + /* Master sword */ DMG_ENTRY(0, 0x0), + /* Giant's Knife */ DMG_ENTRY(0, 0x0), + /* Fire arrow */ DMG_ENTRY(0, 0x0), + /* Ice arrow */ DMG_ENTRY(0, 0x0), + /* Light arrow */ DMG_ENTRY(0, 0x0), + /* Unk arrow 1 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 2 */ DMG_ENTRY(0, 0x0), + /* Unk arrow 3 */ DMG_ENTRY(0, 0x0), + /* Fire magic */ DMG_ENTRY(0, 0x0), + /* Ice magic */ DMG_ENTRY(0, 0x0), + /* Light magic */ DMG_ENTRY(0, 0x0), + /* Shield */ DMG_ENTRY(0, 0x0), + /* Mirror Ray */ DMG_ENTRY(0, 0x0), + /* Kokiri spin */ DMG_ENTRY(0, 0x0), + /* Giant spin */ DMG_ENTRY(0, 0x0), + /* Master spin */ DMG_ENTRY(0, 0x0), + /* Kokiri jump */ DMG_ENTRY(0, 0x0), + /* Giant jump */ DMG_ENTRY(0, 0x0), + /* Master jump */ DMG_ENTRY(0, 0x0), + /* Unknown 1 */ DMG_ENTRY(0, 0x0), + /* Unblockable */ DMG_ENTRY(0, 0x0), + /* Hammer jump */ DMG_ENTRY(0, 0x0), + /* Unknown 2 */ DMG_ENTRY(0, 0x0), +}; static struct_D_80AA1678 sAnimations[] = { { 0x06001AB0, 1.0f, 2, -7.0f }, { 0x06007DE0, 1.0f, 0, -7.0f }, { 0x0600885C, 1.0f, 0, -7.0f }, @@ -92,13 +125,13 @@ void EnDaikuKakariko_Init(Actor* thisx, GlobalContext* globalCtx) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { switch (globalCtx->sceneNum) { case SCENE_SPOT01: - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { this->flags |= 1; this->flags |= initFlags[this->actor.params & 3]; } break; case SCENE_KAKARIKO: - if (gSaveContext.nightFlag == 1) { + if (IS_NIGHT) { this->flags |= 2; } break; @@ -112,7 +145,7 @@ void EnDaikuKakariko_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); } - if (gSaveContext.nightFlag == 1) { + if (IS_NIGHT) { this->flags |= 8; } diff --git a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c index 51ff52b07d..63bca3ea9f 100644 --- a/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c +++ b/src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c @@ -244,7 +244,7 @@ void EnDekubaba_Init(Actor* thisx, GlobalContext* globalCtx) { // This and its counterpart below mean that a Deku Stick jumpslash will not trigger the Deku Stick drop route. // (Of course they reckoned without each age being able to use the other's items, so Stick and Master Sword // jumpslash can give the Stick drop as adult, and neither will as child.) - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { sBigDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE); // DMG_JUMP_MASTER } @@ -259,7 +259,7 @@ void EnDekubaba_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.elements[i].dim.worldSphere.radius = this->collider.elements[i].dim.modelSphere.radius; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { sDekuBabaDamageTable.table[0x1B] = DMG_ENTRY(4, DEKUBABA_DMGEFF_NONE); // DMG_JUMP_MASTER } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index e61fecdfe3..0084b03932 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -179,7 +179,7 @@ void EnDekunuts_SetupBurrow(EnDekunuts* this) { void EnDekunuts_SetupBeginRun(EnDekunuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gDekuNutsUnburrowAnim, -3.0f); - this->collider.dim.height = 0x25; + this->collider.dim.height = 37; this->actor.colChkInfo.mass = 0x32; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->collider.base.acFlags &= ~AC_ON; diff --git a/src/overlays/actors/ovl_En_Dh/z_en_dh.c b/src/overlays/actors/ovl_En_Dh/z_en_dh.c index 8edbb00d83..549792c0b1 100644 --- a/src/overlays/actors/ovl_En_Dh/z_en_dh.c +++ b/src/overlays/actors/ovl_En_Dh/z_en_dh.c @@ -138,7 +138,7 @@ static DamageTable D_809EC620 = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 47, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x2F, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -3500, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_En_Dha/z_en_dha.c b/src/overlays/actors/ovl_En_Dha/z_en_dha.c index c5f6bbc6ab..73f4f6b213 100644 --- a/src/overlays/actors/ovl_En_Dha/z_en_dha.c +++ b/src/overlays/actors/ovl_En_Dha/z_en_dha.c @@ -205,7 +205,7 @@ void EnDha_Wait(EnDha* this, GlobalContext* globalCtx) { playerPos.x += Math_SinS(player->actor.shape.rot.y) * -5.0f; playerPos.z += Math_CosS(player->actor.shape.rot.y) * -5.0f; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { playerPos.y += 38.0f; } else { playerPos.y += 56.0f; diff --git a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c index 9d9b450392..e951559453 100644 --- a/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c +++ b/src/overlays/actors/ovl_En_Diving_Game/z_en_diving_game.c @@ -177,7 +177,7 @@ s32 EnDivingGame_HasMinigameFinished(EnDivingGame* this, GlobalContext* globalCt void func_809EDCB0(EnDivingGame* this, GlobalContext* globalCtx) { f32 frameCount = Animation_GetLastFrame(&gZoraIdleAnim); - Animation_Change(&this->skelAnime, &gZoraIdleAnim, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f); + Animation_Change(&this->skelAnime, &gZoraIdleAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f); this->notPlayingMinigame = true; this->actionFunc = EnDivingGame_Talk; } @@ -282,7 +282,7 @@ void func_809EE048(EnDivingGame* this, GlobalContext* globalCtx) { void func_809EE0FC(EnDivingGame* this, GlobalContext* globalCtx) { f32 frameCount = Animation_GetLastFrame(&gZoraThrowRupeesAnim); - Animation_Change(&this->skelAnime, &gZoraThrowRupeesAnim, 1.0f, 0.0f, (s16)frameCount, 2, -10.0f); + Animation_Change(&this->skelAnime, &gZoraThrowRupeesAnim, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_ONCE, -10.0f); this->notPlayingMinigame = false; this->actionFunc = func_809EE194; } diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 07c1e4fbd4..18f504b620 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -76,48 +76,48 @@ static ColliderCylinderInitType1 sCylinderInit = { { 18, 32, 0, { 0, 0, 0 } }, }; -u16 D_809F040C[] = { +static u16 D_809F040C[] = { 0x10A0, 0x10A1, 0x10A2, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, 0x10DC, 0x10DD, }; // Debug text: sells { Deku Nuts, Deku Sticks, Piece of Heart, Deku Seeds, // Deku Shield, Bombs, Arrows, Red Potion, // Green Potion, Deku Stick Upgrade, Deku Nut Upgrade } -char* D_809F0424[] = { +static char* D_809F0424[] = { "デクの実売り ", "デクの棒売り ", "ハートの欠片売り ", "デクの種売り ", "デクの盾売り ", "バクダン売り ", "矢売り ", "赤のくすり売り ", "緑のくすり売り ", "デクの棒持てる数を増やす", "デクの実持てる数を増やす", }; -DnsItemEntry D_809F0450 = { 20, 5, GI_NUTS_5_2, func_809EF5A4, func_809EFA28 }; +static DnsItemEntry D_809F0450 = { 20, 5, GI_NUTS_5_2, func_809EF5A4, func_809EFA28 }; -DnsItemEntry D_809F0460 = { 15, 1, GI_STICKS_1, func_809EF658, func_809EF9F8 }; +static DnsItemEntry D_809F0460 = { 15, 1, GI_STICKS_1, func_809EF658, func_809EF9F8 }; -DnsItemEntry D_809F0470 = { 10, 1, GI_HEART_PIECE, func_809EF70C, func_809EFA58 }; +static DnsItemEntry D_809F0470 = { 10, 1, GI_HEART_PIECE, func_809EF70C, func_809EFA58 }; -DnsItemEntry D_809F0480 = { 40, 30, GI_SEEDS_30, func_809EF73C, func_809EF9F8 }; +static DnsItemEntry D_809F0480 = { 40, 30, GI_SEEDS_30, func_809EF73C, func_809EF9F8 }; -DnsItemEntry D_809F0490 = { 50, 1, GI_SHIELD_DEKU, func_809EF800, func_809EF9F8 }; +static DnsItemEntry D_809F0490 = { 50, 1, GI_SHIELD_DEKU, func_809EF800, func_809EF9F8 }; -DnsItemEntry D_809F04A0 = { 40, 5, GI_BOMBS_5, func_809EF854, func_809EFA9C }; +static DnsItemEntry D_809F04A0 = { 40, 5, GI_BOMBS_5, func_809EF854, func_809EFA9C }; -DnsItemEntry D_809F04B0 = { 70, 20, GI_ARROWS_LARGE, func_809EF8F4, func_809EFACC }; +static DnsItemEntry D_809F04B0 = { 70, 20, GI_ARROWS_LARGE, func_809EF8F4, func_809EFACC }; -DnsItemEntry D_809F04C0 = { 40, 1, GI_POTION_RED, func_809EF9A4, func_809EF9F8 }; +static DnsItemEntry D_809F04C0 = { 40, 1, GI_POTION_RED, func_809EF9A4, func_809EF9F8 }; -DnsItemEntry D_809F04D0 = { 40, 1, GI_POTION_GREEN, func_809EF9A4, func_809EF9F8 }; +static DnsItemEntry D_809F04D0 = { 40, 1, GI_POTION_GREEN, func_809EF9A4, func_809EF9F8 }; -DnsItemEntry D_809F04E0 = { 40, 1, GI_STICK_UPGRADE_20, func_809EF70C, func_809EFAFC }; +static DnsItemEntry D_809F04E0 = { 40, 1, GI_STICK_UPGRADE_20, func_809EF70C, func_809EFAFC }; -DnsItemEntry D_809F04F0 = { 40, 1, GI_NUT_UPGRADE_30, func_809EF70C, func_809EFB40 }; +static DnsItemEntry D_809F04F0 = { 40, 1, GI_NUT_UPGRADE_30, func_809EF70C, func_809EFB40 }; -DnsItemEntry* D_809F0500[] = { +static DnsItemEntry* sItemEntries[] = { &D_809F0450, &D_809F0460, &D_809F0470, &D_809F0480, &D_809F0490, &D_809F04A0, &D_809F04B0, &D_809F04C0, &D_809F04D0, &D_809F04E0, &D_809F04F0, }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 78, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x4E, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; @@ -128,10 +128,10 @@ typedef struct { /* 0x08 */ f32 transitionRate; } DnsAnimInfo; // size = 0xC -DnsAnimInfo D_809F0538[] = { - { &gBusinessScrubNervousIdleAnim, 0x00, 0.0f }, - { &gBusinessScrubAnim_4404, 0x02, 0.0f }, - { &gBusinessScrubNervousTransitionAnim, 0x02, 0.0f }, +static DnsAnimInfo sAnimInfo[] = { + { &gBusinessScrubNervousIdleAnim, ANIMMODE_LOOP, 0.0f }, + { &gBusinessScrubAnim_4404, ANIMMODE_ONCE, 0.0f }, + { &gBusinessScrubNervousTransitionAnim, ANIMMODE_ONCE, 0.0f }, }; void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -165,7 +165,7 @@ void EnDns_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; - this->dnsItemEntry = D_809F0500[this->actor.params]; + this->dnsItemEntry = sItemEntries[this->actor.params]; this->actionFunc = EnDns_SetupWait; } @@ -178,10 +178,10 @@ void EnDns_Destroy(Actor* thisx, GlobalContext* globalCtx) { void EnDns_Change(EnDns* this, u8 arg1) { s16 frameCount; - frameCount = Animation_GetLastFrame(D_809F0538[arg1].anim); + frameCount = Animation_GetLastFrame(sAnimInfo[arg1].anim); this->unk_2BA = arg1; // Not used anywhere else? - Animation_Change(&this->skelAnime, D_809F0538[arg1].anim, 1.0f, 0.0f, (f32)frameCount, D_809F0538[arg1].mode, - D_809F0538[arg1].transitionRate); + Animation_Change(&this->skelAnime, sAnimInfo[arg1].anim, 1.0f, 0.0f, (f32)frameCount, sAnimInfo[arg1].mode, + sAnimInfo[arg1].transitionRate); } /* Item give checking functions */ diff --git a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c index fed63f4d84..1b5f306336 100644 --- a/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c +++ b/src/overlays/actors/ovl_En_Dnt_Nomal/z_en_dnt_nomal.c @@ -248,7 +248,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, GlobalContext* globalCtx) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); // Big hit osSyncPrintf(VT_FGCOL(CYAN) "☆☆☆☆☆ 大当り ☆☆☆☆☆ %d\n" VT_RST, this->hitCounter); - if (LINK_IS_CHILD && !(gSaveContext.itemGetInf[1] & 0x2000)) { + if (!LINK_IS_ADULT && !(gSaveContext.itemGetInf[1] & 0x2000)) { this->hitCounter++; if (this->hitCounter >= 3) { OnePointCutscene_Init(globalCtx, 4140, -99, &this->actor, MAIN_CAM); diff --git a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c index a6c556afdb..e3b8263d3f 100644 --- a/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c +++ b/src/overlays/actors/ovl_En_Dodongo/z_en_dodongo.c @@ -301,7 +301,7 @@ void EnDodongo_SpawnBombSmoke(EnDodongo* this, GlobalContext* globalCtx) { } static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 13, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x0D, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2800, ICHAIN_STOP), }; 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 3b17778abe..aaaffb78e4 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -63,7 +63,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_STOP), }; -AnimationHeader* D_809FCECC[] = { &gDoor3Anim, &gDoor1Anim, &gDoor4Anim, &gDoor2Anim }; +static AnimationHeader* D_809FCECC[] = { &gDoor3Anim, &gDoor1Anim, &gDoor4Anim, &gDoor2Anim }; static u8 sDoorAnimOpenFrames[] = { 25, 25, 25, 25 }; diff --git a/src/overlays/actors/ovl_En_Du/z_en_du.c b/src/overlays/actors/ovl_En_Du/z_en_du.c index 6baa73391d..190850bcd1 100644 --- a/src/overlays/actors/ovl_En_Du/z_en_du.c +++ b/src/overlays/actors/ovl_En_Du/z_en_du.c @@ -138,7 +138,7 @@ s16 func_809FDCDC(GlobalContext* globalCtx, Actor* actor) { } s32 func_809FDDB4(EnDu* this, GlobalContext* globalCtx) { - if (globalCtx->sceneNum == SCENE_SPOT18 && gSaveContext.linkAge == 1) { + if (globalCtx->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD) { return 1; } else if (globalCtx->sceneNum == SCENE_HIDAN && !(gSaveContext.infTable[0x11] & 0x400) && LINK_IS_ADULT) { return 1; @@ -277,7 +277,7 @@ void EnDu_Init(Actor* thisx, GlobalContext* globalCtx) { EnDu_SetupAction(this, func_809FE890); } else if (globalCtx->sceneNum == 4) { EnDu_SetupAction(this, func_809FE638); - } else if (LINK_IS_CHILD) { + } else if (!LINK_IS_ADULT) { EnDu_SetupAction(this, func_809FE3C0); } else { EnDu_SetupAction(this, func_809FE3B4); diff --git a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c index 03932a6577..5670644917 100644 --- a/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c +++ b/src/overlays/actors/ovl_En_Eiyer/z_en_eiyer.c @@ -107,7 +107,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 25, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x19, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 5, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 1c88d3c792..458b7376bf 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -233,7 +233,7 @@ void EnEncount1_SpawnStalchildOrWolfos(EnEncount1* this, GlobalContext* globalCt this->outOfRangeTimer++; return; } - } else if (!gSaveContext.nightFlag || (Player_GetMask(globalCtx) == PLAYER_MASK_BUNNY)) { + } else if (IS_DAY || (Player_GetMask(globalCtx) == PLAYER_MASK_BUNNY)) { this->killCount = 0; return; } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index d50724d8d4..71e4518e17 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -199,7 +199,7 @@ void EnEncount2_SpawnRocks(EnEncount2* this, GlobalContext* globalCtx) { if (spawnerState == ENCOUNT2_ACTIVE_DEATH_MOUNTAIN) { this->timerBetweenRockSpawns = 4; spawnedRockType = FIRE_ROCK_SPAWNED_FALLING1; - if ((Rand_ZeroFloat(1.99f) < 1.0f) && (LINK_IS_CHILD)) { + if ((Rand_ZeroFloat(1.99f) < 1.0f) && !LINK_IS_ADULT) { // rock spawn pos X, Z near player tempVec2X = Rand_CenteredFloat(10.0f) + player->actor.world.pos.x; tempVec2Z = Rand_CenteredFloat(10.0f) + player->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 7fd77f38d2..4ee48134c7 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -454,7 +454,6 @@ void EnFirefly_Die(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) { Player* player = PLAYER; - Vec3f preyPos; SkelAnime_Update(&this->skelAnime); @@ -586,6 +585,7 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) { void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) { Player* player = PLAYER; Vec3f preyPos; + SkelAnime_Update(&this->skelAnime); if (this->timer != 0) { @@ -742,8 +742,8 @@ void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList static Vec3f limbSrc = { 0.0f, 0.0f, 0.0f }; Vec3f effPos; Vec3f* limbDest; - void* effPrimColor; - void* effEnvColor; + Color_RGBA8* effPrimColor; + Color_RGBA8* effEnvColor; MtxF mtx; s16 effScaleStep; s16 effLife; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index 557aecf2cf..9d103e5bd0 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -117,13 +117,13 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x31, ICHAIN_CONTINUE), - ICHAIN_F32(targetArrowOffset, 0x157C, ICHAIN_CONTINUE), + ICHAIN_F32(targetArrowOffset, 5500, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_STOP), }; -void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { +void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx2) { EnFloormas* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 invisble; s32 pad; @@ -151,7 +151,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { } else { // spawn first small floormaster this->actor.parent = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.parent == NULL) { Actor_Kill(&this->actor); @@ -159,7 +159,7 @@ void EnFloormas_Init(Actor* thisx, GlobalContext* globalCtx) { } // spawn 2nd small floormaster this->actor.child = - Actor_Spawn(&globalCtx2->actorCtx, globalCtx2, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, + Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_FLOORMAS, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, invisble + SPAWN_SMALL); if (this->actor.child == NULL) { Actor_Kill(this->actor.parent); @@ -351,7 +351,7 @@ void EnFloormas_SetupGrabLink(EnFloormas* this, Player* player) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; EnFloormas_MakeInvulnerable(this); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { @@ -779,7 +779,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { } } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { yDelta = CLAMP(-this->actor.yDistToPlayer, 20.0f, 30.0f); xzDelta = -10.0f; } else { @@ -812,7 +812,7 @@ void EnFloormas_GrabLink(EnFloormas* this, GlobalContext* globalCtx) { } else { // Damage link every 20 frames if ((this->actionTarget % 20) == 0) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S_KID); } else { func_8002F7DC(&player->actor, NA_SE_VO_LI_DAMAGE_S); 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 496a96a875..1bbc64b79e 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -100,7 +100,7 @@ typedef struct { f32 yDist; } LogSpotToFromWater; -EnFrPointers sEnFrPointers = { +static EnFrPointers sEnFrPointers = { 0x00, { NULL, @@ -112,12 +112,12 @@ EnFrPointers sEnFrPointers = { }; // Flags for gSaveContext.eventChkInf[13] -u16 sSongIndex[] = { +static u16 sSongIndex[] = { 0x0002, 0x0004, 0x0010, 0x0008, 0x0020, 0x0040, 0x0001, 0x0000, }; // Frog to Index for Song Flag (sSongIndex) Mapping -u8 sFrogToSongIndex[] = { +static u8 sFrogToSongIndex[] = { FROG_SARIA, FROG_SUNS, FROG_SOT, FROG_ZL, FROG_EPONA, }; @@ -397,7 +397,8 @@ void EnFr_DecrementBlinkTimerUpdate(EnFr* this) { void EnFr_SetupJumpingOutOfWater(EnFr* this, GlobalContext* globalCtx) { if (sEnFrPointers.flags == sTimerJumpingOutOfWater[this->actor.params - 1]) { - Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), 2, 0.0f); + Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), ANIMMODE_ONCE, + 0.0f); EnFr_DrawActive(this); this->actionFunc = EnFr_JumpingOutOfWater; } @@ -445,17 +446,20 @@ void EnFr_OrientOnLogSpot(EnFr* this, GlobalContext* globalCtx) { if ((rotYRemaining == 0) && (this->skelAnime.curFrame == this->skelAnime.endFrame)) { sEnFrPointers.flags++; this->actionFunc = EnFr_ChooseJumpFromLogSpot; - Animation_Change(&this->skelAnime, &D_06001534, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001534), 0, 0.0f); + Animation_Change(&this->skelAnime, &D_06001534, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001534), ANIMMODE_LOOP, + 0.0f); } } void EnFr_ChooseJumpFromLogSpot(EnFr* this, GlobalContext* globalCtx) { if (sEnFrPointers.flags == 12) { this->actor.world.rot.y = ((f32)0x8000 / M_PI) * sLogSpotToFromWater[this->actor.params].yaw; - Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), 2, 0.0f); + Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), ANIMMODE_ONCE, + 0.0f); this->actionFunc = EnFr_JumpingBackIntoWater; } else if (this->isJumpingUp) { - Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), 2, 0.0f); + Animation_Change(&this->skelAnime, &D_060007BC, 1.0f, 0.0f, Animation_GetLastFrame(&D_060007BC), ANIMMODE_ONCE, + 0.0f); this->actionFunc = EnFr_JumpingUp; } } @@ -477,7 +481,8 @@ void EnFr_JumpingUp(EnFr* this, GlobalContext* globalCtx) { if (EnFr_IsBelowLogSpot(this, &yDistToLogSpot)) { this->isJumpingUp = false; this->actor.gravity = 0.0f; - Animation_Change(&this->skelAnime, &D_060011C0, 1.0f, 0.0f, Animation_GetLastFrame(&D_060011C0), 0, 0.0f); + Animation_Change(&this->skelAnime, &D_060011C0, 1.0f, 0.0f, Animation_GetLastFrame(&D_060011C0), ANIMMODE_LOOP, + 0.0f); this->actionFunc = EnFr_ChooseJumpFromLogSpot; } else if ((this->actor.velocity.y <= 0.0f) && (yDistToLogSpot < 40.0f)) { this->skelAnime.playSpeed = 1.0f; @@ -498,7 +503,8 @@ void EnFr_JumpingBackIntoWater(EnFr* this, GlobalContext* globalCtx) { // Final Spot Reached if ((this->actor.velocity.y < 0.0f) && (this->actor.world.pos.y < yUnderwater)) { - Animation_Change(&this->skelAnime, &D_06001534, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001534), 0, 0.0f); + Animation_Change(&this->skelAnime, &D_06001534, 1.0f, 0.0f, Animation_GetLastFrame(&D_06001534), ANIMMODE_LOOP, + 0.0f); this->actionFunc = EnFr_SetupJumpingOutOfWater; EnFr_DrawIdle(this); this->isDeactivating = true; diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index f22886e6b4..954dada518 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -85,7 +85,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->actionFunc = EnFu_WaitChild; this->facialExpression = FU_FACE_CALM; } else { 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 9b4f49673b..22ce54ec61 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -116,7 +116,7 @@ static ColliderCylinderInitType1 sCylinderInit3 = { { 20, 30, -15, { 0, 0, 0 } }, }; -DamageTable sDamageTable = { +static DamageTable sDamageTable = { /* Deku nut */ DMG_ENTRY(0, 0x0), /* Deku stick */ DMG_ENTRY(0, 0xF), /* Slingshot */ DMG_ENTRY(0, 0xF), @@ -152,7 +152,7 @@ DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 59, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x3B, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Gb/z_en_gb.c b/src/overlays/actors/ovl_En_Gb/z_en_gb.c index dac68d2a2a..503a7826e9 100644 --- a/src/overlays/actors/ovl_En_Gb/z_en_gb.c +++ b/src/overlays/actors/ovl_En_Gb/z_en_gb.c @@ -377,7 +377,7 @@ void func_80A2FC0C(EnGb* this, GlobalContext* globalCtx) { void func_80A2FC70(EnGb* this, GlobalContext* globalCtx) { if (this->skelAnime.curFrame == Animation_GetLastFrame(&gPoeSellerSwingStickAnim)) { Animation_Change(&this->skelAnime, &gPoeSellerIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gPoeSellerIdleAnim), - 0, 0.0f); + ANIMMODE_LOOP, 0.0f); this->actionFunc = func_80A2F83C; } else if (this->skelAnime.curFrame == 18.0f) { this->cagedSouls[1].unk_1 = 3; @@ -395,21 +395,21 @@ void func_80A2FC70(EnGb* this, GlobalContext* globalCtx) { } } -void EnGb_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnGb_Update(Actor* thisx, GlobalContext* globalCtx2) { EnGb* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 i; f32 rand; this->frameTimer++; SkelAnime_Update(&this->skelAnime); - this->actionFunc(this, globalCtx2); + this->actionFunc(this, globalCtx); this->dyna.actor.textId = this->textId; func_80A2F608(this); - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); for (i = 0; i < ARRAY_COUNT(this->bottlesColliders); i++) { - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->bottlesColliders[i].base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->bottlesColliders[i].base); } rand = Rand_ZeroOne(); @@ -417,7 +417,7 @@ void EnGb_Update(Actor* thisx, GlobalContext* globalCtx) { this->lightColor.g = (s8)(rand * 100.0f) + 155; this->lightColor.b = (s8)(rand * 160.0f) + 95; this->lightColor.a = 200; - EnGb_UpdateCagedSouls(this, globalCtx2); + EnGb_UpdateCagedSouls(this, globalCtx); } void EnGb_Draw(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index ba11bf7c06..5d31eb9f5f 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -181,7 +181,7 @@ void EnGe2_Destroy(Actor* thisx, GlobalContext* globalCtx) { s32 Ge2_DetectPlayerInAction(GlobalContext* globalCtx, EnGe2* this) { f32 visionScale; - visionScale = ((gSaveContext.nightFlag != 0) ? 0.75f : 1.5f); + visionScale = (!IS_DAY ? 0.75f : 1.5f); if ((250.0f * visionScale) < this->actor.xzDistToPlayer) { return 0; @@ -203,7 +203,7 @@ s32 Ge2_DetectPlayerInUpdate(GlobalContext* globalCtx, EnGe2* this, Vec3f* pos, CollisionPoly* outPoly; f32 visionScale; - visionScale = ((gSaveContext.nightFlag != 0) ? 0.75f : 1.5f); + visionScale = (!IS_DAY ? 0.75f : 1.5f); if ((250.0f * visionScale) < this->actor.xzDistToPlayer) { return 0; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index bb486f08f3..3f3febac18 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -364,11 +364,11 @@ s32 EnGo_IsActorSpawned(EnGo* this, GlobalContext* globalCtx) { return true; } else if (globalCtx->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && (this->actor.params & 0xF0) == 0x00) { return true; - } else if (globalCtx->sceneNum == SCENE_SPOT16 && gSaveContext.linkAge == 1 && + } else if (globalCtx->sceneNum == SCENE_SPOT16 && LINK_IS_CHILD && ((this->actor.params & 0xF0) == 0x20 || (this->actor.params & 0xF0) == 0x30 || (this->actor.params & 0xF0) == 0x40)) { return true; - } else if (globalCtx->sceneNum == SCENE_SPOT18 && gSaveContext.linkAge == 1 && + } else if (globalCtx->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD && ((this->actor.params & 0xF0) == 0x50 || (this->actor.params & 0xF0) == 0x60 || (this->actor.params & 0xF0) == 0x70)) { return true; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 15fee32f76..abd0b34f95 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -643,7 +643,7 @@ s16 EnGo2_GetStateGoronFireGeneric(GlobalContext* globalCtx, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityStairwell(GlobalContext* globalCtx, EnGo2* this) { - return LINK_IS_CHILD ? gSaveContext.infTable[14] & 0x8 ? 0x3022 : 0x300E : 0x3043; + return !LINK_IS_ADULT ? gSaveContext.infTable[14] & 0x8 ? 0x3022 : 0x300E : 0x3043; } s16 EnGo2_GetStateGoronCityStairwell(GlobalContext* globalCtx, EnGo2* this) { @@ -671,7 +671,7 @@ s16 EnGo2_GetStateGoronMarketBazaar(GlobalContext* globalCtx, EnGo2* this) { } u16 EnGo2_GetTextIdGoronCityLostWoods(GlobalContext* globalCtx, EnGo2* this) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetSwitch(globalCtx, 0x1C)) { return 0x302F; } else { @@ -695,7 +695,7 @@ s16 EnGo2_GetStateGoronCityLostWoods(GlobalContext* globalCtx, EnGo2* this) { // Goron at base of DMT summit u16 EnGo2_GetTextIdGoronDmtFairyHint(GlobalContext* globalCtx, EnGo2* this) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { return CHECK_QUEST_ITEM(QUEST_GORON_RUBY) ? 0x3065 : 0x3064; } else { return 0x3043; @@ -1139,7 +1139,7 @@ s32 EnGo2_IsCameraModified(EnGo2* this, GlobalContext* globalCtx) { (this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON || (this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) { return true; - } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1))) { + } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { return true; } else { return false; @@ -1533,7 +1533,7 @@ void EnGo2_Init(Actor* thisx, GlobalContext* globalCtx) { if ((gSaveContext.infTable[16] & 0x200)) { Path_CopyLastPoint(this->path, &this->actor.world.pos); this->actor.home.pos = this->actor.world.pos; - if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && (CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1))) { + if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TUNIC, 1)) { EnGo2_GetItemAnimation(this, globalCtx); } else { this->actionFunc = EnGo2_CurledUp; diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 2fdae983d7..7656d0a845 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -101,7 +101,7 @@ static Vec3f sDeadEffectVel = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 3, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 3, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x03, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 0, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 20, ICHAIN_STOP), }; @@ -784,7 +784,7 @@ void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx) { switch (this->gomaType) { case ENGOMA_NORMAL: - this->actor.naviEnemyId = 3; + this->actor.naviEnemyId = 0x03; Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y + ((this->actor.shape.yOffset * this->actor.scale.y) + globalCtx->mainCamera.skyboxOffset.y), @@ -800,7 +800,7 @@ void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx) { break; case ENGOMA_EGG: - this->actor.naviEnemyId = 2; + this->actor.naviEnemyId = 0x02; y = (s16)(sinf((this->eggTimer * 5.0f * 3.1415f) / 180.0f) * 31.9f); y = (s16)(y + 31); gSPSegment(POLY_OPA_DISP++, 0x08, func_80094E78(globalCtx->state.gfxCtx, 0, y)); diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index be22d6706c..82b3c7c586 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -119,13 +119,13 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) { } if (this->type != 5) { - if (((gSaveContext.dayTime < 0xB888) || (gSaveContext.nightFlag == 0)) && !(gSaveContext.eventChkInf[8] & 1)) { + if (((gSaveContext.dayTime < 0xB888) || IS_DAY) && !(gSaveContext.eventChkInf[8] & 1)) { this->actionFunc = EnHeishi1_SetupWalk; } else { Actor_Kill(&this->actor); } } else { - if ((gSaveContext.dayTime >= 0xB889) || (gSaveContext.nightFlag != 0) || (gSaveContext.eventChkInf[8] & 1)) { + if ((gSaveContext.dayTime >= 0xB889) || !IS_DAY || (gSaveContext.eventChkInf[8] & 1)) { this->actionFunc = EnHeishi1_SetupWaitNight; } else { Actor_Kill(&this->actor); @@ -451,7 +451,7 @@ void EnHeishi1_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->linkDetected) { - // ! @bug This appears to be a check to make sure that link is standing on the ground + //! @bug This appears to be a check to make sure that link is standing on the ground // before getting caught. However this is an issue for two reasons: // 1: When doing a backflip or falling from the upper path, links y velocity will reach // less than -4.0 before even touching the ground. diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 5f43d47400..e82e065c8a 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -126,8 +126,8 @@ void EnHeishi2_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_InitCylinder(globalCtx, collider); Collider_SetCylinder(globalCtx, collider, &this->actor, &sCylinderInit); this->collider.dim.yShift = 0; - this->collider.dim.radius = 0xF; - this->collider.dim.height = 0x46; + this->collider.dim.radius = 15; + this->collider.dim.height = 70; this->actor.targetMode = 6; switch (this->type) { @@ -195,31 +195,31 @@ void func_80A53278(EnHeishi2* this, GlobalContext* globalCtx) { // "Get all spiritual stones!" osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 全部の精霊石GET! ☆☆☆☆☆ \n" VT_RST); this->unk_300 = 6; - this->actor.textId = 0x7006; // "There's a lot going on in the castle right now. I can't allow even..." + this->actor.textId = 0x7006; this->actionFunc = func_80A5475C; - } else if (gSaveContext.nightFlag != 0) { + } else if (!IS_DAY) { // "Sleep early for children!" osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 子供ははやくネロ! ☆☆☆☆☆ \n" VT_RST); this->unk_300 = 6; - this->actor.textId = 0x7002; // "Welcome to Hyrule Castle Town. It's a peaceful, prosperous town." + this->actor.textId = 0x7002; this->actionFunc = func_80A5475C; } else if (this->unk_30C != 0) { // "Anything passes" osSyncPrintf(VT_FGCOL(BLUE) " ☆☆☆☆☆ なんでも通るよ ☆☆☆☆☆ \n" VT_RST); this->unk_300 = 6; - this->actor.textId = 0x7099; // "KEEP IT A SECRET FROM EVERYONE" + this->actor.textId = 0x7099; this->actionFunc = func_80A5475C; } else if (gSaveContext.eventChkInf[1] & 4) { if (this->unk_30E == 0) { // "Start under the first sleeve!" osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ 1回目袖の下開始! ☆☆☆☆☆ \n" VT_RST); - this->actor.textId = 0x7071; // "Do you really want to go through this gate that much?..." + this->actor.textId = 0x7071; this->unk_30E = 1; } else { // "Start under the second sleeve!" osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ 2回目袖の下開始! ☆☆☆☆☆ \n" VT_RST); - this->actor.textId = 0x7072; // "Give me 10 Rupees...Yes...No" + this->actor.textId = 0x7072; } this->unk_300 = 4; this->actionFunc = func_80A5475C; @@ -228,7 +228,7 @@ void func_80A53278(EnHeishi2* this, GlobalContext* globalCtx) { // "That's okay" osSyncPrintf(VT_FGCOL(CYAN) " ☆☆☆☆☆ それはとおらんよぉ ☆☆☆☆☆ \n" VT_RST); this->unk_300 = 6; - this->actor.textId = 0x7029; // "So you say you want to see Princess Zelda, eh?..." + this->actor.textId = 0x7029; this->actionFunc = func_80A5475C; } } @@ -241,16 +241,16 @@ void func_80A5344C(EnHeishi2* this, GlobalContext* globalCtx) { case 0: if (gSaveContext.rupees >= 10) { Rupees_ChangeBy(-10); - this->actor.textId = 0x7098; // "OK, I'll let you pass, quickly!" + this->actor.textId = 0x7098; this->actionFunc = func_80A53538; break; } else { - this->actor.textId = 0x7097; // "Well, maybe that's too much for a kid to pay." + this->actor.textId = 0x7097; this->actionFunc = func_80A54954; break; } case 1: - this->actor.textId = 0x7096; // "Tsk tsk." + this->actor.textId = 0x7096; this->actionFunc = func_80A54954; break; @@ -360,21 +360,20 @@ void func_80A5399C(EnHeishi2* this, GlobalContext* globalCtx) { if (!(gSaveContext.infTable[7] & 0x80)) { if (Player_GetMask(globalCtx) == PLAYER_MASK_KEATON) { if (this->unk_309 == 0) { - this->actor.textId = 0x200A; // "Wha-ha-ha-hah! Do you think you're in disguise, Mr. Hero?" + this->actor.textId = 0x200A; } else { - this->actor.textId = 0x200B; // "Will you sell it to me? Yes/No way" + this->actor.textId = 0x200B; } this->unk_300 = 4; this->unk_30B = 1; var = 1; } else { this->actor.textId = 0x2016; - // "I wish I could go to the mask shop in town to buy a present for my kid..sigh.." this->unk_300 = 6; var = 1; } } else { - this->actor.textId = 0x2020; // "My boy will be very happy with this!" + this->actor.textId = 0x2020; this->unk_300 = 5; this->unk_30E = 0; } @@ -404,18 +403,18 @@ void func_80A53AD4(EnHeishi2* this, GlobalContext* globalCtx) { if (Text_GetFaceReaction(globalCtx, 5) != 0) { this->actor.textId = Text_GetFaceReaction(globalCtx, 5); } else { - this->actor.textId = 0x200E; // "The road is closed beyond this point! Can't you read..." + this->actor.textId = 0x200E; } this->unk_300 = 6; if (func_8002F194(&this->actor, globalCtx) != 0) { exchangeItemId = func_8002F368(globalCtx); if (exchangeItemId == EXCH_ITEM_LETTER_ZELDA) { func_80078884(NA_SE_SY_CORRECT_CHIME); - player->actor.textId = 0x2010; // "Oh, this is...this is surely Princess Zelda's handwriting!" + player->actor.textId = 0x2010; this->unk_300 = 5; this->actionFunc = func_80A53C0C; } else if (exchangeItemId != EXCH_ITEM_NONE) { - player->actor.textId = 0x200F; // "I don't want that!" + player->actor.textId = 0x200F; } } else { yawDiffTemp = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; @@ -510,7 +509,7 @@ void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx) { Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_ACTIVE); if ((this->unk_30A != 2)) { if (this->unk_30A == 0) { - this->actor.textId = 0x2015; // "By the way Mr. Hero..If you're going to climb Death Mountain..." + this->actor.textId = 0x2015; func_8010B720(globalCtx, this->actor.textId); this->actionFunc = func_80A54038; } else { @@ -520,7 +519,7 @@ void func_80A53F30(EnHeishi2* this, GlobalContext* globalCtx) { } } else { this->unk_30E = 0; - this->actor.textId = 0x2021; // "You sold the 10-Rupee mask for 15 Rupees. You earned a little profit." + this->actor.textId = 0x2021; Rupees_ChangeBy(15); func_8010B720(globalCtx, this->actor.textId); this->actionFunc = func_80A5427C; @@ -545,7 +544,7 @@ void func_80A540C0(EnHeishi2* this, GlobalContext* globalCtx) { if ((func_8010BDBC(&globalCtx->msgCtx) == 4) && (func_80106BC8(globalCtx) != 0)) { switch (globalCtx->msgCtx.choiceIndex) { case 0: - this->actor.textId = 0x2020; // "My boy will be very happy with this!.." + this->actor.textId = 0x2020; func_8010B720(globalCtx, this->actor.textId); Player_UnsetMask(globalCtx); gSaveContext.infTable[7] |= 0x80; @@ -562,7 +561,7 @@ void func_80A540C0(EnHeishi2* this, GlobalContext* globalCtx) { break; case 1: this->unk_30E = 1; - this->actor.textId = 0x200C; // "I won't give up! I have plenty of patience.." + this->actor.textId = 0x200C; func_8010B720(globalCtx, this->actor.textId); this->unk_300 = 5; if (this->unk_30A == 0) { @@ -577,8 +576,7 @@ void func_80A540C0(EnHeishi2* this, GlobalContext* globalCtx) { void func_80A541FC(EnHeishi2* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx) != 0)) { - this->actor.textId = 0x2021; // "You sold the 10-Rupee mask for 15 Rupees. You earned a little profit. Let's - // go to the Mask Shop..." + this->actor.textId = 0x2021; Rupees_ChangeBy(15); func_8010B720(globalCtx, this->actor.textId); this->actionFunc = func_80A5427C; 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 ab6aa5e956..15b27bda7c 100644 --- a/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c +++ b/src/overlays/actors/ovl_En_Heishi3/z_en_heishi3.c @@ -118,13 +118,13 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx) yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; yawDiffNew = ABS(yawDiff); if (yawDiffNew < 0x4300) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { sightRange = 250.0f; } else { sightRange = 200.0f; } } else { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { sightRange = 150.0f; } else { sightRange = 100.0f; 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 b139c804e2..2d59c887bb 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -148,7 +148,7 @@ void func_80A563BC(EnHeishi4* this, GlobalContext* globalCtx) { } else { this->actor.textId = 0x507A; } - } else if (gSaveContext.nightFlag == 0) { + } else if (IS_DAY) { if (this->unk_284 == 0) { this->actor.textId = 0x5063; } else { @@ -194,13 +194,13 @@ void func_80A56614(EnHeishi4* this, GlobalContext* globalCtx) { return; } if (globalCtx->sceneNum == SCENE_MIHARIGOYA) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { this->actor.textId = 0x7004; } else { this->actor.textId = 0x709A; } } else if (globalCtx->sceneNum != SCENE_MARKET_NIGHT) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { this->actor.textId = 0x7002; } else { this->actor.textId = 0x7003; @@ -351,7 +351,7 @@ void EnHeishi4_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetFocus(thisx, this->height); if (this->type != HEISHI4_AT_MARKET_DYING) { this->unk_28C.unk_18 = player->actor.world.pos; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->unk_28C.unk_18.y = (player->actor.world.pos.y - 10.0f); } func_80034A14(thisx, &this->unk_28C, 2, 4); diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 254ae76286..6c2042fa86 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -67,7 +67,7 @@ static s16 sPuzzleCounter = 0; static InitChainEntry sInitChain[] = { ICHAIN_F32(gravity, -1, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 10, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x0A, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2600, ICHAIN_STOP), }; @@ -89,7 +89,7 @@ void EnHintnuts_Init(Actor* thisx, GlobalContext* globalCtx) { this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; sPuzzleCounter = 0; - if (this->actor.textId == 0x109B) { // "Please forgive me, master!..." + if (this->actor.textId == 0x109B) { if (Flags_GetClear(globalCtx, 0x9) != 0) { Actor_Kill(&this->actor); return; @@ -155,7 +155,7 @@ void EnHintnuts_SetupBurrow(EnHintnuts* this) { void EnHintnuts_HitByScrubProjectile2(EnHintnuts* this) { Animation_MorphToPlayOnce(&this->skelAnime, &gHintNutsUnburrowAnim, -3.0f); - this->collider.dim.height = 0x25; + this->collider.dim.height = 37; Audio_PlayActorSound2(&this->actor, NA_SE_EN_NUTS_DAMAGE); this->collider.base.acFlags &= ~AC_ON; 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 c634726da8..4b57e36b12 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -844,7 +844,7 @@ void EnHorse_Init(Actor* thisx, GlobalContext* globalCtx2) { return; } } else if (globalCtx->sceneNum == SCENE_MALON_STABLE) { - if (!gSaveContext.nightFlag || Flags_GetEventChkInf(0x18) || DREG(1) != 0 || LINK_IS_CHILD) { + if (IS_DAY || Flags_GetEventChkInf(0x18) || DREG(1) != 0 || !LINK_IS_ADULT) { Actor_Kill(&this->actor); return; } @@ -3292,14 +3292,14 @@ void EnHorse_UpdateBgCheckInfo(EnHorse* this, GlobalContext* globalCtx) { } } -void EnHorse_CheckBoost(EnHorse* thisx, GlobalContext* globalCtx) { +void EnHorse_CheckBoost(EnHorse* thisx, GlobalContext* globalCtx2) { EnHorse* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 pad; if (this->action == ENHORSE_ACT_MOUNTED_WALK || this->action == ENHORSE_ACT_MOUNTED_TROT || this->action == ENHORSE_ACT_MOUNTED_GALLOP) { - if (CHECK_BTN_ALL(globalCtx2->state.input[0].press.button, BTN_A) && (globalCtx2->interfaceCtx.unk_1EE == 8)) { + if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_A) && (globalCtx->interfaceCtx.unk_1EE == 8)) { if (!(this->stateFlags & ENHORSE_BOOST) && !(this->stateFlags & ENHORSE_FLAG_8) && !(this->stateFlags & ENHORSE_FLAG_9)) { if (this->numBoosts > 0) { @@ -3457,19 +3457,19 @@ s32 EnHorse_RandInt(f32 range) { return Rand_ZeroOne() * range; } -void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx2) { EnHorse* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; Vec3f dustAcc = { 0.0f, 0.0f, 0.0f }; Vec3f dustVel = { 0.0f, 1.0f, 0.0f }; Player* player = PLAYER; this->lastYaw = thisx->shape.rot.y; - EnHorse_UpdateStick(this, globalCtx2); - EnHorse_UpdatePlayerDir(this, globalCtx2); + EnHorse_UpdateStick(this, globalCtx); + EnHorse_UpdatePlayerDir(this, globalCtx); if (!(this->stateFlags & ENHORSE_INACTIVE)) { - EnHorse_MountDismount(this, globalCtx2); + EnHorse_MountDismount(this, globalCtx); } if (this->stateFlags & ENHORSE_FLAG_19) { @@ -3483,17 +3483,17 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { } } - sActionFuncs[this->action](this, globalCtx2); + sActionFuncs[this->action](this, globalCtx); this->stateFlags &= ~ENHORSE_OBSTACLE; this->curFrame = this->skin.skelAnime.curFrame; this->lastPos = thisx->world.pos; if (!(this->stateFlags & ENHORSE_INACTIVE)) { if (this->action == ENHORSE_ACT_MOUNTED_GALLOP || this->action == ENHORSE_ACT_MOUNTED_TROT || this->action == ENHORSE_ACT_MOUNTED_WALK) { - EnHorse_CheckBoost(this, globalCtx2); + EnHorse_CheckBoost(this, globalCtx); } if (this->playerControlled == true) { - EnHorse_RegenBoost(this, globalCtx2); + EnHorse_RegenBoost(this, globalCtx); } Actor_MoveForward(thisx); if (this->action == ENHORSE_ACT_INGO_RACE) { @@ -3517,7 +3517,7 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { } } if (this->action != ENHORSE_ACT_INGO_RACE) { - EnHorse_TiltBody(this, globalCtx2); + EnHorse_TiltBody(this, globalCtx); } Collider_UpdateCylinder(thisx, &this->cyl1); Collider_UpdateCylinder(thisx, &this->cyl2); @@ -3527,18 +3527,18 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { this->cyl1.dim.pos.z = this->cyl1.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * 11.0f); this->cyl2.dim.pos.x = this->cyl2.dim.pos.x + (s16)(Math_SinS(thisx->shape.rot.y) * -18.0f); this->cyl2.dim.pos.z = this->cyl2.dim.pos.z + (s16)(Math_CosS(thisx->shape.rot.y) * -18.0f); - CollisionCheck_SetAT(globalCtx2, &globalCtx2->colChkCtx, &this->cyl1.base); - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->cyl1.base); - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->cyl2.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->cyl1.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cyl1.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->cyl2.base); if ((player->stateFlags1 & 1) && player->rideActor != NULL) { - if (globalCtx2->sceneNum != SCENE_SPOT20 || - (globalCtx2->sceneNum == SCENE_SPOT20 && (thisx->world.pos.z < -2400.0f))) { - EnHorse_UpdateConveyors(this, globalCtx2); + if (globalCtx->sceneNum != SCENE_SPOT20 || + (globalCtx->sceneNum == SCENE_SPOT20 && (thisx->world.pos.z < -2400.0f))) { + EnHorse_UpdateConveyors(this, globalCtx); } } if (!(this->stateFlags & ENHORSE_FLAG_24)) { - EnHorse_UpdateBgCheckInfo(this, globalCtx2); - EnHorse_CheckFloors(this, globalCtx2); + EnHorse_UpdateBgCheckInfo(this, globalCtx); + EnHorse_CheckFloors(this, globalCtx); if (thisx->world.pos.y < this->yFront && thisx->world.pos.y < this->yBack) { if (this->yBack < this->yFront) { thisx->world.pos.y = this->yBack; @@ -3551,8 +3551,8 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { this->stateFlags &= ~ENHORSE_FLAG_24; } - if (globalCtx2->sceneNum == SCENE_SPOT09 && (gSaveContext.eventChkInf[9] & 0xF) != 0xF) { - EnHorse_CheckBridgeJumps(this, globalCtx2); + if (globalCtx->sceneNum == SCENE_SPOT09 && (gSaveContext.eventChkInf[9] & 0xF) != 0xF) { + EnHorse_CheckBridgeJumps(this, globalCtx); } thisx->focus.pos = thisx->world.pos; @@ -3581,19 +3581,19 @@ void EnHorse_Update(Actor* thisx, GlobalContext* globalCtx) { if (gSaveContext.entranceIndex != 343 || gSaveContext.sceneSetupIndex != 9) { if (this->dustFlags & 1) { this->dustFlags &= ~1; - func_800287AC(globalCtx2, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, + func_800287AC(globalCtx, &this->frontRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, EnHorse_RandInt(10) + 30, EnHorse_RandInt(20) + 30); } else if (this->dustFlags & 2) { this->dustFlags &= ~2; - func_800287AC(globalCtx2, &this->frontLeftHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, + func_800287AC(globalCtx, &this->frontLeftHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, EnHorse_RandInt(10) + 30, EnHorse_RandInt(20) + 30); } else if (this->dustFlags & 4) { this->dustFlags &= ~4; - func_800287AC(globalCtx2, &this->backRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, + func_800287AC(globalCtx, &this->backRightHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, EnHorse_RandInt(10) + 30, EnHorse_RandInt(20) + 30); } else if (this->dustFlags & 8) { this->dustFlags &= ~8; - func_800287AC(globalCtx2, &this->backLeftHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, + func_800287AC(globalCtx, &this->backLeftHoof, &dustVel, &dustAcc, EnHorse_RandInt(100) + 200, EnHorse_RandInt(10) + 30, EnHorse_RandInt(20) + 30); } } diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 9fd3630338..f4867875b7 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -208,7 +208,7 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->actor); return; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (Flags_GetEventChkInf(0x14)) { if (this->actor.world.rot.z != 3) { Actor_Kill(&this->actor); @@ -238,7 +238,7 @@ void EnHorseNormal_Init(Actor* thisx, GlobalContext* globalCtx) { return; } } else if (globalCtx->sceneNum == SCENE_MALON_STABLE) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { Actor_Kill(&this->actor); return; } else { diff --git a/src/overlays/actors/ovl_En_Hs/z_en_hs.c b/src/overlays/actors/ovl_En_Hs/z_en_hs.c index d350c386ae..67e16203b8 100644 --- a/src/overlays/actors/ovl_En_Hs/z_en_hs.c +++ b/src/overlays/actors/ovl_En_Hs/z_en_hs.c @@ -72,7 +72,7 @@ void EnHs_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.mass = MASS_IMMOVABLE; Actor_SetScale(&this->actor, 0.01f); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->actor.params = 0; } else { this->actor.params = 1; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 118203b7cc..aa938c4241 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -359,7 +359,7 @@ u16 func_80A6F810(GlobalContext* globalCtx, Actor* thisx) { : 0x7014; case 12: if (globalCtx->sceneNum == SCENE_SPOT01) { - return gSaveContext.nightFlag ? 0x5084 : 0x5083; + return !IS_DAY ? 0x5084 : 0x5083; } else { return (gSaveContext.eventChkInf[8] & 1) ? 0x7044 : 0x7015; } @@ -372,7 +372,7 @@ u16 func_80A6F810(GlobalContext* globalCtx, Actor* thisx) { case 16: return 0x700E; case 17: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (!gSaveContext.nightFlag) { return (gSaveContext.infTable[22] & 1) ? 0x5058 : 0x5057; } else { @@ -384,7 +384,7 @@ u16 func_80A6F810(GlobalContext* globalCtx, Actor* thisx) { return 0x5058; } case 18: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { return (gSaveContext.eventChkInf[8] & 1) ? 0x505F : ((gSaveContext.infTable[22] & 8) ? 0x505E : 0x505D); } else { return (this->unk_330 & 0x800) ? 0x5062 : ((gSaveContext.infTable[22] & 0x10) ? 0x5061 : 0x5060); @@ -654,9 +654,9 @@ s32 func_80A70AE4(EnHy* this, GlobalContext* globalCtx) { ((this->actor.params & 0x7F) != 12) && ((this->actor.params & 0x7F) != 2) && ((this->actor.params & 0x7F) != 7)) { return true; - } else if (LINK_IS_CHILD) { + } else if (!LINK_IS_ADULT) { return true; - } else if (((this->actor.params & 0x7F) != 12) && (gSaveContext.nightFlag == 1)) { + } else if (((this->actor.params & 0x7F) != 12) && IS_NIGHT) { return false; } else { return true; @@ -664,7 +664,7 @@ s32 func_80A70AE4(EnHy* this, GlobalContext* globalCtx) { case SCENE_LABO: if ((this->actor.params & 0x7F) != 10) { return true; - } else if (gSaveContext.linkAge == 1) { + } else if (LINK_IS_CHILD) { return false; } else if (((this->actor.params & 0x7F) == 10) && !gSaveContext.nightFlag) { return false; @@ -681,13 +681,13 @@ s32 func_80A70AE4(EnHy* this, GlobalContext* globalCtx) { } case SCENE_KAKARIKO: if ((this->actor.params & 0x7F) == 0) { - return LINK_IS_CHILD ? false : true; + return !LINK_IS_ADULT ? false : true; } else if (((this->actor.params & 0x7F) != 9) && ((this->actor.params & 0x7F) != 2) && ((this->actor.params & 0x7F) != 7)) { return true; } else if (!gSaveContext.nightFlag) { return false; - } else if (gSaveContext.linkAge == 1) { + } else if (LINK_IS_CHILD) { return false; } else { return true; @@ -696,7 +696,7 @@ s32 func_80A70AE4(EnHy* this, GlobalContext* globalCtx) { case SCENE_MARKET_ALLEY_N: if ((this->actor.params & 0x7F) != 14) { return true; - } else if (gSaveContext.nightFlag == 1) { + } else if (IS_NIGHT) { return false; } else if ((gSaveContext.eventChkInf[8] & 1) && !(gSaveContext.eventChkInf[4] & 0x20)) { return false; diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 8524582857..2a8095d34a 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -234,10 +234,10 @@ void func_80A74398(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params == 0) { thisx->colChkInfo.health += 20; - thisx->naviEnemyId = 52; + thisx->naviEnemyId = 0x34; } else { Actor_SetScale(thisx, 0.012f); - thisx->naviEnemyId = 53; + thisx->naviEnemyId = 0x35; Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_ENEMY); } diff --git a/src/overlays/actors/ovl_En_In/z_en_in.c b/src/overlays/actors/ovl_En_In/z_en_in.c index 59ee50d365..40da3cee6e 100644 --- a/src/overlays/actors/ovl_En_In/z_en_in.c +++ b/src/overlays/actors/ovl_En_In/z_en_in.c @@ -114,13 +114,13 @@ u16 func_80A79010(GlobalContext* globalCtx) { return temp_v0; } if (gSaveContext.eventChkInf[1] & 0x100) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { return 0x205F; } else { return 0x2057; } } - if (gSaveContext.nightFlag == 1) { + if (IS_NIGHT) { return 0x204E; } switch (gSaveContext.eventInf[0] & 0xF) { @@ -165,7 +165,7 @@ u16 func_80A79168(GlobalContext* globalCtx, Actor* thisx) { if (temp_v0 != 0) { return temp_v0; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { return func_80A78FB0(globalCtx); } else { return func_80A79010(globalCtx); @@ -331,7 +331,7 @@ void func_80A796EC(EnIn* this, s32 arg1) { } s32 func_80A7975C(EnIn* this, GlobalContext* globalCtx) { - if (this->actor.params != 1 || this->actor.shape.rot.z != 1 || LINK_IS_CHILD) { + if (this->actor.params != 1 || this->actor.shape.rot.z != 1 || !LINK_IS_ADULT) { return 0; } this->animationIdx = 1; @@ -343,15 +343,15 @@ s32 func_80A7975C(EnIn* this, GlobalContext* globalCtx) { } s32 func_80A79830(EnIn* this, GlobalContext* globalCtx) { - if (globalCtx->sceneNum == SCENE_SPOT20 && gSaveContext.linkAge == 1 && (gSaveContext.nightFlag == 0) && - this->actor.shape.rot.z == 1 && !(gSaveContext.eventChkInf[1] & 0x10)) { + if (globalCtx->sceneNum == SCENE_SPOT20 && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 && + !(gSaveContext.eventChkInf[1] & 0x10)) { return 1; } - if (globalCtx->sceneNum == SCENE_MALON_STABLE && gSaveContext.linkAge == 1 && (gSaveContext.nightFlag == 0) && - this->actor.shape.rot.z == 3 && (gSaveContext.eventChkInf[1] & 0x10)) { + if (globalCtx->sceneNum == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 3 && + (gSaveContext.eventChkInf[1] & 0x10)) { return 1; } - if (globalCtx->sceneNum == SCENE_MALON_STABLE && gSaveContext.linkAge == 1 && gSaveContext.nightFlag == 1) { + if (globalCtx->sceneNum == SCENE_MALON_STABLE && LINK_IS_CHILD && IS_NIGHT) { if ((this->actor.shape.rot.z == 2) && !(gSaveContext.eventChkInf[1] & 0x10)) { return 1; } @@ -359,7 +359,7 @@ s32 func_80A79830(EnIn* this, GlobalContext* globalCtx) { return 1; } } - if (globalCtx->sceneNum == SCENE_SPOT20 && LINK_IS_ADULT && (gSaveContext.nightFlag == 0)) { + if (globalCtx->sceneNum == SCENE_SPOT20 && LINK_IS_ADULT && IS_DAY) { if ((this->actor.shape.rot.z == 5) && !(gSaveContext.eventChkInf[1] & 0x100)) { return 2; } @@ -367,7 +367,7 @@ s32 func_80A79830(EnIn* this, GlobalContext* globalCtx) { return 4; } } - if (globalCtx->sceneNum == SCENE_SOUKO && LINK_IS_ADULT && gSaveContext.nightFlag == 1) { + if (globalCtx->sceneNum == SCENE_SOUKO && LINK_IS_ADULT && IS_NIGHT) { if (this->actor.shape.rot.z == 6 && !(gSaveContext.eventChkInf[1] & 0x100)) { return 3; } @@ -461,7 +461,7 @@ void func_80A79C78(EnIn* this, GlobalContext* globalCtx) { Interface_ChangeAlpha(2); } -s32 D_80A7B998 = 0; +static s32 D_80A7B998 = 0; void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) { EnIn* this = THIS; diff --git a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c index ca27826824..f4870a9854 100644 --- a/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c +++ b/src/overlays/actors/ovl_En_Kakasi/z_en_kakasi.c @@ -181,7 +181,7 @@ void func_80A8F660(EnKakasi* this, GlobalContext* globalCtx) { this->actor.textId = 0x4076; this->unk_196 = 6; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->unk_194 = false; if (gSaveContext.scarecrowCustomSongSet) { this->actor.textId = 0x407A; diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index f93a654e1c..b1e2a57af5 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -203,19 +203,19 @@ void func_80A906C4(EnKakasi2* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); } -void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx2) { EnKakasi2* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; this->actor.world.rot = this->actor.shape.rot; Actor_SetFocus(&this->actor, this->height); - this->actionFunc(this, globalCtx2); + this->actionFunc(this, globalCtx); Actor_MoveForward(&this->actor); if (this->actor.shape.yOffset == 0.0f) { Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (BREG(0) != 0) { if (BREG(5) != 0) { @@ -229,12 +229,12 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) { if ((this->unk_194 % 2) == 0) { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, - 1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx2->state.gfxCtx); + 1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx->state.gfxCtx); } } else { DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f, - 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx); + 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx->state.gfxCtx); } } } diff --git a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c index d72058284b..acd57b407b 100644 --- a/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c +++ b/src/overlays/actors/ovl_En_Kakasi3/z_en_kakasi3.c @@ -191,7 +191,7 @@ void func_80A91284(EnKakasi3* this, GlobalContext* globalCtx) { this->dialogState = 6; this->unk_19A = 0; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->unk_194 = false; if (gSaveContext.scarecrowSpawnSongSet) { this->actor.textId = 0x40A0; diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 4bf0bd088b..9daab279e6 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -205,7 +205,7 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); osSyncPrintf("KANBAN ARG %x\n", this->actor.params); if (this->actor.params == ENKANBAN_FISHING) { - if (gSaveContext.linkAge == 1) { + if (LINK_IS_CHILD) { this->actor.textId = 0x409D; } else { this->actor.textId = 0x4090; @@ -217,7 +217,7 @@ void EnKanban_Init(Actor* thisx, GlobalContext* globalCtx) { this->partFlags = 0xFFFF; Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 10.0f, 50.0f, 4); EnKanban_SetFloorRot(this); - if (gSaveContext.linkAge == 1) { + if (LINK_IS_CHILD) { this->actor.world.pos.y -= 15.0f; } } @@ -879,7 +879,7 @@ void EnKanban_Draw(Actor* thisx, GlobalContext* globalCtx) { } gDPSetPrimColor(POLY_XLU_DISP++, 0x00, 0x00, 0, 0, 0, (s8)shadowAlpha); - if ((this->actionState == ENKANBAN_SIGN) && (gSaveContext.linkAge == 1)) { + if ((this->actionState == ENKANBAN_SIGN) && LINK_IS_CHILD) { zShift = 0.0f; } else { zShift = ((this->actor.world.pos.y - this->actor.floorHeight) * -50.0f) / 100.0f; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 6138136a30..b066f02269 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -88,7 +88,7 @@ static CollisionCheckInfoInit sColCheckInfoInit = { 1, 15, 80, MASS_HEAVY }; static InitChainEntry sInitChain[] = { ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 1, ICHAIN_CONTINUE), - ICHAIN_S8(naviEnemyId, 9, ICHAIN_STOP), + ICHAIN_S8(naviEnemyId, 0x09, ICHAIN_STOP), }; void EnKarebaba_Init(Actor* thisx, GlobalContext* globalCtx) { @@ -157,7 +157,7 @@ void EnKarebaba_SetupUpright(EnKarebaba* this) { Actor_SetScale(&this->actor, 0.01f); this->bodyCollider.base.colType = COLTYPE_HIT6; this->bodyCollider.base.acFlags &= ~AC_HARD; - this->bodyCollider.info.bumper.dmgFlags = LINK_IS_CHILD ? 0x07C00710 : 0x0FC00710; + this->bodyCollider.info.bumper.dmgFlags = !LINK_IS_ADULT ? 0x07C00710 : 0x0FC00710; this->bodyCollider.dim.radius = 15; this->bodyCollider.dim.height = 80; this->headCollider.dim.height = 80; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 1cc1bdc863..775fcc6c01 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -549,7 +549,7 @@ s16 func_80A97738(GlobalContext* globalCtx, Actor* thisx) { s32 EnKo_GetForestQuestState(EnKo* this) { s32 result; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { // Obtained Zelda's Letter if (gSaveContext.eventChkInf[4] & 1) { return ENKO_FQS_CHILD_SARIA; diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index a14ae34860..d0a3f69241 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -36,10 +36,10 @@ void func_80A9BF30(EnKusa* this, GlobalContext* globalCtx); void func_80A9BFA8(EnKusa* this, GlobalContext* globalCtx); void func_80A9C068(EnKusa* this, GlobalContext* globalCtx); -s16 D_80A9C1D0 = 0; -s16 D_80A9C1D4 = 0; -s16 D_80A9C1D8 = 0; -s16 D_80A9C1DC = 0; +static s16 D_80A9C1D0 = 0; +static s16 D_80A9C1D4 = 0; +static s16 D_80A9C1D8 = 0; +static s16 D_80A9C1DC = 0; const ActorInit En_Kusa_InitVars = { ACTOR_EN_KUSA, diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 7b25b405ff..cc1274c98f 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -414,6 +414,6 @@ void EnMThunder_Draw(Actor* thisx, GlobalContext* globalCtx2) { CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_m_thunder.c", 1031); } #else -f32 D_80AA046C[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f }; +static f32 D_80AA046C[] = { 0.1f, 0.15f, 0.2f, 0.25f, 0.3f, 0.25f, 0.2f, 0.15f }; #pragma GLOBAL_ASM("asm/non_matchings/overlays/actors/ovl_En_M_Thunder/EnMThunder_Draw.s") #endif 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 d347b7d904..74c9aee4b1 100644 --- a/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c +++ b/src/overlays/actors/ovl_En_Ma1/z_en_ma1.c @@ -177,14 +177,14 @@ s32 func_80AA08C4(EnMa1* this, GlobalContext* globalCtx) { if ((this->actor.shape.rot.z == 3) && (gSaveContext.sceneSetupIndex == 5)) { return 1; } - if (gSaveContext.linkAge != 1) { + if (!LINK_IS_CHILD) { return 0; } if (((globalCtx->sceneNum == SCENE_MARKET_NIGHT) || (globalCtx->sceneNum == SCENE_MARKET_DAY)) && - (!(gSaveContext.eventChkInf[1] & 0x10)) && (!(gSaveContext.infTable[8] & 0x800))) { + !(gSaveContext.eventChkInf[1] & 0x10) && !(gSaveContext.infTable[8] & 0x800)) { return 1; } - if ((globalCtx->sceneNum == SCENE_SPOT15) && (!(gSaveContext.eventChkInf[1] & 0x10))) { + if ((globalCtx->sceneNum == SCENE_SPOT15) && !(gSaveContext.eventChkInf[1] & 0x10)) { if (gSaveContext.infTable[8] & 0x800) { return 1; } else { @@ -192,13 +192,13 @@ s32 func_80AA08C4(EnMa1* this, GlobalContext* globalCtx) { return 0; } } - if ((globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag == 1) && (gSaveContext.eventChkInf[1] & 0x10)) { + if ((globalCtx->sceneNum == SCENE_SOUKO) && IS_NIGHT && (gSaveContext.eventChkInf[1] & 0x10)) { return 1; } if (globalCtx->sceneNum != SCENE_SPOT20) { return 0; } - if ((this->actor.shape.rot.z == 3) && (gSaveContext.nightFlag == 0) && (gSaveContext.eventChkInf[1] & 0x10)) { + if ((this->actor.shape.rot.z == 3) && IS_DAY && (gSaveContext.eventChkInf[1] & 0x10)) { return 1; } return 0; @@ -273,7 +273,7 @@ void EnMa1_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.targetMode = 6; this->unk_1E8.unk_00 = 0; - if ((!(gSaveContext.eventChkInf[1] & 0x10)) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) { + if (!(gSaveContext.eventChkInf[1] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { this->actionFunc = func_80AA0D88; EnMa1_ChangeAnimation(this, 2); } else { @@ -302,7 +302,7 @@ void func_80AA0D88(EnMa1* this, GlobalContext* globalCtx) { if ((globalCtx->sceneNum == SCENE_SPOT15) && (gSaveContext.eventChkInf[1] & 0x10)) { Actor_Kill(&this->actor); - } else if ((!(gSaveContext.eventChkInf[1] & 0x10)) || (CHECK_QUEST_ITEM(QUEST_SONG_EPONA))) { + } else if (!(gSaveContext.eventChkInf[1] & 0x10) || CHECK_QUEST_ITEM(QUEST_SONG_EPONA)) { if (this->unk_1E8.unk_00 == 2) { this->actionFunc = func_80AA0EA0; globalCtx->msgCtx.unk_E3E7 = 4; 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 6266989b38..fceb814995 100644 --- a/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c +++ b/src/overlays/actors/ovl_En_Ma2/z_en_ma2.c @@ -74,7 +74,7 @@ u16 func_80AA19A0(GlobalContext* globalCtx, Actor* thisx) { if (gSaveContext.eventChkInf[1] & 0x100) { return 0x2056; } - if (gSaveContext.nightFlag == 1) { + if (IS_NIGHT) { if (gSaveContext.infTable[8] & 0x1000) { return 0x2052; } else if (gSaveContext.infTable[8] & 0x4000) { @@ -135,24 +135,24 @@ void func_80AA1AE4(EnMa2* this, GlobalContext* globalCtx) { } u16 func_80AA1B58(EnMa2* this, GlobalContext* globalCtx) { - if (gSaveContext.linkAge == 1) { + if (LINK_IS_CHILD) { return 0; } - if ((!(gSaveContext.eventChkInf[1] & 0x100)) && (globalCtx->sceneNum == SCENE_MALON_STABLE) && - (gSaveContext.nightFlag == 0) && (this->actor.shape.rot.z == 5)) { + if (!(gSaveContext.eventChkInf[1] & 0x100) && (globalCtx->sceneNum == SCENE_MALON_STABLE) && IS_DAY && + (this->actor.shape.rot.z == 5)) { return 1; } - if ((!(gSaveContext.eventChkInf[1] & 0x100)) && (globalCtx->sceneNum == SCENE_SPOT20) && - (gSaveContext.nightFlag == 1) && (this->actor.shape.rot.z == 6)) { + if (!(gSaveContext.eventChkInf[1] & 0x100) && (globalCtx->sceneNum == SCENE_SPOT20) && IS_NIGHT && + (this->actor.shape.rot.z == 6)) { return 2; } - if ((!(gSaveContext.eventChkInf[1] & 0x100)) || (globalCtx->sceneNum != SCENE_SPOT20)) { + if (!(gSaveContext.eventChkInf[1] & 0x100) || (globalCtx->sceneNum != SCENE_SPOT20)) { return 0; } - if ((this->actor.shape.rot.z == 7) && (gSaveContext.nightFlag == 0)) { + if ((this->actor.shape.rot.z == 7) && IS_DAY) { return 3; } - if ((this->actor.shape.rot.z == 8) && (gSaveContext.nightFlag == 1)) { + if ((this->actor.shape.rot.z == 8) && IS_NIGHT) { return 3; } return 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 488b5fc6ed..953e783e91 100644 --- a/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c +++ b/src/overlays/actors/ovl_En_Ma3/z_en_ma3.c @@ -193,7 +193,7 @@ void func_80AA2E54(EnMa3* this, GlobalContext* globalCtx) { } s32 func_80AA2EC8(EnMa3* this, GlobalContext* globalCtx) { - if (gSaveContext.linkAge == 1) { + if (LINK_IS_CHILD) { return 2; } if (!(gSaveContext.eventChkInf[1] & 0x100)) { 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 18b333c206..06e5d05e3a 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -248,7 +248,7 @@ static DamageTable sClubMoblinDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 74, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x4A, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, -1000, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 5300, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 3dbfd3d829..ef853025e9 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -472,7 +472,7 @@ u8 EnMd_ShouldSpawn(EnMd* this, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_KOKIRI_HOME4) { if (((gSaveContext.eventChkInf[1] & 0x1000) != 0) || ((gSaveContext.eventChkInf[4] & 1) != 0)) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { return 1; } } diff --git a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c index d34b37fbc4..e2d3f63a49 100644 --- a/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c +++ b/src/overlays/actors/ovl_En_Mm2/z_en_mm2.c @@ -156,7 +156,7 @@ void EnMm2_Init(Actor* thisx, GlobalContext* globalCtx2) { func_80AAEF70(this, globalCtx); this->actionFunc = func_80AAF57C; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); } if (this->actor.params == 1) { diff --git a/src/overlays/actors/ovl_En_Mu/z_en_mu.c b/src/overlays/actors/ovl_En_Mu/z_en_mu.c index ae267dbfae..4c922a0997 100644 --- a/src/overlays/actors/ovl_En_Mu/z_en_mu.c +++ b/src/overlays/actors/ovl_En_Mu/z_en_mu.c @@ -41,7 +41,7 @@ static ColliderCylinderInit D_80AB0BD0 = { { 100, 70, 0, { 0, 0, 0 } }, }; -CollisionCheckInfoInit2 D_80AB0BFC = { 0, 0, 0, 0, MASS_IMMOVABLE }; +static CollisionCheckInfoInit2 D_80AB0BFC = { 0, 0, 0, 0, MASS_IMMOVABLE }; const ActorInit En_Mu_InitVars = { ACTOR_EN_MU, diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 9bd7050007..5636c8e8e7 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -1098,7 +1098,7 @@ void EnNb_LookUp(EnNb* this, GlobalContext* globalCtx) { } void EnNb_CrawlspaceSpawnCheck(EnNb* this, GlobalContext* globalCtx) { - if (!(gSaveContext.eventChkInf[9] & 0x20) && (gSaveContext.linkAge == 1)) { + if (!(gSaveContext.eventChkInf[9] & 0x20) && LINK_IS_CHILD) { EnNb_UpdatePath(this, globalCtx); // looking into crawlspace diff --git a/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/src/overlays/actors/ovl_En_Niw/z_en_niw.c index db89a01c59..2d191feba9 100644 --- a/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -184,7 +184,7 @@ void EnNiw_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case 2: - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { Actor_Kill(&this->actor); } break; diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 79b15e39be..2d804e42a8 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -206,7 +206,7 @@ void EnNiwGirl_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetFocus(&this->actor, 30.0f); if (tempActionFunc == this->actionFunc) { this->unk_2D4.unk_18 = player->actor.world.pos; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->unk_2D4.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(&this->actor, &this->unk_2D4, 2, 4); diff --git a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c index 6d3e6e4c61..670114ca2b 100644 --- a/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c +++ b/src/overlays/actors/ovl_En_Niw_Lady/z_en_niw_lady.c @@ -81,7 +81,7 @@ void EnNiwLady_Init(Actor* thisx, GlobalContext* globalCtx) { if (globalCtx->sceneNum == SCENE_LABO) { this->unk_278 = 1; } - if ((this->unk_278 != 0) && (gSaveContext.nightFlag == 0)) { + if ((this->unk_278 != 0) && IS_DAY) { Actor_Kill(thisx); return; } @@ -169,7 +169,7 @@ void func_80AB9F24(EnNiwLady* this, GlobalContext* globalCtx) { this->actor.draw = EnNiwLady_Draw; switch (this->unk_278) { case 0: - if (!(gSaveContext.itemGetInf[0] & 0x1000) && LINK_IS_CHILD) { + if (!(gSaveContext.itemGetInf[0] & 0x1000) && !LINK_IS_ADULT) { frames = Animation_GetLastFrame(&gObjOsAnim_A630); Animation_Change(&this->skelAnime, &gObjOsAnim_A630, 1.0f, 0.0f, (s16)frames, ANIMMODE_LOOP, 0.0f); } else { @@ -492,7 +492,7 @@ void EnNiwLady_Update(Actor* thisx, GlobalContext* globalCtx) { Actor_SetFocus(thisx, 60.0f); this->unk_288.unk_18 = player->actor.world.pos; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->unk_288.unk_18.y = player->actor.world.pos.y - 10.0f; } func_80034A14(thisx, &this->unk_288, 2, 4); 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 0c749697bd..2780c33bfd 100644 --- a/src/overlays/actors/ovl_En_Ny/z_en_ny.c +++ b/src/overlays/actors/ovl_En_Ny/z_en_ny.c @@ -100,7 +100,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 40, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x28, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index b5f17beb62..45c1063000 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -254,7 +254,7 @@ void func_80ABF4C8(EnOkarinaTag* this, GlobalContext* globalCtx) { break; case 6: globalCtx->csCtx.segment = - (LINK_IS_ADULT) ? SEGMENTED_TO_VIRTUAL(&D_02003C80) : SEGMENTED_TO_VIRTUAL(&D_02005020); + LINK_IS_ADULT ? SEGMENTED_TO_VIRTUAL(&D_02003C80) : SEGMENTED_TO_VIRTUAL(&D_02005020); gSaveContext.cutsceneTrigger = 1; gSaveContext.eventChkInf[1] |= 0x2000; func_80078884(NA_SE_SY_CORRECT_CHIME); diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 407442521f..a11632979e 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -111,7 +111,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 66, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x42, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 6500, ICHAIN_STOP), }; @@ -571,10 +571,10 @@ void EnOkuta_ColliderCheck(EnOkuta* this, GlobalContext* globalCtx) { } } -void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { +void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx2) { EnOkuta* this = THIS; + GlobalContext* globalCtx = globalCtx2; Player* player = PLAYER; - GlobalContext* globalCtx2 = globalCtx; WaterBox* outWaterBox; f32 ySurface; Vec3f sp38; @@ -582,8 +582,8 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { if (!(player->stateFlags1 & 0x300000C0)) { if (this->actor.params == 0) { - EnOkuta_ColliderCheck(this, globalCtx2); - if (!WaterBox_GetSurfaceImpl(globalCtx2, &globalCtx2->colCtx, this->actor.world.pos.x, + EnOkuta_ColliderCheck(this, globalCtx); + if (!WaterBox_GetSurfaceImpl(globalCtx, &globalCtx->colCtx, this->actor.world.pos.x, this->actor.world.pos.z, &ySurface, &outWaterBox) || (ySurface < this->actor.floorHeight)) { if (this->actor.colChkInfo.health != 0) { @@ -594,7 +594,7 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.home.pos.y = ySurface; } } - this->actionFunc(this, globalCtx2); + this->actionFunc(this, globalCtx); if (this->actor.params == 0) { EnOkuta_UpdateHeadScale(this); this->collider.dim.height = @@ -604,14 +604,14 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { sp34 = false; Actor_MoveForward(&this->actor); Math_Vec3f_Copy(&sp38, &this->actor.world.pos); - Actor_UpdateBgCheckInfo(globalCtx2, &this->actor, 10.0f, 15.0f, 30.0f, 5); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 10.0f, 15.0f, 30.0f, 5); if ((this->actor.bgCheckFlags & 8) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~8; } if ((this->actor.bgCheckFlags & 1) && - SurfaceType_IsIgnoredByProjectiles(&globalCtx2->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { + SurfaceType_IsIgnoredByProjectiles(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId)) { sp34 = true; this->actor.bgCheckFlags &= ~1; } @@ -626,18 +626,18 @@ void EnOkuta_Update(Actor* thisx, GlobalContext* globalCtx) { } if (this->actor.params == 0x10) { this->actor.flags |= 0x1000000; - CollisionCheck_SetAT(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } if (this->actionFunc != EnOkuta_WaitToAppear) { if ((this->actionFunc != EnOkuta_Die) && (this->actionFunc != EnOkuta_WaitToDie) && (this->actionFunc != EnOkuta_Freeze)) { - CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } Actor_SetFocus(&this->actor, 15.0f); if ((this->actor.params == 0) && (this->actor.draw != NULL)) { - EnOkuta_SpawnRipple(this, globalCtx2); + EnOkuta_SpawnRipple(this, globalCtx); } } } diff --git a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c index bb0ddbb976..b41f63ceb0 100644 --- a/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c +++ b/src/overlays/actors/ovl_En_Peehat/z_en_peehat.c @@ -192,8 +192,8 @@ void EnPeehat_SetupAction(EnPeehat* this, EnPeehatActionFunc actionFunc) { void EnPeehat_Init(Actor* thisx, GlobalContext* globalCtx) { EnPeehat* this = THIS; - Actor_ProcessInitChain(thisx, sInitChain); - Actor_SetScale(thisx, 36.0f * 0.001f); + Actor_ProcessInitChain(&this->actor, sInitChain); + Actor_SetScale(&this->actor, 36.0f * 0.001f); SkelAnime_Init(globalCtx, &this->skelAnime, &gPeehatSkel, &gPeehatRisingAnim, this->jointTable, this->morphTable, 24); ActorShape_Init(&this->actor.shape, 100.0f, ActorShadow_DrawCircle, 27.0f); @@ -205,11 +205,11 @@ void EnPeehat_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.floorHeight = this->actor.world.pos.y; Collider_InitCylinder(globalCtx, &this->colCylinder); - Collider_SetCylinder(globalCtx, &this->colCylinder, thisx, &sCylinderInit); + Collider_SetCylinder(globalCtx, &this->colCylinder, &this->actor, &sCylinderInit); Collider_InitQuad(globalCtx, &this->colQuad); - Collider_SetQuad(globalCtx, &this->colQuad, thisx, &sQuadInit); + Collider_SetQuad(globalCtx, &this->colQuad, &this->actor, &sQuadInit); Collider_InitJntSph(globalCtx, &this->colJntSph); - Collider_SetJntSph(globalCtx, &this->colJntSph, thisx, &sJntSphInit, this->colJntSphItemList); + Collider_SetJntSph(globalCtx, &this->colJntSph, &this->actor, &sJntSphInit, this->colJntSphItemList); this->actor.naviEnemyId = 0x48; this->xzDistToRise = 740.0f; @@ -310,8 +310,8 @@ void EnPeehat_HitWhenGrounded(EnPeehat* this, GlobalContext* globalCtx) { } void EnPeehat_Ground_SetStateGround(EnPeehat* this) { - Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, Animation_GetLastFrame(&gPeehatRisingAnim), 2, - 0.0f); + Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, Animation_GetLastFrame(&gPeehatRisingAnim), + ANIMMODE_ONCE, 0.0f); this->seekPlayerTimer = 600; this->unk2D4 = 0; this->unk2FA = 0; @@ -321,7 +321,7 @@ void EnPeehat_Ground_SetStateGround(EnPeehat* this) { } void EnPeehat_Ground_StateGround(EnPeehat* this, GlobalContext* globalCtx) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { this->actor.flags |= 1; if (this->riseDelayTimer == 0) { if (this->actor.xzDistToPlayer < this->xzDistToRise) { @@ -348,17 +348,17 @@ void EnPeehat_Ground_StateGround(EnPeehat* this, GlobalContext* globalCtx) { } void EnPeehat_Flying_SetStateGround(EnPeehat* this) { - Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, Animation_GetLastFrame(&gPeehatRisingAnim), 2, - 0.0f); + Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, Animation_GetLastFrame(&gPeehatRisingAnim), + ANIMMODE_ONCE, 0.0f); this->seekPlayerTimer = 400; this->unk2D4 = 0; - this->unk2FA = 0; // @bug: overwrites number of child larva spawned, allowing for more than MAX_LARVA spawns + this->unk2FA = 0; //! @bug: overwrites number of child larva spawned, allowing for more than MAX_LARVA spawns this->state = PEAHAT_STATE_4; EnPeehat_SetupAction(this, EnPeehat_Flying_StateGrounded); } void EnPeehat_Flying_StateGrounded(EnPeehat* this, GlobalContext* globalCtx) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { if (this->actor.xzDistToPlayer < this->xzDistToRise) { EnPeehat_Flying_SetStateRise(this); } @@ -386,7 +386,7 @@ void EnPeehat_Flying_SetStateFly(EnPeehat* this) { void EnPeehat_Flying_StateFly(EnPeehat* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PIHAT_FLY - SFX_FLAG); SkelAnime_Update(&this->skelAnime); - if ((gSaveContext.nightFlag != 0) || this->xzDistToRise < this->actor.xzDistToPlayer) { + if (!IS_DAY || this->xzDistToRise < this->actor.xzDistToPlayer) { EnPeehat_Flying_SetStateLanding(this); } else if (this->actor.xzDistToPlayer < this->xzDistMax) { if (this->unk2FA < MAX_LARVA && (globalCtx->gameplayFrames & 7) == 0) { @@ -404,11 +404,10 @@ void EnPeehat_Flying_StateFly(EnPeehat* this, GlobalContext* globalCtx) { } void EnPeehat_Ground_SetStateRise(EnPeehat* this) { - f32 lastFrame; + f32 lastFrame = Animation_GetLastFrame(&gPeehatRisingAnim); - lastFrame = Animation_GetLastFrame(&gPeehatRisingAnim); if (this->state != PEAHAT_STATE_STUNNED) { - Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, lastFrame, 2, 0.0f); + Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, lastFrame, ANIMMODE_ONCE, 0.0f); } this->state = PEAHAT_STATE_8; this->animTimer = lastFrame; @@ -449,7 +448,7 @@ void EnPeehat_Flying_SetStateRise(EnPeehat* this) { lastFrame = Animation_GetLastFrame(&gPeehatRisingAnim); if (this->state != PEAHAT_STATE_STUNNED) { - Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, lastFrame, 2, 0.0f); + Animation_Change(&this->skelAnime, &gPeehatRisingAnim, 0.0f, 3.0f, lastFrame, ANIMMODE_ONCE, 0.0f); } this->state = PEAHAT_STATE_9; this->animTimer = lastFrame; @@ -470,7 +469,8 @@ void EnPeehat_Flying_StateRise(EnPeehat* this, GlobalContext* globalCtx) { } } if (SkelAnime_Update(&this->skelAnime) || this->animTimer == 0) { - this->unk2FA = 0; // @bug: overwrites number of child larva spawned, allowing for more than MAX_LARVA spawns + //! @bug: overwrites number of child larva spawned, allowing for more than MAX_LARVA spawns + this->unk2FA = 0; EnPeehat_Flying_SetStateFly(this); } else { this->actor.world.pos.y += 18.0f; @@ -504,8 +504,7 @@ void EnPeehat_Ground_StateSeekPlayer(EnPeehat* this, GlobalContext* globalCtx) { } else { this->seekPlayerTimer--; } - if ((gSaveContext.nightFlag == 0) && - (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax)) { + if (IS_DAY && (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax)) { Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0); if (this->unk2FA != 0) { this->actor.shape.rot.y += 0x1C2; @@ -682,8 +681,7 @@ void EnPeehat_Ground_StateHover(EnPeehat* this, GlobalContext* globalCtx) { } this->actor.shape.rot.y += 0x15E; // if daytime, and the player is close to the initial spawn position - if ((gSaveContext.nightFlag == 0) && - Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax) { + if (IS_DAY && Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnPeehat_Ground_SetStateSeekPlayer(this); this->unk2FA = globalCtx->gameplayFrames & 1; @@ -725,8 +723,7 @@ void EnPeehat_Ground_StateReturnHome(EnPeehat* this, GlobalContext* globalCtx) { EnPeehat_Ground_SetStateLanding(this); this->riseDelayTimer = 60; } - if (gSaveContext.nightFlag == 0 && - Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax) { + if (IS_DAY && Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) < this->xzDistMax) { this->seekPlayerTimer = 400; EnPeehat_Ground_SetStateSeekPlayer(this); this->unk2FA = (globalCtx->gameplayFrames & 1); diff --git a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c index fe9c209d84..72fd45c66e 100644 --- a/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c +++ b/src/overlays/actors/ovl_En_Po_Relay/z_en_po_relay.c @@ -25,7 +25,7 @@ void EnPoRelay_Talk2(EnPoRelay* this, GlobalContext* globalCtx); void EnPoRelay_DisappearAndReward(EnPoRelay* this, GlobalContext* globalCtx); void EnPoRelay_SetupIdle(EnPoRelay* this); -Vec3s D_80AD8C30[] = { +static Vec3s D_80AD8C30[] = { { 0xFFC4, 0xFDEE, 0xF47A }, { 0x0186, 0xFE0C, 0xF47A }, { 0x0186, 0xFE0C, 0xF0F6 }, { 0x00D2, 0xFDEE, 0xF0F6 }, { 0x00D2, 0xFD9E, 0xEEDA }, { 0x023A, 0xFDC6, 0xEEDA }, { 0x023A, 0xFDC6, 0xED18 }, { 0x00D2, 0xFDC6, 0xED18 }, { 0x00D2, 0xFDC6, 0xEBCE }, { 0x00D2, 0xFDC6, 0xEAA2 }, { 0x023A, 0xFDC6, 0xEAA2 }, { 0x023A, 0xFDC6, 0xEBB0 }, diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 2e30dbe34c..3a869d580c 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -159,11 +159,11 @@ void EnRd_Init(Actor* thisx, GlobalContext* globalCtx) { if (thisx->params >= -1) { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600E778, &D_060087D0, this->jointTable, this->morphTable, 26); - thisx->naviEnemyId = 42; + thisx->naviEnemyId = 0x2A; } else { SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06003DD8, &D_060087D0, this->jointTable, this->morphTable, 26); - thisx->naviEnemyId = 45; + thisx->naviEnemyId = 0x2D; } Collider_InitCylinder(globalCtx, &this->collider); @@ -509,7 +509,7 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { return; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Math_SmoothStepToF(&this->actor.shape.yOffset, -1500.0f, 1.0f, 150.0f, 0.0f); } @@ -535,12 +535,12 @@ void func_80AE3454(EnRd* this, GlobalContext* globalCtx) { } break; case 3: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } break; case 4: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Math_SmoothStepToF(&this->actor.shape.yOffset, 0, 1.0f, 400.0f, 0.0f); } this->actor.targetMode = 0; diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 30019aa6a3..70cf28f863 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -41,7 +41,7 @@ void EnRiverSound_Init(Actor* thisx, GlobalContext* globalCtx) { func_800F6FB4(4); Actor_Kill(&this->actor); } else if (this->actor.params == RS_SARIAS_SONG) { - if ((!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY)) || (CHECK_QUEST_ITEM(QUEST_SONG_SARIA))) { + if (!CHECK_QUEST_ITEM(QUEST_SONG_LULLABY) || CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Rr/z_en_rr.c b/src/overlays/actors/ovl_En_Rr/z_en_rr.c index ffc7770d0f..66ba3a151a 100644 --- a/src/overlays/actors/ovl_En_Rr/z_en_rr.c +++ b/src/overlays/actors/ovl_En_Rr/z_en_rr.c @@ -157,7 +157,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 55, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x37, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index a29a822185..658a341710 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -241,9 +241,9 @@ void func_80AEAECC(EnRu1* this, GlobalContext* globalCtx) { s32 EnRu1_IsCsStateIdle(GlobalContext* globalCtx) { if (globalCtx->csCtx.state == CS_STATE_IDLE) { - return 1; + return true; } - return 0; + return false; } CsCmdActorAction* func_80AEAF58(GlobalContext* globalCtx, s32 npcActionIdx) { @@ -260,18 +260,18 @@ s32 func_80AEAFA0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action == action)) { - return 1; + return true; } - return 0; + return false; } s32 func_80AEAFE0(GlobalContext* globalCtx, u16 action, s32 npcActionIdx) { CsCmdActorAction* csCmdNPCAction = func_80AEAF58(globalCtx, npcActionIdx); if ((csCmdNPCAction != NULL) && (csCmdNPCAction->action != action)) { - return 1; + return true; } - return 0; + return false; } s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { @@ -283,13 +283,13 @@ s32 func_80AEB020(EnRu1* this, GlobalContext* globalCtx) { someEnRu1 = (EnRu1*)actorIt; if (someEnRu1 != this) { if ((someEnRu1->action == 31) || (someEnRu1->action == 32) || (someEnRu1->action == 24)) { - return 1; + return true; } } } actorIt = actorIt->next; } - return 0; + return false; } BgBdanObjects* EnRu1_FindSwitch(GlobalContext* globalCtx) { @@ -666,7 +666,6 @@ void func_80AEBF60(EnRu1* this, GlobalContext* globalCtx) { func_80AEB7D0(this); this->action = 5; this->unk_364 = this->actor.world.pos; - return; } else { func_80AEBA0C(this, globalCtx); } @@ -767,10 +766,8 @@ void func_80AEC320(EnRu1* this, GlobalContext* globalCtx) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 7; EnRu1_SetMouthIndex(this, 1); - return; - } - if ((gSaveContext.infTable[20] & 0x80) && (!(gSaveContext.infTable[20] & 1)) && - (!(gSaveContext.infTable[20] & 0x20))) { + } else if ((gSaveContext.infTable[20] & 0x80) && !(gSaveContext.infTable[20] & 1) && + !(gSaveContext.infTable[20] & 0x20)) { if (!func_80AEB020(this, globalCtx)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; @@ -826,13 +823,14 @@ s32 func_80AEC5FC(EnRu1* this, GlobalContext* globalCtx) { f32 playerPosZ = player->actor.world.pos.z; if ((playerPosZ - thisPosZ <= 265.0f) && (player->actor.world.pos.y >= this->actor.world.pos.y)) { - return 1; + return true; } - return 0; + return false; } void func_80AEC650(EnRu1* this) { s32 pad[2]; + if (this->unk_280 == 0) { if ((Animation_OnFrame(&this->skelAnime, 2.0f)) || (Animation_OnFrame(&this->skelAnime, 7.0f))) { func_80078914(&this->actor.projectedPos, NA_SE_PL_WALK_DIRT); @@ -1064,17 +1062,17 @@ s32 func_80AECF6C(EnRu1* this, GlobalContext* globalCtx) { Math_SmoothStepToS(shapeRotY, temp_f16, 0x14, 0x1838, 0x64); player->actor.world.rot.y = *shapeRotY; } else { - return 1; + return true; } } - return 0; + return false; } s32 func_80AED084(EnRu1* this, UNK_TYPE arg1) { if (this->blueWarp != NULL && this->blueWarp->unk_1EC == arg1) { - return 1; + return true; } - return 0; + return false; } void func_80AED0B0(EnRu1* this, UNK_TYPE arg1) { @@ -1173,8 +1171,8 @@ void func_80AED414(EnRu1* this, GlobalContext* globalCtx) { void func_80AED44C(EnRu1* this, GlobalContext* globalCtx) { s8 actorRoom; - if ((gSaveContext.infTable[20] & 2) && (!(gSaveContext.infTable[20] & 0x20)) && - (!(gSaveContext.infTable[20] & 1)) && (!(gSaveContext.infTable[20] & 0x80))) { + if ((gSaveContext.infTable[20] & 2) && !(gSaveContext.infTable[20] & 0x20) && !(gSaveContext.infTable[20] & 1) && + !(gSaveContext.infTable[20] & 0x80)) { if (!func_80AEB020(this, globalCtx)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; @@ -1226,7 +1224,7 @@ s32 func_80AED624(EnRu1* this, GlobalContext* globalCtx) { if (this->roomNum2 != curRoomNum) { Actor_Kill(&this->actor); - return 0; + return false; } else if (((this->roomNum1 != curRoomNum) || (this->roomNum2 != curRoomNum)) && (this->actor.yDistToWater > kREG(16) + 50.0f) && (this->action != 33)) { this->action = 33; @@ -1234,7 +1232,7 @@ s32 func_80AED624(EnRu1* this, GlobalContext* globalCtx) { this->alpha = 0xFF; this->unk_2A4 = 0.0f; } - return 1; + return true; } void func_80AED6DC(EnRu1* this, GlobalContext* globalCtx) { @@ -1271,7 +1269,7 @@ void func_80AED738(EnRu1* this, GlobalContext* globalCtx) { } void func_80AED83C(EnRu1* this) { - s32 pad2[2]; + s32 pad[2]; Vec3s* tempPtr; Vec3s* tempPtr2; @@ -1508,9 +1506,9 @@ s32 func_80AEE264(EnRu1* this, GlobalContext* globalCtx) { this->actor.textId = 0x404C; func_8002F2F4(&this->actor, globalCtx); } - return 0; + return false; } - return 1; + return true; } void func_80AEE2F8(EnRu1* this, GlobalContext* globalCtx) { @@ -1548,10 +1546,10 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { this->drawConfig = 0; this->unk_28C = (BgBdanObjects*)dynaPolyActor; this->actor.shape.shadowAlpha = 0; - return 1; + return true; } } - return 0; + return false; } void func_80AEE488(EnRu1* this, GlobalContext* globalCtx) { @@ -1600,7 +1598,7 @@ s32 func_80AEE6D0(EnRu1* this, GlobalContext* globalCtx) { s32 pad; s8 curRoomNum = globalCtx->roomCtx.curRoom.num; - if ((!(gSaveContext.infTable[20] & 0x10)) && (func_80AEB124(globalCtx) != 0)) { + if (!(gSaveContext.infTable[20] & 0x10) && (func_80AEB124(globalCtx) != 0)) { if (!Player_InCsMode(globalCtx)) { Animation_Change(&this->skelAnime, &gRutoChildSeesSapphireAnim, 1.0f, 0, Animation_GetLastFrame(&gRutoChildSquirmAnim), ANIMMODE_LOOP, -8.0f); @@ -1611,10 +1609,10 @@ s32 func_80AEE6D0(EnRu1* this, GlobalContext* globalCtx) { gSaveContext.cutsceneTrigger = 1; } this->roomNum3 = curRoomNum; - return 1; + return true; } this->roomNum3 = curRoomNum; - return 0; + return false; } void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) { @@ -1677,9 +1675,9 @@ s32 func_80AEEAC8(EnRu1* this, GlobalContext* globalCtx) { func_8002F580(&this->actor, globalCtx); this->action = 27; func_80AEADD8(this); - return 1; + return true; } - return 0; + return false; } void func_80AEEB24(EnRu1* this, GlobalContext* globalCtx) { @@ -1818,9 +1816,9 @@ s32 func_80AEF0BC(EnRu1* this, GlobalContext* globalCtx) { globalCtx->msgCtx.msgMode = 0x37; this->action = 26; this->actor.flags &= ~0x9; - return 1; + return true; } - return 0; + return false; } void func_80AEF170(EnRu1* this, GlobalContext* globalCtx, s32 cond) { @@ -2095,7 +2093,7 @@ void func_80AEFC24(EnRu1* this, GlobalContext* globalCtx) { } void func_80AEFC54(EnRu1* this, GlobalContext* globalCtx) { - if ((gSaveContext.infTable[20] & 0x20) && (!(gSaveContext.infTable[20] & 0x40))) { + if ((gSaveContext.infTable[20] & 0x20) && !(gSaveContext.infTable[20] & 0x40)) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->action = 41; this->unk_28C = EnRu1_FindSwitch(globalCtx); @@ -2116,7 +2114,7 @@ void func_80AEFCE8(EnRu1* this, GlobalContext* globalCtx) { } void func_80AEFD38(EnRu1* this, GlobalContext* globalCtx) { - if ((gSaveContext.eventChkInf[3] & 0x80) && (gSaveContext.linkAge == 1)) { + if ((gSaveContext.eventChkInf[3] & 0x80) && LINK_IS_CHILD) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); this->actor.flags &= ~0x10; this->action = 44; @@ -2134,17 +2132,17 @@ s32 func_80AEFDC0(EnRu1* this, GlobalContext* globalCtx) { this->actor.textId = 0x402C; } func_8002F2F4(&this->actor, globalCtx); - return 0; + return false; } - return 1; + return true; } s32 func_80AEFE38(EnRu1* this, GlobalContext* globalCtx) { if (func_8010BDBC(&globalCtx->msgCtx) == 2) { this->actor.flags &= ~0x9; - return 1; + return true; } - return 0; + return false; } void func_80AEFE84(EnRu1* this, GlobalContext* globalCtx, s32 cond) { @@ -2179,7 +2177,7 @@ void func_80AEFF40(EnRu1* this, GlobalContext* globalCtx) { void func_80AEFF94(EnRu1* this, GlobalContext* globalCtx) { s8 actorRoom; - if ((gSaveContext.infTable[20] & 2) && (gSaveContext.infTable[20] & 1) && (!(gSaveContext.infTable[20] & 0x20)) && + if ((gSaveContext.infTable[20] & 2) && (gSaveContext.infTable[20] & 1) && !(gSaveContext.infTable[20] & 0x20) && (!(func_80AEB020(this, globalCtx)))) { func_80AEB264(this, &gRutoChildWait2Anim, 0, 0, 0); actorRoom = this->actor.room; diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c index 3d606538f2..bbb3c6e22a 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1_cutscene_data.c @@ -2,7 +2,7 @@ #include "z64cutscene_commands.h" // clang-format off -CutsceneData D_80AF0880[] = { +static CutsceneData D_80AF0880[] = { CS_BEGIN_CUTSCENE(15, 1306), CS_PLAYER_ACTION_LIST(10), CS_PLAYER_ACTION(0x0027, 0, 50, 0x0000, 0x6C16, 0x0000, 12, -340, -2810, 12, -340, -2810, 1.1393037E-29f, 0.0f, 1.4E-45f), @@ -110,9 +110,9 @@ CutsceneData D_80AF0880[] = { CS_END(), }; -u32 D_80AF10A0 = 0; +static u32 D_80AF10A0 = 0; -CutsceneData D_80AF10A4[] = { +static CutsceneData D_80AF10A4[] = { CS_BEGIN_CUTSCENE(14, 1299), CS_PLAYER_ACTION_LIST(3), CS_PLAYER_ACTION(0x0005, 0, 272, 0x0000, 0xC000, 0x0000, -1085, -1025, -3347, -1085, -1025, -3347, 1.1393037E-29f, 0.0f, 1.4E-45f), @@ -199,9 +199,9 @@ CutsceneData D_80AF10A4[] = { CS_END(), }; -u32 D_80AF1724 = 0; +static u32 D_80AF1724 = 0; -CutsceneData D_80AF1728[] = { +static CutsceneData D_80AF1728[] = { CS_BEGIN_CUTSCENE(7, 1160), CS_MISC_LIST(1), CS_MISC(0x000C, 75, 627, 0x0000, 0x00000000, 0x00000000, 0xFFFFFFC0, 0x00000032, 0x00000000, 0xFFFFFFC0, 0x00000032, 0x00000000, 0x00000000, 0x00000000), diff --git a/src/overlays/actors/ovl_En_Sa/z_en_sa.c b/src/overlays/actors/ovl_En_Sa/z_en_sa.c index 8972195dad..d1d6219655 100644 --- a/src/overlays/actors/ovl_En_Sa/z_en_sa.c +++ b/src/overlays/actors/ovl_En_Sa/z_en_sa.c @@ -355,12 +355,12 @@ s32 func_80AF5DFC(EnSa* this, GlobalContext* globalCtx) { return 5; } } - if (globalCtx->sceneNum == SCENE_KOKIRI_HOME5 && LINK_IS_CHILD && + if (globalCtx->sceneNum == SCENE_KOKIRI_HOME5 && !LINK_IS_ADULT && INV_CONTENT(ITEM_OCARINA_FAIRY) == ITEM_OCARINA_FAIRY && !(gSaveContext.eventChkInf[4] & 1)) { return 1; } if (globalCtx->sceneNum == SCENE_SPOT05 && (gSaveContext.eventChkInf[4] & 1)) { - return (CHECK_QUEST_ITEM(QUEST_SONG_SARIA)) ? 2 : 5; + return CHECK_QUEST_ITEM(QUEST_SONG_SARIA) ? 2 : 5; } if (globalCtx->sceneNum == SCENE_SPOT04 && !CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) { if (gSaveContext.infTable[0] & 1) { diff --git a/src/overlays/actors/ovl_En_Sb/z_en_sb.c b/src/overlays/actors/ovl_En_Sb/z_en_sb.c index ba918ef6cb..ec4888e56b 100644 --- a/src/overlays/actors/ovl_En_Sb/z_en_sb.c +++ b/src/overlays/actors/ovl_En_Sb/z_en_sb.c @@ -86,7 +86,7 @@ static DamageTable sDamageTable[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 39, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x27, ICHAIN_CONTINUE), ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 30, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 1d322bb871..365bccb1b4 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -189,7 +189,7 @@ void EnSkb_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_80AFCD60(EnSkb* this) { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { @@ -226,7 +226,7 @@ void func_80AFCE5C(EnSkb* this, GlobalContext* globalCtx) { void func_80AFCF48(EnSkb* this) { Animation_Change(&this->skelAnime, &gStalchildUncurlingAnim, -1.0f, - Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, 2, -4.0f); + Animation_GetLastFrame(&gStalchildUncurlingAnim), 0.0f, ANIMMODE_ONCE, -4.0f); this->unk_280 = 0; this->unk_281 = 0; this->actor.flags &= ~1; @@ -248,7 +248,7 @@ void func_80AFCFF0(EnSkb* this, GlobalContext* globalCtx) { void func_80AFD0A4(EnSkb* this) { Animation_Change(&this->skelAnime, &gStalchildWalkingAnim, 0.96000004f, 0.0f, - Animation_GetLastFrame(&gStalchildWalkingAnim), 0, -4.0f); + Animation_GetLastFrame(&gStalchildWalkingAnim), ANIMMODE_LOOP, -4.0f); this->unk_280 = 4; this->unk_288 = 0; this->actor.speedXZ = this->actor.scale.y * 160.0f; @@ -286,7 +286,7 @@ void EnSkb_Advance(EnSkb* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_STALKID_WALK); } } - if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || gSaveContext.nightFlag == 0) { + if (Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos) > 800.0f || IS_DAY) { func_80AFCF48(this); } else if (Actor_IsFacingPlayer(&this->actor, 0x11C7) && (this->actor.xzDistToPlayer < (60.0f + (this->actor.params * 6.0f)))) { @@ -296,7 +296,7 @@ void EnSkb_Advance(EnSkb* this, GlobalContext* globalCtx) { void func_80AFD33C(EnSkb* this) { Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, 0.6f, 0.0f, - Animation_GetLastFrame(&gStalchildAttackingAnim), 3, 4.0f); + Animation_GetLastFrame(&gStalchildAttackingAnim), ANIMMODE_ONCE_INTERP, 4.0f); this->collider.base.atFlags &= ~4; this->unk_280 = 3; this->actor.speedXZ = 0.0f; @@ -322,7 +322,8 @@ void EnSkb_SetupAttack(EnSkb* this, GlobalContext* globalCtx) { } void func_80AFD47C(EnSkb* this) { - Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, 3, 0.0f); + Animation_Change(&this->skelAnime, &gStalchildAttackingAnim, -0.4f, this->skelAnime.curFrame - 1.0f, 0.0f, + ANIMMODE_ONCE_INTERP, 0.0f); this->collider.base.atFlags &= ~4; this->unk_280 = 5; this->unk_281 = 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 02207366fe..4acbd5f7e9 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -368,10 +368,10 @@ void EnSkj_SetNaviId(EnSkj* this) { } } -void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx) { +void EnSkj_Init(Actor* thisx, GlobalContext* globalCtx2) { s16 type = (thisx->params >> 0xA) & 0x3F; EnSkj* this = (EnSkj*)thisx; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; s32 pad; Player* player; diff --git a/src/overlays/actors/ovl_En_St/z_en_st.c b/src/overlays/actors/ovl_En_St/z_en_st.c index 839326bd68..f859503fa2 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -571,7 +571,7 @@ s32 EnSt_DecrStunTimer(EnSt* this) { if (this->stunTimer == 0) { return 0; } - this->stunTimer--; // @bug ? no return but v0 ends up being stunTimer before decrement + this->stunTimer--; //! @bug ? no return but v0 ends up being stunTimer before decrement } /** @@ -801,9 +801,9 @@ void EnSt_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.flags |= 0x80; } if (this->actor.params == 1) { - this->actor.naviEnemyId = 5; + this->actor.naviEnemyId = 0x05; } else { - this->actor.naviEnemyId = 4; + this->actor.naviEnemyId = 0x04; } EnSt_CheckCeilingPos(this, globalCtx); this->actor.flags |= 0x4000; diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth_gfx.c b/src/overlays/actors/ovl_En_Sth/z_en_sth_gfx.c index fa61063113..bca6fdec48 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth_gfx.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth_gfx.c @@ -248,7 +248,7 @@ static Vtx D_80B09F30[] = { VTX(332, 65042, 328, 1629, 520, 199, 177, 68, 255), VTX(332, 65042, 65208, 2210, 520, 199, 177, 188, 255), }; -Gfx D_80B0A050[] = { +static Gfx D_80B0A050[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPPipeSync(), gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), @@ -373,7 +373,7 @@ Gfx D_80B0A050[] = { gsSPEndDisplayList(), }; -Gfx D_80B0A3C0[] = { +static Gfx D_80B0A3C0[] = { gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPPipeSync(), gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2), diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 7d72e57bcd..2565e61b7c 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -552,7 +552,7 @@ void func_80B0D590(EnSw* this, GlobalContext* globalCtx) { this->collider.elements[0].info.ocElemFlags = 1; } - Math_ApproachF(&this->actor.scale.x, gSaveContext.nightFlag ? 0.02f : 0.0f, 0.2f, 0.01f); + Math_ApproachF(&this->actor.scale.x, !IS_DAY ? 0.02f : 0.0f, 0.2f, 0.01f); Actor_SetScale(&this->actor, this->actor.scale.x); } diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index 2cc9838ec5..7cf180e0f1 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -79,7 +79,7 @@ void EnSyatekiMan_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_SetScale(&this->actor, 0.01f); SkelAnime_InitFlex(globalCtx, &this->skelAnime, &gObjectOssanSkel, &gObjectOssanAnim_000338, this->jointTable, this->morphTable, 9); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->headRot.z = 20; } this->blinkTimer = 20; @@ -253,7 +253,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, GlobalContext* globalCtx) { case SYATEKI_RESULT_WINNER: this->tempGallery = this->actor.parent; this->actor.parent = NULL; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { if (!(gSaveContext.itemGetInf[0] & 0x2000)) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ Equip_Pachinko ☆☆☆☆☆ %d\n" VT_RST, CUR_UPG_VALUE(UPG_BULLET_BAG)); @@ -322,7 +322,7 @@ void EnSyatekiMan_FinishPrize(EnSyatekiMan* this, GlobalContext* globalCtx) { if ((func_8010BDBC(&globalCtx->msgCtx) == 6) && func_80106BC8(globalCtx)) { // Successful completion osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { gSaveContext.itemGetInf[0] |= 0x2000; } else if ((this->getItemId == GI_QUIVER_40) || (this->getItemId == GI_QUIVER_50)) { gSaveContext.itemGetInf[0] |= 0x4000; diff --git a/src/overlays/actors/ovl_En_Ta/z_en_ta.c b/src/overlays/actors/ovl_En_Ta/z_en_ta.c index 35e444fac3..79fe56090a 100644 --- a/src/overlays/actors/ovl_En_Ta/z_en_ta.c +++ b/src/overlays/actors/ovl_En_Ta/z_en_ta.c @@ -64,13 +64,13 @@ static ColliderCylinderInit sCylinderInit = { { 30, 40, 0, { 0, 0, 0 } }, }; -Vec3f D_80B16E7C = { +static Vec3f D_80B16E7C = { 1100.0f, 1000.0f, 0.0f, }; -UNK_TYPE D_80B16E88[] = { +static void* D_80B16E88[] = { 0x06007F80, 0x06006EC0, 0x060072C0, @@ -121,14 +121,14 @@ void func_80B13AAC(EnTa* this, GlobalContext* globalCtx) { } } -void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { +void EnTa_Init(Actor* thisx, GlobalContext* globalCtx2) { EnTa* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); - SkelAnime_InitFlex(globalCtx2, &this->skelAnime, &D_0600B7B8, &D_06001C94, this->jointTable, this->morphTable, 17); - Collider_InitCylinder(globalCtx2, &this->collider); - Collider_SetCylinder(globalCtx2, &this->collider, &this->actor, &sCylinderInit); + SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600B7B8, &D_06001C94, this->jointTable, this->morphTable, 17); + Collider_InitCylinder(globalCtx, &this->collider); + Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; this->unk_2E0 = 0; @@ -147,7 +147,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(CYAN) " 追放タロン \n" VT_RST); if (gSaveContext.eventChkInf[6] & 0x800) { Actor_Kill(&this->actor); - } else if (LINK_IS_CHILD) { + } else if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); } else if (gSaveContext.eventChkInf[6] & 0x400) { func_80B13AA0(this, func_80B14CAC, func_80B167C0); @@ -166,9 +166,9 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf(VT_FGCOL(CYAN) " 出戻りタロン \n" VT_RST); if (!(gSaveContext.eventChkInf[6] & 0x800)) { Actor_Kill(&this->actor); - } else if (LINK_IS_CHILD) { + } else if (!LINK_IS_ADULT) { Actor_Kill(&this->actor); - } else if (globalCtx2->sceneNum == SCENE_MALON_STABLE && gSaveContext.nightFlag) { + } else if (globalCtx->sceneNum == SCENE_MALON_STABLE && gSaveContext.nightFlag) { Actor_Kill(&this->actor); osSyncPrintf(VT_FGCOL(CYAN) " 夜はいない \n" VT_RST); } else { @@ -180,7 +180,7 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { break; default: osSyncPrintf(VT_FGCOL(CYAN) " その他のタロン \n" VT_RST); - if (globalCtx2->sceneNum == SCENE_SPOT15) { + if (globalCtx->sceneNum == SCENE_SPOT15) { if (gSaveContext.eventChkInf[1] & 0x10) { Actor_Kill(&this->actor); } else if (gSaveContext.eventChkInf[1] & 0x8) { @@ -195,26 +195,26 @@ void EnTa_Init(Actor* thisx, GlobalContext* globalCtx) { this->unk_2E4 = &D_0600CD50; this->actor.shape.shadowScale = 54.0f; } - } else if (globalCtx2->sceneNum == SCENE_SOUKO) { + } else if (globalCtx->sceneNum == SCENE_SOUKO) { osSyncPrintf(VT_FGCOL(CYAN) " ロンロン牧場の倉庫 の タロン\n" VT_RST); if (!(gSaveContext.eventChkInf[1] & 0x10)) { Actor_Kill(&this->actor); } else if (LINK_IS_ADULT) { Actor_Kill(&this->actor); } else { - if (gSaveContext.nightFlag == 0) { + if (IS_DAY) { this->actor.flags |= 0x10; this->unk_2C4[0] = this->unk_2C4[1] = this->unk_2C4[2] = 7; this->unk_2B8[0] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 5.0f, + &globalCtx->actorCtx, globalCtx, ACTOR_EN_NIW, this->actor.world.pos.x + 5.0f, this->actor.world.pos.y + 3.0f, this->actor.world.pos.z + 26.0f, 0, 0, 0, 0xD); this->unk_2B8[1] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x - 20.0f, + &globalCtx->actorCtx, globalCtx, ACTOR_EN_NIW, this->actor.world.pos.x - 20.0f, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); this->unk_2B8[2] = (EnNiw*)Actor_Spawn( - &globalCtx2->actorCtx, globalCtx2, ACTOR_EN_NIW, this->actor.world.pos.x + 20.0f, + &globalCtx->actorCtx, globalCtx, ACTOR_EN_NIW, this->actor.world.pos.x + 20.0f, this->actor.world.pos.y + 40.0f, this->actor.world.pos.z - 30.0f, 0, 0, 0, 0xD); - func_80B13AAC(this, globalCtx2); + func_80B13AAC(this, globalCtx); if (gSaveContext.eventInf[0] & 0x400) { func_80B13AA0(this, func_80B16608, func_80B16938); @@ -295,7 +295,7 @@ void func_80B143D4(EnTa* this, GlobalContext* globalCtx) { } void func_80B14410(EnTa* this) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_80B13AA0(this, func_80B14C18, func_80B167C0); gSaveContext.eventChkInf[1] |= 0x8; } else { diff --git a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index 8393d6bf5c..09fceaec7a 100644 --- a/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -78,7 +78,7 @@ void func_80B176E0(EnTakaraMan* this, GlobalContext* globalCtx) { Animation_Change(&this->skelAnime, &D_06000498, 1.0f, 0.0f, (s16)frameCount, ANIMMODE_LOOP, -10.0f); if (!this->unk_214) { - this->actor.textId = 0x6D; // "Open the chest and..Surprise! ... 10 Rupees to play .. Yes/No" + this->actor.textId = 0x6D; this->dialogState = 4; } this->actionFunc = func_80B1778C; @@ -98,17 +98,17 @@ void func_80B1778C(EnTakaraMan* this, GlobalContext* globalCtx) { } else { yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y; if (globalCtx->roomCtx.curRoom.num == 6 && !this->unk_21A) { - this->actor.textId = 0x6E; // "Great! You are a real gambler!" + this->actor.textId = 0x6E; this->unk_21A = 1; this->dialogState = 6; } if (!this->unk_21A && this->unk_214) { if (Flags_GetSwitch(globalCtx, 0x32)) { - this->actor.textId = 0x84; // "Thanks a lot!" + this->actor.textId = 0x84; this->dialogState = 5; } else { - this->actor.textId = 0x704C; // "With that key, proceed to the room ahead. Go, go!" + this->actor.textId = 0x704C; this->dialogState = 6; } } @@ -142,7 +142,7 @@ void func_80B17934(EnTakaraMan* this, GlobalContext* globalCtx) { this->actionFunc = func_80B17A6C; } else { func_80106CCC(globalCtx); - this->actor.textId = 0x85; // "You don't have enough Rupees!" + this->actor.textId = 0x85; func_8010B720(globalCtx, this->actor.textId); this->dialogState = 5; this->actionFunc = func_80B17B14; @@ -150,7 +150,7 @@ void func_80B17934(EnTakaraMan* this, GlobalContext* globalCtx) { break; case 1: // No func_80106CCC(globalCtx); - this->actor.textId = 0x2D; // "All right. You don't have to play if you don't want to." + this->actor.textId = 0x2D; func_8010B720(globalCtx, this->actor.textId); this->dialogState = 5; this->actionFunc = func_80B17B14; 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 99fefb67df..289f35537c 100644 --- a/src/overlays/actors/ovl_En_Tite/z_en_tite.c +++ b/src/overlays/actors/ovl_En_Tite/z_en_tite.c @@ -165,7 +165,7 @@ static DamageTable sDamageTable[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 69, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x45, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2000, ICHAIN_CONTINUE), ICHAIN_F32(minVelocityY, 65496, ICHAIN_CONTINUE), ICHAIN_F32_DIV1000(gravity, 64536, ICHAIN_STOP), diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 6a07cd47f1..848a39a095 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -493,7 +493,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD || + if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !!LINK_IS_ADULT || globalCtx->sceneNum != SCENE_SPOT02) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c index 18d509bd3a..dcef2b7584 100644 --- a/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c +++ b/src/overlays/actors/ovl_En_Toryo/z_en_toryo.c @@ -112,12 +112,12 @@ void EnToryo_Init(Actor* thisx, GlobalContext* globalCtx) { } break; case SCENE_SPOT01: - if ((LINK_AGE_IN_YEARS == YEARS_CHILD) && (gSaveContext.nightFlag == 0)) { + if ((LINK_AGE_IN_YEARS == YEARS_CHILD) && IS_DAY) { this->stateFlags |= 2; } break; case SCENE_KAKARIKO: - if ((LINK_AGE_IN_YEARS == YEARS_CHILD) && (gSaveContext.nightFlag == 1)) { + if ((LINK_AGE_IN_YEARS == YEARS_CHILD) && IS_NIGHT) { this->stateFlags |= 4; } break; diff --git a/src/overlays/actors/ovl_En_Tp/z_en_tp.c b/src/overlays/actors/ovl_En_Tp/z_en_tp.c index 305567e263..4bbdbe0c3f 100644 --- a/src/overlays/actors/ovl_En_Tp/z_en_tp.c +++ b/src/overlays/actors/ovl_En_Tp/z_en_tp.c @@ -153,7 +153,7 @@ void EnTp_Init(Actor* thisx, GlobalContext* globalCtx2) { Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); if (this->actor.params <= TAILPASARAN_HEAD) { - this->actor.naviEnemyId = 6; + this->actor.naviEnemyId = 0x06; this->timer = 0; this->collider.base.acFlags |= AC_HARD; this->collider.elements->dim.modelSphere.radius = this->collider.elements->dim.worldSphere.radius = 8; diff --git a/src/overlays/actors/ovl_En_Vali/z_en_vali.c b/src/overlays/actors/ovl_En_Vali/z_en_vali.c index f1390f60ca..98c003d2c6 100644 --- a/src/overlays/actors/ovl_En_Vali/z_en_vali.c +++ b/src/overlays/actors/ovl_En_Vali/z_en_vali.c @@ -130,7 +130,7 @@ static DamageTable sDamageTable = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 24, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x18, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 10, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 5000, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 2abc8d858c..1a5f7e13ff 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -164,8 +164,8 @@ void EnVbBall_UpdateBones(EnVbBall* this, GlobalContext* globalCtx) { } } -void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; EnVbBall* this = THIS; BossFd* bossFd = (BossFd*)this->actor.parent; f32 radius; @@ -183,18 +183,18 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { this->actor.gravity = -1.0f; func_8002D7EC(&this->actor); if (this->actor.params >= 200) { - EnVbBall_UpdateBones(this, globalCtx2); + EnVbBall_UpdateBones(this, globalCtx); } else { Math_ApproachF(&this->shadowOpacity, 175.0f, 1.0f, 40.0f); radius = this->actor.scale.y * 1700.0f; this->actor.world.pos.y -= radius; - Actor_UpdateBgCheckInfo(globalCtx2, &this->actor, 50.0f, 50.0f, 100.0f, 4); + Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 50.0f, 50.0f, 100.0f, 4); this->actor.world.pos.y += radius; if ((this->actor.bgCheckFlags & 1) && (this->actor.velocity.y <= 0.0f)) { if ((this->actor.params == 100) || (this->actor.params == 101)) { Actor_Kill(&this->actor); if (this->actor.params == 100) { - func_80033E88(&this->actor, globalCtx2, 5, 0xA); + func_80033E88(&this->actor, globalCtx, 5, 0xA); } if (this->actor.params == 100) { spawnNum = 2; @@ -215,7 +215,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { spawnOffset.y = Rand_ZeroFloat(3.0f) + 4.0f; spawnOffset.z = Rand_CenteredFloat(10.0f); } - newActor = (EnVbBall*)Actor_SpawnAsChild(&globalCtx2->actorCtx, &this->actor, globalCtx2, + newActor = (EnVbBall*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_VB_BALL, this->actor.world.pos.x + spawnOffset.x, this->actor.world.pos.y + spawnOffset.y, this->actor.world.pos.z + spawnOffset.z, 0, 0, @@ -247,7 +247,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { debrisPos1.y = Rand_CenteredFloat(10.0f) + this->actor.world.pos.y; debrisPos1.z = Rand_CenteredFloat(10.0f) + this->actor.world.pos.z; - EnVbBall_SpawnDebris(globalCtx2, bossFd->effects, &debrisPos1, &debrisVel1, &debrisAcc1, + EnVbBall_SpawnDebris(globalCtx, bossFd->effects, &debrisPos1, &debrisVel1, &debrisAcc1, (s16)Rand_ZeroFloat(12.0f) + 15); } for (i = 0; i < 10; i++) { @@ -265,7 +265,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { dustPos.y = Rand_CenteredFloat(30.0f) + this->actor.world.pos.y; dustPos.z = Rand_CenteredFloat(30.0f) + this->actor.world.pos.z; - EnVbBall_SpawnDust(globalCtx2, bossFd->effects, &dustPos, &dustVel, &dustAcc, + EnVbBall_SpawnDust(globalCtx, bossFd->effects, &dustPos, &dustVel, &dustAcc, Rand_ZeroFloat(100.0f) + 350.0f); } } else { @@ -282,7 +282,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { debrisPos2.y = Rand_CenteredFloat(5.0f) + this->actor.world.pos.y; debrisPos2.z = Rand_CenteredFloat(5.0f) + this->actor.world.pos.z; - EnVbBall_SpawnDebris(globalCtx2, bossFd->effects, &debrisPos2, &debrisVel2, &debrisAcc2, + EnVbBall_SpawnDebris(globalCtx, bossFd->effects, &debrisPos2, &debrisVel2, &debrisAcc2, (s16)Rand_ZeroFloat(12.0f) + 15); } Actor_Kill(&this->actor); @@ -295,7 +295,7 @@ void EnVbBall_Update(Actor* thisx, GlobalContext* globalCtx) { Audio_PlayActorSound2(&player->actor, NA_SE_PL_BODY_HIT); } Collider_UpdateCylinder(&this->actor, &this->collider); - CollisionCheck_SetAT(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 5be4c3d607..70ad28862c 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -73,7 +73,7 @@ extern AnimationHeader D_06011348; extern FlexSkeletonHeader D_060114E8; extern FlexSkeletonHeader D_060119E8; -u8 D_80B2CEC0 = false; +static u8 D_80B2CEC0 = false; const ActorInit En_Viewer_InitVars = { ACTOR_EN_VIEWER, @@ -104,7 +104,7 @@ struct_80B2CEE8 D_80B2CEE8[] = { { OBJECT_GANON, OBJECT_GANON, 1, -6, 0, 10, 0, &D_060114E8, &D_06011348 }, }; -EnViewerAnimFunc sAnimFuncs[] = { +static EnViewerAnimFunc sAnimFuncs[] = { func_80B2A300, func_80B2A4D8, func_80B2A300, @@ -118,9 +118,9 @@ static void* sActorShadowDrawFunc[] = { }; // timer -s16 D_80B2CFCC = 0; +static s16 D_80B2CFCC = 0; -Vec3f D_80B2CFD0 = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_80B2CFD0 = { 0.0f, 0.0f, 0.0f }; static EnViewerDrawFunc sDrawFuncs[] = { func_80B2B4A8, @@ -131,9 +131,9 @@ static EnViewerDrawFunc sDrawFuncs[] = { // angl -EnGanonMant* sGanonCape; +static EnGanonMant* sGanonCape; -Vec3f D_80B2D448; +static Vec3f D_80B2D448; void EnViewer_SetupAction(EnViewer* this, EnViewerActionFunc actionFunc) { this->actionFunc = actionFunc; diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 85de6f6779..8f000d8181 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -516,9 +516,9 @@ void EnVm_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec } } -void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx) { +void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx2) { EnVm* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; Vec3f actorPos; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_vm.c", 1014); @@ -538,12 +538,12 @@ void EnVm_Draw(Actor* thisx, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 168); func_80094BC4(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 255, 0); - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[globalCtx2->gameplayFrames % 8])); + gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[globalCtx->gameplayFrames % 8])); gSPDisplayList(POLY_XLU_DISP++, gEffEnemyDeathFlameDL); Matrix_RotateY(32767.0f, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_vm.c", 1044), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[(globalCtx2->gameplayFrames + 4) % 8])); + gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_80B2EB88[(globalCtx->gameplayFrames + 4) % 8])); gSPDisplayList(POLY_XLU_DISP++, gEffEnemyDeathFlameDL); } gSPSegment(POLY_OPA_DISP++, 0x08, func_80094E78(globalCtx->state.gfxCtx, 0, this->beamTexScroll)); diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 15bf24000b..9a4bf00d53 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -113,7 +113,7 @@ static DamageTable sDamageTable = { static InitChainEntry sInitChain[] = { ICHAIN_S8(naviEnemyId, 0x30, 1), - ICHAIN_F32(targetArrowOffset, 0x157C, 1), + ICHAIN_F32(targetArrowOffset, 5500, 1), ICHAIN_F32_DIV1000(gravity, -1500, 0), }; @@ -425,7 +425,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { Player* player = PLAYER; if (Animation_OnFrame(&this->skelAnime, 1.0f) != 0) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S_KID); } else { func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S); @@ -443,14 +443,14 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->actor.world.pos.y = this->actor.world.pos.y + 10.0f; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { player->actor.world.pos.y = this->actor.world.pos.y - 30.0f; } else { player->actor.world.pos.y = this->actor.world.pos.y - 50.0f; } if (this->timer == -0x1E) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY_KID); } else { func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY); @@ -462,7 +462,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) { this->timer = this->timer + 2; } else { - Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f); + Math_StepToF(&this->actor.world.pos.y, player->actor.world.pos.y + (!LINK_IS_ADULT ? 30.0f : 50.0f), 5.0f); } Math_StepToF(&this->actor.world.pos.x, player->actor.world.pos.x, 3.0f); diff --git a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c index d41ebf84ab..2628ae2933 100644 --- a/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c +++ b/src/overlays/actors/ovl_En_Weiyer/z_en_weiyer.c @@ -59,7 +59,9 @@ static ColliderCylinderInit sCylinderInit = { }, { 16, 10, -6, { 0, 0, 0 } }, }; + static CollisionCheckInfoInit sColChkInfoInit = { 2, 45, 15, 100 }; + static DamageTable sDamageTable = { /* Deku nut */ DMG_ENTRY(0, 0x1), /* Deku stick */ DMG_ENTRY(2, 0x0), @@ -95,7 +97,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 25, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x19, ICHAIN_CONTINUE), ICHAIN_VEC3F_DIV1000(scale, 3, ICHAIN_CONTINUE), ICHAIN_F32(targetArrowOffset, 2500, ICHAIN_STOP), }; @@ -181,7 +183,7 @@ void func_80B32660(EnWeiyer* this) { this->actor.speedXZ = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = -1.0f; - this->collider.dim.height = sCylinderInit.dim.height + 0xF; + this->collider.dim.height = sCylinderInit.dim.height + 15; Actor_SetColorFilter(&this->actor, 0, 0xC8, 0, 0x50); this->collider.base.atFlags &= ~AT_ON; Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 2ecf6dadaa..c6117b90a9 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -69,7 +69,7 @@ void func_80B391CC(EnWonderTalk* this, GlobalContext* globalCtx) { this->unk_15C = 80.0f; // Attention coordinates osSyncPrintf(VT_FGCOL(PURPLE) "☆☆☆☆☆ 注目座標\t \t☆☆☆☆☆ %f\n" VT_RST, 0.0f); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->actor.textId = 0x7040; // Children osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ こども ☆☆☆☆☆ \n" VT_RST); @@ -189,7 +189,7 @@ void func_80B395F0(EnWonderTalk* this, GlobalContext* globalCtx) { case 2: switch (globalCtx->msgCtx.choiceIndex) { case 0: - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { // I'm still a child! osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ まだコドモなの! ☆☆☆☆☆ \n" VT_RST); this->actor.textId = 0x5001; diff --git a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c index 8723f968db..6d772e7cfd 100644 --- a/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c +++ b/src/overlays/actors/ovl_En_Yabusame_Mark/z_en_yabusame_mark.c @@ -54,7 +54,7 @@ static Vec3f sCollisionVertices[] = { { 115.0f, 160.0f, -150.0f }, { -50.0f, -140.0f, -160.0f }, { 115.0f, 160.0f, 150.0f }, { -50.0f, -140.0f, 160.0f }, }; -Vec3f D_80B435F0[] = { +static Vec3f D_80B435F0[] = { { 3382.0f, 1734.0f, -4946.0f }, // small, furthest from entrance { 3360.0f, 1734.0f, 495.0f }, // small, closest to entrance { 4517.0f, 1682.0f, -1779.0f }, // medium, on the right @@ -67,9 +67,9 @@ typedef struct { /* 0x04 */ f32 unk_4; // second ring /* 0x08 */ f32 unk_8; // outside edge /* 0x0C */ f32 unk_C; -} unknownStruct; // size = 0x10 +} YabasumeUnkStruct; // size = 0x10 -unknownStruct D_80B4362C[] = { +static YabasumeUnkStruct D_80B4362C[] = { { 20.0f, 40.0f, 60.0f, 777.0f }, { 40.0f, 80.0f, 120.0f, 777.0f }, { 40.0f, 120.0f, 160.0f, 777.0f }, diff --git a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c index e57cfb8fed..9b2c75d71e 100644 --- a/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c +++ b/src/overlays/actors/ovl_En_Zl1/z_en_zl1_cutscene_data.c @@ -2,7 +2,7 @@ #include "z64cutscene_commands.h" // clang-format off -CutsceneData D_80B4C5D0[] = { +static CutsceneData D_80B4C5D0[] = { CS_BEGIN_CUTSCENE(28, 3000), CS_PLAYER_ACTION_LIST(3), CS_PLAYER_ACTION(0x0005, 400, 1211, 0x0000, 0xC000, 0x0000, -422, 84, 1, -422, 84, 1, 1.1266861702801002e-29f, 0.0f, 1.401298464324817e-45f), @@ -247,7 +247,7 @@ CutsceneData D_80B4C5D0[] = { }; // clang-format on -CutsceneCameraAngle D_80B4D5C0[] = { +static CutsceneCameraAngle D_80B4D5C0[] = { { { -440.0f, 117.0f, 0.0f }, { -490.0f, 120.0f, 0.0f }, 0, 45 }, { { -484.0f, 122.0f, -29.0f }, { -480.0f, 116.0f, 18.0f }, 0, 80 }, { { -413.0f, 136.0f, -72.0f }, { -403.0f, 141.0f, -89.0f }, 0, 25 }, @@ -262,33 +262,33 @@ CutsceneCameraAngle D_80B4D5C0[] = { { { -491.0f, 120.0f, -7.0f }, { -509.0f, 115.0f, -7.0f }, 0, 75 }, { { -485.0f, 120.0f, -42.0f }, { -484.0f, 120.0f, 10.0f }, 0, 45 }, }; -CutsceneCameraPoint D_80B4D72C[] = { +static CutsceneCameraPoint D_80B4D72C[] = { { 0, 0, 20, 80.79987f, { -484, 122, -29 } }, { 0, 0, 20, 80.79987f, { -484, 122, -29 } }, { 0, 0, 20, 80.79987f, { -484, 122, -29 } }, { 0, 0, 20, 80.79987f, { -452, 121, -21 } }, { 0, 0, 20, 80.79987f, { -452, 121, -21 } }, { 0, 0, 20, 80.79987f, { -452, 121, -21 } }, { -1, 0, 20, 80.79987f, { -452, 121, -21 } }, { -1, 0, 30, 80.79987f, { -452, 121, -21 } }, }; -CutsceneCameraPoint D_80B4D7AC[] = { +static CutsceneCameraPoint D_80B4D7AC[] = { { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { 0, 0, 0, 80.79987f, { -480, 116, 18 } }, { -1, 0, 0, 80.79987f, { -480, 116, 18 } }, { -1, 0, 0, 80.79987f, { -480, 116, 18 } }, }; -CutsceneCameraPoint D_80B4D82C[] = { +static CutsceneCameraPoint D_80B4D82C[] = { { 0, 0, 20, 45.200058f, { -439, 116, 0 } }, { 0, 0, 20, 45.200058f, { -439, 116, 0 } }, { 0, 0, 20, 50.60008f, { -433, 116, 0 } }, { 0, 0, 20, 55.600098f, { -431, 116, 0 } }, { 0, 0, 20, 60.000114f, { -427, 116, 0 } }, { 0, 0, 20, 65.000114f, { -424, 116, 0 } }, { 0, 0, 20, 70.800026f, { -422, 116, 0 } }, { 0, 0, 20, 75.59995f, { -419, 115, 0 } }, { -1, 0, 20, 75.59995f, { -419, 116, 0 } }, { -1, 0, 30, 75.59995f, { -419, 115, 0 } }, }; -CutsceneCameraPoint D_80B4D8CC[] = { +static CutsceneCameraPoint D_80B4D8CC[] = { { 0, 0, 0, 60.400116f, { -480, 114, 0 } }, { 0, 0, 0, 45.200058f, { -480, 114, 0 } }, { 0, 0, 0, 45.200058f, { -474, 114, 0 } }, { 0, 0, 0, 50.60008f, { -472, 114, 0 } }, { 0, 0, 0, 55.600098f, { -468, 114, 0 } }, { 0, 0, 0, 60.000114f, { -465, 114, 0 } }, { 0, 0, 0, 65.000114f, { -463, 114, 0 } }, { 0, 0, 0, 70.800026f, { -460, 114, 0 } }, { -1, 0, 0, 75.59995f, { -460, 114, 0 } }, { -1, 0, 0, 75.59995f, { -460, 114, 0 } }, }; -CutsceneCameraPoint D_80B4D96C[] = { +static CutsceneCameraPoint D_80B4D96C[] = { { 0, 0, 25, 60.000114f, { -116, 50, 469 } }, { 0, 0, 25, 60.000114f, { -116, 50, 469 } }, { 0, 0, 25, 60.000114f, { -118, 50, 467 } }, { 0, 0, 25, 60.000114f, { -120, 50, 465 } }, { 0, 0, 25, 60.000114f, { -123, 50, 464 } }, { 0, 0, 25, 60.000114f, { -126, 50, 463 } }, @@ -297,7 +297,7 @@ CutsceneCameraPoint D_80B4D96C[] = { { 0, 0, 25, 60.000114f, { -140, 50, 466 } }, { 0, 0, 25, 60.000114f, { -140, 50, 466 } }, { -1, 0, 25, 60.000114f, { -140, 50, 466 } }, { -1, 0, 25, 60.000114f, { -140, 50, 466 } }, }; -CutsceneCameraPoint D_80B4DA4C[] = { +static CutsceneCameraPoint D_80B4DA4C[] = { { 0, 0, 0, 20.399963f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, @@ -306,21 +306,21 @@ CutsceneCameraPoint D_80B4DA4C[] = { { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { 0, 0, 0, 60.000114f, { -130, 50, 480 } }, { -1, 0, 0, 60.000114f, { -130, 50, 480 } }, { -1, 0, 0, 60.000114f, { -130, 50, 480 } }, }; -CutsceneCameraPoint D_80B4DB2C[] = { +static CutsceneCameraPoint D_80B4DB2C[] = { { 0, 0, 30, 20.799965f, { -427, 116, 4 } }, { 0, 0, 30, 20.799965f, { -426, 115, 4 } }, { 0, 0, 30, 20.799965f, { -429, 115, 7 } }, { 0, 0, 30, 20.799965f, { -428, 114, 12 } }, { 0, 0, 30, 20.799965f, { -430, 114, 14 } }, { 0, 0, 30, 20.799965f, { -430, 114, 14 } }, { 0, 0, 30, 20.799965f, { -430, 114, 14 } }, { -1, 0, 30, 20.799965f, { -430, 112, 14 } }, { -1, 0, 30, 20.799965f, { -430, 112, 14 } }, }; -CutsceneCameraPoint D_80B4DBBC[] = { +static CutsceneCameraPoint D_80B4DBBC[] = { { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { 0, 0, 0, 20.799965f, { -389, 109, 36 } }, { -1, 0, 0, 20.799965f, { -389, 109, 36 } }, { -1, 0, 0, 20.799965f, { -389, 109, 36 } }, }; -CutsceneCameraPoint D_80B4DC4C[] = { +static CutsceneCameraPoint D_80B4DC4C[] = { { 0, 0, 30, 45.0f, { -496, 119, 0 } }, { 0, 0, 30, 45.0f, { -496, 119, 0 } }, { 0, 0, 30, 45.0f, { -496, 119, 0 } }, { 0, 0, 15, 45.0f, { -496, 119, 0 } }, { 0, 0, 15, 45.80006f, { -471, 122, 0 } }, { 0, 0, 15, 45.80006f, { -395, 139, 0 } }, @@ -330,7 +330,7 @@ CutsceneCameraPoint D_80B4DC4C[] = { { 0, 0, 30, 45.80006f, { 429, 328, 0 } }, { -1, 0, 30, 45.80006f, { 429, 328, 0 } }, { -1, 0, 30, 45.80006f, { 429, 328, 0 } }, }; -CutsceneCameraPoint D_80B4DD3C[] = { +static CutsceneCameraPoint D_80B4DD3C[] = { { 0, 0, 0, 45.0f, { -443, 115, 0 } }, { 0, 0, 0, 45.0f, { -443, 115, 0 } }, { 0, 0, 0, 45.0f, { -443, 115, 0 } }, { 0, 0, 0, 45.0f, { -443, 115, 0 } }, { 0, 0, 0, 45.80006f, { -420, 133, 0 } }, { 0, 0, 0, 45.80006f, { -344, 150, 0 } }, @@ -340,7 +340,7 @@ CutsceneCameraPoint D_80B4DD3C[] = { { 0, 0, 0, 45.80006f, { 482, 332, 0 } }, { -1, 0, 0, 45.80006f, { 482, 332, 0 } }, { -1, 0, 0, 45.80006f, { 482, 332, 0 } }, }; -CutsceneCameraPoint D_80B4DE2C[] = { +static CutsceneCameraPoint D_80B4DE2C[] = { { 0, 0, 25, 60.600117f, { 66, 404, 425 } }, { 0, 0, 25, 60.400116f, { 66, 404, 425 } }, { 0, 0, 25, 55.600098f, { 66, 404, 426 } }, { 0, 0, 25, 55.200096f, { 63, 373, 413 } }, { 0, 0, 25, 50.400078f, { 26, 353, 408 } }, { 0, 0, 25, 50.400078f, { 17, 325, 397 } }, @@ -349,7 +349,7 @@ CutsceneCameraPoint D_80B4DE2C[] = { { 0, 0, 25, 35.20002f, { -377, 108, 65 } }, { 0, 0, 25, 35.20002f, { -377, 108, 65 } }, { -1, 0, 30, 30.2f, { -376, 108, 65 } }, { -1, 0, 30, 30.2f, { -376, 108, 65 } }, }; -CutsceneCameraPoint D_80B4DF0C[] = { +static CutsceneCameraPoint D_80B4DF0C[] = { { 0, 0, 0, 45.80006f, { 29, 383, 445 } }, { 0, 0, 0, 45.80006f, { 29, 383, 445 } }, { 0, 0, 0, 45.80006f, { 29, 383, 445 } }, { 0, 0, 0, 45.80006f, { 29, 383, 445 } }, { 0, 0, 0, 45.80006f, { 29, 383, 445 } }, { 0, 0, 0, 45.80006f, { 49, 347, 424 } }, @@ -358,71 +358,71 @@ CutsceneCameraPoint D_80B4DF0C[] = { { 0, 0, 0, 30.2f, { -345, 109, 96 } }, { 0, 0, 0, 30.2f, { -345, 109, 96 } }, { -1, 0, 0, 30.2f, { -345, 109, 96 } }, { -1, 0, 0, 30.2f, { -345, 109, 96 } }, }; -CutsceneCameraPoint D_80B4DFEC[] = { +static CutsceneCameraPoint D_80B4DFEC[] = { { 0, 0, 10, 30.0f, { -482, 119, 0 } }, { 0, 0, 10, 30.0f, { -482, 119, 0 } }, { 0, 0, 10, 30.0f, { -482, 119, 0 } }, { 0, 0, 10, 30.800003f, { -482, 119, 0 } }, { 0, 0, 10, 30.800003f, { -482, 119, 0 } }, { 0, 0, 10, 30.800003f, { -462, 126, 0 } }, { 0, 0, 30, 30.800003f, { -395, 150, 0 } }, { 0, 0, 30, 30.800003f, { -395, 150, 0 } }, { -1, 0, 30, 30.800003f, { -395, 150, 0 } }, { -1, 0, 30, 30.800003f, { -395, 150, 0 } }, }; -CutsceneCameraPoint D_80B4E08C[] = { +static CutsceneCameraPoint D_80B4E08C[] = { { 0, 0, 0, 30.0f, { -440, 115, 0 } }, { 0, 0, 0, 30.0f, { -440, 115, 0 } }, { 0, 0, 0, 30.0f, { -440, 115, 0 } }, { 0, 0, 0, 30.800003f, { -440, 115, 0 } }, { 0, 0, 0, 30.800003f, { -440, 115, 0 } }, { 0, 0, 0, 30.800003f, { -423, 142, 0 } }, { 0, 0, 0, 30.800003f, { -358, 171, 0 } }, { 0, 0, 0, 30.800003f, { -358, 171, 0 } }, { -1, 0, 0, 30.800003f, { -358, 171, 0 } }, { -1, 0, 0, 30.800003f, { -358, 171, 0 } }, }; -CutsceneCameraPoint D_80B4E12C[] = { +static CutsceneCameraPoint D_80B4E12C[] = { { 0, 0, 30, 25.0f, { -551, 119, 7 } }, { 0, 0, 30, 25.0f, { -551, 119, 7 } }, { 0, 0, 15, 25.0f, { -551, 119, 7 } }, { 0, 0, 15, 60.0f, { -485, 120, -7 } }, { 0, 0, 30, 60.0f, { -485, 120, -7 } }, { 0, 0, 30, 60.0f, { -485, 120, -7 } }, { 0, 0, 30, 60.0f, { -485, 118, -5 } }, { -1, 0, 30, 60.0f, { -485, 119, -6 } }, { -1, 0, 30, 60.0f, { -485, 119, -6 } }, }; -CutsceneCameraPoint D_80B4E1BC[] = { +static CutsceneCameraPoint D_80B4E1BC[] = { { 0, 0, 0, 45.200058f, { -587, 115, 14 } }, { 0, 0, 0, 25.400097f, { -587, 115, 14 } }, { 0, 0, 0, 25.400097f, { -587, 115, 14 } }, { 0, 0, 0, 60.20023f, { -521, 117, -1 } }, { 0, 0, 0, 60.20023f, { -521, 117, -1 } }, { 0, 0, 0, 60.20023f, { -521, 117, -1 } }, { 0, 0, 0, 60.20023f, { -521, 117, -1 } }, { -1, 0, 0, 60.20023f, { -521, 116, 0 } }, { -1, 0, 0, 60.19925f, { -521, 116, 0 } }, }; -CutsceneCameraPoint D_80B4E24C[] = { +static CutsceneCameraPoint D_80B4E24C[] = { { 0, 0, 30, 60.000114f, { 75, 52, 50 } }, { 0, 0, 30, 60.000114f, { 75, 52, 48 } }, { 0, 0, 60, 60.000114f, { 74, 52, 45 } }, { 0, 0, 60, 60.000114f, { 49, 51, -43 } }, { 0, 0, 30, 60.000114f, { 49, 51, -43 } }, { 0, 0, 30, 60.000114f, { 49, 51, -43 } }, { -1, 0, 30, 60.000114f, { 49, 51, -43 } }, { -1, 0, 30, 60.000114f, { 49, 51, -43 } }, }; -CutsceneCameraPoint D_80B4E2CC[] = { +static CutsceneCameraPoint D_80B4E2CC[] = { { 0, 0, 0, 60.000114f, { 90, 52, 53 } }, { 0, 0, 0, 60.000114f, { 90, 52, 50 } }, { 0, 0, 0, 60.000114f, { 90, 52, 45 } }, { 0, 0, 0, 60.000114f, { 65, 51, -44 } }, { 0, 0, 0, 60.000114f, { 65, 51, -44 } }, { 0, 0, 0, 60.000114f, { 65, 51, -44 } }, { -1, 0, 0, 60.000114f, { 65, 51, -44 } }, { -1, 0, 0, 60.000114f, { 65, 51, -44 } }, }; -CutsceneCameraPoint D_80B4E34C[] = { +static CutsceneCameraPoint D_80B4E34C[] = { { 0, 0, 31, 60.000114f, { -449, 121, -19 } }, { 0, 0, 30, 60.000114f, { -449, 121, -19 } }, { 0, 0, 30, 60.000114f, { -449, 121, -19 } }, { 0, 0, 30, 60.000114f, { -456, 110, -17 } }, { 0, 0, 30, 60.000114f, { -456, 110, -17 } }, { 0, 0, 30, 60.000114f, { -456, 110, -17 } }, { -1, 0, 30, 60.000114f, { -456, 110, -17 } }, { -1, 0, 30, 60.000114f, { -456, 110, -17 } }, }; -CutsceneCameraPoint D_80B4E3CC[] = { +static CutsceneCameraPoint D_80B4E3CC[] = { { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { 0, 0, 0, 60.000114f, { -441, 107, -22 } }, { -1, 0, 0, 60.000114f, { -441, 107, -22 } }, { -1, 0, 0, 60.000114f, { -441, 107, -22 } }, }; -CutsceneCameraPoint D_80B4E44C[] = { +static CutsceneCameraPoint D_80B4E44C[] = { { 0, 0, 30, 20.799965f, { -331, 110, -91 } }, { 0, 0, 30, 20.799965f, { -331, 110, -91 } }, { 0, 0, 30, 20.799965f, { -331, 110, -91 } }, { 0, 0, 30, 20.799965f, { -511, 121, 7 } }, { 0, 0, 30, 20.799965f, { -511, 121, 7 } }, { 0, 0, 30, 20.799965f, { -511, 121, 7 } }, { -1, 0, 30, 20.799965f, { -511, 121, 7 } }, { -1, 0, 30, 20.799965f, { -511, 121, 7 } }, }; -CutsceneCameraPoint D_80B4E4CC[] = { +static CutsceneCameraPoint D_80B4E4CC[] = { { 0, 0, 0, 20.799965f, { -369, 110, -70 } }, { 0, 0, 0, 20.799965f, { -369, 110, -70 } }, { 0, 0, 0, 20.799965f, { -369, 110, -70 } }, { 0, 0, 0, 20.799965f, { -549, 124, 29 } }, { 0, 0, 0, 20.799965f, { -549, 124, 29 } }, { 0, 0, 0, 20.799965f, { -549, 124, 29 } }, { -1, 0, 0, 20.799965f, { -549, 124, 29 } }, { -1, 0, 0, 20.799965f, { -549, 124, 29 } }, }; -CutsceneCameraMove D_80B4E54C[] = { +static CutsceneCameraMove D_80B4E54C[] = { { D_80B4D72C, D_80B4D7AC, 0 }, { D_80B4D82C, D_80B4D8CC, 0 }, { D_80B4D96C, D_80B4DA4C, 0 }, { D_80B4DB2C, D_80B4DBBC, 0 }, { D_80B4DC4C, D_80B4DD3C, 0 }, { D_80B4DE2C, D_80B4DF0C, 0 }, { D_80B4DFEC, D_80B4E08C, 0 }, { D_80B4E12C, D_80B4E1BC, 0 }, { D_80B4E24C, D_80B4E2CC, 0 }, 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 48fd99eac7..7e3b35cdd7 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -46,25 +46,25 @@ static void* sEyeTextures[] = { gZelda2EyeOpenTex, gZelda2EyeHalfTex, gZelda2Eye static void* sMouthTextures[] = { gZelda2MouthSeriousTex, gZelda2MouthHappyTex, gZelda2MouthOpenTex }; -s32 D_80B5A468 = 0; +static s32 D_80B5A468 = 0; -Vec3f D_80B5A46C = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_80B5A46C = { 0.0f, 0.0f, 0.0f }; -Vec3f D_80B5A478 = { 0.0f, 10.0f, 0.0f }; +static Vec3f D_80B5A478 = { 0.0f, 10.0f, 0.0f }; -f32 D_80B5A484 = 0.0f; +static f32 D_80B5A484 = 0.0f; -Vec3f D_80B5A488 = { 0.0f, 0.0f, 0.0f }; +static Vec3f D_80B5A488 = { 0.0f, 0.0f, 0.0f }; -s32 D_80B5A494 = -1; +static s32 D_80B5A494 = -1; -Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; +static Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; -Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; +static Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; -Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; +static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; -u32 D_80B5A4BC = 0; +static u32 D_80B5A4BC = 0; void func_80B533B0(Actor* thisx, GlobalContext* globalCtx) { EnZl3* this = THIS; diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 50a1175bfc..d9d81f24d6 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -498,7 +498,7 @@ void EnZo_Dialog(EnZo* this, GlobalContext* globalCtx) { this->unk_194.unk_18 = player->actor.world.pos; if (this->actionFunc == EnZo_Standing) { // Look down at link if young, look up if old - this->unk_194.unk_14 = LINK_IS_CHILD ? 10.0f : -10.0f; + this->unk_194.unk_14 = !LINK_IS_ADULT ? 10.0f : -10.0f; } else { this->unk_194.unk_18.y = this->actor.world.pos.y; } diff --git a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index 713d04ca2c..dcda6aa195 100644 --- a/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -68,7 +68,7 @@ static EnfHGPainting sPaintings[] = { }; static InitChainEntry sInitChain[] = { - ICHAIN_S8(naviEnemyId, 26, ICHAIN_CONTINUE), + ICHAIN_S8(naviEnemyId, 0x1A, ICHAIN_CONTINUE), ICHAIN_F32(uncullZoneScale, 1200, ICHAIN_STOP), }; diff --git a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c index 7a0125fe9f..644609c355 100644 --- a/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c +++ b/src/overlays/actors/ovl_Magic_Dark/z_magic_dark.c @@ -41,7 +41,7 @@ void MagicDark_Init(Actor* thisx, GlobalContext* globalCtx) { MagicDark* this = THIS; Player* player = PLAYER; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { this->scale = 0.4f; } else { this->scale = 0.6f; diff --git a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c index d665e4a99d..86231c92dd 100644 --- a/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c +++ b/src/overlays/actors/ovl_Magic_Wind/z_magic_wind_gfx.c @@ -1,6 +1,6 @@ #include "global.h" -Vtx sCylinderVtx[] = { +static Vtx sCylinderVtx[] = { VTX(0, 0, -6000, 1024, 2048, 0xFF, 0xFF, 0xFF, 0xFF), VTX(-4243, 12800, -4243, 1280, 0, 0xFF, 0xFF, 0xFF, 0x00), VTX(0, 12800, -6000, 1024, 0, 0xFF, 0xFF, 0xFF, 0x00), @@ -41,7 +41,7 @@ Vtx sCylinderVtx[] = { VTX(0, 0, 6000, 2048, 2048, 0xFF, 0xFF, 0xFF, 0xFF), }; -char sWindEffTexture[] = { +static char sWindEffTexture[] = { 0x06, 0x19, 0x28, 0x43, 0x66, 0x82, 0xA0, 0xAE, 0xA3, 0x93, 0x76, 0x56, 0x32, 0x12, 0x00, 0x00, 0x03, 0x15, 0x25, 0x39, 0x57, 0x81, 0xAD, 0xBC, 0xA4, 0x7B, 0x5D, 0x45, 0x33, 0x20, 0x24, 0x38, 0x33, 0x1F, 0x26, 0x4F, 0x71, 0x8C, 0xB2, 0xC9, 0xC7, 0xAE, 0x87, 0x57, 0x33, 0x24, 0x11, 0x00, 0x00, 0x05, 0x1C, 0x3B, 0x5E, 0x7D, 0x90, 0x93, 0x85, @@ -260,7 +260,7 @@ char sWindEffTexture[] = { 0x78, 0x8C, 0x8F, 0x86, 0x73, 0x72, 0x82, 0x83, 0x4E, 0x12, 0x00, }; -Gfx sInnerCylinderDList[] = { +static Gfx sInnerCylinderDList[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), @@ -287,7 +287,7 @@ Gfx sInnerCylinderDList[] = { gsSPEndDisplayList(), }; -Gfx sOuterCylinderDList[] = { +static Gfx sOuterCylinderDList[] = { gsDPPipeSync(), gsDPSetTextureLUT(G_TT_NONE), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index aa7a90859a..f35c1a6134 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -44,7 +44,7 @@ const ActorInit Mir_Ray_InitVars = { (ActorFunc)MirRay_Draw, }; -u8 D_80B8E670 = 0; +static u8 D_80B8E670 = 0; static ColliderQuadInit sQuadInit = { { diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 5ead8936d8..58b083e5c5 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -54,10 +54,10 @@ static ColliderCylinderInit sCylinderInit = { static CollisionCheckInfoInit sColChkInfoInit = { 0, 12, 60, MASS_IMMOVABLE }; static InitChainEntry sInitChain[] = { - ICHAIN_VEC3F_DIV1000(scale, 0x64, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneForward, 0x7D0, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneScale, 0x15E, ICHAIN_CONTINUE), - ICHAIN_F32(uncullZoneDownward, 0x3E8, ICHAIN_STOP), + ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneForward, 2000, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneScale, 350, ICHAIN_CONTINUE), + ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_STOP), }; static s16 sEffectScales[] = { diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 843afa24a8..1612142ea8 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -159,11 +159,11 @@ void ObjHamishi_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.shape.yOffset = 80.0f; } -void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void ObjHamishi_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; ObjHamishi* this = THIS; - Collider_DestroyCylinder(globalCtx2, &this->collider); + Collider_DestroyCylinder(globalCtx, &this->collider); } void ObjHamishi_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index ae6d9d9e82..bcd7699e21 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -212,11 +212,11 @@ void ObjLightswitch_Init(Actor* thisx, GlobalContext* globalCtx) { osSyncPrintf("(光スイッチ)(arg_data 0x%04x)\n", this->actor.params); } -void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx) { - GlobalContext* globalCtx2 = globalCtx; +void ObjLightswitch_Destroy(Actor* thisx, GlobalContext* globalCtx2) { + GlobalContext* globalCtx = globalCtx2; ObjLightswitch* this = THIS; - Collider_DestroyJntSph(globalCtx2, &this->collider); + Collider_DestroyJntSph(globalCtx, &this->collider); } void ObjLightswitch_SetupOff(ObjLightswitch* this) { @@ -375,15 +375,15 @@ void ObjLightswitch_Disappear(ObjLightswitch* this, GlobalContext* globalCtx) { } } -void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) { +void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx2) { ObjLightswitch* this = THIS; - GlobalContext* globalCtx2 = globalCtx; + GlobalContext* globalCtx = globalCtx2; if (this->toggleDelay > 0) { this->toggleDelay--; } - this->actionFunc(this, globalCtx2); + this->actionFunc(this, globalCtx); if (this->actor.update != NULL) { if ((this->actor.params & 1) == 1) { @@ -395,8 +395,8 @@ void ObjLightswitch_Update(Actor* thisx, GlobalContext* globalCtx) { this->prevFrameACflags = this->collider.base.acFlags; this->collider.base.acFlags &= ~AC_HIT; - CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); - CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base); + CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); + CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); } } diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 19b7f74b7a..e5efe8740f 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -32,10 +32,10 @@ void ObjTsubo_LiftedUp(ObjTsubo* this, GlobalContext* globalCtx); void ObjTsubo_SetupThrown(ObjTsubo* this); void ObjTsubo_Thrown(ObjTsubo* this, GlobalContext* globalCtx); -s16 D_80BA1B50 = 0; -s16 D_80BA1B54 = 0; -s16 D_80BA1B58 = 0; -s16 D_80BA1B5C = 0; +static s16 D_80BA1B50 = 0; +static s16 D_80BA1B54 = 0; +static s16 D_80BA1B58 = 0; +static s16 D_80BA1B5C = 0; const ActorInit Obj_Tsubo_InitVars = { ACTOR_OBJ_TSUBO, diff --git a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c index 7d380c55fb..d74ed07143 100644 --- a/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c +++ b/src/overlays/actors/ovl_Oceff_Storm/z_oceff_storm.c @@ -112,7 +112,7 @@ void OceffStorm_UnkAction(OceffStorm* this, GlobalContext* globalCtx) { if (this->primColorAlpha < 100) { this->primColorAlpha += 5; } - // ! @bug Actor_Kill is never called so the actor will stay alive forever + //! @bug Actor_Kill is never called so the actor will stay alive forever } void OceffStorm_Update(Actor* thisx, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c index fa850c5a14..fd91a7aee6 100644 --- a/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c +++ b/src/overlays/actors/ovl_Oceff_Wipe/z_oceff_wipe.c @@ -30,7 +30,7 @@ const ActorInit Oceff_Wipe_InitVars = { #include "z_oceff_wipe_gfx.c" -u8 sOceffWipeAlphaIndices[] = { +static u8 sOceffWipeAlphaIndices[] = { 0x01, 0x10, 0x22, 0x01, 0x20, 0x12, 0x01, 0x20, 0x12, 0x01, 0x10, 0x22, 0x01, 0x20, 0x12, 0x01, 0x12, 0x21, 0x01, 0x02, }; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 65b6c1f732..3bb1ea242a 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -1461,7 +1461,7 @@ void func_80832E48(Player* this, s32 flags) { SkelAnime_UpdateTranslation(&this->skelAnime, &pos, this->actor.shape.rot.y); if (flags & 1) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { pos.x *= 0.64f; pos.z *= 0.64f; } @@ -4162,8 +4162,8 @@ s32 func_80839800(Player* this, GlobalContext* globalCtx) { // are common across the two actors' structs however most other variables are not! door = (EnDoor*)doorActor; - door->animStyle = (doorDirection < 0.0f) ? ((LINK_IS_ADULT) ? KNOB_ANIM_ADULT_L : KNOB_ANIM_CHILD_L) - : ((LINK_IS_ADULT) ? KNOB_ANIM_ADULT_R : KNOB_ANIM_CHILD_R); + door->animStyle = (doorDirection < 0.0f) ? (LINK_IS_ADULT ? KNOB_ANIM_ADULT_L : KNOB_ANIM_CHILD_L) + : (LINK_IS_ADULT ? KNOB_ANIM_ADULT_R : KNOB_ANIM_CHILD_R); if (door->animStyle == KNOB_ANIM_ADULT_L) { sp5C = D_808539EC[this->modelAnimType]; @@ -4751,11 +4751,11 @@ s32 func_8083B040(Player* this, GlobalContext* globalCtx) { this->unk_664 = this->targetActor; } else if (sp2C == EXCH_ITEM_LETTER_RUTO) { this->unk_84F = 1; - this->actor.textId = 0x4005; // "There is something already inside this bottle..." + this->actor.textId = 0x4005; func_80835EA4(globalCtx, 1); } else { this->unk_84F = 2; - this->actor.textId = 0xCF; // "This item doesn't work here..." + this->actor.textId = 0xCF; func_80835EA4(globalCtx, 4); } @@ -6127,7 +6127,7 @@ s32 func_8083F0C8(Player* this, GlobalContext* globalCtx, u32 arg2) { f32 phi_f12; s32 i; - if (LINK_IS_CHILD && !(this->stateFlags1 & 0x8000000) && (arg2 & 0x30)) { + if (!LINK_IS_ADULT && !(this->stateFlags1 & 0x8000000) && (arg2 & 0x30)) { wallPoly = this->actor.wallPoly; CollisionPoly_GetVerticesByBgId(wallPoly, this->actor.wallBgId, &globalCtx->colCtx, sp50); @@ -8444,7 +8444,7 @@ void func_80845668(Player* this, GlobalContext* globalCtx) { temp1 *= 0.072f; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { temp1 += 1.0f; } @@ -9800,7 +9800,6 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) { flameIntensity = CLAMP(flameIntensity, 0.0f, 1.0f); EffectSsFireTail_SpawnFlameOnPlayer(globalCtx, flameScale, i, flameIntensity); } - } if (spawnedFlame) { @@ -11983,7 +11982,7 @@ void func_8084E6D4(Player* this, GlobalContext* globalCtx) { } } else { if (this->unk_850 == 0) { - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_80832924(this, D_808549E0); } return; @@ -12028,7 +12027,7 @@ void func_8084E9AC(Player* this, GlobalContext* globalCtx) { return; } - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_80832924(this, D_808549F4); } else { func_8084E988(this); @@ -13511,12 +13510,12 @@ void func_80851A50(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg LinkAnimation_Update(globalCtx, &this->skelAnime); - if (((LINK_IS_ADULT) && LinkAnimation_OnFrame(&this->skelAnime, 70.0f)) || - ((LINK_IS_CHILD) && LinkAnimation_OnFrame(&this->skelAnime, 87.0f))) { + if ((LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 70.0f)) || + (!LINK_IS_ADULT && LinkAnimation_OnFrame(&this->skelAnime, 87.0f))) { sp2C = &D_808551A4[gSaveContext.linkAge]; this->interactRangeActor->parent = &this->actor; - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { dLists = D_80125DE8; } else { dLists = D_80125E18; @@ -13524,7 +13523,7 @@ void func_80851A50(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg this->leftHandDLists = &dLists[gSaveContext.linkAge]; func_8002F7DC(&this->actor, sp2C->unk_00); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { func_80832698(this, sp2C->unk_02); } } else if (LINK_IS_ADULT) { @@ -13913,7 +13912,7 @@ void func_80852944(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg void func_808529D0(GlobalContext* globalCtx, Player* this, CsCmdActorAction* arg2) { this->actor.world.pos.x = arg2->startPos.x; this->actor.world.pos.y = arg2->startPos.y; - if ((globalCtx->sceneNum == SCENE_SPOT04) && LINK_IS_CHILD) { + if ((globalCtx->sceneNum == SCENE_SPOT04) && !LINK_IS_ADULT) { this->actor.world.pos.y -= 1.0f; } this->actor.world.pos.z = arg2->startPos.z; diff --git a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c index 906276d8dd..46b34216b8 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Bubble/z_eff_ss_bubble.c @@ -21,7 +21,7 @@ EffectSsInit Effect_Ss_Bubble_InitVars = { u32 EffectSsBubble_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) { EffectSsBubbleInitParams* initParams = (EffectSsBubbleInitParams*)initParamsx; - // @bug Rand_ZeroOne in the macro means a random number is generated for both parts of the macro. + //! @bug Rand_ZeroOne in the macro means a random number is generated for both parts of the macro. // In the base game this works out because both addresses are segment 4, but it may break if // the addresses were changed to refer to different segments this->gfx = SEGMENTED_TO_VIRTUAL(Rand_ZeroOne() < 0.5f ? &gEffBubble1Tex : &gEffBubble2Tex); diff --git a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c index e7c6eb0f76..f7217853ae 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dt_Bubble/z_eff_ss_dt_bubble.c @@ -34,7 +34,7 @@ EffectSsInit Effect_Ss_Dt_Bubble_InitVars = { u32 EffectSsDtBubble_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void* initParamsx) { EffectSsDtBubbleInitParams* initParams = (EffectSsDtBubbleInitParams*)initParamsx; - // @bug Rand_ZeroOne in the macro means a random number is generated for both parts of the macro. + //! @bug Rand_ZeroOne in the macro means a random number is generated for both parts of the macro. // In the base game this works out because both addresses are segment 4, but it may break if // the addresses were changed to refer to different segments this->gfx = SEGMENTED_TO_VIRTUAL(Rand_ZeroOne() < 0.5f ? &gEffBubble1Tex : &gEffBubble2Tex); diff --git a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c index a8cea99dbf..aa580b3198 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c +++ b/src/overlays/effects/ovl_Effect_Ss_Stick/z_eff_ss_stick.c @@ -54,7 +54,7 @@ void EffectSsStick_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this) { Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); - if (LINK_IS_CHILD) { + if (!LINK_IS_ADULT) { Matrix_Scale(0.01f, 0.0025f, 0.01f, MTXMODE_APPLY); Matrix_RotateRPY(0, this->rYaw, 0, MTXMODE_APPLY); } else { diff --git a/src/overlays/ovl_map_mark_data/z_map_mark_data.c b/src/overlays/ovl_map_mark_data/z_map_mark_data.c index 7fed7c64c1..1fa95837a7 100644 --- a/src/overlays/ovl_map_mark_data/z_map_mark_data.c +++ b/src/overlays/ovl_map_mark_data/z_map_mark_data.c @@ -1,6 +1,6 @@ #include "global.h" -MapMarkData sMapMarkDekuTree[] = { +static MapMarkData sMapMarkDekuTree[] = { // Deku Tree minimap 0 { { MAP_MARK_CHEST, @@ -87,7 +87,7 @@ MapMarkData sMapMarkDekuTree[] = { }, }; -MapMarkData sMapMarkDodongosCavern[] = { +static MapMarkData sMapMarkDodongosCavern[] = { // Dodongo's Cavern minimap 0 { { MAP_MARK_CHEST, @@ -197,7 +197,7 @@ MapMarkData sMapMarkDodongosCavern[] = { }, }; -MapMarkData sMapMarkJabuJabuBelly[] = { +static MapMarkData sMapMarkJabuJabuBelly[] = { // Jabu-Jabu's Belly minimap 0 { { MAP_MARK_CHEST, @@ -308,7 +308,7 @@ MapMarkData sMapMarkJabuJabuBelly[] = { }, }; -MapMarkData sMapMarkForestTemple[] = { +static MapMarkData sMapMarkForestTemple[] = { // Forest Temple minimap 0 { { MAP_MARK_NONE, 0, { 0 } }, @@ -485,7 +485,7 @@ MapMarkData sMapMarkForestTemple[] = { }, }; -MapMarkData sMapMarkFireTemple[] = { +static MapMarkData sMapMarkFireTemple[] = { // Fire Temple minimap 0 { { MAP_MARK_NONE, 0, { 0 } }, @@ -687,7 +687,7 @@ MapMarkData sMapMarkFireTemple[] = { }, }; -MapMarkData sMapMarkWaterTemple[] = { +static MapMarkData sMapMarkWaterTemple[] = { // Water Temple minimap 0 { { MAP_MARK_NONE, 0, { 0 } }, @@ -896,7 +896,7 @@ MapMarkData sMapMarkWaterTemple[] = { }, }; -MapMarkData sMapMarkSpiritTemple[] = { +static MapMarkData sMapMarkSpiritTemple[] = { // Spirit Temple minimap 0 { { MAP_MARK_CHEST, @@ -1112,7 +1112,7 @@ MapMarkData sMapMarkSpiritTemple[] = { }, }; -MapMarkData sMapMarkShadowTemple[] = { +static MapMarkData sMapMarkShadowTemple[] = { // Shadow Temple minimap 0 { { MAP_MARK_NONE, 0, { 0 } }, @@ -1314,7 +1314,7 @@ MapMarkData sMapMarkShadowTemple[] = { }, }; -MapMarkData sMapMarkBottomWell[] = { +static MapMarkData sMapMarkBottomWell[] = { // Bottom of the Well minimap 0 { { MAP_MARK_CHEST, @@ -1372,7 +1372,7 @@ MapMarkData sMapMarkBottomWell[] = { }, }; -MapMarkData sMapMarkIceCavern[] = { +static MapMarkData sMapMarkIceCavern[] = { // Ice Cavern minimap 0 { { MAP_MARK_NONE, 0, { 0 } }, diff --git a/tools/overlayhelpers/mapmark.py b/tools/overlayhelpers/mapmark.py index a5cf622808..8cc91ae771 100644 --- a/tools/overlayhelpers/mapmark.py +++ b/tools/overlayhelpers/mapmark.py @@ -23,7 +23,6 @@ DUNGEON_NAMES = [ HEADER = """\ #include "global.h" - """ def RamToOff(vram):