From 9b1ebffd2710ff7aa4e12e949732522f8f3ad4ad Mon Sep 17 00:00:00 2001 From: Gliniak <153369+Gliniak@users.noreply.github.com> Date: Sat, 28 Mar 2026 20:11:43 +0100 Subject: [PATCH] [Memory] GetPhysicalAddress - Added case to assume that input address is already physical - Restored break on Indirect Buffer failure (Hopefully it won't break anything) --- src/xenia/gpu/pm4_command_processor_implement.h | 2 +- src/xenia/memory.cc | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xenia/gpu/pm4_command_processor_implement.h b/src/xenia/gpu/pm4_command_processor_implement.h index 4684c22d6..0072ecc7e 100644 --- a/src/xenia/gpu/pm4_command_processor_implement.h +++ b/src/xenia/gpu/pm4_command_processor_implement.h @@ -29,7 +29,7 @@ void COMMAND_PROCESSOR::ExecuteIndirectBuffer(uint32_t ptr, // Return up a level if we encounter a bad packet. XELOGE("**** INDIRECT RINGBUFFER: Failed to execute packet."); assert_always(); - // break; + break; } } while (reader_.read_count()); diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index e3fff3fd3..a67dc56f3 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -527,9 +527,15 @@ uint32_t Memory::HostToGuestVirtualThunk(const void* context, uint32_t Memory::GetPhysicalAddress(uint32_t address) const { const BaseHeap* heap = LookupHeap(address); - if (!heap || heap->heap_type() != HeapType::kGuestPhysical) { + if (!heap) { return UINT32_MAX; } + + // Assumption that we already received physical address, so just return it. + if (heap->heap_type() != HeapType::kGuestPhysical && address < 0x1FFFFFFF) { + return address; + } + return static_cast(heap)->GetPhysicalAddress(address); }