mirror of
https://github.com/izzy2lost/Torch.git
synced 2026-07-06 00:18:35 -07:00
Support Vtx Overlaps
This commit is contained in:
+12
-6
@@ -1405,12 +1405,7 @@ std::optional<std::uint32_t> Companion::GetFileOffsetFromSegmentedAddr(const uin
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::optional<std::tuple<std::string, YAML::Node>> Companion::GetNodeByAddr(uint32_t addr){
|
||||
if(!this->gAddrMap.contains(this->gCurrentFile)){
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// HACK: Adjust address to rom address if virtual address
|
||||
uint32_t Companion::PatchVirtualAddr(uint32_t addr) {
|
||||
if (addr & 0x80000000) {
|
||||
if (gVirtualAddrMap.contains(gCurrentFile)) {
|
||||
addr -= std::get<0>(gVirtualAddrMap[gCurrentFile]);
|
||||
@@ -1418,6 +1413,17 @@ std::optional<std::tuple<std::string, YAML::Node>> Companion::GetNodeByAddr(uint
|
||||
}
|
||||
}
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
std::optional<std::tuple<std::string, YAML::Node>> Companion::GetNodeByAddr(uint32_t addr){
|
||||
if(!this->gAddrMap.contains(this->gCurrentFile)){
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// HACK: Adjust address to rom address if virtual address
|
||||
addr = PatchVirtualAddr(addr);
|
||||
|
||||
if(!this->gAddrMap[this->gCurrentFile].contains(addr)){
|
||||
for (auto &file : this->gCurrentExternalFiles) {
|
||||
if (!this->gAddrMap.contains(file)) {
|
||||
|
||||
Reference in New Issue
Block a user