diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2025-03-29 15:16:10 -0400 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2025-03-29 15:16:10 -0400 |
| commit | a9dea598b603336cf23f25464cae9eb9c399dbd9 (patch) | |
| tree | 41e601608e4d5e087266fb6d9a83500c8347460b | |
| parent | c1288acaac94062271c54b3242e0a4418c1fc175 (diff) | |
Fix some MM specific things
| -rw-r--r-- | CFG/Config.xml | 10 | ||||
| -rw-r--r-- | CFG/Config_MM.xml | 8 | ||||
| -rw-r--r-- | CFG/EnumData_MM.xml (renamed from CFG/EnumData.xml) | 0 | ||||
| -rw-r--r-- | CMakeLists.txt | 6 | ||||
| -rw-r--r-- | OTRExporter/CutsceneExporter.cpp | 10 | ||||
| -rw-r--r-- | OTRExporter/Exporter.h | 5 | ||||
| -rwxr-xr-x | extract_assets.py | 19 |
7 files changed, 45 insertions, 13 deletions
diff --git a/CFG/Config.xml b/CFG/Config.xml index 1c845c1..adec174 100644 --- a/CFG/Config.xml +++ b/CFG/Config.xml @@ -1,8 +1,8 @@ <Root> - <SymbolMap File="SymbolMap_MM.txt"/> - <ActorList File="ActorList_MM.txt"/> - <ObjectList File="ObjectList_MM.txt"/> - <EnumData File="EnumData.xml"/> - <ExternalXMLFolder Path="../mm/assets/xml/N64_US/"/> + <SymbolMap File="SymbolMap_OoTMqDbg.txt"/> + <ActorList File="ActorList_OoTMqDbg.txt"/> + <ObjectList File="ObjectList_OoTMqDbg.txt"/> + <ExternalXMLFolder Path="../soh/assets/xml/GC_NMQ_PAL_F/"/> + <TexturePool File="TexturePool.xml"/> <ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="objects/gameplay_keep/"/> </Root> diff --git a/CFG/Config_MM.xml b/CFG/Config_MM.xml new file mode 100644 index 0000000..642d066 --- /dev/null +++ b/CFG/Config_MM.xml @@ -0,0 +1,8 @@ +<Root> + <SymbolMap File="SymbolMap_MM.txt"/> + <ActorList File="ActorList_MM.txt"/> + <ObjectList File="ObjectList_MM.txt"/> + <EnumData File="EnumData_MM.xml"/> + <ExternalXMLFolder Path="../mm/assets/xml/N64_US/"/> + <ExternalFile XmlPath="objects/gameplay_keep.xml" OutPath="objects/gameplay_keep/"/> +</Root> diff --git a/CFG/EnumData.xml b/CFG/EnumData_MM.xml index 8343a0b..8343a0b 100644 --- a/CFG/EnumData.xml +++ b/CFG/EnumData_MM.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index eaaab54..6223a17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,3 +89,9 @@ if (NOT TARGET ZAPD) endif()
add_subdirectory(OTRExporter)
+
+if (GAME_STR STREQUAL "MM")
+ target_compile_definitions(OTRExporter PRIVATE GAME_MM)
+else()
+ target_compile_definitions(OTRExporter PRIVATE GAME_OOT)
+endif()
diff --git a/OTRExporter/CutsceneExporter.cpp b/OTRExporter/CutsceneExporter.cpp index 0e19a0c..0689788 100644 --- a/OTRExporter/CutsceneExporter.cpp +++ b/OTRExporter/CutsceneExporter.cpp @@ -1,10 +1,11 @@ #include "CutsceneExporter.h" +#include "Globals.h" #include <libultraship/bridge.h> void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZCutscene* cs = (ZCutscene*)res; - WriteHeader(cs, outPath, writer, static_cast<uint32_t>(SOH::ResourceType::SOH_Cutscene)); + WriteHeader(cs, outPath, writer, static_cast<uint32_t>(SOH::ResourceType::SOH_Cutscene)); writer->Write((uint32_t)0); @@ -12,7 +13,12 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW writer->Write(CS_BEGIN_CUTSCENE(cs->numCommands, cs->endFrame)); - SaveMM(cs, writer); + if (Globals::Instance->game == ZGame::MM_RETAIL) { + SaveMM(cs, writer); + } else { + SaveOot(cs, writer); + } + // CS_END writer->Write(0xFFFFFFFF); diff --git a/OTRExporter/Exporter.h b/OTRExporter/Exporter.h index 4f5b84a..b1214c7 100644 --- a/OTRExporter/Exporter.h +++ b/OTRExporter/Exporter.h @@ -5,8 +5,11 @@ #include <Utils/BinaryWriter.h> #include <libultraship/bridge.h> #include "VersionInfo.h" +#ifdef GAME_MM #include "../../mm/2s2h/resource/type/2shResourceType.h" - +#elif GAME_OOT +#include "../../soh/soh/resource/type/SoHResourceType.h" +#endif class OTRExporter : public ZResourceExporter { protected: diff --git a/extract_assets.py b/extract_assets.py index 2e8dc61..0eed59a 100755 --- a/extract_assets.py +++ b/extract_assets.py @@ -8,20 +8,29 @@ import struct import subprocess import argparse -def BuildOTR(xmlPath, rom, zapd_exe=None, genHeaders=None, customAssetsPath=None, customOtrFile=None, portVer=None): +def BuildOTR(xmlPath, rom, zapd_exe=None, genHeaders=None, customAssetsPath=None, customOtrFile=None, portVer=None, isMM): if not zapd_exe: zapd_exe = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out" exec_cmd = [zapd_exe, "ed", "-i", xmlPath, "-b", rom, "-fl", "CFG/filelists", - "-o", "placeholder", "-osf", "placeholder", "-rconf", "CFG/Config.xml"] + "-o", "placeholder", "-osf", "placeholder", "-rconf"] + if isMM: + exec_cmd.extend("CFG/Config_MM.xml") + else: + exec_cmd.extend("CFG/Config.xml") # generate headers, but not otrs by excluding the otr exporter if genHeaders: exec_cmd.extend(["-gsf", "1"]) else: # generate otrs, but not headers - exec_cmd.extend(["-gsf", "0", "-se", "OTR", "--customAssetsPath", customAssetsPath, - "--customOtrFile", customOtrFile, "--otrfile", "mm.zip"]) + if isMM: + exec_cmd.extend(["-gsf", "0", "-se", "OTR", "--customAssetsPath", customAssetsPath, + "--customOtrFile", customOtrFile, "--otrfile", "mm.zip"]) + else: + exec_cmd.extend(["-gsf", "0", "-se", "OTR", "--customAssetsPath", customAssetsPath, + "--customOtrFile", customOtrFile, "--otrfile", "oot.otr"]) + if portVer: exec_cmd.extend(["--portVer", portVer]) @@ -79,7 +88,7 @@ def main(): roms = [ Z64Rom(args.rom) ] if args.rom else rom_chooser.chooseROM(args.verbose, args.non_interactive) for rom in roms: BuildOTR(os.path.join(args.xml_root, rom.version.xml_ver), rom.file_path, zapd_exe=args.zapd_exe, genHeaders=args.gen_headers, - customAssetsPath=args.custom_assets_path, customOtrFile=args.custom_otr_file, portVer=args.port_ver) + customAssetsPath=args.custom_assets_path, customOtrFile=args.custom_otr_file, portVer=args.port_ver, rom_info.is_mm(args.rom)) if __name__ == "__main__": main() |
