diff options
| author | bunnei <ericbunnie@gmail.com> | 2014-06-14 12:13:16 -0400 |
|---|---|---|
| committer | bunnei <ericbunnie@gmail.com> | 2014-06-14 12:13:16 -0400 |
| commit | 004df767953a949817da89bddcd5d1379240f769 (patch) | |
| tree | b2d54928dcbf3cb4dde0cd5d3277afe7999b7bd9 /src/core/arm/interpreter/arm_interpreter.cpp | |
| parent | c34ba380011921a9d984136381c3a65a1e2389d5 (diff) | |
| parent | b45a38f55794e47b0429a8667441a20433e19e42 (diff) | |
Merge branch 'threading' of https://github.com/bunnei/citra
Conflicts:
src/core/hle/function_wrappers.h
src/core/hle/service/gsp.cpp
Diffstat (limited to 'src/core/arm/interpreter/arm_interpreter.cpp')
| -rw-r--r-- | src/core/arm/interpreter/arm_interpreter.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/arm/interpreter/arm_interpreter.cpp b/src/core/arm/interpreter/arm_interpreter.cpp index 17f787b86..0e893f182 100644 --- a/src/core/arm/interpreter/arm_interpreter.cpp +++ b/src/core/arm/interpreter/arm_interpreter.cpp @@ -98,7 +98,7 @@ u64 ARM_Interpreter::GetTicks() const { * @param num_instructions Number of instructions to executes */ void ARM_Interpreter::ExecuteInstructions(int num_instructions) { - state->NumInstrsToExecute = num_instructions; + state->NumInstrsToExecute = num_instructions - 1; ARMul_Emulate32(state); } @@ -118,6 +118,9 @@ void ARM_Interpreter::SaveContext(ThreadContext& ctx) { ctx.fpscr = state->VFP[1]; ctx.fpexc = state->VFP[2]; + + ctx.reg_15 = state->Reg[15]; + ctx.mode = state->NextInstr; } /** @@ -137,6 +140,11 @@ void ARM_Interpreter::LoadContext(const ThreadContext& ctx) { state->VFP[1] = ctx.fpscr; state->VFP[2] = ctx.fpexc; - state->Reg[15] = ctx.pc; - state->NextInstr = RESUME; + state->Reg[15] = ctx.reg_15; + state->NextInstr = ctx.mode; +} + +/// Prepare core for thread reschedule (if needed to correctly handle state) +void ARM_Interpreter::PrepareReschedule() { + state->NumInstrsToExecute = 0; } |
