From f06ed7388df76f09d8fbda765acea5d2923553d4 Mon Sep 17 00:00:00 2001 From: MegaMech Date: Fri, 8 Mar 2024 13:24:58 -0700 Subject: Detect Compression Type and Improve Yaml Structure (#21) * Auto detect mio0 * Altered decompressor * Fix bug * Bug fix * fix * debugging * fix debug * Remove logging * Fix spacing * node change * Cleanup * Track compression offset using global var * Implementation * Renames * Simplification * Fixes * Fix debugging output * yaml config segments uses array style * Fix to_hex zero fill * Bug fixes --------- Co-authored-by: = <=> --- src/factories/DisplayListFactory.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/factories/DisplayListFactory.cpp') diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index bf13826..d5197cc 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -77,7 +77,7 @@ void DListHeaderExporter::Export(std::ostream &write, std::shared_ptr raw, std::string& entryName, YAML::Node &node, std::string* replacement ) { const auto cmds = std::static_pointer_cast(raw)->mGfxs; const auto symbol = GetSafeNode(node, "symbol", entryName); - const auto offset = GetSafeNode(node, "offset"); + auto offset = GetSafeNode(node, "offset"); char out[0xFFFF] = {0}; @@ -113,6 +113,9 @@ void DListCodeExporter::Export(std::ostream &write, std::shared_ptr GFXDSetGBIVersion(); if (Companion::Instance->IsDebug()) { + if (IS_SEGMENTED(offset)) { + offset = SEGMENT_OFFSET(offset); + } write << "// 0x" << std::hex << std::uppercase << offset << "\n"; } @@ -267,8 +270,6 @@ std::optional> DListFactory::parse(std::vector gfxs; auto processing = true; @@ -305,7 +306,6 @@ std::optional> DListFactory::parse(std::vectorNormalizeAsset("dl_" + Torch::to_hex(ptr, false)); } - Decompressor::CopyCompression(node, dl); dl["type"] = "GFX"; dl["offset"] = ptr; dl["symbol"] = output; @@ -363,7 +363,6 @@ std::optional> DListFactory::parse(std::vectorNormalizeAsset("lights1_" + Torch::to_hex(w1, false)); } - Decompressor::CopyCompression(node, light); light["type"] = "lights"; light["offset"] = ptr; light["symbol"] = output; @@ -411,7 +410,6 @@ std::optional> DListFactory::parse(std::vectorNormalizeAsset("vtx_" + Torch::to_hex(w1, false)); } - Decompressor::CopyCompression(node, vtx); vtx["type"] = "VTX"; vtx["offset"] = ptr; vtx["count"] = nvtx; -- cgit v1.2.3