diff options
author | bunnei <bunneidev@gmail.com> | 2018-03-19 03:35:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-19 03:35:47 +0100 |
commit | 23a0d2d7b77fa619edc7d69d0162bd3071b67b4b (patch) | |
tree | 85f20b5e8bbd0b1b2b6e28eac6224908a0f3b7fe /src/core/arm/dynarmic/arm_dynarmic.cpp | |
parent | Merge pull request #250 from bunnei/buffer-dequeue-wait (diff) | |
parent | Implements citra-emu/citra#3184 (diff) | |
download | yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar.gz yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar.bz2 yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar.lz yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar.xz yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.tar.zst yuzu-23a0d2d7b77fa619edc7d69d0162bd3071b67b4b.zip |
Diffstat (limited to 'src/core/arm/dynarmic/arm_dynarmic.cpp')
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 0902c6df3..7d83f9717 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -122,11 +122,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; @@ -189,13 +200,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(); @@ -228,4 +232,5 @@ void ARM_Dynarmic::ClearInstructionCache() { void ARM_Dynarmic::PageTableChanged() { jit = MakeJit(cb); + current_page_table = Memory::GetCurrentPageTable(); } |