|
|
@ -22,12 +22,20 @@ namespace Memory { |
|
|
static std::array<u8, Memory::VRAM_SIZE> vram; |
|
|
static std::array<u8, Memory::VRAM_SIZE> vram; |
|
|
static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; |
|
|
static std::array<u8, Memory::N3DS_EXTRA_RAM_SIZE> n3ds_extra_ram; |
|
|
|
|
|
|
|
|
PageTable* current_page_table = nullptr; |
|
|
|
|
|
|
|
|
static PageTable* current_page_table = nullptr; |
|
|
|
|
|
|
|
|
std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { |
|
|
std::array<u8*, PAGE_TABLE_NUM_ENTRIES>* GetCurrentPageTablePointers() { |
|
|
return ¤t_page_table->pointers; |
|
|
return ¤t_page_table->pointers; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void SetCurrentPageTable(PageTable* page_table) { |
|
|
|
|
|
current_page_table = page_table; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PageTable* GetCurrentPageTable() { |
|
|
|
|
|
return current_page_table; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { |
|
|
static void MapPages(PageTable& page_table, u32 base, u32 size, u8* memory, PageType type) { |
|
|
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE, |
|
|
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE, |
|
|
(base + size) * PAGE_SIZE); |
|
|
(base + size) * PAGE_SIZE); |
|
|
|