diff options
author | merry <git@mary.rs> | 2022-04-03 19:20:11 +0200 |
---|---|---|
committer | merry <git@mary.rs> | 2022-04-03 19:20:11 +0200 |
commit | a5d040df3d98006827083d18906e36b56dbd65bb (patch) | |
tree | 3ae9d2445c334c44054558b7c3a6e61d3690f352 /src/core/arm/dynarmic/arm_dynarmic_32.cpp | |
parent | dynarmic: Better interrupts (diff) | |
download | yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar.gz yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar.bz2 yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar.lz yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar.xz yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.tar.zst yuzu-a5d040df3d98006827083d18906e36b56dbd65bb.zip |
Diffstat (limited to 'src/core/arm/dynarmic/arm_dynarmic_32.cpp')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 3437eed0e..224a30170 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp @@ -25,6 +25,9 @@ namespace Core { using namespace Common::Literals; +constexpr Dynarmic::HaltReason break_loop = Dynarmic::HaltReason::UserDefined2; +constexpr Dynarmic::HaltReason svc_call = Dynarmic::HaltReason::UserDefined3; + class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks { public: explicit DynarmicCallbacks32(ARM_Dynarmic_32& parent_) @@ -82,9 +85,8 @@ public: } void CallSVC(u32 swi) override { - parent.svc_called = true; parent.svc_swi = swi; - parent.jit->HaltExecution(); + parent.jit->HaltExecution(svc_call); } void AddTicks(u64 ticks) override { @@ -219,12 +221,10 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* void ARM_Dynarmic_32::Run() { while (true) { const auto hr = jit->Run(); - if (!svc_called) { - break; + if (Has(hr, svc_call)) { + Kernel::Svc::Call(system, svc_swi); } - svc_called = false; - Kernel::Svc::Call(system, svc_swi); - if (shutdown || Has(hr, Dynarmic::HaltReason::UserDefined2)) { + if (Has(hr, break_loop)) { break; } } @@ -310,12 +310,11 @@ void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) { } void ARM_Dynarmic_32::PrepareReschedule() { - jit->HaltExecution(); - shutdown = true; + jit->HaltExecution(break_loop); } void ARM_Dynarmic_32::SignalInterrupt() { - jit->HaltExecution(Dynarmic::HaltReason::UserDefined2); + jit->HaltExecution(break_loop); } void ARM_Dynarmic_32::ClearInstructionCache() { |