mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Added symbol generation for tluts
This commit is contained in:
@@ -108,6 +108,7 @@ void DListCodeExporter::Export(std::ostream &write, std::shared_ptr<IParsedData>
|
||||
gfxd_vtx_callback(GFXDOverride::Vtx);
|
||||
gfxd_timg_callback(GFXDOverride::Texture);
|
||||
gfxd_dl_callback(GFXDOverride::DisplayList);
|
||||
gfxd_tlut_callback(GFXDOverride::Palette);
|
||||
gfxd_lightsn_callback(GFXDOverride::Light);
|
||||
GFXDSetGBIVersion();
|
||||
|
||||
@@ -136,6 +137,7 @@ void DebugDisplayList(uint32_t w0, uint32_t w1){
|
||||
gfxd_vtx_callback(GFXDOverride::Vtx);
|
||||
gfxd_timg_callback(GFXDOverride::Texture);
|
||||
gfxd_dl_callback(GFXDOverride::DisplayList);
|
||||
gfxd_tlut_callback(GFXDOverride::Palette);
|
||||
//gfxd_light_callback(GFXDOverride::Light);
|
||||
GFXDSetGBIVersion();
|
||||
gfxd_execute();
|
||||
|
||||
@@ -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: {}", ptr, 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}", ptr);
|
||||
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 TLUT: 0x{:X} Symbol: {}", tlut, symbol);
|
||||
gfxd_puts(symbol.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
SPDLOG_WARN("Could not find tlut at 0x{:X}", tlut);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ void Quadrangle(const Gfx* gfx);
|
||||
void Triangle2(const Gfx* gfx);
|
||||
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);
|
||||
int Palette(uint32_t tlut, int32_t idx, int32_t count);
|
||||
int Light(uint32_t lightsn, int32_t count);
|
||||
int DisplayList(uint32_t dl);
|
||||
};
|
||||
Reference in New Issue
Block a user