Make CPU respect chosen option (JIT, etc)

This commit is contained in:
irisz64
2025-07-03 10:42:48 +02:00
parent 075fadde87
commit 92eff7f198
9 changed files with 57 additions and 40 deletions

View File

@@ -3,7 +3,13 @@
#include <Scheduler.hpp>
namespace n64 {
Core::Core() : cpu(std::make_unique<Interpreter>(parallel)) {}
Core::Core(CPUType cpuType) {
switch (cpuType) {
case Interpreted: cpu = std::make_unique<Interpreter>(parallel); break;
case DynamicRecompiler: cpu = std::make_unique<JIT>(parallel); break;
default: Util::panic("Unimplemented CPU type\n");
}
}
void Core::Stop() {
pause = true;

View File

@@ -6,7 +6,12 @@
namespace n64 {
struct Core {
explicit Core();
enum CPUType {
Interpreted,
DynamicRecompiler,
CachedInterpreter
};
explicit Core(CPUType);
void Stop();
void LoadROM(const std::string &);
[[nodiscard]] bool LoadTAS(const fs::path &) const;