mirror of https://github.com/zeldaret/mm.git
z_scene functions now use the same structs as OOT (#3)
* z_scene now uses OOT structs where available Additionally commits a decompiled z_actor function. * Fixes audio_setBGM function call in Scene_HeaderCommand15 * Update structs.h Co-authored-by: rozlette <uberpanzermensch@gmail.com> Co-authored-by: Egor Ananyin <ananinegor@gmail.com>
This commit is contained in:
parent
5687f3741a
commit
f230898dfe
|
@ -1937,8 +1937,8 @@ 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(GlobalContext* ctxt, u32 segmentAddress); // func_8010549C
|
||||
void func_8010565C(GlobalContext* ctxt, u8 num, u32 segmentAddress); // func_8010565C
|
||||
void func_8010549C(GlobalContext* ctxt, void* segmentAddress); // func_8010549C
|
||||
void func_8010565C(GlobalContext* ctxt, u8 num, void* 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
|
||||
|
|
|
@ -628,215 +628,200 @@ typedef struct {
|
|||
} RoomMeshType2Params; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdActorList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdBase;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdAltHeaders; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdSpawnList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 data2;
|
||||
} SCmdBase; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdColHeader; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdCsCameraList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdCsCameraList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdColHeader;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdCutsceneActorList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdRoomList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdCutsceneData; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ s8 west;
|
||||
/* 0x05 */ s8 vertical;
|
||||
/* 0x06 */ s8 south;
|
||||
/* 0x07 */ u8 clothIntensity;
|
||||
} SCmdWindSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x5];
|
||||
/* 0x7 */ u8 echo;
|
||||
} SCmdEchoSettings; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdEntranceList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 data2;
|
||||
} SCmdEndMarker; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 cUpElfMsgNum;
|
||||
/* 0x04 */ u32 keepObjectId;
|
||||
} SCmdSpecialFiles;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdEntranceList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 gpFlag1;
|
||||
/* 0x04 */ u32 gpFlag2;
|
||||
} SCmdRoomBehavior;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdExitList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdMesh;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdLightList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdObjectList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdLightSettingList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdLightList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdMesh; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdPathList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdMinimapChests; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdTransiActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ UNK_TYPE1 pad1[0x3];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdMinimapSettings; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdLightSettingList;
|
||||
// Cloudmodding has this as Environment Settings
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 cameraMovement;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 area;
|
||||
} SCmdMiscSettings; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 hour;
|
||||
/* 0x05 */ u8 min;
|
||||
/* 0x06 */ u8 unk6;
|
||||
} SCmdTimeSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdObjectList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 skyboxId;
|
||||
/* 0x05 */ u8 unk5;
|
||||
/* 0x06 */ u8 unk6;
|
||||
} SCmdSkyboxSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdPathList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[2];
|
||||
/* 0x04 */ u8 unk4;
|
||||
/* 0x05 */ u8 unk5;
|
||||
} SCmdSkyboxDisables;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 gpFlag1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 gpFlag2;
|
||||
} SCmdRoomBehavior; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdExitList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdRoomList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdEndMarker;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u8 unk4;
|
||||
/* 0x5 */ u8 unk5;
|
||||
} SCmdSkyboxDisables; // size = 0x6
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 bgmId;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[4];
|
||||
/* 0x06 */ u8 nighttimeSFX;
|
||||
/* 0x07 */ u8 musicSeq;
|
||||
} SCmdSoundSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u8 skyboxId;
|
||||
/* 0x5 */ u8 unk5;
|
||||
/* 0x6 */ u8 unk6;
|
||||
} SCmdSkyboxSettings; // size = 0x7
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x02 */ UNK_TYPE1 pad2[5];
|
||||
/* 0x07 */ u8 echo;
|
||||
} SCmdEchoSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 bgmId;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x4];
|
||||
/* 0x6 */ u8 nighttimeSFX;
|
||||
/* 0x7 */ u8 musicSeq;
|
||||
} SCmdSoundSettings; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdCutsceneData;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdSpawnList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdAltHeaders;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 cUpElfMsgNum;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 keepObjectId;
|
||||
} SCmdSpecialFiles; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ u32 data2;
|
||||
} SCmdWorldMapVisited;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u8 hour;
|
||||
/* 0x5 */ u8 min;
|
||||
/* 0x6 */ u8 unk6;
|
||||
} SCmdTimeSettings; // size = 0x7
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdTextureAnimations;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 num;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ u32 segment;
|
||||
} SCmdTransiActorList; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdCutsceneActorList;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ u8 code;
|
||||
/* 0x1 */ u8 data1;
|
||||
/* 0x2 */ UNK_TYPE1 pad2[0x2];
|
||||
/* 0x4 */ s8 unk4;
|
||||
/* 0x5 */ s8 unk5;
|
||||
/* 0x6 */ s8 unk6;
|
||||
/* 0x7 */ u8 unk7;
|
||||
} SCmdWindSettings; // size = 0x8
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 data1;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdMinimapSettings;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 code;
|
||||
/* 0x01 */ u8 num;
|
||||
/* 0x04 */ void* segment;
|
||||
} SCmdMinimapChests;
|
||||
|
||||
// Extra information in the save context that is not saved
|
||||
typedef struct {
|
||||
|
@ -889,35 +874,38 @@ typedef struct {
|
|||
} SaveContext_struct2; // size = 0x22
|
||||
|
||||
typedef union {
|
||||
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;
|
||||
/* Command: N/A */ SCmdBase base;
|
||||
/* Command: 0x00 */ SCmdSpawnList spawnList;
|
||||
/* Command: 0x01 */ SCmdActorList actorList;
|
||||
/* Command: 0x02 */ SCmdCsCameraList csCameraList;
|
||||
/* Command: 0x03 */ SCmdColHeader colHeader;
|
||||
/* Command: 0x04 */ SCmdRoomList roomList;
|
||||
/* Command: 0x05 */ SCmdWindSettings windSettings;
|
||||
/* Command: 0x06 */ SCmdEntranceList entranceList;
|
||||
/* Command: 0x07 */ SCmdSpecialFiles specialFiles;
|
||||
/* Command: 0x08 */ SCmdRoomBehavior roomBehavior;
|
||||
/* Command: 0x09 */ // Unused
|
||||
/* Command: 0x0A */ SCmdMesh mesh;
|
||||
/* Command: 0x0B */ SCmdObjectList objectList;
|
||||
/* Command: 0x0C */ SCmdLightList lightList;
|
||||
/* Command: 0x0D */ SCmdPathList pathList;
|
||||
/* Command: 0x0E */ SCmdTransiActorList transiActorList;
|
||||
/* Command: 0x0F */ SCmdLightSettingList lightSettingList;
|
||||
/* Command: 0x10 */ SCmdTimeSettings timeSettings;
|
||||
/* Command: 0x11 */ SCmdSkyboxSettings skyboxSettings;
|
||||
/* Command: 0x12 */ SCmdSkyboxDisables skyboxDisables;
|
||||
/* Command: 0x13 */ SCmdExitList exitList;
|
||||
/* Command: 0x14 */ SCmdEndMarker endMarker;
|
||||
/* Command: 0x15 */ SCmdSoundSettings soundSettings;
|
||||
/* Command: 0x16 */ SCmdEchoSettings echoSettings;
|
||||
/* Command: 0x17 */ SCmdCutsceneData cutsceneData;
|
||||
/* Command: 0x18 */ SCmdAltHeaders altHeaders;
|
||||
/* Command: 0x19 */ SCmdWorldMapVisited worldMapVisited;
|
||||
/* Command: 0x1A */ SCmdTextureAnimations textureAnimations;
|
||||
/* Command: 0x1B */ SCmdCutsceneActorList cutsceneActorList;
|
||||
/* Command: 0x1C */ SCmdMinimapSettings minimapSettings;
|
||||
/* Command: 0x1D */ // Unused
|
||||
/* Command: 0x1E */ SCmdMinimapChests minimapChests;
|
||||
} SceneCmd; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
|
@ -1769,12 +1757,12 @@ typedef struct {
|
|||
/* 0xA9 */ UNK_TYPE1 unkA9;
|
||||
/* 0xAA */ UNK_TYPE1 unkAA;
|
||||
/* 0xAB */ UNK_TYPE1 unkAB;
|
||||
/* 0xAC */ s16 unkAC;
|
||||
/* 0xAE */ s16 unkAE;
|
||||
/* 0xB0 */ s16 unkB0;
|
||||
/* 0xAC */ s16 windWest;
|
||||
/* 0xAE */ s16 windVertical;
|
||||
/* 0xB0 */ s16 windSouth;
|
||||
/* 0xB2 */ UNK_TYPE1 unkB2;
|
||||
/* 0xB3 */ UNK_TYPE1 unkB3;
|
||||
/* 0xB4 */ f32 unkB4;
|
||||
/* 0xB4 */ f32 windClothIntensity;
|
||||
/* 0xB8 */ u8 environmentSettingsCount;
|
||||
/* 0xB9 */ UNK_TYPE1 unkB9;
|
||||
/* 0xBA */ UNK_TYPE1 unkBA;
|
||||
|
|
|
@ -359,20 +359,20 @@ f32 Actor_XZDistanceToPoint(Actor* actor, Vec3f* point) {
|
|||
return Math_Vec3f_DistXZ(&actor->currPosRot.pos, point);
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void Actor_CalcOffsetOrientedToDrawRotation(Actor* actor, Vec3f* offset, Vec3f* point) {
|
||||
f32 cos_rot_x;
|
||||
f32 sin_rot_x;
|
||||
|
||||
cos_rot_x = Math_Coss(actor->shape.rot.x);
|
||||
sin_rot_x = Math_Sins(actor->shape.rot.x);
|
||||
offset->x = (point->x - actor->currPosRot.pos.x * cos_rot_x) - (point->z - actor->currPosRot.pos.z * sin_rot_x);
|
||||
f32 cos_rot_y;
|
||||
f32 sin_rot_y;
|
||||
f32 imm_x;
|
||||
f32 imm_z;
|
||||
|
||||
cos_rot_y = Math_Coss(actor->shape.rot.y);
|
||||
sin_rot_y = Math_Sins(actor->shape.rot.y);
|
||||
imm_x = point->x - actor->currPosRot.pos.x;
|
||||
imm_z = point->z - actor->currPosRot.pos.z;
|
||||
offset->x = ((imm_x * cos_rot_y) - (imm_z * sin_rot_y));
|
||||
offset->z = ((imm_z * cos_rot_y) + (imm_x * sin_rot_y));
|
||||
offset->y = point->y - actor->currPosRot.pos.y;
|
||||
offset->z = (point->z - actor->currPosRot.pos.z * cos_rot_x) + (point->x - actor->currPosRot.pos.x * sin_rot_x);
|
||||
}
|
||||
#else
|
||||
GLOBAL_ASM("asm/non_matchings/z_actor//Actor_CalcOffsetOrientedToDrawRotation.asm")
|
||||
#endif
|
||||
|
||||
f32 Actor_YDistance(Actor* actor1, Actor* actor2) {
|
||||
return actor2->currPosRot.pos.y - actor1->currPosRot.pos.y;
|
||||
|
|
|
@ -9,13 +9,11 @@ GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_ReloadUnloadedObjects.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;
|
||||
}
|
||||
|
||||
|
@ -38,10 +36,8 @@ void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
void* objectVramAddr;
|
||||
s16 temp16;
|
||||
u8 unk20;
|
||||
|
||||
ctxt->linkActorEntry = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->spawnList.segment) +
|
||||
ctxt->linkActorEntry = (ActorEntry*)Lib_PtrSegToVirt(entry->spawnList.segment) +
|
||||
ctxt->setupEntranceList[ctxt->curSpawn].spawn;
|
||||
|
||||
if ( (ctxt->linkActorEntry->params & 0x0F00) >> 8 == 0x0C ||
|
||||
(gSaveContext.extra.unk10 == 0x02 && gSaveContext.extra.unk42 == 0x0CFF)
|
||||
) {
|
||||
|
@ -50,18 +46,13 @@ void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
}
|
||||
|
||||
loadReturn = Scene_LoadObject(&ctxt->sceneContext, 0x11);
|
||||
|
||||
global = ctxt;
|
||||
objectVramAddr = global->sceneContext.objects[global->sceneContext.objectCount].vramAddr;
|
||||
|
||||
ctxt->sceneContext.objectCount = loadReturn;
|
||||
ctxt->sceneContext.unk9 = loadReturn;
|
||||
|
||||
unk20 = gSaveContext.perm.unk20;
|
||||
temp16 = D_801C2730[unk20];
|
||||
|
||||
actorOverlayTable[0].initInfo->objectId = temp16;
|
||||
|
||||
Scene_LoadObject(&ctxt->sceneContext, temp16);
|
||||
|
||||
ctxt->sceneContext.objects[ctxt->sceneContext.objectCount].vramAddr = objectVramAddr;
|
||||
|
@ -69,14 +60,14 @@ void Scene_HeaderCommand00(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
// Scene Command 0x01: Actor List
|
||||
void Scene_HeaderCommand01(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->sceneNumActorsToLoad = (u16) entry->base.data1;
|
||||
ctxt->setupActorList = (ActorEntry*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->sceneNumActorsToLoad = (u16) entry->actorList.num;
|
||||
ctxt->setupActorList = (ActorEntry*)Lib_PtrSegToVirt(entry->actorList.segment);
|
||||
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.data2);
|
||||
ctxt->unk18858 = (UNK_PTR)Lib_PtrSegToVirt(entry->csCameraList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x03: Collision Header
|
||||
|
@ -84,7 +75,7 @@ void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
BgMeshHeader* temp_ret;
|
||||
BgMeshHeader* temp_s0;
|
||||
|
||||
temp_ret = (BgMeshHeader*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
temp_ret = (BgMeshHeader*)Lib_PtrSegToVirt(entry->colHeader.segment);
|
||||
temp_s0 = temp_ret;
|
||||
temp_s0->vertices = (BgVertex*)Lib_PtrSegToVirt(temp_ret->vertices);
|
||||
temp_s0->polygons = (BgPolygon*)Lib_PtrSegToVirt(temp_s0->polygons);
|
||||
|
@ -103,40 +94,42 @@ void Scene_HeaderCommand03(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
// Scene Command 0x04: Room List
|
||||
void Scene_HeaderCommand04(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->numRooms = (u8) entry->base.data1;
|
||||
ctxt->roomList = (RoomFileLocation*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->numRooms = entry->roomList.num;
|
||||
ctxt->roomList = (RoomFileLocation*)Lib_PtrSegToVirt(entry->roomList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x06: Entrance List
|
||||
void Scene_HeaderCommand06(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupEntranceList = (EntranceEntry*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->setupEntranceList = (EntranceEntry*)Lib_PtrSegToVirt(entry->entranceList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x07: Special Files
|
||||
void Scene_HeaderCommand07(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
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->specialFiles.keepObjectId != 0) {
|
||||
ctxt->sceneContext.keepObjectId = Scene_LoadObject(&ctxt->sceneContext,
|
||||
entry->specialFiles.keepObjectId);
|
||||
gRspSegmentPhysAddrs[5] = (u32)(ctxt->sceneContext.objects[ctxt->sceneContext.keepObjectId].vramAddr)
|
||||
+ 0x80000000;
|
||||
}
|
||||
|
||||
if (entry->base.data1 != 0) {
|
||||
ctxt->unk18868 = Play_LoadScene(ctxt, &D_801C2650[entry->base.data1 - 1]);
|
||||
if (entry->specialFiles.cUpElfMsgNum != 0) {
|
||||
ctxt->unk18868 = Play_LoadScene(ctxt, &D_801C2650[entry->specialFiles.cUpElfMsgNum - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Scene Command 0x08: Room Behavior
|
||||
void Scene_HeaderCommand08(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
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;
|
||||
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 Command 0x0A: Mesh Header
|
||||
void Scene_HeaderCommand0A(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->roomContext.currRoom.mesh = (RoomMesh*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->roomContext.currRoom.mesh = (RoomMesh*)Lib_PtrSegToVirt(entry->mesh.segment);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand0B.asm")
|
||||
|
@ -146,8 +139,8 @@ void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
s32 i;
|
||||
LightInfo* lightInfo;
|
||||
|
||||
lightInfo = (LightInfo*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
for (i = 0; i < entry->base.data1; i++)
|
||||
lightInfo = (LightInfo*)Lib_PtrSegToVirt(entry->lightList.segment);
|
||||
for (i = 0; i < entry->lightList.num; i++)
|
||||
{
|
||||
Lights_Insert(ctxt, &ctxt->lightCtx, lightInfo);
|
||||
lightInfo++;
|
||||
|
@ -156,13 +149,13 @@ void Scene_HeaderCommand0C(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
// Scene Command 0x0D: Path List
|
||||
void Scene_HeaderCommand0D(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupPathList = (void*)Lib_PtrSegToVirt((void*)entry->base.data2);
|
||||
ctxt->setupPathList = (void*)Lib_PtrSegToVirt(entry->pathList.segment);
|
||||
}
|
||||
|
||||
// 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);
|
||||
ctxt->transitionActorCount = entry->transiActorList.num;
|
||||
ctxt->transitionActorList = (TransitionActorInit*)Lib_PtrSegToVirt((void*)entry->transiActorList.segment);
|
||||
func_80105818(ctxt, ctxt->transitionActorCount, ctxt->transitionActorList);
|
||||
}
|
||||
|
||||
|
@ -172,19 +165,19 @@ void func_8012FEBC(GlobalContext* ctxt, u8* nbTransitionActors) {
|
|||
|
||||
// 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);
|
||||
ctxt->kankyoContext.environmentSettingsCount = entry->lightSettingList.num;
|
||||
ctxt->kankyoContext.environmentSettingsList = (void*)Lib_PtrSegToVirt(entry->lightSettingList.segment);
|
||||
}
|
||||
|
||||
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 to add one.
|
||||
}
|
||||
|
||||
|
@ -206,18 +199,17 @@ GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand10.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;
|
||||
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;
|
||||
}
|
||||
|
||||
void Scene_HeaderCommand13(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->setupExitList = (void*)Lib_PtrSegToVirt((void*)entry->exitList.segment);
|
||||
ctxt->setupExitList = (void*)Lib_PtrSegToVirt(entry->exitList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x09: Undefined
|
||||
|
@ -243,11 +235,9 @@ void Scene_HeaderCommand16(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
void Scene_HeaderCommand18(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
SceneCmd** altHeaderList;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
if (gSaveContext.extra.sceneSetupIndex) {
|
||||
altHeaderList = (SceneCmd**)Lib_PtrSegToVirt((void*)entry->altHeaders.segment);
|
||||
altHeaderList = (SceneCmd**)Lib_PtrSegToVirt(entry->altHeaders.segment);
|
||||
altHeader = altHeaderList[gSaveContext.extra.sceneSetupIndex - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ProcessHeader(ctxt, (SceneCmd*)Lib_PtrSegToVirt(altHeader));
|
||||
(entry + 1)->base.code = 0x14;
|
||||
|
@ -263,7 +253,8 @@ void Scene_HeaderCommand17(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
// 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);
|
||||
ActorCutscene_Init(ctxt, (ActorCutscene*)Lib_PtrSegToVirt(entry->cutsceneActorList.segment),
|
||||
entry->cutsceneActorList.num);
|
||||
}
|
||||
|
||||
// Scene Command 0x1C: Mini Maps
|
||||
|
@ -284,7 +275,10 @@ void Scene_HeaderCommand1E(GlobalContext* ctxt, SceneCmd* entry) {
|
|||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand19.asm")
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/Scene_HeaderCommand1A.asm")
|
||||
// Scene Command 0x1A: Texture Animations
|
||||
void Scene_HeaderCommand1A(GlobalContext* ctxt, SceneCmd* entry) {
|
||||
ctxt->sceneTextureAnimations = (AnimatedTexture*)Lib_PtrSegToVirt(entry->textureAnimations.segment);
|
||||
}
|
||||
|
||||
GLOBAL_ASM("./asm/non_matchings/z_scene/func_801306A4.asm")
|
||||
|
||||
|
|
Loading…
Reference in New Issue