Scene Changes (#114)

* match function

* major cleanups

* rename switch functions

* use graph_alloc to fix fake matches

* more documentation

* more matches, lots of changes

* lots more work

* format

* Update z_scene_proc.c

* very hard lagrange interpolation function OK!

* remove any remaining

* documentation done, only two functions left

* a few more things

* one function left!

* document another oot leftover

* last function decompiled, not matched yet

* scene_proc complete

* start work on z_scene

* done with z_scene

* remove unessecary typedefs

* fix some things to remove warnings

* Add z_scene_table and decomp data

* Delete ctx.c

* add draw cfg enum

* cleanup

* most scene table functions done

* done for now

* all scene files done

* Update include/z64scene.h

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>

* add missing macros

* fix some renames

* scene texture file rename

* added temporary structs so it still builds

* more structs

* even more old structs

* fix boyo

* should fix compile error

* lets hope nothing broke

* ub comment back

Co-authored-by: Anghelo Carvajal <anghelo.carvajal.14@sansano.usm.cl>
This commit is contained in:
Zelllll 2021-05-09 21:12:42 -05:00 committed by GitHub
parent e39141fb3d
commit 874a75f456
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 4345 additions and 1573 deletions

View File

@ -698,7 +698,7 @@ void func_800B5040(TargetContext* targetContext, Actor* actor, u8 type, GlobalCo
void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalContext* ctxt);
void func_800B5208(TargetContext* targetCtxt, GlobalContext* ctxt);
void func_800B5814(TargetContext* targetContext, ActorPlayer* player, Actor* param_3, GlobalContext* ctxt);
u32 Actor_GetSwitchFlag(GlobalContext* ctxt, s32 flag);
u32 Flags_GetSwitch(GlobalContext* ctxt, s32 flag);
void Actor_SetSwitchFlag(GlobalContext* ctxt, s32 flag);
void Actor_UnsetSwitchFlag(GlobalContext* ctxt, s32 flag);
u32 Actor_GetChestFlag(GlobalContext* ctxt, u32 flag);
@ -2432,90 +2432,90 @@ void func_8012ED34(s16 param_1);
// void func_8012F1BC(void);
// void func_8012F22C(void);
// void func_8012F278(void);
s32 Scene_LoadObject(SceneContext* sceneCtxt, s16 id);
void Scene_Init(GlobalContext* ctxt, SceneContext* sceneCtxt);
void Scene_ReloadUnloadedObjects(SceneContext* sceneCtxt);
s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, s16 id);
s32 Scene_IsObjectLoaded(SceneContext* sceneCtxt, s32 index);
void Scene_DmaAllObjects(SceneContext* sceneCtxt);
void* func_8012F73C(SceneContext* sceneCtxt, s32 iParm2, s16 id);
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand0B(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand0E(GlobalContext* ctxt, SceneCmd* entry);
void func_8012FEBC(GlobalContext* ctxt, u8* nbTransitionActors);
void Scene_HeaderCommand0F(GlobalContext* ctxt, SceneCmd* entry);
s32 func_8012FF10(GlobalContext* ctxt, s32 fileIndex);
void Scene_HeaderCommand11(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand12(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand10(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand05(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand15(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand16(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand1B(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand1C(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand19(GlobalContext* ctxt, SceneCmd* entry);
void Scene_HeaderCommand1A(GlobalContext* ctxt, SceneCmd* entry);
void func_801306A4(GlobalContext* ctxt);
s32 Scene_ProcessHeader(GlobalContext* ctxt, SceneCmd* header);
u32 Scene_CreateEntrance(u32 sceneIndex, u32 spawnIndex, u32 offset);
void func_80130784(u32 spawnIndex);
void SceneProc_DrawCurrentSceneAnimatedTextures(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig0(GlobalContext* ctxt);
Gfx* SceneProc_SetTile1Layer(GlobalContext* ctxt, ScrollingTextureParams* params);
void SceneProc_DrawType0Texture(GlobalContext* ctxt, u32 segment, ScrollingTextureParams* params);
Gfx* SceneProc_SetTile2Layers(GlobalContext* ctxt, ScrollingTextureParams* params);
void SceneProc_DrawType1Texture(GlobalContext* ctxt, u32 segment, ScrollingTextureParams* params);
void SceneProc_DrawFlashingTexture(GlobalContext* ctxt, u32 segment, FlashingTexturePrimColor* primColor, Color_RGBA8* envColor);
void SceneProc_DrawType2Texture(GlobalContext* ctxt, u32 segment, FlashingTextureParams* params);
s32 SceneProc_Lerp(s32 a, s32 b, f32 t);
void SceneProc_DrawType3Texture(GlobalContext* ctxt, u32 segment, FlashingTextureParams* params);
f32 SceneProc_Interpolate(u32 numKeyFrames, f32* keyFrames, f32* values, f32 frame);
u8 SceneProc_InterpolateClamped(u32 numKeyFrames, f32* keyFrames, f32* values, f32 frame);
void SceneProc_DrawType4Texture(GlobalContext* ctxt, u32 segment, FlashingTextureParams* params);
void SceneProc_DrawType5Texture(GlobalContext* ctxt, u32 segment, CyclingTextureParams* params);
void SceneProc_DrawAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures, f32 flashingAlpha, u32 step, u32 flags);
void SceneProc_DrawAllSceneAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures);
void SceneProc_DrawOpaqueSceneAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures);
void SceneProc_DrawTranslucentSceneAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures);
void SceneProc_DrawAllSceneAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha);
void SceneProc_DrawOpaqueSceneAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha);
void SceneProc_DrawTranslucentSceneAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha);
void SceneProc_DrawAllAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures, u32 step);
void SceneProc_DrawOpaqueAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures, u32 step);
void SceneProc_DrawTranslucentAnimatedTextures(GlobalContext* ctxt, AnimatedTexture* textures, u32 step);
void SceneProc_DrawAllAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha, u32 step);
void SceneProc_DrawOpaqueAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha, u32 step);
void SceneProc_DrawTranslucentAnimatedTexturesWithAlpha(GlobalContext* ctxt, AnimatedTexture* textures, f32 alpha, u32 step);
void SceneProc_DrawSceneConfig1(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig3(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig4(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig2(GlobalContext* ctxt);
void func_80131DF0(GlobalContext* ctxt, u32 param_2, u32 flags);
void func_80131E58(GlobalContext* ctxt, u32 param_2, u32 flags);
void SceneProc_DrawSceneConfig5(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig7(GlobalContext* ctxt);
void SceneProc_DrawSceneConfig6(GlobalContext* ctxt);
EntranceRecord* SceneTable_LookupEntrance(u32 entrance);
s32 SceneTable_LookupEntranceScene(u32 entrance);
s32 SceneTable_LookupEntranceAbsoluteScene(u32 entrance);
// void func_80132374(void);
s16 func_801323A0(u32 entrance);
s32 Object_Spawn(ObjectContext* objectCtx, s16 id);
void Object_InitBank(GameState* state, ObjectContext* objectCtx);
void Object_UpdateBank(ObjectContext* objectCtx);
s32 Object_GetIndex(ObjectContext* objectCtx, s16 id);
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index);
void Object_LoadAll(ObjectContext* objectCtx);
void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id);
void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdActorCutsceneCamList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdRoomList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdEntranceList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdRoomBehavior(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdMesh(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd);
void Transition_Init(GameState* state, TransitionContext* transitionCtx);
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd);
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex);
void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdWindSettings(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdExitList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmd09(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdEchoSetting(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdActorCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdMiniMap(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmd1D(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdMiniMapCompassInfo(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_HeaderCmdAnimatedMaterials(GlobalContext* globalCtx, SceneCmd* cmd);
void Scene_SetExitFade(GlobalContext* globalCtx);
s32 Scene_ProcessHeader(GlobalContext* globalCtx, SceneCmd* header);
u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup);
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex);
void Scene_ExecuteDrawConfig(GlobalContext* globalCtx);
void Scene_DrawConfigDefault(GlobalContext* globalCtx);
Gfx* AnimatedMat_TexScroll(GlobalContext* globalCtx, AnimatedMatTexScrollParams* params);
void AnimatedMat_DrawTexScroll(GlobalContext* globalCtx, s32 segment, void* params);
Gfx* AnimatedMat_TwoLayerTexScroll(GlobalContext* globalCtx, AnimatedMatTexScrollParams* params);
void AnimatedMat_DrawTwoTexScroll(GlobalContext* globalCtx, s32 segment, void* params);
void AnimatedMat_SetColor(GlobalContext* globalCtx, s32 segment, F3DPrimColor* primColor, F3DEnvColor* envColor);
void AnimatedMat_DrawColor(GlobalContext* globalCtx, s32 segment, void* params);
s32 AnimatedMat_Lerp(s32 min, s32 max, f32 norm);
void AnimatedMat_DrawColorLerp(GlobalContext* globalCtx, s32 segment, void* params);
f32 Scene_LagrangeInterp(s32 n, f32 x[], f32 fx[], f32 xp);
u8 Scene_LagrangeInterpColor(s32 n, f32 x[], f32 fx[], f32 xp);
void AnimatedMat_DrawColorNonLinearInterp(GlobalContext* globalCtx, s32 segment, void* params);
void AnimatedMat_DrawTexCycle(GlobalContext* globalCtx, s32 segment, void* params);
void AnimatedMat_DrawMain(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio, u32 step, u32 flags);
void AnimatedMat_Draw(GlobalContext* globalCtx, AnimatedMaterial* matAnim);
void AnimatedMat_DrawOpa(GlobalContext* globalCtx, AnimatedMaterial* matAnim);
void AnimatedMat_DrawXlu(GlobalContext* globalCtx, AnimatedMaterial* matAnim);
void AnimatedMat_DrawAlpha(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio);
void AnimatedMat_DrawAlphaOpa(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio);
void AnimatedMat_DrawAlphaXlu(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio);
void AnimatedMat_DrawStep(GlobalContext* globalCtx, AnimatedMaterial* matAnim, u32 step);
void AnimatedMat_DrawStepOpa(GlobalContext* globalCtx, AnimatedMaterial* matAnim, u32 step);
void AnimatedMat_DrawStepXlu(GlobalContext* globalCtx, AnimatedMaterial* matAnim, u32 step);
void AnimatedMat_DrawAlphaStep(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio, u32 step);
void AnimatedMat_DrawAlphaStepOpa(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio, u32 step);
void AnimatedMat_DrawAlphaStepXlu(GlobalContext* globalCtx, AnimatedMaterial* matAnim, f32 alphaRatio, u32 step);
void Scene_DrawConfigMatAnim(GlobalContext* globalCtx);
void Scene_DrawConfig3(GlobalContext* globalCtx);
void Scene_DrawConfig4(GlobalContext* globalCtx);
void Scene_DrawConfigDoNothing(GlobalContext* globalCtx);
void Scene_SetRenderModeXlu(GlobalContext* globalCtx, s32 index, u32 flags);
void Scene_SetCullFlag(GlobalContext* globalCtx, s32 index, u32 flags);
void Scene_DrawConfig5(GlobalContext* globalCtx);
void Scene_DrawConfigMatAnimManualStep(GlobalContext* globalCtx);
void Scene_DrawConfigGreatBayTemple(GlobalContext* globalCtx);
EntranceTableEntry* Entrance_GetTableEntry(u16 entrance);
s32 Entrance_GetSceneNum(u16 entranceIndex);
s32 Entrance_GetSceneNumAbsolute(u16 entranceIndex);
s32 Entrance_GetSpawnNum(u16 entranceIndex);
s32 Entrance_GetTransitionFlags(u16 entranceIndex);
// void func_801323D0(void);
// void func_80132428(void);
// void func_80132494(void);
@ -3016,7 +3016,7 @@ void Play_Update(GlobalContext* ctxt);
s32 func_801690CC(GlobalContext* gCtx);
// void func_80169100(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_801691F0(void);
void* Play_LoadScene(GlobalContext* ctxt, ObjectFileTableEntry* entry);
void* Play_LoadScene(GlobalContext* ctxt, RomFile* entry);
void func_8016927C(GlobalContext* ctxt, s16 sParm2);
// void func_801692C4(GlobalContext* ctxt, UNK_TYPE1 uParm2);
// void Play_SceneInit(GlobalContext* ctxt, s32 sceneIndex, UNK_TYPE1 param_3);

View File

@ -15,9 +15,6 @@
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr) - 0x80000000)
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))
#define ALIGN16(val) (((val) + 0xF) & ~0xF)
// Currently most often called ctxt in MM, TODO: Refactor names when its used
#define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera]

View File

@ -44,7 +44,7 @@ extern UNK_TYPE D_0E0001C8;
extern UNK_TYPE D_0E0002C8;
extern Gfx object_ikana_obj_001100[];
extern AnimatedTexture object_ikana_obj_001228[];
extern AnimatedMaterial object_ikana_obj_001228[];
extern Gfx object_fu_kaiten_0005D0[];
extern CollisionHeader object_fu_kaiten_002D30;

View File

@ -1,7 +1,14 @@
#ifndef _STDBOOL_H_
#define _STDBOOL_H_
#ifndef _STDBOOL
#define _STDBOOL
#define __bool_true_false_are_defined 1
#ifndef __cplusplus
#define bool u32
#define false 0
#define true !false
#define true 1
#endif /* _STDBOOL_H_ */
#endif /* __cplusplus */
#endif /* _STDBOOL */

View File

@ -1504,580 +1504,9 @@ extern SceneIdList scenesPerMapArea[11];
// extern UNK_TYPE1 D_801C23E0;
// extern UNK_TYPE1 D_801C23F8;
// extern UNK_TYPE1 D_801C2410;
extern ObjectFileTableEntry D_801C2650[2];
extern ObjectFileTableEntry D_801C2660[9];
extern scene_header_func sceneHeaderFuncTable[31];
extern s16 D_801C2730[8];
extern ObjectFileTableEntry objectFileTable[643];
extern Gfx gSceneProcDefaultDl[11];
extern global_context_func gSceneProcSceneDrawFuncs[8];
extern scene_proc_draw_func gSceneProcDrawFuncs[6];
extern Gfx D_801C3BF0[4];
extern Gfx D_801C3C10[4];
extern Gfx D_801C3C30[4];
extern Gfx* D_801C3C50[3];
extern Gfx D_801C3C60[2];
extern Gfx D_801C3C70[2];
extern Gfx* D_801C3C80[2];
extern Gfx D_801C3C88[2];
extern SceneTableEntry gSceneTable[113];
// extern UNK_TYPE1 D_801C43B0;
// extern UNK_TYPE1 D_801C43B4;
// extern UNK_TYPE1 D_801C43B8;
extern UNK_PTR D_801C43BC;
// extern UNK_TYPE1 D_801C43C8;
// extern UNK_TYPE1 D_801C43CC;
// extern UNK_TYPE1 D_801C43D0;
// extern UNK_TYPE1 D_801C43D4;
// extern UNK_TYPE1 D_801C43D8;
// extern UNK_TYPE1 D_801C43DC;
// extern UNK_TYPE1 D_801C43E0;
// extern UNK_TYPE1 D_801C43E8;
// extern UNK_TYPE1 D_801C43EC;
// extern UNK_TYPE1 D_801C43F0;
// extern UNK_TYPE1 D_801C43F4;
// extern UNK_TYPE1 D_801C43F8;
// extern UNK_TYPE1 D_801C4400;
// extern UNK_TYPE1 D_801C4404;
// extern UNK_TYPE1 D_801C4408;
// extern UNK_TYPE1 D_801C440C;
// extern UNK_TYPE1 D_801C4410;
// extern UNK_TYPE1 D_801C4414;
// extern UNK_TYPE1 D_801C4418;
// extern UNK_TYPE1 D_801C441C;
// extern UNK_TYPE1 D_801C4420;
// extern UNK_TYPE1 D_801C4424;
// extern UNK_TYPE1 D_801C4428;
extern UNK_PTR D_801C442C;
// extern UNK_TYPE1 D_801C4458;
// extern UNK_TYPE1 D_801C445C;
// extern UNK_TYPE1 D_801C4460;
// extern UNK_TYPE1 D_801C4464;
extern UNK_PTR D_801C4468;
// extern UNK_TYPE1 D_801C4478;
// extern UNK_TYPE1 D_801C448C;
// extern UNK_TYPE1 D_801C449C;
// extern UNK_TYPE1 D_801C44AC;
// extern UNK_TYPE1 D_801C44BC;
// extern UNK_TYPE1 D_801C44CC;
// extern UNK_TYPE1 D_801C44DC;
// extern UNK_TYPE1 D_801C44EC;
// extern UNK_TYPE1 D_801C44FC;
// extern UNK_TYPE1 D_801C450C;
// extern UNK_TYPE1 D_801C451C;
// extern UNK_TYPE1 D_801C452C;
// extern UNK_TYPE1 D_801C453C;
// extern UNK_TYPE1 D_801C454C;
// extern UNK_TYPE1 D_801C455C;
// extern UNK_TYPE1 D_801C456C;
extern UNK_PTR D_801C457C;
// extern UNK_TYPE1 D_801C45BC;
// extern UNK_TYPE1 D_801C45C8;
// extern UNK_TYPE1 D_801C45D0;
// extern UNK_TYPE1 D_801C45D4;
// extern UNK_TYPE1 D_801C45D8;
// extern UNK_TYPE1 D_801C45DC;
// extern UNK_TYPE1 D_801C45E0;
// extern UNK_TYPE1 D_801C45E4;
// extern UNK_TYPE1 D_801C45E8;
// extern UNK_TYPE1 D_801C45EC;
// extern UNK_TYPE1 D_801C45F0;
// extern UNK_TYPE1 D_801C45F4;
// extern UNK_TYPE1 D_801C45F8;
// extern UNK_TYPE1 D_801C45FC;
// extern UNK_TYPE1 D_801C4600;
extern UNK_PTR D_801C4604;
// extern UNK_TYPE1 D_801C4640;
// extern UNK_TYPE1 D_801C4654;
// extern UNK_TYPE1 D_801C4658;
// extern UNK_TYPE1 D_801C465C;
// extern UNK_TYPE1 D_801C4660;
// extern UNK_TYPE1 D_801C4668;
// extern UNK_TYPE1 D_801C466C;
// extern UNK_TYPE1 D_801C4670;
// extern UNK_TYPE1 D_801C4678;
// extern UNK_TYPE1 D_801C467C;
// extern UNK_TYPE1 D_801C4680;
// extern UNK_TYPE1 D_801C4684;
// extern UNK_TYPE1 D_801C4690;
// extern UNK_TYPE1 D_801C46A0;
// extern UNK_TYPE1 D_801C46AC;
// extern UNK_TYPE1 D_801C46B8;
// extern UNK_TYPE1 D_801C46C4;
// extern UNK_TYPE1 D_801C46CC;
// extern UNK_TYPE1 D_801C46D0;
// extern UNK_TYPE1 D_801C46D4;
// extern UNK_TYPE1 D_801C46D8;
extern UNK_PTR D_801C46DC;
// extern UNK_TYPE1 D_801C46F0;
// extern UNK_TYPE1 D_801C46F4;
// extern UNK_TYPE1 D_801C46F8;
// extern UNK_TYPE1 D_801C46FC;
// extern UNK_TYPE1 D_801C4708;
// extern UNK_TYPE1 D_801C4710;
// extern UNK_TYPE1 D_801C4718;
// extern UNK_TYPE1 D_801C4720;
// extern UNK_TYPE1 D_801C4724;
// extern UNK_TYPE1 D_801C4728;
// extern UNK_TYPE1 D_801C472C;
// extern UNK_TYPE1 D_801C4730;
// extern UNK_TYPE1 D_801C4734;
// extern UNK_TYPE1 D_801C4738;
extern UNK_PTR D_801C473C;
// extern UNK_TYPE1 D_801C4758;
// extern UNK_TYPE1 D_801C475C;
// extern UNK_TYPE1 D_801C4760;
// extern UNK_TYPE1 D_801C4768;
// extern UNK_TYPE1 D_801C476C;
// extern UNK_TYPE1 D_801C4770;
// extern UNK_TYPE1 D_801C4774;
// extern UNK_TYPE1 D_801C4778;
// extern UNK_TYPE1 D_801C4780;
// extern UNK_TYPE1 D_801C4784;
// extern UNK_TYPE1 D_801C4788;
// extern UNK_TYPE1 D_801C4790;
// extern UNK_TYPE1 D_801C4794;
// extern UNK_TYPE1 D_801C4798;
// extern UNK_TYPE1 D_801C479C;
// extern UNK_TYPE1 D_801C47A0;
// extern UNK_TYPE1 D_801C47A4;
// extern UNK_TYPE1 D_801C47A8;
extern UNK_PTR D_801C47AC;
// extern UNK_TYPE1 D_801C47C8;
// extern UNK_TYPE1 D_801C47CC;
// extern UNK_TYPE1 D_801C47D0;
// extern UNK_TYPE1 D_801C47D4;
// extern UNK_TYPE1 D_801C47D8;
// extern UNK_TYPE1 D_801C47DC;
// extern UNK_TYPE1 D_801C47E0;
// extern UNK_TYPE1 D_801C47E4;
// extern UNK_TYPE1 D_801C47E8;
// extern UNK_TYPE1 D_801C47EC;
// extern UNK_TYPE1 D_801C47F0;
// extern UNK_TYPE1 D_801C47F4;
// extern UNK_TYPE1 D_801C47F8;
// extern UNK_TYPE1 D_801C47FC;
// extern UNK_TYPE1 D_801C4800;
// extern UNK_TYPE1 D_801C4804;
extern UNK_PTR D_801C4808;
// extern UNK_TYPE1 D_801C4848;
// extern UNK_TYPE1 D_801C484C;
// extern UNK_TYPE1 D_801C4850;
// extern UNK_TYPE1 D_801C4854;
// extern UNK_TYPE1 D_801C4858;
// extern UNK_TYPE1 D_801C4860;
// extern UNK_TYPE1 D_801C4868;
// extern UNK_TYPE1 D_801C486C;
// extern UNK_TYPE1 D_801C4870;
// extern UNK_TYPE1 D_801C4874;
// extern UNK_TYPE1 D_801C4878;
// extern UNK_TYPE1 D_801C487C;
// extern UNK_TYPE1 D_801C4880;
// extern UNK_TYPE1 D_801C4884;
// extern UNK_TYPE1 D_801C4888;
extern UNK_PTR D_801C488C;
// extern UNK_TYPE1 D_801C48B4;
// extern UNK_TYPE1 D_801C48B8;
// extern UNK_TYPE1 D_801C48BC;
// extern UNK_TYPE1 D_801C48C0;
// extern UNK_TYPE1 D_801C48C4;
// extern UNK_TYPE1 D_801C48C8;
// extern UNK_TYPE1 D_801C48CC;
// extern UNK_TYPE1 D_801C48D0;
// extern UNK_TYPE1 D_801C48DC;
// extern UNK_TYPE1 D_801C48E0;
// extern UNK_TYPE1 D_801C48E4;
// extern UNK_TYPE1 D_801C48E8;
// extern UNK_TYPE1 D_801C48EC;
// extern UNK_TYPE1 D_801C48F0;
// extern UNK_TYPE1 D_801C48F4;
// extern UNK_TYPE1 D_801C48F8;
// extern UNK_TYPE1 D_801C48FC;
// extern UNK_TYPE1 D_801C4900;
// extern UNK_TYPE1 D_801C4904;
// extern UNK_TYPE1 D_801C4908;
// extern UNK_TYPE1 D_801C490C;
extern UNK_PTR D_801C4910;
// extern UNK_TYPE1 D_801C493C;
// extern UNK_TYPE1 D_801C4940;
// extern UNK_TYPE1 D_801C4944;
// extern UNK_TYPE1 D_801C496C;
// extern UNK_TYPE1 D_801C4994;
// extern UNK_TYPE1 D_801C49AC;
// extern UNK_TYPE1 D_801C49C4;
// extern UNK_TYPE1 D_801C49DC;
// extern UNK_TYPE1 D_801C49F4;
// extern UNK_TYPE1 D_801C4A0C;
// extern UNK_TYPE1 D_801C4A24;
// extern UNK_TYPE1 D_801C4A3C;
// extern UNK_TYPE1 D_801C4A54;
// extern UNK_TYPE1 D_801C4A6C;
// extern UNK_TYPE1 D_801C4A84;
// extern UNK_TYPE1 D_801C4A9C;
// extern UNK_TYPE1 D_801C4AB4;
extern UNK_PTR D_801C4AB8;
// extern UNK_TYPE1 D_801C4AF4;
// extern UNK_TYPE1 D_801C4AF8;
// extern UNK_TYPE1 D_801C4AFC;
// extern UNK_TYPE1 D_801C4B00;
// extern UNK_TYPE1 D_801C4B04;
// extern UNK_TYPE1 D_801C4B08;
// extern UNK_TYPE1 D_801C4B0C;
// extern UNK_TYPE1 D_801C4B14;
// extern UNK_TYPE1 D_801C4B1C;
// extern UNK_TYPE1 D_801C4B24;
// extern UNK_TYPE1 D_801C4B2C;
extern UNK_PTR D_801C4B34;
// extern UNK_TYPE1 D_801C4B44;
// extern UNK_TYPE1 D_801C4B4C;
// extern UNK_TYPE1 D_801C4B50;
// extern UNK_TYPE1 D_801C4B54;
// extern UNK_TYPE1 D_801C4B58;
// extern UNK_TYPE1 D_801C4B5C;
// extern UNK_TYPE1 D_801C4B60;
// extern UNK_TYPE1 D_801C4B64;
// extern UNK_TYPE1 D_801C4B68;
extern UNK_PTR D_801C4B6C;
// extern UNK_TYPE1 D_801C4B90;
// extern UNK_TYPE1 D_801C4B94;
// extern UNK_TYPE1 D_801C4B98;
// extern UNK_TYPE1 D_801C4BA0;
// extern UNK_TYPE1 D_801C4BBC;
// extern UNK_TYPE1 D_801C4BC0;
// extern UNK_TYPE1 D_801C4BC4;
// extern UNK_TYPE1 D_801C4BC8;
// extern UNK_TYPE1 D_801C4BCC;
// extern UNK_TYPE1 D_801C4BD0;
// extern UNK_TYPE1 D_801C4BD4;
// extern UNK_TYPE1 D_801C4BD8;
// extern UNK_TYPE1 D_801C4BDC;
// extern UNK_TYPE1 D_801C4BE0;
// extern UNK_TYPE1 D_801C4BE4;
extern UNK_PTR D_801C4BE8;
// extern UNK_TYPE1 D_801C4C18;
// extern UNK_TYPE1 D_801C4C1C;
// extern UNK_TYPE1 D_801C4C20;
// extern UNK_TYPE1 D_801C4C24;
// extern UNK_TYPE1 D_801C4C28;
extern UNK_PTR D_801C4C2C;
// extern UNK_TYPE1 D_801C4C40;
// extern UNK_TYPE1 D_801C4C4C;
// extern UNK_TYPE1 D_801C4C54;
// extern UNK_TYPE1 D_801C4C5C;
// extern UNK_TYPE1 D_801C4C64;
// extern UNK_TYPE1 D_801C4C6C;
// extern UNK_TYPE1 D_801C4C74;
// extern UNK_TYPE1 D_801C4C7C;
// extern UNK_TYPE1 D_801C4C84;
// extern UNK_TYPE1 D_801C4C8C;
// extern UNK_TYPE1 D_801C4C94;
// extern UNK_TYPE1 D_801C4C9C;
// extern UNK_TYPE1 D_801C4CA4;
// extern UNK_TYPE1 D_801C4CAC;
extern UNK_PTR D_801C4CB4;
// extern UNK_TYPE1 D_801C4CEC;
// extern UNK_TYPE1 D_801C4CF4;
// extern UNK_TYPE1 D_801C4CFC;
// extern UNK_TYPE1 D_801C4D04;
// extern UNK_TYPE1 D_801C4D0C;
// extern UNK_TYPE1 D_801C4D14;
// extern UNK_TYPE1 D_801C4D1C;
// extern UNK_TYPE1 D_801C4D24;
// extern UNK_TYPE1 D_801C4D2C;
// extern UNK_TYPE1 D_801C4D34;
extern UNK_PTR D_801C4D3C;
// extern UNK_TYPE1 D_801C4D64;
// extern UNK_TYPE1 D_801C4D68;
// extern UNK_TYPE1 D_801C4D6C;
// extern UNK_TYPE1 D_801C4D70;
// extern UNK_TYPE1 D_801C4D74;
// extern UNK_TYPE1 D_801C4D78;
// extern UNK_TYPE1 D_801C4D7C;
// extern UNK_TYPE1 D_801C4D80;
// extern UNK_TYPE1 D_801C4D84;
extern UNK_PTR D_801C4D88;
// extern UNK_TYPE1 D_801C4DA4;
// extern UNK_TYPE1 D_801C4DA8;
// extern UNK_TYPE1 D_801C4DAC;
// extern UNK_TYPE1 D_801C4DB0;
// extern UNK_TYPE1 D_801C4DB4;
// extern UNK_TYPE1 D_801C4DBC;
// extern UNK_TYPE1 D_801C4DC0;
// extern UNK_TYPE1 D_801C4DC4;
extern UNK_PTR D_801C4DC8;
// extern UNK_TYPE1 D_801C4DD8;
// extern UNK_TYPE1 D_801C4DDC;
// extern UNK_TYPE1 D_801C4DE0;
// extern UNK_TYPE1 D_801C4DE4;
// extern UNK_TYPE1 D_801C4DE8;
// extern UNK_TYPE1 D_801C4DEC;
// extern UNK_TYPE1 D_801C4DF8;
// extern UNK_TYPE1 D_801C4DFC;
// extern UNK_TYPE1 D_801C4E00;
// extern UNK_TYPE1 D_801C4E08;
// extern UNK_TYPE1 D_801C4E10;
// extern UNK_TYPE1 D_801C4E14;
// extern UNK_TYPE1 D_801C4E1C;
// extern UNK_TYPE1 D_801C4E24;
// extern UNK_TYPE1 D_801C4E28;
// extern UNK_TYPE1 D_801C4E2C;
// extern UNK_TYPE1 D_801C4E30;
// extern UNK_TYPE1 D_801C4E34;
extern UNK_PTR D_801C4E38;
// extern UNK_TYPE1 D_801C4E50;
// extern UNK_TYPE1 D_801C4E54;
// extern UNK_TYPE1 D_801C4E58;
// extern UNK_TYPE1 D_801C4E5C;
// extern UNK_TYPE1 D_801C4E60;
// extern UNK_TYPE1 D_801C4E64;
// extern UNK_TYPE1 D_801C4E68;
// extern UNK_TYPE1 D_801C4E6C;
// extern UNK_TYPE1 D_801C4E70;
// extern UNK_TYPE1 D_801C4E74;
// extern UNK_TYPE1 D_801C4E78;
// extern UNK_TYPE1 D_801C4E7C;
// extern UNK_TYPE1 D_801C4E80;
extern UNK_PTR D_801C4E84;
// extern UNK_TYPE1 D_801C4EB0;
// extern UNK_TYPE1 D_801C4EBC;
// extern UNK_TYPE1 D_801C4EC8;
// extern UNK_TYPE1 D_801C4ED4;
// extern UNK_TYPE1 D_801C4EE0;
extern UNK_PTR D_801C4EEC;
// extern UNK_TYPE1 D_801C4F00;
// extern UNK_TYPE1 D_801C4F04;
// extern UNK_TYPE1 D_801C4F08;
// extern UNK_TYPE1 D_801C4F10;
// extern UNK_TYPE1 D_801C4F18;
// extern UNK_TYPE1 D_801C4F1C;
// extern UNK_TYPE1 D_801C4F20;
// extern UNK_TYPE1 D_801C4F24;
extern UNK_PTR D_801C4F28;
// extern UNK_TYPE1 D_801C4F3C;
// extern UNK_TYPE1 D_801C4F40;
// extern UNK_TYPE1 D_801C4F44;
// extern UNK_TYPE1 D_801C4F48;
// extern UNK_TYPE1 D_801C4F54;
// extern UNK_TYPE1 D_801C4F58;
// extern UNK_TYPE1 D_801C4F5C;
// extern UNK_TYPE1 D_801C4F60;
extern UNK_PTR D_801C4F64;
// extern UNK_TYPE1 D_801C4F74;
// extern UNK_TYPE1 D_801C4F78;
// extern UNK_TYPE1 D_801C4F7C;
// extern UNK_TYPE1 D_801C4F84;
// extern UNK_TYPE1 D_801C4F88;
// extern UNK_TYPE1 D_801C4F8C;
// extern UNK_TYPE1 D_801C4F90;
// extern UNK_TYPE1 D_801C4F94;
// extern UNK_TYPE1 D_801C4F98;
// extern UNK_TYPE1 D_801C4F9C;
extern UNK_PTR D_801C4FA0;
// extern UNK_TYPE1 D_801C4FBC;
// extern UNK_TYPE1 D_801C4FC0;
// extern UNK_TYPE1 D_801C4FC4;
// extern UNK_TYPE1 D_801C4FC8;
// extern UNK_TYPE1 D_801C4FCC;
extern UNK_PTR D_801C4FD0;
// extern UNK_TYPE1 D_801C4FE4;
// extern UNK_TYPE1 D_801C4FE8;
// extern UNK_TYPE1 D_801C4FEC;
// extern UNK_TYPE1 D_801C4FF4;
// extern UNK_TYPE1 D_801C4FF8;
// extern UNK_TYPE1 D_801C4FFC;
// extern UNK_TYPE1 D_801C5000;
// extern UNK_TYPE1 D_801C5004;
// extern UNK_TYPE1 D_801C5008;
// extern UNK_TYPE1 D_801C500C;
// extern UNK_TYPE1 D_801C5010;
// extern UNK_TYPE1 D_801C5014;
// extern UNK_TYPE1 D_801C5018;
// extern UNK_TYPE1 D_801C501C;
extern UNK_PTR D_801C5020;
// extern UNK_TYPE1 D_801C5044;
// extern UNK_TYPE1 D_801C5048;
// extern UNK_TYPE1 D_801C504C;
// extern UNK_TYPE1 D_801C5050;
// extern UNK_TYPE1 D_801C505C;
// extern UNK_TYPE1 D_801C5060;
// extern UNK_TYPE1 D_801C5064;
// extern UNK_TYPE1 D_801C5068;
// extern UNK_TYPE1 D_801C5074;
// extern UNK_TYPE1 D_801C5078;
// extern UNK_TYPE1 D_801C507C;
// extern UNK_TYPE1 D_801C5080;
// extern UNK_TYPE1 D_801C508C;
// extern UNK_TYPE1 D_801C5090;
// extern UNK_TYPE1 D_801C5094;
// extern UNK_TYPE1 D_801C509C;
// extern UNK_TYPE1 D_801C50A0;
// extern UNK_TYPE1 D_801C50A4;
// extern UNK_TYPE1 D_801C50A8;
// extern UNK_TYPE1 D_801C50AC;
// extern UNK_TYPE1 D_801C50B0;
// extern UNK_TYPE1 D_801C50B4;
// extern UNK_TYPE1 D_801C50C0;
// extern UNK_TYPE1 D_801C50C4;
// extern UNK_TYPE1 D_801C50C8;
// extern UNK_TYPE1 D_801C50CC;
extern UNK_PTR D_801C50D0;
// extern UNK_TYPE1 D_801C50E0;
// extern UNK_TYPE1 D_801C50E4;
// extern UNK_TYPE1 D_801C50E8;
// extern UNK_TYPE1 D_801C50F0;
// extern UNK_TYPE1 D_801C50F8;
// extern UNK_TYPE1 D_801C50FC;
// extern UNK_TYPE1 D_801C5100;
// extern UNK_TYPE1 D_801C5104;
// extern UNK_TYPE1 D_801C5108;
// extern UNK_TYPE1 D_801C510C;
// extern UNK_TYPE1 D_801C5110;
// extern UNK_TYPE1 D_801C5114;
extern UNK_PTR D_801C5118;
// extern UNK_TYPE1 D_801C513C;
// extern UNK_TYPE1 D_801C5144;
// extern UNK_TYPE1 D_801C514C;
// extern UNK_TYPE1 D_801C5154;
// extern UNK_TYPE1 D_801C515C;
// extern UNK_TYPE1 D_801C5164;
// extern UNK_TYPE1 D_801C516C;
extern UNK_PTR D_801C5174;
// extern UNK_TYPE1 D_801C5184;
// extern UNK_TYPE1 D_801C5188;
// extern UNK_TYPE1 D_801C518C;
// extern UNK_TYPE1 D_801C5190;
// extern UNK_TYPE1 D_801C519C;
// extern UNK_TYPE1 D_801C51A0;
// extern UNK_TYPE1 D_801C51A4;
// extern UNK_TYPE1 D_801C51A8;
// extern UNK_TYPE1 D_801C51B4;
// extern UNK_TYPE1 D_801C51B8;
// extern UNK_TYPE1 D_801C51BC;
// extern UNK_TYPE1 D_801C51C4;
// extern UNK_TYPE1 D_801C51C8;
// extern UNK_TYPE1 D_801C51CC;
// extern UNK_TYPE1 D_801C51D4;
// extern UNK_TYPE1 D_801C51D8;
// extern UNK_TYPE1 D_801C51DC;
// extern UNK_TYPE1 D_801C51E0;
// extern UNK_TYPE1 D_801C51E4;
extern UNK_PTR D_801C51E8;
// extern UNK_TYPE1 D_801C5200;
// extern UNK_TYPE1 D_801C5204;
// extern UNK_TYPE1 D_801C5208;
// extern UNK_TYPE1 D_801C520C;
// extern UNK_TYPE1 D_801C5210;
// extern UNK_TYPE1 D_801C5214;
// extern UNK_TYPE1 D_801C5218;
// extern UNK_TYPE1 D_801C521C;
// extern UNK_TYPE1 D_801C5220;
extern UNK_PTR D_801C5224;
// extern UNK_TYPE1 D_801C5240;
// extern UNK_TYPE1 D_801C5244;
// extern UNK_TYPE1 D_801C5248;
// extern UNK_TYPE1 D_801C5258;
// extern UNK_TYPE1 D_801C5268;
// extern UNK_TYPE1 D_801C5278;
// extern UNK_TYPE1 D_801C5284;
// extern UNK_TYPE1 D_801C5288;
// extern UNK_TYPE1 D_801C528C;
// extern UNK_TYPE1 D_801C5290;
// extern UNK_TYPE1 D_801C5294;
// extern UNK_TYPE1 D_801C5298;
// extern UNK_TYPE1 D_801C529C;
// extern UNK_TYPE1 D_801C52A4;
// extern UNK_TYPE1 D_801C52D0;
// extern UNK_TYPE1 D_801C52D4;
// extern UNK_TYPE1 D_801C52D8;
// extern UNK_TYPE1 D_801C52DC;
// extern UNK_TYPE1 D_801C52E0;
// extern UNK_TYPE1 D_801C52E4;
// extern UNK_TYPE1 D_801C52E8;
extern UNK_PTR D_801C52EC;
// extern UNK_TYPE1 D_801C5304;
// extern UNK_TYPE1 D_801C530C;
// extern UNK_TYPE1 D_801C5314;
// extern UNK_TYPE1 D_801C531C;
// extern UNK_TYPE1 D_801C5328;
// extern UNK_TYPE1 D_801C5334;
// extern UNK_TYPE1 D_801C5338;
// extern UNK_TYPE1 D_801C533C;
// extern UNK_TYPE1 D_801C5340;
// extern UNK_TYPE1 D_801C5344;
// extern UNK_TYPE1 D_801C5348;
// extern UNK_TYPE1 D_801C534C;
// extern UNK_TYPE1 D_801C5350;
// extern UNK_TYPE1 D_801C5354;
// extern UNK_TYPE1 D_801C5358;
// extern UNK_TYPE1 D_801C535C;
// extern UNK_TYPE1 D_801C5360;
extern UNK_PTR D_801C5364;
// extern UNK_TYPE1 D_801C5398;
// extern UNK_TYPE1 D_801C53A0;
// extern UNK_TYPE1 D_801C53A4;
// extern UNK_TYPE1 D_801C53A8;
// extern UNK_TYPE1 D_801C53AC;
// extern UNK_TYPE1 D_801C53B0;
// extern UNK_TYPE1 D_801C53B4;
// extern UNK_TYPE1 D_801C53B8;
// extern UNK_TYPE1 D_801C53BC;
// extern UNK_TYPE1 D_801C53C0;
extern UNK_PTR D_801C53C4;
// extern UNK_TYPE1 D_801C53EC;
// extern UNK_TYPE1 D_801C53F4;
// extern UNK_TYPE1 D_801C53F8;
// extern UNK_TYPE1 D_801C53FC;
// extern UNK_TYPE1 D_801C5400;
// extern UNK_TYPE1 D_801C5404;
// extern UNK_TYPE1 D_801C5408;
// extern UNK_TYPE1 D_801C540C;
extern UNK_PTR D_801C5410;
// extern UNK_TYPE1 D_801C5430;
// extern UNK_TYPE1 D_801C5440;
// extern UNK_TYPE1 D_801C5448;
// extern UNK_TYPE1 D_801C544C;
// extern UNK_TYPE1 D_801C5450;
// extern UNK_TYPE1 D_801C5454;
// extern UNK_TYPE1 D_801C5458;
// extern UNK_TYPE1 D_801C545C;
// extern UNK_TYPE1 D_801C5460;
// extern UNK_TYPE1 D_801C5464;
// extern UNK_TYPE1 D_801C5468;
extern UNK_PTR D_801C546C;
// extern UNK_TYPE1 D_801C5498;
// extern UNK_TYPE1 D_801C549C;
// extern UNK_TYPE1 D_801C54A0;
// extern UNK_TYPE1 D_801C54A4;
// extern UNK_TYPE1 D_801C54B0;
// extern UNK_TYPE1 D_801C54B4;
// extern UNK_TYPE1 D_801C54B8;
// extern UNK_TYPE1 D_801C54BC;
// extern UNK_TYPE1 D_801C54C0;
// extern UNK_TYPE1 D_801C54C4;
// extern UNK_TYPE1 D_801C54C8;
// extern UNK_TYPE1 D_801C54CC;
// extern UNK_TYPE1 D_801C54D0;
// extern UNK_TYPE1 D_801C54D4;
// extern UNK_TYPE1 D_801C54D8;
// extern UNK_TYPE1 D_801C54DC;
// extern UNK_TYPE1 D_801C54E0;
// extern UNK_TYPE1 D_801C54E4;
// extern UNK_TYPE1 D_801C54E8;
// extern UNK_TYPE1 D_801C54EC;
// extern UNK_TYPE1 D_801C54F0;
extern UNK_PTR D_801C54F4;
// extern UNK_TYPE1 D_801C5538;
// extern UNK_TYPE1 D_801C5568;
// extern UNK_TYPE1 D_801C5598;
// extern UNK_TYPE1 D_801C55C4;
// extern UNK_TYPE1 D_801C55F0;
// extern UNK_TYPE1 D_801C561C;
// extern UNK_TYPE1 D_801C5648;
// extern UNK_TYPE1 D_801C5674;
// extern UNK_TYPE1 D_801C56A0;
// extern UNK_TYPE1 D_801C56CC;
extern UNK_PTR D_801C56F8;
extern SceneEntranceTableEnty gSceneEntranceTable[110];
extern s16 gLinkFormObjectIndexes[8];
extern RomFile objectFileTable[643];
extern SceneTableEntry gSceneTable[];
extern UNK_PTR D_801C5C50;
// extern UNK_TYPE1 D_801C5C9C;
extern UNK_PTR D_801C5CB0;
@ -4044,9 +3473,9 @@ extern s32* gNMIBuffer;
// extern UNK_TYPE1 D_801F59F8;
extern QuakeRequest sQuakeRequest[4];
extern Quake2Context sQuake2Context;
extern s32 gSceneProcStep;
extern u32 gSceneProcFlags;
extern f32 gSceneProcFlashingAlpha;
extern s32 sMatAnimStep;
extern u32 sMatAnimFlags;
extern f32 sMatAnimAlphaRatio;
extern s32 D_801F5AB0;
extern s32 D_801F5AB4;
// extern UNK_TYPE1 D_801F5AC0;

View File

@ -76,7 +76,7 @@ typedef struct {
/* 0x0 */ s8 segment;
/* 0x2 */ s16 type;
/* 0x4 */ void* params;
} AnimatedTexture; // size = 0x8
} AnimatedMaterial; // size = 0x8
typedef struct {
/* 0x0 */ u16 floorHead;
@ -152,12 +152,6 @@ typedef struct {
/* 0x10 */ u32 collectibleFlags;
} CycleSceneFlags; // size = 0x14
typedef struct {
/* 0x0 */ u16 cycleLength;
/* 0x4 */ Gfx** textureDls;
/* 0x8 */ u8* textureDlOffsets;
} CyclingTextureParams; // size = 0xC
typedef struct {
/* 0x0 */ s16 x;
/* 0x2 */ s16 y;
@ -205,14 +199,6 @@ typedef struct {
/* 0x7 */ u8 unk7;
} FireObjLightParams; // size = 0x8
typedef struct {
/* 0x0 */ u8 red;
/* 0x1 */ u8 green;
/* 0x2 */ u8 blue;
/* 0x3 */ u8 alpha;
/* 0x4 */ u8 lodFrac;
} FlashingTexturePrimColor; // size = 0x5
// Font textures are loaded into here
typedef struct {
/* 0x0000 */ u8 unk0[2][120][128];
@ -308,11 +294,6 @@ typedef enum IRQ_TYPE {
IRQ_PRENMI_4 = 0x2A1
} IRQ_TYPE;
typedef struct {
/* 0x0 */ u32 vromStart;
/* 0x4 */ u32 vromEnd;
} ObjectFileTableEntry; // size = 0x8
typedef struct {
/* 0x00 */ u32 textSize;
/* 0x04 */ u32 dataSize;
@ -439,17 +420,6 @@ typedef struct {
/* 0xE */ s16 color;
} TitleCardContext; // size = 0x10
typedef struct {
struct {
s8 room; // Room to switch to
s8 effects; // How the camera reacts during the transition
} /* 0x00 */ sides[2]; // 0 = front, 1 = back
/* 0x04 */ s16 id;
/* 0x06 */ Vec3s pos;
/* 0x0C */ s16 rotY;
/* 0x0E */ s16 params;
} TransitionActorEntry; // size = 0x10
typedef struct {
/* 0x0 */ s32 topY;
/* 0x4 */ s32 bottomY;
@ -635,14 +605,6 @@ typedef enum {
GFXPRINT_OPEN = 0x80
} GfxPrintFlag;
typedef struct {
/* 0x0 */ u16 cycleLength;
/* 0x2 */ u16 numKeyFrames;
/* 0x4 */ FlashingTexturePrimColor* primColors;
/* 0x8 */ Color_RGBA8* envColors;
/* 0xC */ u16* keyFrames;
} FlashingTextureParams; // size = 0x10
typedef struct {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ u32 vromStart;
@ -1307,8 +1269,6 @@ typedef void(*cutscene_update_func)(GlobalContext* ctxt, CutsceneContext* cCtxt)
typedef void(*draw_func)(GlobalContext* ctxt, s16 index);
typedef void(*global_context_func)(GlobalContext*);
typedef void(*room_draw_func)(GlobalContext* ctxt, Room* room, u32 flags);
typedef struct {
@ -1323,10 +1283,6 @@ typedef struct {
/* 0x20 */ u32 unk20;
} s801BB170; // size = 0x24
typedef void(*scene_header_func)(GlobalContext* ctxt, SceneCmd* entry);
typedef void(*scene_proc_draw_func)(GlobalContext* ctxt, u32 segment, void* params);
typedef struct Camera Camera;
typedef struct {
@ -1665,17 +1621,15 @@ struct GlobalContext {
/* 0x17002 */ UNK_TYPE1 pad17002[0x2];
/* 0x17004 */ KankyoContext kankyoContext;
/* 0x17104 */ AnimationContext animationCtx;
/* 0x17D88 */ SceneContext sceneContext;
/* 0x17D88 */ ObjectContext objectCtx;
/* 0x186E0 */ RoomContext roomContext;
/* 0x18760 */ u8 transitionActorCount;
/* 0x18761 */ UNK_TYPE1 pad18761[0x3];
/* 0x18764 */ TransitionActorEntry* transitionActorList;
/* 0x18760 */ TransitionContext transitionCtx;
/* 0x18768 */ UNK_TYPE1 pad18768[0x48];
/* 0x187B0 */ MtxF unk187B0;
/* 0x187F0 */ UNK_TYPE1 pad187F0[0xC];
/* 0x187FC */ MtxF unk187FC;
/* 0x1883C */ UNK_TYPE1 pad1883C[0x4];
/* 0x18840 */ u32 unk18840;
/* 0x18840 */ u32 gameplayFrames;
/* 0x18844 */ u8 unk18844;
/* 0x18845 */ u8 unk18845;
/* 0x18846 */ u16 sceneNumActorsToLoad;
@ -1690,7 +1644,7 @@ struct GlobalContext {
/* 0x18860 */ u16* setupExitList;
/* 0x18864 */ void* setupPathList;
/* 0x18868 */ UNK_PTR unk18868;
/* 0x1886C */ AnimatedTexture* sceneTextureAnimations;
/* 0x1886C */ AnimatedMaterial* sceneMaterialAnims;
/* 0x18870 */ UNK_TYPE1 pad18870[0x4];
/* 0x18874 */ u8 unk18874;
/* 0x18875 */ s8 unk18875;

View File

@ -1,6 +1,13 @@
#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
typedef enum {
/* 0x000 */ OBJECT_UNSET_0,
/* 0x001 */ GAMEPLAY_KEEP,

View File

@ -8,8 +8,8 @@
#define SPAWN_ROT_FLAGS(rotation, flags) (((rotation) << 7) | (flags))
typedef struct {
/* 0x0 */ u32 vromStart;
/* 0x4 */ u32 vromEnd;
/* 0x00 */ u32 vromStart;
/* 0x04 */ u32 vromEnd;
} RomFile; // size = 0x8
typedef struct {
@ -67,7 +67,7 @@ typedef struct {
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 cUpElfMsgNum;
/* 0x04 */ u32 keepObjectId;
/* 0x04 */ u32 subKeepIndex;
} SCmdSpecialFiles;
typedef struct {
@ -287,6 +287,22 @@ typedef struct {
/* 0x7A */ UNK_TYPE2 unk7A[3];
} RoomContext; // size = 0x80
typedef struct {
struct {
s8 room; // Room to switch to
s8 effects; // How the camera reacts during the transition
} /* 0x00 */ sides[2]; // 0 = front, 1 = back
/* 0x04 */ s16 id;
/* 0x06 */ Vec3s pos;
/* 0x0C */ s16 rotY;
/* 0x0E */ s16 params;
} TransitionActorEntry; // size = 0x10
typedef struct {
/* 0x00 */ u8 nbTransitionActors;
/* 0x04 */ TransitionActorEntry* transitionActorList;
} TransitionContext;
typedef struct {
/* 0x0 */ s16 id;
/* 0x2 */ Vec3s pos;
@ -307,16 +323,16 @@ typedef struct {
} EntranceEntry; // size = 0x2
typedef struct {
/* 0x0 */ s8 scene; // TODO what does it means for this to be neagtive?
/* 0x1 */ s8 unk1;
/* 0x2 */ u16 unk2;
} EntranceRecord; // size = 0x4
/* 0x0 */ s8 sceneNum;
/* 0x1 */ s8 spawnNum;
/* 0x2 */ u16 flags;
} EntranceTableEntry; // size = 0x4
typedef struct {
/* 0x0 */ u32 entranceCount;
/* 0x4 */ EntranceRecord** entrances;
/* 0x0 */ u32 tableCount : 8;
/* 0x4 */ EntranceTableEntry** table;
/* 0x8 */ char* name;
} SceneEntranceTableEnty; // size = 0xC
} SceneEntranceTableEntry; // size = 0xC
typedef struct {
/* 0x00 */ u16 scenes[27];
@ -332,32 +348,59 @@ typedef struct {
} ObjectStatus; // size = 0x44
typedef struct {
/* 0x0 */ u32 romStart;
/* 0x4 */ u32 romEnd;
/* 0x8 */ u16 unk8;
/* 0xA */ UNK_TYPE1 padA[0x1];
/* 0xB */ u8 sceneConfig; // TODO: This at least controls the behavior of animated textures. Does it do more?
/* 0xC */ UNK_TYPE1 padC[0x1];
/* 0xD */ u8 unkD;
/* 0xE */ UNK_TYPE1 padE[0x2];
} SceneTableEntry; // size = 0x10
/* 0x0 */ RomFile segment;
/* 0x8 */ u16 titleTextId;
/* 0xA */ u8 unk_A;
/* 0xB */ u8 drawConfig;
/* 0xC */ u8 unk_C;
/* 0xD */ char pad_D[3];
} SceneTableEntry; // size = 0x10;
typedef struct {
/* 0x0 */ u8 r;
/* 0x1 */ u8 g;
/* 0x2 */ u8 b;
/* 0x3 */ u8 a;
/* 0x4 */ u8 lodFrac;
} F3DPrimColor; // size = 0x5
typedef struct {
/* 0x0 */ u8 r;
/* 0x1 */ u8 g;
/* 0x2 */ u8 b;
/* 0x3 */ u8 a;
} F3DEnvColor; // size = 0x4
typedef struct {
/* 0x0 */ u16 keyFrameLength;
/* 0x2 */ u16 keyFrameCount;
/* 0x4 */ F3DPrimColor* primColors;
/* 0x8 */ F3DEnvColor* envColors;
/* 0xC */ u16* keyFrames;
} AnimatedMatColorParams; // size = 0x10
typedef struct {
/* 0x0 */ s8 xStep;
/* 0x1 */ s8 yStep;
/* 0x2 */ u8 width;
/* 0x3 */ u8 height;
} ScrollingTextureParams; // size = 0x4
} AnimatedMatTexScrollParams; // size = 0x4
typedef struct {
/* 0x000 */ void* objectVramStart;
/* 0x004 */ void* objectVramEnd;
/* 0x008 */ u8 objectCount;
/* 0x0 */ u16 keyFrameLength;
/* 0x4 */ void** textureList;
/* 0x8 */ u8* textureIndexList;
} AnimatedMatTexCycleParams; // size = 0xC
typedef struct {
/* 0x000 */ void* spaceStart;
/* 0x004 */ void* spaceEnd;
/* 0x008 */ u8 num;
/* 0x009 */ u8 spawnedObjectCount;
/* 0x00A */ u8 mainKeepIndex;
/* 0x00B */ u8 keepObjectId;
/* 0x00C */ ObjectStatus objects[35]; // TODO: OBJECT_EXCHANGE_BANK_MAX array size
} SceneContext; // size = 0x958
/* 0x00B */ u8 subKeepIndex;
/* 0x00C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX];
} ObjectContext; // size = 0x958
typedef struct {
u8 headerType;
@ -625,4 +668,186 @@ typedef enum {
/* 0x70 */ SCENE_ALLEY
} SceneID;
// Scene draw configs
typedef enum {
/* 0 */ SCENE_DRAW_CFG_DEFAULT,
/* 1 */ SCENE_DRAW_CFG_MAT_ANIM,
/* 2 */ SCENE_DRAW_CFG_NOTHING,
/* 3 */ SCENE_DRAW_CFG_UNUSED_3,
/* 4 */ SCENE_DRAW_CFG_UNUSED_4,
/* 5 */ SCENE_DRAW_CFG_UNUSED_5,
/* 6 */ SCENE_DRAW_CFG_GREAT_BAY_TEMPLE,
/* 7 */ SCENE_DRAW_CFG_MAT_ANIM_MANUAL_STEP
} SceneDrawConfigIds;
// Scene commands
typedef enum {
/* 0x00 */ SCENE_CMD_ID_SPAWN_LIST,
/* 0x01 */ SCENE_CMD_ID_ACTOR_LIST,
/* 0x02 */ SCENE_CMD_ID_ACTOR_CUTSCENE_CAM_LIST,
/* 0x03 */ SCENE_CMD_ID_COL_HEADER,
/* 0x04 */ SCENE_CMD_ID_ROOM_LIST,
/* 0x05 */ SCENE_CMD_ID_WIND_SETTINGS,
/* 0x06 */ SCENE_CMD_ID_ENTRANCE_LIST,
/* 0x07 */ SCENE_CMD_ID_SPECIAL_FILES,
/* 0x08 */ SCENE_CMD_ID_ROOM_BEHAVIOR,
/* 0x09 */ SCENE_CMD_ID_UNUSED_09,
/* 0x0A */ SCENE_CMD_ID_MESH,
/* 0x0B */ SCENE_CMD_ID_OBJECT_LIST,
/* 0x0C */ SCENE_CMD_ID_LIGHT_LIST,
/* 0x0D */ SCENE_CMD_ID_PATH_LIST,
/* 0x0E */ SCENE_CMD_ID_TRANSI_ACTOR_LIST,
/* 0x0F */ SCENE_CMD_ID_ENV_LIGHT_SETTINGS,
/* 0x10 */ SCENE_CMD_ID_TIME_SETTINGS,
/* 0x11 */ SCENE_CMD_ID_SKYBOX_SETTINGS,
/* 0x12 */ SCENE_CMD_ID_SKYBOX_DISABLES,
/* 0x13 */ SCENE_CMD_ID_EXIT_LIST,
/* 0x14 */ SCENE_CMD_ID_END,
/* 0x15 */ SCENE_CMD_ID_SOUND_SETTINGS,
/* 0x16 */ SCENE_CMD_ID_ECHO_SETTINGS,
/* 0x17 */ SCENE_CMD_ID_CUTSCENE_LIST,
/* 0x18 */ SCENE_CMD_ID_ALTERNATE_HEADER_LIST,
/* 0x19 */ SCENE_CMD_ID_MISC_SETTINGS,
/* 0x1A */ SCENE_CMD_ID_ANIMATED_MATERIAL_LIST,
/* 0x1B */ SCENE_CMD_ID_ACTOR_CUTSCENE_LIST,
/* 0x1C */ SCENE_CMD_ID_MINIMAP_INFO,
/* 0x1D */ SCENE_CMD_ID_UNUSED_1D,
/* 0x1E */ SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO,
/* 0x1F */ SCENE_CMD_MAX
} SceneCommandTypeID;
#define SCENE_CMD_SPAWN_LIST(numSpawns, spawnList) \
{ SCENE_CMD_ID_SPAWN_LIST, numSpawns, CMD_PTR(spawnList) }
#define SCENE_CMD_ACTOR_LIST(numActors, actorList) \
{ SCENE_CMD_ID_ACTOR_LIST, numActors, CMD_PTR(actorList) }
#define SCENE_CMD_ACTOR_CUTSCENE_CAM_LIST(camList) \
{ SCENE_CMD_ID_ACTOR_CUTSCENE_CAM_LIST, 0, CMD_PTR(camList) }
#define SCENE_CMD_COL_HEADER(colHeader) \
{ SCENE_CMD_ID_COL_HEADER, 0, CMD_PTR(colHeader) }
#define SCENE_CMD_ROOM_LIST(numRooms, roomList) \
{ SCENE_CMD_ID_ROOM_LIST, numRooms, CMD_PTR(roomList) }
#define SCENE_CMD_WIND_SETTINGS(xDir, yDir, zDir, strength) \
{ SCENE_CMD_ID_WIND_SETTINGS, 0, CMD_BBBB(xDir, yDir, zDir, strength) }
#define SCENE_CMD_ENTRANCE_LIST(entranceList) \
{ SCENE_CMD_ID_ENTRANCE_LIST, 0, CMD_PTR(entranceList) }
#define SCENE_CMD_SPECIAL_FILES(elfMessageFile, keepObjectId) \
{ SCENE_CMD_ID_SPECIAL_FILES, elfMessageFile, CMD_W(keepObjectId) }
#define SCENE_CMD_ROOM_BEHAVIOR(currRoomUnk3, currRoomUnk2, currRoomUnk5, msgCtxunk12044, enablePosLights, \
kankyoContextUnkE2) \
{ \
SCENE_CMD_ID_ROOM_BEHAVIOR, currRoomUnk3, \
currRoomUnk2 | _SHIFTL(currRoomUnk5, 8, 1) | _SHIFTL(msgCtxunk12044, 10, 1) | \
_SHIFTL(enablePosLights, 11, 1) | _SHIFTL(kankyoContextUnkE2, 12, 1) \
}
#define SCENE_CMD_MESH(meshHeader) \
{ SCENE_CMD_ID_MESH, 0, CMD_PTR(meshHeader) }
#define SCENE_CMD_OBJECT_LIST(numObjects, objectList) \
{ SCENE_CMD_ID_OBJECT_LIST, numObjects, CMD_PTR(objectList) }
#define SCENE_CMD_LIGHT_LIST(numLights, lightList) \
{ SCENE_CMD_ID_POS_LIGHT_LIST, numLights, CMD_PTR(lightList) }
#define SCENE_CMD_PATH_LIST(pathList) \
{ SCENE_CMD_ID_PATH_LIST, 0, CMD_PTR(pathList) }
#define SCENE_CMD_TRANSITION_ACTOR_LIST(numTransitionActors, transitionActorList) \
{ SCENE_CMD_ID_TRANSI_ACTOR_LIST, numTransitionActors, CMD_PTR(transitionActorList) }
#define SCENE_CMD_ENV_LIGHT_SETTINGS(numLightSettings, lightSettingsList) \
{ SCENE_CMD_ID_ENV_LIGHT_SETTINGS, numLightSettings, CMD_PTR(lightSettingsList) }
#define SCENE_CMD_TIME_SETTINGS(hour, min, speed) \
{ SCENE_CMD_ID_TIME_SETTINGS, 0, CMD_BBBB(hour, min, speed, 0) }
#define SCENE_CMD_SKYBOX_SETTINGS(externalTextureFileId, skyboxId, weather, lightMode) \
{ SCENE_CMD_ID_SKYBOX_SETTINGS, externalTextureFileId, CMD_BBBB(skyboxId, weather, lightMode, 0) }
#define SCENE_CMD_SKYBOX_DISABLES(disableSky, disableSunMoon) \
{ SCENE_CMD_ID_SKYBOX_DISABLES, 0, CMD_BBBB(disableSky, disableSunMoon, 0, 0) }
#define SCENE_CMD_EXIT_LIST(exitList) \
{ SCENE_CMD_ID_EXIT_LIST, 0, CMD_PTR(exitList) }
#define SCENE_CMD_END() \
{ SCENE_CMD_ID_END, 0, CMD_W(0) }
#define SCENE_CMD_SOUND_SETTINGS(audioSessionId, nighttimeSfx, bgmId) \
{ SCENE_CMD_ID_SOUND_SETTINGS, audioSessionId, CMD_BBBB(0, 0, nighttimeSfx, bgmId) }
#define SCENE_CMD_ECHO_SETTINGS(echo) \
{ SCENE_CMD_ID_ECHO_SETTINGS, 0, CMD_BBBB(0, 0, 0, echo) }
#define SCENE_CMD_CUTSCENE_LIST(numCutscene, cutsceneList) \
{ SCENE_CMD_ID_CUTSCENE_LIST, numCutscene, CMD_PTR(cutsceneList) }
#define SCENE_CMD_ALTERNATE_HEADER_LIST(alternateHeaderList) \
{ SCENE_CMD_ID_ALTERNATE_HEADER_LIST, 0, CMD_PTR(alternateHeaderList) }
#define SCENE_CMD_MISC_SETTINGS() \
{ SCENE_CMD_ID_MISC_SETTINGS, 0, CMD_W(0) }
#define SCENE_CMD_ANIMATED_MATERIAL_LIST(matAnimList) \
{ SCENE_CMD_ID_ANIMATED_MATERIAL_LIST, 0, CMD_PTR(matAnimList) }
#define SCENE_CMD_ACTOR_CUTSCENE_LIST(actorCutsceneCount, actorCutsceneList) \
{ SCENE_CMD_ID_ACTOR_CUTSCENE_LIST, actorCutsceneCount, CMD_PTR(actorCutsceneList) }
#define SCENE_CMD_MINIMAP_INFO(minimapInfo) \
{ SCENE_CMD_ID_MINIMAP_INFO, 0, CMD_PTR(minimapInfo) }
#define SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(compassIconCount, compassIconInfo) \
{ SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO, compassIconCount, CMD_PTR(compassIconInfo) }
//! @TODO: Remove these! These are only here for the time being to prevent compiler errors with scenes and rooms!
// ----> AnimatedMaterial
typedef struct {
/* 0x0 */ s8 segment;
/* 0x2 */ s16 type;
/* 0x4 */ void* params;
} AnimatedTexture; // size = 0x8
// ----> AnimatedMatTexScrollParams
typedef struct {
/* 0x0 */ s8 xStep;
/* 0x1 */ s8 yStep;
/* 0x2 */ u8 width;
/* 0x3 */ u8 height;
} ScrollingTextureParams; // size = 0x4
// ----> F3DPrimColor
typedef struct {
/* 0x0 */ u8 red;
/* 0x1 */ u8 green;
/* 0x2 */ u8 blue;
/* 0x3 */ u8 alpha;
/* 0x4 */ u8 lodFrac;
} FlashingTexturePrimColor; // size = 0x5
// ----> AnimatedMatColorParams
typedef struct {
/* 0x0 */ u16 cycleLength;
/* 0x2 */ u16 numKeyFrames;
/* 0x4 */ FlashingTexturePrimColor* primColors;
/* 0x8 */ Color_RGBA8* envColors;
/* 0xC */ u16* keyFrames;
} FlashingTextureParams; // size = 0x10
// ----> AnimatedMatTexCycleParams
typedef struct {
/* 0x0 */ u16 cycleLength;
/* 0x4 */ Gfx** textureDls;
/* 0x8 */ u8* textureDlOffsets;
} CyclingTextureParams; // size = 0xC
#endif

View File

@ -410,7 +410,7 @@ SECTIONS
build/asm/code/code_0x8012EC80.o(.text)
build/src/code/z_scene.o(.text)
build/src/code/z_scene_proc.o(.text)
build/asm/code/z_scene_table.o(.text)
build/src/code/z_scene_table.o(.text)
build/asm/code/code_0x801323D0.o(.text)
build/src/code/z_skelanime.o(.text)
build/asm/code/z_skin.o(.text)
@ -528,10 +528,10 @@ SECTIONS
build/src/code/z_rcp.o(.data)
build/asm/code/code_data_z_room.o(.data)
build/asm/code/code_data_0x801C1D30.o(.data)
build/asm/code/code_data_z_scene.o(.data)
build/src/code/z_scene.o(.data)
build/asm/code/code_data_0x801C2730.o(.data)
build/asm/code/code_data_z_scene_proc.o(.data)
build/asm/code/code_data_z_scene_table.o(.data)
build/src/code/z_scene_proc.o(.data)
build/src/code/z_scene_table.o(.data)
build/asm/code/code_data_0x801323D0.o(.data)
build/src/code/z_skelanime.o(.data)
build/src/code/z_skin_matrix.o(.data)
@ -602,7 +602,7 @@ SECTIONS
build/asm/code/code_rodata_0x8012A080.o(.rodata)
build/asm/code/code_rodata_z_room.o(.rodata)
build/src/code/z_scene_proc.o(.rodata)
build/asm/code/code_rodata_z_scene_table.o(.rodata)
build/src/code/z_scene_table.o(.rodata)
build/asm/code/code_rodata_z_skin.o(.rodata)
build/src/code/z_skin_matrix.o(.rodata)
build/asm/code/code_rodata_z_sub_s.o(.rodata)

View File

@ -171,7 +171,7 @@ void Actor_TargetContextInit(TargetContext* targetCtxt, Actor* actor, GlobalCont
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_actor//func_800B5814.asm")
u32 Actor_GetSwitchFlag(GlobalContext* ctxt, s32 flag) {
u32 Flags_GetSwitch(GlobalContext* ctxt, s32 flag) {
if (flag >= 0 && flag < 0x80) {
return ctxt->actorCtx.switchFlags[(flag & -0x20) >> 5] & (1 << (flag & 0x1F));
}
@ -327,7 +327,7 @@ void Actor_SetScale(Actor* actor, f32 scale) {
void Actor_SetObjectSegment(GlobalContext* ctxt, Actor* actor) {
// TODO: Segment number enum
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->sceneContext.objects[actor->objBankIndex].segment);
gSegments[6] = PHYSICAL_TO_VIRTUAL(ctxt->objectCtx.status[actor->objBankIndex].segment);
}
#if 0
@ -351,7 +351,7 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
actor->naviMsgId = 255;
Actor_Setshape(&actor->shape, 0, 0, 0);
if (Scene_IsObjectLoaded(&ctxt->sceneContext, actor->objBankIndex) != 0) {
if (Object_IsLoaded(&ctxt->objectCtx, actor->objBankIndex) != 0) {
Actor_SetObjectSegment(ctxt, actor);
actor->init(actor, ctxt);
actor->init = NULL;

View File

@ -10,7 +10,7 @@ void EffectSs_DrawGEffect(GlobalContext* globalCtx, EffectSs* this, void* textur
MtxF mfTrans11DA0;
s32 pad1;
Mtx* mtx;
void* object = globalCtx->sceneContext.objects[this->rgObjBankIdx].segment;
void* object = globalCtx->objectCtx.status[this->rgObjBankIdx].segment;
OPEN_DISPS(gfxCtx);

View File

@ -149,15 +149,15 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk154 = 0.01f;
break;
case ITEM00_SHIELD_HERO:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_SHIELD_2);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_SHIELD_2);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
case ITEM00_MAP:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_MAP);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_MAP);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
case ITEM00_COMPASS:
this->actor.objBankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_COMPASS);
this->actor.objBankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_COMPASS);
EnItem00_SetObject(this, globalCtx, &shadowOffset, &shadowScale);
break;
default:
@ -263,8 +263,8 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) {
void EnItem00_WaitForHeartObject(EnItem00* this, GlobalContext* globalCtx) {
s32 sp1C;
sp1C = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEARTS);
if (Scene_IsObjectLoaded(&globalCtx->sceneContext, sp1C)) {
sp1C = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEARTS);
if (Object_IsLoaded(&globalCtx->objectCtx, sp1C)) {
this->actor.objBankIndex = sp1C;
this->actionFunc = func_800A640C;
}
@ -323,7 +323,7 @@ void func_800A6650(EnItem00* this, GlobalContext* globalCtx) {
if (this->actor.params <= ITEM00_RUPEE_RED) {
this->actor.shape.rot.y = this->actor.shape.rot.y + 960;
}
if ((globalCtx->unk18840 & 1) != 0) {
if ((globalCtx->gameplayFrames & 1) != 0) {
pos.x = this->actor.world.pos.x + randPlusMinusPoint5Scaled(10.0f);
pos.y = this->actor.world.pos.y + randPlusMinusPoint5Scaled(10.0f);
pos.z = this->actor.world.pos.z + randPlusMinusPoint5Scaled(10.0f);
@ -377,7 +377,7 @@ void func_800A6780(EnItem00* this, GlobalContext* globalCtx) {
}
}
if ((globalCtx->unk18840 & 1) == 0) {
if ((globalCtx->gameplayFrames & 1) == 0) {
pos.x = this->actor.world.pos.x + ((Rand_ZeroOne() - 0.5f) * 10.0f);
pos.y = this->actor.world.pos.y + ((Rand_ZeroOne() - 0.5f) * 10.0f);
pos.z = this->actor.world.pos.z + ((Rand_ZeroOne() - 0.5f) * 10.0f);
@ -639,8 +639,8 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) {
case ITEM00_HEART:
if (this->unk152 < 0) {
if (this->unk152 == -1) {
s8 bankIndex = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEART);
if (Scene_IsObjectLoaded(&globalCtx->sceneContext, bankIndex)) {
s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART);
if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) {
this->actor.objBankIndex = bankIndex;
Actor_SetObjectSegment(globalCtx, &this->actor);
this->unk152 = -2;
@ -767,7 +767,7 @@ void EnItem00_DrawHeartContainer(EnItem00* actor, GlobalContext* globalCtx) {
s32 pad;
s32 pad2;
if (Scene_FindSceneObjectIndex(&globalCtx->sceneContext, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
if (Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEARTS) == actor->actor.objBankIndex) {
OPEN_DISPS(globalCtx->state.gfxCtx);
func_8012C2DC(globalCtx->state.gfxCtx);

View File

@ -1,83 +1,72 @@
#include <ultra64.h>
#include <global.h>
/*
TODO:
There are a few issues left with this file, but many rely on larger structural project changes.
I am avoiding these in the mean time in order to not break the Ghidra project structures.
We need a header file for just z_scene. Including relevant structs, scene, and object enums.
Needs definition for OBJECT_EXCHANGE_BANK_MAX
The .data, .bss, and .rodata sections are not migrated to this file yet.
*/
s32 Scene_LoadObject(SceneContext* sceneCtxt, s16 id) {
s32 Object_Spawn(ObjectContext* objectCtx, s16 id) {
u32 size;
sceneCtxt->objects[sceneCtxt->objectCount].id = id;
objectCtx->status[objectCtx->num].id = id;
size = objectFileTable[id].vromEnd - objectFileTable[id].vromStart;
if (sceneCtxt) {}
if (1) {}
if (size) {
DmaMgr_SendRequest0(sceneCtxt->objects[sceneCtxt->objectCount].segment, objectFileTable[id].vromStart, size);
if (size != 0) {
DmaMgr_SendRequest0(objectCtx->status[objectCtx->num].segment, objectFileTable[id].vromStart, size);
}
// TODO: This 0x22 is OBJECT_EXCHANGE_BANK_MAX - 1 in OOT
if (sceneCtxt->objectCount < 0x22) {
sceneCtxt->objects[sceneCtxt->objectCount + 1].segment =
// UB to cast pointer to u32
(void*)ALIGN16((u32)sceneCtxt->objects[sceneCtxt->objectCount].segment + size);
if (objectCtx->num < OBJECT_EXCHANGE_BANK_MAX - 1) {
objectCtx->status[objectCtx->num + 1].segment =
(void*)ALIGN16((u32)objectCtx->status[objectCtx->num].segment + size);
}
sceneCtxt->objectCount++;
sceneCtxt->spawnedObjectCount = sceneCtxt->objectCount;
objectCtx->num++;
objectCtx->spawnedObjectCount = objectCtx->num;
return sceneCtxt->objectCount - 1;
return objectCtx->num - 1;
}
void Scene_Init(GlobalContext* ctxt, SceneContext* sceneCtxt) {
GlobalContext* global = ctxt; // Needs to be a new variable to match (possibly a sub struct?)
u32 unused;
void Object_InitBank(GameState* state, ObjectContext* objectCtx) {
GlobalContext* globalCtx = (GlobalContext*)state;
s32 pad;
u32 spaceSize;
s32 i;
if (global->sceneNum == SCENE_CLOCKTOWER || global->sceneNum == SCENE_TOWN || global->sceneNum == SCENE_BACKTOWN || global->sceneNum == SCENE_ICHIBA) {
spaceSize = 1566720;
} else if (global->sceneNum == SCENE_MILK_BAR) {
spaceSize = 1617920;
} else if (global->sceneNum == SCENE_00KEIKOKU) {
spaceSize = 1505280;
if (globalCtx->sceneNum == SCENE_CLOCKTOWER || globalCtx->sceneNum == SCENE_TOWN ||
globalCtx->sceneNum == SCENE_BACKTOWN || globalCtx->sceneNum == SCENE_ICHIBA) {
spaceSize = OBJECT_SPACE_SIZE_CLOCK_TOWN;
} else if (globalCtx->sceneNum == SCENE_MILK_BAR) {
spaceSize = OBJECT_SPACE_SIZE_MILK_BAR;
} else if (globalCtx->sceneNum == SCENE_00KEIKOKU) {
spaceSize = OBJECT_SPACE_SIZE_TERMINA_FIELD;
} else {
spaceSize = 1413120;
spaceSize = OBJECT_SPACE_SIZE_DEFAULT;
}
sceneCtxt->objectCount = 0;
sceneCtxt->spawnedObjectCount = 0;
sceneCtxt->mainKeepIndex = 0;
sceneCtxt->keepObjectId = 0;
objectCtx->num = 0;
objectCtx->spawnedObjectCount = 0;
objectCtx->mainKeepIndex = 0;
objectCtx->subKeepIndex = 0;
// TODO: 0x23 is OBJECT_EXCHANGE_BANK_MAX in OOT
for (i = 0; i < 0x23; i++) sceneCtxt->objects[i].id = 0;
// clang-format off
for (i = 0; i < OBJECT_EXCHANGE_BANK_MAX; i++) { objectCtx->status[i].id = 0; }
// clang-format on
sceneCtxt->objectVramStart = sceneCtxt->objects[0].segment = THA_AllocEndAlign16(&ctxt->state.heap, spaceSize);
// UB to cast sceneCtxt->objectVramStart to s32
sceneCtxt->objectVramEnd = (void*)((u32)sceneCtxt->objectVramStart + spaceSize);
// TODO: Second argument here is an object enum
sceneCtxt->mainKeepIndex = Scene_LoadObject(sceneCtxt, 1);
// TODO: Segment number enum?
gSegments[4] = PHYSICAL_TO_VIRTUAL(sceneCtxt->objects[sceneCtxt->mainKeepIndex].segment);
objectCtx->spaceStart = objectCtx->status[0].segment = THA_AllocEndAlign16(&state->heap, spaceSize);
objectCtx->spaceEnd = (void*)((u32)objectCtx->spaceStart + spaceSize);
objectCtx->mainKeepIndex = Object_Spawn(objectCtx, GAMEPLAY_KEEP);
gSegments[4] = PHYSICAL_TO_VIRTUAL(objectCtx->status[objectCtx->mainKeepIndex].segment);
}
void Scene_ReloadUnloadedObjects(SceneContext* sceneCtxt) {
void Object_UpdateBank(ObjectContext* objectCtx) {
s32 i;
ObjectStatus* status;
ObjectFileTableEntry* objectFile;
ObjectStatus* status = &objectCtx->status[0];
RomFile* objectFile;
u32 size;
status = &sceneCtxt->objects[0];
for (i = 0; i < sceneCtxt->objectCount; i++) {
for (i = 0; i < objectCtx->num; i++) {
if (status->id < 0) {
s32 id = -status->id;
if (status->dmaReq.vromAddr == 0) {
objectFile = &objectFileTable[id];
size = objectFile->vromEnd - objectFile->vromStart;
@ -86,175 +75,185 @@ void Scene_ReloadUnloadedObjects(SceneContext* sceneCtxt) {
status->id = 0;
} else {
osCreateMesgQueue(&status->loadQueue, &status->loadMsg, 1);
DmaMgr_SendRequestImpl(&status->dmaReq, status->segment, objectFile->vromStart,
size, 0, &status->loadQueue, NULL);
DmaMgr_SendRequestImpl(&status->dmaReq, status->segment, objectFile->vromStart, size, 0,
&status->loadQueue, NULL);
}
} else if (!osRecvMesg(&status->loadQueue, NULL, OS_MESG_NOBLOCK)) {
status->id = id;
}
}
status++;
}
}
s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, s16 objectId) {
s32 Object_GetIndex(ObjectContext* objectCtx, s16 objectId) {
s32 i;
for(i = 0; i < sceneCtxt->objectCount; i++) {
if((sceneCtxt->objects[i].id < 0 ? -sceneCtxt->objects[i].id : sceneCtxt->objects[i].id) == objectId) {
for (i = 0; i < objectCtx->num; i++) {
if ((objectCtx->status[i].id < 0 ? -objectCtx->status[i].id : objectCtx->status[i].id) == objectId) {
return i;
}
}
return -1;
}
s32 Scene_IsObjectLoaded(SceneContext* actorShape, s32 index) {
if (actorShape->objects[index].id > 0) {
return 1;
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 index) {
if (objectCtx->status[index].id > 0) {
return true;
} else {
return 0;
return false;
}
}
void Scene_DmaAllObjects(SceneContext* sceneCtxt) {
void Object_LoadAll(ObjectContext* objectCtx) {
s32 i;
s32 id;
u32 vromSize;
for (i = 0; i < sceneCtxt->objectCount; i++) {
id = sceneCtxt->objects[i].id;
for (i = 0; i < objectCtx->num; i++) {
id = objectCtx->status[i].id;
vromSize = objectFileTable[id].vromEnd - objectFileTable[id].vromStart;
if (vromSize == 0) {
continue;
}
DmaMgr_SendRequest0(sceneCtxt->objects[i].segment, objectFileTable[id].vromStart, vromSize);
DmaMgr_SendRequest0(objectCtx->status[i].segment, objectFileTable[id].vromStart, vromSize);
}
}
void* func_8012F73C(SceneContext* sceneCtxt, s32 iParm2, s16 id) {
void* func_8012F73C(ObjectContext* objectCtx, s32 iParm2, s16 id) {
u32 addr;
u32 vromSize;
ObjectFileTableEntry* fileTableEntry;
RomFile* fileTableEntry;
sceneCtxt->objects[iParm2].id = -id;
sceneCtxt->objects[iParm2].dmaReq.vromAddr = 0;
objectCtx->status[iParm2].id = -id;
objectCtx->status[iParm2].dmaReq.vromAddr = 0;
fileTableEntry = &objectFileTable[id];
vromSize = fileTableEntry->vromEnd - fileTableEntry->vromStart;
// TODO: UB to cast void to u32
addr = ((u32)sceneCtxt->objects[iParm2].segment) + vromSize;
addr = ((u32)objectCtx->status[iParm2].segment) + vromSize;
addr = ALIGN16(addr);
// UB to cast u32 to pointer
return (void*)addr;
}
// Scene Command 0x00: Link Spawn List
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
GlobalContext* global = ctxt; // Needs to be a new variable to match (possibly a sub struct?)
// Scene Header Command 0x00: Spawn List
void Scene_HeaderCmdSpawnList(GlobalContext* globalCtx, SceneCmd* cmd) {
GlobalContext* globalCtx2 = globalCtx;
s32 loadedCount;
void* objectVramAddr;
s16 temp16;
void* nextObject;
s16 playerObjectId;
u8 unk20;
ctxt->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(entry->spawnList.segment) +
ctxt->setupEntranceList[ctxt->curSpawn].spawn;
if ( (ctxt->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)
) {
Scene_LoadObject(&ctxt->sceneContext, OBJECT_STK);
globalCtx->linkActorEntry = (ActorEntry*)Lib_SegmentedToVirtual(cmd->spawnList.segment) +
globalCtx->setupEntranceList[globalCtx->curSpawn].spawn;
if ((globalCtx->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)) {
// Skull Kid Object
Object_Spawn(&globalCtx->objectCtx, OBJECT_STK);
return;
}
loadedCount = Scene_LoadObject(&ctxt->sceneContext, OBJECT_LINK_CHILD);
objectVramAddr = global->sceneContext.objects[global->sceneContext.objectCount].segment;
ctxt->sceneContext.objectCount = loadedCount;
ctxt->sceneContext.spawnedObjectCount = loadedCount;
loadedCount = Object_Spawn(&globalCtx->objectCtx, OBJECT_LINK_CHILD);
nextObject = globalCtx2->objectCtx.status[globalCtx2->objectCtx.num].segment;
globalCtx->objectCtx.num = loadedCount;
globalCtx->objectCtx.spawnedObjectCount = loadedCount;
unk20 = gSaveContext.perm.unk20;
temp16 = D_801C2730[unk20];
gActorOverlayTable[0].initInfo->objectId = temp16;
Scene_LoadObject(&ctxt->sceneContext, temp16);
playerObjectId = gLinkFormObjectIndexes[unk20];
gActorOverlayTable[0].initInfo->objectId = playerObjectId;
Object_Spawn(&globalCtx->objectCtx, playerObjectId);
ctxt->sceneContext.objects[ctxt->sceneContext.objectCount].segment = objectVramAddr;
globalCtx->objectCtx.status[globalCtx->objectCtx.num].segment = nextObject;
}
// Scene Command 0x01: Actor List
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->sceneNumActorsToLoad = (u16)entry->actorList.num;
ctxt->setupActorList = (ActorEntry*)Lib_SegmentedToVirtual(entry->actorList.segment);
ctxt->actorCtx.unkC = (u16)0;
// Scene Header Command 0x01: Actor List
void Scene_HeaderCmdActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->sceneNumActorsToLoad = (u16)cmd->actorList.num;
globalCtx->setupActorList = (ActorEntry*)Lib_SegmentedToVirtual(cmd->actorList.segment);
globalCtx->actorCtx.unkC = (u16)0;
}
// Scene Command 0x02: Cutscene Camera List
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->unk18858 = (UNK_PTR)Lib_SegmentedToVirtual(entry->csCameraList.segment);
// Scene Header Command 0x02: List of cameras for actor cutscenes
void Scene_HeaderCmdActorCutsceneCamList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk18858 = (UNK_PTR)Lib_SegmentedToVirtual(cmd->csCameraList.segment);
}
// Scene Command 0x03: Collision Header
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
CollisionHeader* temp_ret;
CollisionHeader* temp_s0;
// Scene Header Command 0x03: Collision Header
void Scene_HeaderCmdColHeader(GlobalContext* globalCtx, SceneCmd* cmd) {
CollisionHeader* colHeaderTemp;
CollisionHeader* colHeader;
temp_ret = (CollisionHeader*)Lib_SegmentedToVirtual(entry->colHeader.segment);
temp_s0 = temp_ret;
temp_s0->vtxList = (Vec3s*)Lib_SegmentedToVirtual(temp_ret->vtxList);
temp_s0->polyList = (CollisionPoly*)Lib_SegmentedToVirtual(temp_s0->polyList);
if (temp_s0->surfaceTypeList != 0) {
temp_s0->surfaceTypeList = (SurfaceType*)Lib_SegmentedToVirtual(temp_s0->surfaceTypeList);
}
if (temp_s0->cameraDataList != 0) {
temp_s0->cameraDataList = (void*)Lib_SegmentedToVirtual(temp_s0->cameraDataList);
}
if (temp_s0->waterBoxes != 0) {
temp_s0->waterBoxes = (WaterBox*)Lib_SegmentedToVirtual(temp_s0->waterBoxes);
colHeaderTemp = (CollisionHeader*)Lib_SegmentedToVirtual(cmd->colHeader.segment);
colHeader = colHeaderTemp;
colHeader->vtxList = (Vec3s*)Lib_SegmentedToVirtual(colHeaderTemp->vtxList);
colHeader->polyList = (CollisionPoly*)Lib_SegmentedToVirtual(colHeader->polyList);
if (colHeader->surfaceTypeList != NULL) {
colHeader->surfaceTypeList = (SurfaceType*)Lib_SegmentedToVirtual(colHeader->surfaceTypeList);
}
BgCheck_Init(&ctxt->colCtx, ctxt, temp_s0);
if (colHeader->cameraDataList != NULL) {
colHeader->cameraDataList = (void*)Lib_SegmentedToVirtual(colHeader->cameraDataList);
}
if (colHeader->waterBoxes != NULL) {
colHeader->waterBoxes = (WaterBox*)Lib_SegmentedToVirtual(colHeader->waterBoxes);
}
BgCheck_Init(&globalCtx->colCtx, globalCtx, colHeader);
}
// Scene Command 0x04: Room List
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->numRooms = entry->roomList.num;
ctxt->roomList = (RomFile*)Lib_SegmentedToVirtual(entry->roomList.segment);
// Scene Header Command 0x04: Room List
void Scene_HeaderCmdRoomList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->numRooms = cmd->roomList.num;
globalCtx->roomList = (RomFile*)Lib_SegmentedToVirtual(cmd->roomList.segment);
}
// Scene Command 0x06: Entrance List
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->setupEntranceList = (EntranceEntry*)Lib_SegmentedToVirtual(entry->entranceList.segment);
// Scene Header Command 0x06: Entrance List
void Scene_HeaderCmdEntranceList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupEntranceList = (EntranceEntry*)Lib_SegmentedToVirtual(cmd->entranceList.segment);
}
// Scene Command 0x07: Special Files
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneCmd* entry) {
if (entry->specialFiles.keepObjectId != 0) {
ctxt->sceneContext.keepObjectId = Scene_LoadObject(&ctxt->sceneContext,
entry->specialFiles.keepObjectId);
// Scene Header Command 0x07: Special Files
void Scene_HeaderCmdSpecialFiles(GlobalContext* globalCtx, SceneCmd* cmd) {
static RomFile tatlMessageFiles[2] = {
{ (u32)_elf_message_fieldSegmentRomStart, (u32)_elf_message_fieldSegmentRomEnd },
{ (u32)_elf_message_ydanSegmentRomStart, (u32)_elf_message_ydanSegmentRomEnd },
};
if (cmd->specialFiles.subKeepIndex != 0) {
globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, cmd->specialFiles.subKeepIndex);
// TODO: Segment number enum?
gSegments[5] =
PHYSICAL_TO_VIRTUAL(ctxt->sceneContext.objects[ctxt->sceneContext.keepObjectId].segment);
gSegments[5] = PHYSICAL_TO_VIRTUAL(globalCtx->objectCtx.status[globalCtx->objectCtx.subKeepIndex].segment);
}
if (entry->specialFiles.cUpElfMsgNum != 0) {
ctxt->unk18868 = Play_LoadScene(ctxt, &D_801C2650[entry->specialFiles.cUpElfMsgNum - 1]);
if (cmd->specialFiles.cUpElfMsgNum != 0) {
globalCtx->unk18868 = Play_LoadScene(globalCtx, &tatlMessageFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
}
}
// Scene Command 0x08: Room Behavior
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->roomContext.currRoom.unk3 = entry->roomBehavior.gpFlag1;
ctxt->roomContext.currRoom.unk2 = entry->roomBehavior.gpFlag2 & 0xFF;
ctxt->roomContext.currRoom.unk5 = (entry->roomBehavior.gpFlag2 >> 8) & 1;
ctxt->msgCtx.unk12044 = (entry->roomBehavior.gpFlag2 >> 0xa) & 1;
ctxt->roomContext.currRoom.enablePosLights = (entry->roomBehavior.gpFlag2 >> 0xb) & 1;
ctxt->kankyoContext.unkE2 = (entry->roomBehavior.gpFlag2 >> 0xc) & 1;
// Scene Header Command 0x08: Room Behavior
void Scene_HeaderCmdRoomBehavior(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.unk3 = cmd->roomBehavior.gpFlag1;
globalCtx->roomContext.currRoom.unk2 = cmd->roomBehavior.gpFlag2 & 0xFF;
globalCtx->roomContext.currRoom.unk5 = (cmd->roomBehavior.gpFlag2 >> 8) & 1;
globalCtx->msgCtx.unk12044 = (cmd->roomBehavior.gpFlag2 >> 0xa) & 1;
globalCtx->roomContext.currRoom.enablePosLights = (cmd->roomBehavior.gpFlag2 >> 0xb) & 1;
globalCtx->kankyoContext.unkE2 = (cmd->roomBehavior.gpFlag2 >> 0xc) & 1;
}
// Scene Command 0x0A: Mesh Header
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->roomContext.currRoom.mesh = (RoomMesh*)Lib_SegmentedToVirtual(entry->mesh.segment);
// Scene Header Command 0x0A: Mesh Header
void Scene_HeaderCmdMesh(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.mesh = (RoomMesh*)Lib_SegmentedToVirtual(cmd->mesh.segment);
}
// Scene Command 0x0B: Object List
void Scene_HeaderCommand0B(GlobalContext *ctxt, SceneCmd *entry) {
// Scene Header Command 0x0B: Object List
void Scene_HeaderCmdObjectList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i, j, k;
ObjectStatus* firstObject;
ObjectStatus* status;
@ -262,21 +261,23 @@ void Scene_HeaderCommand0B(GlobalContext *ctxt, SceneCmd *entry) {
s16* objectEntry;
void* nextPtr;
objectEntry = (s16*)Lib_SegmentedToVirtual(entry->objectList.segment);
objectEntry = (s16*)Lib_SegmentedToVirtual(cmd->objectList.segment);
k = 0;
i = ctxt->sceneContext.spawnedObjectCount;
status = &ctxt->sceneContext.objects[i];
firstObject = ctxt->sceneContext.objects;
i = globalCtx->objectCtx.spawnedObjectCount;
status = &globalCtx->objectCtx.status[i];
firstObject = globalCtx->objectCtx.status;
while (i < ctxt->sceneContext.objectCount) {
while (i < globalCtx->objectCtx.num) {
if (status->id != *objectEntry) {
status2 = &ctxt->sceneContext.objects[i];
for (j = i; j < ctxt->sceneContext.objectCount; j++) {
status2 = &globalCtx->objectCtx.status[i];
for (j = i; j < globalCtx->objectCtx.num; j++) {
status2->id = 0;
status2++;
}
ctxt->sceneContext.objectCount = i;
func_800BA6FC(ctxt, &ctxt->actorCtx);
globalCtx->objectCtx.num = i;
func_800BA6FC(globalCtx, &globalCtx->actorCtx);
continue;
}
@ -287,116 +288,128 @@ void Scene_HeaderCommand0B(GlobalContext *ctxt, SceneCmd *entry) {
status++;
}
while (k < entry->objectList.num) {
nextPtr = func_8012F73C(&ctxt->sceneContext, i, *objectEntry);
while (k < cmd->objectList.num) {
nextPtr = func_8012F73C(&globalCtx->objectCtx, i, *objectEntry);
// TODO: This 0x22 is OBJECT_EXCHANGE_BANK_MAX - 1 in OOT
if (i < 0x22) {
if (i < OBJECT_EXCHANGE_BANK_MAX - 1) {
firstObject[i + 1].segment = nextPtr;
}
i++;
k++;
objectEntry++;
}
ctxt->sceneContext.objectCount = i;
globalCtx->objectCtx.num = i;
}
// Scene Command 0x0C: Light List
void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry) {
// Scene Header Command 0x0C: Light List
void Scene_HeaderCmdLightList(GlobalContext* globalCtx, SceneCmd* cmd) {
s32 i;
LightInfo* lightInfo;
LightInfo* lightInfo = (LightInfo*)Lib_SegmentedToVirtual(cmd->lightList.segment);
lightInfo = (LightInfo*)Lib_SegmentedToVirtual(entry->lightList.segment);
for (i = 0; i < entry->lightList.num; i++)
{
LightContext_InsertLight(ctxt, &ctxt->lightCtx, lightInfo);
for (i = 0; i < cmd->lightList.num; i++) {
LightContext_InsertLight(globalCtx, &globalCtx->lightCtx, lightInfo);
lightInfo++;
}
}
// Scene Command 0x0D: Path List
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->setupPathList = (void*)Lib_SegmentedToVirtual(entry->pathList.segment);
// Scene Header Command 0x0D: Path List
void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupPathList = (void*)Lib_SegmentedToVirtual(cmd->pathList.segment);
}
// Scene Command 0x0E: Transition Actor List
void Scene_HeaderCommand0E(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->transitionActorCount = entry->transiActorList.num;
ctxt->transitionActorList = (TransitionActorEntry*)Lib_SegmentedToVirtual((void*)entry->transiActorList.segment);
func_80105818(ctxt, ctxt->transitionActorCount, ctxt->transitionActorList);
// Scene Header Command 0x0E: Transition Actor List
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->transitionCtx.nbTransitionActors = cmd->transiActorList.num;
globalCtx->transitionCtx.transitionActorList =
(TransitionActorEntry*)Lib_SegmentedToVirtual((void*)cmd->transiActorList.segment);
func_80105818(globalCtx, globalCtx->transitionCtx.nbTransitionActors, globalCtx->transitionCtx.transitionActorList);
}
void func_8012FEBC(GlobalContext* ctxt, u8* nbTransitionActors) {
*nbTransitionActors = 0;
// Init function for the transition system.
void Transition_Init(GameState* state, TransitionContext* transitionCtx) {
transitionCtx->nbTransitionActors = 0;
}
// Scene Command 0x0F: Light Setting List
void Scene_HeaderCommand0F(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->kankyoContext.environmentSettingsCount = entry->lightSettingList.num;
ctxt->kankyoContext.environmentSettingsList = (void*)Lib_SegmentedToVirtual(entry->lightSettingList.segment);
// Scene Header Command 0x0F: Environment Light Settings List
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->kankyoContext.environmentSettingsCount = cmd->lightSettingList.num;
globalCtx->kankyoContext.environmentSettingsList = (void*)Lib_SegmentedToVirtual(cmd->lightSettingList.segment);
}
s32 func_8012FF10(GlobalContext* ctxt, s32 fileIndex) {
u32 vromStart = D_801C2660[fileIndex].vromStart;
u32 fileSize = D_801C2660[fileIndex].vromEnd - vromStart;
/**
* Loads different texture files for each region of the world.
* These later are stored in segment 0x06, and used in maps.
*/
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
static RomFile sceneTextureFiles[9] = {
{ 0, 0 }, // Default
{ (u32)_scene_texture_01SegmentRomStart, (u32)_scene_texture_01SegmentRomEnd },
{ (u32)_scene_texture_02SegmentRomStart, (u32)_scene_texture_02SegmentRomEnd },
{ (u32)_scene_texture_03SegmentRomStart, (u32)_scene_texture_03SegmentRomEnd },
{ (u32)_scene_texture_04SegmentRomStart, (u32)_scene_texture_04SegmentRomEnd },
{ (u32)_scene_texture_05SegmentRomStart, (u32)_scene_texture_05SegmentRomEnd },
{ (u32)_scene_texture_06SegmentRomStart, (u32)_scene_texture_06SegmentRomEnd },
{ (u32)_scene_texture_07SegmentRomStart, (u32)_scene_texture_07SegmentRomEnd },
{ (u32)_scene_texture_08SegmentRomStart, (u32)_scene_texture_08SegmentRomEnd },
};
u32 vromStart = sceneTextureFiles[fileIndex].vromStart;
u32 size = sceneTextureFiles[fileIndex].vromEnd - vromStart;
if (fileSize) {
ctxt->roomContext.unk74 = THA_AllocEndAlign16(&ctxt->state.heap, fileSize);
return DmaMgr_SendRequest0(ctxt->roomContext.unk74, vromStart, fileSize);
if (size != 0) {
globalCtx->roomContext.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
return DmaMgr_SendRequest0(globalCtx->roomContext.unk74, vromStart, size);
}
// UB: Undefined behaviour to not have a return statement here, but it breaks matching to add one.
}
// Scene Command 0x11: Skybox Settings
void Scene_HeaderCommand11(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->unk18874 = entry->skyboxSettings.skyboxId & 3;
ctxt->kankyoContext.unk17 = ctxt->kankyoContext.unk18 = entry->skyboxSettings.unk5;
ctxt->kankyoContext.unk1E = entry->skyboxSettings.unk6;
func_8012FF10(ctxt, entry->skyboxSettings.data1);
// Scene Header Command 0x11: Skybox Settings
void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk18874 = cmd->skyboxSettings.skyboxId & 3;
globalCtx->kankyoContext.unk17 = globalCtx->kankyoContext.unk18 = cmd->skyboxSettings.unk5;
globalCtx->kankyoContext.unk1E = cmd->skyboxSettings.unk6;
Scene_LoadAreaTextures(globalCtx, cmd->skyboxSettings.data1);
}
// Scene Command 0x12: Skybox Disables
void Scene_HeaderCommand12(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->kankyoContext.unk15 = entry->skyboxDisables.unk4;
ctxt->kankyoContext.unk16 = entry->skyboxDisables.unk5;
// Scene Header Command 0x12: Skybox Disables
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->kankyoContext.unk15 = cmd->skyboxDisables.unk4;
globalCtx->kankyoContext.unk16 = cmd->skyboxDisables.unk5;
}
// Scene Command 0x10: Time Settings
void Scene_HeaderCommand10(GlobalContext *ctxt, SceneCmd *entry) {
// Scene Header Command 0x10: Time Settings
void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
u32 dayTime;
if (entry->timeSettings.hour != 0xFF && entry->timeSettings.min != 0xFF) {
if (cmd->timeSettings.hour != 0xFF && cmd->timeSettings.min != 0xFF) {
gSaveContext.extra.environmentTime = gSaveContext.perm.time =
(u16)(((entry->timeSettings.hour + (entry->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
(u16)(((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f);
}
if (entry->timeSettings.unk6 != 0xFF) {
ctxt->kankyoContext.unk2 = entry->timeSettings.unk6;
if (cmd->timeSettings.unk6 != 0xFF) {
globalCtx->kankyoContext.unk2 = cmd->timeSettings.unk6;
} else {
ctxt->kankyoContext.unk2 = 0;
globalCtx->kankyoContext.unk2 = 0;
}
if (gSaveContext.perm.inv.items[0] == 0xFF) {
if (ctxt->kankyoContext.unk2 != 0) {
ctxt->kankyoContext.unk2 = 5;
}
if ((gSaveContext.perm.inv.items[0] == 0xFF) && (globalCtx->kankyoContext.unk2 != 0)) {
globalCtx->kankyoContext.unk2 = 5;
}
if (gSaveContext.extra.unk2b8 == 0) {
// TODO: Needs REG macro
gGameInfo->data[0x0F] = ctxt->kankyoContext.unk2;
REG(15) = globalCtx->kankyoContext.unk2;
}
dayTime = gSaveContext.perm.time;
ctxt->kankyoContext.unk4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
globalCtx->kankyoContext.unk4 = -(Math_SinS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.perm.time;
ctxt->kankyoContext.unk8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
globalCtx->kankyoContext.unk8 = (Math_CosS(dayTime - 0x8000) * 120.0f) * 25.0f;
dayTime = gSaveContext.perm.time;
ctxt->kankyoContext.unkC = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
globalCtx->kankyoContext.unkC = (Math_CosS(dayTime - 0x8000) * 20.0f) * 25.0f;
if (ctxt->kankyoContext.unk2 == 0 && gSaveContext.perm.cutscene < 0xFFF0) {
if (globalCtx->kankyoContext.unk2 == 0 && gSaveContext.perm.cutscene < 0xFFF0) {
gSaveContext.extra.environmentTime = gSaveContext.perm.time;
if (gSaveContext.extra.environmentTime >= 0x2AAA && gSaveContext.extra.environmentTime < 0x4555) {
@ -411,135 +424,172 @@ void Scene_HeaderCommand10(GlobalContext *ctxt, SceneCmd *entry) {
}
}
// Scene Command 0x05: Wind Settings
void Scene_HeaderCommand05(GlobalContext* ctxt, SceneCmd* entry) {
s8 temp1 = entry->windSettings.west;
s8 temp2 = entry->windSettings.vertical;
s8 temp3 = entry->windSettings.south;
ctxt->kankyoContext.windWest = temp1;
ctxt->kankyoContext.windVertical = temp2;
ctxt->kankyoContext.windSouth = temp3;
ctxt->kankyoContext.windClothIntensity = entry->windSettings.clothIntensity;
// Scene Header Command 0x05: Wind Settings
void Scene_HeaderCmdWindSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
s8 temp1 = cmd->windSettings.west;
s8 temp2 = cmd->windSettings.vertical;
s8 temp3 = cmd->windSettings.south;
globalCtx->kankyoContext.windWest = temp1;
globalCtx->kankyoContext.windVertical = temp2;
globalCtx->kankyoContext.windSouth = temp3;
globalCtx->kankyoContext.windClothIntensity = cmd->windSettings.clothIntensity;
}
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->setupExitList = (void*)Lib_SegmentedToVirtual(entry->exitList.segment);
// Scene Header Command 0x13: Exit List
void Scene_HeaderCmdExitList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->setupExitList = (u16*)Lib_SegmentedToVirtual(cmd->exitList.segment);
}
// Scene Command 0x09: Undefined
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneCmd* entry) {
// Scene Header Command 0x09: Undefined
void Scene_HeaderCmd09(GlobalContext* globalCtx, SceneCmd* cmd) {
}
// Scene Command 0x15: Sound Settings
void Scene_HeaderCommand15(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->unk814 = entry->soundSettings.musicSeq;
ctxt->unk815 = entry->soundSettings.nighttimeSFX;
// Scene Header Command 0x15: Sound Settings=
void Scene_HeaderCmdSoundSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->unk814 = cmd->soundSettings.musicSeq;
globalCtx->unk815 = cmd->soundSettings.nighttimeSFX;
if (gSaveContext.extra.unk276 == 0xFF || func_801A8A50(0) == 0x57) {
audio_setBGM(entry->soundSettings.bgmId);
audio_setBGM(cmd->soundSettings.bgmId);
}
}
// Scene Command 0x16: Echo Setting
void Scene_HeaderCommand16(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->roomContext.currRoom.echo = entry->echoSettings.echo;
// Scene Header Command 0x16: Echo Setting
void Scene_HeaderCmdEchoSetting(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->roomContext.currRoom.echo = cmd->echoSettings.echo;
}
// Scene Command 0x18: Alternate Headers
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneCmd* entry) {
// Scene Header Command 0x18: Alternate Header List=
void Scene_HeaderCmdAltHeaderList(GlobalContext* globalCtx, SceneCmd* cmd) {
SceneCmd** altHeaderList;
SceneCmd* altHeader;
if (gSaveContext.extra.sceneSetupIndex) {
altHeaderList = (SceneCmd**)Lib_SegmentedToVirtual(entry->altHeaders.segment);
altHeaderList = (SceneCmd**)Lib_SegmentedToVirtual(cmd->altHeaders.segment);
altHeader = altHeaderList[gSaveContext.extra.sceneSetupIndex - 1];
if (altHeader != NULL) {
Scene_ProcessHeader(ctxt, (SceneCmd*)Lib_SegmentedToVirtual(altHeader));
(entry + 1)->base.code = 0x14;
Scene_ProcessHeader(globalCtx, (SceneCmd*)Lib_SegmentedToVirtual(altHeader));
(cmd + 1)->base.code = 0x14;
}
}
}
// Scene Command 0x17: Cutscene Data
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->csCtx.cutsceneCount = (u8)entry->base.data1;
ctxt->cutsceneList = (CutsceneEntry*)Lib_SegmentedToVirtual((void*)entry->base.data2);
// Scene Header Command 0x17: Cutscene List
void Scene_HeaderCmdCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->csCtx.cutsceneCount = (u8)cmd->base.data1;
globalCtx->cutsceneList = (CutsceneEntry*)Lib_SegmentedToVirtual((void*)cmd->base.data2);
}
// Scene Command 0x1B: Cutscene Actor List
void Scene_HeaderCommand1B(GlobalContext* ctxt, SceneCmd* entry) {
ActorCutscene_Init(ctxt, (ActorCutscene*)Lib_SegmentedToVirtual(entry->cutsceneActorList.segment),
entry->cutsceneActorList.num);
// Scene Header Command 0x1B: Actor Cutscene List
void Scene_HeaderCmdActorCutsceneList(GlobalContext* globalCtx, SceneCmd* cmd) {
ActorCutscene_Init(globalCtx, (ActorCutscene*)Lib_SegmentedToVirtual(cmd->cutsceneActorList.segment),
cmd->cutsceneActorList.num);
}
// Scene Command 0x1C: Mini Maps
void Scene_HeaderCommand1C(GlobalContext* ctxt, SceneCmd* entry) {
func_80104CF4(ctxt);
func_8010549C(ctxt, entry->minimapSettings.segment);
// Scene Header Command 0x1C: Mini Maps
void Scene_HeaderCmdMiniMap(GlobalContext* globalCtx, SceneCmd* cmd) {
func_80104CF4(globalCtx);
func_8010549C(globalCtx, cmd->minimapSettings.segment);
}
// Scene Command 0x1D: Undefined
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneCmd* entry) {
// Scene Header Command 0x1D: Undefined
void Scene_HeaderCmd1D(GlobalContext* globalCtx, SceneCmd* cmd) {
}
// Scene Command 0x1E: Minimap Chests
void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneCmd* entry) {
func_8010565C(ctxt, entry->minimapChests.num, entry->minimapChests.segment);
// Scene Header Command 0x1E: Minimap Compass Icon Info
void Scene_HeaderCmdMiniMapCompassInfo(GlobalContext* globalCtx, SceneCmd* cmd) {
func_8010565C(globalCtx, cmd->minimapChests.num, cmd->minimapChests.segment);
}
// Scene Command 0x19: Misc. Settings (Camera & World Map Area)
void Scene_HeaderCommand19(GlobalContext *ctxt, SceneCmd *entry) {
s16 j;
s16 i;
// Scene Header Command 0x1A: Sets Area Visited Flag
void Scene_HeaderCmdSetAreaVisitedFlag(GlobalContext* globalCtx, SceneCmd* cmd) {
s16 j = 0;
s16 i = 0;
j = 0;
i = 0;
while (1) {
while (true) {
if (scenesPerMapArea[i].scenes[j] == 0xFFFF) {
i++;
j=0;
j = 0;
// 0x0B is sizeof(scenesPerMapArea) / sizeof(SceneIdList) ... but does not match calculated
if (i == 0x0B) {
if (i == (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
break;
}
}
if (ctxt->sceneNum == scenesPerMapArea[i].scenes[j]) {
if (globalCtx->sceneNum == scenesPerMapArea[i].scenes[j]) {
break;
}
j++;
}
// 0x0B is sizeof(scenesPerMapArea) / sizeof(SceneIdList) ... but does not match calculated
if (i < 0x0B) {
// This bitwise OR could be a macro, but all sane looking versions break matching.
if (i < (s32)(sizeof(scenesPerMapArea) / sizeof(SceneIdList))) {
gSaveContext.perm.mapsVisited = (gBitFlags[i] | gSaveContext.perm.mapsVisited) | gSaveContext.perm.mapsVisited;
}
}
// Scene Command 0x1A: Texture Animations
void Scene_HeaderCommand1A(GlobalContext* ctxt, SceneCmd* entry) {
ctxt->sceneTextureAnimations = (AnimatedTexture*)Lib_SegmentedToVirtual(entry->textureAnimations.segment);
// Scene Header Command 0x1A: Material Animations
void Scene_HeaderCmdAnimatedMaterials(GlobalContext* globalCtx, SceneCmd* cmd) {
globalCtx->sceneMaterialAnims = (AnimatedMaterial*)Lib_SegmentedToVirtual(cmd->textureAnimations.segment);
}
void func_801306A4(GlobalContext *ctxt) {
ctxt->unk1887F = func_801323A0(ctxt->nextEntranceIndex) & 0x7F;
/**
* Sets the exit fade from the next entrance index.
*/
void Scene_SetExitFade(GlobalContext* globalCtx) {
globalCtx->unk1887F = Entrance_GetTransitionFlags(globalCtx->nextEntranceIndex) & 0x7F;
}
s32 Scene_ProcessHeader(GlobalContext* ctxt, SceneCmd* header) {
u32 cmdCode;
/**
* Executes all of the commands in a scene or room header.
*/
s32 Scene_ProcessHeader(GlobalContext* globalCtx, SceneCmd* header) {
static void (*sceneCmdHandlers[])(GlobalContext*, 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_HeaderCmdSetAreaVisitedFlag,
Scene_HeaderCmdAnimatedMaterials,
Scene_HeaderCmdActorCutsceneList,
Scene_HeaderCmdMiniMap,
Scene_HeaderCmd1D,
Scene_HeaderCmdMiniMapCompassInfo,
};
u32 cmdId;
while (1) {
cmdCode = header->base.code;
while (true) {
cmdId = header->base.code;
if (cmdCode == 0x14) {
if (cmdId == SCENE_CMD_ID_END) {
break;
}
if (cmdCode < 0x1F) {
sceneHeaderFuncTable[cmdCode](ctxt, header);
if (cmdId < SCENE_CMD_MAX) {
sceneCmdHandlers[cmdId](globalCtx, header);
}
header++;
@ -548,10 +598,16 @@ s32 Scene_ProcessHeader(GlobalContext* ctxt, SceneCmd* header) {
return 0;
}
u32 Scene_CreateEntrance(u32 sceneIndex, u32 spawnIndex, u32 offset) {
return (((sceneIndex << 9) | (spawnIndex << 4)) | offset) & 0xFFFF;
/**
* Creates an entrance index from the scene index, spawn index, and scene setup.
*/
u16 Entrance_CreateIndex(s32 sceneIndex, s32 spawnIndex, s32 sceneSetup) {
return (((sceneIndex << 9) | (spawnIndex << 4)) | sceneSetup) & 0xFFFF;
}
void func_80130784(u32 spawnIndex) {
Scene_CreateEntrance(gSaveContext.perm.entranceIndex >> 9, spawnIndex, 0);
/**
* Creates an entrance index from the current entrance index with the given spawn index.
*/
u16 Entrance_CreateIndexFromSpawn(s32 spawnIndex) {
return Entrance_CreateIndex(gSaveContext.perm.entranceIndex >> 9, spawnIndex, 0);
}

File diff suppressed because it is too large Load Diff

2818
src/code/z_scene_table.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -49,9 +49,9 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
Collider_UpdateCylinder(thisx, &THIS->collision);
THIS->animatedTextures = (AnimatedTexture*)Lib_SegmentedToVirtual(object_ikana_obj_001228);
THIS->animatedTextures = (AnimatedMaterial*)Lib_SegmentedToVirtual(object_ikana_obj_001228);
if (Actor_GetSwitchFlag(globalCtx, THIS->base.params & 0x7F) != 0) {
if (Flags_GetSwitch(globalCtx, THIS->base.params & 0x7F) != 0) {
BgIkanaRay_SetActivated(THIS);
} else {
BgIkanaRay_SetDeactivated(THIS);
@ -70,7 +70,7 @@ void BgIkanaRay_SetDeactivated(BgIkanaRay* this) {
}
void BgIkanaRay_UpdateCheckForActivation(BgIkanaRay* this, GlobalContext* globalCtx) {
if (Actor_GetSwitchFlag(globalCtx, this->base.params & 0x7F) != 0) {
if (Flags_GetSwitch(globalCtx, this->base.params & 0x7F) != 0) {
BgIkanaRay_SetActivated(this);
}
}
@ -90,6 +90,6 @@ void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void BgIkanaRay_Draw(Actor* thisx, GlobalContext* globalCtx) {
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, THIS->animatedTextures);
AnimatedMat_Draw(globalCtx, THIS->animatedTextures);
func_800BE03C(globalCtx, object_ikana_obj_001100);
}

View File

@ -8,7 +8,7 @@ struct BgIkanaRay;
typedef struct BgIkanaRay {
/* 0x000 */ Actor base;
/* 0x144 */ ColliderCylinder collision;
/* 0x190 */ AnimatedTexture* animatedTextures;
/* 0x190 */ AnimatedMaterial* animatedTextures;
/* 0x194 */ void (*update)(struct BgIkanaRay*, GlobalContext*);
} BgIkanaRay; // size = 0x198

View File

@ -51,10 +51,10 @@ extern CollisionHeader D_06000F28;
extern UNK_PTR D_06000CE8;
s32 BgIkanaShutter_AllSwitchesPressed(BgIkanaShutter* this, GlobalContext* globalCtx) {
return Actor_GetSwitchFlag(globalCtx, this->dyna.actor.params & 0x7F) &&
Actor_GetSwitchFlag(globalCtx, (this->dyna.actor.params & 0x7F) + 1) &&
Actor_GetSwitchFlag(globalCtx, (this->dyna.actor.params & 0x7F) + 2) &&
Actor_GetSwitchFlag(globalCtx, (this->dyna.actor.params & 0x7F) + 3);
return Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x7F) &&
Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x7F) + 1) &&
Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x7F) + 2) &&
Flags_GetSwitch(globalCtx, (this->dyna.actor.params & 0x7F) + 3);
}
void BgIkanaShutter_Init(Actor* thisx, GlobalContext* globalCtx) {

View File

@ -35,11 +35,11 @@ static InitChainEntry sInitChain[] = {
};
extern Gfx D_06000100[];
extern AnimatedTexture D_060001F8;
extern AnimatedMaterial D_060001F8;
extern Gfx D_06000300[];
extern AnimatedTexture D_060003F8;
extern AnimatedMaterial D_060003F8;
extern Gfx D_06000500[];
extern AnimatedTexture D_060005F8;
extern AnimatedMaterial D_060005F8;
void BgKeikokuSpr_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
@ -56,12 +56,12 @@ void BgKeikokuSpr_Draw(Actor* thisx, GlobalContext* globalCtx) {
OPEN_DISPS(globalCtx->state.gfxCtx);
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, Lib_SegmentedToVirtual(&D_060001F8));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060001F8));
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_XLU_DISP++, D_06000100);
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, Lib_SegmentedToVirtual(&D_060003F8));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060003F8));
gSPDisplayList(POLY_XLU_DISP++, D_06000300);
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, Lib_SegmentedToVirtual(&D_060005F8));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_060005F8));
gSPDisplayList(POLY_XLU_DISP++, D_06000500);
CLOSE_DISPS(globalCtx->state.gfxCtx);

View File

@ -126,7 +126,7 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_UpdateSpheres(i, &this->collider);
}
if (Actor_GetSwitchFlag(globalCtx, this->dyna.actor.params & 0x7F)) {
if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x7F)) {
BgKin2Fence_SetupDoNothing(this);
return;
}

View File

@ -21,7 +21,7 @@ const ActorInit Dm_Statue_InitVars = {
(ActorFunc)DmStatue_Draw
};
extern AnimatedTexture D_06001788;
extern AnimatedMaterial D_06001788;
extern Gfx D_06000520[];
void DmStatue_Init(Actor* thisx, GlobalContext* globalCtx) {
@ -37,6 +37,6 @@ void DmStatue_Update(Actor* thisx, GlobalContext* globalCtx) {
}
void DmStatue_Draw(Actor* thisx, GlobalContext* globalCtx) {
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, Lib_SegmentedToVirtual(&D_06001788));
AnimatedMat_Draw(globalCtx, Lib_SegmentedToVirtual(&D_06001788));
func_800BE03C(globalCtx, D_06000520);
}

View File

@ -166,7 +166,7 @@ s32 DoorSpiral_GetObjectType(GlobalContext* globalCtx) {
type = sceneInfo->objectType;
} else {
// Set the type based on if link is in a dungeon scene, or the overworld
type = (Scene_FindSceneObjectIndex(&globalCtx->sceneContext, GAMEPLAY_DANGEON_KEEP) >= 0) ? SPIRAL_OBJECT_DUNGEON : SPIRAL_OBJECT_OVERWORLD;
type = (Object_GetIndex(&globalCtx->objectCtx, GAMEPLAY_DANGEON_KEEP) >= 0) ? SPIRAL_OBJECT_DUNGEON : SPIRAL_OBJECT_OVERWORLD;
}
return type;
@ -185,7 +185,7 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
s8 objBankId;
if (this->actor.room != globalCtx->transitionActorList[transition].sides[0].room) {
if (this->actor.room != globalCtx->transitionCtx.transitionActorList[transition].sides[0].room) {
Actor_MarkForDeath(&this->actor);
return;
}
@ -194,7 +194,7 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk145 = GET_UNK145_PARAM(thisx); // set but never used
this->orientation = GET_ORIENTATION_PARAM(thisx);
this->objectType = DoorSpiral_GetObjectType(globalCtx);
objBankId = Scene_FindSceneObjectIndex(&globalCtx->sceneContext, sSpiralObjectInfo[this->objectType].objectBankId);
objBankId = Object_GetIndex(&globalCtx->objectCtx, sSpiralObjectInfo[this->objectType].objectBankId);
this->bankIndex = objBankId;
if (objBankId < 0) {
@ -209,14 +209,14 @@ void DoorSpiral_Init(Actor* thisx, GlobalContext* globalCtx) {
void DoorSpiral_Destroy(Actor* thisx, GlobalContext* globalCtx) {
s32 transition = GET_TRANSITION_ID_PARAM(thisx);
globalCtx->transitionActorList[transition].id *= -1;
globalCtx->transitionCtx.transitionActorList[transition].id *= -1;
}
/**
* Waits for the required object to be loaded.
*/
void DoorSpiral_WaitForObject(DoorSpiral* this, GlobalContext* globalCtx) {
if (Scene_IsObjectLoaded(&globalCtx->sceneContext, this->bankIndex)) {
if (Object_IsLoaded(&globalCtx->objectCtx, this->bankIndex)) {
this->actor.objBankIndex = this->bankIndex;
DoorSpiral_SetSpiralType(this, globalCtx);
}
@ -287,7 +287,7 @@ void DoorSpiral_Wait(DoorSpiral* this, GlobalContext* globalCtx) {
player->doorDirection = this->orientation;
player->doorActor = &this->actor;
transition = GET_TRANSITION_ID_PARAM(this);
player->unk37F = ((u16)globalCtx->transitionActorList[transition].params) >> 10;
player->unk37F = ((u16)globalCtx->transitionCtx.transitionActorList[transition].params) >> 10;
func_80122F28(player, globalCtx, &this->actor);
}

View File

@ -57,7 +57,7 @@ static InitChainEntry sInitChain[] = {
};
extern Gfx D_06000300[];
extern AnimatedTexture D_06000E88;
extern AnimatedMaterial D_06000E88;
void ObjBoyo_Init(Actor* thisx, GlobalContext* globalCtx) {
ObjBoyo* this = THIS;
@ -181,6 +181,6 @@ void ObjBoyo_Update(Actor* thisx, GlobalContext* globalCtx2) {
void ObjBoyo_Draw(Actor* thisx, GlobalContext* globalCtx) {
ObjBoyo* this = THIS;
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, this->unk_190);
AnimatedMat_Draw(globalCtx, this->unk_190);
func_800BDFC0(globalCtx, D_06000300);
}

View File

@ -15,7 +15,7 @@ typedef struct {
typedef struct ObjBoyo {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ AnimatedTexture* unk_190;
/* 0x190 */ AnimatedMaterial* unk_190;
/* 0x194 */ s16 unk_194;
/* 0x196 */ s16 unk_196;
/* 0x198 */ f32 unk_198;

View File

@ -39,7 +39,7 @@ static unkStruct D_80C25CE0[2] = {
void ObjEnding_Init(Actor* thisx, GlobalContext *globalCtx) {
ObjEnding* this = THIS;
AnimatedTexture *texture;
AnimatedMaterial *texture;
Actor_ProcessInitChain(&this->actor, D_80C25CF8);
this->unk144 = &D_80C25CE0[this->actor.params];
@ -60,7 +60,7 @@ void ObjEnding_Draw(Actor *thisx, GlobalContext *globalCtx) {
UNK_TYPE4 tempunk4;
if (this->texture != NULL) {
SceneProc_DrawAllSceneAnimatedTextures(globalCtx, this->texture);
AnimatedMat_Draw(globalCtx, this->texture);
}
tempunk4 = this->unk144->unk0;
if (tempunk4 != 0) {

View File

@ -8,13 +8,13 @@ struct ObjEnding;
typedef struct {
/* 0x0 */ UNK_TYPE4 unk0;
/* 0x4 */ Gfx* dl;
/* 0x8 */ AnimatedTexture *texture;
/* 0x8 */ AnimatedMaterial *texture;
} unkStruct; // size = 0xC
typedef struct ObjEnding {
/* 0x000 */ Actor actor;
/* 0x144 */ unkStruct* unk144;
/* 0x148 */ AnimatedTexture* texture;
/* 0x148 */ AnimatedMaterial* texture;
} ObjEnding; // size = 0x14C
extern const ActorInit Obj_Ending_InitVars;

View File

@ -40,7 +40,7 @@ void ObjFunen_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
temp = -(globalCtx->unk18840 & 0x7FFFFFFF) & 0x7F;
temp = -(globalCtx->gameplayFrames & 0x7FFFFFFF) & 0x7F;
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, temp, 0x20, 0x20, 1, 0, temp, 0x20, 0x20));

View File

@ -1568,4 +1568,4 @@
('', '', 0, 0),
('', '', 0, 0),
('', '', 0, 0),
]
]

View File

@ -684,7 +684,7 @@
0x800B51A4:("Actor_TargetContextInit",),
0x800B5208:("func_800B5208",),
0x800B5814:("func_800B5814",),
0x800B5BB0:("Actor_GetSwitchFlag",),
0x800B5BB0:("Flags_GetSwitch",),
0x800B5BF4:("Actor_SetSwitchFlag",),
0x800B5C34:("Actor_UnsetSwitchFlag",),
0x800B5C78:("Actor_GetChestFlag",),
@ -2424,90 +2424,90 @@
0x8012F1BC:("func_8012F1BC",),
0x8012F22C:("func_8012F22C",),
0x8012F278:("func_8012F278",),
0x8012F2E0:("Scene_LoadObject",),
0x8012F3D0:("Scene_Init",),
0x8012F4FC:("Scene_ReloadUnloadedObjects",),
0x8012F608:("Scene_FindSceneObjectIndex",),
0x8012F668:("Scene_IsObjectLoaded",),
0x8012F698:("Scene_DmaAllObjects",),
0x8012F2E0:("Object_Spawn",),
0x8012F3D0:("Object_InitBank",),
0x8012F4FC:("Object_UpdateBank",),
0x8012F608:("Object_GetIndex",),
0x8012F668:("Object_IsLoaded",),
0x8012F698:("Object_LoadAll",),
0x8012F73C:("func_8012F73C",),
0x8012F79C:("Scene_HeaderCommand00",),
0x8012F90C:("Scene_HeaderCommand01",),
0x8012F954:("Scene_HeaderCommand02",),
0x8012F984:("Scene_HeaderCommand03",),
0x8012FA24:("Scene_HeaderCommand04",),
0x8012FA68:("Scene_HeaderCommand06",),
0x8012FA98:("Scene_HeaderCommand07",),
0x8012FB60:("Scene_HeaderCommand08",),
0x8012FBE8:("Scene_HeaderCommand0A",),
0x8012FC18:("Scene_HeaderCommand0B",),
0x8012FDA4:("Scene_HeaderCommand0C",),
0x8012FE2C:("Scene_HeaderCommand0D",),
0x8012FE5C:("Scene_HeaderCommand0E",),
0x8012FEBC:("func_8012FEBC",),
0x8012FECC:("Scene_HeaderCommand0F",),
0x8012FF10:("func_8012FF10",),
0x8012FF8C:("Scene_HeaderCommand11",),
0x8012FFF0:("Scene_HeaderCommand12",),
0x80130018:("Scene_HeaderCommand10",),
0x8013033C:("Scene_HeaderCommand05",),
0x801303A0:("Scene_HeaderCommand13",),
0x801303D0:("Scene_HeaderCommand09",),
0x801303E0:("Scene_HeaderCommand15",),
0x8013043C:("Scene_HeaderCommand16",),
0x80130454:("Scene_HeaderCommand18",),
0x801304CC:("Scene_HeaderCommand17",),
0x80130500:("Scene_HeaderCommand1B",),
0x80130540:("Scene_HeaderCommand1C",),
0x80130578:("Scene_HeaderCommand1D",),
0x80130588:("Scene_HeaderCommand1E",),
0x801305B0:("Scene_HeaderCommand19",),
0x80130674:("Scene_HeaderCommand1A",),
0x801306A4:("func_801306A4",),
0x8012F79C:("Scene_HeaderCmdSpawnList",),
0x8012F90C:("Scene_HeaderCmdActorList",),
0x8012F954:("Scene_HeaderCmdActorCutsceneCamList",),
0x8012F984:("Scene_HeaderCmdColHeader",),
0x8012FA24:("Scene_HeaderCmdRoomList",),
0x8012FA68:("Scene_HeaderCmdEntranceList",),
0x8012FA98:("Scene_HeaderCmdSpecialFiles",),
0x8012FB60:("Scene_HeaderCmdRoomBehavior",),
0x8012FBE8:("Scene_HeaderCmdMesh",),
0x8012FC18:("Scene_HeaderCmdObjectList",),
0x8012FDA4:("Scene_HeaderCmdLightList",),
0x8012FE2C:("Scene_HeaderCmdPathList",),
0x8012FE5C:("Scene_HeaderCmdTransiActorList",),
0x8012FEBC:("Transition_Init",),
0x8012FECC:("Scene_HeaderCmdEnvLightSettings",),
0x8012FF10:("Scene_LoadAreaTextures",),
0x8012FF8C:("Scene_HeaderCmdSkyboxSettings",),
0x8012FFF0:("Scene_HeaderCmdSkyboxDisables",),
0x80130018:("Scene_HeaderCmdTimeSettings",),
0x8013033C:("Scene_HeaderCmdWindSettings",),
0x801303A0:("Scene_HeaderCmdExitList",),
0x801303D0:("Scene_HeaderCmd09",),
0x801303E0:("Scene_HeaderCmdSoundSettings",),
0x8013043C:("Scene_HeaderCmdEchoSetting",),
0x80130454:("Scene_HeaderCmdAltHeaderList",),
0x801304CC:("Scene_HeaderCmdCutsceneList",),
0x80130500:("Scene_HeaderCmdActorCutsceneList",),
0x80130540:("Scene_HeaderCmdMiniMap",),
0x80130578:("Scene_HeaderCmd1D",),
0x80130588:("Scene_HeaderCmdMiniMapCompassInfo",),
0x801305B0:("Scene_HeaderCmdSetAreaVisitedFlag",),
0x80130674:("Scene_HeaderCmdAnimatedMaterials",),
0x801306A4:("Scene_SetExitFade",),
0x801306E8:("Scene_ProcessHeader",),
0x80130768:("Scene_CreateEntrance",),
0x80130784:("func_80130784",),
0x801307C0:("SceneProc_DrawCurrentSceneAnimatedTextures",),
0x801307F4:("SceneProc_DrawSceneConfig0",),
0x80130834:("SceneProc_SetTile1Layer",),
0x801308A0:("SceneProc_DrawType0Texture",),
0x80130940:("SceneProc_SetTile2Layers",),
0x801309F4:("SceneProc_DrawType1Texture",),
0x80130A94:("SceneProc_DrawFlashingTexture",),
0x80130C5C:("SceneProc_DrawType2Texture",),
0x80130D0C:("SceneProc_Lerp",),
0x80130D3C:("SceneProc_DrawType3Texture",),
0x80130F58:("SceneProc_Interpolate",),
0x8013115C:("SceneProc_InterpolateClamped",),
0x801311B4:("SceneProc_DrawType4Texture",),
0x80131580:("SceneProc_DrawType5Texture",),
0x80131690:("SceneProc_DrawAnimatedTextures",),
0x80131758:("SceneProc_DrawAllSceneAnimatedTextures",),
0x8013178C:("SceneProc_DrawOpaqueSceneAnimatedTextures",),
0x801317C0:("SceneProc_DrawTranslucentSceneAnimatedTextures",),
0x801317F4:("SceneProc_DrawAllSceneAnimatedTexturesWithAlpha",),
0x8013182C:("SceneProc_DrawOpaqueSceneAnimatedTexturesWithAlpha",),
0x80131864:("SceneProc_DrawTranslucentSceneAnimatedTexturesWithAlpha",),
0x8013189C:("SceneProc_DrawAllAnimatedTextures",),
0x801318C8:("SceneProc_DrawOpaqueAnimatedTextures",),
0x801318F4:("SceneProc_DrawTranslucentAnimatedTextures",),
0x80131920:("SceneProc_DrawAllAnimatedTexturesWithAlpha",),
0x8013194C:("SceneProc_DrawOpaqueAnimatedTexturesWithAlpha",),
0x80131978:("SceneProc_DrawTranslucentAnimatedTexturesWithAlpha",),
0x801319A4:("SceneProc_DrawSceneConfig1",),
0x801319CC:("SceneProc_DrawSceneConfig3",),
0x80131CDC:("SceneProc_DrawSceneConfig4",),
0x80131DE4:("SceneProc_DrawSceneConfig2",),
0x80131DF0:("func_80131DF0",),
0x80131E58:("func_80131E58",),
0x80131EC0:("SceneProc_DrawSceneConfig5",),
0x80131F90:("SceneProc_DrawSceneConfig7",),
0x80131FC0:("SceneProc_DrawSceneConfig6",),
0x801322C0:("SceneTable_LookupEntrance",),
0x8013230C:("SceneTable_LookupEntranceScene",),
0x80132338:("SceneTable_LookupEntranceAbsoluteScene",),
0x80132374:("func_80132374",),
0x801323A0:("func_801323A0",),
0x80130768:("Entrance_CreateIndex",),
0x80130784:("Entrance_CreateIndexFromSpawn",),
0x801307C0:("Scene_ExecuteDrawConfig",),
0x801307F4:("Scene_DrawConfigDefault",),
0x80130834:("AnimatedMat_TexScroll",),
0x801308A0:("AnimatedMat_DrawTexScroll",),
0x80130940:("AnimatedMat_TwoLayerTexScroll",),
0x801309F4:("AnimatedMat_DrawTwoTexScroll",),
0x80130A94:("AnimatedMat_SetColor",),
0x80130C5C:("Scene_DrawType2Texture",),
0x80130D0C:("AnimatedMat_Lerp",),
0x80130D3C:("Scene_DrawType3Texture",),
0x80130F58:("Scene_LagrangeInterp",),
0x8013115C:("Scene_LagrangeInterpColor",),
0x801311B4:("AnimatedMat_DrawColorNonLinearInterp",),
0x80131580:("AnimatedMat_DrawTexCycle",),
0x80131690:("AnimatedMat_DrawMain",),
0x80131758:("AnimatedMat_Draw",),
0x8013178C:("AnimatedMat_DrawOpa",),
0x801317C0:("AnimatedMat_DrawXlu",),
0x801317F4:("AnimatedMat_DrawAlpha",),
0x8013182C:("AnimatedMat_DrawAlphaOpa",),
0x80131864:("AnimatedMat_DrawAlphaXlu",),
0x8013189C:("AnimatedMat_DrawStep",),
0x801318C8:("AnimatedMat_DrawStepOpa",),
0x801318F4:("AnimatedMat_DrawStepXlu",),
0x80131920:("AnimatedMat_DrawAlphaStep",),
0x8013194C:("AnimatedMat_DrawAlphaStepOpa",),
0x80131978:("AnimatedMat_DrawAlphaStepXlu",),
0x801319A4:("Scene_DrawConfigMatAnim",),
0x801319CC:("Scene_DrawConfig3",),
0x80131CDC:("Scene_DrawConfig4",),
0x80131DE4:("Scene_DrawConfigDoNothing",),
0x80131DF0:("Scene_SetRenderModeXlu",),
0x80131E58:("Scene_SetCullFlag",),
0x80131EC0:("Scene_DrawConfig5",),
0x80131F90:("Scene_DrawConfigMatAnimManualStep",),
0x80131FC0:("Scene_DrawConfigGreatBayTemple",),
0x801322C0:("Entrance_GetTableEntry",),
0x8013230C:("Entrance_GetSceneNum",),
0x80132338:("Entrance_GetSceneNumAbsolute",),
0x80132374:("Entrance_GetSpawnNum",),
0x801323A0:("Entrance_GetTransitionFlags",),
0x801323D0:("func_801323D0",),
0x80132428:("func_80132428",),
0x80132494:("func_80132494",),

View File

@ -1532,4 +1532,4 @@ build/comp/assets/scenes/KAKUSIANA_room_11.yaz0
build/comp/assets/scenes/KAKUSIANA_room_12.yaz0
build/comp/assets/scenes/KAKUSIANA_room_13.yaz0
build/comp/assets/scenes/KAKUSIANA_room_14.yaz0
build/comp/assets/textures/bump_texture_static.yaz0
build/comp/assets/textures/bump_texture_static.yaz0

View File

@ -1532,4 +1532,4 @@ build/baserom/assets/scenes/KAKUSIANA_room_11
build/baserom/assets/scenes/KAKUSIANA_room_12
build/baserom/assets/scenes/KAKUSIANA_room_13
build/baserom/assets/scenes/KAKUSIANA_room_14
build/baserom/assets/textures/bump_texture_static
build/baserom/assets/textures/bump_texture_static

View File

@ -429,7 +429,7 @@
0x801C0EF0:"code_data_z_rcp",
0x801C1D10:"code_data_z_room",
0x801C1D30:"code_data_0x801C1D30",
0x801C20A0:"code_data_z_scene", # bit of a guess
0x801C2650:"code_data_z_scene",
0x801C2730:"code_data_0x801C2730",
0x801C3B60:"code_data_z_scene_proc",
0x801C3CA0:"code_data_z_scene_table",

View File

@ -1498,13 +1498,13 @@
0x801C23E0:("D_801C23E0","UNK_TYPE1","",0x1),
0x801C23F8:("D_801C23F8","UNK_TYPE1","",0x1),
0x801C2410:("D_801C2410","UNK_TYPE1","",0x1),
0x801C2650:("D_801C2650","ObjectFileTableEntry","[2]",0x10),
0x801C2660:("D_801C2660","ObjectFileTableEntry","[9]",0x48),
0x801C2650:("tatlMessageFiles","RomFile","[2]",0x10),
0x801C2660:("sceneTextureFiles","RomFile","[9]",0x48),
0x801C26A8:("sceneHeaderFuncTable","scene_header_func","[31]",0x7c),
0x801C2730:("D_801C2730","s16","[8]",0x10),
0x801C2740:("objectFileTable","ObjectFileTableEntry","[643]",0x1418),
0x801C3B60:("gSceneProcDefaultDl","Gfx","[11]",0x58),
0x801C3BB8:("gSceneProcSceneDrawFuncs","global_context_func","[8]",0x20),
0x801C2730:("gLinkFormObjectIndexes","s16","[8]",0x10),
0x801C2740:("objectFileTable","RomFile","[643]",0x1418),
0x801C3B60:("sSceneDrawDefaultDl","Gfx","[11]",0x58),
0x801C3BB8:("gSceneProcSceneDrawFuncs","SceneDrawConfigFunc","[8]",0x20),
0x801C3BD8:("gSceneProcDrawFuncs","scene_proc_draw_func","[6]",0x18),
0x801C3BF0:("D_801C3BF0","Gfx","[4]",0x20),
0x801C3C10:("D_801C3C10","Gfx","[4]",0x20),
@ -2071,7 +2071,7 @@
0x801C56A0:("D_801C56A0","UNK_TYPE1","",0x1),
0x801C56CC:("D_801C56CC","UNK_TYPE1","",0x1),
0x801C56F8:("D_801C56F8","UNK_PTR","",0x4),
0x801C5720:("gSceneEntranceTable","SceneEntranceTableEnty","[110]",0x528),
0x801C5720:("sSceneEntranceTable","SceneEntranceTableEnty","[110]",0x528),
0x801C5C50:("D_801C5C50","UNK_PTR","",0x4),
0x801C5C9C:("D_801C5C9C","UNK_TYPE1","",0x1),
0x801C5CB0:("D_801C5CB0","UNK_PTR","",0x4),
@ -4224,9 +4224,9 @@
0x801F59F8:("D_801F59F8","UNK_TYPE1","",0x1),
0x801F5A00:("sQuakeRequest","QuakeRequest","[4]",0x90),
0x801F5A90:("sQuake2Context","Quake2Context","",0xc),
0x801F5AA0:("gSceneProcStep","s32","",0x4),
0x801F5AA4:("gSceneProcFlags","u32","",0x4),
0x801F5AA8:("gSceneProcFlashingAlpha","f32","",0x4),
0x801F5AA0:("sMatAnimStep","s32","",0x4),
0x801F5AA4:("sMatAnimFlags","u32","",0x4),
0x801F5AA8:("sMatAnimAlphaRatio","f32","",0x4),
0x801F5AB0:("D_801F5AB0","UNK_TYPE1","",0x1),
0x801F5AB4:("D_801F5AB4","UNK_TYPE1","",0x1),
0x801F5AC0:("D_801F5AC0","UNK_TYPE1","",0x1),

View File

@ -321,9 +321,9 @@ D_801F59F4 = code_bss_start + 0x00011A54;
D_801F59F8 = code_bss_start + 0x00011A58;
sQuakeRequest = code_bss_start + 0x00011A60;
sQuake2Context = code_bss_start + 0x00011AF0;
gSceneProcStep = code_bss_start + 0x00011B00;
gSceneProcFlags = code_bss_start + 0x00011B04;
gSceneProcFlashingAlpha = code_bss_start + 0x00011B08;
sMatAnimStep = code_bss_start + 0x00011B00;
sMatAnimFlags = code_bss_start + 0x00011B04;
sMatAnimAlphaRatio = code_bss_start + 0x00011B08;
D_801F5AB0 = code_bss_start + 0x00011B10;
D_801F5AB4 = code_bss_start + 0x00011B14;
D_801F5AC0 = code_bss_start + 0x00011B20;