From 629584b1bc5a3573bcc12a21029a6e6c53559d75 Mon Sep 17 00:00:00 2001 From: mzxrules Date: Fri, 6 Sep 2024 12:45:30 -0400 Subject: [PATCH] Update Room Documentation (#1678) * Implement Room Documentation * nit * Resolve Dragorn fixes (OoT) * Resolve Fig suggestions, fix comment wording (OoT) * hensldm nit --- include/functions.h | 8 +- include/z64play.h | 3 +- include/z64scene.h | 17 ++-- src/code/z_map_disp.c | 4 +- src/code/z_play.c | 7 +- src/code/z_room.c | 99 +++++++++++++------ src/code/z_scene.c | 4 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 4 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 14 +-- .../actors/ovl_player_actor/z_player.c | 12 +-- tools/disasm/functions.txt | 8 +- tools/sizes/code_functions.csv | 8 +- 12 files changed, 116 insertions(+), 72 deletions(-) diff --git a/include/functions.h b/include/functions.h index e4a9e70c9a..39493ff043 100644 --- a/include/functions.h +++ b/include/functions.h @@ -223,12 +223,12 @@ void GetItem_Draw(PlayState* play, s16 drawId); void Room_Noop(PlayState* play, Room* room, Input* input, s32 arg3); void Room_Init(PlayState* play, RoomContext* roomCtx); -size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx); -s32 Room_StartRoomTransition(PlayState* play, RoomContext* roomCtx, s32 index); -s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx); +size_t Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx); +s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 index); +s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx); void Room_Draw(PlayState* play, Room* room, u32 flags); -void func_8012EBF8(PlayState* play, RoomContext* roomCtx); +void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx); void func_80183070(void); diff --git a/include/z64play.h b/include/z64play.h index f1d51034cd..e79b202497 100644 --- a/include/z64play.h +++ b/include/z64play.h @@ -87,8 +87,7 @@ typedef struct PlayState { /* 0x18844 */ u8 unk_18844; // bool /* 0x18845 */ u8 haltAllActors; /* 0x18846 */ s16 numSetupActors; - /* 0x18848 */ u8 numRooms; - /* 0x1884C */ RomFile* roomList; + /* 0x18848 */ RoomList roomList; /* 0x18850 */ ActorEntry* linkActorEntry; /* 0x18854 */ ActorEntry* setupActorList; /* 0x18858 */ ActorCsCamInfo* actorCsCamList; diff --git a/include/z64scene.h b/include/z64scene.h index d2bfc787e0..674c4d9129 100644 --- a/include/z64scene.h +++ b/include/z64scene.h @@ -332,14 +332,13 @@ typedef enum { } RoomBehaviorType2; typedef struct { - /* 0x00 */ s8 num; + /* 0x00 */ s8 num; // -1 is invalid room /* 0x01 */ u8 unk1; /* 0x02 */ u8 behaviorType2; /* 0x03 */ u8 behaviorType1; /* 0x04 */ s8 echo; /* 0x05 */ u8 lensMode; /* 0x06 */ u8 enablePosLights; - /* 0x07 */ UNK_TYPE1 pad7[0x1]; /* 0x08 */ RoomShape* roomShape; /* 0x0C */ void* segment; /* 0x10 */ UNK_TYPE1 pad10[0x4]; @@ -348,11 +347,10 @@ typedef struct { typedef struct RoomContext { /* 0x00 */ Room curRoom; /* 0x14 */ Room prevRoom; - /* 0x28 */ void* roomMemPages[2]; // In a scene with transitions, roomMemory is split between two pages that toggle each transition. This is one continuous range, as the second page allocates from the end - /* 0x30 */ u8 activeMemPage; // 0 - First page in memory, 1 - Second page - /* 0x31 */ s8 status; - /* 0x32 */ UNK_TYPE1 pad32[0x2]; - /* 0x34 */ void* activeRoomVram; + /* 0x28 */ void* bufPtrs[2]; // Start and end pointers for the room buffer. Can be split into two pages, where page 0 is allocated from the start pointer and page 1 is allocated from the end pointer. + /* 0x30 */ u8 activeBufPage; // 0 - First page in memory, 1 - Second page + /* 0x31 */ s8 status; // 0 - Free for new room request, 1 - DmaRequest for a new room is in progress + /* 0x34 */ void* roomRequestAddr; // Pointer to where the requested room segment will be stored /* 0x38 */ DmaRequest dmaRequest; /* 0x58 */ OSMesgQueue loadQueue; /* 0x70 */ OSMesg loadMsg[1]; @@ -362,6 +360,11 @@ typedef struct RoomContext { /* 0x7A */ UNK_TYPE2 unk7A[3]; } RoomContext; // size = 0x80 +typedef struct RoomList { + /* 0x0 */ u8 count; + /* 0x4 */ RomFile* romFiles; // Array of rom addresses for each room in a scene +} RoomList; // size = 0x8 + typedef void(*RoomDrawHandler)(struct PlayState* play, Room* room, u32 flags); typedef struct TransitionActorEntry { diff --git a/src/code/z_map_disp.c b/src/code/z_map_disp.c index 7fbae707d3..5718e1c844 100644 --- a/src/code/z_map_disp.c +++ b/src/code/z_map_disp.c @@ -509,7 +509,7 @@ void MapDisp_Init(PlayState* play) { sMapDisp.swapAnimTimer = 0; if (!Map_IsInBossScene(play)) { - sSceneNumRooms = play->numRooms; + sSceneNumRooms = play->roomList.count; } sMapDisp.texBuff0 = THA_AllocTailAlign16(&play->state.tha, 0x4000); sMapDisp.texBuff1 = THA_AllocTailAlign16(&play->state.tha, 0x4000); @@ -691,7 +691,7 @@ void MapDisp_InitMapData(PlayState* play, void* segmentAddress) { s32 i; if (!Map_IsInBossScene(play)) { - sSceneNumRooms = play->numRooms; + sSceneNumRooms = play->roomList.count; mapDataScene = Lib_SegmentedToVirtual(segmentAddress); sMapDataScene = *mapDataScene; mapDataRooms = Lib_SegmentedToVirtual(mapDataScene->rooms); diff --git a/src/code/z_play.c b/src/code/z_play.c index 188336c00b..1c63b6a4b2 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -993,7 +993,7 @@ void Play_UpdateMain(PlayState* this) { this->envCtx.fillScreen = false; } } else { - Room_HandleLoadCallbacks(this, &this->roomCtx); + Room_ProcessRoomRequest(this, &this->roomCtx); CollisionCheck_AT(this, &this->colChkCtx); CollisionCheck_OC(this, &this->colChkCtx); CollisionCheck_Damage(this, &this->colChkCtx); @@ -1597,7 +1597,7 @@ void Play_SpawnScene(PlayState* this, s32 sceneId, s32 spawn) { scene->unk_D = 0; gSegments[0x02] = OS_K0_TO_PHYSICAL(this->sceneSegment); Play_InitScene(this, spawn); - Room_AllocateAndLoad(this, &this->roomCtx); + Room_SetupFirstRoom(this, &this->roomCtx); } void Play_GetScreenPos(PlayState* this, Vec3f* worldPos, Vec3f* screenPos) { @@ -2311,7 +2311,8 @@ void Play_Init(GameState* thisx) { Actor_InitContext(this, &this->actorCtx, this->linkActorEntry); - while (!Room_HandleLoadCallbacks(this, &this->roomCtx)) {} + // Busyloop until the room loads + while (!Room_ProcessRoomRequest(this, &this->roomCtx)) {} if ((CURRENT_DAY != 0) && ((this->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) || (this->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_5))) { diff --git a/src/code/z_room.c b/src/code/z_room.c index 3478446306..70573b0c8f 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -481,8 +481,13 @@ void Room_Init(PlayState* play, RoomContext* roomCtx) { } } -size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) { - size_t maxRoomSize = 0; +/** + * Allocates memory for rooms and fetches the first room that the player will spawn into. + * + * @return u32 size of the buffer reserved for room data + */ +size_t Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx) { + size_t roomBufferSize = 0; size_t roomSize; s32 i; s32 j; @@ -493,17 +498,19 @@ size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) { size_t cumulRoomSize; s32 pad[2]; + // Set roomBufferSize to the largest room { - RomFile* roomList = play->roomList; + RomFile* roomList = play->roomList.romFiles; - for (i = 0; i < play->numRooms; i++) { + for (i = 0; i < play->roomList.count; i++) { roomSize = roomList[i].vromEnd - roomList[i].vromStart; - maxRoomSize = MAX(roomSize, maxRoomSize); + roomBufferSize = MAX(roomSize, roomBufferSize); } } + // If there any rooms are connected, find their combined size and update roomBufferSize if larger if ((u32)play->transitionActors.count != 0) { - RomFile* roomList = play->roomList; + RomFile* roomList = play->roomList.romFiles; TransitionActorEntry* transitionActor = &play->transitionActors.list[0]; for (j = 0; j < play->transitionActors.count; j++) { @@ -513,17 +520,17 @@ size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) { backRoomSize = (backRoom < 0) ? 0 : roomList[backRoom].vromEnd - roomList[backRoom].vromStart; cumulRoomSize = (frontRoom != backRoom) ? frontRoomSize + backRoomSize : frontRoomSize; - maxRoomSize = MAX(cumulRoomSize, maxRoomSize); + roomBufferSize = MAX(cumulRoomSize, roomBufferSize); transitionActor++; } } - roomCtx->roomMemPages[0] = THA_AllocTailAlign16(&play->state.tha, maxRoomSize); - if (roomCtx->roomMemPages[0] == NULL) { + roomCtx->bufPtrs[0] = THA_AllocTailAlign16(&play->state.tha, roomBufferSize); + if (roomCtx->bufPtrs[0] == NULL) { _dbg_hungup("../z_room.c", 1078); } - roomCtx->roomMemPages[1] = (void*)((uintptr_t)roomCtx->roomMemPages[0] + maxRoomSize); - roomCtx->activeMemPage = 0; + roomCtx->bufPtrs[1] = (void*)((uintptr_t)roomCtx->bufPtrs[0] + roomBufferSize); + roomCtx->activeBufPage = 0; roomCtx->status = 0; if ((gSaveContext.respawnFlag != 0) && (gSaveContext.respawnFlag != -2) && (gSaveContext.respawnFlag != -7)) { @@ -542,12 +549,31 @@ size_t Room_AllocateAndLoad(PlayState* play, RoomContext* roomCtx) { frontRoom = play->setupEntranceList[play->curSpawn].room; } - Room_StartRoomTransition(play, roomCtx, frontRoom); + // Load into a room for the first time. + // Since curRoom was initialized to `room` = -1 and `segment` = NULL in Play_InitScene, the previous room + // will also be initialized to the nulled state when this function completes. + Room_RequestNewRoom(play, roomCtx, frontRoom); - return maxRoomSize; + return roomBufferSize; } -s32 Room_StartRoomTransition(PlayState* play, RoomContext* roomCtx, s32 index) { +/** + * Tries to create an asynchronous request to transfer room data into memory. + * If successful, the requested room will be loaded into memory and becomes the new current room; the room that was + * current before becomes the previous room. + * + * Room_RequestNewRoom will be blocked from loading new rooms until Room_ProcessRoomRequest completes room + * initialization. + * + * Calling Room_RequestNewRoom outside of Room_SetupFirstRoom will allow for two rooms being initialized simultaneously. + * This allows an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them. Calling + * Room_FinishRoomChange afterward will finalize the room swap. + * + * @param roomNum is the id of the room to load. roomNum must NOT be the same id as curRoom.num, since this will create + * duplicate actor instances that cannot be cleaned up by calling Room_FinishRoomChange + * @returns bool false if the request could not be created. + */ +s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 index) { if (roomCtx->status == 0) { size_t size; @@ -556,33 +582,40 @@ s32 Room_StartRoomTransition(PlayState* play, RoomContext* roomCtx, s32 index) { roomCtx->curRoom.segment = NULL; roomCtx->status = 1; - size = play->roomList[index].vromEnd - play->roomList[index].vromStart; - roomCtx->activeRoomVram = (void*)(ALIGN16((uintptr_t)roomCtx->roomMemPages[roomCtx->activeMemPage] - - (size + 8) * roomCtx->activeMemPage - 7)); + size = play->roomList.romFiles[index].vromEnd - play->roomList.romFiles[index].vromStart; + roomCtx->roomRequestAddr = (void*)(ALIGN16((uintptr_t)roomCtx->bufPtrs[roomCtx->activeBufPage] - + (size + 8) * roomCtx->activeBufPage - 7)); osCreateMesgQueue(&roomCtx->loadQueue, roomCtx->loadMsg, ARRAY_COUNT(roomCtx->loadMsg)); - DmaMgr_RequestAsync(&roomCtx->dmaRequest, roomCtx->activeRoomVram, play->roomList[index].vromStart, size, 0, - &roomCtx->loadQueue, NULL); - roomCtx->activeMemPage ^= 1; + DmaMgr_RequestAsync(&roomCtx->dmaRequest, roomCtx->roomRequestAddr, play->roomList.romFiles[index].vromStart, + size, 0, &roomCtx->loadQueue, NULL); + roomCtx->activeBufPage ^= 1; - return 1; + return true; } - return 0; + return false; } -s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) { +/** + * Completes room initialization for the room requested by a call to Room_RequestNewRoom. + * This function does not block the thread if the room data is still being transferred. + * + * @returns bool false if a dma transfer is in progress. + */ +s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx) { if (roomCtx->status == 1) { if (osRecvMesg(&roomCtx->loadQueue, NULL, OS_MESG_NOBLOCK) == 0) { roomCtx->status = 0; - roomCtx->curRoom.segment = roomCtx->activeRoomVram; - gSegments[0x03] = OS_K0_TO_PHYSICAL(roomCtx->activeRoomVram); + roomCtx->curRoom.segment = roomCtx->roomRequestAddr; + gSegments[0x03] = OS_K0_TO_PHYSICAL(roomCtx->curRoom.segment); Scene_ExecuteCommands(play, roomCtx->curRoom.segment); func_80123140(play, GET_PLAYER(play)); Actor_SpawnTransitionActors(play, &play->actorCtx); - if (((play->sceneId != SCENE_IKANA) || (roomCtx->curRoom.num != 1)) && (play->sceneId != SCENE_IKNINSIDE)) { + if (!(((play->sceneId == SCENE_IKANA) && (roomCtx->curRoom.num == 1)) || + (play->sceneId == SCENE_IKNINSIDE))) { play->envCtx.lightSettingOverride = LIGHT_SETTING_OVERRIDE_NONE; play->envCtx.lightBlendOverride = LIGHT_BLEND_OVERRIDE_NONE; } @@ -591,11 +624,11 @@ s32 Room_HandleLoadCallbacks(PlayState* play, RoomContext* roomCtx) { Environment_StopStormNatureAmbience(play); } } else { - return 0; + return false; } } - return 1; + return true; } RoomDrawHandler sRoomDrawHandlers[] = { @@ -613,9 +646,17 @@ void Room_Draw(PlayState* play, Room* room, u32 flags) { return; } -void func_8012EBF8(PlayState* play, RoomContext* roomCtx) { +/** + * Finalizes a swap between two rooms. + * + * When a new room is created with Room_RequestNewRoom, the previous room and its actors remain in memory. This allows + * an actor like ACTOR_EN_HOLL to seamlessly swap the two rooms as the player moves between them. + */ +void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx) { + // Delete the previous room roomCtx->prevRoom.num = -1; roomCtx->prevRoom.segment = NULL; + func_800BA798(play, &play->actorCtx); Actor_SpawnTransitionActors(play, &play->actorCtx); if (roomCtx->curRoom.num > -1) { diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 175a0abd45..e7a2c50dbb 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -220,8 +220,8 @@ void Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd) { // SceneTableEntry Header Command 0x04: Room List void Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) { - play->numRooms = cmd->roomList.num; - play->roomList = Lib_SegmentedToVirtual(cmd->roomList.segment); + play->roomList.count = cmd->roomList.num; + play->roomList.romFiles = Lib_SegmentedToVirtual(cmd->roomList.segment); } // SceneTableEntry Header Command 0x06: Entrance List 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 314ede2736..268474c642 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -568,9 +568,9 @@ void func_808A1884(DoorShutter* this, PlayState* play) { play->roomCtx.curRoom = play->roomCtx.prevRoom; play->roomCtx.prevRoom = temp; - play->roomCtx.activeMemPage ^= 1; + play->roomCtx.activeBufPage ^= 1; } - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } this->slidingDoor.unk_15C = 0; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index b81196a4fb..36cf65332e 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -142,7 +142,7 @@ void EnHoll_ChangeRooms(PlayState* play) { play->roomCtx.curRoom = play->roomCtx.prevRoom; play->roomCtx.prevRoom = tempRoom; - play->roomCtx.activeMemPage ^= 1; + play->roomCtx.activeBufPage ^= 1; } void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) { @@ -187,7 +187,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) { if (play->roomCtx.prevRoom.num == this->actor.room) { EnHoll_ChangeRooms(play); } - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } } else if (this->type == EN_HOLL_TYPE_SCENE_CHANGER) { play->nextEntrance = play->setupExitList[EN_HOLL_GET_EXIT_LIST_INDEX(&this->actor)]; @@ -198,7 +198,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) { } else { this->actor.room = play->transitionActors.list[enHollId].sides[this->playerSide ^ 1].room; if (play->roomCtx.prevRoom.num < 0) { - Room_StartRoomTransition(play, &play->roomCtx, this->actor.room); + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room); if (this == sInstancePlayingSound) { sInstancePlayingSound = NULL; } @@ -242,7 +242,7 @@ void EnHoll_TransparentIdle(EnHoll* this, PlayState* play) { this->actor.room = room; if ((this->actor.room != play->roomCtx.curRoom.num) && - Room_StartRoomTransition(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { this->actionFunc = EnHoll_RoomTransitionIdle; } } @@ -267,7 +267,7 @@ void EnHoll_VerticalBgCoverIdle(EnHoll* this, PlayState* play) { this->actor.room = play->transitionActors.list[enHollId].sides[playerSide].room; if ((this->actor.room != play->roomCtx.curRoom.num) && - Room_StartRoomTransition(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { this->actionFunc = EnHoll_RoomTransitionIdle; this->bgCoverAlphaActive = true; } @@ -290,7 +290,7 @@ void EnHoll_VerticalIdle(EnHoll* this, PlayState* play) { this->actor.room = play->transitionActors.list[enHollId].sides[playerSide].room; if ((this->actor.room != play->roomCtx.curRoom.num) && - Room_StartRoomTransition(play, &play->roomCtx, this->actor.room)) { + Room_RequestNewRoom(play, &play->roomCtx, this->actor.room)) { this->actionFunc = EnHoll_RoomTransitionIdle; } } @@ -299,7 +299,7 @@ void EnHoll_VerticalIdle(EnHoll* this, PlayState* play) { void EnHoll_RoomTransitionIdle(EnHoll* this, PlayState* play) { if (play->roomCtx.status == 0) { - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); if (play->bgCoverAlpha == 0) { this->bgCoverAlphaActive = false; } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 6693fc1fcd..77672f335b 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -6534,7 +6534,7 @@ s32 Player_ActionChange_1(Player* this, PlayState* play) { .room; if ((roomNum >= 0) && (roomNum != play->roomCtx.curRoom.num)) { - Room_StartRoomTransition(play, &play->roomCtx, roomNum); + Room_RequestNewRoom(play, &play->roomCtx, roomNum); } } } @@ -13738,14 +13738,14 @@ void Player_Action_1(Player* this, PlayState* play) { play->roomCtx.curRoom.segment = NULL; play->roomCtx.prevRoom.segment = NULL; - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); this->av2.actionVar2 = -1; this->av1.actionVar1 = this->unk_3CE; } } } } else if (this->av2.actionVar2 < 0) { - if (Room_StartRoomTransition(play, &play->roomCtx, this->av1.actionVar1)) { + if (Room_RequestNewRoom(play, &play->roomCtx, this->av1.actionVar1)) { Map_InitRoomData(play, play->roomCtx.curRoom.num); Map_SetAreaEntrypoint(play); this->av2.actionVar2 = 5; @@ -15220,7 +15220,7 @@ void Player_Action_35(Player* this, PlayState* play) { play->roomCtx.curRoom.num = -1; play->roomCtx.curRoom.segment = NULL; - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } else { static Vec3f D_8085D62C = { 0.0f, 0.0f, 0.0f }; static Vec3f D_8085D638 = { 0.0f, 0.0f, 0.0f }; @@ -15228,7 +15228,7 @@ void Player_Action_35(Player* this, PlayState* play) { R_PLAY_FILL_SCREEN_ON = -16; if (play->roomCtx.curRoom.num < 0) { - Room_StartRoomTransition(play, &play->roomCtx, temp_v1_4->sides[0].room); + Room_RequestNewRoom(play, &play->roomCtx, temp_v1_4->sides[0].room); play->roomCtx.prevRoom.num = -1; play->roomCtx.prevRoom.segment = NULL; } @@ -15336,7 +15336,7 @@ void Player_Action_36(Player* this, PlayState* play) { if ((this->actor.category == ACTORCAT_PLAYER) && !framedDoor) { if (play->roomCtx.prevRoom.num >= 0) { - func_8012EBF8(play, &play->roomCtx); + Room_FinishRoomChange(play, &play->roomCtx); } func_800E0238(Play_GetCamera(play, CAM_ID_MAIN)); diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 14e69e9b07..27b465c246 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -2400,11 +2400,11 @@ 0x8012E32C:("Room_DrawImageMulti",), 0x8012E6A8:("Room_DrawImage",), 0x8012E710:("Room_Init",), - 0x8012E750:("Room_AllocateAndLoad",), - 0x8012E96C:("Room_StartRoomTransition",), - 0x8012EAA8:("Room_HandleLoadCallbacks",), + 0x8012E750:("Room_SetupFirstRoom",), + 0x8012E96C:("Room_RequestNewRoom",), + 0x8012EAA8:("Room_ProcessRoomRequest",), 0x8012EBA8:("Room_Draw",), - 0x8012EBF8:("func_8012EBF8",), + 0x8012EBF8:("Room_FinishRoomChange",), 0x8012EC80:("Inventory_GetBtnBItem",), 0x8012ED34:("Inventory_ChangeEquipment",), 0x8012ED78:("Inventory_DeleteEquipment",), diff --git a/tools/sizes/code_functions.csv b/tools/sizes/code_functions.csv index e5a16f2a4f..beca6c6660 100644 --- a/tools/sizes/code_functions.csv +++ b/tools/sizes/code_functions.csv @@ -1914,11 +1914,11 @@ asm/non_matchings/code/z_room/Room_GetImageMultiBgEntry.s,Room_GetImageMultiBgEn asm/non_matchings/code/z_room/Room_DrawImageMulti.s,Room_DrawImageMulti,0x8012E32C,0xDF asm/non_matchings/code/z_room/Room_DrawImage.s,Room_DrawImage,0x8012E6A8,0x1A asm/non_matchings/code/z_room/Room_Init.s,Room_Init,0x8012E710,0x10 -asm/non_matchings/code/z_room/Room_AllocateAndLoad.s,Room_AllocateAndLoad,0x8012E750,0x87 -asm/non_matchings/code/z_room/Room_StartRoomTransition.s,Room_StartRoomTransition,0x8012E96C,0x4F -asm/non_matchings/code/z_room/Room_HandleLoadCallbacks.s,Room_HandleLoadCallbacks,0x8012EAA8,0x40 +asm/non_matchings/code/z_room/Room_SetupFirstRoom.s,Room_SetupFirstRoom,0x8012E750,0x87 +asm/non_matchings/code/z_room/Room_RequestNewRoom.s,Room_RequestNewRoom,0x8012E96C,0x4F +asm/non_matchings/code/z_room/Room_ProcessRoomRequest.s,Room_ProcessRoomRequest,0x8012EAA8,0x40 asm/non_matchings/code/z_room/Room_Draw.s,Room_Draw,0x8012EBA8,0x14 -asm/non_matchings/code/z_room/func_8012EBF8.s,func_8012EBF8,0x8012EBF8,0x22 +asm/non_matchings/code/z_room/Room_FinishRoomChange.s,Room_FinishRoomChange,0x8012EBF8,0x22 asm/non_matchings/code/z_inventory/Inventory_GetBtnBItem.s,Inventory_GetBtnBItem,0x8012EC80,0x2D asm/non_matchings/code/z_inventory/Inventory_ChangeEquipment.s,Inventory_ChangeEquipment,0x8012ED34,0x11 asm/non_matchings/code/z_inventory/Inventory_DeleteEquipment.s,Inventory_DeleteEquipment,0x8012ED78,0x1C