|
|
@ -125,14 +125,14 @@ struct Memory::Impl { |
|
|
[[nodiscard]] u8* GetPointerFromRasterizerCachedMemory(u64 vaddr) const { |
|
|
[[nodiscard]] u8* GetPointerFromRasterizerCachedMemory(u64 vaddr) const { |
|
|
Common::PhysicalAddress const paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].GetPhysOffset(YUZU_PAGEBITS); |
|
|
Common::PhysicalAddress const paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].GetPhysOffset(YUZU_PAGEBITS); |
|
|
if (paddr) |
|
|
if (paddr) |
|
|
return system.DeviceMemory().GetPointer<u8>((paddr << YUZU_PAGEBITS) + vaddr); |
|
|
|
|
|
|
|
|
return system.DeviceMemory().GetPointer<u8>(paddr + vaddr); |
|
|
return {}; |
|
|
return {}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[[nodiscard]] u8* GetPointerFromDebugMemory(u64 vaddr) const { |
|
|
[[nodiscard]] u8* GetPointerFromDebugMemory(u64 vaddr) const { |
|
|
const Common::PhysicalAddress paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].GetPhysOffset(YUZU_PAGEBITS); |
|
|
const Common::PhysicalAddress paddr = current_page_table->entries[vaddr >> YUZU_PAGEBITS].GetPhysOffset(YUZU_PAGEBITS); |
|
|
if (paddr != 0) |
|
|
if (paddr != 0) |
|
|
return system.DeviceMemory().GetPointer<u8>((paddr << YUZU_PAGEBITS) + vaddr); |
|
|
|
|
|
|
|
|
return system.DeviceMemory().GetPointer<u8>(paddr + vaddr); |
|
|
return {}; |
|
|
return {}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -555,6 +555,8 @@ struct Memory::Impl { |
|
|
entry.addr = static_cast<u32>(GetInteger(target) >> YUZU_PAGEBITS) - static_cast<u32>(base); |
|
|
entry.addr = static_cast<u32>(GetInteger(target) >> YUZU_PAGEBITS) - static_cast<u32>(base); |
|
|
entry.block = static_cast<u32>(orig_base); |
|
|
entry.block = static_cast<u32>(orig_base); |
|
|
|
|
|
|
|
|
|
|
|
ASSERT_MSG(entry.GetPhysOffset(YUZU_PAGEBITS) == GetInteger(target) - (base << YUZU_PAGEBITS), "assert failed; {:#x} == {:#x}", entry.GetPhysOffset(YUZU_PAGEBITS), GetInteger(target) - (base << YUZU_PAGEBITS)); |
|
|
|
|
|
|
|
|
ASSERT_MSG(page_table.entries[base].ptr.Pointer(), |
|
|
ASSERT_MSG(page_table.entries[base].ptr.Pointer(), |
|
|
"memory mapping base yield a nullptr within the table"); |
|
|
"memory mapping base yield a nullptr within the table"); |
|
|
|
|
|
|
|
|
|