Update Room Documentation (#2015)

* Update Room Documentation

* Write more complete documentation, implement suggestions.

* Function name changes; minor comment tweaks

* nit

* Resolve Dragorn fixes

* Resolve Fig suggestions, fix comment wording

* fix bss, fig suggestion

* bss
This commit is contained in:
mzxrules
2024-09-05 08:08:21 -04:00
committed by GitHub
parent dbb059c6a7
commit acb5c7f20c
27 changed files with 243 additions and 195 deletions
+6 -6
View File
@@ -1044,12 +1044,12 @@ void func_80095974(GraphicsContext* gfxCtx);
void func_80095AA0(PlayState* play, Room* room, Input* input, s32 arg3);
void Room_DrawBackground2D(Gfx** gfxP, void* tex, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tlutMode,
u16 tlutCount, f32 offsetX, f32 offsetY);
void func_80096FD4(PlayState* play, Room* room);
u32 func_80096FE8(PlayState* play, RoomContext* roomCtx);
s32 func_8009728C(PlayState* play, RoomContext* roomCtx, s32 roomNum);
s32 func_800973FC(PlayState* play, RoomContext* roomCtx);
void Room_Init(PlayState* play, Room* room);
u32 Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx);
s32 Room_RequestNewRoom(PlayState* play, RoomContext* roomCtx, s32 roomNum);
s32 Room_ProcessRoomRequest(PlayState* play, RoomContext* roomCtx);
void Room_Draw(PlayState* play, Room* room, u32 flags);
void func_80097534(PlayState* play, RoomContext* roomCtx);
void Room_FinishRoomChange(PlayState* play, RoomContext* roomCtx);
void Sample_Destroy(GameState* thisx);
void Sample_Init(GameState* thisx);
void Inventory_ChangeEquipment(s16 equipment, u16 value);
@@ -1061,7 +1061,7 @@ s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId);
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot);
void func_800981B8(ObjectContext* objectCtx);
s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd);
void TransitionActor_InitContext(GameState* state, TransitionActorContext* transiActorCtx);
void Scene_ResetTransitionActorList(GameState* state, TransitionActorList* transitionActors);
void Scene_SetTransitionForNextEntrance(PlayState* play);
void Scene_Draw(PlayState* play);
+2 -3
View File
@@ -63,7 +63,7 @@ typedef struct PlayState {
/* 0x10B20 */ AnimTaskQueue animTaskQueue;
/* 0x117A4 */ ObjectContext objectCtx;
/* 0x11CBC */ RoomContext roomCtx;
/* 0x11D34 */ TransitionActorContext transiActorCtx;
/* 0x11D34 */ TransitionActorList transitionActors;
/* 0x11D3C */ void (*playerInit)(Player* player, struct PlayState* play, FlexSkeletonHeader* skelHeader);
/* 0x11D40 */ void (*playerUpdate)(Player* player, struct PlayState* play, Input* input);
/* 0x11D44 */ int (*isPlayerDroppingFish)(struct PlayState* play);
@@ -81,8 +81,7 @@ typedef struct PlayState {
/* 0x11DE9 */ u8 haltAllActors;
/* 0x11DEA */ u8 spawn;
/* 0x11DEB */ u8 numActorEntries;
/* 0x11DEC */ u8 numRooms;
/* 0x11DF0 */ RomFile* roomList;
/* 0x11DEC */ RoomList roomList;
/* 0x11DF4 */ ActorEntry* playerEntry;
/* 0x11DF8 */ ActorEntry* actorEntryList;
/* 0x11DFC */ void* unk_11DFC;
+14 -9
View File
@@ -40,10 +40,10 @@ typedef struct TransitionActorEntry {
/* 0x0E */ s16 params;
} TransitionActorEntry; // size = 0x10
typedef struct TransitionActorContext {
/* 0x00 */ u8 numActors;
typedef struct TransitionActorList {
/* 0x00 */ u8 count;
/* 0x04 */ TransitionActorEntry* list;
} TransitionActorContext; // size = 0x8
} TransitionActorList; // size = 0x8
typedef struct Spawn {
/* 0x00 */ u8 playerEntryIndex;
@@ -171,7 +171,7 @@ typedef enum RoomBehaviorType2 {
} RoomBehaviorType2;
typedef struct Room {
/* 0x00 */ s8 num;
/* 0x00 */ s8 num; // -1 is invalid room
/* 0x01 */ u8 unk_01;
/* 0x02 */ u8 behaviorType2;
/* 0x03 */ u8 behaviorType1;
@@ -185,16 +185,21 @@ typedef struct Room {
typedef struct RoomContext {
/* 0x00 */ Room curRoom;
/* 0x14 */ Room prevRoom;
/* 0x28 */ void* bufPtrs[2];
/* 0x30 */ u8 unk_30;
/* 0x31 */ s8 status;
/* 0x34 */ void* unk_34;
/* 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 - Last page in memory
/* 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;
/* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config
/* 0x74 */ s16 drawParams[2]; // context-specific data used by the current scene draw config
} RoomContext; // size = 0x78
typedef struct RoomList {
/* 0x00 */ u8 count;
/* 0x04 */ RomFile* romFiles; // Array of rom addresses for each room in a scene
} RoomList;
#define ROOM_DRAW_OPA (1 << 0)
#define ROOM_DRAW_XLU (1 << 1)