mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
31 lines
No EOL
873 B
C++
31 lines
No EOL
873 B
C++
#ifdef CPU_DYNARMIC
|
|
#include "cpu_dynarmic.hpp"
|
|
#include "arm_defs.hpp"
|
|
|
|
CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel, *this) {
|
|
cp15 = std::make_shared<CP15>();
|
|
|
|
Dynarmic::A32::UserConfig config;
|
|
config.arch_version = Dynarmic::A32::ArchVersion::v6K;
|
|
config.callbacks = &env;
|
|
config.coprocessors[15] = cp15;
|
|
// config.define_unpredictable_behaviour = true;
|
|
config.global_monitor = &exclusiveMonitor;
|
|
config.processor_id = 0;
|
|
|
|
jit = std::make_unique<Dynarmic::A32::Jit>(config);
|
|
}
|
|
|
|
void CPU::reset() {
|
|
setCPSR(CPSR::UserMode);
|
|
setFPSCR(FPSCR::ThreadDefault);
|
|
env.totalTicks = 0;
|
|
|
|
cp15->reset();
|
|
cp15->setTLSBase(VirtualAddrs::TLSBase); // Set cp15 TLS pointer to the main thread's thread-local storage
|
|
jit->Reset();
|
|
jit->ClearCache();
|
|
jit->Regs().fill(0);
|
|
}
|
|
|
|
#endif // CPU_DYNARMIC
|