Support Vtx Overlaps

This commit is contained in:
inspectredc
2025-07-04 17:41:27 -06:00
committed by Lywx
parent 5e334dc8c7
commit 59773d06d9
4 changed files with 20 additions and 11 deletions
+12 -6
View File
@@ -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)) {