diff options
author | N00byKing <N00byKing@users.noreply.github.com> | 2018-02-14 18:47:48 +0100 |
---|---|---|
committer | N00byKing <N00byKing@hotmail.de> | 2018-02-25 11:44:21 +0100 |
commit | bc88cae0c730ece6d027778267eb0fa256479bda (patch) | |
tree | eaf8581141f7240b6cf23eda17834558b6fe1c40 /src/core/arm/dynarmic | |
parent | Merge pull request #190 from bunnei/fix-qt-waittree (diff) | |
download | yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar.gz yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar.bz2 yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar.lz yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar.xz yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.tar.zst yuzu-bc88cae0c730ece6d027778267eb0fa256479bda.zip |
Diffstat (limited to 'src/core/arm/dynarmic')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 19 | ||||
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.h | 5 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 283d20831..a64ce9551 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -101,11 +101,22 @@ std::unique_ptr<Dynarmic::A64::Jit> MakeJit(const std::unique_ptr<ARM_Dynarmic_C return std::make_unique<Dynarmic::A64::Jit>(config); } +void ARM_Dynarmic::Run() { + ASSERT(Memory::GetCurrentPageTable() == current_page_table); + + jit->Run(); +} + +void ARM_Dynarmic::Step() { + cb->InterpreterFallback(jit->GetPC(), 1); +} + ARM_Dynarmic::ARM_Dynarmic() : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), jit(MakeJit(cb)) { ARM_Interface::ThreadContext ctx; inner_unicorn.SaveContext(ctx); LoadContext(ctx); + PageTableChanged(); } ARM_Dynarmic::~ARM_Dynarmic() = default; @@ -164,13 +175,6 @@ void ARM_Dynarmic::SetTlsAddress(u64 address) { cb->tpidrro_el0 = address; } -void ARM_Dynarmic::ExecuteInstructions(int num_instructions) { - cb->ticks_remaining = num_instructions; - jit->Run(); - CoreTiming::AddTicks(num_instructions - cb->num_interpreted_instructions); - cb->num_interpreted_instructions = 0; -} - void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { ctx.cpu_registers = jit->GetRegisters(); ctx.sp = jit->GetSP(); @@ -203,4 +207,5 @@ void ARM_Dynarmic::ClearInstructionCache() { void ARM_Dynarmic::PageTableChanged() { jit = MakeJit(cb); + current_page_table = Memory::GetCurrentPageTable(); } diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h index 1d9dcf5ff..a436ddd0f 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.h +++ b/src/core/arm/dynarmic/arm_dynarmic.h @@ -29,6 +29,8 @@ public: u32 GetVFPReg(int index) const override; void SetVFPReg(int index, u32 value) override; u32 GetCPSR() const override; + void Run() override; + void Step() override; void SetCPSR(u32 cpsr) override; VAddr GetTlsAddress() const override; void SetTlsAddress(VAddr address) override; @@ -37,7 +39,6 @@ public: void LoadContext(const ThreadContext& ctx) override; void PrepareReschedule() override; - void ExecuteInstructions(int num_instructions) override; void ClearInstructionCache() override; void PageTableChanged() override; @@ -47,4 +48,6 @@ private: std::unique_ptr<ARM_Dynarmic_Callbacks> cb; std::unique_ptr<Dynarmic::A64::Jit> jit; ARM_Unicorn inner_unicorn; + + Memory::PageTable* current_page_table = nullptr; }; |