ARM: pass MemorySystem separately in the constructor and make System optional

So that unit test can test CPU without constructing the entire system. Also remove hacks in the System class
This commit is contained in:
Weiyi Wang 2019-02-01 14:50:25 -05:00
parent 9573ee46bd
commit 64f6e5e597
14 changed files with 80 additions and 65 deletions

View file

@ -179,13 +179,13 @@ System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) {
if (Settings::values.use_cpu_jit) {
#ifdef ARCHITECTURE_x86_64
cpu_core = std::make_unique<ARM_Dynarmic>(*this, USER32MODE);
cpu_core = std::make_unique<ARM_Dynarmic>(this, *memory, USER32MODE);
#else
cpu_core = std::make_unique<ARM_DynCom>(*this, USER32MODE);
cpu_core = std::make_unique<ARM_DynCom>(this, *memory, USER32MODE);
LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available");
#endif
} else {
cpu_core = std::make_unique<ARM_DynCom>(*this, USER32MODE);
cpu_core = std::make_unique<ARM_DynCom>(this, *memory, USER32MODE);
}
kernel->GetThreadManager().SetCPU(*cpu_core);