Start adding memory stuff

This commit is contained in:
wheremyfoodat 2022-09-15 13:35:15 +03:00
parent 2057e0c447
commit 905c7ed770
8 changed files with 77 additions and 10 deletions

18
include/memory.hpp Normal file
View file

@ -0,0 +1,18 @@
#pragma once
#include <vector>
#include "helpers.hpp"
class Memory {
u8* fcram;
// Our dynarmic core uses page tables for reads and writes with 4096 byte pages
std::vector<uintptr_t> readTable, writeTable;
static constexpr u32 pageShift = 12;
static constexpr u32 pageSize = 1 << pageShift;
static constexpr u32 pageMask = pageSize - 1;
public:
Memory();
void* getReadPointer(u32 address);
void* getWritePointer(u32 address);
};