mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-10-01 14:47:02 -05:00
Merge pull request #14123 from JosJuice/fix-logical-page-mappings
Memmap: Fix populating m_logical_page_mappings
This commit is contained in:
@@ -292,12 +292,13 @@ void MemoryManager::UpdateDBATMappings(const PowerPC::BatTable& dbat_table)
|
|||||||
if (intersection_start < intersection_end)
|
if (intersection_start < intersection_end)
|
||||||
{
|
{
|
||||||
// Found an overlapping region; map it.
|
// Found an overlapping region; map it.
|
||||||
|
u32 mapped_logical_address = logical_address + intersection_start - translated_address;
|
||||||
|
u32 mapped_size = intersection_end - intersection_start;
|
||||||
|
|
||||||
if (m_is_fastmem_arena_initialized)
|
if (m_is_fastmem_arena_initialized)
|
||||||
{
|
{
|
||||||
u32 position = physical_region.shm_position + intersection_start - mapping_address;
|
u32 position = physical_region.shm_position + intersection_start - mapping_address;
|
||||||
u8* base = m_logical_base + logical_address + intersection_start - translated_address;
|
u8* base = m_logical_base + mapped_logical_address;
|
||||||
u32 mapped_size = intersection_end - intersection_start;
|
|
||||||
|
|
||||||
void* mapped_pointer = m_arena.MapInMemoryRegion(position, mapped_size, base, true);
|
void* mapped_pointer = m_arena.MapInMemoryRegion(position, mapped_size, base, true);
|
||||||
if (!mapped_pointer)
|
if (!mapped_pointer)
|
||||||
@@ -311,8 +312,10 @@ void MemoryManager::UpdateDBATMappings(const PowerPC::BatTable& dbat_table)
|
|||||||
LogicalMemoryView{mapped_pointer, mapped_size});
|
LogicalMemoryView{mapped_pointer, mapped_size});
|
||||||
}
|
}
|
||||||
|
|
||||||
m_logical_page_mappings[i] =
|
u32 bat_index = mapped_logical_address / PowerPC::BAT_PAGE_SIZE;
|
||||||
*physical_region.out_pointer + intersection_start - mapping_address;
|
u8* target_address = *physical_region.out_pointer + intersection_start - mapping_address;
|
||||||
|
for (u32 j = 0; j < mapped_size / PowerPC::BAT_PAGE_SIZE; ++j)
|
||||||
|
m_logical_page_mappings[bat_index + j] = target_address + j * PowerPC::BAT_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user