Figure out why the program counter never stops increasing after a certain point

This commit is contained in:
2026-05-25 15:58:54 +02:00
parent 76475271d1
commit 3b7bdceabd
9 changed files with 218 additions and 177 deletions
+9 -3
View File
@@ -16,6 +16,8 @@ Core::Core() :
cpuType = Interpreted;
} else if (selectedCpu == "jit") {
cpuType = DynamicRecompiler;
} else if (selectedCpu == "cached_interpreter") {
cpuType = CachedInterpreter;
} else {
panic("Unimplemented CPU type");
}
@@ -63,7 +65,13 @@ void Core::LoadROM(const std::string &rom_) {
}
u32 Core::StepCPU() {
if (cpuType == Interpreted)
if (cpuType == Interpreted) {
auto taken = interpreter.Step() + regs.PopStalledCycles();
StepRSP(taken);
return taken;
}
if (cpuType == CachedInterpreter)
return interpreter.ExecuteCached() + regs.PopStalledCycles();
#ifdef KAIZEN_JIT_ENABLED
@@ -115,8 +123,6 @@ void Core::Run(const float volumeL, const float volumeR) {
const u32 taken = StepCPU();
cycles += taken;
StepRSP(taken);
frameCycles += taken;
Scheduler::GetInstance().Tick(taken);
}