diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-02-18 12:54:55 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-02-18 12:54:55 -0600 |
| commit | 8f7f877306ddf0050fa3ce88781ecbf61f9a97a9 (patch) | |
| tree | 14c3643d5a558dac3e0bd60cc264339e15bcac66 /src/factories/DisplayListOverrides.cpp | |
| parent | 102ab4862f360651f02ec1af904298984699a3d4 (diff) | |
Added symbol generation for tluts
Diffstat (limited to 'src/factories/DisplayListOverrides.cpp')
| -rw-r--r-- | src/factories/DisplayListOverrides.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/factories/DisplayListOverrides.cpp b/src/factories/DisplayListOverrides.cpp index bdf2fa3..3af2f69 100644 --- a/src/factories/DisplayListOverrides.cpp +++ b/src/factories/DisplayListOverrides.cpp @@ -63,18 +63,32 @@ int Vtx(uint32_t vtx, int32_t num) { } int Texture(uint32_t timg, int32_t fmt, int32_t siz, int32_t width, int32_t height, int32_t pal) { - auto ptr = Decompressor::TranslateAddr(timg); - auto dec = Companion::Instance->GetNodeByAddr(ptr); + auto dec = Companion::Instance->GetNodeByAddr(timg); + + if(dec.has_value()){ + auto node = std::get<1>(dec.value()); + auto symbol = GetSafeNode<std::string>(node, "symbol"); + SPDLOG_INFO("Found Texture: 0x{:X} Symbol: {}", timg, symbol); + gfxd_puts(symbol.c_str()); + return 1; + } + + SPDLOG_WARN("Could not find texture at 0x{:X}", timg); + return 0; +} + +int Palette(uint32_t tlut, int32_t idx, int32_t count) { + auto dec = Companion::Instance->GetNodeByAddr(tlut); if(dec.has_value()){ auto node = std::get<1>(dec.value()); auto symbol = GetSafeNode<std::string>(node, "symbol"); - SPDLOG_INFO("Found Texture: 0x{:X} Symbol: {}", ptr, symbol); + SPDLOG_INFO("Found TLUT: 0x{:X} Symbol: {}", tlut, symbol); gfxd_puts(symbol.c_str()); return 1; } - SPDLOG_WARN("Could not find texture at 0x{:X}", ptr); + SPDLOG_WARN("Could not find tlut at 0x{:X}", tlut); return 0; } |
