mirror of https://github.com/zeldaret/mm.git
Decompiling functions in z_scene (#4)
* Decompiling functions in z_scene * Bringing decompiled functions in line with project style
This commit is contained in:
parent
6387dff17b
commit
bfcc1d6a9a
|
|
@ -2407,40 +2407,40 @@ s32 Scene_FindSceneObjectIndex(SceneContext* sceneCtxt, short id); // func_8012F
|
|||
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
|
||||
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012F79C
|
||||
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012F90C
|
||||
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012F954
|
||||
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012F984
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FA24
|
||||
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FA68
|
||||
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FA98
|
||||
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FB60
|
||||
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FBE8
|
||||
void Scene_HeaderCommand0B(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FC18
|
||||
void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FDA4
|
||||
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FE2C
|
||||
void Scene_HeaderCommand0E(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FE5C
|
||||
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry); // func_8012F79C
|
||||
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry); // func_8012F90C
|
||||
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry); // func_8012F954
|
||||
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry); // func_8012F984
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry); // func_8012FA24
|
||||
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry); // func_8012FA68
|
||||
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneCmd* entry); // func_8012FA98
|
||||
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneCmd* entry); // func_8012FB60
|
||||
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneCmd* entry); // func_8012FBE8
|
||||
void Scene_HeaderCommand0B(GlobalContext* ctxt, SceneCmd* entry); // func_8012FC18
|
||||
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 Scene_HeaderCommand0F(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FECC
|
||||
void Scene_HeaderCommand0F(GlobalContext* ctxt, SceneCmd* entry); // func_8012FECC
|
||||
void func_8012FF10(GlobalContext* ctxt, int iParm2); // func_8012FF10
|
||||
void Scene_HeaderCommand11(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FF8C
|
||||
void Scene_HeaderCommand12(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8012FFF0
|
||||
void Scene_HeaderCommand10(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130018
|
||||
void Scene_HeaderCommand05(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8013033C
|
||||
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_801303A0
|
||||
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_801303D0
|
||||
void Scene_HeaderCommand15(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_801303E0
|
||||
void Scene_HeaderCommand16(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_8013043C
|
||||
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130454
|
||||
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_801304CC
|
||||
void Scene_HeaderCommand1B(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130500
|
||||
void Scene_HeaderCommand1C(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130540
|
||||
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130578
|
||||
void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130588
|
||||
void Scene_HeaderCommand19(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_801305B0
|
||||
void Scene_HeaderCommand1A(GlobalContext* ctxt, SceneHeaderEntry* entry); // func_80130674
|
||||
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
|
||||
void Scene_HeaderCommand05(GlobalContext* ctxt, SceneCmd* entry); // func_8013033C
|
||||
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneCmd* entry); // func_801303A0
|
||||
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneCmd* entry); // func_801303D0
|
||||
void Scene_HeaderCommand15(GlobalContext* ctxt, SceneCmd* entry); // func_801303E0
|
||||
void Scene_HeaderCommand16(GlobalContext* ctxt, SceneCmd* entry); // func_8013043C
|
||||
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneCmd* entry); // func_80130454
|
||||
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry); // func_801304CC
|
||||
void Scene_HeaderCommand1B(GlobalContext* ctxt, SceneCmd* entry); // func_80130500
|
||||
void Scene_HeaderCommand1C(GlobalContext* ctxt, SceneCmd* entry); // func_80130540
|
||||
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneCmd* entry); // func_80130578
|
||||
void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneCmd* entry); // func_80130588
|
||||
void Scene_HeaderCommand19(GlobalContext* ctxt, SceneCmd* entry); // func_801305B0
|
||||
void Scene_HeaderCommand1A(GlobalContext* ctxt, SceneCmd* entry); // func_80130674
|
||||
void func_801306A4(GlobalContext* ctxt); // func_801306A4
|
||||
s32 Scene_ProcessHeader(GlobalContext* ctxt, SceneHeaderEntry* header); // func_801306E8
|
||||
s32 Scene_ProcessHeader(GlobalContext* ctxt, SceneCmd* header); // func_801306E8
|
||||
u32 Scene_CreateEntrance(u32 sceneIndex, u32 spawnIndex, u32 offset); // func_80130768
|
||||
void func_80130784(void); // func_80130784
|
||||
void SceneProc_DrawCurrentSceneAnimatedTextures(GlobalContext* ctxt); // func_801307C0
|
||||
|
|
|
|||
|
|
@ -168,6 +168,11 @@ typedef struct {
|
|||
/* 0x7 */ u8 unk7;
|
||||
} CutsceneEntry;
|
||||
|
||||
typedef struct{
|
||||
/* 0x00 */ u8 spawn;
|
||||
/* 0x01 */ u8 room;
|
||||
} EntranceEntry;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 chestFlags;
|
||||
/* 0x04 */ u32 switchFlags[2];
|
||||
|
|
@ -476,7 +481,11 @@ typedef struct {
|
|||
|
||||
// Extra information in the save context that is not saved
|
||||
typedef struct {
|
||||
/* 0x000 */ UNK_TYPE1 pad0[640];
|
||||
/* 0x000 */ UNK_TYPE1 pad0[0x10];
|
||||
/* 0x010 */ s32 unk010;
|
||||
/* 0x012 */ UNK_TYPE1 unk011[0x2E];
|
||||
/* 0x042 */ s16 unk042;
|
||||
/* 0x044 */ UNK_TYPE1 unk044[0x23C];
|
||||
/* 0x280 */ u16 unk280;
|
||||
/* 0x282 */ u16 unk282;
|
||||
/* 0x284 */ UNK_TYPE1 pad284[64];
|
||||
|
|
@ -515,22 +524,30 @@ typedef struct {
|
|||
/* 0x00 */ UNK_TYPE1 pad0[34];
|
||||
} SaveContext_struct2;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ UNK_TYPE1 pad0[16];
|
||||
} SceneActorInit;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u32 entranceCount;
|
||||
/* 0x4 */ EntranceRecord** entrances;
|
||||
/* 0x8 */ char* name;
|
||||
} SceneEntranceTableEnty;
|
||||
|
||||
/**
|
||||
* Scene Commands
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 command;
|
||||
/* 0x1 */ u8 unk1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x4 */ u32 unk4;
|
||||
} SceneHeaderEntry;
|
||||
/* 0x0 */ u8 command;
|
||||
/* 0x1 */ u8 unk1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x4 */ u32 unk4;
|
||||
} SCmdBase;
|
||||
|
||||
typedef union
|
||||
{
|
||||
SCmdBase base;
|
||||
} SceneCmd;
|
||||
/**
|
||||
* End Scene Commands
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 scenes[27];
|
||||
|
|
@ -540,7 +557,7 @@ typedef struct {
|
|||
/* 0x00 */ s16 id; // Negative ids mean that the object is unloaded
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ void* vramAddr;
|
||||
/* 0x08 */ DmaRequest unk8;
|
||||
/* 0x08 */ DmaRequest dmaReq;
|
||||
/* 0x28 */ OSMesgQueue unk28;
|
||||
/* 0x40 */ UNK_TYPE1 pad40[4];
|
||||
} SceneObject;
|
||||
|
|
@ -666,6 +683,13 @@ typedef struct {
|
|||
/* 0x4 */ s16 z;
|
||||
} Vector3s;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s16 id;
|
||||
/* 0x02 */ Vector3s pos;
|
||||
/* 0x08 */ Vector3s rot;
|
||||
/* 0x0E */ s16 params;
|
||||
} ActorEntry;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ s32 topY;
|
||||
/* 0x4 */ s32 bottomY;
|
||||
|
|
@ -1024,7 +1048,8 @@ typedef struct {
|
|||
/* 0x000E */ UNK_TYPE1 padE[10];
|
||||
/* 0x0018 */ u32 day;
|
||||
/* 0x001C */ u32 daysElapsed;
|
||||
/* 0x0020 */ UNK_TYPE1 pad20[3];
|
||||
/* 0x0020 */ u8 unk20;
|
||||
/* 0x0021 */ UNK_TYPE1 pad21[2];
|
||||
/* 0x0023 */ u8 owlSave;
|
||||
/* 0x0024 */ SaveContext_struct1 unk24;
|
||||
/* 0x004C */ SaveContext_struct2 unk4C;
|
||||
|
|
@ -1093,7 +1118,7 @@ typedef struct {
|
|||
/* 0x16 */ UNK_TYPE1 pad16[2];
|
||||
/* 0x18 */ BgPolygon* polygons;
|
||||
/* 0x1C */ BgPolygonAttributes* attributes;
|
||||
/* 0x20 */ UNK_TYPE1 pad20[4];
|
||||
/* 0x20 */ UNK_PTR cameraData;
|
||||
/* 0x24 */ u16 numWaterBoxes;
|
||||
/* 0x26 */ UNK_TYPE1 pad26[2];
|
||||
/* 0x28 */ BgWaterBox* waterboxes;
|
||||
|
|
@ -1235,7 +1260,9 @@ typedef struct {
|
|||
/* 0xDA */ UNK_TYPE1 padDA[2];
|
||||
/* 0xDC */ f32 unkDC;
|
||||
/* 0xE0 */ u8 unkE0;
|
||||
/* 0xE1 */ UNK_TYPE1 padE1[17];
|
||||
/* 0xE1 */ UNK_TYPE1 unkE1;
|
||||
/* 0xE2 */ s8 unkE2;
|
||||
/* 0xE3 */ UNK_TYPE1 padE2[15];
|
||||
} KankyoContext;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -1251,7 +1278,9 @@ typedef struct {
|
|||
/* 0x11F22 */ u8 unk11F22;
|
||||
/* 0x11F23 */ UNK_TYPE1 pad11F23[253];
|
||||
/* 0x12020 */ u8 unk12020;
|
||||
/* 0x12021 */ UNK_TYPE1 pad12021[73];
|
||||
/* 0x12021 */ UNK_TYPE1 pad12021[35];
|
||||
/* 0x12044 */ s16 unk12044;
|
||||
/* 0x12046 */ UNK_TYPE1 pad12046[36];
|
||||
/* 0x1206A */ s16 unk1206A;
|
||||
/* 0x1206C */ UNK_TYPE1 pad1206C[108];
|
||||
} MessageContext;
|
||||
|
|
@ -1277,7 +1306,8 @@ typedef struct {
|
|||
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 index;
|
||||
/* 0x01 */ UNK_TYPE1 pad1[2];
|
||||
/* 0x01 */ UNK_TYPE1 unk1;
|
||||
/* 0x02 */ s8 unk2;
|
||||
/* 0x03 */ u8 unk3;
|
||||
/* 0x04 */ s8 unk4;
|
||||
/* 0x05 */ u8 unk5;
|
||||
|
|
@ -1796,7 +1826,7 @@ typedef struct {
|
|||
/* 0x20 */ u32 unk20;
|
||||
} s801BB170;
|
||||
|
||||
typedef void(*scene_header_func)(GlobalContext* ctxt, SceneHeaderEntry* entry);
|
||||
typedef void(*scene_header_func)(GlobalContext* ctxt, SceneCmd* entry);
|
||||
|
||||
typedef void(*scene_proc_draw_func)(GlobalContext* ctxt, u32 segment, void* params);
|
||||
|
||||
|
|
@ -2154,13 +2184,13 @@ struct GlobalContext {
|
|||
/* 0x18848 */ u8 numRooms;
|
||||
/* 0x18849 */ UNK_TYPE1 pad18849[3];
|
||||
/* 0x1884C */ RoomFileLocation* roomAddrs;
|
||||
/* 0x18850 */ UNK_TYPE1 pad18850[4];
|
||||
/* 0x18854 */ SceneActorInit* sceneActorList;
|
||||
/* 0x18858 */ UNK_TYPE1 pad18858[4];
|
||||
/* 0x1885C */ u8* entranceList;
|
||||
/* 0x18850 */ ActorEntry* linkActorEntry;
|
||||
/* 0x18854 */ ActorEntry* sceneActorList;
|
||||
/* 0x18858 */ UNK_PTR unk18858;
|
||||
/* 0x1885C */ EntranceEntry* entranceList;
|
||||
/* 0x18860 */ void* exitList;
|
||||
/* 0x18864 */ void* pathList;
|
||||
/* 0x18868 */ UNK_TYPE1 pad18868[4];
|
||||
/* 0x18868 */ UNK_PTR unk18868;
|
||||
/* 0x1886C */ AnimatedTexture* sceneTextureAnimations;
|
||||
/* 0x18870 */ UNK_TYPE1 pad18870[4];
|
||||
/* 0x18874 */ u8 unk18874;
|
||||
|
|
@ -2169,7 +2199,9 @@ struct GlobalContext {
|
|||
/* 0x1887C */ s8 unk1887C;
|
||||
/* 0x1887D */ UNK_TYPE1 pad1887D[7];
|
||||
/* 0x18884 */ CollisionContext collisionContext;
|
||||
/* 0x18B20 */ UNK_TYPE1 pad18B20[42];
|
||||
/* 0x18B20 */ UNK_TYPE1 pad18B20[0x28];
|
||||
/* 0x18B48 */ u8 curSpawn;
|
||||
/* 0x18B49 */ UNK_TYPE1 unk18B49;
|
||||
/* 0x18B4A */ u8 unk18B4A;
|
||||
/* 0x18B4B */ UNK_TYPE1 pad18B4B[777];
|
||||
/* 0x18E54 */ SceneTableEntry* currentSceneTableEntry;
|
||||
|
|
|
|||
|
|
@ -1556,7 +1556,7 @@ extern UNK_TYPE1 D_801C2410; // D_801C2410
|
|||
extern UNK_TYPE1 D_801C2650; // D_801C2650
|
||||
extern UNK_TYPE1 D_801C2660; // D_801C2660
|
||||
extern scene_header_func sceneHeaderFuncTable[31]; // D_801C26A8
|
||||
extern UNK_TYPE1 D_801C2730; // D_801C2730
|
||||
extern s16 D_801C2730[0x08]; // D_801C2730
|
||||
extern ObjectFileTableEntry objectFileTable[643]; // D_801C2740
|
||||
extern Gfx gSceneProcDefaultDl[11]; // D_801C3B60
|
||||
extern global_context_func gSceneProcSceneDrawFuncs[8]; // D_801C3BB8
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ s32 Room_HandleLoadCallbacks(GlobalContext* ctxt, RoomContext* roomCtxt) {
|
|||
roomCtxt->currRoom.vramAddr = (void*)(roomCtxt->activeRoomVram);
|
||||
gRspSegmentPhysAddrs[3] = roomCtxt->activeRoomVram + 0x80000000;
|
||||
|
||||
Scene_ProcessHeader(ctxt, (SceneHeaderEntry*)roomCtxt->currRoom.vramAddr);
|
||||
Scene_ProcessHeader(ctxt, (SceneCmd*)roomCtxt->currRoom.vramAddr);
|
||||
func_80123140(ctxt, (ActorPlayer*)ctxt->actorContext.actorTypeLists[2].head);
|
||||
Actor_SpawnTransitionActors(ctxt, &ctxt->actorContext);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,29 +9,137 @@ GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_ReloadUnloadedObjects.asm")
|
|||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_FindSceneObjectIndex.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_IsObjectLoaded.asm")
|
||||
s32 Scene_IsObjectLoaded(SceneContext* iParm1, s32 index) {
|
||||
if (iParm1->objects[index].id > 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_DmaAllObjects.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/func_8012F73C.asm")
|
||||
|
||||
// Scene Command 0x00: Link Spawn List
|
||||
#ifdef NONMATCHING
|
||||
// Regalloc differences only
|
||||
void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
ActorEntry* linkEntry;
|
||||
s32 loadReturn;
|
||||
void* objectVramAddr;
|
||||
s16 temp16;
|
||||
|
||||
linkEntry = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4) + (ctxt->entranceList[ctxt->curSpawn].spawn & 0xFF);
|
||||
ctxt->linkActorEntry = linkEntry;
|
||||
|
||||
if ( (ctxt->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
|
||||
(gSaveContext.extra.unk010 == 0x02 && gSaveContext.extra.unk042 == 0x0CFF)
|
||||
) {
|
||||
Scene_LoadObject(&ctxt->sceneContext, 0x192);
|
||||
return;
|
||||
}
|
||||
|
||||
loadReturn = Scene_LoadObject(&ctxt->sceneContext, 0x11);
|
||||
|
||||
temp16 = (&ctxt->sceneContext)->unk8;
|
||||
objectVramAddr = ctxt->sceneContext.objects[temp16].vramAddr;
|
||||
ctxt->sceneContext.unk8 = loadReturn & 0xFF;
|
||||
ctxt->sceneContext.unk9 = loadReturn & 0xFF;
|
||||
|
||||
temp16 = D_801C2730[gSaveContext.perm.unk20];
|
||||
actorOverlayTable[0].initValues->objectDependency = temp16;
|
||||
|
||||
Scene_LoadObject(&ctxt->sceneContext, temp16);
|
||||
|
||||
ctxt->sceneContext.objects[(&ctxt->sceneContext)->unk8].vramAddr = objectVramAddr;
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand00.asm")
|
||||
#endif
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand01.asm")
|
||||
// Scene Command 0x01: Actor List
|
||||
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
GlobalContext *temp_a2;
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand02.asm")
|
||||
temp_a2 = ctxt;
|
||||
temp_a2->sceneNumActorsToLoad = (u16) entry->base.unk1;
|
||||
ctxt = temp_a2;
|
||||
ctxt->sceneActorList = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
ctxt->actorContext.unkC = (u16)0;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand03.asm")
|
||||
// Scene Command 0x02: Cutscene Camera List
|
||||
void Scene_HeaderCommand02(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->unk18858 = (UNK_PTR)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand04.asm")
|
||||
// Scene Command 0x03: Collision Header
|
||||
void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
BgMeshHeader* temp_ret;
|
||||
BgMeshHeader* temp_s0;
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand06.asm")
|
||||
temp_ret = (BgMeshHeader*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
temp_s0 = temp_ret;
|
||||
temp_s0->vertices = (BgVertex*)Lib_PtrSegToVirt(temp_ret->vertices);
|
||||
temp_s0->polygons = (BgPolygon*)Lib_PtrSegToVirt(temp_s0->polygons);
|
||||
if (temp_s0->attributes != 0) {
|
||||
temp_s0->attributes = (BgPolygonAttributes*)Lib_PtrSegToVirt(temp_s0->attributes);
|
||||
}
|
||||
if (temp_s0->cameraData != 0) {
|
||||
temp_s0->cameraData = (void*)Lib_PtrSegToVirt(temp_s0->cameraData);
|
||||
}
|
||||
if (temp_s0->waterboxes != 0) {
|
||||
temp_s0->waterboxes = (BgWaterBox*)Lib_PtrSegToVirt(temp_s0->waterboxes);
|
||||
}
|
||||
|
||||
BgCheck_Init(&ctxt->bgCheckContext, ctxt, temp_s0);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand07.asm")
|
||||
// Scene Command 0x04: Room List
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->numRooms = (u8) entry->base.unk1;
|
||||
ctxt->roomAddrs = (RoomFileLocation*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand08.asm")
|
||||
// Scene Command 0x06: Entrance List
|
||||
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->entranceList = (EntranceEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand0A.asm")
|
||||
// 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);
|
||||
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]));
|
||||
}
|
||||
}
|
||||
|
||||
// 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->msgContext.unk12044 = (entry->base.unk4 >> 0xa) & 1;
|
||||
ctxt->roomContext.currRoom.enablePosLights = (entry->base.unk4 >> 0xb) & 1;
|
||||
ctxt->kankyoContext.unkE2 = (entry->base.unk4 >> 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);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand0B.asm")
|
||||
|
||||
|
|
@ -57,7 +165,10 @@ GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand05.asm")
|
|||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand13.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand09.asm")
|
||||
// Scene Command 0x09: Undefined
|
||||
void Scene_HeaderCommand09(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand15.asm")
|
||||
|
||||
|
|
@ -65,13 +176,20 @@ GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand16.asm")
|
|||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand18.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand17.asm")
|
||||
// Scene Command 0x17: Cutscene Data
|
||||
void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->cutsceneContext.cutsceneCount = (u8)entry->base.unk1;
|
||||
ctxt->cutsceneList = (CutsceneEntry*)Lib_PtrSegToVirt((void*)entry->base.unk4);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand1B.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand1C.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand1D.asm")
|
||||
// Scene Command 0x1D: Undefined
|
||||
void Scene_HeaderCommand1D(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_HeaderCommand1E.asm")
|
||||
|
||||
|
|
@ -83,7 +201,8 @@ GLOBAL_ASM("./asm/nonmatching/z_scene/func_801306A4.asm")
|
|||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_ProcessHeader.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/Scene_CreateEntrance.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/func_80130784.asm")
|
||||
u32 Scene_CreateEntrance(u32 sceneIndex, u32 spawnIndex, u32 offset) {
|
||||
return (((sceneIndex << 9) | (spawnIndex << 4)) | offset) & 0xFFFF;
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/nonmatching/z_scene/func_80130784.asm")
|
||||
Loading…
Reference in New Issue