Update ZAPD (#1533)

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "2b6f459b9"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "2b6f459b9"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

* Update ZAPD

Co-authored-by: Yanis42 <35189056+Yanis42@users.noreply.github.com>

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "572b13236"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "572b13236"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "9601f2699"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "9601f2699"
git-subrepo:
  version:  "0.4.6"
  origin:   "???"
  commit:   "???"

* fixes for new ZAPD

* readd typedefs

* remov enums

* Reading is hard

---------

Co-authored-by: Yanis42 <35189056+Yanis42@users.noreply.github.com>
This commit is contained in:
louist103
2024-01-14 10:34:50 -05:00
committed by GitHub
parent 5607eec18b
commit a5400fbde5
55 changed files with 3310 additions and 1636 deletions
+1 -1
View File
@@ -122,7 +122,7 @@ typedef struct Actor {
/* 0x01F */ s8 targetMode; // Controls how far the actor can be targeted from and how far it can stay locked on
/* 0x020 */ s16 halfDaysBits; // Bitmask indicating which half-days this actor is allowed to not be killed(?) (TODO: not sure how to word this). If the current halfDayBit is not part of this mask then the actor is killed when spawning the setup actors
/* 0x024 */ PosRot world; // Position/rotation in the world
/* 0x038 */ s8 csId; // ActorCutscene index, see `CutsceneId`
/* 0x038 */ s8 csId; // CutsceneEntry index, see `CutsceneId`
/* 0x039 */ u8 audioFlags; // Another set of flags? Seems related to sfx or bgm
/* 0x03C */ PosRot focus; // Target reticle focuses on this position. For player this represents head pos and rot
/* 0x050 */ u16 sfxId; // Id of sound effect to play. Plays when value is set, then is cleared the following update cycle
-2
View File
@@ -84,8 +84,6 @@ typedef struct {
/* 0x4 */ Vec3s* bgCamFuncData; // s16 data grouped in threes (ex. Vec3s), is usually of type `BgCamFuncData`
} BgCamInfo; // size = 0x8
typedef BgCamInfo CamData; // TODO: ZAPD compatibility
// The structure used for all instances of s16 data from `BgCamInfo`.
typedef struct {
/* 0x00 */ Vec3s pos;
-7
View File
@@ -59,11 +59,4 @@ void SkelCurve_SetAnim(SkelCurve* skelCurve, CurveAnimationHeader* animation, f3
s32 SkelCurve_Update(struct PlayState* play, SkelCurve* skelCurve);
void SkelCurve_Draw(struct Actor* actor, struct PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw, PostCurveLimbDraw postLimbDraw, s32 lod, struct Actor* thisx);
// ZAPD compatibility typedefs
// TODO: Remove when ZAPD adds support for them
typedef CurveInterpKnot TransformData;
typedef CurveAnimationHeader TransformUpdateIndex;
typedef CurveSkeletonHeader SkelCurveLimbList;
#endif // Z64_CURVE_H
+4 -11
View File
@@ -599,10 +599,6 @@ typedef struct {
/* 0x7 */ u8 spawnFlags; // See `CS_SPAWN_FLAG_`
} CutsceneScriptEntry; // size = 0x8
// ZAPD compatibility typedefs
// TODO: Remove when ZAPD adds support for them
typedef CutsceneScriptEntry CutsceneEntry;
typedef struct {
/* 0x00 */ u8 scriptListCount;
/* 0x04 */ CutsceneData* script;
@@ -631,13 +627,11 @@ typedef struct {
/* 0x0C */ s16 hudVisibility;
/* 0x0E */ u8 endCam;
/* 0x0F */ u8 letterboxSize;
} ActorCutscene; // size = 0x10
// TODO: rename `ActorCutscene` to `CutsceneEntry` once ZAPD uses `CutsceneScriptEntry`
// typedef CutsceneEntry ActorCutscene;
} CutsceneEntry; // size = 0x10
typedef enum {
/* -1 */ CS_ID_NONE = -1,
// CsId's 0 - 119 are sceneLayer-specific and index `ActorCutscene`
// CsId's 0 - 119 are sceneLayer-specific and index `CutsceneEntry`
/* 0x78 */ CS_ID_GLOBAL_78 = 120,
/* 0x79 */ CS_ID_GLOBAL_79,
/* 0x7A */ CS_ID_GLOBAL_7A,
@@ -760,7 +754,6 @@ typedef enum CutsceneCamRelativeTo {
/* 5 */ CS_CAM_REL_5
} CutsceneCamRelativeTo;
// Roll and Fov Data
typedef struct CsCmdCamMisc {
/* 0x0 */ s16 unused0; // used only in the unused interp function
@@ -827,7 +820,7 @@ s32 Cutscene_GetCueChannel(struct PlayState* play, u16 cueType);
s32 Cutscene_IsCueInChannel(struct PlayState* play, u16 cueType);
u8 Cutscene_IsPlaying(struct PlayState* play);
void CutsceneManager_Init(struct PlayState* play, ActorCutscene* cutsceneList, s16 numEntries);
void CutsceneManager_Init(struct PlayState* play, CutsceneEntry* cutsceneList, s16 numEntries);
void CutsceneManager_StoreCamera(Camera* camera);
void CutsceneManager_ClearWaiting(void);
s16 CutsceneManager_Update(void);
@@ -838,7 +831,7 @@ s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor);
s16 CutsceneManager_Start(s16 csId, Actor* actor);
s16 CutsceneManager_Stop(s16 csId);
s16 CutsceneManager_GetCurrentCsId(void);
ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId);
CutsceneEntry* CutsceneManager_GetCutsceneEntry(s16 csId);
s16 CutsceneManager_GetAdditionalCsId(s16 csId);
s16 CutsceneManager_GetLength(s16 csId);
s16 CutsceneManager_GetCutsceneScriptIndex(s16 csId);
-34
View File
@@ -665,40 +665,6 @@
*/
#define CS_END() { CMD_W(0xFFFFFFFF) }
// TODO: Fix ZAPD and delete these
#define CS_ACTOR_ACTION_LIST CS_ACTOR_CUE_LIST
#define CS_ACTOR_ACTION CS_ACTOR_CUE
#define CS_PLAYER_ACTION_LIST CS_PLAYER_CUE_LIST
#define CS_PLAYER_ACTION CS_PLAYER_CUE
#define CS_LIGHTING_LIST CS_LIGHT_SETTING_LIST
#define CS_CAMERA_LIST CS_CAM_SPLINE_LIST
#define CS_TEXT_DISPLAY_TEXTBOX CS_TEXT
#define CS_TEXT_LEARN_SONG CS_TEXT_OCARINA_ACTION
#define CS_SCENE_TRANS_FX_LIST CS_TRANSITION_LIST
#define CS_SCENE_TRANS_FX CS_TRANSITION
#define CS_GIVETATL_LIST CS_GIVE_TATL_LIST
#define CS_GIVETATL CS_GIVE_TATL
#define CS_PLAYSEQ_LIST CS_START_SEQ_LIST
#define CS_STOPSEQ_LIST CS_STOP_SEQ_LIST
#define CS_FADESEQ_LIST CS_FADE_OUT_SEQ_LIST
#define CS_FADESEQ CS_FADE_OUT_SEQ
#define CS_PLAYAMBIENCE_LIST CS_START_AMBIENCE_LIST
#define CS_PLAYAMBIENCE CS_START_AMBIENCE
#define CS_FADEAMBIENCE_LIST CS_FADE_OUT_AMBIENCE_LIST
#define CS_FADEAMBIENCE CS_FADE_OUT_AMBIENCE
#define CS_SCENE_UNK_130_LIST CS_SFX_REVERB_INDEX_2_LIST
#define CS_SCENE_UNK_130 CS_SFX_REVERB_INDEX_2
#define CS_SCENE_UNK_131_LIST CS_SFX_REVERB_INDEX_1_LIST
#define CS_SCENE_UNK_131 CS_SFX_REVERB_INDEX_1
#define CS_SCENE_UNK_132_LIST CS_MODIFY_SEQ_LIST
#define CS_SCENE_UNK_132 CS_MODIFY_SEQ
#define CS_MOTIONBLUR_LIST CS_MOTION_BLUR_LIST
#define CS_MOTIONBLUR CS_MOTION_BLUR
#define CS_FADESCREEN_LIST CS_TRANSITION_GENERAL_LIST
#define CS_FADESCREEN CS_TRANSITION_GENERAL
#define CS_TERMINATOR_LIST CS_DESTINATION_LIST
#define CS_TERMINATOR CS_DESTINATION
#define CS_PLAYSEQ(seqId, startFrame, endFrame) \
CS_START_SEQ((seqId)-1, startFrame, endFrame)
-12
View File
@@ -312,9 +312,6 @@ typedef union {
RoomShapeCullable cullable;
} RoomShape; // "Ground Shape"
// TODO: update ZAPD
#define SCENE_CMD_MESH SCENE_CMD_ROOM_SHAPE
// TODO: Check which ones don't exist
typedef enum {
/* 0 */ ROOM_BEHAVIOR_TYPE1_0,
@@ -468,10 +465,6 @@ typedef struct {
/* 0x4 */ void* params;
} AnimatedMaterial; // size = 0x8
// TODO: ZAPD
typedef RoomShapeCullableEntry PolygonDlist2;
typedef RoomShapeCullable PolygonType2;
#define OBJECT_SLOT_NONE -1
typedef struct {
@@ -522,8 +515,6 @@ typedef struct {
/* 0x4 */ Vec3s* actorCsCamFuncData; // s16 data grouped in threes
} ActorCsCamInfo; // size = 0x8
typedef ActorCsCamInfo CsCameraEntry; // TODO: Remove once ZAPD updates its structs
typedef union {
/* Command: N/A */ SCmdBase base;
/* Command: 0x00 */ SCmdSpawnList spawnList;
@@ -898,9 +889,6 @@ typedef enum {
#define SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(compassIconCount, compassIconInfo) \
{ SCENE_CMD_ID_MINIMAP_COMPASS_ICON_INFO, compassIconCount, CMD_PTR(compassIconInfo) }
// TODO: ZAPD Capatability
#define SCENE_CMD_MISC_SETTINGS SCENE_CMD_SET_REGION_VISITED
#define SCENE_CMD_CUTSCENE_LIST SCENE_CMD_CUTSCENE_SCRIPT_LIST
s32 Object_SpawnPersistent(ObjectContext* objectCtx, s16 id);
void Object_InitContext(struct GameState* gameState, ObjectContext* objectCtx);
-7
View File
@@ -48,13 +48,6 @@ typedef struct {
/* 0x8 */ Gfx* dlist;
} SkinAnimatedLimbData; // size = 0xC
// ZAPD compatibility typedefs
// TODO: Remove when ZAPD adds support for them
typedef SkinVertex Struct_800A57C0;
typedef SkinTransformation Struct_800A598C_2;
typedef SkinAnimatedLimbData Struct_800A5E28;
typedef SkinLimbModif Struct_800A598C;
#define SKIN_LIMB_TYPE_ANIMATED 4
#define SKIN_LIMB_TYPE_NORMAL 11
+1
View File
@@ -16,6 +16,7 @@
#include "slowly.h"
#include "stack.h"
#include "stackcheck.h"
#include "prevent_bss_reordering.h"
/**
* Assigns the "save" values in PreRender
+8 -8
View File
@@ -8,7 +8,7 @@
#include "z64shrink_window.h"
#include "libc/string.h"
ActorCutscene sGlobalCutsceneList[] = {
CutsceneEntry sGlobalCutsceneList[] = {
// CS_ID_GLOBAL_78
{ -100, -1, CS_CAM_ID_NONE, CS_SCRIPT_ID_NONE, CS_ID_NONE, CS_END_SFX_NONE_ALT, 255, CS_HUD_VISIBILITY_ALL_ALT, 255,
255 },
@@ -57,7 +57,7 @@ CutsceneManager sCutsceneMgr = {
CS_ID_NONE, 0, CS_ID_NONE, SUB_CAM_ID_DONE, NULL, CS_START_0, NULL, CAM_ID_MAIN, false,
};
ActorCutscene* sSceneCutsceneList;
CutsceneEntry* sSceneCutsceneList;
s16 sSceneCutsceneCount;
u8 sWaitingCutsceneList[16];
static s32 sBssPad;
@@ -110,7 +110,7 @@ s16 CutsceneManager_SetHudVisibility(s16 csHudVisibility) {
return hudVisibility;
}
ActorCutscene* CutsceneManager_GetCutsceneEntryImpl(s16 csId) {
CutsceneEntry* CutsceneManager_GetCutsceneEntryImpl(s16 csId) {
if (csId < CS_ID_GLOBAL_78) {
return &sSceneCutsceneList[csId];
} else {
@@ -119,7 +119,7 @@ ActorCutscene* CutsceneManager_GetCutsceneEntryImpl(s16 csId) {
}
}
void CutsceneManager_Init(PlayState* play, ActorCutscene* cutsceneList, s16 numEntries) {
void CutsceneManager_Init(PlayState* play, CutsceneEntry* cutsceneList, s16 numEntries) {
s32 i;
sSceneCutsceneList = cutsceneList;
@@ -204,7 +204,7 @@ s16 CutsceneManager_MarkNextCutscenes(void) {
#define CUR_CAM sCutsceneMgr.play->cameraPtrs[sCutsceneMgr.subCamId]
void CutsceneManager_End(void) {
ActorCutscene* csEntry;
CutsceneEntry* csEntry;
s16 oldCamId;
s16 oldStateFlags;
@@ -375,7 +375,7 @@ s16 CutsceneManager_StartWithPlayerCsAndSetFlag(s16 csId, Actor* actor) {
}
s16 CutsceneManager_Start(s16 csId, Actor* actor) {
ActorCutscene* csEntry;
CutsceneEntry* csEntry;
Camera* subCam;
Camera* retCam;
s32 csType = 0;
@@ -444,7 +444,7 @@ s16 CutsceneManager_Start(s16 csId, Actor* actor) {
}
s16 CutsceneManager_Stop(s16 csId) {
ActorCutscene* csEntry;
CutsceneEntry* csEntry;
if (csId <= CS_ID_NONE) {
return csId;
@@ -472,7 +472,7 @@ s16 CutsceneManager_GetCurrentCsId(void) {
return sCutsceneMgr.csId;
}
ActorCutscene* CutsceneManager_GetCutsceneEntry(s16 csId) {
CutsceneEntry* CutsceneManager_GetCutsceneEntry(s16 csId) {
return CutsceneManager_GetCutsceneEntryImpl(csId);
}
+2 -2
View File
@@ -2040,7 +2040,7 @@ s16 sPlayerCsIdToCsCamId[] = {
/**
* Extract the common cutscene ids used by Player from the scene and set the cutscene ids in this->playerCsIds.
* If a playerCsId is not present in the scene, then that particular id is set to CS_ID_NONE.
* Otherwise, if there is an ActorCutscene where csCamId matches the appropriate element of sPlayerCsIdToCsCamId,
* Otherwise, if there is an CutsceneEntry where csCamId matches the appropriate element of sPlayerCsIdToCsCamId,
* set the corresponding playerActorCsId (and possibly change its priority for the zeroth one).
*/
void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
@@ -2050,7 +2050,7 @@ void Play_AssignPlayerCsIdsFromScene(GameState* thisx, s32 spawnCsId) {
s16* csCamId = sPlayerCsIdToCsCamId;
for (i = 0; i < ARRAY_COUNT(this->playerCsIds); i++, curPlayerCsId++, csCamId++) {
ActorCutscene* csEntry;
CutsceneEntry* csEntry;
s32 curCsId;
*curPlayerCsId = CS_ID_NONE;
+1 -1
View File
@@ -809,7 +809,7 @@ void EnMa4_SetupBeginEponasSongCs(EnMa4* this) {
this->actionFunc = EnMa4_BeginEponasSongCs;
}
// Epona's Song cutscene is an ActorCutscene
// Epona's Song cutscene is an CutsceneEntry
void EnMa4_BeginEponasSongCs(EnMa4* this, PlayState* play) {
s16 csId = this->actor.csId;
@@ -329,7 +329,7 @@ void EnTest4_Init(Actor* thisx, PlayState* play) {
sCsIdList[THREEDAY_DAYTIME_NIGHT] = csId;
if (csId > CS_ID_NONE) {
ActorCutscene* csEntry = CutsceneManager_GetCutsceneEntry(sCsIdList[THREEDAY_DAYTIME_NIGHT]);
CutsceneEntry* csEntry = CutsceneManager_GetCutsceneEntry(sCsIdList[THREEDAY_DAYTIME_NIGHT]);
SET_EVENTINF(EVENTINF_HAS_DAYTIME_TRANSITION_CS);
sCsIdList[THREEDAY_DAYTIME_DAY] = csEntry->additionalCsId;
+2 -2
View File
@@ -6,7 +6,7 @@
[subrepo]
remote = https://github.com/zeldaret/ZAPD.git
branch = master
commit = 7f398831fbcf67210b37882b5017093a1d187d5c
parent = 71e36ae371f89b5f86a6d59c7ebc24b8a55ee43e
commit = 9601f2699c142bb8273d33763ef4d84e8a7d650f
parent = 3e1207d5e7818ab6676422cda10f206b180126db
method = merge
cmdver = 0.4.6
+1 -1
View File
@@ -290,7 +290,7 @@ void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter*
uint32_t oldOffset = writer->GetBaseAddress();
writer->Seek(baseStreamEnd, SeekOffsetType::Start);
for (EntranceEntry entry : cmdEntrance->entrances)
for (Spawn entry : cmdEntrance->entrances)
{
writer->Write((uint8_t)entry.startPositionIndex);
writer->Write((uint8_t)entry.roomToLoad);
+1 -1
View File
@@ -28,7 +28,7 @@ to install it via Homebrew.
#### Linux / *nix
ZAPD uses the clasic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
ZAPD uses the classic `Makefile` approach. To build just run `make` (or even better `make -j` for faster compilations).
You can configure a bit your ZAPD build with the following options:
+93
View File
@@ -165,6 +165,98 @@ void GameConfig::ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element)
externalFiles.push_back(ExternalFile(fs::path(xmlPathValue), fs::path(outPathValue)));
}
void GameConfig::ConfigFunc_EnumData(const tinyxml2::XMLElement& element)
{
std::string path = Path::GetDirectoryName(configFilePath).string();
path = path.append("/").append(element.Attribute("File"));
tinyxml2::XMLDocument doc;
tinyxml2::XMLError eResult = doc.LoadFile(path.c_str());
if (eResult != tinyxml2::XML_SUCCESS)
{
throw std::runtime_error("Error: Unable to read enum data.");
}
tinyxml2::XMLNode* root = doc.FirstChild();
if (root == nullptr)
return;
for (tinyxml2::XMLElement* csEnum = root->FirstChildElement(); csEnum != nullptr;
csEnum = csEnum->NextSiblingElement())
{
for (tinyxml2::XMLElement* item = csEnum->FirstChildElement(); item != nullptr;
item = item->NextSiblingElement())
{
std::string enumKey = csEnum->Attribute("Key");
uint16_t itemIndex = atoi(item->Attribute("Index"));
const char* itemID = item->Attribute("ID");
// Common
if (enumKey == "cmd")
enumData.cutsceneCmd[itemIndex] = itemID;
else if (enumKey == "miscType")
enumData.miscType[itemIndex] = itemID;
else if (enumKey == "textType")
enumData.textType[itemIndex] = itemID;
else if (enumKey == "fadeOutSeqPlayer")
enumData.fadeOutSeqPlayer[itemIndex] = itemID;
else if (enumKey == "transitionType")
enumData.transitionType[itemIndex] = itemID;
else if (enumKey == "destination")
enumData.destination[itemIndex] = itemID;
else if (enumKey == "naviQuestHintType")
enumData.naviQuestHintType[itemIndex] = itemID;
else if (enumKey == "ocarinaSongActionId")
enumData.ocarinaSongActionId[itemIndex] = itemID;
else if (enumKey == "seqId")
enumData.seqId[itemIndex] = itemID;
else if (enumKey == "playerCueId")
enumData.playerCueId[itemIndex] = itemID;
// MM
else if (enumKey == "modifySeqType")
enumData.modifySeqType[itemIndex] = itemID;
else if (enumKey == "chooseCreditsSceneType")
enumData.chooseCreditsSceneType[itemIndex] = itemID;
else if (enumKey == "destinationType")
enumData.destinationType[itemIndex] = itemID;
else if (enumKey == "motionBlurType")
enumData.motionBlurType[itemIndex] = itemID;
else if (enumKey == "transitionGeneralType")
enumData.transitionGeneralType[itemIndex] = itemID;
else if (enumKey == "rumbleType")
enumData.rumbleType[itemIndex] = itemID;
else if (enumKey == "spawnFlag")
enumData.spawnFlag[itemIndex] = itemID;
else if (enumKey == "endSfx")
enumData.endSfx[itemIndex] = itemID;
else if (enumKey == "csSplineInterpType")
enumData.interpType[itemIndex] = itemID;
else if (enumKey == "csSplineRelTo")
enumData.relTo[itemIndex] = itemID;
}
}
}
void GameConfig::ReadConfigFile(const fs::path& argConfigFilePath)
{
static const std::unordered_map<std::string, ConfigFunc> ConfigFuncDictionary = {
@@ -175,6 +267,7 @@ void GameConfig::ReadConfigFile(const fs::path& argConfigFilePath)
{"SpecialEntranceList", &GameConfig::ConfigFunc_specialEntranceList},
{"TexturePool", &GameConfig::ConfigFunc_TexturePool},
{"BGConfig", &GameConfig::ConfigFunc_BGConfig},
{"EnumData", &GameConfig::ConfigFunc_EnumData},
{"ExternalXMLFolder", &GameConfig::ConfigFunc_ExternalXMLFolder},
{"ExternalFile", &GameConfig::ConfigFunc_ExternalFile},
};
+33
View File
@@ -21,6 +21,37 @@ public:
ExternalFile(fs::path nXmlPath, fs::path nOutPath);
};
// Stores data from the XML file, the integer is the index (via ATOI) and the string is the value
class EnumData
{
public:
// Common
std::map<uint16_t, std::string> cutsceneCmd;
std::map<uint16_t, std::string> miscType;
std::map<uint16_t, std::string> fadeOutSeqPlayer;
std::map<uint16_t, std::string> transitionType;
std::map<uint16_t, std::string> naviQuestHintType;
std::map<uint16_t, std::string> ocarinaSongActionId;
std::map<uint16_t, std::string> seqId;
// OoT
std::map<uint16_t, std::string> textType;
std::map<uint16_t, std::string> destination;
std::map<uint16_t, std::string> playerCueId;
// MM
std::map<uint16_t, std::string> modifySeqType;
std::map<uint16_t, std::string> chooseCreditsSceneType;
std::map<uint16_t, std::string> destinationType;
std::map<uint16_t, std::string> motionBlurType;
std::map<uint16_t, std::string> transitionGeneralType;
std::map<uint16_t, std::string> rumbleType;
std::map<uint8_t, std::string> spawnFlag;
std::map<uint8_t, std::string> endSfx;
std::map<uint8_t, std::string> interpType;
std::map<uint16_t, std::string> relTo;
};
class ZFile;
class GameConfig
@@ -34,6 +65,7 @@ public:
std::vector<std::string> entranceList;
std::vector<std::string> specialEntranceList;
std::map<uint32_t, TexturePoolEntry> texturePool; // Key = CRC
EnumData enumData;
// ZBackground
uint32_t bgScreenWidth = 320, bgScreenHeight = 240;
@@ -59,6 +91,7 @@ public:
void ConfigFunc_BGConfig(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalXMLFolder(const tinyxml2::XMLElement& element);
void ConfigFunc_ExternalFile(const tinyxml2::XMLElement& element);
void ConfigFunc_EnumData(const tinyxml2::XMLElement& element);
void ReadConfigFile(const fs::path& configFilePath);
};
@@ -1,40 +1,48 @@
#include "CutsceneMM_Commands.h"
#include <cassert>
#include <unordered_map>
#include "Globals.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
#include "WarningHandler.h"
/**** GENERIC ****/
// Specific for command lists where each entry has size 8 bytes
const std::unordered_map<CutsceneMMCommands, CsCommandListDescriptor> csCommandsDescMM = {
{CutsceneMMCommands::CS_CMD_MISC, {"CS_MISC", "(0x%02X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_SET_LIGHTING, {"CS_LIGHTING", "(0x%02X, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_SCENE_TRANS_FX, {"CS_SCENE_TRANS_FX", "(%i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_MOTIONBLUR, {"CS_MOTIONBLUR", "(%i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_GIVETATL, {"CS_GIVETATL", "(%i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_PLAYSEQ, {"CS_PLAYSEQ", "(0x%04X, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_130, {"CS_SCENE_UNK_130", "(0x%04X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_131, {"CS_SCENE_UNK_131", "(0x%04X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_132, {"CS_SCENE_UNK_132", "(%i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_STOPSEQ, {"CS_STOPSEQ", "(0x%04X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_PLAYAMBIENCE, {"CS_PLAYAMBIENCE", "(0x%04X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_FADEAMBIENCE, {"CS_FADEAMBIENCE", "(0x%04X, %i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_TERMINATOR, {"CS_TERMINATOR", "(%i, %i, %i)"}},
{CutsceneMMCommands::CS_CMD_CHOOSE_CREDITS_SCENES,
{"CS_CHOOSE_CREDITS_SCENES", "(%i, %i, %i)"}},
const std::unordered_map<CutsceneMM_CommandType, CsCommandListDescriptor> csCommandsDescMM = {
{CutsceneMM_CommandType::CS_CMD_MISC, {"CS_MISC", "(%s, %i, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING, {"CS_LIGHT_SETTING", "(0x%02X, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_TRANSITION, {"CS_TRANSITION", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_MOTION_BLUR, {"CS_MOTION_BLUR", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_GIVE_TATL, {"CS_GIVE_TATL", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_START_SEQ, {"CS_START_SEQ", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_2,
{"CS_SFX_REVERB_INDEX_2", "(0x%04X, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_1,
{"CS_SFX_REVERB_INDEX_1", "(0x%04X, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ, {"CS_MODIFY_SEQ", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_STOP_SEQ, {"CS_STOP_SEQ", "(%s, %i, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_START_AMBIENCE, {"CS_START_AMBIENCE", "(0x%04X, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_FADE_OUT_AMBIENCE,
{"CS_FADE_OUT_AMBIENCE", "(0x%04X, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_DESTINATION, {"CS_DESTINATION", "(%s, %i, %i)"}},
{CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES,
{"CS_CHOOSE_CREDITS_SCENES", "(%s, %i, %i)"}},
};
CutsceneSubCommandEntry_GenericMMCmd::CutsceneSubCommandEntry_GenericMMCmd(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex, CutsceneMMCommands cmdId)
CutsceneMMSubCommandEntry_GenericCmd::CutsceneMMSubCommandEntry_GenericCmd(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex, CutsceneMM_CommandType cmdId)
: CutsceneSubCommandEntry(rawData, rawDataIndex), commandId(cmdId)
{
}
std::string CutsceneSubCommandEntry_GenericMMCmd::GetBodySourceCode() const
std::string CutsceneMMSubCommandEntry_GenericCmd::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
const auto& element = csCommandsDescMM.find(commandId);
std::string entryFmt = "CS_UNK_DATA(0x%02X, %i, %i, %i)";
std::string type = "";
bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end();
if (element != csCommandsDescMM.end())
{
@@ -42,12 +50,54 @@ std::string CutsceneSubCommandEntry_GenericMMCmd::GetBodySourceCode() const
entryFmt += element->second.args;
}
if (commandId == CutsceneMM_CommandType::CS_CMD_MISC &&
enumData->miscType.find(base) != enumData->miscType.end())
type = enumData->miscType[base];
else if (commandId == CutsceneMM_CommandType::CS_CMD_TRANSITION &&
enumData->transitionType.find(base) != enumData->transitionType.end())
type = enumData->transitionType[base];
else if (commandId == CutsceneMM_CommandType::CS_CMD_MOTION_BLUR &&
enumData->motionBlurType.find(base) != enumData->motionBlurType.end())
type = enumData->motionBlurType[base];
else if (commandId == CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ &&
enumData->modifySeqType.find(base) != enumData->modifySeqType.end())
type = enumData->modifySeqType[base];
else if (commandId == CutsceneMM_CommandType::CS_CMD_DESTINATION &&
enumData->destinationType.find(base) != enumData->destinationType.end())
type = enumData->destinationType[base];
else if (commandId == CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES &&
enumData->chooseCreditsSceneType.find(base) != enumData->chooseCreditsSceneType.end())
type = enumData->chooseCreditsSceneType[base];
else if ((commandId == CutsceneMM_CommandType::CS_CMD_START_SEQ ||
commandId == CutsceneMM_CommandType::CS_CMD_STOP_SEQ) &&
isIndexInSeqId)
type = enumData->seqId[base - 1];
else if (commandId == CutsceneMM_CommandType::CS_CMD_GIVE_TATL)
type = base ? "true" : "false";
if (type != "")
return StringHelper::Sprintf(entryFmt.c_str(), type.c_str(), startFrame, endFrame, pad);
if (commandId == CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING ||
commandId == CutsceneMM_CommandType::CS_CMD_START_SEQ ||
commandId == CutsceneMM_CommandType::CS_CMD_STOP_SEQ)
{
return StringHelper::Sprintf(entryFmt.c_str(), base - 1, startFrame, endFrame, pad);
}
return StringHelper::Sprintf(entryFmt.c_str(), base, startFrame, endFrame, pad);
}
CutsceneMMCommand_GenericCmd::CutsceneMMCommand_GenericCmd(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex,
CutsceneMMCommands cmdId)
CutsceneMM_CommandType cmdId)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
@@ -57,7 +107,7 @@ CutsceneMMCommand_GenericCmd::CutsceneMMCommand_GenericCmd(const std::vector<uin
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_GenericMMCmd(rawData, rawDataIndex, cmdId);
auto* entry = new CutsceneMMSubCommandEntry_GenericCmd(rawData, rawDataIndex, cmdId);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
@@ -65,7 +115,7 @@ CutsceneMMCommand_GenericCmd::CutsceneMMCommand_GenericCmd(const std::vector<uin
std::string CutsceneMMCommand_GenericCmd::GetCommandMacro() const
{
const auto& element = csCommandsDescMM.find(static_cast<CutsceneMMCommands>(commandID));
const auto& element = csCommandsDescMM.find(static_cast<CutsceneMM_CommandType>(commandID));
if (element != csCommandsDescMM.end())
{
@@ -75,43 +125,157 @@ std::string CutsceneMMCommand_GenericCmd::GetCommandMacro() const
return StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%X, %i)", commandID, numEntries);
}
CutsceneSubCommandEntry_Camera::CutsceneSubCommandEntry_Camera(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
/**** CAMERA ****/
CutsceneSubCommandEntry_SplineCamPoint::CutsceneSubCommandEntry_SplineCamPoint(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex): CutsceneSubCommandEntry(rawData, rawDataIndex)
{
interpType = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0);
weight = BitConverter::ToUInt8BE(rawData, rawDataIndex + 1);
duration = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
posX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
posY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
posZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 8);
relTo = BitConverter::ToUInt16BE(rawData, rawDataIndex + 10);
}
std::string CutsceneSubCommandEntry_Camera::GetBodySourceCode() const
std::string CutsceneSubCommandEntry_SplineCamPoint::GetBodySourceCode() const
{
return StringHelper::Sprintf("CMD_HH(0x%04X, 0x%04X)", base, startFrame);
const auto interpTypeMap = &Globals::Instance->cfg.enumData.interpType;
const auto relToMap = &Globals::Instance->cfg.enumData.relTo;
return StringHelper::Sprintf("CS_CAM_POINT(%s, 0x%02X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, %s)", interpTypeMap->at(interpType).c_str(), weight, duration, posX, posY, posZ, relToMap->at(relTo).c_str());
}
size_t CutsceneSubCommandEntry_Camera::GetRawSize() const
size_t CutsceneSubCommandEntry_SplineCamPoint::GetRawSize() const
{
return 0x0C;
}
CutsceneSubCommandEntry_SplineMiscPoint::CutsceneSubCommandEntry_SplineMiscPoint(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex): CutsceneSubCommandEntry(rawData, rawDataIndex)
{
unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
roll = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
fov = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unused1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
}
std::string CutsceneSubCommandEntry_SplineMiscPoint::GetBodySourceCode() const
{
return StringHelper::Sprintf("CS_CAM_MISC(0x%04X, 0x%04X, 0x%04X, 0x%04X)", unused0, roll, fov, unused1);
}
size_t CutsceneSubCommandEntry_SplineMiscPoint::GetRawSize() const
{
return 0x08;
}
CutsceneSubCommandEntry_SplineHeader::CutsceneSubCommandEntry_SplineHeader(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex): CutsceneSubCommandEntry(rawData, rawDataIndex)
{
numEntries = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
unused0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
unused1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
duration = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
}
std::string CutsceneSubCommandEntry_SplineHeader::GetBodySourceCode() const
{
return StringHelper::Sprintf("CS_CAM_SPLINE(0x%04X, 0x%04X, 0x%04X, 0x%04X)", numEntries, unused0, unused1, duration);
}
size_t CutsceneSubCommandEntry_SplineHeader::GetRawSize() const
{
return 0x08;
}
CutsceneSubCommandEntry_SplineFooter::CutsceneSubCommandEntry_SplineFooter(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex): CutsceneSubCommandEntry(rawData, rawDataIndex)
{
uint16_t firstHalfWord = BitConverter::ToUInt16BE(rawData, rawDataIndex);
uint16_t secondHalfWord = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
if (firstHalfWord != 0xFFFF || secondHalfWord != 4) {
HANDLE_ERROR(WarningType::InvalidExtractedData, "Invalid Spline Footer",
StringHelper::Sprintf("Invalid Spline footer. Was expecting 0xFFFF, 0x0004. Got 0x%04X, 0x%04X",
firstHalfWord, secondHalfWord));
}
}
std::string CutsceneSubCommandEntry_SplineFooter::GetBodySourceCode() const
{
return "CS_CAM_END()";
}
size_t CutsceneSubCommandEntry_SplineFooter::GetRawSize() const
{
return 0x04;
}
CutsceneMMCommand_Camera::CutsceneMMCommand_Camera(const std::vector<uint8_t>& rawData,
CutsceneMMCommand_Spline::CutsceneMMCommand_Spline(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
numHeaders = 0;
totalCommands = 0;
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries / 4; i++)
{
auto* entry = new CutsceneSubCommandEntry_Camera(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
while(1) {
if (BitConverter::ToUInt16BE(rawData, rawDataIndex) == 0xFFFF) {
break;
}
numHeaders++;
auto* header = new CutsceneSubCommandEntry_SplineHeader(rawData, rawDataIndex);
rawDataIndex += header->GetRawSize();
entries.push_back(header);
totalCommands += header->numEntries;
for (uint32_t i = 0; i < header->numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_SplineCamPoint(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
for (uint32_t i = 0; i < header->numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_SplineCamPoint(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
for (uint32_t i = 0; i < header->numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_SplineMiscPoint(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
auto* footer = new CutsceneSubCommandEntry_SplineFooter(rawData, rawDataIndex);
entries.push_back(footer);
rawDataIndex += footer->GetRawSize();
}
std::string CutsceneMMCommand_Camera::GetCommandMacro() const
std::string CutsceneMMCommand_Spline::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_CAMERA_LIST(%i)", numEntries);
return StringHelper::Sprintf("CS_CAM_SPLINE_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_FadeScreen::CutsceneSubCommandEntry_FadeScreen(
size_t CutsceneMMCommand_Spline::GetCommandSize() const
{
// 8 Bytes once for the spline command, 8 Bytes per spline the header, two groups of size 12, 1 group of size 8, 4 bytes for the footer.
return 8 + (8 * numHeaders) + ((totalCommands * 2) * 0xC) + (totalCommands * 8) + 4;
}
/**** TRANSITION GENERAL ****/
CutsceneSubCommandEntry_TransitionGeneral::CutsceneSubCommandEntry_TransitionGeneral(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
@@ -123,18 +287,71 @@ CutsceneSubCommandEntry_FadeScreen::CutsceneSubCommandEntry_FadeScreen(
unk_0B = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0B);
}
std::string CutsceneSubCommandEntry_FadeScreen::GetBodySourceCode() const
std::string CutsceneSubCommandEntry_TransitionGeneral::GetBodySourceCode() const
{
return StringHelper::Sprintf("CS_FADESCREEN(0x%02X, %i, %i, %i, %i, %i)", base, startFrame,
endFrame, unk_06, unk_07, unk_08);
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->transitionGeneralType.find(base) != enumData->transitionGeneralType.end())
return StringHelper::Sprintf("CS_TRANSITION_GENERAL(%s, %i, %i, %i, %i, %i)",
enumData->transitionGeneralType[base].c_str(), startFrame,
endFrame, unk_06, unk_07, unk_08);
return StringHelper::Sprintf("CS_TRANSITION_GENERAL(0x%02X, %i, %i, %i, %i, %i)", base,
startFrame, endFrame, unk_06, unk_07, unk_08);
}
size_t CutsceneSubCommandEntry_FadeScreen::GetRawSize() const
size_t CutsceneSubCommandEntry_TransitionGeneral::GetRawSize() const
{
return 0x0C;
}
CutsceneMMCommand_FadeScreen::CutsceneMMCommand_FadeScreen(const std::vector<uint8_t>& rawData,
CutsceneMMCommand_TransitionGeneral::CutsceneMMCommand_TransitionGeneral(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_TransitionGeneral(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_TransitionGeneral::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TRANSITION_GENERAL_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_FadeOutSeq::CutsceneSubCommandEntry_FadeOutSeq(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
unk_08 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
}
/**** FADE OUT SEQUENCE ****/
std::string CutsceneSubCommandEntry_FadeOutSeq::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->fadeOutSeqPlayer.find(base) != enumData->fadeOutSeqPlayer.end())
return StringHelper::Sprintf("CS_FADE_OUT_SEQ(%s, %i, %i)",
enumData->fadeOutSeqPlayer[base].c_str(), startFrame,
endFrame);
return StringHelper::Sprintf("CS_FADE_OUT_SEQ(%i, %i, %i)", base, startFrame, endFrame);
}
size_t CutsceneSubCommandEntry_FadeOutSeq::GetRawSize() const
{
return 0x0C;
}
CutsceneMMCommand_FadeOutSeq::CutsceneMMCommand_FadeOutSeq(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
@@ -143,53 +360,18 @@ CutsceneMMCommand_FadeScreen::CutsceneMMCommand_FadeScreen(const std::vector<uin
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_FadeScreen(rawData, rawDataIndex);
auto* entry = new CutsceneSubCommandEntry_FadeOutSeq(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_FadeScreen::GetCommandMacro() const
std::string CutsceneMMCommand_FadeOutSeq::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_FADESCREEN_LIST(%i)", numEntries);
return StringHelper::Sprintf("CS_FADE_OUT_SEQ_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_FadeSeq::CutsceneSubCommandEntry_FadeSeq(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
unk_08 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
}
std::string CutsceneSubCommandEntry_FadeSeq::GetBodySourceCode() const
{
return StringHelper::Sprintf("CS_FADESEQ(%i, %i, %i)", base, startFrame, endFrame);
}
size_t CutsceneSubCommandEntry_FadeSeq::GetRawSize() const
{
return 0x0C;
}
CutsceneMMCommand_FadeSeq::CutsceneMMCommand_FadeSeq(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_FadeSeq(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_FadeSeq::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_FADESEQ_LIST(%i)", numEntries);
}
/**** NON IMPLEMENTED ****/
CutsceneSubCommandEntry_NonImplemented::CutsceneSubCommandEntry_NonImplemented(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
@@ -211,3 +393,210 @@ CutsceneMMCommand_NonImplemented::CutsceneMMCommand_NonImplemented(
rawDataIndex += entry->GetRawSize();
}
}
/**** RUMBLE ****/
CutsceneMMSubCommandEntry_Rumble::CutsceneMMSubCommandEntry_Rumble(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
intensity = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06);
decayTimer = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07);
decayStep = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08);
}
std::string CutsceneMMSubCommandEntry_Rumble::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->rumbleType.find(base) != enumData->rumbleType.end())
return StringHelper::Sprintf("CS_RUMBLE(%s, %i, %i, 0x%02X, 0x%02X, 0x%02X)",
enumData->rumbleType[base].c_str(), startFrame, endFrame,
intensity, decayTimer, decayStep);
return StringHelper::Sprintf("CS_RUMBLE(0x%04X, %i, %i, 0x%02X, 0x%02X, 0x%02X)", base,
startFrame, endFrame, intensity, decayTimer, decayStep);
}
size_t CutsceneMMSubCommandEntry_Rumble::GetRawSize() const
{
return 0x0C;
}
CutsceneMMCommand_Rumble::CutsceneMMCommand_Rumble(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneMMSubCommandEntry_Rumble(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_Rumble::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_RUMBLE_LIST(%i)", numEntries);
}
/**** TEXT ****/
CutsceneMMSubCommandEntry_Text::CutsceneMMSubCommandEntry_Text(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
textId1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
textId2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
}
std::string CutsceneMMSubCommandEntry_Text::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (type == 0xFFFF)
{
return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame);
}
if (type == 2 &&
enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end())
{
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)",
enumData->ocarinaSongActionId[base].c_str(), startFrame,
endFrame, textId1);
}
switch (type)
{
case 0:
return StringHelper::Sprintf("CS_TEXT_DEFAULT(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame,
endFrame, textId1, textId2);
case 1:
return StringHelper::Sprintf("CS_TEXT_TYPE_1(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame,
endFrame, textId1, textId2);
case 3:
return StringHelper::Sprintf("CS_TEXT_TYPE_3(0x%X, %i, %i, 0x%X, 0x%X)", base, startFrame,
endFrame, textId1, textId2);
case 4:
return StringHelper::Sprintf("CS_TEXT_BOSSES_REMAINS(0x%X, %i, %i, 0x%X)", base, startFrame,
endFrame, textId1);
case 5:
return StringHelper::Sprintf("CS_TEXT_ALL_NORMAL_MASKS(0x%X, %i, %i, 0x%X)", base,
startFrame, endFrame, textId1);
}
return nullptr;
}
size_t CutsceneMMSubCommandEntry_Text::GetRawSize() const
{
return 0x0C;
}
CutsceneMMCommand_Text::CutsceneMMCommand_Text(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneMMSubCommandEntry_Text(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_Text::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TEXT_LIST(%i)", numEntries);
}
/**** ACTOR CUE ****/
CutsceneMMSubCommandEntry_ActorCue::CutsceneMMSubCommandEntry_ActorCue(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0xC);
startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x10);
startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x14);
endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x18);
endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x1C);
endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x20);
normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x24);
normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x28);
normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x2C);
}
std::string CutsceneMMSubCommandEntry_ActorCue::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (static_cast<CutsceneMM_CommandType>(commandID) == CutsceneMM_CommandType::CS_CMD_PLAYER_CUE)
{
return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
enumData->playerCueId[base].c_str(), startFrame, endFrame,
rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX,
endPosY, endPosZ, normalX, normalY, normalZ);
}
else
{
return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX,
startPosY, startPosZ, endPosX, endPosY, endPosZ, normalX,
normalY, normalZ);
}
}
size_t CutsceneMMSubCommandEntry_ActorCue::GetRawSize() const
{
return 0x30;
}
CutsceneMMCommand_ActorCue::CutsceneMMCommand_ActorCue(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneMMSubCommandEntry_ActorCue(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneMMCommand_ActorCue::GetCommandMacro() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (static_cast<CutsceneMM_CommandType>(commandID) == CutsceneMM_CommandType::CS_CMD_PLAYER_CUE)
{
return StringHelper::Sprintf("CS_PLAYER_CUE_LIST(%i)", numEntries);
}
if (enumData->cutsceneCmd.find(commandID) != enumData->cutsceneCmd.end())
{
return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(%s, %i)",
enumData->cutsceneCmd[commandID].c_str(), numEntries);
}
return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(0x%03X, %i)", commandID, numEntries);
}
@@ -1,51 +1,256 @@
#pragma once
#include "Cutscene_Commands.h"
#include "Cutscene_Common.h"
enum class CutsceneMMCommands
// https://github.com/zeldaret/mm/blob/0c7b90cf97f26483c8b6a98ae099a295f61e72ab/include/z64cutscene.h#L294-530
enum class CutsceneMM_CommandType
{
/* 0x00A */ CS_CMD_TEXTBOX = 0xA,
/* 0x05A */ CS_CMD_CAMERA = 0x5A,
/* 0x096 */ CS_CMD_MISC = 0x96,
/* 0x097 */ CS_CMD_SET_LIGHTING,
/* 0x098 */ CS_CMD_SCENE_TRANS_FX,
/* 0x099 */ CS_CMD_MOTIONBLUR,
/* 0x09A */ CS_CMD_GIVETATL,
/* 0x09B */ CS_CMD_FADESCREEN,
/* 0x09C */ CS_CMD_FADESEQ,
/* 0x09D */ CS_CMD_SETTIME,
/* 0x0C8 */ CS_CMD_SET_PLAYER_ACTION = 0xC8,
/* 0x0FA */ CS_CMD_UNK_FA = 0xFA,
/* 0x0FE */ CS_CMD_UNK_FE = 0xFE,
/* 0x0FF */ CS_CMD_UNK_FF,
/* 0x100 */ CS_CMD_UNK_100,
/* 0x101 */ CS_CMD_UNK_101,
/* 0x102 */ CS_CMD_UNK_102,
/* 0x103 */ CS_CMD_UNK_103,
/* 0x104 */ CS_CMD_UNK_104,
/* 0x105 */ CS_CMD_UNK_105,
/* 0x108 */ CS_CMD_UNK_108 = 0x108,
/* 0x109 */ CS_CMD_UNK_109,
/* 0x12C */ CS_CMD_PLAYSEQ = 0x12C,
/* 0x12D */ CS_CMD_UNK_12D,
/* 0x130 */ CS_CMD_130 = 0x130,
/* 0x131 */ CS_CMD_131 = 0x131,
/* 0x132 */ CS_CMD_132 = 0x132,
/* 0x133 */ CS_CMD_STOPSEQ,
/* 0x134 */ CS_CMD_PLAYAMBIENCE,
/* 0x135 */ CS_CMD_FADEAMBIENCE,
/* 0x15E */ CS_CMD_TERMINATOR = 0x15E,
/* -2 */ CS_CMD_ACTOR_CUE_POST_PROCESS = -2,
/* -1 */ CS_CAM_STOP,
/* 0x00A */ CS_CMD_TEXT = 10,
/* 0x05A */ CS_CMD_CAMERA_SPLINE = 90,
/* 0x064 */ CS_CMD_ACTOR_CUE_100 = 100,
/* 0x065 */ CS_CMD_ACTOR_CUE_101,
/* 0x066 */ CS_CMD_ACTOR_CUE_102,
/* 0x067 */ CS_CMD_ACTOR_CUE_103,
/* 0x068 */ CS_CMD_ACTOR_CUE_104,
/* 0x069 */ CS_CMD_ACTOR_CUE_105,
/* 0x06A */ CS_CMD_ACTOR_CUE_106,
/* 0x06B */ CS_CMD_ACTOR_CUE_107,
/* 0x06C */ CS_CMD_ACTOR_CUE_108,
/* 0x06D */ CS_CMD_ACTOR_CUE_109,
/* 0x06E */ CS_CMD_ACTOR_CUE_110,
/* 0x06F */ CS_CMD_ACTOR_CUE_111,
/* 0x070 */ CS_CMD_ACTOR_CUE_112,
/* 0x071 */ CS_CMD_ACTOR_CUE_113,
/* 0x072 */ CS_CMD_ACTOR_CUE_114,
/* 0x073 */ CS_CMD_ACTOR_CUE_115,
/* 0x074 */ CS_CMD_ACTOR_CUE_116,
/* 0x075 */ CS_CMD_ACTOR_CUE_117,
/* 0x076 */ CS_CMD_ACTOR_CUE_118,
/* 0x077 */ CS_CMD_ACTOR_CUE_119,
/* 0x078 */ CS_CMD_ACTOR_CUE_120,
/* 0x079 */ CS_CMD_ACTOR_CUE_121,
/* 0x07A */ CS_CMD_ACTOR_CUE_122,
/* 0x07B */ CS_CMD_ACTOR_CUE_123,
/* 0x07C */ CS_CMD_ACTOR_CUE_124,
/* 0x07D */ CS_CMD_ACTOR_CUE_125,
/* 0x07E */ CS_CMD_ACTOR_CUE_126,
/* 0x07F */ CS_CMD_ACTOR_CUE_127,
/* 0x080 */ CS_CMD_ACTOR_CUE_128,
/* 0x081 */ CS_CMD_ACTOR_CUE_129,
/* 0x082 */ CS_CMD_ACTOR_CUE_130,
/* 0x083 */ CS_CMD_ACTOR_CUE_131,
/* 0x084 */ CS_CMD_ACTOR_CUE_132,
/* 0x085 */ CS_CMD_ACTOR_CUE_133,
/* 0x086 */ CS_CMD_ACTOR_CUE_134,
/* 0x087 */ CS_CMD_ACTOR_CUE_135,
/* 0x088 */ CS_CMD_ACTOR_CUE_136,
/* 0x089 */ CS_CMD_ACTOR_CUE_137,
/* 0x08A */ CS_CMD_ACTOR_CUE_138,
/* 0x08B */ CS_CMD_ACTOR_CUE_139,
/* 0x08C */ CS_CMD_ACTOR_CUE_140,
/* 0x08D */ CS_CMD_ACTOR_CUE_141,
/* 0x08E */ CS_CMD_ACTOR_CUE_142,
/* 0x08F */ CS_CMD_ACTOR_CUE_143,
/* 0x090 */ CS_CMD_ACTOR_CUE_144,
/* 0x091 */ CS_CMD_ACTOR_CUE_145,
/* 0x092 */ CS_CMD_ACTOR_CUE_146,
/* 0x093 */ CS_CMD_ACTOR_CUE_147,
/* 0x094 */ CS_CMD_ACTOR_CUE_148,
/* 0x095 */ CS_CMD_ACTOR_CUE_149,
/* 0x096 */ CS_CMD_MISC,
/* 0x097 */ CS_CMD_LIGHT_SETTING,
/* 0x098 */ CS_CMD_TRANSITION,
/* 0x099 */ CS_CMD_MOTION_BLUR,
/* 0x09A */ CS_CMD_GIVE_TATL,
/* 0x09B */ CS_CMD_TRANSITION_GENERAL,
/* 0x09C */ CS_CMD_FADE_OUT_SEQ,
/* 0x09D */ CS_CMD_TIME,
/* 0x0C8 */ CS_CMD_PLAYER_CUE = 200,
/* 0x0C9 */ CS_CMD_ACTOR_CUE_201,
/* 0x0FA */ CS_CMD_UNK_DATA_FA = 0xFA,
/* 0x0FE */ CS_CMD_UNK_DATA_FE = 0xFE,
/* 0x0FF */ CS_CMD_UNK_DATA_FF,
/* 0x100 */ CS_CMD_UNK_DATA_100,
/* 0x101 */ CS_CMD_UNK_DATA_101,
/* 0x102 */ CS_CMD_UNK_DATA_102,
/* 0x103 */ CS_CMD_UNK_DATA_103,
/* 0x104 */ CS_CMD_UNK_DATA_104,
/* 0x105 */ CS_CMD_UNK_DATA_105,
/* 0x108 */ CS_CMD_UNK_DATA_108 = 0x108,
/* 0x109 */ CS_CMD_UNK_DATA_109,
/* 0x12C */ CS_CMD_START_SEQ = 300,
/* 0x12D */ CS_CMD_STOP_SEQ,
/* 0x12E */ CS_CMD_START_AMBIENCE,
/* 0x12F */ CS_CMD_FADE_OUT_AMBIENCE,
/* 0x130 */ CS_CMD_SFX_REVERB_INDEX_2,
/* 0x131 */ CS_CMD_SFX_REVERB_INDEX_1,
/* 0x132 */ CS_CMD_MODIFY_SEQ,
/* 0x15E */ CS_CMD_DESTINATION = 350,
/* 0x15F */ CS_CMD_CHOOSE_CREDITS_SCENES,
/* 0x190 */ CS_CMD_RUMBLE = 0x190,
/* 0x190 */ CS_CMD_RUMBLE = 400,
/* 0x1C2 */ CS_CMD_ACTOR_CUE_450 = 450,
/* 0x1C3 */ CS_CMD_ACTOR_CUE_451,
/* 0x1C4 */ CS_CMD_ACTOR_CUE_452,
/* 0x1C5 */ CS_CMD_ACTOR_CUE_453,
/* 0x1C6 */ CS_CMD_ACTOR_CUE_454,
/* 0x1C7 */ CS_CMD_ACTOR_CUE_455,
/* 0x1C8 */ CS_CMD_ACTOR_CUE_456,
/* 0x1C9 */ CS_CMD_ACTOR_CUE_457,
/* 0x1CA */ CS_CMD_ACTOR_CUE_458,
/* 0x1CB */ CS_CMD_ACTOR_CUE_459,
/* 0x1CC */ CS_CMD_ACTOR_CUE_460,
/* 0x1CD */ CS_CMD_ACTOR_CUE_461,
/* 0x1CE */ CS_CMD_ACTOR_CUE_462,
/* 0x1CF */ CS_CMD_ACTOR_CUE_463,
/* 0x1D0 */ CS_CMD_ACTOR_CUE_464,
/* 0x1D1 */ CS_CMD_ACTOR_CUE_465,
/* 0x1D2 */ CS_CMD_ACTOR_CUE_466,
/* 0x1D3 */ CS_CMD_ACTOR_CUE_467,
/* 0x1D4 */ CS_CMD_ACTOR_CUE_468,
/* 0x1D5 */ CS_CMD_ACTOR_CUE_469,
/* 0x1D6 */ CS_CMD_ACTOR_CUE_470,
/* 0x1D7 */ CS_CMD_ACTOR_CUE_471,
/* 0x1D8 */ CS_CMD_ACTOR_CUE_472,
/* 0x1D9 */ CS_CMD_ACTOR_CUE_473,
/* 0x1DA */ CS_CMD_ACTOR_CUE_474,
/* 0x1DB */ CS_CMD_ACTOR_CUE_475,
/* 0x1DC */ CS_CMD_ACTOR_CUE_476,
/* 0x1DD */ CS_CMD_ACTOR_CUE_477,
/* 0x1DE */ CS_CMD_ACTOR_CUE_478,
/* 0x1DF */ CS_CMD_ACTOR_CUE_479,
/* 0x1E0 */ CS_CMD_ACTOR_CUE_480,
/* 0x1E1 */ CS_CMD_ACTOR_CUE_481,
/* 0x1E2 */ CS_CMD_ACTOR_CUE_482,
/* 0x1E3 */ CS_CMD_ACTOR_CUE_483,
/* 0x1E4 */ CS_CMD_ACTOR_CUE_484,
/* 0x1E5 */ CS_CMD_ACTOR_CUE_485,
/* 0x1E6 */ CS_CMD_ACTOR_CUE_486,
/* 0x1E7 */ CS_CMD_ACTOR_CUE_487,
/* 0x1E8 */ CS_CMD_ACTOR_CUE_488,
/* 0x1E9 */ CS_CMD_ACTOR_CUE_489,
/* 0x1EA */ CS_CMD_ACTOR_CUE_490,
/* 0x1EB */ CS_CMD_ACTOR_CUE_491,
/* 0x1EC */ CS_CMD_ACTOR_CUE_492,
/* 0x1ED */ CS_CMD_ACTOR_CUE_493,
/* 0x1EE */ CS_CMD_ACTOR_CUE_494,
/* 0x1EF */ CS_CMD_ACTOR_CUE_495,
/* 0x1F0 */ CS_CMD_ACTOR_CUE_496,
/* 0x1F1 */ CS_CMD_ACTOR_CUE_497,
/* 0x1F2 */ CS_CMD_ACTOR_CUE_498,
/* 0x1F3 */ CS_CMD_ACTOR_CUE_499,
/* 0x1F4 */ CS_CMD_ACTOR_CUE_500,
/* 0x1F5 */ CS_CMD_ACTOR_CUE_501,
/* 0x1F6 */ CS_CMD_ACTOR_CUE_502,
/* 0x1F7 */ CS_CMD_ACTOR_CUE_503,
/* 0x1F8 */ CS_CMD_ACTOR_CUE_504,
/* 0x1F9 */ CS_CMD_ACTOR_CUE_SOTCS,
/* 0x1FA */ CS_CMD_ACTOR_CUE_506,
/* 0x1FB */ CS_CMD_ACTOR_CUE_507,
/* 0x1FC */ CS_CMD_ACTOR_CUE_508,
/* 0x1FD */ CS_CMD_ACTOR_CUE_509,
/* 0x1FE */ CS_CMD_ACTOR_CUE_510,
/* 0x1FF */ CS_CMD_ACTOR_CUE_511,
/* 0x200 */ CS_CMD_ACTOR_CUE_512,
/* 0x201 */ CS_CMD_ACTOR_CUE_513,
/* 0x202 */ CS_CMD_ACTOR_CUE_514,
/* 0x203 */ CS_CMD_ACTOR_CUE_515,
/* 0x204 */ CS_CMD_ACTOR_CUE_516,
/* 0x205 */ CS_CMD_ACTOR_CUE_517,
/* 0x206 */ CS_CMD_ACTOR_CUE_518,
/* 0x207 */ CS_CMD_ACTOR_CUE_519,
/* 0x208 */ CS_CMD_ACTOR_CUE_520,
/* 0x209 */ CS_CMD_ACTOR_CUE_521,
/* 0x20A */ CS_CMD_ACTOR_CUE_522,
/* 0x20B */ CS_CMD_ACTOR_CUE_523,
/* 0x20C */ CS_CMD_ACTOR_CUE_524,
/* 0x20D */ CS_CMD_ACTOR_CUE_525,
/* 0x20E */ CS_CMD_ACTOR_CUE_526,
/* 0x20F */ CS_CMD_ACTOR_CUE_527,
/* 0x210 */ CS_CMD_ACTOR_CUE_528,
/* 0x211 */ CS_CMD_ACTOR_CUE_529,
/* 0x212 */ CS_CMD_ACTOR_CUE_530,
/* 0x213 */ CS_CMD_ACTOR_CUE_531,
/* 0x214 */ CS_CMD_ACTOR_CUE_532,
/* 0x215 */ CS_CMD_ACTOR_CUE_533,
/* 0x216 */ CS_CMD_ACTOR_CUE_534,
/* 0x217 */ CS_CMD_ACTOR_CUE_535,
/* 0x218 */ CS_CMD_ACTOR_CUE_536,
/* 0x219 */ CS_CMD_ACTOR_CUE_537,
/* 0x21A */ CS_CMD_ACTOR_CUE_538,
/* 0x21B */ CS_CMD_ACTOR_CUE_539,
/* 0x21C */ CS_CMD_ACTOR_CUE_540,
/* 0x21D */ CS_CMD_ACTOR_CUE_541,
/* 0x21E */ CS_CMD_ACTOR_CUE_542,
/* 0x21F */ CS_CMD_ACTOR_CUE_543,
/* 0x220 */ CS_CMD_ACTOR_CUE_544,
/* 0x221 */ CS_CMD_ACTOR_CUE_545,
/* 0x222 */ CS_CMD_ACTOR_CUE_546,
/* 0x223 */ CS_CMD_ACTOR_CUE_547,
/* 0x224 */ CS_CMD_ACTOR_CUE_548,
/* 0x225 */ CS_CMD_ACTOR_CUE_549,
/* 0x226 */ CS_CMD_ACTOR_CUE_550,
/* 0x227 */ CS_CMD_ACTOR_CUE_551,
/* 0x228 */ CS_CMD_ACTOR_CUE_552,
/* 0x229 */ CS_CMD_ACTOR_CUE_553,
/* 0x22A */ CS_CMD_ACTOR_CUE_554,
/* 0x22B */ CS_CMD_ACTOR_CUE_555,
/* 0x22C */ CS_CMD_ACTOR_CUE_556,
/* 0x22D */ CS_CMD_ACTOR_CUE_557,
/* 0x22E */ CS_CMD_ACTOR_CUE_558,
/* 0x22F */ CS_CMD_ACTOR_CUE_559,
/* 0x230 */ CS_CMD_ACTOR_CUE_560,
/* 0x231 */ CS_CMD_ACTOR_CUE_561,
/* 0x232 */ CS_CMD_ACTOR_CUE_562,
/* 0x233 */ CS_CMD_ACTOR_CUE_563,
/* 0x234 */ CS_CMD_ACTOR_CUE_564,
/* 0x235 */ CS_CMD_ACTOR_CUE_565,
/* 0x236 */ CS_CMD_ACTOR_CUE_566,
/* 0x237 */ CS_CMD_ACTOR_CUE_567,
/* 0x238 */ CS_CMD_ACTOR_CUE_568,
/* 0x239 */ CS_CMD_ACTOR_CUE_569,
/* 0x23A */ CS_CMD_ACTOR_CUE_570,
/* 0x23B */ CS_CMD_ACTOR_CUE_571,
/* 0x23C */ CS_CMD_ACTOR_CUE_572,
/* 0x23D */ CS_CMD_ACTOR_CUE_573,
/* 0x23E */ CS_CMD_ACTOR_CUE_574,
/* 0x23F */ CS_CMD_ACTOR_CUE_575,
/* 0x240 */ CS_CMD_ACTOR_CUE_576,
/* 0x241 */ CS_CMD_ACTOR_CUE_577,
/* 0x242 */ CS_CMD_ACTOR_CUE_578,
/* 0x243 */ CS_CMD_ACTOR_CUE_579,
/* 0x244 */ CS_CMD_ACTOR_CUE_580,
/* 0x245 */ CS_CMD_ACTOR_CUE_581,
/* 0x246 */ CS_CMD_ACTOR_CUE_582,
/* 0x247 */ CS_CMD_ACTOR_CUE_583,
/* 0x248 */ CS_CMD_ACTOR_CUE_584,
/* 0x249 */ CS_CMD_ACTOR_CUE_585,
/* 0x24A */ CS_CMD_ACTOR_CUE_586,
/* 0x24B */ CS_CMD_ACTOR_CUE_587,
/* 0x24C */ CS_CMD_ACTOR_CUE_588,
/* 0x24D */ CS_CMD_ACTOR_CUE_589,
/* 0x24E */ CS_CMD_ACTOR_CUE_590,
/* 0x24F */ CS_CMD_ACTOR_CUE_591,
/* 0x250 */ CS_CMD_ACTOR_CUE_592,
/* 0x251 */ CS_CMD_ACTOR_CUE_593,
/* 0x252 */ CS_CMD_ACTOR_CUE_594,
/* 0x253 */ CS_CMD_ACTOR_CUE_595,
/* 0x254 */ CS_CMD_ACTOR_CUE_596,
/* 0x255 */ CS_CMD_ACTOR_CUE_597,
/* 0x256 */ CS_CMD_ACTOR_CUE_598,
/* 0x257 */ CS_CMD_ACTOR_CUE_599
};
class CutsceneSubCommandEntry_GenericMMCmd : public CutsceneSubCommandEntry
/**** GENERIC ****/
class CutsceneMMSubCommandEntry_GenericCmd : public CutsceneSubCommandEntry
{
public:
CutsceneMMCommands commandId;
CutsceneMM_CommandType commandId;
CutsceneSubCommandEntry_GenericMMCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneMMCommands cmdId);
CutsceneMMSubCommandEntry_GenericCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneMM_CommandType cmdId);
std::string GetBodySourceCode() const override;
};
@@ -54,34 +259,89 @@ class CutsceneMMCommand_GenericCmd : public CutsceneCommand
{
public:
CutsceneMMCommand_GenericCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneMMCommands cmdId);
CutsceneMM_CommandType cmdId);
std::string GetCommandMacro() const override;
};
/**** CAMERA ****/
// TODO: MM cutscene camera command is implemented as a placeholder until we better understand how
// it works
class CutsceneSubCommandEntry_Camera : public CutsceneSubCommandEntry
class CutsceneSubCommandEntry_SplineCamPoint : public CutsceneSubCommandEntry
{
public:
uint32_t unk_08;
uint8_t interpType;
uint8_t weight;
uint16_t duration;
CutsceneSubCommandEntry_Camera(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
uint16_t posX;
uint16_t posY;
uint16_t posZ;
uint16_t relTo;
CutsceneSubCommandEntry_SplineCamPoint(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_Camera : public CutsceneCommand
class CutsceneSubCommandEntry_SplineMiscPoint : public CutsceneSubCommandEntry
{
public:
CutsceneMMCommand_Camera(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
uint16_t unused0;
uint16_t roll;
uint16_t fov;
uint16_t unused1;
CutsceneSubCommandEntry_SplineMiscPoint(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneSubCommandEntry_FadeScreen : public CutsceneSubCommandEntry
class CutsceneSubCommandEntry_SplineFooter : public CutsceneSubCommandEntry
{
public:
CutsceneSubCommandEntry_SplineFooter(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneSubCommandEntry_SplineHeader : public CutsceneSubCommandEntry
{
public:
uint16_t numEntries;
uint16_t unused0;
uint16_t unused1;
uint16_t duration;
CutsceneSubCommandEntry_SplineHeader(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_Spline : public CutsceneCommand
{
public:
uint32_t numHeaders;
uint32_t totalCommands;
CutsceneMMCommand_Spline(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
size_t GetCommandSize() const override;
};
/**** TRANSITION GENERAL ****/
class CutsceneSubCommandEntry_TransitionGeneral : public CutsceneSubCommandEntry
{
public:
uint8_t unk_06;
@@ -91,41 +351,46 @@ public:
uint8_t unk_0A;
uint8_t unk_0B;
CutsceneSubCommandEntry_FadeScreen(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
CutsceneSubCommandEntry_TransitionGeneral(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_FadeScreen : public CutsceneCommand
class CutsceneMMCommand_TransitionGeneral : public CutsceneCommand
{
public:
CutsceneMMCommand_FadeScreen(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
CutsceneMMCommand_TransitionGeneral(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
class CutsceneSubCommandEntry_FadeSeq : public CutsceneSubCommandEntry
/**** FADE OUT SEQUENCE ****/
class CutsceneSubCommandEntry_FadeOutSeq : public CutsceneSubCommandEntry
{
public:
uint32_t unk_08;
CutsceneSubCommandEntry_FadeSeq(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
CutsceneSubCommandEntry_FadeOutSeq(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_FadeSeq : public CutsceneCommand
class CutsceneMMCommand_FadeOutSeq : public CutsceneCommand
{
public:
CutsceneMMCommand_FadeSeq(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
CutsceneMMCommand_FadeOutSeq(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** NON IMPLEMENTED ****/
class CutsceneSubCommandEntry_NonImplemented : public CutsceneSubCommandEntry
{
public:
@@ -138,3 +403,75 @@ class CutsceneMMCommand_NonImplemented : public CutsceneCommand
public:
CutsceneMMCommand_NonImplemented(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
};
/**** RUMBLE ****/
class CutsceneMMSubCommandEntry_Rumble : public CutsceneSubCommandEntry
{
public:
uint8_t intensity;
uint8_t decayTimer;
uint8_t decayStep;
CutsceneMMSubCommandEntry_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_Rumble : public CutsceneCommand
{
public:
CutsceneMMCommand_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** TEXT ****/
class CutsceneMMSubCommandEntry_Text : public CutsceneSubCommandEntry
{
public:
uint16_t type;
uint16_t textId1;
uint16_t textId2;
CutsceneMMSubCommandEntry_Text(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_Text : public CutsceneCommand
{
public:
CutsceneMMCommand_Text(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** ACTOR CUE ****/
class CutsceneMMSubCommandEntry_ActorCue : public CutsceneSubCommandEntry
{
public:
uint16_t rotX, rotY, rotZ;
int32_t startPosX, startPosY, startPosZ;
int32_t endPosX, endPosY, endPosZ;
float normalX, normalY, normalZ;
CutsceneMMSubCommandEntry_ActorCue(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneMMCommand_ActorCue : public CutsceneCommand
{
public:
CutsceneMMCommand_ActorCue(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
@@ -0,0 +1,461 @@
#include "CutsceneOoT_Commands.h"
#include <cassert>
#include <unordered_map>
#include "Globals.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
/**** GENERIC ****/
// Specific for command lists where each entry has size 0x30 bytes
const std::unordered_map<CutsceneOoT_CommandType, CsCommandListDescriptor> csCommandsDesc = {
{CutsceneOoT_CommandType::CS_CMD_MISC,
{"CS_MISC", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING,
{"CS_LIGHT_SETTING", "(0x%02X, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneOoT_CommandType::CS_CMD_START_SEQ,
{"CS_START_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneOoT_CommandType::CS_CMD_STOP_SEQ,
{"CS_STOP_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ,
{"CS_FADE_OUT_SEQ", "(%s, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
};
CutsceneOoTSubCommandEntry_GenericCmd::CutsceneOoTSubCommandEntry_GenericCmd(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex, CutsceneOoT_CommandType cmdId)
: CutsceneSubCommandEntry(rawData, rawDataIndex), commandId(cmdId)
{
word0 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0);
word1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x4);
unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x8);
unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0xC);
unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x10);
unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x14);
unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x18);
unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x1C);
unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x20);
unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x24);
unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x28);
unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x2C);
}
std::string CutsceneOoTSubCommandEntry_GenericCmd::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
const auto& element = csCommandsDesc.find(commandId);
if (element != csCommandsDesc.end())
{
bool isIndexInMisc = enumData->miscType.find(base) != enumData->miscType.end();
bool isIndexInFade =
enumData->fadeOutSeqPlayer.find(base) != enumData->fadeOutSeqPlayer.end();
bool isIndexInSeqId = enumData->seqId.find(base - 1) != enumData->seqId.end();
std::string entryFmt = element->second.cmdMacro;
std::string firstArg;
entryFmt += element->second.args;
if (commandId == CutsceneOoT_CommandType::CS_CMD_MISC && isIndexInMisc)
firstArg = enumData->miscType[base];
else if (commandId == CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ && isIndexInFade)
firstArg = enumData->fadeOutSeqPlayer[base];
else if (commandId == CutsceneOoT_CommandType::CS_CMD_START_SEQ && isIndexInSeqId)
firstArg = enumData->seqId[base - 1];
else if (commandId == CutsceneOoT_CommandType::CS_CMD_STOP_SEQ && isIndexInSeqId)
firstArg = enumData->seqId[base - 1];
else
{
return StringHelper::Sprintf(entryFmt.c_str(), base - 1, startFrame, endFrame, pad,
unused1, unused2, unused3, unused4, unused5, unused6,
unused7, unused8, unused9, unused10);
}
return StringHelper::Sprintf(entryFmt.c_str(), firstArg.c_str(), startFrame, endFrame, pad,
unused1, unused2, unused3, unused4, unused5, unused6, unused7,
unused8, unused9, unused10);
}
return StringHelper::Sprintf("CS_UNK_DATA(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, "
"0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)",
word0, word1, unused1, unused2, unused3, unused4, unused5, unused6,
unused7, unused8, unused9, unused10);
}
size_t CutsceneOoTSubCommandEntry_GenericCmd::GetRawSize() const
{
return 0x30;
}
CutsceneOoTCommand_GenericCmd::CutsceneOoTCommand_GenericCmd(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex,
CutsceneOoT_CommandType cmdId)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
commandID = static_cast<uint32_t>(cmdId);
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneOoTSubCommandEntry_GenericCmd(rawData, rawDataIndex, cmdId);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneOoTCommand_GenericCmd::GetCommandMacro() const
{
const auto& element = csCommandsDesc.find(static_cast<CutsceneOoT_CommandType>(commandID));
if (element != csCommandsDesc.end())
{
return StringHelper::Sprintf("%s_LIST(%i)", element->second.cmdMacro, numEntries);
}
return StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%X, %i)", commandID, numEntries);
}
/**** CAMERA ****/
CutsceneOoTCommand_CameraPoint::CutsceneOoTCommand_CameraPoint(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
continueFlag = BitConverter::ToInt8BE(rawData, rawDataIndex + 0);
cameraRoll = BitConverter::ToInt8BE(rawData, rawDataIndex + 1);
nextPointFrame = BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
viewAngle = BitConverter::ToFloatBE(rawData, rawDataIndex + 4);
posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 12);
unused = BitConverter::ToInt16BE(rawData, rawDataIndex + 14);
}
std::string CutsceneOoTCommand_CameraPoint::GetBodySourceCode() const
{
std::string continueMacro = "CS_CAM_CONTINUE";
if (continueFlag != 0)
continueMacro = "CS_CAM_STOP";
return StringHelper::Sprintf("CS_CAM_POINT(%s, 0x%02X, %i, %ff, %i, %i, %i, 0x%04X)",
continueMacro.c_str(), cameraRoll, nextPointFrame, viewAngle, posX,
posY, posZ, unused);
}
size_t CutsceneOoTCommand_CameraPoint::GetRawSize() const
{
return 0x10;
}
CutsceneOoTCommand_GenericCameraCmd::CutsceneOoTCommand_GenericCameraCmd(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unused = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
bool shouldContinue = true;
uint32_t currentPtr = rawDataIndex + 8;
while (shouldContinue)
{
CutsceneOoTCommand_CameraPoint* camPoint =
new CutsceneOoTCommand_CameraPoint(rawData, currentPtr);
entries.push_back(camPoint);
if (camPoint->continueFlag == -1)
shouldContinue = false;
currentPtr += camPoint->GetRawSize();
}
}
std::string CutsceneOoTCommand_GenericCameraCmd::GetCommandMacro() const
{
std::string result;
const char* listStr;
if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE)
{
listStr = "CS_CAM_AT_SPLINE";
}
else if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER)
{
listStr = "CS_CAM_AT_SPLINE_REL_TO_PLAYER";
}
else if (commandID == (uint32_t)CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER)
{
listStr = "CS_CAM_EYE_SPLINE_REL_TO_PLAYER";
}
else
{
listStr = "CS_CAM_EYE_SPLINE";
}
result += StringHelper::Sprintf("%s(%i, %i)", listStr, startFrame, endFrame);
return result;
}
size_t CutsceneOoTCommand_GenericCameraCmd::GetCommandSize() const
{
return 0x0C + entries.at(0)->GetRawSize() * entries.size();
}
/**** RUMBLE ****/
CutsceneOoTSubCommandEntry_Rumble::CutsceneOoTSubCommandEntry_Rumble(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
sourceStrength = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06);
duration = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07);
decreaseRate = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08);
unk_09 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09);
unk_0A = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0A);
}
std::string CutsceneOoTSubCommandEntry_Rumble::GetBodySourceCode() const
{
// Note: the first argument is unused
return StringHelper::Sprintf("CS_RUMBLE_CONTROLLER(%i, %i, %i, %i, %i, %i, 0x%02X, 0x%02X)",
base, startFrame, endFrame, sourceStrength, duration, decreaseRate,
unk_09, unk_0A);
}
size_t CutsceneOoTSubCommandEntry_Rumble::GetRawSize() const
{
return 0x0C;
}
CutsceneOoTCommand_Rumble::CutsceneOoTCommand_Rumble(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneOoTSubCommandEntry_Rumble(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneOoTCommand_Rumble::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_RUMBLE_CONTROLLER_LIST(%i)", numEntries);
}
/**** TEXT ****/
CutsceneOoTSubCommandEntry_Text::CutsceneOoTSubCommandEntry_Text(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
textId1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
textId2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
}
std::string CutsceneOoTSubCommandEntry_Text::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (type == 0xFFFF)
{
return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame);
}
if (type == 2 &&
enumData->ocarinaSongActionId.find(base) != enumData->ocarinaSongActionId.end())
{
return StringHelper::Sprintf("CS_TEXT_OCARINA_ACTION(%s, %i, %i, 0x%X)",
enumData->ocarinaSongActionId[base].c_str(), startFrame,
endFrame, textId1);
}
if (enumData->textType.find(type) != enumData->textType.end())
{
return StringHelper::Sprintf("CS_TEXT(0x%X, %i, %i, %s, 0x%X, 0x%X)", base, startFrame,
endFrame, enumData->textType[type].c_str(), textId1, textId2);
}
return StringHelper::Sprintf("CS_TEXT(0x%X, %i, %i, %i, 0x%X, 0x%X)", base, startFrame,
endFrame, type, textId1, textId2);
}
size_t CutsceneOoTSubCommandEntry_Text::GetRawSize() const
{
return 0x0C;
}
CutsceneOoTCommand_Text::CutsceneOoTCommand_Text(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneOoTSubCommandEntry_Text(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneOoTCommand_Text::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TEXT_LIST(%i)", numEntries);
}
/**** ACTOR CUE ****/
CutsceneOoTSubCommandEntry_ActorCue::CutsceneOoTSubCommandEntry_ActorCue(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0xC);
startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x10);
startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x14);
endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x18);
endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x1C);
endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x20);
normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x24);
normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x28);
normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x2C);
}
std::string CutsceneOoTSubCommandEntry_ActorCue::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (static_cast<CutsceneOoT_CommandType>(commandID) ==
CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE)
{
return StringHelper::Sprintf("CS_PLAYER_CUE(%s, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
enumData->playerCueId[base].c_str(), startFrame, endFrame,
rotX, rotY, rotZ, startPosX, startPosY, startPosZ, endPosX,
endPosY, endPosZ, normalX, normalY, normalZ);
}
else
{
return StringHelper::Sprintf("CS_ACTOR_CUE(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
"%i, %i, %i, %i, %.8ef, %.8ef, %.8ef)",
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX,
startPosY, startPosZ, endPosX, endPosY, endPosZ, normalX,
normalY, normalZ);
}
}
size_t CutsceneOoTSubCommandEntry_ActorCue::GetRawSize() const
{
return 0x30;
}
CutsceneOoTCommand_ActorCue::CutsceneOoTCommand_ActorCue(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneOoTSubCommandEntry_ActorCue(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneOoTCommand_ActorCue::GetCommandMacro() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (static_cast<CutsceneOoT_CommandType>(commandID) ==
CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE)
{
return StringHelper::Sprintf("CS_PLAYER_CUE_LIST(%i)", entries.size());
}
if (enumData->cutsceneCmd.find(commandID) != enumData->cutsceneCmd.end())
{
return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(%s, %i)",
enumData->cutsceneCmd[commandID].c_str(), entries.size());
}
return StringHelper::Sprintf("CS_ACTOR_CUE_LIST(0x%04X, %i)", commandID, entries.size());
}
/**** DESTINATION ****/
CutsceneOoTCommand_Destination::CutsceneOoTCommand_Destination(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unknown = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate
}
std::string CutsceneOoTCommand_Destination::GenerateSourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->destination.find(base) != enumData->destination.end())
{
return StringHelper::Sprintf("CS_DESTINATION(%s, %i, %i),\n",
enumData->destination[base].c_str(), startFrame, endFrame);
}
return StringHelper::Sprintf("CS_DESTINATION(%i, %i, %i),\n", base, startFrame, endFrame);
}
size_t CutsceneOoTCommand_Destination::GetCommandSize() const
{
return 0x10;
}
/**** TRANSITION ****/
CutsceneOoTCommand_Transition::CutsceneOoTCommand_Transition(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
}
std::string CutsceneOoTCommand_Transition::GenerateSourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->transitionType.find(base) != enumData->transitionType.end())
{
return StringHelper::Sprintf("CS_TRANSITION(%s, %i, %i),\n",
enumData->transitionType[base].c_str(), startFrame, endFrame);
}
return StringHelper::Sprintf("CS_TRANSITION(%i, %i, %i),\n", base, startFrame, endFrame);
}
size_t CutsceneOoTCommand_Transition::GetCommandSize() const
{
return 0x10;
}
@@ -0,0 +1,314 @@
#pragma once
#include "Cutscene_Common.h"
// https://github.com/zeldaret/oot/blob/7235af2249843fb68740111b70089bad827a4730/include/z64cutscene.h#L35-L165
enum class CutsceneOoT_CommandType
{
CS_CMD_CAM_EYE_SPLINE = 0x01,
CS_CMD_CAM_AT_SPLINE,
CS_CMD_MISC,
CS_CMD_LIGHT_SETTING,
CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER,
CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER,
CS_CMD_CAM_EYE,
CS_CMD_CAM_AT,
CS_CMD_RUMBLE_CONTROLLER,
CS_CMD_PLAYER_CUE,
CS_CMD_UNIMPLEMENTED_B,
CS_CMD_UNIMPLEMENTED_D = 0x0D,
CS_CMD_ACTOR_CUE_1_0,
CS_CMD_ACTOR_CUE_0_0,
CS_CMD_ACTOR_CUE_1_1,
CS_CMD_ACTOR_CUE_0_1,
CS_CMD_ACTOR_CUE_0_2,
CS_CMD_TEXT,
CS_CMD_UNIMPLEMENTED_15 = 0x15,
CS_CMD_UNIMPLEMENTED_16,
CS_CMD_ACTOR_CUE_0_3,
CS_CMD_ACTOR_CUE_1_2,
CS_CMD_ACTOR_CUE_2_0,
CS_CMD_UNIMPLEMENTED_1B = 0x1B,
CS_CMD_UNIMPLEMENTED_1C,
CS_CMD_ACTOR_CUE_3_0,
CS_CMD_ACTOR_CUE_4_0,
CS_CMD_ACTOR_CUE_6_0,
CS_CMD_UNIMPLEMENTED_20,
CS_CMD_UNIMPLEMENTED_21,
CS_CMD_ACTOR_CUE_0_4,
CS_CMD_ACTOR_CUE_1_3,
CS_CMD_ACTOR_CUE_2_1,
CS_CMD_ACTOR_CUE_3_1,
CS_CMD_ACTOR_CUE_4_1,
CS_CMD_ACTOR_CUE_0_5,
CS_CMD_ACTOR_CUE_1_4,
CS_CMD_ACTOR_CUE_2_2,
CS_CMD_ACTOR_CUE_3_2,
CS_CMD_ACTOR_CUE_4_2,
CS_CMD_ACTOR_CUE_5_0,
CS_CMD_TRANSITION,
CS_CMD_ACTOR_CUE_0_6,
CS_CMD_ACTOR_CUE_4_3,
CS_CMD_ACTOR_CUE_1_5,
CS_CMD_ACTOR_CUE_7_0,
CS_CMD_ACTOR_CUE_2_3,
CS_CMD_ACTOR_CUE_3_3,
CS_CMD_ACTOR_CUE_6_1,
CS_CMD_ACTOR_CUE_3_4,
CS_CMD_ACTOR_CUE_4_4,
CS_CMD_ACTOR_CUE_5_1,
CS_CMD_ACTOR_CUE_6_2 = 0x39,
CS_CMD_ACTOR_CUE_6_3,
CS_CMD_UNIMPLEMENTED_3B,
CS_CMD_ACTOR_CUE_7_1,
CS_CMD_UNIMPLEMENTED_3D,
CS_CMD_ACTOR_CUE_8_0,
CS_CMD_ACTOR_CUE_3_5,
CS_CMD_ACTOR_CUE_1_6,
CS_CMD_ACTOR_CUE_3_6,
CS_CMD_ACTOR_CUE_3_7,
CS_CMD_ACTOR_CUE_2_4,
CS_CMD_ACTOR_CUE_1_7,
CS_CMD_ACTOR_CUE_2_5,
CS_CMD_ACTOR_CUE_1_8,
CS_CMD_UNIMPLEMENTED_47,
CS_CMD_ACTOR_CUE_2_6,
CS_CMD_UNIMPLEMENTED_49,
CS_CMD_ACTOR_CUE_2_7,
CS_CMD_ACTOR_CUE_3_8,
CS_CMD_ACTOR_CUE_0_7,
CS_CMD_ACTOR_CUE_5_2,
CS_CMD_ACTOR_CUE_1_9,
CS_CMD_ACTOR_CUE_4_5,
CS_CMD_ACTOR_CUE_1_10,
CS_CMD_ACTOR_CUE_2_8,
CS_CMD_ACTOR_CUE_3_9,
CS_CMD_ACTOR_CUE_4_6,
CS_CMD_ACTOR_CUE_5_3,
CS_CMD_ACTOR_CUE_0_8,
CS_CMD_START_SEQ,
CS_CMD_STOP_SEQ,
CS_CMD_ACTOR_CUE_6_4,
CS_CMD_ACTOR_CUE_7_2,
CS_CMD_ACTOR_CUE_5_4,
CS_CMD_ACTOR_CUE_0_9 = 0x5D,
CS_CMD_ACTOR_CUE_1_11,
CS_CMD_ACTOR_CUE_0_10 = 0x69,
CS_CMD_ACTOR_CUE_2_9,
CS_CMD_ACTOR_CUE_0_11,
CS_CMD_ACTOR_CUE_3_10,
CS_CMD_UNIMPLEMENTED_6D,
CS_CMD_ACTOR_CUE_0_12,
CS_CMD_ACTOR_CUE_7_3,
CS_CMD_UNIMPLEMENTED_70,
CS_CMD_UNIMPLEMENTED_71,
CS_CMD_ACTOR_CUE_7_4,
CS_CMD_ACTOR_CUE_6_5,
CS_CMD_ACTOR_CUE_1_12,
CS_CMD_ACTOR_CUE_2_10,
CS_CMD_ACTOR_CUE_1_13,
CS_CMD_ACTOR_CUE_0_13,
CS_CMD_ACTOR_CUE_1_14,
CS_CMD_ACTOR_CUE_2_11,
CS_CMD_ACTOR_CUE_0_14 = 0x7B,
CS_CMD_FADE_OUT_SEQ,
CS_CMD_ACTOR_CUE_1_15,
CS_CMD_ACTOR_CUE_2_12,
CS_CMD_ACTOR_CUE_3_11,
CS_CMD_ACTOR_CUE_4_7,
CS_CMD_ACTOR_CUE_5_5,
CS_CMD_ACTOR_CUE_6_6,
CS_CMD_ACTOR_CUE_1_16,
CS_CMD_ACTOR_CUE_2_13,
CS_CMD_ACTOR_CUE_3_12,
CS_CMD_ACTOR_CUE_7_5,
CS_CMD_ACTOR_CUE_4_8,
CS_CMD_ACTOR_CUE_5_6,
CS_CMD_ACTOR_CUE_6_7,
CS_CMD_ACTOR_CUE_0_15,
CS_CMD_ACTOR_CUE_0_16,
CS_CMD_TIME,
CS_CMD_ACTOR_CUE_1_17,
CS_CMD_ACTOR_CUE_7_6,
CS_CMD_ACTOR_CUE_9_0,
CS_CMD_ACTOR_CUE_0_17,
CS_CMD_DESTINATION = 0x03E8,
CS_CMD_END = 0xFFFF
};
/**** GENERIC ****/
class CutsceneOoTSubCommandEntry_GenericCmd : public CutsceneSubCommandEntry
{
public:
CutsceneOoT_CommandType commandId;
uint32_t word0 = 0;
uint32_t word1 = 0;
uint32_t unused1 = 0;
uint32_t unused2 = 0;
uint32_t unused3 = 0;
uint32_t unused4 = 0;
uint32_t unused5 = 0;
uint32_t unused6 = 0;
uint32_t unused7 = 0;
uint32_t unused8 = 0;
uint32_t unused9 = 0;
uint32_t unused10 = 0;
CutsceneOoTSubCommandEntry_GenericCmd(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex, CutsceneOoT_CommandType cmdId);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneOoTCommand_GenericCmd : public CutsceneCommand
{
public:
CutsceneOoTCommand_GenericCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneOoT_CommandType cmdId);
std::string GetCommandMacro() const override;
};
/**** CAMERA ****/
class CutsceneOoTCommand_CameraPoint : public CutsceneSubCommandEntry
{
public:
int8_t continueFlag;
int8_t cameraRoll;
int16_t nextPointFrame;
float viewAngle;
int16_t posX, posY, posZ;
int16_t unused;
CutsceneOoTCommand_CameraPoint(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneOoTCommand_GenericCameraCmd : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t unused;
CutsceneOoTCommand_GenericCameraCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
size_t GetCommandSize() const override;
};
/**** TRANSITION ****/
class CutsceneOoTCommand_Transition : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
CutsceneOoTCommand_Transition(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GenerateSourceCode() const override;
size_t GetCommandSize() const override;
};
/**** RUMBLE ****/
class CutsceneOoTSubCommandEntry_Rumble : public CutsceneSubCommandEntry
{
public:
uint8_t sourceStrength;
uint8_t duration;
uint8_t decreaseRate;
uint8_t unk_09;
uint8_t unk_0A;
CutsceneOoTSubCommandEntry_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneOoTCommand_Rumble : public CutsceneCommand
{
public:
CutsceneOoTCommand_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** TEXT ****/
class CutsceneOoTSubCommandEntry_Text : public CutsceneSubCommandEntry
{
public:
uint16_t type;
uint16_t textId1;
uint16_t textId2;
CutsceneOoTSubCommandEntry_Text(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneOoTCommand_Text : public CutsceneCommand
{
public:
CutsceneOoTCommand_Text(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** ACTOR CUE ****/
class CutsceneOoTSubCommandEntry_ActorCue : public CutsceneSubCommandEntry
{
public:
uint16_t rotX, rotY, rotZ;
int32_t startPosX, startPosY, startPosZ;
int32_t endPosX, endPosY, endPosZ;
float normalX, normalY, normalZ;
CutsceneOoTSubCommandEntry_ActorCue(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneOoTCommand_ActorCue : public CutsceneCommand
{
public:
CutsceneOoTCommand_ActorCue(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
/**** DESTINATION ****/
class CutsceneOoTCommand_Destination : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t unknown;
CutsceneOoTCommand_Destination(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GenerateSourceCode() const override;
size_t GetCommandSize() const override;
};
@@ -1,596 +0,0 @@
#include "Cutscene_Commands.h"
#include <cassert>
#include <unordered_map>
#include "CutsceneMM_Commands.h"
#include "Globals.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
/* CutsceneSubCommandEntry */
CutsceneSubCommandEntry::CutsceneSubCommandEntry(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
{
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
pad = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
}
std::string CutsceneSubCommandEntry::GetBodySourceCode() const
{
return StringHelper::Sprintf("CMD_HH(0x%04X, 0x%04X), CMD_HH(0x%04X, 0x%04X)", base, startFrame,
endFrame, pad);
}
size_t CutsceneSubCommandEntry::GetRawSize() const
{
return 0x08;
}
/* CutsceneCommand */
CutsceneCommand::CutsceneCommand(const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
{
numEntries = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0);
}
CutsceneCommand::~CutsceneCommand()
{
for (auto& entry : entries)
{
delete entry;
}
}
std::string CutsceneCommand::GetCommandMacro() const
{
return StringHelper::Sprintf("CMD_W(0x%08X), CMD_W(0x%08X)", commandID, numEntries);
}
std::string CutsceneCommand::GenerateSourceCode() const
{
std::string result;
result += GetCommandMacro();
result += ",\n";
for (auto& entry : entries)
{
result += " ";
result += entry->GetBodySourceCode();
result += ",\n";
}
return result;
}
size_t CutsceneCommand::GetCommandSize() const
{
size_t size = 0;
if (entries.size() > 0)
{
size = entries.at(0)->GetRawSize() * entries.size();
}
else
{
size = 0x08 * numEntries;
}
return 0x08 + size;
}
void CutsceneCommand::SetCommandID(uint32_t nCommandID)
{
commandID = nCommandID;
for (auto& entry : entries)
{
entry->commandID = commandID;
}
}
// Specific for command lists where each entry has size 0x30 bytes
const std::unordered_map<CutsceneCommands, CsCommandListDescriptor> csCommandsDesc = {
{CutsceneCommands::Misc,
{"CS_MISC", "(0x%04X, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneCommands::SetLighting,
{"CS_LIGHTING", "(0x%02X, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneCommands::PlayBGM, {"CS_PLAY_BGM", "(%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneCommands::StopBGM, {"CS_STOP_BGM", "(%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
{CutsceneCommands::FadeBGM, {"CS_FADE_BGM", "(%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i)"}},
};
CutsceneSubCommandEntry_GenericCmd::CutsceneSubCommandEntry_GenericCmd(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex, CutsceneCommands cmdId)
: CutsceneSubCommandEntry(rawData, rawDataIndex), commandId(cmdId)
{
word0 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0);
word1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x4);
unused1 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x8);
unused2 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0xC);
unused3 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x10);
unused4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x14);
unused5 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x18);
unused6 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x1C);
unused7 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x20);
unused8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x24);
unused9 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x28);
unused10 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x2C);
}
std::string CutsceneSubCommandEntry_GenericCmd::GetBodySourceCode() const
{
const auto& element = csCommandsDesc.find(commandId);
if (element != csCommandsDesc.end())
{
std::string entryFmt = element->second.cmdMacro;
entryFmt += element->second.args;
return StringHelper::Sprintf(entryFmt.c_str(), base, startFrame, endFrame, pad, unused1,
unused2, unused3, unused4, unused5, unused6, unused7, unused8,
unused9, unused10);
}
return StringHelper::Sprintf("CS_UNK_DATA(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, "
"0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)",
word0, word1, unused1, unused2, unused3, unused4, unused5, unused6,
unused7, unused8, unused9, unused10);
}
size_t CutsceneSubCommandEntry_GenericCmd::GetRawSize() const
{
return 0x30;
}
CutsceneCommand_GenericCmd::CutsceneCommand_GenericCmd(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex,
CutsceneCommands cmdId)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
commandID = static_cast<uint32_t>(cmdId);
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_GenericCmd(rawData, rawDataIndex, cmdId);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_GenericCmd::GetCommandMacro() const
{
const auto& element = csCommandsDesc.find(static_cast<CutsceneCommands>(commandID));
if (element != csCommandsDesc.end())
{
return StringHelper::Sprintf("%s_LIST(%i)", element->second.cmdMacro, numEntries);
}
return StringHelper::Sprintf("CS_UNK_DATA_LIST(0x%X, %i)", commandID, numEntries);
}
CutsceneCameraPoint::CutsceneCameraPoint(const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
continueFlag = BitConverter::ToInt8BE(rawData, rawDataIndex + 0);
cameraRoll = BitConverter::ToInt8BE(rawData, rawDataIndex + 1);
nextPointFrame = BitConverter::ToInt16BE(rawData, rawDataIndex + 2);
viewAngle = BitConverter::ToFloatBE(rawData, rawDataIndex + 4);
posX = BitConverter::ToInt16BE(rawData, rawDataIndex + 8);
posY = BitConverter::ToInt16BE(rawData, rawDataIndex + 10);
posZ = BitConverter::ToInt16BE(rawData, rawDataIndex + 12);
unused = BitConverter::ToInt16BE(rawData, rawDataIndex + 14);
}
std::string CutsceneCameraPoint::GetBodySourceCode() const
{
std::string result = "";
if (commandID == (int32_t)CutsceneCommands::SetCameraFocus)
{
result += "CS_CAM_FOCUS_POINT";
}
else if (commandID == (int32_t)CutsceneCommands::SetCameraFocusLink)
{
result += "CS_CAM_FOCUS_POINT_PLAYER";
}
else if (commandID == (int32_t)CutsceneCommands::SetCameraPosLink)
{
result += "CS_CAM_POS_PLAYER";
}
else
{
result += "CS_CAM_POS";
}
std::string continueMacro = "CS_CMD_CONTINUE";
if (continueFlag != 0)
continueMacro = "CS_CMD_STOP";
result +=
StringHelper::Sprintf("(%s, 0x%02X, %i, %ff, %i, %i, %i, 0x%04X)", continueMacro.c_str(),
cameraRoll, nextPointFrame, viewAngle, posX, posY, posZ, unused);
return result;
}
size_t CutsceneCameraPoint::GetRawSize() const
{
return 0x10;
}
CutsceneCommandSetCameraPos::CutsceneCommandSetCameraPos(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unused = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
bool shouldContinue = true;
uint32_t currentPtr = rawDataIndex + 8;
while (shouldContinue)
{
CutsceneCameraPoint* camPoint = new CutsceneCameraPoint(rawData, currentPtr);
entries.push_back(camPoint);
if (camPoint->continueFlag == -1)
shouldContinue = false;
currentPtr += camPoint->GetRawSize();
}
}
std::string CutsceneCommandSetCameraPos::GetCommandMacro() const
{
std::string result;
std::string listStr;
if (commandID == (int32_t)CutsceneCommands::SetCameraFocus)
{
listStr = "CS_CAM_FOCUS_POINT_LIST";
}
else if (commandID == (int32_t)CutsceneCommands::SetCameraFocusLink)
{
listStr = "CS_CAM_FOCUS_POINT_PLAYER_LIST";
}
else if (commandID == (int32_t)CutsceneCommands::SetCameraPosLink)
{
listStr = "CS_CAM_POS_PLAYER_LIST";
}
else
{
listStr = "CS_CAM_POS_LIST";
}
result += StringHelper::Sprintf("%s(%i, %i)", listStr.c_str(), startFrame, endFrame);
return result;
}
size_t CutsceneCommandSetCameraPos::GetCommandSize() const
{
return 0x0C + entries.at(0)->GetRawSize() * entries.size();
}
CutsceneSubCommandEntry_Rumble::CutsceneSubCommandEntry_Rumble(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
unk_06 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x06);
unk_07 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x07);
unk_08 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08);
unk_09 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09);
unk_0A = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0A);
unk_0B = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x0B);
}
std::string CutsceneSubCommandEntry_Rumble::GetBodySourceCode() const
{
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
return StringHelper::Sprintf("CS_RUMBLE(%i, %i, %i, 0x%02X, 0x%02X, 0x%02X)", base,
startFrame, endFrame, unk_06, unk_07, unk_08);
}
return StringHelper::Sprintf("CS_CMD_09(%i, %i, %i, 0x%02X, 0x%02X, 0x%02X, 0x%02X, 0x%02X)",
base, startFrame, endFrame, unk_06, unk_07, unk_08, unk_09, unk_0A,
unk_0B);
}
size_t CutsceneSubCommandEntry_Rumble::GetRawSize() const
{
return 0x0C;
}
CutsceneCommand_Rumble::CutsceneCommand_Rumble(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_Rumble(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_Rumble::GetCommandMacro() const
{
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
return StringHelper::Sprintf("CS_RUMBLE_LIST(%i)", numEntries);
}
return StringHelper::Sprintf("CS_CMD_09_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_SetTime::CutsceneSubCommandEntry_SetTime(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
hour = BitConverter::ToUInt8BE(rawData, rawDataIndex + 6);
minute = BitConverter::ToUInt8BE(rawData, rawDataIndex + 7);
unk_08 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 8);
}
std::string CutsceneSubCommandEntry_SetTime::GetBodySourceCode() const
{
return StringHelper::Sprintf("CS_TIME(%i, %i, %i, %i, %i, %i)", base, startFrame, endFrame,
hour, minute, unk_08);
}
size_t CutsceneSubCommandEntry_SetTime::GetRawSize() const
{
return 0x0C;
}
CutsceneCommand_SetTime::CutsceneCommand_SetTime(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_SetTime(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_SetTime::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TIME_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_TextBox::CutsceneSubCommandEntry_TextBox(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
type = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
textId1 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
textId2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
}
std::string CutsceneSubCommandEntry_TextBox::GetBodySourceCode() const
{
if (type == 0xFFFF)
{
return StringHelper::Sprintf("CS_TEXT_NONE(%i, %i)", startFrame, endFrame);
}
if (type == 2)
{
return StringHelper::Sprintf("CS_TEXT_LEARN_SONG(%i, %i, %i, 0x%X)", base, startFrame,
endFrame, textId1);
}
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
switch (type)
{
case 0:
return StringHelper::Sprintf("CS_TEXT_DEFAULT(0x%X, %i, %i, 0x%X, 0x%X)", base,
startFrame, endFrame, textId1, textId2);
case 1:
return StringHelper::Sprintf("CS_TEXT_TYPE_1(0x%X, %i, %i, 0x%X, 0x%X)", base,
startFrame, endFrame, textId1, textId2);
case 3:
return StringHelper::Sprintf("CS_TEXT_TYPE_3(0x%X, %i, %i, 0x%X, 0x%X)", base,
startFrame, endFrame, textId1, textId2);
case 4:
return StringHelper::Sprintf("CS_TEXT_BOSSES_REMAINS(0x%X, %i, %i, 0x%X)", base,
startFrame, endFrame, textId1);
case 5:
return StringHelper::Sprintf("CS_TEXT_ALL_NORMAL_MASKS(0x%X, %i, %i, 0x%X)", base,
startFrame, endFrame, textId1);
}
}
return StringHelper::Sprintf("CS_TEXT_DISPLAY_TEXTBOX(0x%X, %i, %i, %i, 0x%X, 0x%X)", base,
startFrame, endFrame, type, textId1, textId2);
}
size_t CutsceneSubCommandEntry_TextBox::GetRawSize() const
{
return 0x0C;
}
CutsceneCommand_TextBox::CutsceneCommand_TextBox(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_TextBox(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_TextBox::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TEXT_LIST(%i)", numEntries);
}
CutsceneSubCommandEntry_ActorAction::CutsceneSubCommandEntry_ActorAction(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
rotX = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x6);
rotY = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x8);
rotZ = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0xA);
startPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0xC);
startPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x10);
startPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x14);
endPosX = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x18);
endPosY = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x1C);
endPosZ = BitConverter::ToInt32BE(rawData, rawDataIndex + 0x20);
normalX = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x24);
normalY = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x28);
normalZ = BitConverter::ToFloatBE(rawData, rawDataIndex + 0x2C);
}
std::string CutsceneSubCommandEntry_ActorAction::GetBodySourceCode() const
{
std::string result;
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
if (static_cast<CutsceneMMCommands>(commandID) ==
CutsceneMMCommands::CS_CMD_SET_PLAYER_ACTION)
{
result = "CS_PLAYER_ACTION";
}
else
{
result = "CS_ACTOR_ACTION";
}
}
else
{
if (static_cast<CutsceneCommands>(commandID) == CutsceneCommands::SetPlayerAction)
{
result = "CS_PLAYER_ACTION";
}
else
{
result = "CS_NPC_ACTION";
}
}
result +=
StringHelper::Sprintf("(%i, %i, %i, 0x%04X, 0x%04X, 0x%04X, %i, %i, "
"%i, %i, %i, %i, %.11ef, %.11ef, %.11ef)",
base, startFrame, endFrame, rotX, rotY, rotZ, startPosX, startPosY,
startPosZ, endPosX, endPosY, endPosZ, normalX, normalY, normalZ);
return result;
}
size_t CutsceneSubCommandEntry_ActorAction::GetRawSize() const
{
return 0x30;
}
CutsceneCommand_ActorAction::CutsceneCommand_ActorAction(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_ActorAction(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_ActorAction::GetCommandMacro() const
{
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
if (static_cast<CutsceneMMCommands>(commandID) ==
CutsceneMMCommands::CS_CMD_SET_PLAYER_ACTION)
{
return StringHelper::Sprintf("CS_PLAYER_ACTION_LIST(%i)", numEntries);
}
return StringHelper::Sprintf("CS_ACTOR_ACTION_LIST(0x%03X, %i)", commandID, numEntries);
}
if (static_cast<CutsceneCommands>(commandID) == CutsceneCommands::SetPlayerAction)
{
return StringHelper::Sprintf("CS_PLAYER_ACTION_LIST(%i)", entries.size());
}
return StringHelper::Sprintf("CS_NPC_ACTION_LIST(0x%03X, %i)", commandID, entries.size());
}
CutsceneCommand_Terminator::CutsceneCommand_Terminator(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
unknown = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6); // endFrame duplicate
}
std::string CutsceneCommand_Terminator::GenerateSourceCode() const
{
std::string result;
result += StringHelper::Sprintf("CS_TERMINATOR(%i, %i, %i),\n", base, startFrame, endFrame);
return result;
}
size_t CutsceneCommand_Terminator::GetCommandSize() const
{
return 0x10;
}
CutsceneCommandSceneTransFX::CutsceneCommandSceneTransFX(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
}
std::string CutsceneCommandSceneTransFX::GenerateSourceCode() const
{
return StringHelper::Sprintf("CS_SCENE_TRANS_FX(%i, %i, %i),\n", base, startFrame, endFrame);
}
size_t CutsceneCommandSceneTransFX::GetCommandSize() const
{
return 0x10;
}
@@ -1,267 +0,0 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "Declaration.h"
enum class CutsceneCommands
{
SetCameraPos = 0x0001,
SetCameraFocus = 0x0002,
Misc = 0x0003,
SetLighting = 0x0004,
SetCameraPosLink = 0x0005,
SetCameraFocusLink = 0x0006,
Cmd07 = 0x0007,
Cmd08 = 0x0008,
Cmd09 = 0x0009, // Rumble
Textbox = 0x0013,
SetPlayerAction = 0x000A,
SetActorAction1 = 0x000F,
SetActorAction2 = 0x000E,
SetActorAction3 = 0x0019,
SetActorAction4 = 0x001D,
SetActorAction5 = 0x001E,
SetActorAction6 = 0x002C,
SetActorAction7 = 0x001F,
SetActorAction8 = 0x0031,
SetActorAction9 = 0x003E,
SetActorAction10 = 0x008F,
SetSceneTransFX = 0x002D,
PlayBGM = 0x0056,
StopBGM = 0x0057,
FadeBGM = 0x007C,
SetTime = 0x008C,
Terminator = 0x03E8,
};
typedef struct CsCommandListDescriptor
{
const char* cmdMacro;
const char* args;
} CsCommandListDescriptor;
class CutsceneSubCommandEntry
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t pad;
uint32_t commandID;
CutsceneSubCommandEntry(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
virtual ~CutsceneSubCommandEntry() = default;
virtual std::string GetBodySourceCode() const;
virtual size_t GetRawSize() const;
};
class CutsceneCommand
{
public:
uint32_t commandID;
uint32_t commandIndex;
uint32_t numEntries;
std::vector<CutsceneSubCommandEntry*> entries;
CutsceneCommand(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
virtual ~CutsceneCommand();
virtual std::string GetCommandMacro() const;
virtual std::string GenerateSourceCode() const;
virtual size_t GetCommandSize() const;
virtual void SetCommandID(uint32_t nCommandID);
};
class CutsceneSubCommandEntry_GenericCmd : public CutsceneSubCommandEntry
{
public:
CutsceneCommands commandId;
uint32_t word0 = 0;
uint32_t word1 = 0;
uint32_t unused1 = 0;
uint32_t unused2 = 0;
uint32_t unused3 = 0;
uint32_t unused4 = 0;
uint32_t unused5 = 0;
uint32_t unused6 = 0;
uint32_t unused7 = 0;
uint32_t unused8 = 0;
uint32_t unused9 = 0;
uint32_t unused10 = 0;
CutsceneSubCommandEntry_GenericCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneCommands cmdId);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_GenericCmd : public CutsceneCommand
{
public:
CutsceneCommand_GenericCmd(const std::vector<uint8_t>& rawData, offset_t rawDataIndex,
CutsceneCommands cmdId);
std::string GetCommandMacro() const override;
};
class CutsceneCameraPoint : public CutsceneSubCommandEntry
{
public:
int8_t continueFlag;
int8_t cameraRoll;
int16_t nextPointFrame;
float viewAngle;
int16_t posX, posY, posZ;
int16_t unused;
CutsceneCameraPoint(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommandSetCameraPos : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t unused;
CutsceneCommandSetCameraPos(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
size_t GetCommandSize() const override;
};
class CutsceneCommandSceneTransFX : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
CutsceneCommandSceneTransFX(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GenerateSourceCode() const override;
size_t GetCommandSize() const override;
};
class CutsceneSubCommandEntry_Rumble : public CutsceneSubCommandEntry
{
public:
uint8_t unk_06;
uint8_t unk_07;
uint8_t unk_08;
uint8_t unk_09;
uint8_t unk_0A;
uint8_t unk_0B;
CutsceneSubCommandEntry_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_Rumble : public CutsceneCommand
{
public:
CutsceneCommand_Rumble(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
class CutsceneSubCommandEntry_SetTime : public CutsceneSubCommandEntry
{
public:
uint8_t hour;
uint8_t minute;
uint32_t unk_08;
CutsceneSubCommandEntry_SetTime(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_SetTime : public CutsceneCommand
{
public:
CutsceneCommand_SetTime(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
class CutsceneSubCommandEntry_TextBox : public CutsceneSubCommandEntry
{
public:
uint16_t type;
uint16_t textId1;
uint16_t textId2;
CutsceneSubCommandEntry_TextBox(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_TextBox : public CutsceneCommand
{
public:
CutsceneCommand_TextBox(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
class CutsceneSubCommandEntry_ActorAction : public CutsceneSubCommandEntry
{
public:
uint16_t rotX, rotY, rotZ;
int32_t startPosX, startPosY, startPosZ;
int32_t endPosX, endPosY, endPosZ;
float normalX, normalY, normalZ;
CutsceneSubCommandEntry_ActorAction(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_ActorAction : public CutsceneCommand
{
public:
CutsceneCommand_ActorAction(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
class CutsceneCommand_Terminator : public CutsceneCommand
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t unknown;
CutsceneCommand_Terminator(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GenerateSourceCode() const override;
size_t GetCommandSize() const override;
};
@@ -0,0 +1,128 @@
#include "Cutscene_Common.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
/* CutsceneSubCommandEntry */
CutsceneSubCommandEntry::CutsceneSubCommandEntry(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
{
base = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0);
startFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 2);
endFrame = BitConverter::ToUInt16BE(rawData, rawDataIndex + 4);
pad = BitConverter::ToUInt16BE(rawData, rawDataIndex + 6);
}
std::string CutsceneSubCommandEntry::GetBodySourceCode() const
{
return StringHelper::Sprintf("CMD_HH(0x%04X, 0x%04X), CMD_HH(0x%04X, 0x%04X)", base, startFrame,
endFrame, pad);
}
size_t CutsceneSubCommandEntry::GetRawSize() const
{
return 0x08;
}
/* CutsceneCommand */
CutsceneCommand::CutsceneCommand(const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
{
numEntries = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0);
}
CutsceneCommand::~CutsceneCommand()
{
for (auto entry : entries)
{
delete entry;
}
}
std::string CutsceneCommand::GetCommandMacro() const
{
return StringHelper::Sprintf("CMD_W(0x%08X), CMD_W(0x%08X)", commandID, numEntries);
}
std::string CutsceneCommand::GenerateSourceCode() const
{
std::string result;
result += GetCommandMacro();
result += ",\n";
for (auto& entry : entries)
{
result += " ";
result += entry->GetBodySourceCode();
result += ",\n";
}
return result;
}
size_t CutsceneCommand::GetCommandSize() const
{
size_t size = 0;
if (entries.size() > 0)
{
size = entries.at(0)->GetRawSize() * entries.size();
}
else
{
size = 0x08 * numEntries;
}
return 0x08 + size;
}
void CutsceneCommand::SetCommandID(uint32_t nCommandID)
{
commandID = nCommandID;
for (auto& entry : entries)
{
entry->commandID = commandID;
}
}
/*** TIME ****/
CutsceneSubCommandEntry_SetTime::CutsceneSubCommandEntry_SetTime(
const std::vector<uint8_t>& rawData, offset_t rawDataIndex)
: CutsceneSubCommandEntry(rawData, rawDataIndex)
{
hour = BitConverter::ToUInt8BE(rawData, rawDataIndex + 6);
minute = BitConverter::ToUInt8BE(rawData, rawDataIndex + 7);
}
std::string CutsceneSubCommandEntry_SetTime::GetBodySourceCode() const
{
// Note: Both OoT and MM have the first argument unused
return StringHelper::Sprintf("CS_TIME(%i, %i, %i, %i, %i)", base, startFrame, endFrame, hour,
minute);
}
size_t CutsceneSubCommandEntry_SetTime::GetRawSize() const
{
return 0x0C;
}
CutsceneCommand_Time::CutsceneCommand_Time(const std::vector<uint8_t>& rawData,
offset_t rawDataIndex)
: CutsceneCommand(rawData, rawDataIndex)
{
rawDataIndex += 4;
entries.reserve(numEntries);
for (size_t i = 0; i < numEntries; i++)
{
auto* entry = new CutsceneSubCommandEntry_SetTime(rawData, rawDataIndex);
entries.push_back(entry);
rawDataIndex += entry->GetRawSize();
}
}
std::string CutsceneCommand_Time::GetCommandMacro() const
{
return StringHelper::Sprintf("CS_TIME_LIST(%i)", numEntries);
}
@@ -0,0 +1,72 @@
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "Declaration.h"
typedef struct CsCommandListDescriptor
{
const char* cmdMacro;
const char* args;
} CsCommandListDescriptor;
class CutsceneSubCommandEntry
{
public:
uint16_t base;
uint16_t startFrame;
uint16_t endFrame;
uint16_t pad;
uint32_t commandID;
CutsceneSubCommandEntry(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
virtual ~CutsceneSubCommandEntry() = default;
virtual std::string GetBodySourceCode() const;
virtual size_t GetRawSize() const;
};
class CutsceneCommand
{
public:
uint32_t commandID;
uint32_t commandIndex;
uint32_t numEntries;
std::vector<CutsceneSubCommandEntry*> entries;
CutsceneCommand(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
virtual ~CutsceneCommand();
virtual std::string GetCommandMacro() const;
virtual std::string GenerateSourceCode() const;
virtual size_t GetCommandSize() const;
virtual void SetCommandID(uint32_t nCommandID);
};
/**** TIME ****/
class CutsceneSubCommandEntry_SetTime : public CutsceneSubCommandEntry
{
public:
uint8_t hour;
uint8_t minute;
CutsceneSubCommandEntry_SetTime(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetBodySourceCode() const override;
size_t GetRawSize() const override;
};
class CutsceneCommand_Time : public CutsceneCommand
{
public:
CutsceneCommand_Time(const std::vector<uint8_t>& rawData, offset_t rawDataIndex);
std::string GetCommandMacro() const override;
};
+126 -121
View File
@@ -6,149 +6,149 @@
#include "ZDisplayList.h"
#include "ZFile.h"
/* Struct_800A57C0 */
/* SkinVertex */
Struct_800A57C0::Struct_800A57C0(ZFile* nParent) : ZResource(nParent)
SkinVertex::SkinVertex(ZFile* nParent) : ZResource(nParent)
{
}
void Struct_800A57C0::ParseRawData()
void SkinVertex::ParseRawData()
{
const auto& rawData = parent->GetRawData();
unk_0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
unk_2 = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02);
unk_4 = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04);
unk_6 = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x06);
unk_7 = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x07);
unk_8 = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x08);
unk_9 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09);
index = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
s = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02);
t = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04);
normX = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x06);
normY = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x07);
normZ = BitConverter::ToInt8BE(rawData, rawDataIndex + 0x08);
alpha = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x09);
}
std::string Struct_800A57C0::GetBodySourceCode() const
std::string SkinVertex::GetBodySourceCode() const
{
return StringHelper::Sprintf("0x%02X, %i, %i, %i, %i, %i, 0x%02X", unk_0, unk_2, unk_4, unk_6,
unk_7, unk_8, unk_9);
return StringHelper::Sprintf("0x%02X, %i, %i, %i, %i, %i, 0x%02X", index, s, t, normX, normY,
normZ, alpha);
}
std::string Struct_800A57C0::GetSourceTypeName() const
std::string SkinVertex::GetSourceTypeName() const
{
return "Struct_800A57C0";
return "SkinVertex";
}
ZResourceType Struct_800A57C0::GetResourceType() const
ZResourceType SkinVertex::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t Struct_800A57C0::GetRawDataSize() const
size_t SkinVertex::GetRawDataSize() const
{
return 0x0A;
}
/* Struct_800A598C_2 */
/* SkinTransformation */
Struct_800A598C_2::Struct_800A598C_2(ZFile* nParent) : ZResource(nParent)
SkinTransformation::SkinTransformation(ZFile* nParent) : ZResource(nParent)
{
}
void Struct_800A598C_2::ParseRawData()
void SkinTransformation::ParseRawData()
{
const auto& rawData = parent->GetRawData();
unk_0 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x00);
limbIndex = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x00);
x = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x02);
y = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x04);
z = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x06);
unk_8 = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08);
scale = BitConverter::ToUInt8BE(rawData, rawDataIndex + 0x08);
}
std::string Struct_800A598C_2::GetBodySourceCode() const
std::string SkinTransformation::GetBodySourceCode() const
{
return StringHelper::Sprintf("0x%02X, %i, %i, %i, 0x%02X", unk_0, x, y, z, unk_8);
return StringHelper::Sprintf("0x%02X, %i, %i, %i, 0x%02X", limbIndex, x, y, z, scale);
}
std::string Struct_800A598C_2::GetSourceTypeName() const
std::string SkinTransformation::GetSourceTypeName() const
{
return "Struct_800A598C_2";
return "SkinTransformation";
}
ZResourceType Struct_800A598C_2::GetResourceType() const
ZResourceType SkinTransformation::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t Struct_800A598C_2::GetRawDataSize() const
size_t SkinTransformation::GetRawDataSize() const
{
return 0x0A;
}
/* Struct_800A598C */
/* SkinLimbModif */
Struct_800A598C::Struct_800A598C(ZFile* nParent) : ZResource(nParent)
SkinLimbModif::SkinLimbModif(ZFile* nParent) : ZResource(nParent)
{
}
void Struct_800A598C::ParseRawData()
void SkinLimbModif::ParseRawData()
{
const auto& rawData = parent->GetRawData();
unk_0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
unk_2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02);
vtxCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
transformCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02);
unk_4 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x04);
unk_8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08);
unk_C = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0C);
skinVertices = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08);
limbTransformations = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x0C);
if (unk_8 != 0 && GETSEGNUM(unk_8) == parent->segment)
if (skinVertices != 0 && GETSEGNUM(skinVertices) == parent->segment)
{
uint32_t unk_8_Offset = Seg2Filespace(unk_8, parent->baseAddress);
uint32_t unk_8_Offset = Seg2Filespace(skinVertices, parent->baseAddress);
unk_8_arr.reserve(unk_0);
for (size_t i = 0; i < unk_0; i++)
skinVertices_arr.reserve(vtxCount);
for (size_t i = 0; i < vtxCount; i++)
{
Struct_800A57C0 unk8_data(parent);
unk8_data.ExtractFromFile(unk_8_Offset);
unk_8_arr.push_back(unk8_data);
SkinVertex skinVertices_data(parent);
skinVertices_data.ExtractFromFile(unk_8_Offset);
skinVertices_arr.push_back(skinVertices_data);
unk_8_Offset += unk8_data.GetRawDataSize();
unk_8_Offset += skinVertices_data.GetRawDataSize();
}
}
if (unk_C != 0 && GETSEGNUM(unk_8) == parent->segment)
if (limbTransformations != 0 && GETSEGNUM(skinVertices) == parent->segment)
{
uint32_t unk_C_Offset = Seg2Filespace(unk_C, parent->baseAddress);
uint32_t unk_C_Offset = Seg2Filespace(limbTransformations, parent->baseAddress);
unk_C_arr.reserve(unk_2);
for (size_t i = 0; i < unk_2; i++)
limbTransformations_arr.reserve(transformCount);
for (size_t i = 0; i < transformCount; i++)
{
Struct_800A598C_2 unkC_data(parent);
unkC_data.ExtractFromFile(unk_C_Offset);
unk_C_arr.push_back(unkC_data);
SkinTransformation limbTransformations_data(parent);
limbTransformations_data.ExtractFromFile(unk_C_Offset);
limbTransformations_arr.push_back(limbTransformations_data);
unk_C_Offset += unkC_data.GetRawDataSize();
unk_C_Offset += limbTransformations_data.GetRawDataSize();
}
}
}
void Struct_800A598C::DeclareReferences(const std::string& prefix)
void SkinLimbModif::DeclareReferences(const std::string& prefix)
{
std::string varPrefix = prefix;
if (name != "")
varPrefix = name;
if (unk_8 != 0 && GETSEGNUM(unk_8) == parent->segment)
if (skinVertices != 0 && GETSEGNUM(skinVertices) == parent->segment)
{
const auto& res = unk_8_arr.at(0);
const auto& res = skinVertices_arr.at(0);
std::string unk_8_Str = res.GetDefaultName(varPrefix);
size_t arrayItemCnt = unk_8_arr.size();
size_t arrayItemCnt = skinVertices_arr.size();
std::string entryStr = "";
for (size_t i = 0; i < arrayItemCnt; i++)
{
auto& child = unk_8_arr[i];
auto& child = skinVertices_arr[i];
child.DeclareReferences(varPrefix);
entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str());
@@ -156,11 +156,11 @@ void Struct_800A598C::DeclareReferences(const std::string& prefix)
entryStr += "\n";
}
uint32_t unk_8_Offset = Seg2Filespace(unk_8, parent->baseAddress);
Declaration* decl = parent->GetDeclaration(unk_8_Offset);
uint32_t skinVertices_Offset = Seg2Filespace(skinVertices, parent->baseAddress);
Declaration* decl = parent->GetDeclaration(skinVertices_Offset);
if (decl == nullptr)
{
parent->AddDeclarationArray(unk_8_Offset, res.GetDeclarationAlignment(),
parent->AddDeclarationArray(skinVertices_Offset, res.GetDeclarationAlignment(),
arrayItemCnt * res.GetRawDataSize(),
res.GetSourceTypeName(), unk_8_Str, arrayItemCnt, entryStr);
}
@@ -168,17 +168,17 @@ void Struct_800A598C::DeclareReferences(const std::string& prefix)
decl->declBody = entryStr;
}
if (unk_C != 0 && GETSEGNUM(unk_C) == parent->segment)
if (limbTransformations != 0 && GETSEGNUM(limbTransformations) == parent->segment)
{
const auto& res = unk_C_arr.at(0);
const auto& res = limbTransformations_arr.at(0);
std::string unk_C_Str = res.GetDefaultName(varPrefix);
size_t arrayItemCnt = unk_C_arr.size();
size_t arrayItemCnt = limbTransformations_arr.size();
std::string entryStr = "";
for (size_t i = 0; i < arrayItemCnt; i++)
{
auto& child = unk_C_arr[i];
auto& child = limbTransformations_arr[i];
child.DeclareReferences(varPrefix);
entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str());
@@ -186,7 +186,7 @@ void Struct_800A598C::DeclareReferences(const std::string& prefix)
entryStr += "\n";
}
uint32_t unk_C_Offset = Seg2Filespace(unk_C, parent->baseAddress);
uint32_t unk_C_Offset = Seg2Filespace(limbTransformations, parent->baseAddress);
Declaration* decl = parent->GetDeclaration(unk_C_Offset);
if (decl == nullptr)
{
@@ -199,69 +199,70 @@ void Struct_800A598C::DeclareReferences(const std::string& prefix)
}
}
std::string Struct_800A598C::GetBodySourceCode() const
std::string SkinLimbModif::GetBodySourceCode() const
{
std::string unk_8_Str;
std::string skinVertices_Str;
std::string unk_C_Str;
Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Struct_800A57C0", unk_8_Str);
Globals::Instance->GetSegmentedPtrName(unk_C, parent, "Struct_800A598C_2", unk_C_Str);
Globals::Instance->GetSegmentedPtrName(skinVertices, parent, "SkinVertex", skinVertices_Str);
Globals::Instance->GetSegmentedPtrName(limbTransformations, parent, "SkinTransformation",
unk_C_Str);
std::string entryStr = StringHelper::Sprintf("\n\t\tARRAY_COUNTU(%s), ARRAY_COUNTU(%s),\n",
unk_8_Str.c_str(), unk_C_Str.c_str());
entryStr +=
StringHelper::Sprintf("\t\t%i, %s, %s\n\t", unk_4, unk_8_Str.c_str(), unk_C_Str.c_str());
skinVertices_Str.c_str(), unk_C_Str.c_str());
entryStr += StringHelper::Sprintf("\t\t%i, %s, %s\n\t", unk_4, skinVertices_Str.c_str(),
unk_C_Str.c_str());
return entryStr;
}
std::string Struct_800A598C::GetSourceTypeName() const
std::string SkinLimbModif::GetSourceTypeName() const
{
return "Struct_800A598C";
return "SkinLimbModif";
}
ZResourceType Struct_800A598C::GetResourceType() const
ZResourceType SkinLimbModif::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t Struct_800A598C::GetRawDataSize() const
size_t SkinLimbModif::GetRawDataSize() const
{
return 0x10;
}
/* Struct_800A5E28 */
/* SkinAnimatedLimbData */
Struct_800A5E28::Struct_800A5E28(ZFile* nParent) : ZResource(nParent)
SkinAnimatedLimbData::SkinAnimatedLimbData(ZFile* nParent) : ZResource(nParent)
{
}
void Struct_800A5E28::ParseRawData()
void SkinAnimatedLimbData::ParseRawData()
{
const auto& rawData = parent->GetRawData();
unk_0 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
unk_2 = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02);
unk_4 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04);
unk_8 = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08);
totalVtxCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x00);
limbModifCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + 0x02);
limbModifications = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x04);
dlist = BitConverter::ToUInt32BE(rawData, rawDataIndex + 0x08);
if (unk_4 != 0 && GETSEGNUM(unk_4) == parent->segment)
if (limbModifications != 0 && GETSEGNUM(limbModifications) == parent->segment)
{
uint32_t unk_4_Offset = Seg2Filespace(unk_4, parent->baseAddress);
uint32_t limbModifications_Offset = Seg2Filespace(limbModifications, parent->baseAddress);
unk_4_arr.reserve(unk_2);
for (size_t i = 0; i < unk_2; i++)
limbModifications_arr.reserve(limbModifCount);
for (size_t i = 0; i < limbModifCount; i++)
{
Struct_800A598C unk_4_data(parent);
unk_4_data.ExtractFromFile(unk_4_Offset);
unk_4_arr.push_back(unk_4_data);
SkinLimbModif limbModifications_data(parent);
limbModifications_data.ExtractFromFile(limbModifications_Offset);
limbModifications_arr.push_back(limbModifications_data);
unk_4_Offset += unk_4_data.GetRawDataSize();
limbModifications_Offset += limbModifications_data.GetRawDataSize();
}
}
}
void Struct_800A5E28::DeclareReferences(const std::string& prefix)
void SkinAnimatedLimbData::DeclareReferences(const std::string& prefix)
{
std::string varPrefix = prefix;
if (name != "")
@@ -269,17 +270,17 @@ void Struct_800A5E28::DeclareReferences(const std::string& prefix)
ZResource::DeclareReferences(varPrefix);
if (unk_4 != SEGMENTED_NULL && GETSEGNUM(unk_4) == parent->segment)
if (limbModifications != SEGMENTED_NULL && GETSEGNUM(limbModifications) == parent->segment)
{
const auto& res = unk_4_arr.at(0);
std::string unk_4_Str = res.GetDefaultName(varPrefix);
const auto& res = limbModifications_arr.at(0);
std::string limbModifications_Str = res.GetDefaultName(varPrefix);
size_t arrayItemCnt = unk_4_arr.size();
size_t arrayItemCnt = limbModifications_arr.size();
std::string entryStr = "";
for (size_t i = 0; i < arrayItemCnt; i++)
{
auto& child = unk_4_arr[i];
auto& child = limbModifications_arr[i];
child.DeclareReferences(varPrefix);
entryStr += StringHelper::Sprintf("\t{ %s },", child.GetBodySourceCode().c_str());
@@ -287,63 +288,67 @@ void Struct_800A5E28::DeclareReferences(const std::string& prefix)
entryStr += "\n";
}
uint32_t unk_4_Offset = Seg2Filespace(unk_4, parent->baseAddress);
Declaration* decl = parent->GetDeclaration(unk_4_Offset);
uint32_t limbModifications_Offset = Seg2Filespace(limbModifications, parent->baseAddress);
Declaration* decl = parent->GetDeclaration(limbModifications_Offset);
if (decl == nullptr)
{
parent->AddDeclarationArray(unk_4_Offset, res.GetDeclarationAlignment(),
parent->AddDeclarationArray(limbModifications_Offset, res.GetDeclarationAlignment(),
arrayItemCnt * res.GetRawDataSize(),
res.GetSourceTypeName(), unk_4_Str, arrayItemCnt, entryStr);
res.GetSourceTypeName(), limbModifications_Str,
arrayItemCnt, entryStr);
}
else
decl->declBody = entryStr;
}
if (unk_8 != SEGMENTED_NULL && GETSEGNUM(unk_8) == parent->segment)
if (dlist != SEGMENTED_NULL && GETSEGNUM(dlist) == parent->segment)
{
uint32_t unk_8_Offset = Seg2Filespace(unk_8, parent->baseAddress);
uint32_t dlist_Offset = Seg2Filespace(dlist, parent->baseAddress);
int32_t dlistLength = ZDisplayList::GetDListLength(
parent->GetRawData(), unk_8_Offset,
parent->GetRawData(), dlist_Offset,
Globals::Instance->game == ZGame::OOT_SW97 ? DListType::F3DEX : DListType::F3DZEX);
ZDisplayList* unk_8_dlist = new ZDisplayList(parent);
unk_8_dlist->ExtractFromBinary(unk_8_Offset, dlistLength);
ZDisplayList* dlist_data = new ZDisplayList(parent);
dlist_data->ExtractFromBinary(dlist_Offset, dlistLength);
std::string dListStr =
StringHelper::Sprintf("%sSkinLimbDL_%06X", varPrefix.c_str(), unk_8_Offset);
unk_8_dlist->SetName(dListStr);
unk_8_dlist->DeclareVar(varPrefix, "");
unk_8_dlist->DeclareReferences(varPrefix);
parent->AddResource(unk_8_dlist);
StringHelper::Sprintf("%sSkinLimbDL_%06X", varPrefix.c_str(), dlist_Offset);
dlist_data->SetName(dListStr);
dlist_data->DeclareVar(varPrefix, "");
dlist_data->DeclareReferences(varPrefix);
parent->AddResource(dlist_data);
}
}
std::string Struct_800A5E28::GetBodySourceCode() const
std::string SkinAnimatedLimbData::GetBodySourceCode() const
{
std::string unk_4_Str;
std::string unk_8_Str;
Globals::Instance->GetSegmentedPtrName(unk_4, parent, "Struct_800A598C", unk_4_Str);
Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Gfx", unk_8_Str);
std::string limbModifications_Str;
std::string dlist_Str;
Globals::Instance->GetSegmentedPtrName(limbModifications, parent, "SkinLimbModif",
limbModifications_Str);
Globals::Instance->GetSegmentedPtrName(dlist, parent, "Gfx", dlist_Str);
std::string entryStr = "\n";
entryStr += StringHelper::Sprintf("\t%i, ARRAY_COUNTU(%s),\n", unk_0, unk_4_Str.c_str());
entryStr += StringHelper::Sprintf("\t%s, %s\n", unk_4_Str.c_str(), unk_8_Str.c_str());
entryStr += StringHelper::Sprintf("\t%i, ARRAY_COUNTU(%s),\n", totalVtxCount,
limbModifications_Str.c_str());
entryStr +=
StringHelper::Sprintf("\t%s, %s\n", limbModifications_Str.c_str(), dlist_Str.c_str());
return entryStr;
}
std::string Struct_800A5E28::GetSourceTypeName() const
std::string SkinAnimatedLimbData::GetSourceTypeName() const
{
return "Struct_800A5E28";
return "SkinAnimatedLimbData";
}
ZResourceType Struct_800A5E28::GetResourceType() const
ZResourceType SkinAnimatedLimbData::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t Struct_800A5E28::GetRawDataSize() const
size_t SkinAnimatedLimbData::GetRawDataSize() const
{
return 0x0C;
}
+32 -34
View File
@@ -6,19 +6,17 @@
#include "ZResource.h"
// TODO: check if more types exists
enum class ZLimbSkinType
{
SkinType_0, // Segment = 0
SkinType_4 = 4, // Segment = segmented address // Struct_800A5E28
SkinType_5 = 5, // Segment = 0
SkinType_DList = 11, // Segment = DList address
SkinType_Null, // SkinLimb segment = NULL
SkinType_Animated = 4, // SkinLimb segment = SkinAnimatedLimbData*
SkinType_Normal = 11, // SkinLimb segment = Gfx*
};
class Struct_800A57C0 : public ZResource
class SkinVertex : public ZResource
{
public:
Struct_800A57C0(ZFile* nParent);
SkinVertex(ZFile* nParent);
void ParseRawData() override;
@@ -30,19 +28,19 @@ public:
size_t GetRawDataSize() const override;
protected:
uint16_t unk_0;
int16_t unk_2;
int16_t unk_4;
int8_t unk_6;
int8_t unk_7;
int8_t unk_8;
uint8_t unk_9;
uint16_t index;
int16_t s;
int16_t t;
int8_t normX;
int8_t normY;
int8_t normZ;
uint8_t alpha;
};
class Struct_800A598C_2 : public ZResource
class SkinTransformation : public ZResource
{
public:
Struct_800A598C_2(ZFile* nParent);
SkinTransformation(ZFile* nParent);
void ParseRawData() override;
@@ -54,17 +52,17 @@ public:
size_t GetRawDataSize() const override;
protected:
uint8_t unk_0;
uint8_t limbIndex;
int16_t x;
int16_t y;
int16_t z;
uint8_t unk_8;
uint8_t scale;
};
class Struct_800A598C : public ZResource
class SkinLimbModif : public ZResource
{
public:
Struct_800A598C(ZFile* nParent);
SkinLimbModif(ZFile* nParent);
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
@@ -77,20 +75,20 @@ public:
size_t GetRawDataSize() const override;
protected:
uint16_t unk_0; // Length of unk_8
uint16_t unk_2; // Length of unk_C
uint16_t unk_4; // 0 or 1 // Used as an index for unk_C
segptr_t unk_8; // Struct_800A57C0*
segptr_t unk_C; // Struct_800A598C_2*
uint16_t vtxCount; // Number of vertices in this modif entry
uint16_t transformCount; // Length of limbTransformations
uint16_t unk_4; // 0 or 1, used as an index for limbTransformations
segptr_t skinVertices; // SkinVertex*
segptr_t limbTransformations; // SkinTransformation*
std::vector<Struct_800A57C0> unk_8_arr;
std::vector<Struct_800A598C_2> unk_C_arr;
std::vector<SkinVertex> skinVertices_arr;
std::vector<SkinTransformation> limbTransformations_arr;
};
class Struct_800A5E28 : public ZResource
class SkinAnimatedLimbData : public ZResource
{
public:
Struct_800A5E28(ZFile* nParent);
SkinAnimatedLimbData(ZFile* nParent);
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
@@ -103,11 +101,11 @@ public:
size_t GetRawDataSize() const override;
protected:
uint16_t unk_0; // Vtx count
uint16_t unk_2; // Length of unk_4
segptr_t unk_4; // Struct_800A598C*
segptr_t unk_8; // Gfx*
uint16_t totalVtxCount;
uint16_t limbModifCount; // Length of limbModifications
segptr_t limbModifications; // SkinLimbModif*
segptr_t dlist; // Gfx*
std::vector<Struct_800A598C> unk_4_arr;
std::vector<SkinLimbModif> limbModifications_arr;
// ZDisplayList* unk_8_dlist = nullptr;
};
+6 -4
View File
@@ -186,7 +186,8 @@ mkdir build\ZAPD
<ClCompile Include="ImageBackend.cpp" />
<ClCompile Include="Main.cpp" />
<ClCompile Include="OtherStructs\CutsceneMM_Commands.cpp" />
<ClCompile Include="OtherStructs\Cutscene_Commands.cpp" />
<ClCompile Include="OtherStructs\CutsceneOoT_Commands.cpp" />
<ClCompile Include="OtherStructs\Cutscene_Common.cpp" />
<ClCompile Include="OtherStructs\SkinLimbStructs.cpp" />
<ClCompile Include="OutputFormatter.cpp" />
<ClCompile Include="WarningHandler.cpp" />
@@ -198,9 +199,9 @@ mkdir build\ZAPD
<ClCompile Include="ZMtx.cpp" />
<ClCompile Include="ZPath.cpp" />
<ClCompile Include="ZPlayerAnimationData.cpp" />
<ClCompile Include="ZRoom\Commands\SetActorCutsceneList.cpp" />
<ClCompile Include="ZRoom\Commands\SetAnimatedMaterialList.cpp" />
<ClCompile Include="ZRoom\Commands\SetCsCamera.cpp" />
<ClCompile Include="ZRoom\Commands\SetCutsceneEntryList.cpp" />
<ClCompile Include="ZRoom\Commands\SetMinimapChests.cpp" />
<ClCompile Include="ZRoom\Commands\SetMinimapList.cpp" />
<ClCompile Include="ZRoom\Commands\SetWorldMapVisited.cpp" />
@@ -278,7 +279,8 @@ mkdir build\ZAPD
<ClInclude Include="Globals.h" />
<ClInclude Include="ImageBackend.h" />
<ClInclude Include="OtherStructs\CutsceneMM_Commands.h" />
<ClInclude Include="OtherStructs\Cutscene_Commands.h" />
<ClInclude Include="OtherStructs\CutsceneOoT_Commands.h" />
<ClInclude Include="OtherStructs\Cutscene_Common.h" />
<ClInclude Include="OtherStructs\SkinLimbStructs.h" />
<ClInclude Include="OutputFormatter.h" />
<ClInclude Include="WarningHandler.h" />
@@ -296,9 +298,9 @@ mkdir build\ZAPD
<ClInclude Include="ZMtx.h" />
<ClInclude Include="ZPath.h" />
<ClInclude Include="ZPlayerAnimationData.h" />
<ClInclude Include="ZRoom\Commands\SetActorCutsceneList.h" />
<ClInclude Include="ZRoom\Commands\SetAnimatedMaterialList.h" />
<ClInclude Include="ZRoom\Commands\SetCsCamera.h" />
<ClInclude Include="ZRoom\Commands\SetCutsceneEntryList.h" />
<ClInclude Include="ZRoom\Commands\SetMinimapChests.h" />
<ClInclude Include="ZRoom\Commands\SetMinimapList.h" />
<ClInclude Include="ZRoom\Commands\SetWorldMapVisited.h" />
+18 -12
View File
@@ -228,9 +228,6 @@
<ClCompile Include="ZRoom\Commands\Unused1D.cpp">
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
</ClCompile>
<ClCompile Include="ZRoom\Commands\SetActorCutsceneList.cpp">
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
</ClCompile>
<ClCompile Include="ZRoom\Commands\SetCsCamera.cpp">
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
</ClCompile>
@@ -279,9 +276,6 @@
<ClCompile Include="ZCollisionPoly.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
<ClCompile Include="OtherStructs\Cutscene_Commands.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
<ClCompile Include="OtherStructs\CutsceneMM_Commands.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
@@ -297,6 +291,15 @@
<ClCompile Include="ZWaterbox.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
<ClCompile Include="OtherStructs\CutsceneOoT_Commands.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
<ClCompile Include="OtherStructs\Cutscene_Common.cpp">
<Filter>Source Files\Z64</Filter>
</ClCompile>
<ClCompile Include="ZRoom\Commands\SetCutsceneEntryList.cpp">
<Filter>Source Files\Z64\ZRoom\Commands</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="ZRoom\ZRoom.h">
@@ -497,9 +500,6 @@
<ClInclude Include="ZRoom\Commands\SetWorldMapVisited.h">
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
</ClInclude>
<ClInclude Include="ZRoom\Commands\SetActorCutsceneList.h">
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
</ClInclude>
<ClInclude Include="ZRoom\Commands\Unused1D.h">
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
</ClInclude>
@@ -548,9 +548,6 @@
<ClInclude Include="ZCollisionPoly.h">
<Filter>Header Files\Z64</Filter>
</ClInclude>
<ClInclude Include="OtherStructs\Cutscene_Commands.h">
<Filter>Header Files\Z64</Filter>
</ClInclude>
<ClInclude Include="OtherStructs\CutsceneMM_Commands.h">
<Filter>Header Files\Z64</Filter>
</ClInclude>
@@ -569,6 +566,15 @@
<ClInclude Include="ZWaterbox.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="OtherStructs\Cutscene_Common.h">
<Filter>Header Files\Z64</Filter>
</ClInclude>
<ClInclude Include="OtherStructs\CutsceneOoT_Commands.h">
<Filter>Header Files\Z64</Filter>
</ClInclude>
<ClInclude Include="ZRoom\Commands\SetCutsceneEntryList.h">
<Filter>Header Files\Z64\ZRoom\Commands</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="..\SymbolMap_OoTMqDbg.txt">
+24 -21
View File
@@ -153,7 +153,10 @@ size_t ZLinkAnimation::GetRawDataSize() const
std::string ZLinkAnimation::GetSourceTypeName() const
{
return "LinkAnimationHeader";
if (Globals::Instance->game == ZGame::MM_RETAIL)
return "PlayerAnimationHeader";
else
return "LinkAnimationHeader";
}
void ZLinkAnimation::ParseRawData()
@@ -174,8 +177,8 @@ std::string ZLinkAnimation::GetBodySourceCode() const
/* ZCurveAnimation */
TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
uint32_t fileOffset)
CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData,
uint32_t fileOffset)
: parent(parent)
{
unk_00 = BitConverter::ToUInt16BE(rawData, fileOffset + 0);
@@ -185,26 +188,26 @@ TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
unk_08 = BitConverter::ToFloatBE(rawData, fileOffset + 8);
}
TransformData::TransformData(ZFile* parent, const std::vector<uint8_t>& rawData,
uint32_t fileOffset, size_t index)
: TransformData(parent, rawData, fileOffset + index * GetRawDataSize())
CurveInterpKnot::CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData,
uint32_t fileOffset, size_t index)
: CurveInterpKnot(parent, rawData, fileOffset + index * GetRawDataSize())
{
}
std::string TransformData::GetBody([[maybe_unused]] const std::string& prefix) const
std::string CurveInterpKnot::GetBody([[maybe_unused]] const std::string& prefix) const
{
return StringHelper::Sprintf("0x%04X, 0x%04X, %i, %i, %ff", unk_00, unk_02, unk_04, unk_06,
unk_08);
}
size_t TransformData::GetRawDataSize() const
size_t CurveInterpKnot::GetRawDataSize() const
{
return 0x0C;
}
std::string TransformData::GetSourceTypeName()
std::string CurveInterpKnot::GetSourceTypeName()
{
return "TransformData";
return "CurveInterpKnot";
}
ZCurveAnimation::ZCurveAnimation(ZFile* nParent) : ZAnimation(nParent)
@@ -369,7 +372,7 @@ std::string ZCurveAnimation::GetBodySourceCode() const
std::string refIndexStr;
Globals::Instance->GetSegmentedPtrName(refIndex, parent, "u8", refIndexStr);
std::string transformDataStr;
Globals::Instance->GetSegmentedPtrName(transformData, parent, "TransformData",
Globals::Instance->GetSegmentedPtrName(transformData, parent, "CurveInterpKnot",
transformDataStr);
std::string copyValuesStr;
Globals::Instance->GetSegmentedPtrName(copyValues, parent, "s16", copyValuesStr);
@@ -390,7 +393,7 @@ DeclarationAlignment ZCurveAnimation::GetDeclarationAlignment() const
std::string ZCurveAnimation::GetSourceTypeName() const
{
return "TransformUpdateIndex";
return "CurveAnimationHeader";
}
/* ZLegacyAnimation */
@@ -423,7 +426,7 @@ void ZLegacyAnimation::ParseRawData()
ptr = jointKeyOffset;
for (int32_t i = 0; i < limbCount + 1; i++)
{
JointKey key(parent);
LegacyJointKey key(parent);
key.ExtractFromFile(ptr);
jointKeyArray.push_back(key);
@@ -495,7 +498,7 @@ std::string ZLegacyAnimation::GetBodySourceCode() const
std::string frameDataName;
std::string jointKeyName;
Globals::Instance->GetSegmentedPtrName(frameData, parent, "s16", frameDataName);
Globals::Instance->GetSegmentedPtrName(jointKey, parent, "JointKey", jointKeyName);
Globals::Instance->GetSegmentedPtrName(jointKey, parent, "LegacyJointKey", jointKeyName);
body += StringHelper::Sprintf("\t%i, %i,\n", frameCount, limbCount);
body += StringHelper::Sprintf("\t%s,\n", frameDataName.c_str());
@@ -514,11 +517,11 @@ size_t ZLegacyAnimation::GetRawDataSize() const
return 0x0C;
}
JointKey::JointKey(ZFile* nParent) : ZResource(nParent)
LegacyJointKey::LegacyJointKey(ZFile* nParent) : ZResource(nParent)
{
}
void JointKey::ParseRawData()
void LegacyJointKey::ParseRawData()
{
ZResource::ParseRawData();
@@ -531,23 +534,23 @@ void JointKey::ParseRawData()
z = BitConverter::ToInt16BE(rawData, rawDataIndex + 0x0A);
}
std::string JointKey::GetBodySourceCode() const
std::string LegacyJointKey::GetBodySourceCode() const
{
return StringHelper::Sprintf("%6i, %6i, %6i, %6i, %6i, %6i", xMax, x, yMax, y, zMax, z);
}
std::string JointKey::GetSourceTypeName() const
std::string LegacyJointKey::GetSourceTypeName() const
{
return "JointKey";
return "LegacyJointKey";
}
ZResourceType JointKey::GetResourceType() const
ZResourceType LegacyJointKey::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t JointKey::GetRawDataSize() const
size_t LegacyJointKey::GetRawDataSize() const
{
return 0x0C;
}
+12 -12
View File
@@ -67,7 +67,7 @@ public:
void ParseRawData() override;
};
class TransformData
class CurveInterpKnot
{
protected:
ZFile* parent;
@@ -84,10 +84,10 @@ protected:
float unk_08;
public:
TransformData() = default;
TransformData(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset);
TransformData(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset,
size_t index);
CurveInterpKnot() = default;
CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset);
CurveInterpKnot(ZFile* parent, const std::vector<uint8_t>& rawData, uint32_t fileOffset,
size_t index);
[[nodiscard]] std::string GetBody(const std::string& prefix) const;
@@ -102,7 +102,7 @@ protected:
///* 0x0000 */ u8* refIndex;
segptr_t refIndex = 0;
///* 0x0004 */ TransformData* transformData;
///* 0x0004 */ CurveInterpKnot* transformData;
segptr_t transformData = 0;
///* 0x0008 */ s16* copyValues;
segptr_t copyValues = 0;
@@ -114,7 +114,7 @@ protected:
uint8_t limbCount = 0;
std::vector<uint8_t> refIndexArr;
std::vector<TransformData> transformDataArr;
std::vector<CurveInterpKnot> transformDataArr;
std::vector<int16_t> copyValuesArr;
public:
@@ -132,14 +132,14 @@ public:
std::string GetSourceTypeName() const override;
};
// TransformUpdateIndex
// CurveAnimationHeader
/* ZLegacyAnimation */
class JointKey : public ZResource
class LegacyJointKey : public ZResource
{
public:
JointKey(ZFile* nParent);
LegacyJointKey(ZFile* nParent);
void ParseRawData() override;
std::string GetBodySourceCode() const override;
@@ -172,8 +172,8 @@ public:
protected:
int16_t limbCount;
segptr_t frameData; // s16*
segptr_t jointKey; // JointKey*
segptr_t jointKey; // LegacyJointKey*
std::vector<uint16_t> frameDataArray;
std::vector<JointKey> jointKeyArray;
std::vector<LegacyJointKey> jointKeyArray;
};
+3 -3
View File
@@ -99,7 +99,7 @@ void ZCollisionHeader::ParseRawData()
// usually ordered. If for some reason the data was in some other funny
// order, this would probably break.
// The most common ordering is:
// - *CamData*
// - *BgCamInfo*
// - SurfaceType
// - CollisionPoly
// - Vertices
@@ -261,7 +261,7 @@ std::string ZCollisionHeader::GetBodySourceCode() const
declaration += StringHelper::Sprintf("\t%s,\n", surfaceName.c_str());
std::string camName;
Globals::Instance->GetSegmentedPtrName(camDataAddress, parent, "CamData", camName);
Globals::Instance->GetSegmentedPtrName(camDataAddress, parent, "BgCamInfo", camName);
declaration += StringHelper::Sprintf("\t%s,\n", camName.c_str());
std::string waterBoxName;
@@ -370,7 +370,7 @@ CameraDataList::CameraDataList(ZFile* parent, const std::string& prefix,
}
parent->AddDeclarationArray(
rawDataIndex, DeclarationAlignment::Align4, entries.size() * 8, "CamData",
rawDataIndex, DeclarationAlignment::Align4, entries.size() * 8, "BgCamInfo",
StringHelper::Sprintf("%sCamDataList", prefix.c_str(), rawDataIndex), entries.size(),
declaration);
+188 -202
View File
@@ -3,7 +3,6 @@
#include <cassert>
#include "Globals.h"
#include "OtherStructs/CutsceneMM_Commands.h"
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
#include "WarningHandler.h"
@@ -129,174 +128,147 @@ void ZCutscene::ParseRawData()
CutsceneCommand* ZCutscene::GetCommandOoT(uint32_t id, offset_t currentPtr) const
{
CutsceneCommands cmdID = static_cast<CutsceneCommands>(id);
CutsceneOoT_CommandType cmdID = static_cast<CutsceneOoT_CommandType>(id);
const auto& rawData = parent->GetRawData();
switch (id)
{
case 10: // CutsceneCommands::SetPlayerAction
case 15: // CutsceneCommands::SetActorAction1
case 17:
case 18:
case 23:
case 34:
case 39:
case 46:
case 76:
case 85:
case 93:
case 105:
case 107:
case 110:
case 119:
case 123:
case 138:
case 139:
case 144:
case 14: // CutsceneCommands::SetActorAction2
case 16:
case 24:
case 35:
case 40:
case 48:
case 64:
case 68:
case 70:
case 78:
case 80:
case 94:
case 116:
case 118:
case 120:
case 125:
case 131:
case 141:
case 25: // CutsceneCommands::SetActorAction3
case 36:
case 41:
case 50:
case 67:
case 69:
case 72:
case 81:
case 106:
case 117:
case 121:
case 126:
case 132:
case 29: // CutsceneCommands::SetActorAction4
case 37:
case 42:
case 51:
case 53:
case 63:
case 65:
case 66:
case 75:
case 82:
case 108:
case 127:
case 133:
case 30: // CutsceneCommands::SetActorAction5
case 38:
case 43:
case 47:
case 54:
case 79:
case 83:
case 128:
case 135:
case 44: // CutsceneCommands::SetActorAction6
case 55:
case 77:
case 84:
case 90:
case 129:
case 136:
case 31: // CutsceneCommands::SetActorAction7
case 52:
case 57:
case 58:
case 88:
case 115:
case 130:
case 137:
case 49: // CutsceneCommands::SetActorAction8
case 60:
case 89:
case 111:
case 114:
case 134:
case 142:
case 62: // CutsceneCommands::SetActorAction9
case 143: // CutsceneCommands::SetActorAction10
case 74:
return new CutsceneCommand_ActorAction(rawData, currentPtr);
case 0x0B:
case 0x0D:
case 0x1A:
case 0x1B:
case 0x1C:
case 0x20:
case 0x21:
case 0x3B:
case 0x3D:
case 0x47:
case 0x49:
case 0x6D:
case 0x15:
case 0x16:
case 0x70:
case 0x71:
return new CutsceneCommand_GenericCmd(rawData, currentPtr, cmdID);
}
switch (cmdID)
{
case CutsceneCommands::Misc:
case CutsceneCommands::SetLighting:
case CutsceneCommands::PlayBGM:
case CutsceneCommands::StopBGM:
case CutsceneCommands::FadeBGM:
return new CutsceneCommand_GenericCmd(rawData, currentPtr, cmdID);
case CutsceneOoT_CommandType::CS_CMD_PLAYER_CUE:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_1:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_8_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_8:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_8:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_9:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_10:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_8:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_9:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_8:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_2:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_9:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_11:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_10:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_9:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_11:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_10:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_12:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_3:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_4:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_12:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_10:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_13:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_13:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_14:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_11:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_14:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_15:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_12:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_11:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_16:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_2_13:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_3_12:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_5:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_4_8:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_5_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_6_7:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_15:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_16:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_1_17:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_7_6:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_9_0:
case CutsceneOoT_CommandType::CS_CMD_ACTOR_CUE_0_17:
return new CutsceneOoTCommand_ActorCue(rawData, currentPtr);
case CutsceneCommands::SetCameraPos:
case CutsceneCommands::SetCameraFocus:
case CutsceneCommands::SetCameraPosLink:
case CutsceneCommands::SetCameraFocusLink:
return new CutsceneCommandSetCameraPos(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_MISC:
case CutsceneOoT_CommandType::CS_CMD_LIGHT_SETTING:
case CutsceneOoT_CommandType::CS_CMD_START_SEQ:
case CutsceneOoT_CommandType::CS_CMD_STOP_SEQ:
case CutsceneOoT_CommandType::CS_CMD_FADE_OUT_SEQ:
return new CutsceneOoTCommand_GenericCmd(rawData, currentPtr, cmdID);
case CutsceneCommands::Cmd07:
break;
case CutsceneCommands::Cmd08:
break;
case CutsceneCommands::Cmd09:
return new CutsceneCommand_Rumble(rawData, currentPtr);
case CutsceneCommands::Textbox:
return new CutsceneCommand_TextBox(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE:
case CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE:
case CutsceneOoT_CommandType::CS_CMD_CAM_EYE_SPLINE_REL_TO_PLAYER:
case CutsceneOoT_CommandType::CS_CMD_CAM_AT_SPLINE_REL_TO_PLAYER:
return new CutsceneOoTCommand_GenericCameraCmd(rawData, currentPtr);
case CutsceneCommands::SetPlayerAction:
case CutsceneCommands::SetActorAction1:
case CutsceneCommands::SetActorAction2:
case CutsceneCommands::SetActorAction3:
case CutsceneCommands::SetActorAction4:
case CutsceneCommands::SetActorAction5:
case CutsceneCommands::SetActorAction6:
case CutsceneCommands::SetActorAction7:
case CutsceneCommands::SetActorAction8:
case CutsceneCommands::SetActorAction9:
case CutsceneCommands::SetActorAction10:
case CutsceneOoT_CommandType::CS_CMD_RUMBLE_CONTROLLER:
return new CutsceneOoTCommand_Rumble(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_TEXT:
return new CutsceneOoTCommand_Text(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_TRANSITION:
return new CutsceneOoTCommand_Transition(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_TIME:
return new CutsceneCommand_Time(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_DESTINATION:
return new CutsceneOoTCommand_Destination(rawData, currentPtr);
case CutsceneOoT_CommandType::CS_CMD_CAM_EYE:
case CutsceneOoT_CommandType::CS_CMD_CAM_AT:
break;
case CutsceneCommands::SetSceneTransFX:
return new CutsceneCommandSceneTransFX(rawData, currentPtr);
case CutsceneCommands::SetTime:
return new CutsceneCommand_SetTime(rawData, currentPtr);
case CutsceneCommands::Terminator:
return new CutsceneCommand_Terminator(rawData, currentPtr);
default:
std::string errorHeader =
StringHelper::Sprintf("Warning: Invalid cutscene command ID: '0x%04X'", cmdID);
return new CutsceneOoTCommand_GenericCmd(rawData, currentPtr, cmdID);
}
return nullptr;
@@ -304,60 +276,74 @@ CutsceneCommand* ZCutscene::GetCommandOoT(uint32_t id, offset_t currentPtr) cons
CutsceneCommand* ZCutscene::GetCommandMM(uint32_t id, offset_t currentPtr) const
{
CutsceneMMCommands cmdID = static_cast<CutsceneMMCommands>(id);
CutsceneMM_CommandType cmdID = static_cast<CutsceneMM_CommandType>(id);
const auto& rawData = parent->GetRawData();
if (((id >= 100) && (id < 150)) || (id == 201) || ((id >= 450) && (id < 600)))
if (((id >= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_100) &&
(id <= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_149)) ||
(id == (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_201) ||
((id >= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_450) &&
(id <= (uint32_t)CutsceneMM_CommandType::CS_CMD_ACTOR_CUE_599)))
{
return new CutsceneCommand_ActorAction(rawData, currentPtr);
return new CutsceneMMCommand_ActorCue(rawData, currentPtr);
}
switch (cmdID)
{
case CutsceneMMCommands::CS_CMD_MISC:
case CutsceneMMCommands::CS_CMD_SET_LIGHTING:
case CutsceneMMCommands::CS_CMD_SCENE_TRANS_FX:
case CutsceneMMCommands::CS_CMD_MOTIONBLUR:
case CutsceneMMCommands::CS_CMD_GIVETATL:
case CutsceneMMCommands::CS_CMD_PLAYSEQ:
case CutsceneMMCommands::CS_CMD_130:
case CutsceneMMCommands::CS_CMD_131:
case CutsceneMMCommands::CS_CMD_132:
case CutsceneMMCommands::CS_CMD_STOPSEQ:
case CutsceneMMCommands::CS_CMD_PLAYAMBIENCE:
case CutsceneMMCommands::CS_CMD_FADEAMBIENCE:
case CutsceneMMCommands::CS_CMD_TERMINATOR:
case CutsceneMMCommands::CS_CMD_CHOOSE_CREDITS_SCENES:
case CutsceneMM_CommandType::CS_CMD_MISC:
case CutsceneMM_CommandType::CS_CMD_LIGHT_SETTING:
case CutsceneMM_CommandType::CS_CMD_TRANSITION:
case CutsceneMM_CommandType::CS_CMD_MOTION_BLUR:
case CutsceneMM_CommandType::CS_CMD_GIVE_TATL:
case CutsceneMM_CommandType::CS_CMD_START_SEQ:
case CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_2:
case CutsceneMM_CommandType::CS_CMD_SFX_REVERB_INDEX_1:
case CutsceneMM_CommandType::CS_CMD_MODIFY_SEQ:
case CutsceneMM_CommandType::CS_CMD_STOP_SEQ:
case CutsceneMM_CommandType::CS_CMD_START_AMBIENCE:
case CutsceneMM_CommandType::CS_CMD_FADE_OUT_AMBIENCE:
case CutsceneMM_CommandType::CS_CMD_DESTINATION:
case CutsceneMM_CommandType::CS_CMD_CHOOSE_CREDITS_SCENES:
case CutsceneMMCommands::CS_CMD_UNK_FA:
case CutsceneMMCommands::CS_CMD_UNK_FE:
case CutsceneMMCommands::CS_CMD_UNK_FF:
case CutsceneMMCommands::CS_CMD_UNK_100:
case CutsceneMMCommands::CS_CMD_UNK_101:
case CutsceneMMCommands::CS_CMD_UNK_102:
case CutsceneMMCommands::CS_CMD_UNK_103:
case CutsceneMMCommands::CS_CMD_UNK_104:
case CutsceneMMCommands::CS_CMD_UNK_105:
case CutsceneMMCommands::CS_CMD_UNK_108:
case CutsceneMMCommands::CS_CMD_UNK_109:
case CutsceneMMCommands::CS_CMD_UNK_12D:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FA:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FE:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_FF:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_100:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_101:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_102:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_103:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_104:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_105:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_108:
case CutsceneMM_CommandType::CS_CMD_UNK_DATA_109:
return new CutsceneMMCommand_GenericCmd(rawData, currentPtr, cmdID);
case CutsceneMMCommands::CS_CMD_TEXTBOX:
return new CutsceneCommand_TextBox(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_CAMERA:
return new CutsceneMMCommand_Camera(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_FADESCREEN:
return new CutsceneMMCommand_FadeScreen(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_FADESEQ:
return new CutsceneMMCommand_FadeSeq(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_SETTIME:
return new CutsceneCommand_SetTime(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_SET_PLAYER_ACTION:
return new CutsceneCommand_ActorAction(rawData, currentPtr);
case CutsceneMMCommands::CS_CMD_RUMBLE:
return new CutsceneCommand_Rumble(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_TEXT:
return new CutsceneMMCommand_Text(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_CAMERA_SPLINE:
return new CutsceneMMCommand_Spline(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_TRANSITION_GENERAL:
return new CutsceneMMCommand_TransitionGeneral(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_FADE_OUT_SEQ:
return new CutsceneMMCommand_FadeOutSeq(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_TIME:
return new CutsceneCommand_Time(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_PLAYER_CUE:
return new CutsceneMMCommand_ActorCue(rawData, currentPtr);
case CutsceneMM_CommandType::CS_CMD_RUMBLE:
return new CutsceneMMCommand_Rumble(rawData, currentPtr);
default:
std::string errorHeader =
StringHelper::Sprintf("Warning: Invalid cutscene command ID: '0x%04X'", cmdID);
return new CutsceneMMCommand_GenericCmd(rawData, currentPtr, cmdID);
}
return nullptr;
+2 -1
View File
@@ -5,7 +5,8 @@
#include <vector>
#include "tinyxml2.h"
#include "OtherStructs/Cutscene_Commands.h"
#include "OtherStructs/CutsceneOoT_Commands.h"
#include "OtherStructs/CutsceneMM_Commands.h"
#include "ZFile.h"
#include "ZResource.h"
+3 -3
View File
@@ -106,7 +106,7 @@ void ZLimb::ParseRawData()
skinSegmentType =
static_cast<ZLimbSkinType>(BitConverter::ToInt32BE(rawData, rawDataIndex + 8));
skinSegment = BitConverter::ToUInt32BE(rawData, rawDataIndex + 12);
if (skinSegmentType == ZLimbSkinType::SkinType_4)
if (skinSegmentType == ZLimbSkinType::SkinType_Animated)
{
if (skinSegment != 0 && GETSEGNUM(skinSegment) == parent->segment)
{
@@ -181,7 +181,7 @@ void ZLimb::DeclareReferences(const std::string& prefix)
case ZLimbType::Skin:
switch (skinSegmentType)
{
case ZLimbSkinType::SkinType_4:
case ZLimbSkinType::SkinType_Animated:
if (skinSegment != 0 && GETSEGNUM(skinSegment) == parent->segment)
{
segmentStruct.DeclareReferences(varPrefix);
@@ -189,7 +189,7 @@ void ZLimb::DeclareReferences(const std::string& prefix)
}
break;
case ZLimbSkinType::SkinType_DList:
case ZLimbSkinType::SkinType_Normal:
DeclareDList(skinSegment, varPrefix, "");
break;
+3 -3
View File
@@ -28,9 +28,9 @@ public:
ZLimbType type = ZLimbType::Standard;
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only
segptr_t skinSegment = 0; // Skin only
Struct_800A5E28 segmentStruct; // Skin only
ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_Null; // Skin only
segptr_t skinSegment = 0; // Skin only
SkinAnimatedLimbData segmentStruct; // Skin only
// Legacy only
float legTransX, legTransY, legTransZ; // Vec3f
@@ -2,6 +2,7 @@
#include "Utils/BitConverter.h"
#include "Utils/StringHelper.h"
#include "Globals.h"
SetCameraSettings::SetCameraSettings(ZFile* nParent) : ZRoomCommand(nParent)
{
@@ -16,8 +17,12 @@ void SetCameraSettings::ParseRawData()
std::string SetCameraSettings::GetBodySourceCode() const
{
return StringHelper::Sprintf("SCENE_CMD_MISC_SETTINGS(0x%02X, 0x%08X)", cameraMovement,
mapHighlight);
if (Globals::Instance->game == ZGame::MM_RETAIL)
return StringHelper::Sprintf("SCENE_CMD_SET_REGION_VISITED(0x%02X, 0x%08X)", cameraMovement,
mapHighlight);
else
return StringHelper::Sprintf("SCENE_CMD_MISC_SETTINGS(0x%02X, 0x%08X)", cameraMovement,
mapHighlight);
}
std::string SetCameraSettings::GetCommandCName() const
@@ -21,7 +21,7 @@ void SetCsCamera::ParseRawData()
cameras.reserve(numCameras);
for (int32_t i = 0; i < numCameras; i++)
{
CsCameraEntry entry(parent->GetRawData(), currentPtr);
ActorCsCamInfo entry(parent->GetRawData(), currentPtr);
numPoints += entry.GetNumPoints();
currentPtr += entry.GetRawDataSize();
@@ -105,7 +105,7 @@ void SetCsCamera::DeclareReferences(const std::string& prefix)
std::string SetCsCamera::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CsCameraEntry", listName);
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorCsCamInfo", listName);
return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_CAM_LIST(%i, %s)", cameras.size(),
listName.c_str());
}
@@ -120,7 +120,7 @@ RoomCommand SetCsCamera::GetRoomCommand() const
return RoomCommand::SetCsCamera;
}
CsCameraEntry::CsCameraEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
ActorCsCamInfo::ActorCsCamInfo(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
: baseOffset(rawDataIndex), type(BitConverter::ToInt16BE(rawData, rawDataIndex + 0)),
numPoints(BitConverter::ToInt16BE(rawData, rawDataIndex + 2))
{
@@ -128,27 +128,27 @@ CsCameraEntry::CsCameraEntry(const std::vector<uint8_t>& rawData, uint32_t rawDa
segmentOffset = GETSEGOFFSET(camAddress);
}
std::string CsCameraEntry::GetSourceTypeName() const
std::string ActorCsCamInfo::GetSourceTypeName() const
{
return "CsCameraEntry";
return "ActorCsCamInfo";
}
int32_t CsCameraEntry::GetRawDataSize() const
int32_t ActorCsCamInfo::GetRawDataSize() const
{
return 8;
}
int16_t CsCameraEntry::GetNumPoints() const
int16_t ActorCsCamInfo::GetNumPoints() const
{
return numPoints;
}
segptr_t CsCameraEntry::GetCamAddress() const
segptr_t ActorCsCamInfo::GetCamAddress() const
{
return camAddress;
}
uint32_t CsCameraEntry::GetSegmentOffset() const
uint32_t ActorCsCamInfo::GetSegmentOffset() const
{
return segmentOffset;
}
+3 -3
View File
@@ -3,10 +3,10 @@
#include "ZRoom/ZRoomCommand.h"
#include "ZVector.h"
class CsCameraEntry
class ActorCsCamInfo
{
public:
CsCameraEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
ActorCsCamInfo(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
std::string GetSourceTypeName() const;
int32_t GetRawDataSize() const;
@@ -25,7 +25,7 @@ public:
class SetCsCamera : public ZRoomCommand
{
public:
std::vector<CsCameraEntry> cameras;
std::vector<ActorCsCamInfo> cameras;
std::vector<ZVector> points;
SetCsCamera(ZFile* nParent);
@@ -1,4 +1,4 @@
#include "SetActorCutsceneList.h"
#include "SetCutsceneEntryList.h"
#include "Globals.h"
#include "Utils/BitConverter.h"
@@ -19,7 +19,7 @@ void SetActorCutsceneList::ParseRawData()
cutscenes.reserve(numCutscenes);
for (int32_t i = 0; i < numCutscenes; i++)
{
ActorCutsceneEntry entry(parent->GetRawData(), currentPtr);
CutsceneEntry entry(parent->GetRawData(), currentPtr);
cutscenes.push_back(entry);
currentPtr += 16;
@@ -55,7 +55,7 @@ void SetActorCutsceneList::DeclareReferences(const std::string& prefix)
std::string SetActorCutsceneList::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorCutscene", listName);
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneEntry", listName);
return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_LIST(%i, %s)", cutscenes.size(),
listName.c_str());
}
@@ -70,25 +70,34 @@ RoomCommand SetActorCutsceneList::GetRoomCommand() const
return RoomCommand::SetActorCutsceneList;
}
ActorCutsceneEntry::ActorCutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
CutsceneEntry::CutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
: priority(BitConverter::ToInt16BE(rawData, rawDataIndex + 0)),
length(BitConverter::ToInt16BE(rawData, rawDataIndex + 2)),
unk4(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)),
unk6(BitConverter::ToInt16BE(rawData, rawDataIndex + 6)),
additionalCutscene(BitConverter::ToInt16BE(rawData, rawDataIndex + 8)),
sound(rawData[rawDataIndex + 0xA]), unkB(rawData[rawDataIndex + 0xB]),
unkC(BitConverter::ToInt16BE(rawData, rawDataIndex + 0xC)), unkE(rawData[rawDataIndex + 0xE]),
letterboxSize(rawData[rawDataIndex + 0xF])
csCamId(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)),
scriptIndex(BitConverter::ToInt16BE(rawData, rawDataIndex + 6)),
additionalCsId(BitConverter::ToInt16BE(rawData, rawDataIndex + 8)),
endSfx(rawData[rawDataIndex + 0xA]), customValue(rawData[rawDataIndex + 0xB]),
hudVisibility(BitConverter::ToInt16BE(rawData, rawDataIndex + 0xC)),
endCam(rawData[rawDataIndex + 0xE]), letterboxSize(rawData[rawDataIndex + 0xF])
{
}
std::string ActorCutsceneEntry::GetBodySourceCode() const
std::string CutsceneEntry::GetBodySourceCode() const
{
return StringHelper::Sprintf("%i, %i, %i, %i, %i, %i, %i, %i, %i, %i", priority, length, unk4,
unk6, additionalCutscene, sound, unkB, unkC, unkE, letterboxSize);
EnumData* enumData = &Globals::Instance->cfg.enumData;
if (enumData->endSfx.find(endSfx) != enumData->endSfx.end())
return StringHelper::Sprintf("%i, %i, %i, %i, %i, %s, %i, %i, %i, %i", priority, length,
csCamId, scriptIndex, additionalCsId,
enumData->endSfx[endSfx].c_str(), customValue, hudVisibility,
endCam, letterboxSize);
else
return StringHelper::Sprintf("%i, %i, %i, %i, %i, %i, %i, %i, %i, %i", priority, length,
csCamId, scriptIndex, additionalCsId, endSfx, customValue,
hudVisibility, endCam, letterboxSize);
}
std::string ActorCutsceneEntry::GetSourceTypeName() const
std::string CutsceneEntry::GetSourceTypeName() const
{
return "ActorCutscene";
return "CutsceneEntry";
}
@@ -2,22 +2,22 @@
#include "ZRoom/ZRoomCommand.h"
class ActorCutsceneEntry
class CutsceneEntry
{
protected:
int16_t priority;
int16_t length;
int16_t unk4;
int16_t unk6;
int16_t additionalCutscene;
uint8_t sound;
uint8_t unkB;
int16_t unkC;
uint8_t unkE;
int16_t csCamId;
int16_t scriptIndex;
int16_t additionalCsId;
uint8_t endSfx;
uint8_t customValue;
int16_t hudVisibility;
uint8_t endCam;
uint8_t letterboxSize;
public:
ActorCutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
CutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
std::string GetBodySourceCode() const;
std::string GetSourceTypeName() const;
@@ -26,7 +26,7 @@ public:
class SetActorCutsceneList : public ZRoomCommand
{
public:
std::vector<ActorCutsceneEntry> cutscenes;
std::vector<CutsceneEntry> cutscenes;
SetActorCutsceneList(ZFile* nParent);
+15 -10
View File
@@ -23,7 +23,7 @@ void SetCutscenes::ParseRawData()
cutsceneEntries.reserve(numCutscenes);
for (uint8_t i = 0; i < numCutscenes; i++)
{
CutsceneEntry entry(parent->GetRawData(), currentPtr);
CutsceneScriptEntry entry(parent->GetRawData(), currentPtr);
cutsceneEntries.push_back(entry);
currentPtr += 8;
}
@@ -32,6 +32,7 @@ void SetCutscenes::ParseRawData()
void SetCutscenes::DeclareReferences(const std::string& prefix)
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
std::string varPrefix = name;
if (varPrefix == "")
varPrefix = prefix;
@@ -62,10 +63,14 @@ void SetCutscenes::DeclareReferences(const std::string& prefix)
Globals::Instance->GetSegmentedPtrName(entry.segmentPtr, parent, "CutsceneData",
csName);
declaration +=
StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, 0x%02X },", csName.c_str(),
entry.exit, entry.entrance, entry.flag);
if (enumData->spawnFlag.find(entry.flag) != enumData->spawnFlag.end())
declaration += StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, %s },",
csName.c_str(), entry.exit, entry.entrance,
enumData->spawnFlag[entry.flag].c_str());
else
declaration +=
StringHelper::Sprintf(" { %s, 0x%04X, 0x%02X, 0x%02X },", csName.c_str(),
entry.exit, entry.entrance, entry.flag);
if (i + 1 < numCutscenes)
declaration += "\n";
@@ -73,8 +78,8 @@ void SetCutscenes::DeclareReferences(const std::string& prefix)
}
parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4,
cutsceneEntries.size() * 8, "CutsceneEntry",
StringHelper::Sprintf("%sCutsceneEntryList_%06X",
cutsceneEntries.size() * 8, "CutsceneScriptEntry",
StringHelper::Sprintf("%sCutsceneScriptEntryList_%06X",
zRoom->GetName().c_str(), segmentOffset),
cutsceneEntries.size(), declaration);
}
@@ -102,8 +107,8 @@ std::string SetCutscenes::GetBodySourceCode() const
if (Globals::Instance->game == ZGame::MM_RETAIL)
{
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneEntry", listName);
return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_LIST(%i, %s)", numCutscenes,
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneScriptEntry", listName);
return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_SCRIPT_LIST(%i, %s)", numCutscenes,
listName.c_str());
}
@@ -121,7 +126,7 @@ RoomCommand SetCutscenes::GetRoomCommand() const
return RoomCommand::SetCutscenes;
}
CutsceneEntry::CutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
CutsceneScriptEntry::CutsceneScriptEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
: segmentPtr(BitConverter::ToInt32BE(rawData, rawDataIndex + 0)),
exit(BitConverter::ToInt16BE(rawData, rawDataIndex + 4)), entrance(rawData[rawDataIndex + 6]),
flag(rawData[rawDataIndex + 7])
@@ -3,10 +3,10 @@
#include "ZCutscene.h"
#include "ZRoom/ZRoomCommand.h"
class CutsceneEntry
class CutsceneScriptEntry
{
public:
CutsceneEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
CutsceneScriptEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
segptr_t segmentPtr;
uint16_t exit;
@@ -17,8 +17,8 @@ public:
class SetCutscenes : public ZRoomCommand
{
public:
std::vector<CutsceneEntry> cutsceneEntries; // (MM Only)
uint8_t numCutscenes; // (MM Only)
std::vector<CutsceneScriptEntry> cutsceneEntries; // (MM Only)
uint8_t numCutscenes; // (MM Only)
SetCutscenes(ZFile* nParent);
@@ -30,7 +30,7 @@ void SetEntranceList::ParseRawDataLate()
entrances.reserve(numEntrances);
for (uint32_t i = 0; i < numEntrances; i++)
{
EntranceEntry entry(parent->GetRawData(), currentPtr);
Spawn entry(parent->GetRawData(), currentPtr);
entrances.push_back(entry);
currentPtr += 2;
@@ -55,16 +55,25 @@ void SetEntranceList::DeclareReferencesLate([[maybe_unused]] const std::string&
std::string varName =
StringHelper::Sprintf("%sEntranceList0x%06X", prefix.c_str(), segmentOffset);
parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4,
entrances.size() * 2, "EntranceEntry", varName,
entrances.size(), declaration);
if (Globals::Instance->game != ZGame::MM_RETAIL)
parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4,
entrances.size() * 2, "Spawn", varName, entrances.size(),
declaration);
else
parent->AddDeclarationArray(segmentOffset, DeclarationAlignment::Align4,
entrances.size() * 2, "EntranceEntry", varName,
entrances.size(), declaration);
}
}
std::string SetEntranceList::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EntranceEntry", listName);
if (Globals::Instance->game != ZGame::MM_RETAIL)
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Spawn", listName);
else
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EntranceEntry", listName);
return StringHelper::Sprintf("SCENE_CMD_ENTRANCE_LIST(%s)", listName.c_str());
}
@@ -78,13 +87,13 @@ RoomCommand SetEntranceList::GetRoomCommand() const
return RoomCommand::SetEntranceList;
}
EntranceEntry::EntranceEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
Spawn::Spawn(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex)
{
startPositionIndex = rawData.at(rawDataIndex + 0);
roomToLoad = rawData.at(rawDataIndex + 1);
}
std::string EntranceEntry::GetBodySourceCode() const
std::string Spawn::GetBodySourceCode() const
{
return StringHelper::Sprintf("0x%02X, 0x%02X", startPositionIndex, roomToLoad);
}
@@ -2,13 +2,13 @@
#include "ZRoom/ZRoomCommand.h"
class EntranceEntry
class Spawn
{
public:
uint8_t startPositionIndex;
uint8_t roomToLoad;
EntranceEntry(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
Spawn(const std::vector<uint8_t>& rawData, uint32_t rawDataIndex);
std::string GetBodySourceCode() const;
};
@@ -16,7 +16,7 @@ public:
class SetEntranceList : public ZRoomCommand
{
public:
std::vector<EntranceEntry> entrances;
std::vector<Spawn> entrances;
SetEntranceList(ZFile* nParent);
@@ -34,18 +34,28 @@ void SetLightingSettings::DeclareReferences(const std::string& prefix)
declaration += "\n";
}
parent->AddDeclarationArray(
segmentOffset, DeclarationAlignment::Align4,
settings.size() * settings.front().GetRawDataSize(), "LightSettings",
StringHelper::Sprintf("%sLightSettings0x%06X", prefix.c_str(), segmentOffset),
settings.size(), declaration);
if (Globals::Instance->game != ZGame::MM_RETAIL)
parent->AddDeclarationArray(
segmentOffset, DeclarationAlignment::Align4,
settings.size() * settings.front().GetRawDataSize(), "EnvLightSettings",
StringHelper::Sprintf("%sLightSettings0x%06X", prefix.c_str(), segmentOffset),
settings.size(), declaration);
else
parent->AddDeclarationArray(
segmentOffset, DeclarationAlignment::Align4,
settings.size() * settings.front().GetRawDataSize(), "LightSettings",
StringHelper::Sprintf("%sLightSettings0x%06X", prefix.c_str(), segmentOffset),
settings.size(), declaration);
}
}
std::string SetLightingSettings::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightSettings", listName);
if (Globals::Instance->game != ZGame::MM_RETAIL)
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EnvLightSettings", listName);
else
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightSettings", listName);
return StringHelper::Sprintf("SCENE_CMD_ENV_LIGHT_SETTINGS(%i, %s)", settings.size(),
listName.c_str());
}
+43 -42
View File
@@ -24,7 +24,7 @@ void SetMesh::ParseRawData()
switch (meshHeaderType)
{
case 0:
polyType = std::make_shared<PolygonType2>(parent, segmentOffset, zRoom);
polyType = std::make_shared<RoomShapeCullable>(parent, segmentOffset, zRoom);
break;
case 1:
@@ -32,7 +32,7 @@ void SetMesh::ParseRawData()
break;
case 2:
polyType = std::make_shared<PolygonType2>(parent, segmentOffset, zRoom);
polyType = std::make_shared<RoomShapeCullable>(parent, segmentOffset, zRoom);
break;
default:
@@ -79,7 +79,7 @@ std::string SetMesh::GetBodySourceCode() const
{
std::string list;
Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "", list);
return StringHelper::Sprintf("SCENE_CMD_MESH(%s)", list.c_str());
return StringHelper::Sprintf("SCENE_CMD_ROOM_SHAPE(%s)", list.c_str());
}
std::string SetMesh::GetCommandCName() const
@@ -92,11 +92,11 @@ RoomCommand SetMesh::GetRoomCommand() const
return RoomCommand::SetMesh;
}
PolygonDlist::PolygonDlist(ZFile* nParent) : ZResource(nParent)
RoomShapeDListsEntry::RoomShapeDListsEntry(ZFile* nParent) : ZResource(nParent)
{
}
void PolygonDlist::ParseRawData()
void RoomShapeDListsEntry::ParseRawData()
{
const auto& rawData = parent->GetRawData();
switch (polyType)
@@ -118,13 +118,13 @@ void PolygonDlist::ParseRawData()
}
}
void PolygonDlist::DeclareReferences(const std::string& prefix)
void RoomShapeDListsEntry::DeclareReferences(const std::string& prefix)
{
opaDList = MakeDlist(opa, prefix);
xluDList = MakeDlist(xlu, prefix);
}
std::string PolygonDlist::GetBodySourceCode() const
std::string RoomShapeDListsEntry::GetBodySourceCode() const
{
std::string bodyStr;
std::string opaStr;
@@ -142,7 +142,7 @@ std::string PolygonDlist::GetBodySourceCode() const
return bodyStr;
}
void PolygonDlist::GetSourceOutputCode(const std::string& prefix)
void RoomShapeDListsEntry::GetSourceOutputCode(const std::string& prefix)
{
std::string bodyStr = StringHelper::Sprintf("\n\t%s\n", GetBodySourceCode().c_str());
@@ -154,25 +154,25 @@ void PolygonDlist::GetSourceOutputCode(const std::string& prefix)
decl->declBody = bodyStr;
}
std::string PolygonDlist::GetSourceTypeName() const
std::string RoomShapeDListsEntry::GetSourceTypeName() const
{
switch (polyType)
{
case 2:
return "PolygonDlist2";
return "RoomShapeCullableEntry";
default:
return "PolygonDlist";
return "RoomShapeDListsEntry";
}
}
ZResourceType PolygonDlist::GetResourceType() const
ZResourceType RoomShapeDListsEntry::GetResourceType() const
{
// TODO
return ZResourceType::Error;
}
size_t PolygonDlist::GetRawDataSize() const
size_t RoomShapeDListsEntry::GetRawDataSize() const
{
switch (polyType)
{
@@ -184,12 +184,13 @@ size_t PolygonDlist::GetRawDataSize() const
}
}
void PolygonDlist::SetPolyType(uint8_t nPolyType)
void RoomShapeDListsEntry::SetPolyType(uint8_t nPolyType)
{
polyType = nPolyType;
}
ZDisplayList* PolygonDlist::MakeDlist(segptr_t ptr, [[maybe_unused]] const std::string& prefix)
ZDisplayList* RoomShapeDListsEntry::MakeDlist(segptr_t ptr,
[[maybe_unused]] const std::string& prefix)
{
if (ptr == 0)
{
@@ -210,15 +211,15 @@ ZDisplayList* PolygonDlist::MakeDlist(segptr_t ptr, [[maybe_unused]] const std::
return dlist;
}
/* BgImage */
/* RoomShapeImageMultiBgEntry */
BgImage::BgImage(ZFile* nParent) : ZResource(nParent)
RoomShapeImageMultiBgEntry::RoomShapeImageMultiBgEntry(ZFile* nParent) : ZResource(nParent)
{
}
BgImage::BgImage(bool nIsSubStruct, const std::string& prefix, uint32_t nRawDataIndex,
ZFile* nParent)
: BgImage(nParent)
RoomShapeImageMultiBgEntry::RoomShapeImageMultiBgEntry(bool nIsSubStruct, const std::string& prefix,
uint32_t nRawDataIndex, ZFile* nParent)
: RoomShapeImageMultiBgEntry(nParent)
{
rawDataIndex = nRawDataIndex;
parent = nParent;
@@ -230,7 +231,7 @@ BgImage::BgImage(bool nIsSubStruct, const std::string& prefix, uint32_t nRawData
sourceBackground = MakeBackground(source, prefix);
}
void BgImage::ParseRawData()
void RoomShapeImageMultiBgEntry::ParseRawData()
{
size_t pad = 0x00;
const auto& rawData = parent->GetRawData();
@@ -252,7 +253,7 @@ void BgImage::ParseRawData()
tlutCount = BitConverter::ToUInt16BE(rawData, rawDataIndex + pad + 0x14);
}
ZBackground* BgImage::MakeBackground(segptr_t ptr, const std::string& prefix)
ZBackground* RoomShapeImageMultiBgEntry::MakeBackground(segptr_t ptr, const std::string& prefix)
{
if (ptr == 0)
return nullptr;
@@ -272,12 +273,12 @@ ZBackground* BgImage::MakeBackground(segptr_t ptr, const std::string& prefix)
return background;
}
size_t BgImage::GetRawDataSize() const
size_t RoomShapeImageMultiBgEntry::GetRawDataSize() const
{
return 0x1C;
}
std::string BgImage::GetBodySourceCode() const
std::string RoomShapeImageMultiBgEntry::GetBodySourceCode() const
{
std::string bodyStr = " ";
if (!isSubStruct)
@@ -340,12 +341,12 @@ std::string BgImage::GetBodySourceCode() const
return bodyStr;
}
std::string BgImage::GetSourceTypeName() const
std::string RoomShapeImageMultiBgEntry::GetSourceTypeName() const
{
return "BgImage";
return "RoomShapeImageMultiBgEntry";
}
ZResourceType BgImage::GetResourceType() const
ZResourceType RoomShapeImageMultiBgEntry::GetResourceType() const
{
// TODO
return ZResourceType::Error;
@@ -380,13 +381,13 @@ std::string PolygonTypeBase::GetSourceTypeName() const
switch (type)
{
case 2:
return "PolygonType2";
return "RoomShapeCullable";
case 1:
return "PolygonType1";
default:
return "PolygonType0";
return "RoomShapeNormal";
}
}
@@ -416,7 +417,7 @@ void PolygonType1::ParseRawData()
if (dlist != 0)
{
PolygonDlist polyGfxList(parent);
RoomShapeDListsEntry polyGfxList(parent);
polyGfxList.zRoom = zRoom;
polyGfxList.SetPolyType(type);
polyGfxList.ExtractFromFile(Seg2Filespace(dlist, parent->baseAddress));
@@ -434,7 +435,7 @@ void PolygonType1::DeclareReferences(const std::string& prefix)
switch (format)
{
case 1:
single = BgImage(true, prefix, rawDataIndex + 0x08, parent);
single = RoomShapeImageMultiBgEntry(true, prefix, rawDataIndex + 0x08, parent);
break;
case 2:
@@ -446,7 +447,7 @@ void PolygonType1::DeclareReferences(const std::string& prefix)
multiList.reserve(count);
for (size_t i = 0; i < count; ++i)
{
BgImage bg(false, prefix, auxPtr, parent);
RoomShapeImageMultiBgEntry bg(false, prefix, auxPtr, parent);
multiList.push_back(bg);
auxPtr += bg.GetRawDataSize();
bgImageArrayBody += bg.GetBodySourceCode();
@@ -507,7 +508,7 @@ std::string PolygonType1::GetBodySourceCode() const
bodyStr += single.GetBodySourceCode();
break;
case 2:
Globals::Instance->GetSegmentedPtrName(list, parent, "BgImage", listStr);
Globals::Instance->GetSegmentedPtrName(list, parent, "RoomShapeImageMultiBgEntry", listStr);
bodyStr += StringHelper::Sprintf(" %i, %s, \n", count, listStr.c_str());
break;
@@ -523,21 +524,21 @@ std::string PolygonType1::GetSourceTypeName() const
switch (format)
{
case 1:
return "MeshHeader1Single";
return "RoomShapeImageSingle";
case 2:
return "MeshHeader1Multi";
return "RoomShapeImageMulti";
}
return "ERROR";
// return "PolygonType1";
}
PolygonType2::PolygonType2(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom)
RoomShapeCullable::RoomShapeCullable(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom)
: PolygonTypeBase(nParent, nRawDataIndex, nRoom)
{
}
void PolygonType2::ParseRawData()
void RoomShapeCullable::ParseRawData()
{
const auto& rawData = parent->GetRawData();
@@ -551,7 +552,7 @@ void PolygonType2::ParseRawData()
polyDLists.reserve(num);
for (size_t i = 0; i < num; i++)
{
PolygonDlist entry(parent);
RoomShapeDListsEntry entry(parent);
entry.zRoom = zRoom;
entry.SetPolyType(type);
entry.ExtractFromFile(currentPtr);
@@ -561,7 +562,7 @@ void PolygonType2::ParseRawData()
}
}
void PolygonType2::DeclareReferences(const std::string& prefix)
void RoomShapeCullable::DeclareReferences(const std::string& prefix)
{
if (num > 0)
{
@@ -593,7 +594,7 @@ void PolygonType2::DeclareReferences(const std::string& prefix)
"0x01000000");
}
std::string PolygonType2::GetBodySourceCode() const
std::string RoomShapeCullable::GetBodySourceCode() const
{
std::string listName;
Globals::Instance->GetSegmentedPtrName(start, parent, "", listName);
@@ -605,12 +606,12 @@ std::string PolygonType2::GetBodySourceCode() const
return body;
}
size_t PolygonType2::GetRawDataSize() const
size_t RoomShapeCullable::GetRawDataSize() const
{
return 0x0C;
}
DeclarationAlignment PolygonType2::GetDeclarationAlignment() const
DeclarationAlignment RoomShapeCullable::GetDeclarationAlignment() const
{
return DeclarationAlignment::Align4;
}
+12 -11
View File
@@ -5,7 +5,7 @@
#include "ZDisplayList.h"
#include "ZRoom/ZRoomCommand.h"
class PolygonDlist : public ZResource
class RoomShapeDListsEntry : public ZResource
{
public:
ZRoom* zRoom;
@@ -21,7 +21,7 @@ public:
ZDisplayList* opaDList = nullptr; // Gfx*
ZDisplayList* xluDList = nullptr; // Gfx*
PolygonDlist(ZFile* nParent);
RoomShapeDListsEntry(ZFile* nParent);
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
@@ -41,7 +41,7 @@ protected:
ZDisplayList* MakeDlist(segptr_t ptr, const std::string& prefix);
};
class BgImage : public ZResource
class RoomShapeImageMultiBgEntry : public ZResource
{
public:
uint16_t unk_00;
@@ -60,8 +60,9 @@ public:
bool isSubStruct;
BgImage(ZFile* nParent);
BgImage(bool nIsSubStruct, const std::string& prefix, uint32_t nRawDataIndex, ZFile* nParent);
RoomShapeImageMultiBgEntry(ZFile* nParent);
RoomShapeImageMultiBgEntry(bool nIsSubStruct, const std::string& prefix, uint32_t nRawDataIndex,
ZFile* nParent);
void ParseRawData() override;
@@ -80,7 +81,7 @@ class PolygonTypeBase : public ZResource
{
public:
uint8_t type;
std::vector<PolygonDlist> polyDLists;
std::vector<RoomShapeDListsEntry> polyDLists;
PolygonTypeBase(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom);
@@ -100,12 +101,12 @@ public:
segptr_t dlist;
// single
BgImage single;
RoomShapeImageMultiBgEntry single;
// multi
uint8_t count;
segptr_t list; // BgImage*
std::vector<BgImage> multiList;
segptr_t list; // RoomShapeImageMultiBgEntry*
std::vector<RoomShapeImageMultiBgEntry> multiList;
PolygonType1(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom);
@@ -119,14 +120,14 @@ public:
size_t GetRawDataSize() const override;
};
class PolygonType2 : public PolygonTypeBase
class RoomShapeCullable : public PolygonTypeBase
{
public:
uint8_t num;
segptr_t start;
segptr_t end;
PolygonType2(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom);
RoomShapeCullable(ZFile* nParent, uint32_t nRawDataIndex, ZRoom* nRoom);
void ParseRawData() override;
void DeclareReferences(const std::string& prefix) override;
@@ -17,8 +17,14 @@ void SetSpecialObjects::ParseRawData()
std::string SetSpecialObjects::GetBodySourceCode() const
{
EnumData* enumData = &Globals::Instance->cfg.enumData;
std::string objectName = ZNames::GetObjectName(globalObject);
if (enumData->naviQuestHintType.find(elfMessage) != enumData->naviQuestHintType.end())
return StringHelper::Sprintf("SCENE_CMD_SPECIAL_FILES(%s, %s)",
enumData->naviQuestHintType[elfMessage].c_str(),
objectName.c_str());
return StringHelper::Sprintf("SCENE_CMD_SPECIAL_FILES(0x%02X, %s)", elfMessage,
objectName.c_str());
}
@@ -1,6 +1,7 @@
#include "SetWorldMapVisited.h"
#include "Utils/StringHelper.h"
#include "Globals.h"
SetWorldMapVisited::SetWorldMapVisited(ZFile* nParent) : ZRoomCommand(nParent)
{
@@ -8,7 +9,10 @@ SetWorldMapVisited::SetWorldMapVisited(ZFile* nParent) : ZRoomCommand(nParent)
std::string SetWorldMapVisited::GetBodySourceCode() const
{
return "SCENE_CMD_MISC_SETTINGS()";
if (Globals::Instance->game == ZGame::MM_RETAIL)
return "SCENE_CMD_SET_REGION_VISITED()";
else
return "SCENE_CMD_MISC_SETTINGS()";
}
std::string SetWorldMapVisited::GetCommandCName() const
+2 -2
View File
@@ -6,7 +6,7 @@
#include <string_view>
#include "Commands/EndMarker.h"
#include "Commands/SetActorCutsceneList.h"
#include "Commands/SetCutsceneEntryList.h"
#include "Commands/SetActorList.h"
#include "Commands/SetAlternateHeaders.h"
#include "Commands/SetAnimatedMaterialList.h"
@@ -336,7 +336,7 @@ std::string ZRoom::GetDefaultName(const std::string& prefix) const
*/
void ZRoom::SyotesRoomFix()
{
PolygonType2 poly(parent, 0, this);
RoomShapeCullable poly(parent, 0, this);
poly.ParseRawData();
poly.DeclareReferences(GetName());
+1 -1
View File
@@ -189,7 +189,7 @@ std::string ZSkeleton::GetSourceTypeName() const
case ZSkeletonType::Flex:
return "FlexSkeletonHeader";
case ZSkeletonType::Curve:
return "SkelCurveLimbList";
return "CurveSkeletonHeader";
}
return "SkeletonHeader";
+12 -3
View File
@@ -21,12 +21,21 @@ class Directory
{
public:
#ifdef USE_BOOST_FS
static std::string GetCurrentDirectory() { return fs::current_path().string(); }
static std::string GetCurrentDirectory()
{
return fs::current_path().string();
}
#else
static std::string GetCurrentDirectory() { return fs::current_path().u8string(); }
static std::string GetCurrentDirectory()
{
return fs::current_path().u8string();
}
#endif
static bool Exists(const fs::path& path) { return fs::exists(path); }
static bool Exists(const fs::path& path)
{
return fs::exists(path);
}
static void CreateDirectory(const std::string& path)
{
+1 -1
View File
@@ -2,7 +2,7 @@
<SymbolMap File="SymbolMap_MM.txt"/>
<ActorList File="ActorList_MM.txt"/>
<ObjectList File="ObjectList_MM.txt"/>
<EnumData File="EnumData.xml"/>
<ExternalXMLFolder Path="assets/xml/"/>
<ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="objects/gameplay_keep/"/>
</Root>
+718
View File
@@ -0,0 +1,718 @@
<Root>
<!--
Description:
This file hosts various enum data from decomp.
Format:
- <Enum>: a list of <Item> with an unique identifier (key), the decomp ID and the index
Parameters:
* Games: list of OoT versions that shares this data
* Key: identifier, the name is the same as the enum from decomp
- <Item>: description of an element of an <Enum>
Parameters:
* Key: identifier that should never be changed
* ID: the actual enum name from decomp, this may change hence the need of the Key parameter
* Name: a descriptive name about the current item
* Index: the location of the item in the enum (should match decomp)
Notes:
- Player Cue Ids got their own enum but not regular Actor Cues.
This is because Actor Cues are among cutscene commands (``csCmd``)
-->
<Enum Games="MM" Key="fadeOutSeqPlayer" ID="CutsceneFadeOutSeqPlayer">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L77-L80 -->
<Item Key="fade_out_bgm_main" ID="CS_FADE_OUT_BGM_MAIN" Index="1"/>
<Item Key="fade_out_fanfare" ID="CS_FADE_OUT_FANFARE" Index="2"/>
</Enum>
<Enum Games="MM" Key="modifySeqType" ID="CsModifySeqType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L109-L118 -->
<Item Key="mod_seq_0" ID="CS_MOD_SEQ_0" Index="1"/>
<Item Key="mod_seq_1" ID="CS_MOD_SEQ_1" Index="2"/>
<Item Key="mod_seq_2" ID="CS_MOD_SEQ_2" Index="3"/>
<Item Key="mod_ambience_0" ID="CS_MOD_AMBIENCE_0" Index="4"/>
<Item Key="mod_ambience_1" ID="CS_MOD_AMBIENCE_1" Index="5"/>
<Item Key="mod_ambience_2" ID="CS_MOD_AMBIENCE_2" Index="6"/>
<Item Key="mod_seq_store" ID="CS_MOD_SEQ_STORE" Index="7"/>
<Item Key="mod_seq_restore" ID="CS_MOD_SEQ_RESTORE" Index="8"/>
</Enum>
<Enum Games="MM" Key="destinationType" ID="CsDestinationType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L129-L132 -->
<Item Key="destination_default" ID="CS_DESTINATION_DEFAULT" Index="1"/>
<Item Key="destination_boss_warp" ID="CS_DESTINATION_BOSS_WARP" Index="2"/>
</Enum>
<Enum Games="MM" Key="chooseCreditsSceneType" ID="CsChooseCreditsSceneType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L143-L155 -->
<Item Key="credits_destination" ID="CS_CREDITS_DESTINATION" Index="1"/>
<Item Key="credits_mask_kamaro" ID="CS_CREDITS_MASK_KAMARO" Index="2"/>
<Item Key="credits_mask_great_fairy" ID="CS_CREDITS_MASK_GREAT_FAIRY" Index="3"/>
<Item Key="credits_mask_romani" ID="CS_CREDITS_MASK_ROMANI" Index="4"/>
<Item Key="credits_mask_blast" ID="CS_CREDITS_MASK_BLAST" Index="5"/>
<Item Key="credits_mask_circus_leader" ID="CS_CREDITS_MASK_CIRCUS_LEADER" Index="6"/>
<Item Key="credits_mask_bremen" ID="CS_CREDITS_MASK_BREMEN" Index="7"/>
<Item Key="credits_mask_ikana" ID="CS_CREDITS_IKANA" Index="8"/>
<Item Key="credits_mask_couple" ID="CS_CREDITS_MASK_COUPLE" Index="9"/>
<Item Key="credits_mask_bunny" ID="CS_CREDITS_MASK_BUNNY" Index="10"/>
<Item Key="credits_mask_postman" ID="CS_CREDITS_MASK_POSTMAN" Index="11"/>
</Enum>
<Enum Games="MM" Key="motionBlurType" ID="CsMotionBlurType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L166-L169 -->
<Item Key="motion_blur_enable" ID="CS_MOTION_BLUR_ENABLE" Index="1"/>
<Item Key="motion_blur_disable" ID="CS_MOTION_BLUR_DISABLE" Index="2"/>
</Enum>
<Enum Games="MM" Key="transitionType" ID="CutsceneTransitionType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L198-L212 -->
<Item Key="gray_fill_in" ID="CS_TRANS_GRAY_FILL_IN" Index="1"/>
<Item Key="blue_fill_in" ID="CS_TRANS_BLUE_FILL_IN" Index="2"/>
<Item Key="red_fill_out" ID="CS_TRANS_RED_FILL_OUT" Index="3"/>
<Item Key="green_fill_out" ID="CS_TRANS_GREEN_FILL_OUT" Index="4"/>
<Item Key="gray_fill_out" ID="CS_TRANS_GRAY_FILL_OUT" Index="5"/>
<Item Key="blue_fill_out" ID="CS_TRANS_BLUE_FILL_OUT" Index="6"/>
<Item Key="red_fill_in" ID="CS_TRANS_RED_FILL_IN" Index="7"/>
<Item Key="green_fill_in" ID="CS_TRANS_GREEN_FILL_IN" Index="8"/>
<Item Key="trigger_instance" ID="CS_TRANS_TRIGGER_INSTANCE" Index="9"/>
<Item Key="black_fill_out" ID="CS_TRANS_BLACK_FILL_OUT" Index="10"/>
<Item Key="black_fill_in" ID="CS_TRANS_BLACK_FILL_IN" Index="11"/>
<Item Key="gray_to_black" ID="CS_TRANS_GRAY_TO_BLACK" Index="12"/>
<Item Key="black_to_gray" ID="CS_TRANS_BLACK_TO_GRAY" Index="13"/>
</Enum>
<Enum Games="MM" Key="rumbleType" ID="CutsceneRumbleType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L248-L251 -->
<Item Key="rumble_once" ID="CS_RUMBLE_ONCE" Index="1"/>
<Item Key="rumble_pulse" ID="CS_RUMBLE_PULSE" Index="2"/>
</Enum>
<Enum Games="MM" Key="transitionGeneralType" ID="CsTransitionGeneralType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L263-L266 -->
<Item Key="trans_general_fill_in" ID="CS_TRANS_GENERAL_FILL_IN" Index="1"/>
<Item Key="trans_general_fill_out" ID="CS_TRANS_GENERAL_FILL_OUT" Index="2"/>
</Enum>
<Enum Games="MM" Key="cmd" ID="CutsceneCmd">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L294-L530 -->
<Item Key="actor_cue_post_process" ID="CS_CMD_ACTOR_CUE_POST_PROCESS" Index="-2"/>
<Item Key="cs_cam_stop" ID="CS_CAM_STOP" Index="-1"/>
<Item Key="text" ID="CS_CMD_TEXT" Index="10"/>
<Item Key="camera_spline" ID="CS_CMD_CAMERA_SPLINE" Index="90"/>
<Item Key="actor_cue_100" ID="CS_CMD_ACTOR_CUE_100" Index="100"/>
<Item Key="actor_cue_101" ID="CS_CMD_ACTOR_CUE_101" Index="101"/>
<Item Key="actor_cue_102" ID="CS_CMD_ACTOR_CUE_102" Index="102"/>
<Item Key="actor_cue_103" ID="CS_CMD_ACTOR_CUE_103" Index="103"/>
<Item Key="actor_cue_104" ID="CS_CMD_ACTOR_CUE_104" Index="104"/>
<Item Key="actor_cue_105" ID="CS_CMD_ACTOR_CUE_105" Index="105"/>
<Item Key="actor_cue_106" ID="CS_CMD_ACTOR_CUE_106" Index="106"/>
<Item Key="actor_cue_107" ID="CS_CMD_ACTOR_CUE_107" Index="107"/>
<Item Key="actor_cue_108" ID="CS_CMD_ACTOR_CUE_108" Index="108"/>
<Item Key="actor_cue_109" ID="CS_CMD_ACTOR_CUE_109" Index="109"/>
<Item Key="actor_cue_110" ID="CS_CMD_ACTOR_CUE_110" Index="110"/>
<Item Key="actor_cue_111" ID="CS_CMD_ACTOR_CUE_111" Index="111"/>
<Item Key="actor_cue_112" ID="CS_CMD_ACTOR_CUE_112" Index="112"/>
<Item Key="actor_cue_113" ID="CS_CMD_ACTOR_CUE_113" Index="113"/>
<Item Key="actor_cue_114" ID="CS_CMD_ACTOR_CUE_114" Index="114"/>
<Item Key="actor_cue_115" ID="CS_CMD_ACTOR_CUE_115" Index="115"/>
<Item Key="actor_cue_116" ID="CS_CMD_ACTOR_CUE_116" Index="116"/>
<Item Key="actor_cue_117" ID="CS_CMD_ACTOR_CUE_117" Index="117"/>
<Item Key="actor_cue_118" ID="CS_CMD_ACTOR_CUE_118" Index="118"/>
<Item Key="actor_cue_119" ID="CS_CMD_ACTOR_CUE_119" Index="119"/>
<Item Key="actor_cue_120" ID="CS_CMD_ACTOR_CUE_120" Index="120"/>
<Item Key="actor_cue_121" ID="CS_CMD_ACTOR_CUE_121" Index="121"/>
<Item Key="actor_cue_122" ID="CS_CMD_ACTOR_CUE_122" Index="122"/>
<Item Key="actor_cue_123" ID="CS_CMD_ACTOR_CUE_123" Index="123"/>
<Item Key="actor_cue_124" ID="CS_CMD_ACTOR_CUE_124" Index="124"/>
<Item Key="actor_cue_125" ID="CS_CMD_ACTOR_CUE_125" Index="125"/>
<Item Key="actor_cue_126" ID="CS_CMD_ACTOR_CUE_126" Index="126"/>
<Item Key="actor_cue_127" ID="CS_CMD_ACTOR_CUE_127" Index="127"/>
<Item Key="actor_cue_128" ID="CS_CMD_ACTOR_CUE_128" Index="128"/>
<Item Key="actor_cue_129" ID="CS_CMD_ACTOR_CUE_129" Index="129"/>
<Item Key="actor_cue_130" ID="CS_CMD_ACTOR_CUE_130" Index="130"/>
<Item Key="actor_cue_131" ID="CS_CMD_ACTOR_CUE_131" Index="131"/>
<Item Key="actor_cue_132" ID="CS_CMD_ACTOR_CUE_132" Index="132"/>
<Item Key="actor_cue_133" ID="CS_CMD_ACTOR_CUE_133" Index="133"/>
<Item Key="actor_cue_134" ID="CS_CMD_ACTOR_CUE_134" Index="134"/>
<Item Key="actor_cue_135" ID="CS_CMD_ACTOR_CUE_135" Index="135"/>
<Item Key="actor_cue_136" ID="CS_CMD_ACTOR_CUE_136" Index="136"/>
<Item Key="actor_cue_137" ID="CS_CMD_ACTOR_CUE_137" Index="137"/>
<Item Key="actor_cue_138" ID="CS_CMD_ACTOR_CUE_138" Index="138"/>
<Item Key="actor_cue_139" ID="CS_CMD_ACTOR_CUE_139" Index="139"/>
<Item Key="actor_cue_140" ID="CS_CMD_ACTOR_CUE_140" Index="140"/>
<Item Key="actor_cue_141" ID="CS_CMD_ACTOR_CUE_141" Index="141"/>
<Item Key="actor_cue_142" ID="CS_CMD_ACTOR_CUE_142" Index="142"/>
<Item Key="actor_cue_143" ID="CS_CMD_ACTOR_CUE_143" Index="143"/>
<Item Key="actor_cue_144" ID="CS_CMD_ACTOR_CUE_144" Index="144"/>
<Item Key="actor_cue_145" ID="CS_CMD_ACTOR_CUE_145" Index="145"/>
<Item Key="actor_cue_146" ID="CS_CMD_ACTOR_CUE_146" Index="146"/>
<Item Key="actor_cue_147" ID="CS_CMD_ACTOR_CUE_147" Index="147"/>
<Item Key="actor_cue_148" ID="CS_CMD_ACTOR_CUE_148" Index="148"/>
<Item Key="actor_cue_149" ID="CS_CMD_ACTOR_CUE_149" Index="149"/>
<Item Key="misc" ID="CS_CMD_MISC" Index="150"/>
<Item Key="light_setting" ID="CS_CMD_LIGHT_SETTING" Index="151"/>
<Item Key="transition" ID="CS_CMD_TRANSITION" Index="152"/>
<Item Key="motion_blur" ID="CS_CMD_MOTION_BLUR" Index="153"/>
<Item Key="give_tatl" ID="CS_CMD_GIVE_TATL" Index="154"/>
<Item Key="transition_general" ID="CS_CMD_TRANSITION_GENERAL" Index="155"/>
<Item Key="fade_out_seq" ID="CS_CMD_FADE_OUT_SEQ" Index="156"/>
<Item Key="time" ID="CS_CMD_TIME" Index="157"/>
<Item Key="player_cue" ID="CS_CMD_PLAYER_CUE" Index="200"/>
<Item Key="actor_cue_201" ID="CS_CMD_ACTOR_CUE_201" Index="201"/>
<Item Key="unk_data_fa" ID="CS_CMD_UNK_DATA_FA" Index="250"/>
<Item Key="unk_data_fe" ID="CS_CMD_UNK_DATA_FE" Index="254"/>
<Item Key="unk_data_ff" ID="CS_CMD_UNK_DATA_FF" Index="255"/>
<Item Key="unk_data_100" ID="CS_CMD_UNK_DATA_100" Index="256"/>
<Item Key="unk_data_101" ID="CS_CMD_UNK_DATA_101" Index="257"/>
<Item Key="unk_data_102" ID="CS_CMD_UNK_DATA_102" Index="258"/>
<Item Key="unk_data_103" ID="CS_CMD_UNK_DATA_103" Index="259"/>
<Item Key="unk_data_104" ID="CS_CMD_UNK_DATA_104" Index="260"/>
<Item Key="unk_data_105" ID="CS_CMD_UNK_DATA_105" Index="261"/>
<Item Key="unk_data_108" ID="CS_CMD_UNK_DATA_108" Index="264"/>
<Item Key="unk_data_109" ID="CS_CMD_UNK_DATA_109" Index="265"/>
<Item Key="start_seq" ID="CS_CMD_START_SEQ" Index="300"/>
<Item Key="stop_seq" ID="CS_CMD_STOP_SEQ" Index="301"/>
<Item Key="start_ambience" ID="CS_CMD_START_AMBIENCE" Index="302"/>
<Item Key="fade_out_ambience" ID="CS_CMD_FADE_OUT_AMBIENCE" Index="303"/>
<Item Key="sfx_reverb_index_2" ID="CS_CMD_SFX_REVERB_INDEX_2" Index="304"/>
<Item Key="sfx_reverb_index_1" ID="CS_CMD_SFX_REVERB_INDEX_1" Index="305"/>
<Item Key="modify_seq" ID="CS_CMD_MODIFY_SEQ" Index="306"/>
<Item Key="destination" ID="CS_CMD_DESTINATION" Index="350"/>
<Item Key="choose_credits_scenes" ID="CS_CMD_CHOOSE_CREDITS_SCENES" Index="351"/>
<Item Key="rumble" ID="CS_CMD_RUMBLE" Index="400"/>
<Item Key="actor_cue_450" ID="CS_CMD_ACTOR_CUE_450" Index="450"/>
<Item Key="actor_cue_451" ID="CS_CMD_ACTOR_CUE_451" Index="451"/>
<Item Key="actor_cue_452" ID="CS_CMD_ACTOR_CUE_452" Index="452"/>
<Item Key="actor_cue_453" ID="CS_CMD_ACTOR_CUE_453" Index="453"/>
<Item Key="actor_cue_454" ID="CS_CMD_ACTOR_CUE_454" Index="454"/>
<Item Key="actor_cue_455" ID="CS_CMD_ACTOR_CUE_455" Index="455"/>
<Item Key="actor_cue_456" ID="CS_CMD_ACTOR_CUE_456" Index="456"/>
<Item Key="actor_cue_457" ID="CS_CMD_ACTOR_CUE_457" Index="457"/>
<Item Key="actor_cue_458" ID="CS_CMD_ACTOR_CUE_458" Index="458"/>
<Item Key="actor_cue_459" ID="CS_CMD_ACTOR_CUE_459" Index="459"/>
<Item Key="actor_cue_460" ID="CS_CMD_ACTOR_CUE_460" Index="460"/>
<Item Key="actor_cue_461" ID="CS_CMD_ACTOR_CUE_461" Index="461"/>
<Item Key="actor_cue_462" ID="CS_CMD_ACTOR_CUE_462" Index="462"/>
<Item Key="actor_cue_463" ID="CS_CMD_ACTOR_CUE_463" Index="463"/>
<Item Key="actor_cue_464" ID="CS_CMD_ACTOR_CUE_464" Index="464"/>
<Item Key="actor_cue_465" ID="CS_CMD_ACTOR_CUE_465" Index="465"/>
<Item Key="actor_cue_466" ID="CS_CMD_ACTOR_CUE_466" Index="466"/>
<Item Key="actor_cue_467" ID="CS_CMD_ACTOR_CUE_467" Index="467"/>
<Item Key="actor_cue_468" ID="CS_CMD_ACTOR_CUE_468" Index="468"/>
<Item Key="actor_cue_469" ID="CS_CMD_ACTOR_CUE_469" Index="469"/>
<Item Key="actor_cue_470" ID="CS_CMD_ACTOR_CUE_470" Index="470"/>
<Item Key="actor_cue_471" ID="CS_CMD_ACTOR_CUE_471" Index="471"/>
<Item Key="actor_cue_472" ID="CS_CMD_ACTOR_CUE_472" Index="472"/>
<Item Key="actor_cue_473" ID="CS_CMD_ACTOR_CUE_473" Index="473"/>
<Item Key="actor_cue_474" ID="CS_CMD_ACTOR_CUE_474" Index="474"/>
<Item Key="actor_cue_475" ID="CS_CMD_ACTOR_CUE_475" Index="475"/>
<Item Key="actor_cue_476" ID="CS_CMD_ACTOR_CUE_476" Index="476"/>
<Item Key="actor_cue_477" ID="CS_CMD_ACTOR_CUE_477" Index="477"/>
<Item Key="actor_cue_478" ID="CS_CMD_ACTOR_CUE_478" Index="478"/>
<Item Key="actor_cue_479" ID="CS_CMD_ACTOR_CUE_479" Index="479"/>
<Item Key="actor_cue_480" ID="CS_CMD_ACTOR_CUE_480" Index="480"/>
<Item Key="actor_cue_481" ID="CS_CMD_ACTOR_CUE_481" Index="481"/>
<Item Key="actor_cue_482" ID="CS_CMD_ACTOR_CUE_482" Index="482"/>
<Item Key="actor_cue_483" ID="CS_CMD_ACTOR_CUE_483" Index="483"/>
<Item Key="actor_cue_484" ID="CS_CMD_ACTOR_CUE_484" Index="484"/>
<Item Key="actor_cue_485" ID="CS_CMD_ACTOR_CUE_485" Index="485"/>
<Item Key="actor_cue_486" ID="CS_CMD_ACTOR_CUE_486" Index="486"/>
<Item Key="actor_cue_487" ID="CS_CMD_ACTOR_CUE_487" Index="487"/>
<Item Key="actor_cue_488" ID="CS_CMD_ACTOR_CUE_488" Index="488"/>
<Item Key="actor_cue_489" ID="CS_CMD_ACTOR_CUE_489" Index="489"/>
<Item Key="actor_cue_490" ID="CS_CMD_ACTOR_CUE_490" Index="490"/>
<Item Key="actor_cue_491" ID="CS_CMD_ACTOR_CUE_491" Index="491"/>
<Item Key="actor_cue_492" ID="CS_CMD_ACTOR_CUE_492" Index="492"/>
<Item Key="actor_cue_493" ID="CS_CMD_ACTOR_CUE_493" Index="493"/>
<Item Key="actor_cue_494" ID="CS_CMD_ACTOR_CUE_494" Index="494"/>
<Item Key="actor_cue_495" ID="CS_CMD_ACTOR_CUE_495" Index="495"/>
<Item Key="actor_cue_496" ID="CS_CMD_ACTOR_CUE_496" Index="496"/>
<Item Key="actor_cue_497" ID="CS_CMD_ACTOR_CUE_497" Index="497"/>
<Item Key="actor_cue_498" ID="CS_CMD_ACTOR_CUE_498" Index="498"/>
<Item Key="actor_cue_499" ID="CS_CMD_ACTOR_CUE_499" Index="499"/>
<Item Key="actor_cue_500" ID="CS_CMD_ACTOR_CUE_500" Index="500"/>
<Item Key="actor_cue_501" ID="CS_CMD_ACTOR_CUE_501" Index="501"/>
<Item Key="actor_cue_502" ID="CS_CMD_ACTOR_CUE_502" Index="502"/>
<Item Key="actor_cue_503" ID="CS_CMD_ACTOR_CUE_503" Index="503"/>
<Item Key="actor_cue_504" ID="CS_CMD_ACTOR_CUE_504" Index="504"/>
<Item Key="actor_cue_sotcs" ID="CS_CMD_ACTOR_CUE_SOTCS" Index="505"/>
<Item Key="actor_cue_506" ID="CS_CMD_ACTOR_CUE_506" Index="506"/>
<Item Key="actor_cue_507" ID="CS_CMD_ACTOR_CUE_507" Index="507"/>
<Item Key="actor_cue_508" ID="CS_CMD_ACTOR_CUE_508" Index="508"/>
<Item Key="actor_cue_509" ID="CS_CMD_ACTOR_CUE_509" Index="509"/>
<Item Key="actor_cue_510" ID="CS_CMD_ACTOR_CUE_510" Index="510"/>
<Item Key="actor_cue_511" ID="CS_CMD_ACTOR_CUE_511" Index="511"/>
<Item Key="actor_cue_512" ID="CS_CMD_ACTOR_CUE_512" Index="512"/>
<Item Key="actor_cue_513" ID="CS_CMD_ACTOR_CUE_513" Index="513"/>
<Item Key="actor_cue_514" ID="CS_CMD_ACTOR_CUE_514" Index="514"/>
<Item Key="actor_cue_515" ID="CS_CMD_ACTOR_CUE_515" Index="515"/>
<Item Key="actor_cue_516" ID="CS_CMD_ACTOR_CUE_516" Index="516"/>
<Item Key="actor_cue_517" ID="CS_CMD_ACTOR_CUE_517" Index="517"/>
<Item Key="actor_cue_518" ID="CS_CMD_ACTOR_CUE_518" Index="518"/>
<Item Key="actor_cue_519" ID="CS_CMD_ACTOR_CUE_519" Index="519"/>
<Item Key="actor_cue_520" ID="CS_CMD_ACTOR_CUE_520" Index="520"/>
<Item Key="actor_cue_521" ID="CS_CMD_ACTOR_CUE_521" Index="521"/>
<Item Key="actor_cue_522" ID="CS_CMD_ACTOR_CUE_522" Index="522"/>
<Item Key="actor_cue_523" ID="CS_CMD_ACTOR_CUE_523" Index="523"/>
<Item Key="actor_cue_524" ID="CS_CMD_ACTOR_CUE_524" Index="524"/>
<Item Key="actor_cue_525" ID="CS_CMD_ACTOR_CUE_525" Index="525"/>
<Item Key="actor_cue_526" ID="CS_CMD_ACTOR_CUE_526" Index="526"/>
<Item Key="actor_cue_527" ID="CS_CMD_ACTOR_CUE_527" Index="527"/>
<Item Key="actor_cue_528" ID="CS_CMD_ACTOR_CUE_528" Index="528"/>
<Item Key="actor_cue_529" ID="CS_CMD_ACTOR_CUE_529" Index="529"/>
<Item Key="actor_cue_530" ID="CS_CMD_ACTOR_CUE_530" Index="530"/>
<Item Key="actor_cue_531" ID="CS_CMD_ACTOR_CUE_531" Index="531"/>
<Item Key="actor_cue_532" ID="CS_CMD_ACTOR_CUE_532" Index="532"/>
<Item Key="actor_cue_533" ID="CS_CMD_ACTOR_CUE_533" Index="533"/>
<Item Key="actor_cue_534" ID="CS_CMD_ACTOR_CUE_534" Index="534"/>
<Item Key="actor_cue_535" ID="CS_CMD_ACTOR_CUE_535" Index="535"/>
<Item Key="actor_cue_536" ID="CS_CMD_ACTOR_CUE_536" Index="536"/>
<Item Key="actor_cue_537" ID="CS_CMD_ACTOR_CUE_537" Index="537"/>
<Item Key="actor_cue_538" ID="CS_CMD_ACTOR_CUE_538" Index="538"/>
<Item Key="actor_cue_539" ID="CS_CMD_ACTOR_CUE_539" Index="539"/>
<Item Key="actor_cue_540" ID="CS_CMD_ACTOR_CUE_540" Index="540"/>
<Item Key="actor_cue_541" ID="CS_CMD_ACTOR_CUE_541" Index="541"/>
<Item Key="actor_cue_542" ID="CS_CMD_ACTOR_CUE_542" Index="542"/>
<Item Key="actor_cue_543" ID="CS_CMD_ACTOR_CUE_543" Index="543"/>
<Item Key="actor_cue_544" ID="CS_CMD_ACTOR_CUE_544" Index="544"/>
<Item Key="actor_cue_545" ID="CS_CMD_ACTOR_CUE_545" Index="545"/>
<Item Key="actor_cue_546" ID="CS_CMD_ACTOR_CUE_546" Index="546"/>
<Item Key="actor_cue_547" ID="CS_CMD_ACTOR_CUE_547" Index="547"/>
<Item Key="actor_cue_548" ID="CS_CMD_ACTOR_CUE_548" Index="548"/>
<Item Key="actor_cue_549" ID="CS_CMD_ACTOR_CUE_549" Index="549"/>
<Item Key="actor_cue_550" ID="CS_CMD_ACTOR_CUE_550" Index="550"/>
<Item Key="actor_cue_551" ID="CS_CMD_ACTOR_CUE_551" Index="551"/>
<Item Key="actor_cue_552" ID="CS_CMD_ACTOR_CUE_552" Index="552"/>
<Item Key="actor_cue_553" ID="CS_CMD_ACTOR_CUE_553" Index="553"/>
<Item Key="actor_cue_554" ID="CS_CMD_ACTOR_CUE_554" Index="554"/>
<Item Key="actor_cue_555" ID="CS_CMD_ACTOR_CUE_555" Index="555"/>
<Item Key="actor_cue_556" ID="CS_CMD_ACTOR_CUE_556" Index="556"/>
<Item Key="actor_cue_557" ID="CS_CMD_ACTOR_CUE_557" Index="557"/>
<Item Key="actor_cue_558" ID="CS_CMD_ACTOR_CUE_558" Index="558"/>
<Item Key="actor_cue_559" ID="CS_CMD_ACTOR_CUE_559" Index="559"/>
<Item Key="actor_cue_560" ID="CS_CMD_ACTOR_CUE_560" Index="560"/>
<Item Key="actor_cue_561" ID="CS_CMD_ACTOR_CUE_561" Index="561"/>
<Item Key="actor_cue_562" ID="CS_CMD_ACTOR_CUE_562" Index="562"/>
<Item Key="actor_cue_563" ID="CS_CMD_ACTOR_CUE_563" Index="563"/>
<Item Key="actor_cue_564" ID="CS_CMD_ACTOR_CUE_564" Index="564"/>
<Item Key="actor_cue_565" ID="CS_CMD_ACTOR_CUE_565" Index="565"/>
<Item Key="actor_cue_566" ID="CS_CMD_ACTOR_CUE_566" Index="566"/>
<Item Key="actor_cue_567" ID="CS_CMD_ACTOR_CUE_567" Index="567"/>
<Item Key="actor_cue_568" ID="CS_CMD_ACTOR_CUE_568" Index="568"/>
<Item Key="actor_cue_569" ID="CS_CMD_ACTOR_CUE_569" Index="569"/>
<Item Key="actor_cue_570" ID="CS_CMD_ACTOR_CUE_570" Index="570"/>
<Item Key="actor_cue_571" ID="CS_CMD_ACTOR_CUE_571" Index="571"/>
<Item Key="actor_cue_572" ID="CS_CMD_ACTOR_CUE_572" Index="572"/>
<Item Key="actor_cue_573" ID="CS_CMD_ACTOR_CUE_573" Index="573"/>
<Item Key="actor_cue_574" ID="CS_CMD_ACTOR_CUE_574" Index="574"/>
<Item Key="actor_cue_575" ID="CS_CMD_ACTOR_CUE_575" Index="575"/>
<Item Key="actor_cue_576" ID="CS_CMD_ACTOR_CUE_576" Index="576"/>
<Item Key="actor_cue_577" ID="CS_CMD_ACTOR_CUE_577" Index="577"/>
<Item Key="actor_cue_578" ID="CS_CMD_ACTOR_CUE_578" Index="578"/>
<Item Key="actor_cue_579" ID="CS_CMD_ACTOR_CUE_579" Index="579"/>
<Item Key="actor_cue_580" ID="CS_CMD_ACTOR_CUE_580" Index="580"/>
<Item Key="actor_cue_581" ID="CS_CMD_ACTOR_CUE_581" Index="581"/>
<Item Key="actor_cue_582" ID="CS_CMD_ACTOR_CUE_582" Index="582"/>
<Item Key="actor_cue_583" ID="CS_CMD_ACTOR_CUE_583" Index="583"/>
<Item Key="actor_cue_584" ID="CS_CMD_ACTOR_CUE_584" Index="584"/>
<Item Key="actor_cue_585" ID="CS_CMD_ACTOR_CUE_585" Index="585"/>
<Item Key="actor_cue_586" ID="CS_CMD_ACTOR_CUE_586" Index="586"/>
<Item Key="actor_cue_587" ID="CS_CMD_ACTOR_CUE_587" Index="587"/>
<Item Key="actor_cue_588" ID="CS_CMD_ACTOR_CUE_588" Index="588"/>
<Item Key="actor_cue_589" ID="CS_CMD_ACTOR_CUE_589" Index="589"/>
<Item Key="actor_cue_590" ID="CS_CMD_ACTOR_CUE_590" Index="590"/>
<Item Key="actor_cue_591" ID="CS_CMD_ACTOR_CUE_591" Index="591"/>
<Item Key="actor_cue_592" ID="CS_CMD_ACTOR_CUE_592" Index="592"/>
<Item Key="actor_cue_593" ID="CS_CMD_ACTOR_CUE_593" Index="593"/>
<Item Key="actor_cue_594" ID="CS_CMD_ACTOR_CUE_594" Index="594"/>
<Item Key="actor_cue_595" ID="CS_CMD_ACTOR_CUE_595" Index="595"/>
<Item Key="actor_cue_596" ID="CS_CMD_ACTOR_CUE_596" Index="596"/>
<Item Key="actor_cue_597" ID="CS_CMD_ACTOR_CUE_597" Index="597"/>
<Item Key="actor_cue_598" ID="CS_CMD_ACTOR_CUE_598" Index="598"/>
<Item Key="actor_cue_599" ID="CS_CMD_ACTOR_CUE_599" Index="599"/>
</Enum>
<Enum Games="MM" Key="miscType" ID="CutsceneMiscType">
<!-- https://github.com/zeldaret/mm/blob/df800c74aecfb6b89ee976df8a2f11451f295e37/include/z64cutscene.h#L532-L574 -->
<Item Key="unimplemented_0" ID="CS_MISC_UNIMPLEMENTED_0" Index="0"/>
<Item Key="rain" ID="CS_MISC_RAIN" Index="1"/>
<Item Key="lightning" ID="CS_MISC_LIGHTNING" Index="2"/>
<Item Key="lift_fog" ID="CS_MISC_LIFT_FOG" Index="3"/>
<Item Key="cloudy_sky" ID="CS_MISC_CLOUDY_SKY" Index="4"/>
<Item Key="stop_cutscene" ID="CS_MISC_STOP_CUTSCENE" Index="5"/>
<Item Key="unimplemented_6" ID="CS_MISC_UNIMPLEMENTED_6" Index="6"/>
<Item Key="show_title_card" ID="CS_MISC_SHOW_TITLE_CARD" Index="7"/>
<Item Key="earthquake_medium" ID="CS_MISC_EARTHQUAKE_MEDIUM" Index="8"/>
<Item Key="earthquake_stop" ID="CS_MISC_EARTHQUAKE_STOP" Index="9"/>
<Item Key="vismono_black_and_white" ID="CS_MISC_VISMONO_BLACK_AND_WHITE" Index="10"/>
<Item Key="vismono_sepia" ID="CS_MISC_VISMONO_SEPIA" Index="11"/>
<Item Key="hide_room" ID="CS_MISC_HIDE_ROOM" Index="12"/>
<Item Key="red_pulsating_lights" ID="CS_MISC_RED_PULSATING_LIGHTS" Index="13"/>
<Item Key="halt_all_actors" ID="CS_MISC_HALT_ALL_ACTORS" Index="14"/>
<Item Key="resume_all_actors" ID="CS_MISC_RESUME_ALL_ACTORS" Index="15"/>
<Item Key="sandstorm_fill" ID="CS_MISC_SANDSTORM_FILL" Index="16"/>
<Item Key="sunssong_start" ID="CS_MISC_SUNSSONG_START" Index="17"/>
<Item Key="freeze_time" ID="CS_MISC_FREEZE_TIME" Index="18"/>
<Item Key="long_scarecrow_song" ID="CS_MISC_LONG_SCARECROW_SONG" Index="19"/>
<Item Key="set_csflag_3" ID="CS_MISC_SET_CSFLAG_3" Index="20"/>
<Item Key="set_csflag_4" ID="CS_MISC_SET_CSFLAG_4" Index="21"/>
<Item Key="player_form_deku" ID="CS_MISC_PLAYER_FORM_DEKU" Index="22"/>
<Item Key="enable_player_reflection" ID="CS_MISC_ENABLE_PLAYER_REFLECTION" Index="23"/>
<Item Key="disable_player_reflection" ID="CS_MISC_DISABLE_PLAYER_REFLECTION" Index="24"/>
<Item Key="player_form_human" ID="CS_MISC_PLAYER_FORM_HUMAN" Index="25"/>
<Item Key="earthquake_strong" ID="CS_MISC_EARTHQUAKE_STRONG" Index="26"/>
<Item Key="dest_moon_crash_fire_wall" ID="CS_MISC_DEST_MOON_CRASH_FIRE_WALL" Index="27"/>
<Item Key="moon_crash_skybox" ID="CS_MISC_MOON_CRASH_SKYBOX" Index="28"/>
<Item Key="player_form_restored" ID="CS_MISC_PLAYER_FORM_RESTORED" Index="29"/>
<Item Key="disable_player_csmode_start_pos" ID="CS_MISC_DISABLE_PLAYER_CSACTION_START_POS" Index="30"/>
<Item Key="enable_player_csmode_start_pos" ID="CS_MISC_ENABLE_PLAYER_CSACTION_START_POS" Index="31"/>
<Item Key="unimplemented_20" ID="CS_MISC_UNIMPLEMENTED_20" Index="32"/>
<Item Key="save_enter_clock_town" ID="CS_MISC_SAVE_ENTER_CLOCK_TOWN" Index="33"/>
<Item Key="reset_save_from_moon_crash" ID="CS_MISC_RESET_SAVE_FROM_MOON_CRASH" Index="34"/>
<Item Key="time_advance" ID="CS_MISC_TIME_ADVANCE" Index="35"/>
<Item Key="earthquake_weak" ID="CS_MISC_EARTHQUAKE_WEAK" Index="36"/>
<Item Key="unimplemented_25" ID="CS_MISC_UNIMPLEMENTED_25" Index="37"/>
<Item Key="dawn_of_a_new_day" ID="CS_MISC_DAWN_OF_A_NEW_DAY" Index="38"/>
<Item Key="player_form_zora" ID="CS_MISC_PLAYER_FORM_ZORA" Index="39"/>
<Item Key="finale" ID="CS_MISC_FINALE" Index="40"/>
</Enum>
<Enum Games="MM" Key="spawnFlag" ID="CS_SPAWN_FLAG">
<!-- https://github.com/zeldaret/mm/blob/0fdd63a350c47b5da87a58f00855bc95b6a32b47/include/z64cutscene.h#L583-L586 -->
<Item Key="flag_none" ID="CS_SPAWN_FLAG_NONE" Index="255"/>
<Item Key="flag_always" ID="CS_SPAWN_FLAG_ALWAYS" Index="254"/>
</Enum>
<Enum Games="MM" Key="endSfx" ID="CutsceneEndSfx">
<!-- https://github.com/zeldaret/mm/blob/0fdd63a350c47b5da87a58f00855bc95b6a32b47/include/z64cutscene.h#L709-L714 -->
<Item Key="none" ID="CS_END_SFX_NONE" Index="0"/>
<Item Key="tre_box_appear" ID="CS_END_SFX_TRE_BOX_APPEAR" Index="1"/>
<Item Key="correct_chime" ID="CS_END_SFX_CORRECT_CHIME" Index="2"/>
<Item Key="none_alt" ID="CS_END_SFX_NONE_ALT" Index="255"/>
</Enum>
<Enum Games="MM" Key="naviQuestHintType" ID="NaviQuestHintFileId">
<!-- https://github.com/zeldaret/mm/blob/0fdd63a350c47b5da87a58f00855bc95b6a32b47/include/z64scene.h#L761-L765 -->
<Item Key="hints_none" ID="NAVI_QUEST_HINTS_NONE" Index="0"/>
<Item Key="hints_overworld" ID="NAVI_QUEST_HINTS_OVERWORLD" Index="1"/>
<Item Key="hints_dungeon" ID="NAVI_QUEST_HINTS_DUNGEON" Index="2"/>
</Enum>
<Enum Games="MM" Key="playerCueId" ID="PlayerCueId">
<!-- https://github.com/zeldaret/mm/blob/da0c9072f5332edbde00d405b2f1c94e92ece434/include/z64player.h#L753-L847 -->
<Item Key="cueid_none" ID="PLAYER_CUEID_NONE" Index="0"/>
<Item Key="cueid_1" ID="PLAYER_CUEID_1" Index="1"/>
<Item Key="cueid_2" ID="PLAYER_CUEID_2" Index="2"/>
<Item Key="cueid_3" ID="PLAYER_CUEID_3" Index="3"/>
<Item Key="cueid_4" ID="PLAYER_CUEID_4" Index="4"/>
<Item Key="cueid_5" ID="PLAYER_CUEID_5" Index="5"/>
<Item Key="cueid_6" ID="PLAYER_CUEID_6" Index="6"/>
<Item Key="cueid_7" ID="PLAYER_CUEID_7" Index="7"/>
<Item Key="cueid_8" ID="PLAYER_CUEID_8" Index="8"/>
<Item Key="cueid_9" ID="PLAYER_CUEID_9" Index="9"/>
<Item Key="cueid_10" ID="PLAYER_CUEID_10" Index="10"/>
<Item Key="cueid_11" ID="PLAYER_CUEID_11" Index="11"/>
<Item Key="cueid_12" ID="PLAYER_CUEID_12" Index="12"/>
<Item Key="cueid_13" ID="PLAYER_CUEID_13" Index="13"/>
<Item Key="cueid_14" ID="PLAYER_CUEID_14" Index="14"/>
<Item Key="cueid_15" ID="PLAYER_CUEID_15" Index="15"/>
<Item Key="cueid_16" ID="PLAYER_CUEID_16" Index="16"/>
<Item Key="cueid_17" ID="PLAYER_CUEID_17" Index="17"/>
<Item Key="cueid_18" ID="PLAYER_CUEID_18" Index="18"/>
<Item Key="cueid_19" ID="PLAYER_CUEID_19" Index="19"/>
<Item Key="cueid_20" ID="PLAYER_CUEID_20" Index="20"/>
<Item Key="cueid_21" ID="PLAYER_CUEID_21" Index="21"/>
<Item Key="cueid_22" ID="PLAYER_CUEID_22" Index="22"/>
<Item Key="cueid_23" ID="PLAYER_CUEID_23" Index="23"/>
<Item Key="cueid_24" ID="PLAYER_CUEID_24" Index="24"/>
<Item Key="cueid_25" ID="PLAYER_CUEID_25" Index="25"/>
<Item Key="cueid_26" ID="PLAYER_CUEID_26" Index="26"/>
<Item Key="cueid_27" ID="PLAYER_CUEID_27" Index="27"/>
<Item Key="cueid_28" ID="PLAYER_CUEID_28" Index="28"/>
<Item Key="cueid_29" ID="PLAYER_CUEID_29" Index="29"/>
<Item Key="cueid_30" ID="PLAYER_CUEID_30" Index="30"/>
<Item Key="cueid_31" ID="PLAYER_CUEID_31" Index="31"/>
<Item Key="cueid_32" ID="PLAYER_CUEID_32" Index="32"/>
<Item Key="cueid_33" ID="PLAYER_CUEID_33" Index="33"/>
<Item Key="cueid_34" ID="PLAYER_CUEID_34" Index="34"/>
<Item Key="cueid_35" ID="PLAYER_CUEID_35" Index="35"/>
<Item Key="cueid_36" ID="PLAYER_CUEID_36" Index="36"/>
<Item Key="cueid_37" ID="PLAYER_CUEID_37" Index="37"/>
<Item Key="cueid_38" ID="PLAYER_CUEID_38" Index="38"/>
<Item Key="cueid_39" ID="PLAYER_CUEID_39" Index="39"/>
<Item Key="cueid_40" ID="PLAYER_CUEID_40" Index="40"/>
<Item Key="cueid_41" ID="PLAYER_CUEID_41" Index="41"/>
<Item Key="cueid_42" ID="PLAYER_CUEID_42" Index="42"/>
<Item Key="cueid_43" ID="PLAYER_CUEID_43" Index="43"/>
<Item Key="cueid_44" ID="PLAYER_CUEID_44" Index="44"/>
<Item Key="cueid_45" ID="PLAYER_CUEID_45" Index="45"/>
<Item Key="cueid_46" ID="PLAYER_CUEID_46" Index="46"/>
<Item Key="cueid_47" ID="PLAYER_CUEID_47" Index="47"/>
<Item Key="cueid_48" ID="PLAYER_CUEID_48" Index="48"/>
<Item Key="cueid_49" ID="PLAYER_CUEID_49" Index="49"/>
<Item Key="cueid_50" ID="PLAYER_CUEID_50" Index="50"/>
<Item Key="cueid_51" ID="PLAYER_CUEID_51" Index="51"/>
<Item Key="cueid_52" ID="PLAYER_CUEID_52" Index="52"/>
<Item Key="cueid_53" ID="PLAYER_CUEID_53" Index="53"/>
<Item Key="cueid_54" ID="PLAYER_CUEID_54" Index="54"/>
<Item Key="cueid_55" ID="PLAYER_CUEID_55" Index="55"/>
<Item Key="cueid_56" ID="PLAYER_CUEID_56" Index="56"/>
<Item Key="cueid_57" ID="PLAYER_CUEID_57" Index="57"/>
<Item Key="cueid_58" ID="PLAYER_CUEID_58" Index="58"/>
<Item Key="cueid_59" ID="PLAYER_CUEID_59" Index="59"/>
<Item Key="cueid_60" ID="PLAYER_CUEID_60" Index="60"/>
<Item Key="cueid_61" ID="PLAYER_CUEID_61" Index="61"/>
<Item Key="cueid_62" ID="PLAYER_CUEID_62" Index="62"/>
<Item Key="cueid_63" ID="PLAYER_CUEID_63" Index="63"/>
<Item Key="cueid_64" ID="PLAYER_CUEID_64" Index="64"/>
<Item Key="cueid_65" ID="PLAYER_CUEID_65" Index="65"/>
<Item Key="cueid_66" ID="PLAYER_CUEID_66" Index="66"/>
<Item Key="cueid_67" ID="PLAYER_CUEID_67" Index="67"/>
<Item Key="cueid_68" ID="PLAYER_CUEID_68" Index="68"/>
<Item Key="cueid_69" ID="PLAYER_CUEID_69" Index="69"/>
<Item Key="cueid_70" ID="PLAYER_CUEID_70" Index="70"/>
<Item Key="cueid_71" ID="PLAYER_CUEID_71" Index="71"/>
<Item Key="cueid_72" ID="PLAYER_CUEID_72" Index="72"/>
<Item Key="cueid_73" ID="PLAYER_CUEID_73" Index="73"/>
<Item Key="cueid_74" ID="PLAYER_CUEID_74" Index="74"/>
<Item Key="cueid_75" ID="PLAYER_CUEID_75" Index="75"/>
<Item Key="cueid_76" ID="PLAYER_CUEID_76" Index="76"/>
<Item Key="cueid_77" ID="PLAYER_CUEID_77" Index="77"/>
<Item Key="cueid_78" ID="PLAYER_CUEID_78" Index="78"/>
<Item Key="cueid_79" ID="PLAYER_CUEID_79" Index="79"/>
<Item Key="cueid_80" ID="PLAYER_CUEID_80" Index="80"/>
<Item Key="cueid_81" ID="PLAYER_CUEID_81" Index="81"/>
<Item Key="cueid_82" ID="PLAYER_CUEID_82" Index="82"/>
<Item Key="cueid_83" ID="PLAYER_CUEID_83" Index="83"/>
<Item Key="cueid_84" ID="PLAYER_CUEID_84" Index="84"/>
<Item Key="cueid_85" ID="PLAYER_CUEID_85" Index="85"/>
<Item Key="cueid_86" ID="PLAYER_CUEID_86" Index="86"/>
<Item Key="cueid_87" ID="PLAYER_CUEID_87" Index="87"/>
<Item Key="cueid_88" ID="PLAYER_CUEID_88" Index="88"/>
<Item Key="cueid_89" ID="PLAYER_CUEID_89" Index="89"/>
<Item Key="cueid_90" ID="PLAYER_CUEID_90" Index="90"/>
<Item Key="cueid_91" ID="PLAYER_CUEID_91" Index="91"/>
</Enum>
<Enum Games="MM" Key="csSplineInterpType" ID="CutsceneCamInterpType">
<!-- https://github.com/zeldaret/mm/blob/5607eec18bae68e4cd38ef6d1fa69d7f1d84bfc8/include/z64cutscene.h#L740-L751 -->
<Item Key="none" ID="CS_CAM_INTERP_NONE" Index="0"/>
<Item Key="set" ID="CS_CAM_INTERP_SET" Index="1"/>
<Item Key="linear" ID="CS_CAM_INTERP_LINEAR" Index="2"/>
<Item Key="scale" ID="CS_CAM_INTERP_SCALE" Index="3"/>
<Item Key="cubic" ID="CS_CAM_INTERP_MP_CUBIC" Index="4"/>
<Item Key="quad" ID="CS_CAM_INTERP_MP_QUAD" Index="5"/>
<Item Key="geo" ID="CS_CAM_INTERP_GEO" Index="6"/>
<Item Key="off" ID="CS_CAM_INTERP_OFF" Index="7"/>
</Enum>
<Enum Games="MM" Key="csSplineRelTo" ID="CutsceneCamRelativeTo ">
<!-- https://github.com/zeldaret/mm/blob/5607eec18bae68e4cd38ef6d1fa69d7f1d84bfc8/include/z64cutscene.h#L754C14-L754-L760 -->
<Item Key="rel0" ID="CS_CAM_REL_0" Index="0"/>
<Item Key="rel1" ID="CS_CAM_REL_1" Index="1"/>
<Item Key="rel2" ID="CS_CAM_REL_2" Index="2"/>
<Item Key="rel3" ID="CS_CAM_REL_3" Index="3"/>
<Item Key="rel4" ID="CS_CAM_REL_4" Index="4"/>
<Item Key="rel5" ID="CS_CAM_REL_5" Index="5"/>
</Enum>
<Enum Games="OoTMqDbg" Key="ocarinaSongActionId" ID="OcarinaSongActionId">
<!-- https://github.com/zeldaret/mm/blob/2dc405b6af0cc700b7f3086aabb424bbdf98822d/include/z64ocarina.h#L35-L118 -->
<Item Key="action_0" ID="OCARINA_ACTION_0" Index="0"/>
<Item Key="action_free_play" ID="OCARINA_ACTION_FREE_PLAY" Index="1"/>
<Item Key="action_demonstrate_sonata" ID="OCARINA_ACTION_DEMONSTRATE_SONATA" Index="2"/>
<Item Key="action_demonstrate_goron_lullaby" ID="OCARINA_ACTION_DEMONSTRATE_GORON_LULLABY" Index="3"/>
<Item Key="action_demonstrate_new_wave" ID="OCARINA_ACTION_DEMONSTRATE_NEW_WAVE" Index="4"/>
<Item Key="action_demonstrate_elegy" ID="OCARINA_ACTION_DEMONSTRATE_ELEGY" Index="5"/>
<Item Key="action_demonstrate_oath" ID="OCARINA_ACTION_DEMONSTRATE_OATH" Index="6"/>
<Item Key="action_demonstrate_sarias" ID="OCARINA_ACTION_DEMONSTRATE_SARIAS" Index="7"/>
<Item Key="action_demonstrate_time" ID="OCARINA_ACTION_DEMONSTRATE_TIME" Index="8"/>
<Item Key="action_demonstrate_healing" ID="OCARINA_ACTION_DEMONSTRATE_HEALING" Index="9"/>
<Item Key="action_demonstrate_eponas" ID="OCARINA_ACTION_DEMONSTRATE_EPONAS" Index="10"/>
<Item Key="action_demonstrate_soaring" ID="OCARINA_ACTION_DEMONSTRATE_SOARING" Index="11"/>
<Item Key="action_demonstrate_storms" ID="OCARINA_ACTION_DEMONSTRATE_STORMS" Index="12"/>
<Item Key="action_demonstrate_suns" ID="OCARINA_ACTION_DEMONSTRATE_SUNS" Index="13"/>
<Item Key="action_demonstrate_inverted_time" ID="OCARINA_ACTION_DEMONSTRATE_INVERTED_TIME" Index="14"/>
<Item Key="action_demonstrate_double_time" ID="OCARINA_ACTION_DEMONSTRATE_DOUBLE_TIME" Index="15"/>
<Item Key="action_demonstrate_goron_lullaby_intro" ID="OCARINA_ACTION_DEMONSTRATE_GORON_LULLABY_INTRO" Index="16"/>
<Item Key="action_11" ID="OCARINA_ACTION_11" Index="17"/>
<Item Key="action_prompt_sonata" ID="OCARINA_ACTION_PROMPT_SONATA" Index="18"/>
<Item Key="action_prompt_goron_lullaby" ID="OCARINA_ACTION_PROMPT_GORON_LULLABY" Index="19"/>
<Item Key="action_prompt_new_wave" ID="OCARINA_ACTION_PROMPT_NEW_WAVE" Index="20"/>
<Item Key="action_prompt_elegy" ID="OCARINA_ACTION_PROMPT_ELEGY" Index="21"/>
<Item Key="action_prompt_oath" ID="OCARINA_ACTION_PROMPT_OATH" Index="22"/>
<Item Key="action_prompt_sarias" ID="OCARINA_ACTION_PROMPT_SARIAS" Index="23"/>
<Item Key="action_prompt_time" ID="OCARINA_ACTION_PROMPT_TIME" Index="24"/>
<Item Key="action_prompt_healing" ID="OCARINA_ACTION_PROMPT_HEALING" Index="25"/>
<Item Key="action_prompt_eponas" ID="OCARINA_ACTION_PROMPT_EPONAS" Index="26"/>
<Item Key="action_prompt_soaring" ID="OCARINA_ACTION_PROMPT_SOARING" Index="27"/>
<Item Key="action_prompt_storms" ID="OCARINA_ACTION_PROMPT_STORMS" Index="28"/>
<Item Key="action_prompt_suns" ID="OCARINA_ACTION_PROMPT_SUNS" Index="29"/>
<Item Key="action_prompt_inverted_time" ID="OCARINA_ACTION_PROMPT_INVERTED_TIME" Index="30"/>
<Item Key="action_prompt_double_time" ID="OCARINA_ACTION_PROMPT_DOUBLE_TIME" Index="31"/>
<Item Key="action_prompt_goron_lullaby_intro" ID="OCARINA_ACTION_PROMPT_GORON_LULLABY_INTRO" Index="32"/>
<Item Key="action_21" ID="OCARINA_ACTION_21" Index="33"/>
<Item Key="action_check_sonata" ID="OCARINA_ACTION_CHECK_SONATA" Index="34"/>
<Item Key="action_check_goron_lullaby" ID="OCARINA_ACTION_CHECK_GORON_LULLABY" Index="35"/>
<Item Key="action_check_new_wave" ID="OCARINA_ACTION_CHECK_NEW_WAVE" Index="36"/>
<Item Key="action_check_elegy" ID="OCARINA_ACTION_CHECK_ELEGY" Index="37"/>
<Item Key="action_check_oath" ID="OCARINA_ACTION_CHECK_OATH" Index="38"/>
<Item Key="action_check_sarias" ID="OCARINA_ACTION_CHECK_SARIAS" Index="39"/>
<Item Key="action_check_time" ID="OCARINA_ACTION_CHECK_TIME" Index="40"/>
<Item Key="action_check_healing" ID="OCARINA_ACTION_CHECK_HEALING" Index="41"/>
<Item Key="action_check_eponas" ID="OCARINA_ACTION_CHECK_EPONAS" Index="42"/>
<Item Key="action_check_soaring" ID="OCARINA_ACTION_CHECK_SOARING" Index="43"/>
<Item Key="action_check_storms" ID="OCARINA_ACTION_CHECK_STORMS" Index="44"/>
<Item Key="action_check_suns" ID="OCARINA_ACTION_CHECK_SUNS" Index="45"/>
<Item Key="action_check_inverted_time" ID="OCARINA_ACTION_CHECK_INVERTED_TIME" Index="46"/>
<Item Key="action_check_double_time" ID="OCARINA_ACTION_CHECK_DOUBLE_TIME" Index="47"/>
<Item Key="action_check_goron_lullaby_intro" ID="OCARINA_ACTION_CHECK_GORON_LULLABY_INTRO" Index="48"/>
<Item Key="action_check_scarecrow_spawn" ID="OCARINA_ACTION_CHECK_SCARECROW_SPAWN" Index="49"/>
<Item Key="action_free_play_done," ID="OCARINA_ACTION_FREE_PLAY_DONE," Index="50"/>
<Item Key="action_scarecrow_long_recording" ID="OCARINA_ACTION_SCARECROW_LONG_RECORDING" Index="51"/>
<Item Key="action_scarecrow_long_demonstration" ID="OCARINA_ACTION_SCARECROW_LONG_DEMONSTRATION" Index="52"/>
<Item Key="action_scarecrow_spawn_recording" ID="OCARINA_ACTION_SCARECROW_SPAWN_RECORDING" Index="53"/>
<Item Key="action_scarecrow_spawn_demonstration" ID="OCARINA_ACTION_SCARECROW_SPAWN_DEMONSTRATION" Index="54"/>
<Item Key="action_37" ID="OCARINA_ACTION_37" Index="55"/>
<Item Key="action_check_notime" ID="OCARINA_ACTION_CHECK_NOTIME" Index="56"/>
<Item Key="action_check_notime_done" ID="OCARINA_ACTION_CHECK_NOTIME_DONE" Index="57"/>
<Item Key="action_3a" ID="OCARINA_ACTION_3A" Index="58"/>
<Item Key="action_3b" ID="OCARINA_ACTION_3B" Index="59"/>
<Item Key="action_3c" ID="OCARINA_ACTION_3C" Index="60"/>
<Item Key="action_demonstrate_evan_part1_first_half" ID="OCARINA_ACTION_DEMONSTRATE_EVAN_PART1_FIRST_HALF" Index="61"/>
<Item Key="action_demonstrate_evan_part2_first_half" ID="OCARINA_ACTION_DEMONSTRATE_EVAN_PART2_FIRST_HALF" Index="62"/>
<Item Key="action_demonstrate_evan_part1_second_half" ID="OCARINA_ACTION_DEMONSTRATE_EVAN_PART1_SECOND_HALF" Index="63"/>
<Item Key="action_demonstrate_evan_part2_second_half" ID="OCARINA_ACTION_DEMONSTRATE_EVAN_PART2_SECOND_HALF" Index="64"/>
<Item Key="action_prompt_evan_part1_second_half" ID="OCARINA_ACTION_PROMPT_EVAN_PART1_SECOND_HALF" Index="65"/>
<Item Key="action_prompt_evan_part2_second_half" ID="OCARINA_ACTION_PROMPT_EVAN_PART2_SECOND_HALF" Index="66"/>
<Item Key="action_prompt_wind_fish_human" ID="OCARINA_ACTION_PROMPT_WIND_FISH_HUMAN" Index="67"/>
<Item Key="action_prompt_wind_fish_goron" ID="OCARINA_ACTION_PROMPT_WIND_FISH_GORON" Index="68"/>
<Item Key="action_prompt_wind_fish_zora" ID="OCARINA_ACTION_PROMPT_WIND_FISH_ZORA" Index="69"/>
<Item Key="action_prompt_wind_fish_deku" ID="OCARINA_ACTION_PROMPT_WIND_FISH_DEKU" Index="70"/>
<Item Key="action_timed_prompt_sonata" ID="OCARINA_ACTION_TIMED_PROMPT_SONATA" Index="71"/>
<Item Key="action_timed_prompt_goron_lullaby" ID="OCARINA_ACTION_TIMED_PROMPT_GORON_LULLABY" Index="72"/>
<Item Key="action_timed_prompt_new_wave" ID="OCARINA_ACTION_TIMED_PROMPT_NEW_WAVE" Index="73"/>
<Item Key="action_timed_prompt_elegy" ID="OCARINA_ACTION_TIMED_PROMPT_ELEGY" Index="74"/>
<Item Key="action_timed_prompt_oath" ID="OCARINA_ACTION_TIMED_PROMPT_OATH" Index="75"/>
<Item Key="action_timed_prompt_sarias" ID="OCARINA_ACTION_TIMED_PROMPT_SARIAS" Index="76"/>
<Item Key="action_timed_prompt_time" ID="OCARINA_ACTION_TIMED_PROMPT_TIME" Index="77"/>
<Item Key="action_timed_prompt_healing" ID="OCARINA_ACTION_TIMED_PROMPT_HEALING" Index="78"/>
<Item Key="action_timed_prompt_eponas" ID="OCARINA_ACTION_TIMED_PROMPT_EPONAS" Index="79"/>
<Item Key="action_timed_prompt_soaring" ID="OCARINA_ACTION_TIMED_PROMPT_SOARING" Index="80"/>
<Item Key="action_timed_prompt_storms" ID="OCARINA_ACTION_TIMED_PROMPT_STORMS" Index="81"/>
</Enum>
<Enum Games="OoTMqDbg" Key="seqId" ID="SeqId">
<!-- https://github.com/zeldaret/mm/blob/2dc405b6af0cc700b7f3086aabb424bbdf98822d/include/sequence.h#L4-132 -->
<Item Key="general_sfx" ID="NA_BGM_GENERAL_SFX" Index="0"/>
<Item Key="ambience" ID="NA_BGM_AMBIENCE" Index="1"/>
<Item Key="termina_field" ID="NA_BGM_TERMINA_FIELD" Index="2"/>
<Item Key="chase" ID="NA_BGM_CHASE" Index="3"/>
<Item Key="majoras_theme" ID="NA_BGM_MAJORAS_THEME" Index="4"/>
<Item Key="clock_tower" ID="NA_BGM_CLOCK_TOWER" Index="5"/>
<Item Key="stone_tower_temple" ID="NA_BGM_STONE_TOWER_TEMPLE" Index="6"/>
<Item Key="inv_stone_tower_temple" ID="NA_BGM_INV_STONE_TOWER_TEMPLE" Index="7"/>
<Item Key="failure_0" ID="NA_BGM_FAILURE_0" Index="8"/>
<Item Key="failure_1" ID="NA_BGM_FAILURE_1" Index="9"/>
<Item Key="happy_mask_salesman" ID="NA_BGM_HAPPY_MASK_SALESMAN" Index="10"/>
<Item Key="song_of_healing" ID="NA_BGM_SONG_OF_HEALING" Index="11"/>
<Item Key="swamp_region" ID="NA_BGM_SWAMP_REGION" Index="12"/>
<Item Key="alien_invasion" ID="NA_BGM_ALIEN_INVASION" Index="13"/>
<Item Key="swamp_cruise" ID="NA_BGM_SWAMP_CRUISE" Index="14"/>
<Item Key="sharps_curse" ID="NA_BGM_SHARPS_CURSE" Index="15"/>
<Item Key="great_bay_region" ID="NA_BGM_GREAT_BAY_REGION" Index="16"/>
<Item Key="ikana_region" ID="NA_BGM_IKANA_REGION" Index="17"/>
<Item Key="deku_palace" ID="NA_BGM_DEKU_PALACE" Index="18"/>
<Item Key="mountain_region" ID="NA_BGM_MOUNTAIN_REGION" Index="19"/>
<Item Key="pirates_fortress" ID="NA_BGM_PIRATES_FORTRESS" Index="20"/>
<Item Key="clock_town_day_1" ID="NA_BGM_CLOCK_TOWN_DAY_1" Index="21"/>
<Item Key="clock_town_day_2" ID="NA_BGM_CLOCK_TOWN_DAY_2" Index="22"/>
<Item Key="clock_town_day_3" ID="NA_BGM_CLOCK_TOWN_DAY_3" Index="23"/>
<Item Key="file_select" ID="NA_BGM_FILE_SELECT" Index="24"/>
<Item Key="clear_event" ID="NA_BGM_CLEAR_EVENT" Index="25"/>
<Item Key="enemy" ID="NA_BGM_ENEMY" Index="26"/>
<Item Key="boss" ID="NA_BGM_BOSS" Index="27"/>
<Item Key="woodfall_temple" ID="NA_BGM_WOODFALL_TEMPLE" Index="28"/>
<Item Key="clock_town_main_sequence" ID="NA_BGM_CLOCK_TOWN_MAIN_SEQUENCE" Index="29"/>
<Item Key="opening" ID="NA_BGM_OPENING" Index="30"/>
<Item Key="inside_a_house" ID="NA_BGM_INSIDE_A_HOUSE" Index="31"/>
<Item Key="game_over" ID="NA_BGM_GAME_OVER" Index="32"/>
<Item Key="clear_boss" ID="NA_BGM_CLEAR_BOSS" Index="33"/>
<Item Key="get_item" ID="NA_BGM_GET_ITEM" Index="34"/>
<Item Key="clock_town_day_2_ptr" ID="NA_BGM_CLOCK_TOWN_DAY_2_PTR" Index="35"/>
<Item Key="get_heart" ID="NA_BGM_GET_HEART" Index="36"/>
<Item Key="timed_mini_game" ID="NA_BGM_TIMED_MINI_GAME" Index="37"/>
<Item Key="goron_race" ID="NA_BGM_GORON_RACE" Index="38"/>
<Item Key="music_box_house" ID="NA_BGM_MUSIC_BOX_HOUSE" Index="39"/>
<Item Key="fairy_fountain" ID="NA_BGM_FAIRY_FOUNTAIN" Index="40"/>
<Item Key="zeldas_lullaby" ID="NA_BGM_ZELDAS_LULLABY" Index="41"/>
<Item Key="rosa_sisters" ID="NA_BGM_ROSA_SISTERS" Index="42"/>
<Item Key="open_chest" ID="NA_BGM_OPEN_CHEST" Index="43"/>
<Item Key="marine_research_lab" ID="NA_BGM_MARINE_RESEARCH_LAB" Index="44"/>
<Item Key="giants_theme" ID="NA_BGM_GIANTS_THEME" Index="45"/>
<Item Key="song_of_storms" ID="NA_BGM_SONG_OF_STORMS" Index="46"/>
<Item Key="romani_ranch" ID="NA_BGM_ROMANI_RANCH" Index="47"/>
<Item Key="goron_village" ID="NA_BGM_GORON_VILLAGE" Index="48"/>
<Item Key="mayors_office" ID="NA_BGM_MAYORS_OFFICE" Index="49"/>
<Item Key="ocarina_epona" ID="NA_BGM_OCARINA_EPONA" Index="50"/>
<Item Key="ocarina_suns" ID="NA_BGM_OCARINA_SUNS" Index="51"/>
<Item Key="ocarina_time" ID="NA_BGM_OCARINA_TIME" Index="52"/>
<Item Key="ocarina_storm" ID="NA_BGM_OCARINA_STORM" Index="53"/>
<Item Key="zora_hall" ID="NA_BGM_ZORA_HALL" Index="54"/>
<Item Key="get_new_mask" ID="NA_BGM_GET_NEW_MASK" Index="55"/>
<Item Key="mini_boss" ID="NA_BGM_MINI_BOSS" Index="56"/>
<Item Key="get_small_item" ID="NA_BGM_GET_SMALL_ITEM" Index="57"/>
<Item Key="astral_observatory" ID="NA_BGM_ASTRAL_OBSERVATORY" Index="58"/>
<Item Key="cavern" ID="NA_BGM_CAVERN" Index="59"/>
<Item Key="milk_bar" ID="NA_BGM_MILK_BAR" Index="60"/>
<Item Key="zelda_appear" ID="NA_BGM_ZELDA_APPEAR" Index="61"/>
<Item Key="sarias_song" ID="NA_BGM_SARIAS_SONG" Index="62"/>
<Item Key="goron_goal" ID="NA_BGM_GORON_GOAL" Index="63"/>
<Item Key="horse" ID="NA_BGM_HORSE" Index="64"/>
<Item Key="horse_goal" ID="NA_BGM_HORSE_GOAL" Index="65"/>
<Item Key="ingo" ID="NA_BGM_INGO" Index="66"/>
<Item Key="kotake_potion_shop" ID="NA_BGM_KOTAKE_POTION_SHOP" Index="67"/>
<Item Key="shop" ID="NA_BGM_SHOP" Index="68"/>
<Item Key="owl" ID="NA_BGM_OWL" Index="69"/>
<Item Key="shooting_gallery" ID="NA_BGM_SHOOTING_GALLERY" Index="70"/>
<Item Key="ocarina_soaring" ID="NA_BGM_OCARINA_SOARING" Index="71"/>
<Item Key="ocarina_healing" ID="NA_BGM_OCARINA_HEALING" Index="72"/>
<Item Key="inverted_song_of_time" ID="NA_BGM_INVERTED_SONG_OF_TIME" Index="73"/>
<Item Key="song_of_double_time" ID="NA_BGM_SONG_OF_DOUBLE_TIME" Index="74"/>
<Item Key="sonata_of_awakening" ID="NA_BGM_SONATA_OF_AWAKENING" Index="75"/>
<Item Key="goron_lullaby" ID="NA_BGM_GORON_LULLABY" Index="76"/>
<Item Key="new_wave_bossa_nova" ID="NA_BGM_NEW_WAVE_BOSSA_NOVA" Index="77"/>
<Item Key="elegy_of_emptiness" ID="NA_BGM_ELEGY_OF_EMPTINESS" Index="78"/>
<Item Key="oath_to_order" ID="NA_BGM_OATH_TO_ORDER" Index="79"/>
<Item Key="sword_training_hall" ID="NA_BGM_SWORD_TRAINING_HALL" Index="80"/>
<Item Key="ocarina_lullaby_intro" ID="NA_BGM_OCARINA_LULLABY_INTRO" Index="81"/>
<Item Key="learned_new_song" ID="NA_BGM_LEARNED_NEW_SONG" Index="82"/>
<Item Key="bremen_march" ID="NA_BGM_BREMEN_MARCH" Index="83"/>
<Item Key="ballad_of_the_wind_fish" ID="NA_BGM_BALLAD_OF_THE_WIND_FISH" Index="84"/>
<Item Key="song_of_soaring" ID="NA_BGM_SONG_OF_SOARING" Index="85"/>
<Item Key="milk_bar_duplicate" ID="NA_BGM_MILK_BAR_DUPLICATE" Index="86"/>
<Item Key="final_hours" ID="NA_BGM_FINAL_HOURS" Index="87"/>
<Item Key="mikau_riff" ID="NA_BGM_MIKAU_RIFF" Index="88"/>
<Item Key="mikau_finale" ID="NA_BGM_MIKAU_FINALE" Index="89"/>
<Item Key="frog_song" ID="NA_BGM_FROG_SONG" Index="90"/>
<Item Key="ocarina_sonata" ID="NA_BGM_OCARINA_SONATA" Index="91"/>
<Item Key="ocarina_lullaby" ID="NA_BGM_OCARINA_LULLABY" Index="92"/>
<Item Key="ocarina_new_wave" ID="NA_BGM_OCARINA_NEW_WAVE" Index="93"/>
<Item Key="ocarina_elegy" ID="NA_BGM_OCARINA_ELEGY" Index="94"/>
<Item Key="ocarina_oath" ID="NA_BGM_OCARINA_OATH" Index="95"/>
<Item Key="majoras_lair" ID="NA_BGM_MAJORAS_LAIR" Index="96"/>
<Item Key="ocarina_lullaby_intro_ptr" ID="NA_BGM_OCARINA_LULLABY_INTRO_PTR" Index="97"/>
<Item Key="ocarina_guitar_bass_session" ID="NA_BGM_OCARINA_GUITAR_BASS_SESSION" Index="98"/>
<Item Key="piano_session" ID="NA_BGM_PIANO_SESSION" Index="99"/>
<Item Key="indigo_go_session" ID="NA_BGM_INDIGO_GO_SESSION" Index="100"/>
<Item Key="snowhead_temple" ID="NA_BGM_SNOWHEAD_TEMPLE" Index="101"/>
<Item Key="great_bay_temple" ID="NA_BGM_GREAT_BAY_TEMPLE" Index="102"/>
<Item Key="new_wave_saxophone" ID="NA_BGM_NEW_WAVE_SAXOPHONE" Index="103"/>
<Item Key="new_wave_vocal" ID="NA_BGM_NEW_WAVE_VOCAL" Index="104"/>
<Item Key="majoras_wrath" ID="NA_BGM_MAJORAS_WRATH" Index="105"/>
<Item Key="majoras_incarnation" ID="NA_BGM_MAJORAS_INCARNATION" Index="106"/>
<Item Key="majoras_mask" ID="NA_BGM_MAJORAS_MASK" Index="107"/>
<Item Key="bass_play" ID="NA_BGM_BASS_PLAY" Index="108"/>
<Item Key="drums_play" ID="NA_BGM_DRUMS_PLAY" Index="109"/>
<Item Key="piano_play" ID="NA_BGM_PIANO_PLAY" Index="110"/>
<Item Key="ikana_castle" ID="NA_BGM_IKANA_CASTLE" Index="111"/>
<Item Key="gathering_giants" ID="NA_BGM_GATHERING_GIANTS" Index="112"/>
<Item Key="kamaro_dance" ID="NA_BGM_KAMARO_DANCE" Index="113"/>
<Item Key="cremia_carriage" ID="NA_BGM_CREMIA_CARRIAGE" Index="114"/>
<Item Key="keaton_quiz" ID="NA_BGM_KEATON_QUIZ" Index="115"/>
<Item Key="end_credits" ID="NA_BGM_END_CREDITS" Index="116"/>
<Item Key="opening_loop" ID="NA_BGM_OPENING_LOOP" Index="117"/>
<Item Key="title_theme" ID="NA_BGM_TITLE_THEME" Index="118"/>
<Item Key="dungeon_appear" ID="NA_BGM_DUNGEON_APPEAR" Index="119"/>
<Item Key="woodfall_clear" ID="NA_BGM_WOODFALL_CLEAR" Index="120"/>
<Item Key="snowhead_clear" ID="NA_BGM_SNOWHEAD_CLEAR" Index="121"/>
<Item Key="into_the_moon" ID="NA_BGM_INTO_THE_MOON" Index="123"/>
<Item Key="goodbye_giant" ID="NA_BGM_GOODBYE_GIANT" Index="124"/>
<Item Key="tatl_and_tael" ID="NA_BGM_TATL_AND_TAEL" Index="125"/>
<Item Key="moons_destruction" ID="NA_BGM_MOONS_DESTRUCTION" Index="126"/>
<Item Key="end_credits_second_half" ID="NA_BGM_END_CREDITS_SECOND_HALF" Index="127"/>
</Enum>
</Root>