summaryrefslogtreecommitdiffstats
path: root/src/core/memory.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/memory.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index 68a6b1ac2..17fa10b49 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -22,12 +22,20 @@ namespace Memory {
static std::array<u8, Memory::VRAM_SIZE> vram;
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() {
return &current_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) {
LOG_DEBUG(HW_Memory, "Mapping %p onto %08X-%08X", memory, base * PAGE_SIZE,
(base + size) * PAGE_SIZE);