From f4a490bb6a2e4d1564ed06b0ee98be274dda7b91 Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 3 Oct 2023 23:01:04 -0400 Subject: [PATCH] Port Proposed OoT Object Docs (#1361) * port docs in z_scene * undo accidental ctrl-f * another fix * expose Object_SpawnPersistent --------- Co-authored-by: engineer124 --- include/z64object.h | 7 - include/z64scene.h | 26 +-- src/code/z_actor.c | 8 +- src/code/z_draw.c | 4 +- src/code/z_effect_soft_sprite_old_init.c | 2 +- src/code/z_en_hy_code.c | 6 +- src/code/z_en_item00.c | 12 +- src/code/z_play.c | 24 +-- src/code/z_player_lib.c | 6 +- src/code/z_scene.c | 157 ++++++++++-------- src/code/z_sub_s.c | 2 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 2 +- .../actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c | 4 +- .../actors/ovl_Bg_Umajump/z_bg_umajump.c | 2 +- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 8 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 2 +- .../actors/ovl_Demo_Getitem/z_demo_getitem.c | 2 +- .../actors/ovl_Demo_Kankyo/z_demo_kankyo.c | 2 +- src/overlays/actors/ovl_Dm_An/z_dm_an.c | 12 +- .../actors/ovl_Dm_Char03/z_dm_char03.c | 2 +- .../actors/ovl_Dm_Char05/z_dm_char05.c | 10 +- src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c | 12 +- src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c | 18 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 2 +- .../actors/ovl_En_Bba_01/z_en_bba_01.c | 10 +- .../actors/ovl_En_Cne_01/z_en_cne_01.c | 10 +- .../actors/ovl_En_Daiku2/z_en_daiku2.c | 4 +- src/overlays/actors/ovl_En_Dnk/z_en_dnk.c | 2 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 6 +- .../actors/ovl_En_Door_Etc/z_en_door_etc.c | 4 +- src/overlays/actors/ovl_En_Drs/z_en_drs.c | 4 +- .../ovl_En_Ending_Hero6/z_en_ending_hero6.c | 2 +- src/overlays/actors/ovl_En_Fall/z_en_fall.c | 8 +- src/overlays/actors/ovl_En_Geg/z_en_geg.c | 12 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 8 +- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 8 +- .../z_en_invadepoh_demo.c | 8 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 2 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 2 +- src/overlays/actors/ovl_En_Mag/z_en_mag.c | 2 +- src/overlays/actors/ovl_En_Nwc/z_en_nwc.c | 6 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 2 +- .../actors/ovl_En_S_Goro/z_en_s_goro.c | 12 +- .../actors/ovl_En_Sekihi/z_en_sekihi.c | 2 +- src/overlays/actors/ovl_En_Sob1/z_en_sob1.c | 12 +- src/overlays/actors/ovl_En_St/z_en_st.c | 6 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 8 +- src/overlays/actors/ovl_En_Sth2/z_en_sth2.c | 2 +- src/overlays/actors/ovl_En_Test2/z_en_test2.c | 2 +- .../actors/ovl_En_Warp_tag/z_en_warp_tag.c | 2 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 2 +- .../actors/ovl_Obj_Etcetera/z_obj_etcetera.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 2 +- .../actors/ovl_Obj_Nozoki/z_obj_nozoki.c | 2 +- .../actors/ovl_Obj_Purify/z_obj_purify.c | 2 +- .../actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c | 2 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 2 +- .../actors/ovl_player_actor/z_player.c | 4 +- .../z_eff_en_ice_block.c | 4 +- .../ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c | 4 +- .../ovl_Effect_Ss_Extra/z_eff_ss_extra.c | 6 +- .../ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c | 6 +- .../ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c | 6 +- .../ovl_Effect_Ss_Stick/z_eff_ss_stick.c | 4 +- tools/disasm/functions.txt | 8 +- tools/namefixer.py | 4 + tools/sizes/code_functions.csv | 8 +- 68 files changed, 279 insertions(+), 269 deletions(-) diff --git a/include/z64object.h b/include/z64object.h index 712826815..d547d4a9e 100644 --- a/include/z64object.h +++ b/include/z64object.h @@ -1,13 +1,6 @@ #ifndef Z64OBJECT_H #define Z64OBJECT_H -#define OBJECT_SPACE_SIZE_DEFAULT 1413120 -#define OBJECT_SPACE_SIZE_CLOCK_TOWN 1566720 -#define OBJECT_SPACE_SIZE_MILK_BAR 1617920 -#define OBJECT_SPACE_SIZE_TERMINA_FIELD 1505280 - -#define OBJECT_EXCHANGE_BANK_MAX 35 - #define DEFINE_OBJECT(_name, enumValue) enumValue, #define DEFINE_OBJECT_UNSET(enumValue) enumValue, #define DEFINE_OBJECT_SIZE_ZERO(_name, enumValue) enumValue, diff --git a/include/z64scene.h b/include/z64scene.h index e0f186cd8..b66ad4e41 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -74,7 +74,7 @@ typedef struct { typedef struct { /* 0x0 */ u8 code; /* 0x1 */ u8 naviQuestHintFileId; - /* 0x4 */ u32 subKeepIndex; + /* 0x4 */ u32 subKeepId; } SCmdSpecialFiles; // size = 0x8 typedef struct { @@ -415,7 +415,7 @@ typedef struct { /* 0x08 */ DmaRequest dmaReq; /* 0x28 */ OSMesgQueue loadQueue; /* 0x40 */ OSMesg loadMsg; -} ObjectStatus; // size = 0x44 +} ObjectEntry; // size = 0x44 typedef struct { /* 0x0 */ RomFile segment; @@ -475,11 +475,11 @@ typedef RoomShapeCullable PolygonType2; typedef struct { /* 0x000 */ void* spaceStart; /* 0x004 */ void* spaceEnd; - /* 0x008 */ u8 num; - /* 0x009 */ u8 spawnedObjectCount; - /* 0x00A */ u8 mainKeepIndex; - /* 0x00B */ u8 subKeepIndex; - /* 0x00C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX]; + /* 0x008 */ u8 numEntries; // total amount of used entries + /* 0x009 */ u8 numPersistentEntries; // amount of entries that won't be reused when loading a new object list (when loading a new room) + /* 0x00A */ u8 mainKeepSlot; // "gameplay_keep" slot + /* 0x00B */ u8 subKeepSlot; // "gameplay_field_keep" or "gameplay_dangeon_keep" slot + /* 0x00C */ ObjectEntry slots[35]; } ObjectContext; // size = 0x958 #define PATH_INDEX_NONE -1 @@ -899,13 +899,13 @@ typedef enum { #define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED #define SCENE_CMD_CUTSCENE_LIST SCENE_CMD_CUTSCENE_SCRIPT_LIST -s32 Object_Spawn(ObjectContext* objectCtx, s16 id); -void Object_InitBank(struct GameState* gameState, ObjectContext* objectCtx); -void Object_UpdateBank(ObjectContext* objectCtx); -s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId); -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index); +s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 id); +void Object_InitContext(struct GameState* gameState, ObjectContext* objectCtx); +void Object_UpdateEntries(ObjectContext* objectCtx); +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId); +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot); void Object_LoadAll(ObjectContext* objectCtx); -void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id); +void* func_8012F73C(ObjectContext* objectCtx, s32 slot, s16 id); void Scene_CommandSpawnList(struct PlayState* play, SceneCmd* cmd); void Scene_CommandActorList(struct PlayState* play, SceneCmd* cmd); void Scene_CommandActorCutsceneCamList(struct PlayState* play, SceneCmd* cmd); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 10f782e25..7c741ae85 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1096,7 +1096,7 @@ void Actor_SetScale(Actor* actor, f32 scale) { } void Actor_SetObjectDependency(PlayState* play, Actor* actor) { - gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[actor->objBankIndex].segment); + gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[actor->objBankIndex].segment); } void Actor_Init(Actor* actor, PlayState* play) { @@ -2700,8 +2700,8 @@ void Actor_Draw(PlayState* play, Actor* actor) { Matrix_Scale(actor->scale.x, actor->scale.y, actor->scale.z, MTXMODE_APPLY); Actor_SetObjectDependency(play, actor); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[actor->objBankIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[actor->objBankIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[actor->objBankIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[actor->objBankIndex].segment); if (actor->colorFilterTimer != 0) { s32 colorFlag = COLORFILTER_GET_COLORFLAG(actor->colorFilterParams); @@ -3299,7 +3299,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1 return NULL; } - objBankIndex = Object_GetIndex(&play->objectCtx, actorInit->objectId); + objBankIndex = Object_GetSlot(&play->objectCtx, actorInit->objectId); if ((objBankIndex < 0) || ((actorInit->type == ACTORCAT_ENEMY) && Flags_GetClear(play, play->roomCtx.curRoom.num) && (actorInit->id != ACTOR_BOSS_05))) { Actor_FreeOverlay(&gActorOverlayTable[index]); diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 2a56e0ba5..3f1d1dc47 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -827,9 +827,9 @@ void GetItem_DrawRemains(PlayState* play, s16 drawId) { OPEN_DISPS(play->state.gfxCtx); - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_BSMASK); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_BSMASK); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment); Gfx_SetupDL25_Opa(play->state.gfxCtx); Matrix_Scale(0.02f, 0.02f, 0.02f, MTXMODE_APPLY); diff --git a/src/code/z_effect_soft_sprite_old_init.c b/src/code/z_effect_soft_sprite_old_init.c index 63b6861a7..d71a18674 100644 --- a/src/code/z_effect_soft_sprite_old_init.c +++ b/src/code/z_effect_soft_sprite_old_init.c @@ -41,7 +41,7 @@ void EffectSs_DrawGEffect(PlayState* play, EffectSs* this, TexturePtr texture) { MtxF mfTrans11DA0; s32 pad1; Mtx* mtx; - void* object = play->objectCtx.status[this->rgObjBankIndex].segment; + void* object = play->objectCtx.slots[this->rgObjBankIndex].segment; OPEN_DISPS(gfxCtx); diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c index e2f31c404..d64308bff 100644 --- a/src/code/z_en_hy_code.c +++ b/src/code/z_en_hy_code.c @@ -133,7 +133,7 @@ EnDoor* EnHy_FindNearestDoor(Actor* actor, PlayState* play) { } void EnHy_ChangeObjectAndAnim(EnHy* enHy, PlayState* play, s16 animIndex) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->animObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjIndex].segment); EnHy_ChangeAnim(&enHy->skelAnime, animIndex); } @@ -141,7 +141,7 @@ s32 EnHy_UpdateSkelAnime(EnHy* enHy, PlayState* play) { s32 isUpdated = false; if (enHy->actor.draw != NULL) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->animObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->animObjIndex].segment); SkelAnime_Update(&enHy->skelAnime); isUpdated = true; } @@ -168,7 +168,7 @@ s32 EnHy_Init(EnHy* enHy, PlayState* play, FlexSkeletonHeader* skeletonHeaderSeg enHy->actor.objBankIndex = enHy->skelLowerObjIndex; isInitialized = true; ActorShape_Init(&enHy->actor.shape, 0.0f, NULL, 0.0f); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[enHy->actor.objBankIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[enHy->actor.objBankIndex].segment); SkelAnime_InitFlex(play, &enHy->skelAnime, skeletonHeaderSeg, NULL, enHy->jointTable, enHy->morphTable, ENHY_LIMB_MAX); EnHy_ChangeObjectAndAnim(enHy, play, animIndex); diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index f9f5df5a8..c6b52e476 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -184,17 +184,17 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { break; case ITEM00_SHIELD_HERO: - thisx->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_SHIELD_2); + thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_SHIELD_2); EnItem00_SetObject(this, play, &shadowOffset, &shadowScale); break; case ITEM00_MAP: - thisx->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_MAP); + thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_MAP); EnItem00_SetObject(this, play, &shadowOffset, &shadowScale); break; case ITEM00_COMPASS: - thisx->objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_COMPASS); + thisx->objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_COMPASS); EnItem00_SetObject(this, play, &shadowOffset, &shadowScale); break; @@ -317,7 +317,7 @@ void EnItem00_Destroy(Actor* thisx, PlayState* play) { } void EnItem00_WaitForHeartObject(EnItem00* this, PlayState* play) { - s32 objBankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS); + s32 objBankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS); if (Object_IsLoaded(&play->objectCtx, objBankIndex)) { this->actor.objBankIndex = objBankIndex; @@ -725,7 +725,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { case ITEM00_RECOVERY_HEART: if (this->unk152 < 0) { if (this->unk152 == -1) { - s8 bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_GI_HEART); + s8 bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_GI_HEART); if (Object_IsLoaded(&play->objectCtx, bankIndex)) { this->actor.objBankIndex = bankIndex; @@ -852,7 +852,7 @@ void EnItem00_DrawSprite(EnItem00* this, PlayState* play) { void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play) { s32 pad[2]; - if (Object_GetIndex(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objBankIndex) { + if (Object_GetSlot(&play->objectCtx, OBJECT_GI_HEARTS) == this->actor.objBankIndex) { OPEN_DISPS(play->state.gfxCtx); Gfx_SetupDL25_Xlu(play->state.gfxCtx); diff --git a/src/code/z_play.c b/src/code/z_play.c index 9a5e6541d..f71cf0c0d 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -921,8 +921,8 @@ void Play_UpdateMain(PlayState* this) { u8 freezeFlashTimer; s32 sp5C = false; - gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); if (R_PICTO_PHOTO_STATE == PICTO_PHOTO_STATE_PROCESS) { @@ -972,7 +972,7 @@ void Play_UpdateMain(PlayState* this) { sp5C = (this->pauseCtx.state != 0) || (this->pauseCtx.debugEditor != DEBUG_EDITOR_NONE); AnimationContext_Reset(&this->animationCtx); - Object_UpdateBank(&this->objectCtx); + Object_UpdateEntries(&this->objectCtx); if (!sp5C && (IREG(72) == 0)) { this->gameplayFrames++; @@ -1153,17 +1153,17 @@ void Play_DrawMain(PlayState* this) { OPEN_DISPS(gfxCtx); - gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSegments[5] = VIRTUAL_TO_PHYSICAL(this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSegments[2] = VIRTUAL_TO_PHYSICAL(this->sceneSegment); - gSPSegment(POLY_OPA_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x04, this->objectCtx.status[this->objectCtx.mainKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSPSegment(POLY_XLU_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); + gSPSegment(OVERLAY_DISP++, 0x04, this->objectCtx.slots[this->objectCtx.mainKeepSlot].segment); - gSPSegment(POLY_OPA_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); - gSPSegment(OVERLAY_DISP++, 0x05, this->objectCtx.status[this->objectCtx.subKeepIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); + gSPSegment(POLY_XLU_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); + gSPSegment(OVERLAY_DISP++, 0x05, this->objectCtx.slots[this->objectCtx.subKeepSlot].segment); gSPSegment(POLY_OPA_DISP++, 0x02, this->sceneSegment); gSPSegment(POLY_XLU_DISP++, 0x02, this->sceneSegment); @@ -1585,7 +1585,7 @@ void Play_InitScene(PlayState* this, s32 spawn) { this->sceneMaterialAnims = NULL; this->roomCtx.unk74 = NULL; this->numSetupActors = 0; - Object_InitBank(&this->state, &this->objectCtx); + Object_InitContext(&this->state, &this->objectCtx); LightContext_Init(this, &this->lightCtx); Door_InitContext(&this->state, &this->doorCtx); Room_Init(this, &this->roomCtx); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 24b55cfea..f288b31de 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -396,9 +396,9 @@ void func_8012301C(Actor* thisx, PlayState* play2) { gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId = objectId; func_8012F73C(&play->objectCtx, this->actor.objBankIndex, objectId); - this->actor.objBankIndex = Object_GetIndex(&play->objectCtx, GAMEPLAY_KEEP); + this->actor.objBankIndex = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP); } else if (this->actionVar1 >= 3) { - s32 objBankIndex = Object_GetIndex(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId); + s32 objBankIndex = Object_GetSlot(&play->objectCtx, gActorOverlayTable[ACTOR_PLAYER].initInfo->objectId); if (Object_IsLoaded(&play->objectCtx, objBankIndex)) { this->actor.objBankIndex = objBankIndex; @@ -1869,7 +1869,7 @@ void Player_DrawHookshotReticle(PlayState* play, Player* player, f32 hookshotDis gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.status[player->actor.objBankIndex].segment); + gSPSegment(OVERLAY_DISP++, 0x06, play->objectCtx.slots[player->actor.objBankIndex].segment); gSPDisplayList(OVERLAY_DISP++, gHookshotReticleDL); CLOSE_DISPS(play->state.gfxCtx); diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 811853f07..d26156d58 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -1,28 +1,41 @@ #include "global.h" -s32 Object_Spawn(ObjectContext* objectCtx, s16 id) { +/** + * Spawn an object file of a specified ID that will persist through room changes. + * + * This waits for the file to be fully loaded, the data is available when the function returns. + * + * @return The new object slot corresponding to the requested object ID. + * + * @note This function is not meant to be called externally to spawn object files on the fly. + * When an object is spawned with this function, all objects that come before it in the entry list will be treated as + * persistent, which will likely cause either the amount of free slots or object space memory to run out. + * This function is only meant to be called internally on scene load, before the object list from any room is processed. + */ +s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 id) { size_t size; - objectCtx->status[objectCtx->num].id = id; + objectCtx->slots[objectCtx->numEntries].id = id; size = gObjectTable[id].vromEnd - gObjectTable[id].vromStart; if (1) {} if (size != 0) { - DmaMgr_SendRequest0(objectCtx->status[objectCtx->num].segment, gObjectTable[id].vromStart, size); + DmaMgr_SendRequest0(objectCtx->slots[objectCtx->numEntries].segment, gObjectTable[id].vromStart, size); } - if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) { - objectCtx->status[objectCtx->num + 1].segment = ALIGN16((u32)objectCtx->status[objectCtx->num].segment + size); + if (objectCtx->numEntries < ARRAY_COUNT(objectCtx->slots) - 1) { + objectCtx->slots[objectCtx->numEntries + 1].segment = + ALIGN16((u32)objectCtx->slots[objectCtx->numEntries].segment + size); } - objectCtx->num++; - objectCtx->spawnedObjectCount = objectCtx->num; + objectCtx->numEntries++; + objectCtx->numPersistentEntries = objectCtx->numEntries; - return objectCtx->num - 1; + return objectCtx->numEntries - 1; } -void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) { +void Object_InitContext(GameState* gameState, ObjectContext* objectCtx) { PlayState* play = (PlayState*)gameState; s32 pad; u32 spaceSize; @@ -30,66 +43,66 @@ void Object_InitBank(GameState* gameState, ObjectContext* objectCtx) { if (play->sceneId == SCENE_CLOCKTOWER || play->sceneId == SCENE_TOWN || play->sceneId == SCENE_BACKTOWN || play->sceneId == SCENE_ICHIBA) { - spaceSize = OBJECT_SPACE_SIZE_CLOCK_TOWN; + spaceSize = 1530 * 1024; } else if (play->sceneId == SCENE_MILK_BAR) { - spaceSize = OBJECT_SPACE_SIZE_MILK_BAR; + spaceSize = 1580 * 1024; } else if (play->sceneId == SCENE_00KEIKOKU) { - spaceSize = OBJECT_SPACE_SIZE_TERMINA_FIELD; + spaceSize = 1470 * 1024; } else { - spaceSize = OBJECT_SPACE_SIZE_DEFAULT; + spaceSize = 1380 * 1024; } - objectCtx->num = 0; - objectCtx->spawnedObjectCount = 0; - objectCtx->mainKeepIndex = 0; - objectCtx->subKeepIndex = 0; + objectCtx->numEntries = 0; + objectCtx->numPersistentEntries = 0; + objectCtx->mainKeepSlot = 0; + objectCtx->subKeepSlot = 0; // clang-format off - for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { objectCtx->status[i].id = 0; } + for (i = 0; i < ARRAY_COUNT(objectCtx->slots); i++) { objectCtx->slots[i].id = 0; } // clang-format on - objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocTailAlign16(&gameState->tha, spaceSize); + objectCtx->spaceStart = objectCtx->slots[0].segment = THA_AllocTailAlign16(&gameState->tha, spaceSize); objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize); - objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP); + objectCtx->mainKeepSlot = Object_SpawnPersistent(objectCtx, GAMEPLAY_KEEP); - gSegments[0x04] = VIRTUAL_TO_PHYSICAL(objectCtx->status[objectCtx->mainKeepIndex].segment); + gSegments[4] = VIRTUAL_TO_PHYSICAL(objectCtx->slots[objectCtx->mainKeepSlot].segment); } -void Object_UpdateBank(ObjectContext* objectCtx) { +void Object_UpdateEntries(ObjectContext* objectCtx) { s32 i; - ObjectStatus* status = &objectCtx->status[0]; + ObjectEntry* entry = &objectCtx->slots[0]; RomFile* objectFile; size_t size; - for (i = 0; i < objectCtx->num; i++) { - if (status->id < 0) { - s32 id = -status->id; + for (i = 0; i < objectCtx->numEntries; i++) { + if (entry->id < 0) { + s32 id = -entry->id; - if (status->dmaReq.vromAddr == 0) { + if (entry->dmaReq.vromAddr == 0) { objectFile = &gObjectTable[id]; size = objectFile->vromEnd - objectFile->vromStart; if (size == 0) { - status->id = 0; + entry->id = 0; } else { - osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1); - DmaMgr_SendRequestImpl(&status->dmaReq, status->segment, objectFile->vromStart, size, 0, - &status->loadQueue, NULL); + osCreateMesgQueue(&entry->loadQueue, &entry->loadMsg, 1); + DmaMgr_SendRequestImpl(&entry->dmaReq, entry->segment, objectFile->vromStart, size, 0, + &entry->loadQueue, NULL); } - } else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) { - status->id = id; + } else if (!osRecvMesg(&entry->loadQueue, NULL, OS_MESG_NOBLOCK)) { + entry->id = id; } } - status++; + entry++; } } -s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) { +s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId) { s32 i; - for (i = 0; i < objectCtx->num; i++) { - if (ABS_ALT(objectCtx->status[i].id) == objectId) { + for (i = 0; i < objectCtx->numEntries; i++) { + if (ABS_ALT(objectCtx->slots[i].id) == objectId) { return i; } } @@ -97,8 +110,8 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) { return -1; } -s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index) { - if (objectCtx->status[index].id > 0) { +s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot) { + if (objectCtx->slots[slot].id > 0) { return true; } else { return false; @@ -110,31 +123,31 @@ void Object_LoadAll(ObjectContext* objectCtx) { s32 id; uintptr_t vromSize; - for (i = 0; i < objectCtx->num; i++) { - id = objectCtx->status[i].id; + for (i = 0; i < objectCtx->numEntries; i++) { + id = objectCtx->slots[i].id; vromSize = gObjectTable[id].vromEnd - gObjectTable[id].vromStart; if (vromSize == 0) { continue; } - DmaMgr_SendRequest0(objectCtx->status[i].segment, gObjectTable[id].vromStart, vromSize); + DmaMgr_SendRequest0(objectCtx->slots[i].segment, gObjectTable[id].vromStart, vromSize); } } -void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) { +void* func_8012F73C(ObjectContext* objectCtx, s32 slot, s16 id) { u32 addr; uintptr_t vromSize; RomFile* fileTableEntry; - objectCtx->status[iParm2].id = -id; - objectCtx->status[iParm2].dmaReq.vromAddr = 0; + objectCtx->slots[slot].id = -id; + objectCtx->slots[slot].dmaReq.vromAddr = 0; fileTableEntry = &gObjectTable[id]; vromSize = fileTableEntry->vromEnd - fileTableEntry->vromStart; // TODO: UB to cast void to u32 - addr = ((u32)objectCtx->status[iParm2].segment) + vromSize; + addr = ((u32)objectCtx->slots[slot].segment) + vromSize; addr = ALIGN16(addr); return (void*)addr; @@ -152,19 +165,19 @@ void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) { ((gSaveContext.respawnFlag == 2) && (gSaveContext.respawn[RESPAWN_MODE_RETURN].playerParams == PLAYER_PARAMS(0xFF, PLAYER_INITMODE_TELESCOPE)))) { // Skull Kid Object - Object_Spawn(&play->objectCtx, OBJECT_STK); + Object_SpawnPersistent(&play->objectCtx, OBJECT_STK); return; } - loadedCount = Object_Spawn(&play->objectCtx, OBJECT_LINK_CHILD); - nextObject = play->objectCtx.status[play->objectCtx.num].segment; - play->objectCtx.num = loadedCount; - play->objectCtx.spawnedObjectCount = loadedCount; + loadedCount = Object_SpawnPersistent(&play->objectCtx, OBJECT_LINK_CHILD); + nextObject = play->objectCtx.slots[play->objectCtx.numEntries].segment; + play->objectCtx.numEntries = loadedCount; + play->objectCtx.numPersistentEntries = loadedCount; playerObjectId = gPlayerFormObjectIndices[GET_PLAYER_FORM]; gActorOverlayTable[0].initInfo->objectId = playerObjectId; - Object_Spawn(&play->objectCtx, playerObjectId); + Object_SpawnPersistent(&play->objectCtx, playerObjectId); - play->objectCtx.status[play->objectCtx.num].segment = nextObject; + play->objectCtx.slots[play->objectCtx.numEntries].segment = nextObject; } // SceneTableEntry Header Command 0x01: Actor List @@ -224,10 +237,10 @@ void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) { { SEGMENT_ROM_START(elf_message_ydan), SEGMENT_ROM_END(elf_message_ydan) }, }; - if (cmd->specialFiles.subKeepIndex != 0) { - play->objectCtx.subKeepIndex = Object_Spawn(&play->objectCtx, cmd->specialFiles.subKeepIndex); + if (cmd->specialFiles.subKeepId != 0) { + play->objectCtx.subKeepSlot = Object_SpawnPersistent(&play->objectCtx, cmd->specialFiles.subKeepId); // TODO: Segment number enum? - gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment); + gSegments[0x05] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[play->objectCtx.subKeepSlot].segment); } if (cmd->specialFiles.naviQuestHintFileId != NAVI_QUEST_HINTS_NONE) { @@ -255,28 +268,28 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { s32 i; s32 j; s32 k; - ObjectStatus* firstObject; - ObjectStatus* status; - ObjectStatus* status2; + ObjectEntry* firstObject; + ObjectEntry* entry; + ObjectEntry* invalidatedEntry; s16* objectEntry; void* nextPtr; objectEntry = Lib_SegmentedToVirtual(cmd->objectList.segment); k = 0; - i = play->objectCtx.spawnedObjectCount; - status = &play->objectCtx.status[i]; - firstObject = play->objectCtx.status; + i = play->objectCtx.numPersistentEntries; + entry = &play->objectCtx.slots[i]; + firstObject = &play->objectCtx.slots[0]; - while (i < play->objectCtx.num) { - if (status->id != *objectEntry) { - status2 = &play->objectCtx.status[i]; + while (i < play->objectCtx.numEntries) { + if (entry->id != *objectEntry) { + invalidatedEntry = &play->objectCtx.slots[i]; - for (j = i; j < play->objectCtx.num; j++) { - status2->id = 0; - status2++; + for (j = i; j < play->objectCtx.numEntries; j++) { + invalidatedEntry->id = 0; + invalidatedEntry++; } - play->objectCtx.num = i; + play->objectCtx.numEntries = i; Actor_KillAllWithMissingObject(play, &play->actorCtx); continue; @@ -285,13 +298,13 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { i++; k++; objectEntry++; - status++; + entry++; } while (k < cmd->objectList.num) { nextPtr = func_8012F73C(&play->objectCtx, i, *objectEntry); - if (i < OBJECT_EXCHANGE_BANK_MAX - 1) { + if (i < ARRAY_COUNT(play->objectCtx.slots) - 1) { firstObject[i + 1].segment = nextPtr; } @@ -300,7 +313,7 @@ void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) { objectEntry++; } - play->objectCtx.num = i; + play->objectCtx.numEntries = i; } // SceneTableEntry Header Command 0x0C: Light List diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 4baff41ce..3dc02ba7d 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -1174,7 +1174,7 @@ s8 SubS_IsObjectLoaded(s8 index, PlayState* play) { } s8 SubS_GetObjectIndex(s16 id, PlayState* play) { - return Object_GetIndex(&play->objectCtx, id); + return Object_GetSlot(&play->objectCtx, id); } /** diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index ea2fe2c90..dae692c89 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -212,7 +212,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwallStruct* sp24 = &D_808B8140[BGBREAKWALL_GET_F(&this->dyna.actor)]; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_15C = Object_GetIndex(&play->objectCtx, sp24->unk_00); + this->unk_15C = Object_GetSlot(&play->objectCtx, sp24->unk_00); if ((this->unk_15C < 0) || !sp24->unk_14(this, play)) { Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c index 8e96cae50..91ea969e2 100644 --- a/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c +++ b/src/overlays/actors/ovl_Bg_Numa_Hana/z_bg_numa_hana.c @@ -404,13 +404,13 @@ void BgNumaHana_Draw(Actor* thisx, PlayState* play2) { gSPDisplayList(POLY_OPA_DISP++, gWoodenFlowerOuterPetalDL); } - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_SYOKUDAI); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_SYOKUDAI); if ((objectIndex >= 0) && (Object_IsLoaded(&play->objectCtx, objectIndex))) { Matrix_SetTranslateRotateYXZ(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y - 64.5f, this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot); Matrix_Scale(1.5f, 1.5f, 1.5f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment); gSPDisplayList(POLY_OPA_DISP++, gObjectSyokudaiTypeNoSwitchDL); } diff --git a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c index 16e068156..63cedff5a 100644 --- a/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c +++ b/src/overlays/actors/ovl_Bg_Umajump/z_bg_umajump.c @@ -103,7 +103,7 @@ void BgUmajump_Init(Actor* thisx, PlayState* play) { thisx->update = Actor_Noop; } } else { - this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_UMAJUMP); + this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_UMAJUMP); if (this->objectIndex < 0) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index e9a3e79c7..e9394f783 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -2152,14 +2152,14 @@ void Boss03_Update(Actor* thisx, PlayState* play2) { /* Start of Gyorg's Draw section */ void Boss03_SetObject(PlayState* play, s16 objectId) { - s32 objectIndex = Object_GetIndex(&play->objectCtx, objectId); + s32 objectIndex = Object_GetSlot(&play->objectCtx, objectId); OPEN_DISPS(play->state.gfxCtx); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objectIndex].segment); - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[objectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[objectIndex].segment); CLOSE_DISPS(play->state.gfxCtx); } 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 ff88a61db..8f3b401da 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -57,7 +57,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play) { if (sEffectTypeObjects[type] == GAMEPLAY_KEEP) { objectIndex = 0; } else { - objectIndex = Object_GetIndex(&play->objectCtx, sEffectTypeObjects[type]); + objectIndex = Object_GetSlot(&play->objectCtx, sEffectTypeObjects[type]); } if (objectIndex < 0) { diff --git a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c index 63228436f..b52787f36 100644 --- a/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c +++ b/src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c @@ -57,7 +57,7 @@ void DemoGetitem_Init(Actor* thisx, PlayState* play) { this->getItemDrawId = sGetItemDraws[itemIndex]; this->cueType = sCueTypes[itemIndex]; - objectIndex = Object_GetIndex(&play->objectCtx, sObjectBankIndices[itemIndex]); + objectIndex = Object_GetSlot(&play->objectCtx, sObjectBankIndices[itemIndex]); if (objectIndex < 0) { Actor_Kill(&this->actor); return; 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 1ee2b1c9d..badd4bc12 100644 --- a/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c +++ b/src/overlays/actors/ovl_Demo_Kankyo/z_demo_kankyo.c @@ -461,7 +461,7 @@ void DemoKankyo_Init(Actor* thisx, PlayState* play) { case DEMO_KANKYO_TYPE_GIANTS: this->isSafeToDrawGiants = false; - objId = Object_GetIndex(&play->objectCtx, sObjectBubbleIndex); + objId = Object_GetSlot(&play->objectCtx, sObjectBubbleIndex); DemoKankyo_SetupAction(this, DemoKakyo_GiantObjectCheck); break; diff --git a/src/overlays/actors/ovl_Dm_An/z_dm_an.c b/src/overlays/actors/ovl_Dm_An/z_dm_an.c index dfcb610c8..a55f2cc1f 100644 --- a/src/overlays/actors/ovl_Dm_An/z_dm_an.c +++ b/src/overlays/actors/ovl_Dm_An/z_dm_an.c @@ -81,9 +81,9 @@ s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) { } if (objectIndex2 >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); isAnimFinished = SkelAnime_Update(&this->skelAnime); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); } return isAnimFinished; @@ -101,10 +101,10 @@ s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) { } if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); this->animIndex = animIndex; didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); } return didAnimChange; @@ -312,9 +312,9 @@ void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto Matrix_TranslateRotateZYX(&D_80C1D2C8, &D_80C1D2D4); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[sp2A].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2A].segment); gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[sp2B].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2B].segment); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c index 9f30d4343..3c499aa7a 100644 --- a/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c +++ b/src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c @@ -72,7 +72,7 @@ void DmChar03_Destroy(Actor* thisx, PlayState* play) { } void func_80AAB5F8(DmChar03* this, PlayState* play) { - s32 index = Object_GetIndex(&play->objectCtx, OBJECT_GI_NUTSMASK); + s32 index = Object_GetSlot(&play->objectCtx, OBJECT_GI_NUTSMASK); if (index >= 0) { this->objectIndex = index; diff --git a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c index 192e040a9..f2f8980a0 100644 --- a/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c +++ b/src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c @@ -178,7 +178,7 @@ void DmChar05_Destroy(Actor* thisx, PlayState* play) { } void func_80AAC990(DmChar05* this, PlayState* play) { - s32 objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GI_GOLONMASK); + s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_GOLONMASK); if (objectIdx >= 0) { this->unk_18F = objectIdx; @@ -200,7 +200,7 @@ void func_80AAC9DC(DmChar05* this, PlayState* play) { } void func_80AACA98(DmChar05* this, PlayState* play) { - s32 objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GI_MASK13); + s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK13); if (objectIdx >= 0) { this->unk_18F = objectIdx; @@ -232,7 +232,7 @@ void func_80AACBE4(DmChar05* this, PlayState* play) { OBJECT_GI_MASK11, OBJECT_GI_MASK20, OBJECT_GI_RABIT_MASK, OBJECT_GI_MASK12, }; s32 params = DMCHAR05_GET(&this->actor) - DMCHAR05_5; - s32 objectIdx = Object_GetIndex(&play->objectCtx, D_80AAE2F0[params]); + s32 objectIdx = Object_GetSlot(&play->objectCtx, D_80AAE2F0[params]); if (objectIdx >= 0) { this->unk_18F = objectIdx; @@ -278,7 +278,7 @@ void func_80AACD0C(DmChar05* this, PlayState* play) { } void func_80AACD1C(DmChar05* this, PlayState* play) { - s32 objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GI_ZORAMASK); + s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_ZORAMASK); if (objectIdx >= 0) { this->unk_18F = objectIdx; @@ -298,7 +298,7 @@ void func_80AACD68(DmChar05* this, PlayState* play) { } void func_80AACE10(DmChar05* this, PlayState* play) { - s32 objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_GI_MASK15); + s32 objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_GI_MASK15); if (objectIdx >= 0) { this->unk_18F = objectIdx; diff --git a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c index 2f7435053..ec5a83095 100644 --- a/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c +++ b/src/overlays/actors/ovl_Dm_Gm/z_dm_gm.c @@ -81,9 +81,9 @@ s32 DmGm_UpdateSkelAnime(DmGm* this, PlayState* play) { } if (objectIndex2 >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); isAnimFinished = SkelAnime_Update(&this->skelAnime); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); } return isAnimFinished; @@ -101,10 +101,10 @@ s32 DmGm_ChangeAnim(DmGm* this, PlayState* play, s32 animIndex) { } if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex2].segment); this->animIndex = animIndex; didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); } return didAnimChange; @@ -312,9 +312,9 @@ void DmGm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Matrix_TranslateRotateZYX(&D_80C25218, &D_80C25224); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[sp2A].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2A].segment); gSPDisplayList(POLY_OPA_DISP++, gMoonMaskDL); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[sp2B].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[sp2B].segment); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c index fb45200bc..cf8ed15e1 100644 --- a/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c +++ b/src/overlays/actors/ovl_Dm_Stk/z_dm_stk.c @@ -320,7 +320,7 @@ void DmStk_LoadObjectForAnimation(DmStk* this, PlayState* play) { } if (objectIndex >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objectIndex].segment); } } @@ -1062,9 +1062,9 @@ void DmStk_Init(Actor* thisx, PlayState* play) { this->shouldDraw = true; if (DM_STK_GET_TYPE(&this->actor) != DM_STK_TYPE_MAJORAS_MASK) { this->dekuPipesCutsceneState = SK_DEKU_PIPES_CS_STATE_NOT_READY; - this->objectStkObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK); - this->objectStk2ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK2); - this->objectStk3ObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_STK3); + this->objectStkObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK); + this->objectStk2ObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK2); + this->objectStk3ObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_STK3); if (this->objectStkObjectIndex < 0) { Actor_Kill(&this->actor); } @@ -1968,15 +1968,15 @@ void DmStk_PostLimbDraw2(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot (this->objectStk2ObjectIndex >= 0)) { Matrix_Push(); Matrix_Scale(2.0f, 2.0f, 2.0f, MTXMODE_APPLY); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectStk2ObjectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStk2ObjectIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objectStk2ObjectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStk2ObjectIndex].segment); AnimatedMat_Draw(play, Lib_SegmentedToVirtual(gSkullKidMajorasMaskCurseOverlayTexAnim)); Gfx_DrawDListOpa(play, gSkullKidMajorasMaskCurseOverlayDL); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectStkObjectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectIndex].segment); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objectStkObjectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectStkObjectIndex].segment); Matrix_Pop(); } @@ -2095,7 +2095,7 @@ void DmStk_Draw(Actor* thisx, PlayState* play) { return; } - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objectStkObjectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectStkObjectIndex].segment); OPEN_DISPS(play->state.gfxCtx); 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 c6e0e4269..b9b53a081 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -234,7 +234,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { this->slidingDoor.dyna.actor.room = -1; } - if ((this->requiredObjBankIndex = Object_GetIndex(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) { + if ((this->requiredObjBankIndex = Object_GetSlot(&play->objectCtx, D_808A2180[sp24].objectId)) < 0) { Actor_Kill(&this->slidingDoor.dyna.actor); return; } diff --git a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c index 7b9355305..46fd9d5b2 100644 --- a/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c +++ b/src/overlays/actors/ovl_En_Bba_01/z_en_bba_01.c @@ -264,9 +264,9 @@ s32 EnBba01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) { OPEN_DISPS(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->enHy.headObjIndex].segment); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.headObjIndex].segment); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.skelLowerObjIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjIndex].segment); CLOSE_DISPS(play->state.gfxCtx); } @@ -303,8 +303,8 @@ void EnBba01_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro if (limbIndex == BBA_LIMB_HEAD) { OPEN_DISPS(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->enHy.skelUpperObjIndex].segment); - gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.skelUpperObjIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment); + gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c index daa07db44..09d67ac24 100644 --- a/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c +++ b/src/overlays/actors/ovl_En_Cne_01/z_en_cne_01.c @@ -254,10 +254,10 @@ s32 EnCne01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* if (limbIndex == CNE_LIMB_HEAD) { OPEN_DISPS(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->enHy.headObjIndex].segment); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.headObjIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.headObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.headObjIndex].segment); *dList = gCneHeadBrownHairDL; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.skelLowerObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelLowerObjIndex].segment); CLOSE_DISPS(play->state.gfxCtx); } @@ -294,8 +294,8 @@ void EnCne01_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro if (limbIndex == CNE_LIMB_RIGHT_FOOT) { OPEN_DISPS(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->enHy.skelUpperObjIndex].segment); - gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->enHy.skelUpperObjIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment); + gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->enHy.skelUpperObjIndex].segment); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c index 5282697a4..31e904bcf 100644 --- a/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c +++ b/src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c @@ -588,10 +588,10 @@ void func_80BE7718(EnDaiku2* this, PlayState* play) { Gfx_SetupDL25_Opa(play->state.gfxCtx); - objectIdx = Object_GetIndex(&play->objectCtx, OBJECT_BOMBIWA); + objectIdx = Object_GetSlot(&play->objectCtx, OBJECT_BOMBIWA); if ((objectIdx >= 0) && Object_IsLoaded(&play->objectCtx, objectIdx)) { gDPPipeSync(POLY_OPA_DISP++); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[objectIdx].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[objectIdx].segment); for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) { if (effect->isEnabled) { diff --git a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c index 2dfc36daa..61170a5d0 100644 --- a/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c +++ b/src/overlays/actors/ovl_En_Dnk/z_en_dnk.c @@ -210,7 +210,7 @@ s32 func_80A515C4(EnDnk* this) { void func_80A51648(EnDnk* this, PlayState* play) { if (SubS_IsObjectLoaded(this->unk_28E, play) == true) { - gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_28E].segment); + gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_28E].segment); this->actor.draw = func_80A52018; this->actor.objBankIndex = this->unk_28E; ActorShape_Init(&this->actor.shape, 0.0f, NULL, 18.0f); 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 289b1403d..a63766b70 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -440,16 +440,16 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { break; } } - if ((i >= ARRAY_COUNT(sObjInfo) - 34) && (Object_GetIndex(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) { + if ((i >= ARRAY_COUNT(sObjInfo) - 34) && (Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) { objectInfo++; } } this->knobDoor.dlIndex = objectInfo->dListIndex; - objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); + objectBankIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId); if (objectBankIndex < 0) { objectInfo = &sObjInfo[15]; - objectBankIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); + objectBankIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId); if (objectBankIndex != 0) { Actor_Kill(&this->knobDoor.dyna.actor); return; diff --git a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c index dfa0e4934..fe09aa1fe 100644 --- a/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c +++ b/src/overlays/actors/ovl_En_Door_Etc/z_en_door_etc.c @@ -101,10 +101,10 @@ void EnDoorEtc_Init(Actor* thisx, PlayState* play2) { break; } } - if ((i >= 15) && (Object_GetIndex(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) { + if ((i >= 15) && (Object_GetSlot(&play->objectCtx, GAMEPLAY_FIELD_KEEP) >= 0)) { objectInfo++; } - objectIndex = Object_GetIndex(&play->objectCtx, objectInfo->objectId); + objectIndex = Object_GetSlot(&play->objectCtx, objectInfo->objectId); if (objectIndex < 0) { Actor_Kill(&this->knobDoor.dyna.actor); } else { diff --git a/src/overlays/actors/ovl_En_Drs/z_en_drs.c b/src/overlays/actors/ovl_En_Drs/z_en_drs.c index da2f0571d..a521abaa0 100644 --- a/src/overlays/actors/ovl_En_Drs/z_en_drs.c +++ b/src/overlays/actors/ovl_En_Drs/z_en_drs.c @@ -118,9 +118,9 @@ void EnDrs_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_87_02) && (limbIndex == WEDDING_DRESS_MANNEQUIN_LIMB_MASK)) { OPEN_DISPS(play->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[temp].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[temp].segment); gSPDisplayList(POLY_OPA_DISP++, &gMoonMaskDL); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[temp2].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[temp2].segment); CLOSE_DISPS(play->state.gfxCtx); } diff --git a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c index 8f6551e84..64b7ea1c2 100644 --- a/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c +++ b/src/overlays/actors/ovl_En_Ending_Hero6/z_en_ending_hero6.c @@ -172,7 +172,7 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL25_Xlu(play->state.gfxCtx); if ((this->objectIndex >= 0) && Object_IsLoaded(&play->objectCtx, this->objectIndex)) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objectIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectIndex].segment); switch (this->type) { case ENDING_HERO6_TYPE_DAIKU_RED: diff --git a/src/overlays/actors/ovl_En_Fall/z_en_fall.c b/src/overlays/actors/ovl_En_Fall/z_en_fall.c index 8468c3e54..e902baa2d 100644 --- a/src/overlays/actors/ovl_En_Fall/z_en_fall.c +++ b/src/overlays/actors/ovl_En_Fall/z_en_fall.c @@ -165,19 +165,19 @@ void EnFall_Init(Actor* thisx, PlayState* play) { case EN_FALL_TYPE_LODMOON_NO_LERP: case EN_FALL_TYPE_LODMOON: case EN_FALL_TYPE_LODMOON_INVERTED_STONE_TOWER: - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_LODMOON); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_LODMOON); break; case EN_FALL_TYPE_MOONS_TEAR: - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_MOONSTON); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_MOONSTON); break; case EN_FALL_TYPE_STOPPED_MOON_OPEN_MOUTH: - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_FALL2); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_FALL2); break; default: - objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_FALL); + objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_FALL); break; } diff --git a/src/overlays/actors/ovl_En_Geg/z_en_geg.c b/src/overlays/actors/ovl_En_Geg/z_en_geg.c index 727b2ff2a..938874266 100644 --- a/src/overlays/actors/ovl_En_Geg/z_en_geg.c +++ b/src/overlays/actors/ovl_En_Geg/z_en_geg.c @@ -416,12 +416,12 @@ s32 func_80BB1D64(EnGeg* this, PlayState* play) { } void EnGeg_UpdateSkelAnime(EnGeg* this, PlayState* play) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_248].segment); SkelAnime_Update(&this->skelAnime); } void EnGeg_ChangeAnim(EnGeg* this, PlayState* play) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_248].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_248].segment); SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animIndex); } @@ -550,7 +550,7 @@ void func_80BB2520(EnGeg* this, PlayState* play) { break; case 0xD66: - this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); + this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); if (this->unk_248 >= 0) { this->animIndex = ENGEG_ANIM_19; EnGeg_ChangeAnim(this, play); @@ -568,7 +568,7 @@ void func_80BB2520(EnGeg* this, PlayState* play) { case 0xD72: case 0xD75: case 0xD8B: - this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); + this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); if (this->unk_248 >= 0) { this->animIndex = ENGEG_ANIM_4; EnGeg_ChangeAnim(this, play); @@ -713,7 +713,7 @@ void func_80BB2B1C(EnGeg* this, PlayState* play) { CutsceneManager_StartWithPlayerCsAndSetFlag(this->csId, &this->actor); this->unk_496 = 0xD68; Message_ContinueTextbox(play, this->unk_496); - this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_TAISOU); + this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU); if (this->unk_248 >= 0) { this->animIndex = ENGEG_ANIM_13; EnGeg_ChangeAnim(this, play); @@ -926,7 +926,7 @@ void EnGeg_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (this->actor.update != NULL) { - this->unk_248 = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); + this->unk_248 = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); if (this->unk_248 < 0) { Actor_Kill(&this->actor); } diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 495f4712c..299ab5c4b 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -165,7 +165,7 @@ void EnGirlA_InitObjIndex(EnGirlA* this, PlayState* play) { return; } - this->objIndex = Object_GetIndex(&play->objectCtx, sShopItemEntries[params].objectId); + this->objIndex = Object_GetSlot(&play->objectCtx, sShopItemEntries[params].objectId); if (this->objIndex < 0) { Actor_Kill(&this->actor); return; 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 0aecc3233..2f6217411 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -991,10 +991,10 @@ s32 EnGo_UpdateSkelAnime(EnGo* this, PlayState* play) { } if (extraObjIndex >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[extraObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[extraObjIndex].segment); this->skelAnime.playSpeed = this->animPlaySpeed; isAnimFinished = SkelAnime_Update(&this->skelAnime); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objIndex].segment); } return isAnimFinished; @@ -1051,11 +1051,11 @@ s32 EnGo_ChangeAnim(EnGo* this, PlayState* play, EnGoAnimation animIndex) { } if (extraObjIndex >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[extraObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[extraObjIndex].segment); this->animIndex = animIndex; didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex); this->animPlaySpeed = this->skelAnime.playSpeed; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objIndex].segment); } return didAnimChange; 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 088e3fae0..df5718605 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -738,7 +738,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->type = HORSE_TYPE_DONKEY; this->unk_528 = 80.0f; this->boostSpeed = 12; - if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { + if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HA)) < 0) { Actor_Kill(&this->actor); return; } @@ -748,8 +748,8 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { this->type = HORSE_TYPE_2; this->unk_528 = 64.8f; this->boostSpeed = 15; - if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HORSE_LINK_CHILD)) < 0) { - thisx->objBankIndex = Object_Spawn(&play->objectCtx, OBJECT_HORSE_LINK_CHILD); + if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HORSE_LINK_CHILD)) < 0) { + thisx->objBankIndex = Object_SpawnPersistent(&play->objectCtx, OBJECT_HORSE_LINK_CHILD); Actor_SetObjectDependency(play, &this->actor); Skin_Init(&play->state, &this->skin, sSkeletonHeaders[this->type], sAnimationHeaders[this->type][0]); Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); @@ -760,7 +760,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { } else if (ENHORSE_IS_BANDIT_TYPE(&this->actor)) { this->type = HORSE_TYPE_BANDIT; this->boostSpeed = 12; - if ((this->bankIndex = Object_GetIndex(&play->objectCtx, OBJECT_HA)) < 0) { + if ((this->bankIndex = Object_GetSlot(&play->objectCtx, OBJECT_HA)) < 0) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c index cb5d73093..801ad428c 100644 --- a/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c +++ b/src/overlays/actors/ovl_En_Invadepoh_Demo/z_en_invadepoh_demo.c @@ -209,7 +209,7 @@ void EnInvadepohDemo_DoNothing(EnInvadepohDemo* this, PlayState* play) { void EnInvadepohDemo_Alien_Init(EnInvadepohDemo* this, PlayState* play) { Actor_ProcessInitChain(&this->actor, sAlienInitChain); this->actor.flags = ACTOR_FLAG_10 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_80000000; - this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_UCH); + this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_UCH); if (this->objectIndex < 0) { Actor_Kill(&this->actor); return; @@ -220,7 +220,7 @@ void EnInvadepohDemo_Alien_Init(EnInvadepohDemo* this, PlayState* play) { void EnInvadepohDemo_Romani_Init(EnInvadepohDemo* this, PlayState* play) { Actor_ProcessInitChain(&this->actor, sRomaniInitChain); - this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_MA1); + this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_MA1); if (this->objectIndex < 0) { Actor_Kill(&this->actor); return; @@ -233,7 +233,7 @@ void EnInvadepohDemo_Cow_Init(EnInvadepohDemo* this, PlayState* play) { Actor_ProcessInitChain(&this->actor, sCowInitChain); Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_INVADEPOH_DEMO, 0.0f, 0.0f, 0.0f, 0, 0, 0, EN_INVADEPOH_DEMO_TYPE_COW_TAIL); - this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); + this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_COW); if (this->objectIndex < 0) { Actor_Kill(&this->actor); return; @@ -250,7 +250,7 @@ void EnInvadepohDemo_Ufo_Init(EnInvadepohDemo* this, PlayState* play) { void EnInvadepohDemo_CowTail_Init(EnInvadepohDemo* this, PlayState* play) { Actor_ProcessInitChain(&this->actor, sCowTailInitChain); - this->objectIndex = Object_GetIndex(&play->objectCtx, OBJECT_COW); + this->objectIndex = Object_GetSlot(&play->objectCtx, OBJECT_COW); if (this->objectIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 23e19bba2..10dc7bcdf 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -425,7 +425,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { this->unk_197 |= 1; } - this->unk_196 = Object_GetIndex(&play->objectCtx, D_8095F6E8[ENISHI_GET_8(&this->actor)]); + this->unk_196 = Object_GetSlot(&play->objectCtx, D_8095F6E8[ENISHI_GET_8(&this->actor)]); if (this->unk_196 < 0) { Actor_Kill(&this->actor); return; 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 890fafd37..0b246b4df 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -393,7 +393,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { this->isInWater |= 1; } - this->objIndex = Object_GetIndex(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]); + this->objIndex = Object_GetSlot(&play->objectCtx, objectIds[(KUSA_GET_TYPE(&this->actor))]); if (this->objIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Mag/z_en_mag.c b/src/overlays/actors/ovl_En_Mag/z_en_mag.c index 215c2146c..856c13c0d 100644 --- a/src/overlays/actors/ovl_En_Mag/z_en_mag.c +++ b/src/overlays/actors/ovl_En_Mag/z_en_mag.c @@ -707,7 +707,7 @@ void EnMag_DrawInner(Actor* thisx, PlayState* play, Gfx** gfxp) { s16 step; // Set segment 6 to the object, since this will be read by OVERLAY_DISP where it is not set by default. - gSPSegment(gfx++, 0x06, play->objectCtx.status[this->actor.objBankIndex].segment); + gSPSegment(gfx++, 0x06, play->objectCtx.slots[this->actor.objBankIndex].segment); Gfx_SetupDL39_Ptr(&gfx); diff --git a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c index 2a6a7ea1b..6ee4a5f80 100644 --- a/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c +++ b/src/overlays/actors/ovl_En_Nwc/z_en_nwc.c @@ -61,7 +61,7 @@ void EnNwc_Init(Actor* thisx, PlayState* play) { s32 niwObjectIndex; EnNwc* this = THIS; - niwObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_NIW); + niwObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_NIW); if (niwObjectIndex < 0) { // niw object does not exist, we need it for tranformation, despawn Actor_Kill(&this->actor); @@ -248,14 +248,14 @@ void EnNwc_CheckFound(EnNwc* this, PlayState* play) { void EnNwc_LoadNiwSkeleton(EnNwc* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->niwObjectIndex)) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->niwObjectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->niwObjectIndex].segment); SkelAnime_InitFlex(play, &this->niwSkeleton, &gNiwSkeleton, &gNiwIdleAnim, this->jointTable, this->morphTable, NIW_LIMB_MAX); Animation_Change(&this->niwSkeleton, &gNiwIdleAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gNiwIdleAnim), ANIMMODE_LOOP, 0.0f); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->nwcObjectIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->nwcObjectIndex].segment); this->state = NWC_STATE_NIW_LOADED; EnNwc_ToggleState(this); } diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 096b8ff38..45f2b485c 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -275,7 +275,7 @@ void EnOssan_Init(Actor* thisx, PlayState* play) { return; } id = sObjectIds[this->actor.params]; - this->objIndex = Object_GetIndex(&play->objectCtx, id); + this->objIndex = Object_GetSlot(&play->objectCtx, id); if (this->objIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c index a89ec608e..33f79d4f2 100644 --- a/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c +++ b/src/overlays/actors/ovl_En_S_Goro/z_en_s_goro.c @@ -786,18 +786,18 @@ void EnSGoro_UpdateSleeping(EnSGoro* this, PlayState* play) { s32 EnSGoro_UpdateCheerAnimation(EnSGoro* this, PlayState* play) { if (this->animInfoIndex == EN_S_GORO_ANIM_IDLE_STAND) { if (((EnJg*)this->otherGoron)->flags & 1) { - this->loadedObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_TAISOU); + this->loadedObjIndex = Object_GetSlot(&play->objectCtx, OBJECT_TAISOU); if (this->loadedObjIndex >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->loadedObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment); this->animInfoIndex = EN_S_GORO_ANIM_TAISOU_CHEER; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); return true; } } } else if ((this->animInfoIndex == EN_S_GORO_ANIM_TAISOU_CHEER) && !(((EnJg*)this->otherGoron)->flags & 1)) { - this->loadedObjIndex = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); + this->loadedObjIndex = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); if (this->loadedObjIndex >= 0) { - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->loadedObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment); this->animInfoIndex = EN_S_GORO_ANIM_IDLE_STAND; SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, this->animInfoIndex); this->skelAnime.curFrame = this->skelAnime.endFrame; @@ -1307,7 +1307,7 @@ void EnSGoro_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); if (this->actor.update != NULL) { - s32 objIndex = Object_GetIndex(&play->objectCtx, OBJECT_OF1D_MAP); + s32 objIndex = Object_GetSlot(&play->objectCtx, OBJECT_OF1D_MAP); this->loadedObjIndex = objIndex; if (objIndex < 0) { @@ -1329,7 +1329,7 @@ void EnSGoro_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->loadedObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->loadedObjIndex].segment); SkelAnime_Update(&this->skelAnime); if (this->animInfoIndex != EN_S_GORO_ANIM_SLEEPY) { EnSGoro_UpdateAttentionTarget(this, play); diff --git a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c index 2e05f0f57..92b88e462 100644 --- a/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c +++ b/src/overlays/actors/ovl_En_Sekihi/z_en_sekihi.c @@ -69,7 +69,7 @@ void EnSekihi_Init(Actor* thisx, PlayState* play) { SET_WEEKEVENTREG(WEEKEVENTREG_OCEANSIDE_SPIDER_HOUSE_BUYER_MOVED_IN); } - objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[type]); + objectIndex = Object_GetSlot(&play->objectCtx, sObjectIds[type]); if (objectIndex >= 0) { this->objectIndex = objectIndex; } diff --git a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c index e5ab7dbad..8a8be15c4 100644 --- a/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c +++ b/src/overlays/actors/ovl_En_Sob1/z_en_sob1.c @@ -381,7 +381,7 @@ void EnSob1_SpawnShopItems(EnSob1* this, PlayState* play, ShopItem* shopItem) { s32 EnSob1_GetObjIndices(EnSob1* this, PlayState* play, s16* objIds) { if (objIds[1] != OBJECT_ID_MAX) { - this->unusedObjIndex = Object_GetIndex(&play->objectCtx, objIds[1]); + this->unusedObjIndex = Object_GetSlot(&play->objectCtx, objIds[1]); if (this->unusedObjIndex < 0) { return false; } @@ -389,7 +389,7 @@ s32 EnSob1_GetObjIndices(EnSob1* this, PlayState* play, s16* objIds) { this->unusedObjIndex = -1; } if (objIds[2] != OBJECT_ID_MAX) { - this->shopkeeperAnimObjIndex = Object_GetIndex(&play->objectCtx, objIds[2]); + this->shopkeeperAnimObjIndex = Object_GetSlot(&play->objectCtx, objIds[2]); if (this->shopkeeperAnimObjIndex < 0) { return false; } @@ -427,7 +427,7 @@ void EnSob1_Init(Actor* thisx, PlayState* play) { } objIds = sObjectIds[this->shopType]; - this->mainObjIndex = Object_GetIndex(&play->objectCtx, objIds[0]); + this->mainObjIndex = Object_GetSlot(&play->objectCtx, objIds[0]); if (this->mainObjIndex < 0) { Actor_Kill(&this->actor); return; @@ -1345,7 +1345,7 @@ void EnSob1_Blink(EnSob1* this) { } void EnSob1_ChangeObject(EnSob1* this, PlayState* play) { - gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->shopkeeperAnimObjIndex].segment); + gSegments[0x06] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment); } s32 EnSob1_AreObjectsLoaded(EnSob1* this, PlayState* play) { @@ -1363,7 +1363,7 @@ s32 EnSob1_AreObjectsLoaded(EnSob1* this, PlayState* play) { void EnSob1_ZoraShopkeeper_Init(EnSob1* this, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gZoraSkel, NULL, this->jointTable, this->morphTable, ZORA_LIMB_MAX); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->shopkeeperAnimObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment); Animation_Change(&this->skelAnime, &gZoraShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gZoraShopkeeperAnim), ANIMMODE_LOOP, 0.0f); this->actor.draw = EnSob1_ZoraShopkeeper_Draw; @@ -1372,7 +1372,7 @@ void EnSob1_ZoraShopkeeper_Init(EnSob1* this, PlayState* play) { void EnSob1_GoronShopkeeper_Init(EnSob1* this, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gGoronSkel, NULL, this->jointTable, this->morphTable, GORON_LIMB_MAX); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->shopkeeperAnimObjIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->shopkeeperAnimObjIndex].segment); Animation_Change(&this->skelAnime, &gGoronShopkeeperAnim, 1.0f, 0.0f, Animation_GetLastFrame(&gGoronShopkeeperAnim), ANIMMODE_LOOP, 0.0f); this->actor.draw = EnSob1_GoronShopkeeper_Draw; 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 2491ec4ed..e4240de0a 100644 --- a/src/overlays/actors/ovl_En_St/z_en_st.c +++ b/src/overlays/actors/ovl_En_St/z_en_st.c @@ -245,9 +245,9 @@ void func_808A54B0(EnSt* this, PlayState* play) { if ((this->unk_18C & 1) && (this->actor.colChkInfo.health != 0)) { OPEN_DISPS(play->state.gfxCtx); - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->unk_2C0].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->unk_2C0].segment); - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->unk_2C0].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->unk_2C0].segment); Gfx_SetupDL25_Xlu(play->state.gfxCtx); Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW); @@ -842,7 +842,7 @@ void func_808A701C(EnSt* this, PlayState* play) { void EnSt_Init(Actor* thisx, PlayState* play) { EnSt* this = THIS; - this->unk_2C0 = Object_GetIndex(&play->objectCtx, GAMEPLAY_KEEP); + this->unk_2C0 = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP); if (((ENST_GET_3F(&this->actor) != ENST_3F_63) && Flags_GetSwitch(play, ENST_GET_3F(&this->actor))) || (this->unk_2C0 < 0)) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 97aa3ed7b..daf58065f 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -112,12 +112,12 @@ void EnSth_Init(Actor* thisx, PlayState* play) { // this actor can draw two separate bodies that use different objects if (STH_GET_SWAMP_BODY(&this->actor)) { - objectId = Object_GetIndex(&play->objectCtx, OBJECT_AHG); + objectId = Object_GetSlot(&play->objectCtx, OBJECT_AHG); } else { - objectId = Object_GetIndex(&play->objectCtx, OBJECT_STH); + objectId = Object_GetSlot(&play->objectCtx, OBJECT_STH); } this->mainObjectId = objectId; - this->maskOfTruthObjectId = Object_GetIndex(&play->objectCtx, OBJECT_MASK_TRUTH); + this->maskOfTruthObjectId = Object_GetSlot(&play->objectCtx, OBJECT_MASK_TRUTH); Actor_SetScale(&this->actor, 0.01f); Collider_InitAndSetCylinder(play, &this->collider, &this->actor, &sCylinderInit); @@ -740,7 +740,7 @@ void EnSth_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.status[this->maskOfTruthObjectId].segment); + gSPSegment(POLY_OPA_DISP++, 0x0A, play->objectCtx.slots[this->maskOfTruthObjectId].segment); gSPDisplayList(POLY_OPA_DISP++, object_mask_truth_DL_0001A0); Matrix_Pop(); diff --git a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c index 66b87c998..be0821580 100644 --- a/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c +++ b/src/overlays/actors/ovl_En_Sth2/z_en_sth2.c @@ -35,7 +35,7 @@ ActorInit En_Sth2_InitVars = { void EnSth2_Init(Actor* thisx, PlayState* play) { EnSth2* this = THIS; - this->objIndex = Object_GetIndex(&play->objectCtx, OBJECT_STH); + this->objIndex = Object_GetSlot(&play->objectCtx, OBJECT_STH); Actor_SetScale(&this->actor, 0.01f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f); this->unused = 0; diff --git a/src/overlays/actors/ovl_En_Test2/z_en_test2.c b/src/overlays/actors/ovl_En_Test2/z_en_test2.c index e853570f4..d909826bb 100644 --- a/src/overlays/actors/ovl_En_Test2/z_en_test2.c +++ b/src/overlays/actors/ovl_En_Test2/z_en_test2.c @@ -83,7 +83,7 @@ void EnTest2_Update(Actor* thisx, PlayState* play) { EnTest2ModelInfo* modelInfo; EnTest2* this = THIS; - objectIndex = Object_GetIndex(&play->objectCtx, sObjectIds[this->actor.params]); + objectIndex = Object_GetSlot(&play->objectCtx, sObjectIds[this->actor.params]); if (objectIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c index bae88696f..4ae591302 100644 --- a/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c +++ b/src/overlays/actors/ovl_En_Warp_tag/z_en_warp_tag.c @@ -60,7 +60,7 @@ void EnWarptag_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnWarpTag_WaitForPlayer; } else { - if ((this->dangeonKeepObject = Object_GetIndex(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) < 0) { + if ((this->dangeonKeepObject = Object_GetSlot(&play->objectCtx, GAMEPLAY_DANGEON_KEEP)) < 0) { Actor_Kill(&this->dyna.actor); } diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index c5b218815..ba4507b71 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -55,7 +55,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { s32 pad; ItemEtcetera* this = THIS; s32 type = ITEMETCETERA_GET_FF(&this->actor); - s32 objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[type]); + s32 objBankIndex = Object_GetSlot(&play->objectCtx, sObjectIds[type]); if (objBankIndex < 0) { // assert on debug diff --git a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c index 12afce508..3846ecfd0 100644 --- a/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c +++ b/src/overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.c @@ -80,7 +80,7 @@ void ObjEtcetera_Init(Actor* thisx, PlayState* play) { type = DEKU_FLOWER_TYPE_PINK; } - objectIndex = Object_GetIndex(&play->objectCtx, objectIds[type]); + objectIndex = Object_GetSlot(&play->objectCtx, objectIds[type]); if (objectIndex >= 0) { this->objIndex = objectIndex; } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index e33f62f8b..93c79efa6 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -149,7 +149,7 @@ void ObjKibako_Init(Actor* thisx, PlayState* play2) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); Collider_UpdateCylinder(&this->actor, &this->collider); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->bankIndex = Object_GetIndex(&play->objectCtx, sObjectIdList[whichBankIndex]); + this->bankIndex = Object_GetSlot(&play->objectCtx, sObjectIdList[whichBankIndex]); if (this->bankIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c index d783c88e8..770f2131d 100644 --- a/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c +++ b/src/overlays/actors/ovl_Obj_Nozoki/z_obj_nozoki.c @@ -93,7 +93,7 @@ void ObjNozoki_Destroy(Actor* thisx, PlayState* play) { } void func_80BA2514(ObjNozoki* this, PlayState* play) { - s32 sp24 = Object_GetIndex(&play->objectCtx, D_80BA34B8[this->unk_15C]); + s32 sp24 = Object_GetSlot(&play->objectCtx, D_80BA34B8[this->unk_15C]); if (sp24 < 0) { Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c index 649343554..d8b04684b 100644 --- a/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c +++ b/src/overlays/actors/ovl_Obj_Purify/z_obj_purify.c @@ -130,7 +130,7 @@ void ObjPurify_Init(Actor* thisx, PlayState* play) { if (sp20 == 1) { DynaPolyActor_Init(&this->dyna, 0); } - this->objIndex = Object_GetIndex(&play->objectCtx, info->objectId); + this->objIndex = Object_GetSlot(&play->objectCtx, info->objectId); if (this->objIndex < 0) { Actor_Kill(&this->dyna.actor); } else if (sp20 == 0) { diff --git a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c index 3bedc3ea4..9a0c9d1c3 100644 --- a/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c +++ b/src/overlays/actors/ovl_Obj_Pzlblock/z_obj_pzlblock.c @@ -207,7 +207,7 @@ void ObjPzlblock_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); - this->unk_17A = Object_GetIndex(&play->objectCtx, sp24->unk_00); + this->unk_17A = Object_GetSlot(&play->objectCtx, sp24->unk_00); if (sp28 == 0) { func_809A3D1C(this); 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 d6f8b468b..1a316dfab 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -186,7 +186,7 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { this->cylinderCollider.dim.radius = sPotTypeData[type].radius; this->cylinderCollider.dim.height = sPotTypeData[type].height; this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->objBankIndex = Object_GetIndex(&play->objectCtx, sPotTypeData[type].objId); + this->objBankIndex = Object_GetSlot(&play->objectCtx, sPotTypeData[type].objId); if (this->objBankIndex < 0) { Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 57322fb0f..d04907e50 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -10661,7 +10661,7 @@ void Player_Init(Actor* thisx, PlayState* play) { if (this->actor.shape.rot.x != 0) { this->transformation = this->actor.shape.rot.x - 1; - objBankIndex = Object_GetIndex(&play->objectCtx, gPlayerFormObjectIndices[this->transformation]); + objBankIndex = Object_GetSlot(&play->objectCtx, gPlayerFormObjectIndices[this->transformation]); this->actor.objBankIndex = objBankIndex; if (objBankIndex < 0) { Actor_Kill(&this->actor); @@ -12380,7 +12380,7 @@ void Player_Update(Actor* thisx, PlayState* play) { // This block is a leftover dog-following mechanic from OoT if (gSaveContext.dogParams < 0) { - if (Object_GetIndex(&play->objectCtx, OBJECT_DOG) < 0) { + if (Object_GetSlot(&play->objectCtx, OBJECT_DOG) < 0) { gSaveContext.dogParams = 0; } else { Actor* dog; diff --git a/src/overlays/effects/ovl_Effect_En_Ice_Block/z_eff_en_ice_block.c b/src/overlays/effects/ovl_Effect_En_Ice_Block/z_eff_en_ice_block.c index e63d414d9..a7161d37e 100644 --- a/src/overlays/effects/ovl_Effect_En_Ice_Block/z_eff_en_ice_block.c +++ b/src/overlays/effects/ovl_Effect_En_Ice_Block/z_eff_en_ice_block.c @@ -25,7 +25,7 @@ EffectSsInit Effect_En_Ice_Block_InitVars = { #define rRotVel regs[3] u32 EffectEnIceBlock_CheckIceBlockObject(EffectSs* this, PlayState* play) { - if (((this->rObjId = Object_GetIndex(&play->objectCtx, OBJECT_ICE_BLOCK)) < 0) || + if (((this->rObjId = Object_GetSlot(&play->objectCtx, OBJECT_ICE_BLOCK)) < 0) || (!Object_IsLoaded(&play->objectCtx, this->rObjId))) { this->life = -1; this->draw = NULL; @@ -63,7 +63,7 @@ void EffectEnIceBlock_Draw(PlayState* play, u32 index, EffectSs* this) { OPEN_DISPS(gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x06, - play->objectCtx.status[this->rObjId].segment); // object: OBJECT_ICE_BLOCK + play->objectCtx.slots[this->rObjId].segment); // object: OBJECT_ICE_BLOCK Gfx_SetupDL25_Xlu(play->state.gfxCtx); Matrix_Translate(this->pos.x, this->pos.y, this->pos.z, MTXMODE_NEW); diff --git a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c index 87e50fb5f..5febef413 100644 --- a/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c +++ b/src/overlays/effects/ovl_Effect_Ss_D_Fire/z_eff_ss_d_fire.c @@ -29,7 +29,7 @@ EffectSsInit Effect_Ss_D_Fire_InitVars = { static TexturePtr sFireTextures[] = { gDodongoFire0Tex, gDodongoFire1Tex, gDodongoFire2Tex, gDodongoFire3Tex }; s32 EffectSsDFire_CheckForObject(EffectSs* this, PlayState* play) { - if (((this->rObjectIndex = Object_GetIndex(&play->objectCtx, OBJECT_DODONGO)) < 0) || + if (((this->rObjectIndex = Object_GetSlot(&play->objectCtx, OBJECT_DODONGO)) < 0) || !Object_IsLoaded(&play->objectCtx, this->rObjectIndex)) { this->life = -1; this->draw = NULL; @@ -69,7 +69,7 @@ void EffectSsDFire_Draw(PlayState* play, u32 index, EffectSs* this) { f32 scale; if (EffectSsDFire_CheckForObject(this, play)) { - object = play->objectCtx.status[this->rObjectIndex].segment; + object = play->objectCtx.slots[this->rObjectIndex].segment; OPEN_DISPS(gfxCtx); diff --git a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c index e3daa2530..e15e58f25 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c +++ b/src/overlays/effects/ovl_Effect_Ss_Extra/z_eff_ss_extra.c @@ -33,11 +33,11 @@ u32 EffectSsExtra_Init(PlayState* play, u32 index, EffectSs* this, void* initPar EffectSsExtraInitParams* params = PARAMS; s32 objIndex; - objIndex = Object_GetIndex(&play->objectCtx, OBJECT_YABUSAME_POINT); + objIndex = Object_GetSlot(&play->objectCtx, OBJECT_YABUSAME_POINT); if ((objIndex >= 0) && (Object_IsLoaded(&play->objectCtx, objIndex))) { void* segBackup = gSegments[6]; - gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objIndex].segment); + gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[objIndex].segment); this->pos = params->pos; this->velocity = params->velocity; @@ -62,7 +62,7 @@ void EffectSsExtra_Draw(PlayState* play, u32 index, EffectSs* this) { void* storedSegment; scale = this->rScale / 100.0f; - storedSegment = play->objectCtx.status[this->rObjId].segment; + storedSegment = play->objectCtx.slots[this->rObjId].segment; OPEN_DISPS(play->state.gfxCtx); diff --git a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c index 15444ad47..828570685 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c +++ b/src/overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.c @@ -27,7 +27,7 @@ EffectSsInit Effect_Ss_Hahen_InitVars = { }; void EffectSsHahen_CheckForObject(EffectSs* this, PlayState* play) { - if (((this->rObjBankIndex = Object_GetIndex(&play->objectCtx, this->rObjId)) < 0) || + if (((this->rObjBankIndex = Object_GetSlot(&play->objectCtx, this->rObjId)) < 0) || !Object_IsLoaded(&play->objectCtx, this->rObjBankIndex)) { this->life = -1; this->draw = NULL; @@ -69,7 +69,7 @@ void EffectSsHahen_DrawOpa(PlayState* play, EffectSs* this) { OPEN_DISPS(gfxCtx); if (this->rObjId != HAHEN_OBJECT_DEFAULT) { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjBankIndex].segment); } gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Gfx_SetupDL25_Opa(play->state.gfxCtx); @@ -85,7 +85,7 @@ void EffectSsHahen_DrawXlu(PlayState* play, EffectSs* this) { OPEN_DISPS(gfxCtx); if (this->rObjId != -1) { - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->rObjBankIndex].segment); } gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Gfx_SetupDL25_Xlu(play->state.gfxCtx); diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index c552e7c50..bde2227d2 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -95,9 +95,9 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { OPEN_DISPS(gfxCtx); if (this->rObjId != KAKERA_OBJECT_DEFAULT) { if ((((this->rReg4 >> 7) & 1) << 7) == 0x80) { - gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); + gSPSegment(POLY_XLU_DISP++, 0x06, play->objectCtx.slots[this->rObjBankIndex].segment); } else { - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjBankIndex].segment); } } @@ -127,7 +127,7 @@ void EffectSsKakera_Draw(PlayState* play, u32 index, EffectSs* this) { } void EffectSsKakera_CheckForObject(EffectSs* this, PlayState* play) { - this->rObjBankIndex = Object_GetIndex(&play->objectCtx, this->rObjId); + this->rObjBankIndex = Object_GetSlot(&play->objectCtx, this->rObjId); if ((this->rObjBankIndex < 0) || (!Object_IsLoaded(&play->objectCtx, this->rObjBankIndex))) { this->life = 0; this->draw = NULL; 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 c1615e2bf..fcdca875f 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 @@ -25,7 +25,7 @@ u32 EffectSsStick_Init(PlayState* play, u32 index, EffectSs* this, void* initPar EffectSsStickInitParams* initParams = PARAMS; Vec3f pos; - this->rObjBankIndex = Object_GetIndex(&play->objectCtx, GAMEPLAY_KEEP); + this->rObjBankIndex = Object_GetSlot(&play->objectCtx, GAMEPLAY_KEEP); pos = initParams->pos; this->pos = pos; this->vec = pos; @@ -51,7 +51,7 @@ void EffectSsStick_Draw(PlayState* play, u32 index, EffectSs* this) { Matrix_RotateZYX(0, this->rYaw, 0, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); Gfx_SetupDL25_Opa(gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->rObjBankIndex].segment); + gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->rObjBankIndex].segment); gSPSegment(POLY_OPA_DISP++, 0x0C, gCullBackDList); gSPDisplayList(POLY_OPA_DISP++, gDekuStickDL); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 79ab56b45..0d5c950c6 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2415,10 +2415,10 @@ 0x8012F1BC:("Inventory_IncrementSkullTokenCount",), 0x8012F22C:("Inventory_GetSkullTokenCount",), 0x8012F278:("Inventory_SaveLotteryCodeGuess",), - 0x8012F2E0:("Object_Spawn",), - 0x8012F3D0:("Object_InitBank",), - 0x8012F4FC:("Object_UpdateBank",), - 0x8012F608:("Object_GetIndex",), + 0x8012F2E0:("Object_SpawnPersistent",), + 0x8012F3D0:("Object_InitContext",), + 0x8012F4FC:("Object_UpdateEntries",), + 0x8012F608:("Object_GetSlot",), 0x8012F668:("Object_IsLoaded",), 0x8012F698:("Object_LoadAll",), 0x8012F73C:("func_8012F73C",), diff --git a/tools/namefixer.py b/tools/namefixer.py index 43e554975..1fe4ce07f 100755 --- a/tools/namefixer.py +++ b/tools/namefixer.py @@ -774,6 +774,9 @@ wordReplace = { "func_80133038": "Schedule_RunScript", + "Object_GetIndex": "Object_GetSlot", + "Object_Spawn": "Object_SpawnPersistent", + "EffectSsKiraKira_SpawnSmallYellow": "EffectSsKirakira_SpawnSmallYellow", "EffectSsKiraKira_SpawnSmall": "EffectSsKirakira_SpawnSmall", "EffectSsKiraKira_SpawnDispersed": "EffectSsKirakira_SpawnDispersed", @@ -1156,6 +1159,7 @@ wordReplace = { "play->roomCtx.curRoom.unk3": "play->roomCtx.curRoom.behaviorType1", "play->roomCtx.curRoom.unk2": "play->roomCtx.curRoom.behaviorType2", "play->roomCtx.unk31": "play->roomCtx.status", + "play->objectCtx.status": "play->objectCtx.slots", "actorCtx.unkC": "actorCtx.halfDaysBit", "actorCtx.unk1F4": "actorCtx.playerImpact.type", diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index 762334814..02e1bf9cd 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1929,10 +1929,10 @@ asm/non_matchings/code/code_8012EC80/Inventory_SaveDekuPlaygroundHighScore.s,Inv asm/non_matchings/code/code_8012EC80/Inventory_IncrementSkullTokenCount.s,Inventory_IncrementSkullTokenCount,0x8012F1BC,0x1C asm/non_matchings/code/code_8012EC80/Inventory_GetSkullTokenCount.s,Inventory_GetSkullTokenCount,0x8012F22C,0x13 asm/non_matchings/code/code_8012EC80/Inventory_SaveLotteryCodeGuess.s,Inventory_SaveLotteryCodeGuess,0x8012F278,0x16 -asm/non_matchings/code/z_scene/Object_Spawn.s,Object_Spawn,0x8012F2E0,0x3C -asm/non_matchings/code/z_scene/Object_InitBank.s,Object_InitBank,0x8012F3D0,0x4B -asm/non_matchings/code/z_scene/Object_UpdateBank.s,Object_UpdateBank,0x8012F4FC,0x43 -asm/non_matchings/code/z_scene/Object_GetIndex.s,Object_GetIndex,0x8012F608,0x18 +asm/non_matchings/code/z_scene/Object_SpawnPersistent.s,Object_SpawnPersistent,0x8012F2E0,0x3C +asm/non_matchings/code/z_scene/Object_InitContext.s,Object_InitContext,0x8012F3D0,0x4B +asm/non_matchings/code/z_scene/Object_UpdateEntries.s,Object_UpdateEntries,0x8012F4FC,0x43 +asm/non_matchings/code/z_scene/Object_GetSlot.s,Object_GetSlot,0x8012F608,0x18 asm/non_matchings/code/z_scene/Object_IsLoaded.s,Object_IsLoaded,0x8012F668,0xC asm/non_matchings/code/z_scene/Object_LoadAll.s,Object_LoadAll,0x8012F698,0x29 asm/non_matchings/code/z_scene/func_8012F73C.s,func_8012F73C,0x8012F73C,0x18