diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index d7eb844..ff38bf1 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -166,7 +166,7 @@ void DListBinaryExporter::Export(std::ostream &write, std::shared_ptrGetNodeByAddr(ptr); if(dec.has_value()){ @@ -192,7 +192,7 @@ void DListBinaryExporter::Export(std::ostream &write, std::shared_ptrGetNodeByAddr(ptr); Gfx value = gsSPDisplayListOTRHash(ptr); @@ -213,7 +213,7 @@ void DListBinaryExporter::Export(std::ostream &write, std::shared_ptrGetNodeByAddr(ptr); w0 &= 0x00FFFFFF; @@ -234,7 +234,7 @@ void DListBinaryExporter::Export(std::ostream &write, std::shared_ptrGetNodeByAddr(ptr); Gfx value = gsDPSetTextureOTRImage(C0(21, 3), C0(19, 2), C0(0, 10), ptr); @@ -295,15 +295,14 @@ std::optional> DListFactory::parse(std::vectorNormalizeAsset("seg" + std::to_string(SEGMENT_NUMBER(w1)) +"_dl_" + Torch::to_hex(SEGMENT_OFFSET(ptr), false)); + output = Companion::Instance->NormalizeAsset("seg" + std::to_string(SEGMENT_NUMBER(ptr)) +"_dl_" + Torch::to_hex(SEGMENT_OFFSET(ptr), false)); } else { SPDLOG_INFO("Found display list at 0x{:X}", ptr); - output = Companion::Instance->NormalizeAsset("dl_" + Torch::to_hex(w1, false)); + output = Companion::Instance->NormalizeAsset("dl_" + Torch::to_hex(ptr, false)); } Decompressor::CopyCompression(node, dl); @@ -353,7 +352,7 @@ std::optional> DListFactory::parse(std::vector> DListFactory::parse(std::vectorGetNodeByAddr(w1); !decl.has_value()){ SPDLOG_INFO("Addr to Vtx array at 0x{:X} not in yaml, autogenerating it", w1); - auto ptr = Decompressor::TranslateAddr(w1); + auto ptr = w1; auto rom = Companion::Instance->GetRomData(); auto factory = Companion::Instance->GetFactory("VTX")->get(); diff --git a/src/factories/DisplayListOverrides.cpp b/src/factories/DisplayListOverrides.cpp index 3af2f69..52a832d 100644 --- a/src/factories/DisplayListOverrides.cpp +++ b/src/factories/DisplayListOverrides.cpp @@ -46,8 +46,7 @@ void Quadrangle(const Gfx* gfx) { gfxd_puts(")"); } -int Vtx(uint32_t vtx, int32_t num) { - auto ptr = Decompressor::TranslateAddr(vtx); +int Vtx(uint32_t ptr, int32_t num) { auto dec = Companion::Instance->GetNodeByAddr(ptr); if(dec.has_value()){ @@ -62,38 +61,37 @@ int Vtx(uint32_t vtx, int32_t num) { return 0; } -int Texture(uint32_t timg, int32_t fmt, int32_t siz, int32_t width, int32_t height, int32_t pal) { - auto dec = Companion::Instance->GetNodeByAddr(timg); +int Texture(uint32_t ptr, int32_t fmt, int32_t siz, int32_t width, int32_t height, int32_t pal) { + auto dec = Companion::Instance->GetNodeByAddr(ptr); if(dec.has_value()){ auto node = std::get<1>(dec.value()); auto symbol = GetSafeNode(node, "symbol"); - SPDLOG_INFO("Found Texture: 0x{:X} Symbol: {}", timg, symbol); + SPDLOG_INFO("Found Texture: 0x{:X} Symbol: {}", ptr, symbol); gfxd_puts(symbol.c_str()); return 1; } - SPDLOG_WARN("Could not find texture at 0x{:X}", timg); + SPDLOG_WARN("Could not find texture at 0x{:X}", ptr); return 0; } -int Palette(uint32_t tlut, int32_t idx, int32_t count) { - auto dec = Companion::Instance->GetNodeByAddr(tlut); +int Palette(uint32_t ptr, int32_t idx, int32_t count) { + auto dec = Companion::Instance->GetNodeByAddr(ptr); if(dec.has_value()){ auto node = std::get<1>(dec.value()); auto symbol = GetSafeNode(node, "symbol"); - SPDLOG_INFO("Found TLUT: 0x{:X} Symbol: {}", tlut, symbol); + SPDLOG_INFO("Found TLUT: 0x{:X} Symbol: {}", ptr, symbol); gfxd_puts(symbol.c_str()); return 1; } - SPDLOG_WARN("Could not find tlut at 0x{:X}", tlut); + SPDLOG_WARN("Could not find tlut at 0x{:X}", ptr); return 0; } -int Light(uint32_t lightsn, int32_t count) { - auto ptr = Decompressor::TranslateAddr(lightsn); +int Light(uint32_t ptr, int32_t count) { auto dec = Companion::Instance->GetNodeByAddr(ptr); if(dec.has_value()){ @@ -108,8 +106,7 @@ int Light(uint32_t lightsn, int32_t count) { return 0; } -int DisplayList(uint32_t dl) { - auto ptr = Decompressor::TranslateAddr(dl); +int DisplayList(uint32_t ptr) { auto dec = Companion::Instance->GetNodeByAddr(ptr); if(dec.has_value()){ diff --git a/src/factories/TextureFactory.cpp b/src/factories/TextureFactory.cpp index 420d8d8..e5b8caa 100644 --- a/src/factories/TextureFactory.cpp +++ b/src/factories/TextureFactory.cpp @@ -143,7 +143,7 @@ std::optional> TextureFactory::parse(std::vector(node, "offset")); + auto offset = GetSafeNode(node, "offset"); if (format.empty()) { SPDLOG_ERROR("Texture entry at {:X} in yaml missing format node\n\