Figure out why the program counter never stops increasing after a certain point
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user