mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
z_room (1 non-matching) (#1143)
* begin room docs and decomp * match Room_DrawImageSingle * match Room_DrawImageMulti * Room_AllocateAndLoad non-matching * big improvements on Room_DrawCullable * match Room_AllocateAndLoad * improvement? * cleanup * comments * cleanup * small pr suggestions * PR Suggestions * cleanup sceneCmds * some PR * PR Suggestions * more PR Suggestions * col to collision
This commit is contained in:
+37
-42
@@ -1888,19 +1888,14 @@ Gfx* Gfx_PrimColor(GraphicsContext* gfxCtx, s32 lodfrac, s32 r, s32 g, s32 b, s3
|
||||
void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g, u8 b);
|
||||
void func_8012D374(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b);
|
||||
void func_8012D40C(f32* param_1, f32* param_2, s16* param_3);
|
||||
void Room_nop8012D510(PlayState* play, Room* room, UNK_PTR param_3, UNK_TYPE1 param_4);
|
||||
void Room_DrawType3Mesh(PlayState* play, Room* room, u32 flags);
|
||||
void Room_DrawType0Mesh(PlayState* play, Room* room, u32 flags);
|
||||
void Room_DrawType2Mesh(PlayState* play, Room* room, u32 flags);
|
||||
void func_8012DEE8(PlayState* play, Room* room, u32 flags);
|
||||
u32 func_8012E254(s32 param_1, PlayState* play);
|
||||
void func_8012E32C(PlayState* play, Room* room, u32 flags);
|
||||
void Room_DrawType1Mesh(PlayState* play, Room* room, u32 flags);
|
||||
|
||||
void Room_Noop(PlayState* play, Room* room, Input* input, s32 arg3);
|
||||
void Room_Init(PlayState* play, RoomContext* roomCtx);
|
||||
u32 Room_AllocateAndLoad(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);
|
||||
void Room_Draw(PlayState* play, Room* room, u32 flags);
|
||||
|
||||
void func_8012EBF8(PlayState* play, RoomContext* roomCtx);
|
||||
s32 Inventory_GetBtnBItem(PlayState* play);
|
||||
void Inventory_ChangeEquipment(s16 value);
|
||||
@@ -1919,40 +1914,40 @@ s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId);
|
||||
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index);
|
||||
void Object_LoadAll(ObjectContext* objectCtx);
|
||||
void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id);
|
||||
void Scene_HeaderCmdSpawnList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdActorList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdActorCutsceneCamList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdColHeader(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdRoomList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdEntranceList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdRoomBehavior(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdMesh(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdObjectList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdLightList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdPathList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdTransiActorList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandActorList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandActorCutsceneCamList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandRoomList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandEntranceList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandMesh(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandLightList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandPathList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandTransiActorList(PlayState* play, SceneCmd* cmd);
|
||||
void Door_InitContext(GameState* gameState, DoorContext* doorCtx);
|
||||
void Scene_HeaderCmdEnvLightSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandEnvLightSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_LoadAreaTextures(PlayState* play, s32 fileIndex);
|
||||
void Scene_HeaderCmdSkyboxSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdSkyboxDisables(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdWindSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdExitList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmd09(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdEchoSetting(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdCutsceneList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdActorCutsceneList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdMiniMap(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmd1D(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdMiniMapCompassInfo(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdSetRegionVisitedFlag(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdAnimatedMaterials(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSkyboxSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSkyboxDisables(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandWindSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandExitList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_Command09(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandEchoSetting(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandMiniMap(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_Command1D(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandMiniMapCompassInfo(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandSetRegionVisitedFlag(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_CommandAnimatedMaterials(PlayState* play, SceneCmd* cmd);
|
||||
void Scene_SetExitFade(PlayState* play);
|
||||
s32 Scene_ProcessHeader(PlayState* play, SceneCmd* header);
|
||||
s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd);
|
||||
u16 Entrance_Create(s32 scene, s32 spawn, s32 layer);
|
||||
u16 Entrance_CreateFromSpawn(s32 spawn);
|
||||
void Scene_Draw(PlayState* play);
|
||||
@@ -2319,7 +2314,7 @@ void Play_SetupRespawnPoint(GameState* thisx, s32 respawnMode, s32 playerParams)
|
||||
void func_80169EFC(GameState* thisx);
|
||||
void func_80169F78(GameState* thisx);
|
||||
void func_80169FDC(GameState* thisx);
|
||||
s32 func_80169FFC(GameState* thisx);
|
||||
s32 Play_CamIsNotFixed(GameState* thisx);
|
||||
s32 FrameAdvance_IsEnabled(GameState* thisx);
|
||||
s32 func_8016A02C(GameState* thisx, Actor* actor, s16* yaw);
|
||||
s32 Play_IsUnderwater(PlayState* this, Vec3f* pos);
|
||||
@@ -2367,7 +2362,7 @@ void PreRender_ApplyFiltersSlowlyInit(PreRender* this);
|
||||
void PreRender_ApplyFiltersSlowlyDestroy(PreRender* this);
|
||||
void func_801720C4(PreRender* this);
|
||||
void func_801720FC(PreRenderParams* params, Gfx** gfxp);
|
||||
void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags);
|
||||
void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags);
|
||||
void THGA_Ct(TwoHeadGfxArena* thga, Gfx* start, size_t size);
|
||||
void THGA_Dt(TwoHeadGfxArena* thga);
|
||||
u32 THGA_IsCrash(TwoHeadGfxArena* thga);
|
||||
|
||||
@@ -63,6 +63,7 @@ extern RegEditor* gRegEditor;
|
||||
#define R_RUN_SPEED_LIMIT REG(45)
|
||||
|
||||
#define R_ENABLE_ARENA_DBG SREG(0) // Same as OoT
|
||||
#define R_ROOM_IMAGE_NODRAW_FLAGS SREG(25)
|
||||
#define R_UPDATE_RATE SREG(30)
|
||||
#define R_FB_FILTER_TYPE SREG(80)
|
||||
#define R_FB_FILTER_PRIM_COLOR(c) SREG(81 + c)
|
||||
@@ -139,6 +140,10 @@ extern RegEditor* gRegEditor;
|
||||
#define R_MINIMAP_DISABLED XREG(95)
|
||||
|
||||
#define R_TRANS_FADE_FLASH_ALPHA_STEP iREG(50) // Set to a negative number to start the flash
|
||||
#define R_ROOM_CULL_DEBUG_MODE iREG(86)
|
||||
#define R_ROOM_CULL_NUM_ENTRIES iREG(87)
|
||||
#define R_ROOM_CULL_USED_ENTRIES iREG(88)
|
||||
#define R_ROOM_CULL_DEBUG_TARGET iREG(89)
|
||||
|
||||
#define R_B_LABEL_DD WREG(0)
|
||||
#define R_OW_MINIMAP_X WREG(29)
|
||||
|
||||
@@ -592,8 +592,6 @@ extern Gfx gCullFrontDList[];
|
||||
extern Gfx sSetupDL[438];
|
||||
extern Gfx sFillSetupDL[12];
|
||||
extern Gfx gEmptyDL[1];
|
||||
extern Vec3f D_801C1D10;
|
||||
extern room_draw_func roomDrawFuncs[4];
|
||||
extern u32 gBitFlags[32];
|
||||
extern u16 gEquipMasks[];
|
||||
extern u16 gEquipNegMasks[];
|
||||
|
||||
@@ -563,8 +563,6 @@ typedef void (*ColChkApplyFunc)(struct PlayState*, CollisionCheckContext*, Colli
|
||||
typedef void (*ColChkVsFunc)(struct PlayState*, CollisionCheckContext*, Collider*, Collider*);
|
||||
typedef s32 (*ColChkLineFunc)(struct PlayState*, CollisionCheckContext*, Collider*, Vec3f*, Vec3f*);
|
||||
|
||||
typedef void(*room_draw_func)(struct PlayState* play, Room* room, u32 flags);
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 controllers; // bit 0 is set if controller 1 is plugged in, etc.
|
||||
/* 0x001 */ UNK_TYPE1 pad1[0x13];
|
||||
|
||||
@@ -96,7 +96,10 @@ typedef struct {
|
||||
/* 0x00 */ Vec3s pos;
|
||||
/* 0x06 */ Vec3s rot;
|
||||
/* 0x0C */ s16 fov;
|
||||
/* 0x0E */ s16 unk_0E;
|
||||
/* 0x0E */ union {
|
||||
s16 roomImageOverrideBgCamIndex;
|
||||
s16 unk_0E;
|
||||
};
|
||||
/* 0x10 */ s16 unk_10;
|
||||
} BgCamFuncData; // size = 0x12
|
||||
|
||||
|
||||
+124
-116
@@ -13,6 +13,9 @@ typedef struct {
|
||||
/* 0x4 */ uintptr_t vromEnd;
|
||||
} RomFile; // size = 0x8
|
||||
|
||||
#define ROOM_DRAW_OPA (1 << 0)
|
||||
#define ROOM_DRAW_XLU (1 << 1)
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
@@ -213,58 +216,132 @@ typedef struct {
|
||||
/* 0x4 */ void* segment;
|
||||
} SCmdMinimapChests; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ Gfx* opaqueDl;
|
||||
/* 0x4 */ Gfx* translucentDl;
|
||||
} RoomMeshType0Params; // size = 0x8
|
||||
|
||||
// Fields TODO
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x1 */ u8 format; // 1 = single, 2 = multi
|
||||
} RoomMeshType1; // size = 0x2
|
||||
|
||||
// Size TODO
|
||||
typedef struct {
|
||||
/* 0x0 */ UNK_TYPE1 pad0[0x10];
|
||||
} RoomMeshType1Params; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ UNK_TYPE1 pad0[0x10];
|
||||
} RoomMeshType2Params; // size = 0x10
|
||||
typedef enum {
|
||||
/* 0 */ ROOM_SHAPE_TYPE_NORMAL,
|
||||
/* 1 */ ROOM_SHAPE_TYPE_IMAGE,
|
||||
/* 2 */ ROOM_SHAPE_TYPE_CULLABLE,
|
||||
/* 3 */ ROOM_SHAPE_TYPE_NONE,
|
||||
/* 4 */ ROOM_SHAPE_TYPE_MAX
|
||||
} RoomShapeType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x1 */ u8 count;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ RoomMeshType0Params* paramsStart;
|
||||
/* 0x8 */ RoomMeshType0Params* paramsEnd;
|
||||
} RoomMeshType0; // size = 0xC
|
||||
} RoomShapeBase; // size = 0x1
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 type;
|
||||
/* 0x1 */ u8 count;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ RoomMeshType2Params* paramsStart;
|
||||
/* 0x8 */ RoomMeshType2Params* paramsEnd;
|
||||
} RoomMeshType2; // size = 0xC
|
||||
/* 0x0 */ Gfx* opa;
|
||||
/* 0x4 */ Gfx* xlu;
|
||||
} RoomShapeDListsEntry; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ RoomShapeBase base;
|
||||
/* 0x1 */ u8 numEntries;
|
||||
/* 0x4 */ RoomShapeDListsEntry* entries;
|
||||
/* 0x8 */ RoomShapeDListsEntry* entriesEnd;
|
||||
} RoomShapeNormal; // size = 0xC
|
||||
|
||||
typedef enum {
|
||||
/* 1 */ ROOM_SHAPE_IMAGE_AMOUNT_SINGLE = 1,
|
||||
/* 2 */ ROOM_SHAPE_IMAGE_AMOUNT_MULTI
|
||||
} RoomShapeImageAmountType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ RoomShapeBase base;
|
||||
/* 0x1 */ u8 amountType; // uses `RoomShapeImageAmountType`
|
||||
/* 0x4 */ RoomShapeDListsEntry* entry;
|
||||
} RoomShapeImageBase; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ RoomShapeImageBase base;
|
||||
/* 0x08 */ void* source;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
/* 0x10 */ void* tlut;
|
||||
/* 0x14 */ u16 width;
|
||||
/* 0x16 */ u16 height;
|
||||
/* 0x18 */ u8 fmt;
|
||||
/* 0x19 */ u8 siz;
|
||||
/* 0x1A */ u16 tlutMode;
|
||||
/* 0x1C */ u16 tlutCount;
|
||||
} RoomShapeImageSingle; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unk_00;
|
||||
/* 0x02 */ u8 bgCamIndex; // the bg cam index this entry is for
|
||||
/* 0x04 */ void* source;
|
||||
/* 0x08 */ u32 unk_0C;
|
||||
/* 0x0C */ void* tlut;
|
||||
/* 0x10 */ u16 width;
|
||||
/* 0x12 */ u16 height;
|
||||
/* 0x14 */ u8 fmt;
|
||||
/* 0x15 */ u8 siz;
|
||||
/* 0x16 */ u16 tlutMode;
|
||||
/* 0x18 */ u16 tlutCount;
|
||||
} RoomShapeImageMultiBgEntry; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ RoomShapeImageBase base;
|
||||
/* 0x8 */ u8 numBackgrounds;
|
||||
/* 0xC */ RoomShapeImageMultiBgEntry* backgrounds;
|
||||
} RoomShapeImageMulti; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ Vec3s boundsSphereCenter;
|
||||
/* 0x6 */ s16 boundsSphereRadius;
|
||||
/* 0x8 */ Gfx* opa;
|
||||
/* 0xC */ Gfx* xlu;
|
||||
} RoomShapeCullableEntry; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ RoomShapeBase base;
|
||||
/* 0x1 */ u8 numEntries;
|
||||
/* 0x4 */ RoomShapeCullableEntry* entries;
|
||||
/* 0x8 */ RoomShapeCullableEntry* entriesEnd;
|
||||
} RoomShapeCullable; // size = 0xC
|
||||
|
||||
typedef union {
|
||||
RoomMeshType0 type0;
|
||||
RoomMeshType1 type1;
|
||||
RoomMeshType2 type2;
|
||||
} RoomMesh; // size = 0xC
|
||||
RoomShapeBase base;
|
||||
RoomShapeNormal normal;
|
||||
union {
|
||||
RoomShapeImageBase base;
|
||||
RoomShapeImageSingle single;
|
||||
RoomShapeImageMulti multi;
|
||||
} image;
|
||||
RoomShapeCullable cullable;
|
||||
} RoomShape; // "Ground Shape"
|
||||
|
||||
// TODO: update ZAPD
|
||||
#define SCENE_CMD_MESH SCENE_CMD_ROOM_SHAPE
|
||||
|
||||
// TODO: Check which ones don't exist
|
||||
typedef enum {
|
||||
/* 0 */ ROOM_BEHAVIOR_TYPE1_0,
|
||||
/* 1 */ ROOM_BEHAVIOR_TYPE1_1,
|
||||
/* 2 */ ROOM_BEHAVIOR_TYPE1_2,
|
||||
/* 3 */ ROOM_BEHAVIOR_TYPE1_3, // unused
|
||||
/* 4 */ ROOM_BEHAVIOR_TYPE1_4,
|
||||
/* 5 */ ROOM_BEHAVIOR_TYPE1_5
|
||||
} RoomBehaviorType1;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ROOM_BEHAVIOR_TYPE2_0,
|
||||
/* 1 */ ROOM_BEHAVIOR_TYPE2_1,
|
||||
/* 2 */ ROOM_BEHAVIOR_TYPE2_2,
|
||||
/* 3 */ ROOM_BEHAVIOR_TYPE2_HOT,
|
||||
/* 4 */ ROOM_BEHAVIOR_TYPE2_4,
|
||||
/* 5 */ ROOM_BEHAVIOR_TYPE2_5,
|
||||
/* 6 */ ROOM_BEHAVIOR_TYPE2_6
|
||||
} RoomBehaviorType2;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 num;
|
||||
/* 0x01 */ u8 unk1;
|
||||
/* 0x02 */ u8 unk2; // 3: Room is hot
|
||||
/* 0x03 */ u8 unk3;
|
||||
/* 0x02 */ u8 behaviorType2;
|
||||
/* 0x03 */ u8 behaviorType1;
|
||||
/* 0x04 */ s8 echo;
|
||||
/* 0x05 */ u8 lensMode;
|
||||
/* 0x06 */ u8 enablePosLights;
|
||||
/* 0x07 */ UNK_TYPE1 pad7[0x1];
|
||||
/* 0x08 */ RoomMesh* mesh;
|
||||
/* 0x08 */ RoomShape* roomShape;
|
||||
/* 0x0C */ void* segment;
|
||||
/* 0x10 */ UNK_TYPE1 pad10[0x4];
|
||||
} Room; // size = 0x14
|
||||
@@ -274,7 +351,7 @@ typedef struct {
|
||||
/* 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 unk31;
|
||||
/* 0x31 */ s8 status;
|
||||
/* 0x32 */ UNK_TYPE1 pad32[0x2];
|
||||
/* 0x34 */ void* activeRoomVram;
|
||||
/* 0x38 */ DmaRequest dmaRequest;
|
||||
@@ -286,15 +363,17 @@ typedef struct {
|
||||
/* 0x7A */ UNK_TYPE2 unk7A[3];
|
||||
} RoomContext; // size = 0x80
|
||||
|
||||
typedef struct {
|
||||
typedef void(*RoomDrawHandler)(struct PlayState* play, Room* room, u32 flags);
|
||||
|
||||
typedef struct TransitionActorEntry {
|
||||
struct {
|
||||
s8 room; // Room to switch to
|
||||
s8 bgCamIndex; // How the camera reacts during the transition. -2 for spiral staircase. -1 for generic door. 0+ will index scene CamData
|
||||
} /* 0x0 */ sides[2]; // 0 = front, 1 = back
|
||||
/* 0x4 */ s16 id;
|
||||
/* 0x4 */ s16 id;
|
||||
/* 0x6 */ Vec3s pos;
|
||||
/* 0xC */ s16 rotY;
|
||||
/* 0xE */ u16 params;
|
||||
/* 0xC */ s16 rotY;
|
||||
/* 0xE */ u16 params;
|
||||
} TransitionActorEntry; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
@@ -390,77 +469,6 @@ typedef struct {
|
||||
/* 0x00C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX];
|
||||
} ObjectContext; // size = 0x958
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 headerType;
|
||||
} MeshHeaderBase; // size = 0x1
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ MeshHeaderBase base;
|
||||
/* 0x1 */ u8 numEntries;
|
||||
/* 0x4 */ u32 dListStart;
|
||||
/* 0x8 */ u32 dListEnd;
|
||||
} MeshHeader0; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 opaqueDList;
|
||||
/* 0x4 */ u32 translucentDList;
|
||||
} MeshEntry0; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ MeshHeaderBase base;
|
||||
/* 0x1 */ u8 format;
|
||||
/* 0x4 */ u32 entryRecord;
|
||||
} MeshHeader1Base; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ MeshHeader1Base base;
|
||||
/* 0x08 */ u32 imagePtr;
|
||||
/* 0x0C */ u32 unknown;
|
||||
/* 0x10 */ u32 unknown2;
|
||||
/* 0x14 */ u16 bgWidth;
|
||||
/* 0x16 */ u16 bgHeight;
|
||||
/* 0x18 */ u8 imageFormat;
|
||||
/* 0x19 */ u8 imageSize;
|
||||
/* 0x1A */ u16 imagePal;
|
||||
/* 0x1C */ u16 imageFlip;
|
||||
} MeshHeader1Single; // size = 0x20
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ MeshHeader1Base base;
|
||||
/* 0x8 */ u8 bgCnt;
|
||||
/* 0xC */ u32 bgRecordPtr;
|
||||
} MeshHeader1Multi; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u16 unknown;
|
||||
/* 0x02 */ s8 bgID;
|
||||
/* 0x04 */ u32 imagePtr;
|
||||
/* 0x08 */ u32 unknown2;
|
||||
/* 0x0C */ u32 unknown3;
|
||||
/* 0x10 */ u16 bgWidth;
|
||||
/* 0x12 */ u16 bgHeight;
|
||||
/* 0x14 */ u8 imageFmt;
|
||||
/* 0x15 */ u8 imageSize;
|
||||
/* 0x16 */ u16 imagePal;
|
||||
/* 0x18 */ u16 imageFlip;
|
||||
} BackgroundRecord; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s16 playerXMax;
|
||||
/* 0x2 */ s16 playerZMax;
|
||||
/* 0x4 */ s16 playerXMin;
|
||||
/* 0x6 */ s16 playerZMin;
|
||||
/* 0x8 */ u32 opaqueDList;
|
||||
/* 0xC */ u32 translucentDList;
|
||||
} MeshEntry2; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ MeshHeaderBase base;
|
||||
/* 0x1 */ u8 numEntries;
|
||||
/* 0x4 */ u32 dListStart;
|
||||
/* 0x8 */ u32 dListEnd;
|
||||
} MeshHeader2; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 count; // number of points in the path
|
||||
/* 0x1 */ u8 unk1;
|
||||
@@ -846,7 +854,7 @@ typedef enum {
|
||||
/* 0x07 */ SCENE_CMD_ID_SPECIAL_FILES,
|
||||
/* 0x08 */ SCENE_CMD_ID_ROOM_BEHAVIOR,
|
||||
/* 0x09 */ SCENE_CMD_ID_UNK_09,
|
||||
/* 0x0A */ SCENE_CMD_ID_MESH,
|
||||
/* 0x0A */ SCENE_CMD_ID_ROOM_SHAPE,
|
||||
/* 0x0B */ SCENE_CMD_ID_OBJECT_LIST,
|
||||
/* 0x0C */ SCENE_CMD_ID_LIGHT_LIST,
|
||||
/* 0x0D */ SCENE_CMD_ID_PATH_LIST,
|
||||
@@ -905,8 +913,8 @@ typedef enum {
|
||||
#define SCENE_CMD_UNK_09() \
|
||||
{ SCENE_CMD_ID_UNK_09, 0, CMD_W(0) }
|
||||
|
||||
#define SCENE_CMD_MESH(meshHeader) \
|
||||
{ SCENE_CMD_ID_MESH, 0, CMD_PTR(meshHeader) }
|
||||
#define SCENE_CMD_ROOM_SHAPE(roomShape) \
|
||||
{ SCENE_CMD_ID_ROOM_SHAPE, 0, CMD_PTR(roomShape) }
|
||||
|
||||
#define SCENE_CMD_OBJECT_LIST(numObjects, objectList) \
|
||||
{ SCENE_CMD_ID_OBJECT_LIST, numObjects, CMD_PTR(objectList) }
|
||||
|
||||
@@ -505,7 +505,6 @@ beginseg
|
||||
include "build/src/code/z_rcp.o"
|
||||
pad_text
|
||||
include "build/src/code/z_room.o"
|
||||
include "build/data/code/z_room.data.o"
|
||||
include "build/src/code/code_8012EC80.o"
|
||||
pad_text
|
||||
include "build/data/code/code_801C2410.data.o"
|
||||
|
||||
@@ -53,8 +53,8 @@ void func_8016FDB8(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, u32 ar
|
||||
flags = 0x1C;
|
||||
}
|
||||
|
||||
func_80172758(&gfx, buf, NULL, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0, 0.0f, 0.0f,
|
||||
1.0f, 1.0f, flags);
|
||||
Prerender_DrawBackground2D(&gfx, buf, NULL, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0,
|
||||
0.0f, 0.0f, 1.0f, 1.0f, flags);
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
|
||||
|
||||
@@ -89,8 +89,8 @@ void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 en
|
||||
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, 0, 0, this->width, this->height);
|
||||
|
||||
func_80172758(&gfx, buf, 0, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0, 0.0f, 0.0f, 1.0f,
|
||||
1.0f, 0xB);
|
||||
Prerender_DrawBackground2D(&gfx, buf, 0, this->width, this->height, G_IM_FMT_RGBA, G_IM_SIZ_16b, G_TT_NONE, 0, 0.0f,
|
||||
0.0f, 1.0f, 1.0f, 0xB);
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
|
||||
|
||||
@@ -454,8 +454,8 @@ void func_801720C4(PreRender* this) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_801720FC.s")
|
||||
|
||||
void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x,
|
||||
f32 y, f32 xScale, f32 yScale, u32 flags) {
|
||||
void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt,
|
||||
u16 arg8, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags) {
|
||||
PreRenderParams params;
|
||||
PreRenderParams* paramsp = ¶ms;
|
||||
|
||||
|
||||
+1
-1
@@ -1344,7 +1344,7 @@ s32 func_800B715C(PlayState* play) {
|
||||
}
|
||||
|
||||
void Actor_SetCameraHorseSetting(PlayState* play, Player* player) {
|
||||
if ((play->roomCtx.curRoom.unk3 != 4) && (player->actor.id == ACTOR_PLAYER)) {
|
||||
if ((play->roomCtx.curRoom.behaviorType1 != ROOM_BEHAVIOR_TYPE1_4) && (player->actor.id == ACTOR_PLAYER)) {
|
||||
EnHorse* rideActor = (EnHorse*)player->rideActor;
|
||||
|
||||
if ((rideActor != NULL) && !(rideActor->unk_1EC & 0x10)) {
|
||||
|
||||
@@ -1767,7 +1767,7 @@ void Interface_UpdateHudAlphas(PlayState* play, s16 dimmingAlpha) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((play->roomCtx.curRoom.unk3 == 1) && (interfaceCtx->minimapAlpha >= 255)) {
|
||||
if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) && (interfaceCtx->minimapAlpha >= 255)) {
|
||||
interfaceCtx->minimapAlpha = 255;
|
||||
}
|
||||
}
|
||||
@@ -5096,8 +5096,9 @@ void Interface_Draw(PlayState* play) {
|
||||
// Load in Grandma's Story
|
||||
gSPLoadUcodeL(OVERLAY_DISP++, gspS2DEX2_fifo);
|
||||
gfx = OVERLAY_DISP;
|
||||
func_80172758(&gfx, sStoryTextures[interfaceCtx->storyType], sStoryTLUTs[interfaceCtx->storyType],
|
||||
SCREEN_WIDTH, SCREEN_HEIGHT, 2, 1, 0x8000, 0x100, 0.0f, 0.0f, 1.0f, 1.0f, 0);
|
||||
Prerender_DrawBackground2D(&gfx, sStoryTextures[interfaceCtx->storyType],
|
||||
sStoryTLUTs[interfaceCtx->storyType], SCREEN_WIDTH, SCREEN_HEIGHT, 2, 1, 0x8000,
|
||||
0x100, 0.0f, 0.0f, 1.0f, 1.0f, 0);
|
||||
OVERLAY_DISP = gfx;
|
||||
gSPLoadUcode(OVERLAY_DISP++, SysUcode_GetUCode(), SysUcode_GetUCodeData());
|
||||
|
||||
|
||||
+8
-8
@@ -992,8 +992,8 @@ void Play_UpdateMain(PlayState* this) {
|
||||
Rumble_SetUpdateEnabled(false);
|
||||
}
|
||||
|
||||
Room_nop8012D510(this, &this->roomCtx.curRoom, &input[1], 0);
|
||||
Room_nop8012D510(this, &this->roomCtx.prevRoom, &input[1], 1);
|
||||
Room_Noop(this, &this->roomCtx.curRoom, &input[1], 0);
|
||||
Room_Noop(this, &this->roomCtx.prevRoom, &input[1], 1);
|
||||
Skybox_Update(&this->skyboxCtx);
|
||||
|
||||
if ((this->pauseCtx.state != 0) || (this->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) {
|
||||
@@ -1127,7 +1127,7 @@ void Play_DrawMain(PlayState* this) {
|
||||
}
|
||||
|
||||
if ((R_PAUSE_BG_PRERENDER_STATE <= PAUSE_BG_PRERENDER_SETUP) && (gTransitionTileState <= TRANS_TILE_SETUP)) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.mesh->type0.type == 1)) {
|
||||
if (this->skyboxCtx.skyboxShouldDraw || (this->roomCtx.curRoom.roomShape->base.type == ROOM_SHAPE_TYPE_IMAGE)) {
|
||||
func_8012CF0C(gfxCtx, false, true, 0, 0, 0);
|
||||
} else {
|
||||
func_8012CF0C(gfxCtx, true, true, this->lightCtx.fogColor.r, this->lightCtx.fogColor.g,
|
||||
@@ -1573,7 +1573,7 @@ void Play_InitScene(PlayState* this, s32 spawn) {
|
||||
Door_InitContext(&this->state, &this->doorCtx);
|
||||
Room_Init(this, &this->roomCtx);
|
||||
gSaveContext.worldMapArea = 0;
|
||||
Scene_ProcessHeader(this, this->sceneSegment);
|
||||
Scene_ExecuteCommands(this, this->sceneSegment);
|
||||
Play_InitEnvironment(this, this->skyboxId);
|
||||
}
|
||||
|
||||
@@ -1940,11 +1940,10 @@ void func_80169FDC(GameState* thisx) {
|
||||
func_80169F78(thisx);
|
||||
}
|
||||
|
||||
// Used by Kankyo to determine how to change the lighting, e.g. for game over.
|
||||
s32 func_80169FFC(GameState* thisx) {
|
||||
s32 Play_CamIsNotFixed(GameState* thisx) {
|
||||
PlayState* this = (PlayState*)thisx;
|
||||
|
||||
return this->roomCtx.curRoom.mesh->type0.type != 1;
|
||||
return this->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE;
|
||||
}
|
||||
|
||||
s32 FrameAdvance_IsEnabled(GameState* thisx) {
|
||||
@@ -2304,7 +2303,8 @@ void Play_Init(GameState* thisx) {
|
||||
|
||||
while (!Room_HandleLoadCallbacks(this, &this->roomCtx)) {}
|
||||
|
||||
if ((CURRENT_DAY != 0) && ((this->roomCtx.curRoom.unk3 == 1) || (this->roomCtx.curRoom.unk3 == 5))) {
|
||||
if ((CURRENT_DAY != 0) && ((this->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_1) ||
|
||||
(this->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_5))) {
|
||||
Actor_Spawn(&this->actorCtx, this, ACTOR_EN_TEST4, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -441,7 +441,7 @@ void func_80123140(PlayState* play, Player* player) {
|
||||
IREG(69) = bootRegs[16];
|
||||
MREG(95) = bootRegs[17];
|
||||
|
||||
if (play->roomCtx.curRoom.unk3 == 2) {
|
||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_2) {
|
||||
R_RUN_SPEED_LIMIT = 500;
|
||||
}
|
||||
|
||||
@@ -1456,7 +1456,7 @@ s32 Player_GetEnvironmentalHazard(PlayState* play) {
|
||||
EnvHazardTextTriggerEntry* triggerEntry;
|
||||
s32 envHazard;
|
||||
|
||||
if (play->roomCtx.curRoom.unk2 == 3) { // Room is hot
|
||||
if (play->roomCtx.curRoom.behaviorType2 == ROOM_BEHAVIOR_TYPE2_HOT) {
|
||||
envHazard = PLAYER_ENV_HAZARD_HOTROOM - 1;
|
||||
} else if ((player->transformation != PLAYER_FORM_ZORA) && (player->underwaterTimer > 80)) {
|
||||
envHazard = PLAYER_ENV_HAZARD_UNDERWATER_FREE - 1;
|
||||
|
||||
+539
-50
File diff suppressed because it is too large
Load Diff
+72
-71
@@ -141,7 +141,7 @@ void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x00: Spawn List
|
||||
void Scene_HeaderCmdSpawnList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSpawnList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 loadedCount;
|
||||
s16 playerObjectId;
|
||||
void* nextObject;
|
||||
@@ -168,19 +168,19 @@ void Scene_HeaderCmdSpawnList(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x01: Actor List
|
||||
void Scene_HeaderCmdActorList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->numSetupActors = cmd->actorList.num;
|
||||
play->setupActorList = Lib_SegmentedToVirtual(cmd->actorList.segment);
|
||||
play->actorCtx.halfDaysBit = 0;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x02: List of camera data for actor cutscenes
|
||||
void Scene_HeaderCmdActorCutsceneCamList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandActorCutsceneCamList(PlayState* play, SceneCmd* cmd) {
|
||||
play->actorCsCamList = Lib_SegmentedToVirtual(cmd->actorCsCamList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x03: Collision Header
|
||||
void Scene_HeaderCmdColHeader(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandCollisionHeader(PlayState* play, SceneCmd* cmd) {
|
||||
CollisionHeader* colHeaderTemp;
|
||||
CollisionHeader* colHeader;
|
||||
|
||||
@@ -205,18 +205,18 @@ void Scene_HeaderCmdColHeader(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x04: Room List
|
||||
void Scene_HeaderCmdRoomList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandRoomList(PlayState* play, SceneCmd* cmd) {
|
||||
play->numRooms = cmd->roomList.num;
|
||||
play->roomList = Lib_SegmentedToVirtual(cmd->roomList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x06: Entrance List
|
||||
void Scene_HeaderCmdEntranceList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandEntranceList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupEntranceList = Lib_SegmentedToVirtual(cmd->entranceList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x07: Special Files
|
||||
void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
// @note These quest hint files are identical to OoT's.
|
||||
// They are not relevant in this game and the system to process these scripts has been removed.
|
||||
static RomFile naviQuestHintFiles[2] = {
|
||||
@@ -236,9 +236,9 @@ void Scene_HeaderCmdSpecialFiles(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x08: Room Behavior
|
||||
void Scene_HeaderCmdRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.unk3 = cmd->roomBehavior.gpFlag1;
|
||||
play->roomCtx.curRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
void Scene_CommandRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.behaviorType1 = cmd->roomBehavior.gpFlag1;
|
||||
play->roomCtx.curRoom.behaviorType2 = cmd->roomBehavior.gpFlag2 & 0xFF;
|
||||
play->roomCtx.curRoom.lensMode = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
|
||||
play->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xA) & 1;
|
||||
play->roomCtx.curRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xB) & 1;
|
||||
@@ -246,12 +246,12 @@ void Scene_HeaderCmdRoomBehavior(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0A: Mesh Header
|
||||
void Scene_HeaderCmdMesh(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.mesh = Lib_SegmentedToVirtual(cmd->mesh.segment);
|
||||
void Scene_CommandMesh(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.roomShape = Lib_SegmentedToVirtual(cmd->mesh.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0B: Object List
|
||||
void Scene_HeaderCmdObjectList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandObjectList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 k;
|
||||
@@ -304,7 +304,7 @@ void Scene_HeaderCmdObjectList(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0C: Light List
|
||||
void Scene_HeaderCmdLightList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandLightList(PlayState* play, SceneCmd* cmd) {
|
||||
s32 i;
|
||||
LightInfo* lightInfo = Lib_SegmentedToVirtual(cmd->lightList.segment);
|
||||
|
||||
@@ -315,12 +315,12 @@ void Scene_HeaderCmdLightList(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0D: Path List
|
||||
void Scene_HeaderCmdPathList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandPathList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupPathList = Lib_SegmentedToVirtual(cmd->pathList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0E: Transition Actor List
|
||||
void Scene_HeaderCmdTransiActorList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandTransiActorList(PlayState* play, SceneCmd* cmd) {
|
||||
play->doorCtx.numTransitionActors = cmd->transiActorList.num;
|
||||
play->doorCtx.transitionActorList = Lib_SegmentedToVirtual(cmd->transiActorList.segment);
|
||||
func_80105818(play, play->doorCtx.numTransitionActors, play->doorCtx.transitionActorList);
|
||||
@@ -332,7 +332,7 @@ void Door_InitContext(GameState* state, DoorContext* doorCtx) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x0F: Environment Light Settings List
|
||||
void Scene_HeaderCmdEnvLightSettings(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandEnvLightSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->envCtx.numLightSettings = cmd->lightSettingList.num;
|
||||
play->envCtx.lightSettingsList = Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
|
||||
}
|
||||
@@ -363,7 +363,7 @@ void Scene_LoadAreaTextures(PlayState* play, s32 fileIndex) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x11: Skybox Settings
|
||||
void Scene_HeaderCmdSkyboxSettings(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSkyboxSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->skyboxId = cmd->skyboxSettings.skyboxId & 3;
|
||||
play->envCtx.unk_17 = play->envCtx.unk_18 = cmd->skyboxSettings.unk5;
|
||||
play->envCtx.unk_1E = cmd->skyboxSettings.unk6;
|
||||
@@ -371,13 +371,13 @@ void Scene_HeaderCmdSkyboxSettings(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x12: Skybox Disables
|
||||
void Scene_HeaderCmdSkyboxDisables(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSkyboxDisables(PlayState* play, SceneCmd* cmd) {
|
||||
play->envCtx.skyboxDisabled = cmd->skyboxDisables.unk4;
|
||||
play->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk5;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x10: Time Settings
|
||||
void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.skyboxTime = gSaveContext.save.time =
|
||||
CLOCK_TIME_ALT2_F(cmd->timeSettings.hour, cmd->timeSettings.min);
|
||||
@@ -418,7 +418,7 @@ void Scene_HeaderCmdTimeSettings(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x05: Wind Settings
|
||||
void Scene_HeaderCmdWindSettings(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandWindSettings(PlayState* play, SceneCmd* cmd) {
|
||||
s8 temp1 = cmd->windSettings.west;
|
||||
s8 temp2 = cmd->windSettings.vertical;
|
||||
s8 temp3 = cmd->windSettings.south;
|
||||
@@ -430,16 +430,16 @@ void Scene_HeaderCmdWindSettings(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x13: Exit List
|
||||
void Scene_HeaderCmdExitList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandExitList(PlayState* play, SceneCmd* cmd) {
|
||||
play->setupExitList = Lib_SegmentedToVirtual(cmd->exitList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x09: Undefined
|
||||
void Scene_HeaderCmd09(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_Command09(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x15: Sound Settings=
|
||||
void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
play->sequenceCtx.seqId = cmd->soundSettings.seqId;
|
||||
play->sequenceCtx.ambienceId = cmd->soundSettings.ambienceId;
|
||||
|
||||
@@ -450,12 +450,12 @@ void Scene_HeaderCmdSoundSettings(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x16: Echo Setting
|
||||
void Scene_HeaderCmdEchoSetting(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandEchoSetting(PlayState* play, SceneCmd* cmd) {
|
||||
play->roomCtx.curRoom.echo = cmd->echoSettings.echo;
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x18: Alternate Header List=
|
||||
void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandAltHeaderList(PlayState* play, SceneCmd* cmd) {
|
||||
SceneCmd** altHeaderList;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
@@ -464,40 +464,40 @@ void Scene_HeaderCmdAltHeaderList(PlayState* play, SceneCmd* cmd) {
|
||||
altHeader = altHeaderList[gSaveContext.sceneLayer - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ProcessHeader(play, Lib_SegmentedToVirtual(altHeader));
|
||||
Scene_ExecuteCommands(play, Lib_SegmentedToVirtual(altHeader));
|
||||
(cmd + 1)->base.code = 0x14;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x17: Cutscene List
|
||||
void Scene_HeaderCmdCutsceneList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandCutsceneList(PlayState* play, SceneCmd* cmd) {
|
||||
play->csCtx.sceneCsCount = cmd->cutsceneList.sceneCsCount;
|
||||
play->csCtx.sceneCsList = Lib_SegmentedToVirtual(cmd->cutsceneList.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1B: Actor Cutscene List
|
||||
void Scene_HeaderCmdActorCutsceneList(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandActorCutsceneList(PlayState* play, SceneCmd* cmd) {
|
||||
ActorCutscene_Init(play, Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment), cmd->cutsceneActorList.num);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1C: Mini Maps
|
||||
void Scene_HeaderCmdMiniMap(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandMiniMap(PlayState* play, SceneCmd* cmd) {
|
||||
func_80104CF4(play);
|
||||
func_8010549C(play, cmd->minimapSettings.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1D: Undefined
|
||||
void Scene_HeaderCmd1D(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_Command1D(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1E: Minimap Compass Icon Info
|
||||
void Scene_HeaderCmdMiniMapCompassInfo(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandMiniMapCompassInfo(PlayState* play, SceneCmd* cmd) {
|
||||
func_8010565C(play, cmd->minimapChests.num, cmd->minimapChests.segment);
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x19: Sets Region Visited Flag
|
||||
void Scene_HeaderCmdSetRegionVisitedFlag(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandSetRegionVisitedFlag(PlayState* play, SceneCmd* cmd) {
|
||||
s16 j = 0;
|
||||
s16 i = 0;
|
||||
|
||||
@@ -525,7 +525,7 @@ void Scene_HeaderCmdSetRegionVisitedFlag(PlayState* play, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x1A: Material Animations
|
||||
void Scene_HeaderCmdAnimatedMaterials(PlayState* play, SceneCmd* cmd) {
|
||||
void Scene_CommandAnimatedMaterials(PlayState* play, SceneCmd* cmd) {
|
||||
play->sceneMaterialAnims = (AnimatedMaterial*)Lib_SegmentedToVirtual(cmd->textureAnimations.segment);
|
||||
}
|
||||
|
||||
@@ -536,57 +536,58 @@ void Scene_SetExitFade(PlayState* play) {
|
||||
play->transitionType = Entrance_GetTransitionFlags(play->nextEntrance) & 0x7F;
|
||||
}
|
||||
|
||||
void (*sSceneCmdHandlers[])(PlayState*, SceneCmd*) = {
|
||||
Scene_CommandSpawnList,
|
||||
Scene_CommandActorList,
|
||||
Scene_CommandActorCutsceneCamList,
|
||||
Scene_CommandCollisionHeader,
|
||||
Scene_CommandRoomList,
|
||||
Scene_CommandWindSettings,
|
||||
Scene_CommandEntranceList,
|
||||
Scene_CommandSpecialFiles,
|
||||
Scene_CommandRoomBehavior,
|
||||
Scene_Command09,
|
||||
Scene_CommandMesh,
|
||||
Scene_CommandObjectList,
|
||||
Scene_CommandLightList,
|
||||
Scene_CommandPathList,
|
||||
Scene_CommandTransiActorList,
|
||||
Scene_CommandEnvLightSettings,
|
||||
Scene_CommandTimeSettings,
|
||||
Scene_CommandSkyboxSettings,
|
||||
Scene_CommandSkyboxDisables,
|
||||
Scene_CommandExitList,
|
||||
NULL,
|
||||
Scene_CommandSoundSettings,
|
||||
Scene_CommandEchoSetting,
|
||||
Scene_CommandCutsceneList,
|
||||
Scene_CommandAltHeaderList,
|
||||
Scene_CommandSetRegionVisitedFlag,
|
||||
Scene_CommandAnimatedMaterials,
|
||||
Scene_CommandActorCutsceneList,
|
||||
Scene_CommandMiniMap,
|
||||
Scene_Command1D,
|
||||
Scene_CommandMiniMapCompassInfo,
|
||||
};
|
||||
|
||||
/**
|
||||
* Executes all of the commands in a scene or room header.
|
||||
*/
|
||||
s32 Scene_ProcessHeader(PlayState* play, SceneCmd* header) {
|
||||
static void (*sceneCmdHandlers[])(PlayState*, SceneCmd*) = {
|
||||
Scene_HeaderCmdSpawnList,
|
||||
Scene_HeaderCmdActorList,
|
||||
Scene_HeaderCmdActorCutsceneCamList,
|
||||
Scene_HeaderCmdColHeader,
|
||||
Scene_HeaderCmdRoomList,
|
||||
Scene_HeaderCmdWindSettings,
|
||||
Scene_HeaderCmdEntranceList,
|
||||
Scene_HeaderCmdSpecialFiles,
|
||||
Scene_HeaderCmdRoomBehavior,
|
||||
Scene_HeaderCmd09,
|
||||
Scene_HeaderCmdMesh,
|
||||
Scene_HeaderCmdObjectList,
|
||||
Scene_HeaderCmdLightList,
|
||||
Scene_HeaderCmdPathList,
|
||||
Scene_HeaderCmdTransiActorList,
|
||||
Scene_HeaderCmdEnvLightSettings,
|
||||
Scene_HeaderCmdTimeSettings,
|
||||
Scene_HeaderCmdSkyboxSettings,
|
||||
Scene_HeaderCmdSkyboxDisables,
|
||||
Scene_HeaderCmdExitList,
|
||||
NULL,
|
||||
Scene_HeaderCmdSoundSettings,
|
||||
Scene_HeaderCmdEchoSetting,
|
||||
Scene_HeaderCmdCutsceneList,
|
||||
Scene_HeaderCmdAltHeaderList,
|
||||
Scene_HeaderCmdSetRegionVisitedFlag,
|
||||
Scene_HeaderCmdAnimatedMaterials,
|
||||
Scene_HeaderCmdActorCutsceneList,
|
||||
Scene_HeaderCmdMiniMap,
|
||||
Scene_HeaderCmd1D,
|
||||
Scene_HeaderCmdMiniMapCompassInfo,
|
||||
};
|
||||
s32 Scene_ExecuteCommands(PlayState* play, SceneCmd* sceneCmd) {
|
||||
u32 cmdId;
|
||||
|
||||
while (true) {
|
||||
cmdId = header->base.code;
|
||||
cmdId = sceneCmd->base.code;
|
||||
|
||||
if (cmdId == SCENE_CMD_ID_END) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (cmdId < SCENE_CMD_MAX) {
|
||||
sceneCmdHandlers[cmdId](play, header);
|
||||
sSceneCmdHandlers[cmdId](play, sceneCmd);
|
||||
}
|
||||
|
||||
header++;
|
||||
sceneCmd++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -498,7 +498,7 @@ void func_808A1618(DoorShutter* this, PlayState* play) {
|
||||
void func_808A1684(DoorShutter* this, PlayState* play) {
|
||||
f32 phi_f0;
|
||||
|
||||
if ((DECR(this->unk_166) == 0) && (play->roomCtx.unk31 == 0) && func_808A1340(this, play)) {
|
||||
if ((DECR(this->unk_166) == 0) && (play->roomCtx.status == 0) && func_808A1340(this, play)) {
|
||||
if (this->doorType == 5) {
|
||||
phi_f0 = 20.0f;
|
||||
} else {
|
||||
|
||||
@@ -328,7 +328,7 @@ s32 func_8094E054(EnGm* this, PlayState* play, s32 arg2) {
|
||||
s32 func_8094E0F8(EnGm* this, PlayState* play) {
|
||||
s32 ret = false;
|
||||
|
||||
if ((this->unk_260 != play->roomCtx.curRoom.num) && (play->roomCtx.unk31 == 0)) {
|
||||
if ((this->unk_260 != play->roomCtx.curRoom.num) && (play->roomCtx.status == 0)) {
|
||||
this->unk_260 = play->roomCtx.curRoom.num;
|
||||
this->unk_262 = SubS_GetObjectIndex(OBJECT_IN2, play);
|
||||
this->actor.draw = NULL;
|
||||
|
||||
@@ -182,7 +182,7 @@ void EnHoll_VisibleIdle(EnHoll* this, PlayState* play) {
|
||||
u32 enHollId = EN_HOLL_GET_ID(&this->actor);
|
||||
|
||||
if (sLoadingPlaneDistance < playerDistFromCentralPlane) {
|
||||
if ((play->roomCtx.prevRoom.num >= 0) && (play->roomCtx.unk31 == 0)) {
|
||||
if ((play->roomCtx.prevRoom.num >= 0) && (play->roomCtx.status == 0)) {
|
||||
this->actor.room = play->doorCtx.transitionActorList[enHollId].sides[this->playerSide].room;
|
||||
if (play->roomCtx.prevRoom.num == this->actor.room) {
|
||||
EnHoll_ChangeRooms(play);
|
||||
@@ -298,7 +298,7 @@ void EnHoll_VerticalIdle(EnHoll* this, PlayState* play) {
|
||||
}
|
||||
|
||||
void EnHoll_RoomTransitionIdle(EnHoll* this, PlayState* play) {
|
||||
if (play->roomCtx.unk31 == 0) {
|
||||
if (play->roomCtx.status == 0) {
|
||||
func_8012EBF8(play, &play->roomCtx);
|
||||
if (play->bgCoverAlpha == 0) {
|
||||
this->bgCoverAlphaActive = false;
|
||||
|
||||
@@ -684,7 +684,8 @@ void EnKusa_Update(Actor* thisx, PlayState* play2) {
|
||||
} else {
|
||||
this->actor.shape.yOffset = 0.0f;
|
||||
}
|
||||
if ((kusaGameplayFrames != play->gameplayFrames) && (play->roomCtx.curRoom.unk3 == 0)) {
|
||||
if ((kusaGameplayFrames != play->gameplayFrames) &&
|
||||
(play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_0)) {
|
||||
EnKusa_Sway();
|
||||
kusaGameplayFrames = play->gameplayFrames;
|
||||
}
|
||||
@@ -696,8 +697,9 @@ void EnKusa_DrawBush(Actor* thisx, PlayState* play2) {
|
||||
|
||||
if ((this->actor.projectedPos.z <= 1200.0f) || ((this->isInWater & 1) && (this->actor.projectedPos.z < 1300.0f))) {
|
||||
|
||||
if ((play->roomCtx.curRoom.unk3 == 0) && (this->actionFunc == EnKusa_WaitForInteract) &&
|
||||
(this->actor.projectedPos.z > -150.0f) && (this->actor.projectedPos.z < 400.0f)) {
|
||||
if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_0) &&
|
||||
(this->actionFunc == EnKusa_WaitForInteract) && (this->actor.projectedPos.z > -150.0f) &&
|
||||
(this->actor.projectedPos.z < 400.0f)) {
|
||||
EnKusa_ApplySway(&D_80936AD8[this->kusaMtxIdx]);
|
||||
}
|
||||
|
||||
@@ -725,7 +727,8 @@ void EnKusa_DrawGrass(Actor* thisx, PlayState* play) {
|
||||
if (this->isCut) {
|
||||
Gfx_DrawDListOpa(play, gKusaStump);
|
||||
} else {
|
||||
if ((play->roomCtx.curRoom.unk3 == 0) && (this->actionFunc == EnKusa_WaitForInteract)) {
|
||||
if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_0) &&
|
||||
(this->actionFunc == EnKusa_WaitForInteract)) {
|
||||
if ((this->actor.projectedPos.z > -150.0f) && (this->actor.projectedPos.z < 400.0f)) {
|
||||
EnKusa_ApplySway(&D_80936AD8[this->kusaMtxIdx]);
|
||||
}
|
||||
|
||||
@@ -1293,7 +1293,7 @@ void func_80A5E604(Actor* thisx, PlayState* play) {
|
||||
} else {
|
||||
this->actor.draw = func_80A5E6F0;
|
||||
|
||||
if (play->roomCtx.curRoom.unk3 == 0) {
|
||||
if (play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_0) {
|
||||
func_80A5B508();
|
||||
}
|
||||
func_80A5CAF4(&D_80A5F1C0);
|
||||
@@ -1356,7 +1356,7 @@ void EnKusa2_Draw(Actor* thisx, PlayState* play) {
|
||||
EnKusa2* this = THIS;
|
||||
|
||||
if (this->actor.projectedPos.z <= 1200.0f) {
|
||||
if ((play->roomCtx.curRoom.unk3 == 0) && (this->actor.projectedPos.z > -150.0f) &&
|
||||
if ((play->roomCtx.curRoom.behaviorType1 == ROOM_BEHAVIOR_TYPE1_0) && (this->actor.projectedPos.z > -150.0f) &&
|
||||
(this->actor.projectedPos.z < 400.0f)) {
|
||||
func_80A5B954(&D_80A60908[this->unk_1CE], 0.0015f);
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ void func_80A42AB8(EnTest4* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if ((play->transitionMode == TRANS_MODE_OFF) && !Play_InCsMode(play) && (play->numSetupActors <= 0) &&
|
||||
(play->roomCtx.unk31 == 0) && !Play_IsDebugCamEnabled()) {
|
||||
(play->roomCtx.status == 0) && !Play_IsDebugCamEnabled()) {
|
||||
s16 temp_a2;
|
||||
u16 temp_a0 = D_80A43364[this->unk_144];
|
||||
s16 temp_a3;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user