prep cache impl

This commit is contained in:
2026-04-23 10:39:49 +02:00
parent 811b4d809c
commit 68e613057e
4 changed files with 133 additions and 110 deletions
+4
View File
@@ -0,0 +1,4 @@
CompileFlags:
CompilationDatabase: build/
Completion:
HeaderInsertion: Never
+1 -3
View File
@@ -62,9 +62,7 @@ void Core::LoadROM(const std::string &rom_) {
romLoaded = true;
}
u32 Core::StepCPU() {
return cpu->Step() + regs.PopStalledCycles();
}
u32 Core::StepCPU() { return cpu->Step() + regs.PopStalledCycles(); }
void Core::StepRSP(const u32 cpuCycles) {
MMIO &mmio = mem->mmio;
+21
View File
@@ -4,6 +4,27 @@
#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;