prep cache impl
This commit is contained in:
@@ -4,9 +4,30 @@
|
||||
#include <Disassembler.hpp>
|
||||
|
||||
namespace n64 {
|
||||
struct alignas(32) InstructionCache {
|
||||
bool valid;
|
||||
u32 data[8];
|
||||
u32 ptag;
|
||||
|
||||
private:
|
||||
int GetLineIndex(u64 vaddr) { return (vaddr >> 5) & 0x1FF; }
|
||||
u32 GetLineStart(u64 paddr) { return paddr & ~0x1F; }
|
||||
};
|
||||
|
||||
struct alignas(32) DataCache {
|
||||
bool valid, dirty;
|
||||
u8 data[16];
|
||||
u32 ptag;
|
||||
int index;
|
||||
|
||||
private:
|
||||
int GetLineIndex(u64 vaddr) { return (vaddr >> 4) & 0x1FF; }
|
||||
u32 GetLineStart(u64 paddr) { return paddr & ~0xF; }
|
||||
};
|
||||
|
||||
struct BaseCPU {
|
||||
virtual ~BaseCPU() = default;
|
||||
virtual u32 Step() = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual ~BaseCPU() = default;
|
||||
virtual u32 Step() = 0;
|
||||
virtual void Reset() = 0;
|
||||
};
|
||||
} // namespace n64
|
||||
|
||||
Reference in New Issue
Block a user