mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[PPC/Posix] Apply 0x1000 shift in PPCContext::TranslateVirtual
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include "xenia/base/memory.h"
|
||||
#include "xenia/base/mutex.h"
|
||||
#include "xenia/base/vec128.h"
|
||||
#include "xenia/guest_pointers.h"
|
||||
@@ -439,6 +440,12 @@ typedef struct alignas(64) PPCContext_s {
|
||||
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this))) {
|
||||
host_address += 0x1000;
|
||||
}
|
||||
#else
|
||||
// Match vE0000000 PhysicalHeap shift (see Memory::TranslateVirtual).
|
||||
if (xe::memory::allocation_granularity() > 0x1000 &&
|
||||
guest_address >= 0xE0000000u) {
|
||||
host_address += 0x1000;
|
||||
}
|
||||
#endif
|
||||
return reinterpret_cast<T>(host_address);
|
||||
}
|
||||
@@ -467,6 +474,11 @@ typedef struct alignas(64) PPCContext_s {
|
||||
if (guest_tmp >= static_cast<uint32_t>(reinterpret_cast<uintptr_t>(this))) {
|
||||
guest_tmp -= 0x1000;
|
||||
}
|
||||
#else
|
||||
if (xe::memory::allocation_granularity() > 0x1000 &&
|
||||
guest_tmp >= 0xE0000000u) {
|
||||
guest_tmp -= 0x1000;
|
||||
}
|
||||
#endif
|
||||
return guest_tmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user