mirror of https://github.com/zeldaret/mm.git
Decompile functions in z_scene
This commit is contained in:
parent
1b335a770b
commit
f8713ceb46
|
|
@ -1931,14 +1931,14 @@ void func_8010439C(void); // func_8010439C
|
|||
void func_801045AC(void); // func_801045AC
|
||||
void func_80104AE8(void); // func_80104AE8
|
||||
void func_80104C80(void); // func_80104C80
|
||||
void func_80104CF4(void); // func_80104CF4
|
||||
void func_80104CF4(GlobalContext* ctxt); // func_80104CF4
|
||||
void func_80104F34(void); // func_80104F34
|
||||
void func_80105294(void); // func_80105294
|
||||
void func_80105318(void); // func_80105318
|
||||
void func_80105328(void); // func_80105328
|
||||
void func_8010534C(void); // func_8010534C
|
||||
void func_8010549C(void); // func_8010549C
|
||||
void func_8010565C(void); // func_8010565C
|
||||
void func_8010549C(GlobalContext* ctxt, u32 segmentAddress); // func_8010549C
|
||||
void func_8010565C(GlobalContext* ctxt, u8 num, u32 segmentAddress); // func_8010565C
|
||||
void func_80105818(GlobalContext* ctxt, unsigned int uParm2, TransitionActorInit* puParm3); // func_80105818
|
||||
void func_80105A40(void); // func_80105A40
|
||||
void func_80105B34(void); // func_80105B34
|
||||
|
|
@ -2400,10 +2400,10 @@ void func_8012F0EC(void); // func_8012F0EC
|
|||
void func_8012F1BC(void); // func_8012F1BC
|
||||
void func_8012F22C(void); // func_8012F22C
|
||||
void func_8012F278(void); // func_8012F278
|
||||
s32 Scene_LoadObject(SceneContext* sceneCtxt, short id); // func_8012F2E0
|
||||
s32 Scene_LoadObject(SceneContext* sceneCtxt, s16 id); // func_8012F2E0
|
||||
void Scene_Init(GlobalContext* ctxt, SceneContext* sceneCtxt); // func_8012F3D0
|
||||
void Scene_ReloadUnloadedObjects(SceneContext* sceneCtxt); // func_8012F4FC
|
||||
s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, short id); // func_8012F608
|
||||
s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, s16 id); // func_8012F608
|
||||
s32 Scene_IsObjectLoaded(SceneContext* iParm1, s32 index); // func_8012F668
|
||||
void Scene_DmaAllObjects(SceneContext* sceneCtxt); // func_8012F698
|
||||
u32 func_8012F73C(SceneContext* sceneCtxt, s32 iParm2, s16 id); // func_8012F73C
|
||||
|
|
@ -2420,9 +2420,9 @@ void Scene_HeaderCommand0B(GlobalContext* ctxt, SceneCmd* entry); // func_8012FC
|
|||
void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry); // func_8012FDA4
|
||||
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneCmd* entry); // func_8012FE2C
|
||||
void Scene_HeaderCommand0E(GlobalContext* ctxt, SceneCmd* entry); // func_8012FE5C
|
||||
void func_8012FEBC(void); // func_8012FEBC
|
||||
void func_8012FEBC(GlobalContext* ctxt, u8* nbTransitionActors); // func_8012FEBC
|
||||
void Scene_HeaderCommand0F(GlobalContext* ctxt, SceneCmd* entry); // func_8012FECC
|
||||
void func_8012FF10(GlobalContext* ctxt, int iParm2); // func_8012FF10
|
||||
s32 func_8012FF10(GlobalContext* ctxt, s32 fileIndex); // func_8012FF10
|
||||
void Scene_HeaderCommand11(GlobalContext* ctxt, SceneCmd* entry); // func_8012FF8C
|
||||
void Scene_HeaderCommand12(GlobalContext* ctxt, SceneCmd* entry); // func_8012FFF0
|
||||
void Scene_HeaderCommand10(GlobalContext* ctxt, SceneCmd* entry); // func_80130018
|
||||
|
|
@ -2983,7 +2983,7 @@ void Play_Update(GlobalContext* ctxt); // func_80168F64
|
|||
void func_801690CC(void); // func_801690CC
|
||||
void func_80169100(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // func_80169100
|
||||
void func_801691F0(void); // func_801691F0
|
||||
void* Play_LoadScene(GlobalContext* ctxt, SceneTableEntry* entry); // func_80169220
|
||||
void* Play_LoadScene(GlobalContext* ctxt, ObjectFileTableEntry* entry); // func_80169220
|
||||
void func_8016927C(GlobalContext* ctxt, short sParm2); // func_8016927C
|
||||
void func_801692C4(GlobalContext* ctxt, UNK_TYPE1 uParm2); // func_801692C4
|
||||
void Play_SceneInit(GlobalContext* ctxt, int sceneIndex, UNK_TYPE1 param_3); // func_801693D4
|
||||
|
|
@ -3902,7 +3902,7 @@ void func_801A3EC0(void); // func_801A3EC0
|
|||
void func_801A3F54(void); // func_801A3F54
|
||||
void func_801A3F6C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // func_801A3F6C
|
||||
void func_801A3FB4(void); // func_801A3FB4
|
||||
void func_801A400C(void); // func_801A400C
|
||||
/*Audio_SetBGM*/ void func_801A400C(u32 bgmID); // func_801A400C
|
||||
void func_801A4058(void); // func_801A4058
|
||||
void func_801A41C8(void); // func_801A41C8
|
||||
void func_801A41F8(void); // func_801A41F8
|
||||
|
|
@ -3974,7 +3974,8 @@ void func_801A7D04(void); // func_801A7D04
|
|||
void func_801A7D84(void); // func_801A7D84
|
||||
void func_801A89A8(void); // func_801A89A8
|
||||
void func_801A89D0(void); // func_801A89D0
|
||||
void func_801A8A50(void); // func_801A8A50
|
||||
// may not be s32 in param or return
|
||||
s32 func_801A8A50(s32 param1); // func_801A8A50
|
||||
void func_801A8ABC(void); // func_801A8ABC
|
||||
void func_801A8BD0(void); // func_801A8BD0
|
||||
void func_801A8D5C(void); // func_801A8D5C
|
||||
|
|
|
|||
|
|
@ -502,24 +502,209 @@ typedef struct {
|
|||
} RoomMeshType2Params; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 command;
|
||||
/* 0x1 */ u8 unk1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 unk4;
|
||||
} SCmdBase; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdBase;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdSpawnList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdCsCameraList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdColHeader;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdRoomList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ s8 unk4;
|
||||
/* 0x05 */ s8 unk5;
|
||||
/* 0x06 */ s8 unk6;
|
||||
/* 0x07 */ u8 unk7;
|
||||
} SCmdWindSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdEntranceList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 cUpElfMsgNum;
|
||||
/* 0x04 */ u32 keepObjectId;
|
||||
} SCmdSpecialFiles;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 gpFlag1;
|
||||
/* 0x04 */ u32 gpFlag2;
|
||||
} SCmdRoomBehavior;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdMesh;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdObjectList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdLightList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdPathList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdTransiActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdLightSettingList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 hour;
|
||||
/* 0x05 */ u8 min;
|
||||
/* 0x06 */ u8 unk6;
|
||||
} SCmdTimeSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 skyboxId;
|
||||
/* 0x05 */ u8 unk5;
|
||||
/* 0x06 */ u8 unk6;
|
||||
} SCmdSkyboxSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 unk4;
|
||||
/* 0x05 */ u8 unk5;
|
||||
} SCmdSkyboxDisables;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdEndMarker;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdExitList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 bgmId;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[4];
|
||||
/* 0x06 */ u8 nighttimeSFX;
|
||||
/* 0x07 */ u8 musicSeq;
|
||||
} SCmdSoundSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[5];
|
||||
/* 0x07 */ u8 echo;
|
||||
} SCmdEchoSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdCutsceneData;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdAltHeaders;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 cameraMovement;
|
||||
/* 0x04 */ u32 area;
|
||||
} SCmdMiscSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdCutsceneActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ UNK_TYPE1 pad1[2];
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdMinimapSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ u32 segment;
|
||||
} SCmdMinimapChests;
|
||||
|
||||
// Extra information in the save context that is not saved
|
||||
typedef struct {
|
||||
/* 0x000 */ UNK_TYPE1 pad0[0x10];
|
||||
/* 0x000 */ UNK_TYPE1 pad0[0xB];
|
||||
/* 0x00C */ s32 sceneSetupIndex;
|
||||
/* 0x010 */ s32 unk10;
|
||||
/* 0x014 */ UNK_TYPE1 pad14[0x2E];
|
||||
/* 0x042 */ s16 unk42;
|
||||
/* 0x044 */ UNK_TYPE1 pad44[0x23C];
|
||||
/* 0x044 */ UNK_TYPE1 pad44[0x232];
|
||||
/* 0x276 */ u8 unk276;
|
||||
/* 0x277 */ UNK_TYPE1 pad277[0x9];
|
||||
/* 0x280 */ u16 unk280;
|
||||
/* 0x282 */ u16 unk282;
|
||||
/* 0x284 */ UNK_TYPE1 pad284[0x40];
|
||||
/* 0x2C4 */ f32 unk2C4;
|
||||
/* 0x2C8 */ CycleSceneFlags cycleSceneFlags[120];
|
||||
/* 0x2C8 */ CycleSceneFlags cycleSceneFlags[0x78];
|
||||
} SaveContextExtra; // size = 0xC28
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -553,8 +738,37 @@ typedef struct {
|
|||
/* 0x00 */ UNK_TYPE1 pad0[0x22];
|
||||
} SaveContext_struct2; // size = 0x22
|
||||
|
||||
|
||||
typedef union {
|
||||
/* 0x0 */ SCmdBase base;
|
||||
SCmdBase base;
|
||||
SCmdSpawnList spawnList;
|
||||
SCmdActorList actorList;
|
||||
SCmdCsCameraList csCameraList;
|
||||
SCmdRoomList roomList;
|
||||
SCmdEntranceList entranceList;
|
||||
SCmdObjectList objectList;
|
||||
SCmdLightList lightList;
|
||||
SCmdPathList pathList;
|
||||
SCmdTransiActorList transiActorList;
|
||||
SCmdLightSettingList lightSettingList;
|
||||
SCmdExitList exitList;
|
||||
SCmdColHeader colHeader;
|
||||
SCmdMesh mesh;
|
||||
SCmdSpecialFiles specialFiles;
|
||||
SCmdCutsceneData cutsceneData;
|
||||
SCmdRoomBehavior roomBehavior;
|
||||
SCmdWindSettings windSettings;
|
||||
SCmdTimeSettings timeSettings;
|
||||
SCmdSkyboxSettings skyboxSettings;
|
||||
SCmdSkyboxDisables skyboxDisables;
|
||||
SCmdEndMarker endMarker;
|
||||
SCmdSoundSettings soundSettings;
|
||||
SCmdEchoSettings echoSettings;
|
||||
SCmdMiscSettings miscSettings;
|
||||
SCmdAltHeaders altHeaders;
|
||||
SCmdCutsceneActorList cutsceneActorList;
|
||||
SCmdMinimapSettings minimapSettings;
|
||||
SCmdMinimapChests minimapChests;
|
||||
} SceneCmd; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -1042,7 +1256,7 @@ typedef struct {
|
|||
typedef struct {
|
||||
/* 0x000 */ void* objectVramStart;
|
||||
/* 0x004 */ void* objectVramEnd;
|
||||
/* 0x008 */ u8 unk8;
|
||||
/* 0x008 */ u8 objectCount;
|
||||
/* 0x009 */ u8 unk9;
|
||||
/* 0x00A */ u8 unkA;
|
||||
/* 0x00B */ u8 keepObjectId;
|
||||
|
|
@ -1193,8 +1407,8 @@ typedef struct {
|
|||
/* 0x12 */ UNK_TYPE1 unk12;
|
||||
/* 0x13 */ UNK_TYPE1 unk13;
|
||||
/* 0x14 */ UNK_TYPE1 unk14;
|
||||
/* 0x15 */ UNK_TYPE1 unk15;
|
||||
/* 0x16 */ UNK_TYPE1 unk16;
|
||||
/* 0x15 */ u8 unk15;
|
||||
/* 0x16 */ u8 unk16;
|
||||
/* 0x17 */ u8 unk17;
|
||||
/* 0x18 */ u8 unk18;
|
||||
/* 0x19 */ UNK_TYPE1 unk19;
|
||||
|
|
@ -1294,12 +1508,9 @@ typedef struct {
|
|||
/* 0xA9 */ UNK_TYPE1 unkA9;
|
||||
/* 0xAA */ UNK_TYPE1 unkAA;
|
||||
/* 0xAB */ UNK_TYPE1 unkAB;
|
||||
/* 0xAC */ UNK_TYPE1 unkAC;
|
||||
/* 0xAD */ UNK_TYPE1 unkAD;
|
||||
/* 0xAE */ UNK_TYPE1 unkAE;
|
||||
/* 0xAF */ UNK_TYPE1 unkAF;
|
||||
/* 0xB0 */ UNK_TYPE1 unkB0;
|
||||
/* 0xB1 */ UNK_TYPE1 unkB1;
|
||||
/* 0xAC */ s16 unkAC;
|
||||
/* 0xAE */ s16 unkAE;
|
||||
/* 0xB0 */ s16 unkB0;
|
||||
/* 0xB2 */ UNK_TYPE1 unkB2;
|
||||
/* 0xB3 */ UNK_TYPE1 unkB3;
|
||||
/* 0xB4 */ f32 unkB4;
|
||||
|
|
@ -1404,7 +1615,7 @@ typedef struct {
|
|||
/* 0x01 */ u8 unk1;
|
||||
/* 0x02 */ u8 unk2;
|
||||
/* 0x03 */ u8 unk3;
|
||||
/* 0x04 */ s8 unk4;
|
||||
/* 0x04 */ s8 echo;
|
||||
/* 0x05 */ u8 unk5;
|
||||
/* 0x06 */ u8 enablePosLights;
|
||||
/* 0x07 */ UNK_TYPE1 pad7[0x1];
|
||||
|
|
@ -1424,7 +1635,7 @@ typedef struct {
|
|||
/* 0x38 */ DmaRequest dmaRequest;
|
||||
/* 0x58 */ OSMesgQueue loadQueue;
|
||||
/* 0x70 */ OSMesg loadMsg[1];
|
||||
/* 0x74 */ UNK_TYPE1 pad74[0x4];
|
||||
/* 0x74 */ void* unk74;
|
||||
/* 0x78 */ s8 unk78;
|
||||
/* 0x79 */ s8 unk79;
|
||||
/* 0x7A */ UNK_TYPE2 unk7A[3];
|
||||
|
|
@ -2238,7 +2449,9 @@ struct GlobalContext {
|
|||
/* 0x000B4 */ UNK_TYPE1 padB4[0x4];
|
||||
/* 0x000B8 */ View view;
|
||||
/* 0x00220 */ CameraContext cameraCtx;
|
||||
/* 0x00814 */ UNK_TYPE1 pad814[0x4];
|
||||
/* 0x00814 */ u8 unk814;
|
||||
/* 0x00815 */ u8 unk815;
|
||||
/* 0x00816 */ UNK_TYPE1 pad816[0x2];
|
||||
/* 0x00818 */ LightingContext lightCtx;
|
||||
/* 0x00828 */ u32 unk828;
|
||||
/* 0x0082C */ UNK_TYPE1 pad82C[0x4];
|
||||
|
|
|
|||
|
|
@ -1553,8 +1553,8 @@ extern UNK_TYPE1 D_801C23C8; // D_801C23C8
|
|||
extern UNK_TYPE1 D_801C23E0; // D_801C23E0
|
||||
extern UNK_TYPE1 D_801C23F8; // D_801C23F8
|
||||
extern UNK_TYPE1 D_801C2410; // D_801C2410
|
||||
extern UNK_TYPE1 D_801C2650; // D_801C2650
|
||||
extern UNK_TYPE1 D_801C2660; // D_801C2660
|
||||
extern ObjectFileTableEntry D_801C2650[2]; // D_801C2650
|
||||
extern ObjectFileTableEntry D_801C2660[9]; // D_801C2660
|
||||
extern scene_header_func sceneHeaderFuncTable[31]; // D_801C26A8
|
||||
extern s16 D_801C2730[8]; // D_801C2730
|
||||
extern ObjectFileTableEntry objectFileTable[643]; // D_801C2740
|
||||
|
|
|
|||
|
|
@ -148,5 +148,5 @@ void func_8012EBF8(GlobalContext* ctxt, RoomContext* roomCtxt){
|
|||
func_8010A33C(ctxt, roomCtxt->currRoom.num);
|
||||
func_8010A2DC(ctxt);
|
||||
}
|
||||
func_801A3CD8(ctxt->roomContext.currRoom.unk4);
|
||||
func_801A3CD8(ctxt->roomContext.currRoom.echo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,17 @@ GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_Init.asm")
|
|||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_ReloadUnloadedObjects.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_FindSceneObjectIndex.asm")
|
||||
s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, 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) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
s32 Scene_IsObjectLoaded(SceneContext* iParm1, s32 index) {
|
||||
if (iParm1->objects[index].id > 0) {
|
||||
|
|
@ -25,16 +35,15 @@ GLOBAL_ASM("./asm/non_matchings/z_scene/func_8012F73C.asm")
|
|||
#ifdef NON_MATCHING
|
||||
// Regalloc differences only
|
||||
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ActorEntry* linkEntry;
|
||||
s32 unused;
|
||||
s32 loadReturn;
|
||||
void* objectVramAddr;
|
||||
s16 temp16;
|
||||
|
||||
linkEntry = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4) + (ctxt->entranceList[ctxt->curSpawn].spawn & 0xFF);
|
||||
ctxt->linkActorEntry = linkEntry;
|
||||
ctxt->linkActorEntry = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->spawnList.segment) + ctxt->setupEntranceList[ctxt->curSpawn].spawn;
|
||||
|
||||
if ( (ctxt->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
|
||||
(gSaveContext.extra.unk010 == 0x02 && gSaveContext.extra.unk042 == 0x0CFF)
|
||||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)
|
||||
) {
|
||||
Scene_LoadObject(&ctxt->sceneContext, 0x192);
|
||||
return;
|
||||
|
|
@ -42,17 +51,19 @@ void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
loadReturn = Scene_LoadObject(&ctxt->sceneContext, 0x11);
|
||||
|
||||
temp16 = (&ctxt->sceneContext)->unk8;
|
||||
objectVramAddr = ctxt->sceneContext.objects[temp16].vramAddr;
|
||||
ctxt->sceneContext.unk8 = loadReturn & 0xFF;
|
||||
objectVramAddr = ctxt->sceneContext.objects[ctxt->sceneContext.objectCount].vramAddr;
|
||||
ctxt->sceneContext.objectCount = loadReturn & 0xFF;
|
||||
ctxt->sceneContext.unk9 = loadReturn & 0xFF;
|
||||
|
||||
|
||||
// More matching, but has code ordering issues in addition to one instance of regalloc
|
||||
//temp16 = gSaveContext.perm.unk20;
|
||||
//temp16 = D_801C2730[temp16];
|
||||
|
||||
temp16 = D_801C2730[gSaveContext.perm.unk20];
|
||||
actorOverlayTable[0].initValues->objectDependency = temp16;
|
||||
|
||||
actorOverlayTable[0].initInfo->objectId = temp16;
|
||||
Scene_LoadObject(&ctxt->sceneContext, temp16);
|
||||
|
||||
ctxt->sceneContext.objects[(&ctxt->sceneContext)->unk8].vramAddr = objectVramAddr;
|
||||
ctxt->sceneContext.objects[ctxt->sceneContext.objectCount].vramAddr = objectVramAddr;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand00.asm")
|
||||
|
|
@ -60,18 +71,14 @@ GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand00.asm")
|
|||
|
||||
// Scene Command 0x01: Actor List
|
||||
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
GlobalContext *temp_a2;
|
||||
|
||||
temp_a2 = ctxt;
|
||||
temp_a2->sceneNumActorsToLoad = (u16) entry->base.unk1;
|
||||
ctxt = temp_a2;
|
||||
ctxt->setupActorList = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->sceneNumActorsToLoad = (u16) entry->base.data1;
|
||||
ctxt->setupActorList = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->actorCtx.unkC = (u16)0;
|
||||
}
|
||||
|
||||
// Scene Command 0x02: Cutscene Camera List
|
||||
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->unk18858 = (UNK_PTR)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->unk18858 = (UNK_PTR)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
// Scene Command 0x03: Collision Header
|
||||
|
|
@ -79,7 +86,7 @@ void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
BgMeshHeader* temp_ret;
|
||||
BgMeshHeader* temp_s0;
|
||||
|
||||
temp_ret = (BgMeshHeader*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
temp_ret = (BgMeshHeader*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
temp_s0 = temp_ret;
|
||||
temp_s0->vertices = (BgVertex*)Lib_PtrSegToVirt(temp_ret->vertices);
|
||||
temp_s0->polygons = (BgPolygon*)Lib_PtrSegToVirt(temp_s0->polygons);
|
||||
|
|
@ -98,99 +105,184 @@ void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
// Scene Command 0x04: Room List
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->numRooms = (u8) entry->base.unk1;
|
||||
ctxt->roomList = (RoomFileLocation*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->numRooms = (u8) entry->base.data1;
|
||||
ctxt->roomList = (RoomFileLocation*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
// Scene Command 0x06: Entrance List
|
||||
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupEntranceList = (EntranceEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->setupEntranceList = (EntranceEntry*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
// Scene Command 0x07: Special Files
|
||||
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
if (entry->base.unk4 != 0) {
|
||||
ctxt->sceneContext.keepObjectId = Scene_LoadObject(&ctxt->sceneContext, entry->base.unk4);
|
||||
if (entry->base.data2 != 0) {
|
||||
ctxt->sceneContext.keepObjectId = Scene_LoadObject(&ctxt->sceneContext, entry->base.data2);
|
||||
gRspSegmentPhysAddrs[5] = (u32)(ctxt->sceneContext.objects[ctxt->sceneContext.keepObjectId].vramAddr) + 0x80000000;
|
||||
}
|
||||
|
||||
if (entry->base.unk1 != 0) {
|
||||
// TODO:
|
||||
// OOT has D_801C2650's equivalent as a list of navi messages that store SceneTableEntry structs.
|
||||
// This needs to be something like (SceneTableEntry*)(&D_801C2650[entry->unk1])
|
||||
// Currently D_801C2650 is not typed so that can't be completed at this moment.
|
||||
ctxt->unk18868 = Play_LoadScene(ctxt, (SceneTableEntry*)(((entry->base.unk1 * 8) - 8) + &D_801C2650));
|
||||
// OR LESS MATCHING:
|
||||
//ctxt->unk18868 = Play_LoadScene(ctxt, (SceneTableEntry*)(&D_801C2650[entry->unk1 - 1]));
|
||||
if (entry->base.data1 != 0) {
|
||||
ctxt->unk18868 = Play_LoadScene(ctxt, &D_801C2650[entry->base.data1 - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x08: Room Behavior
|
||||
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->roomContext.currRoom.unk3 = entry->base.unk1;
|
||||
ctxt->roomContext.currRoom.unk2 = entry->base.unk4 & 0xFF;
|
||||
ctxt->roomContext.currRoom.unk5 = (entry->base.unk4 >> 8) & 1;
|
||||
ctxt->msgCtx.unk12044 = (entry->base.unk4 >> 0xa) & 1;
|
||||
ctxt->roomContext.currRoom.enablePosLights = (entry->base.unk4 >> 0xb) & 1;
|
||||
ctxt->kankyoContext.unkE2 = (entry->base.unk4 >> 0xc) & 1;
|
||||
ctxt->roomContext.currRoom.unk3 = entry->base.data1;
|
||||
ctxt->roomContext.currRoom.unk2 = entry->base.data2 & 0xFF;
|
||||
ctxt->roomContext.currRoom.unk5 = (entry->base.data2 >> 8) & 1;
|
||||
ctxt->msgCtx.unk12044 = (entry->base.data2 >> 0xa) & 1;
|
||||
ctxt->roomContext.currRoom.enablePosLights = (entry->base.data2 >> 0xb) & 1;
|
||||
ctxt->kankyoContext.unkE2 = (entry->base.data2 >> 0xc) & 1;
|
||||
}
|
||||
|
||||
// Scene Command 0x0A: Mesh Header
|
||||
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->roomContext.currRoom.mesh = (RoomMesh*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->roomContext.currRoom.mesh = (RoomMesh*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0B.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0C.asm")
|
||||
// Scene Command 0x0C: Light List
|
||||
void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
s32 i;
|
||||
LightInfo* lightInfo;
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0D.asm")
|
||||
lightInfo = (LightInfo*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
for (i = 0; i < entry->base.data1; i++)
|
||||
{
|
||||
Lights_Insert(ctxt, &ctxt->lightCtx, lightInfo);
|
||||
lightInfo++;
|
||||
}
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0E.asm")
|
||||
// Scene Command 0x0D: Path List
|
||||
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupPathList = (void*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/func_8012FEBC.asm")
|
||||
// Scene Command 0x0E: Transition Actor List
|
||||
void Scene_HeaderCommand0E(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->transitionActorCount = entry->base.data1;
|
||||
ctxt->transitionActorList = (TransitionActorInit*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
func_80105818(ctxt, ctxt->transitionActorCount, ctxt->transitionActorList);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0F.asm")
|
||||
void func_8012FEBC(GlobalContext* ctxt, u8* nbTransitionActors) {
|
||||
*nbTransitionActors = 0;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/func_8012FF10.asm")
|
||||
// Scene Command 0x0F: Light Setting List
|
||||
void Scene_HeaderCommand0F(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->kankyoContext.environmentSettingsCount = entry->base.data1;
|
||||
ctxt->kankyoContext.environmentSettingsList = (void*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand11.asm")
|
||||
s32 func_8012FF10(GlobalContext* ctxt, s32 fileIndex) {
|
||||
s32 vromStart = D_801C2660[fileIndex].vromStart;
|
||||
s32 fileSize = D_801C2660[fileIndex].vromEnd - vromStart;
|
||||
|
||||
if (fileSize) {
|
||||
ctxt->roomContext.unk74 = GameStateHeap_AllocFromEnd(&ctxt->state.heap, fileSize);
|
||||
return DmaMgr_SendRequest0((s32)ctxt->roomContext.unk74, vromStart, fileSize);
|
||||
}
|
||||
|
||||
// UB: Undefined behaviour to not have a return statement here, but it breaks matching.
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand12.asm")
|
||||
// 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 Command 0x12: Skybox Disables
|
||||
void Scene_HeaderCommand12(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->kankyoContext.unk15 = entry->skyboxDisables.unk4;
|
||||
ctxt->kankyoContext.unk16 = entry->skyboxDisables.unk5;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand10.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand05.asm")
|
||||
// Scene Command 0x05: Wind Settings
|
||||
void Scene_HeaderCommand05(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
s8 temp1 = entry->windSettings.unk4;
|
||||
s8 temp2 = entry->windSettings.unk5;
|
||||
s8 temp3 = entry->windSettings.unk6;
|
||||
|
||||
ctxt->kankyoContext.unkAC = temp1;
|
||||
ctxt->kankyoContext.unkAE = temp2;
|
||||
ctxt->kankyoContext.unkB0 = temp3;
|
||||
ctxt->kankyoContext.unkB4 = entry->windSettings.unk7;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand13.asm")
|
||||
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupExitList = (void*)Lib_PtrSegToVirt((void*)entry->exitList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x09: Undefined
|
||||
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand15.asm")
|
||||
// Scene Command 0x15: Sound Settings
|
||||
void Scene_HeaderCommand15(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->unk814 = entry->soundSettings.musicSeq;
|
||||
ctxt->unk815 = entry->soundSettings.nighttimeSFX;
|
||||
if(gSaveContext.extra.unk276 == 0xFF || func_801A8A50(0) == 0x57) {
|
||||
func_801A400C(entry->soundSettings.bgmId);
|
||||
}
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand16.asm")
|
||||
// Scene Command 0x16: Echo Setting
|
||||
void Scene_HeaderCommand16(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->roomContext.currRoom.echo = entry->echoSettings.echo;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand18.asm")
|
||||
// Scene Command 0x18: Alternate Headers
|
||||
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
SceneCmd** altHeaderList;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
if (gSaveContext.extra.sceneSetupIndex) {
|
||||
altHeaderList = (SceneCmd**)Lib_PtrSegToVirt((void*)entry->altHeaders.segment);
|
||||
altHeader = altHeaderList[gSaveContext.extra.sceneSetupIndex - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ProcessHeader(ctxt, (SceneCmd*)Lib_PtrSegToVirt(altHeader));
|
||||
(entry + 1)->base.code = 0x14;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x17: Cutscene Data
|
||||
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->csCtx.cutsceneCount = (u8)entry->base.unk1;
|
||||
ctxt->cutsceneList = (CutsceneEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->csCtx.cutsceneCount = (u8)entry->base.data1;
|
||||
ctxt->cutsceneList = (CutsceneEntry*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand1B.asm")
|
||||
// Scene Command 0x1B: Cutscene Actor List
|
||||
void Scene_HeaderCommand1B(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ActorCutscene_Init(ctxt, (ActorCutscene*)Lib_PtrSegToVirt((void*)entry->cutsceneActorList.segment), entry->cutsceneActorList.num);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand1C.asm")
|
||||
// Scene Command 0x1C: Mini Maps
|
||||
void Scene_HeaderCommand1C(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
func_80104CF4(ctxt);
|
||||
func_8010549C(ctxt, entry->minimapSettings.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x1D: Undefined
|
||||
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand1E.asm")
|
||||
// Scene Command 0x1E: Minimap Chests
|
||||
void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
func_8010565C(ctxt, entry->minimapChests.num, entry->minimapChests.segment);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand19.asm")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue