diff options
| author | 2017-09-30 14:46:06 -0500 | |
|---|---|---|
| committer | 2017-09-30 14:46:06 -0500 | |
| commit | 5ba48c161053fa8cd05c443cb94d4f66fede4d15 (patch) | |
| tree | 8728152f1726aeb775c2bba2ecc60bc67354e083 /src/core/arm | |
| parent | Services/UDS: Handle the rest of the connection sequence. (#2963) (diff) | |
| parent | Moved down_count to CoreTiming (diff) | |
| download | yuzu-5ba48c161053fa8cd05c443cb94d4f66fede4d15.tar.gz yuzu-5ba48c161053fa8cd05c443cb94d4f66fede4d15.tar.xz yuzu-5ba48c161053fa8cd05c443cb94d4f66fede4d15.zip | |
Merge pull request #2973 from huwpascoe/down_count
Moved down_count to CoreTiming
Diffstat (limited to 'src/core/arm')
| -rw-r--r-- | src/core/arm/arm_interface.h | 9 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 9 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.h | 2 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom.cpp | 8 | ||||
| -rw-r--r-- | src/core/arm/dyncom/arm_dyncom.h | 2 |
5 files changed, 2 insertions, 28 deletions
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 2aa017a54..ba528403c 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -125,12 +125,6 @@ public: | |||
| 125 | virtual void SetCP15Register(CP15Register reg, u32 value) = 0; | 125 | virtual void SetCP15Register(CP15Register reg, u32 value) = 0; |
| 126 | 126 | ||
| 127 | /** | 127 | /** |
| 128 | * Advance the CPU core by the specified number of ticks (e.g. to simulate CPU execution time) | ||
| 129 | * @param ticks Number of ticks to advance the CPU core | ||
| 130 | */ | ||
| 131 | virtual void AddTicks(u64 ticks) = 0; | ||
| 132 | |||
| 133 | /** | ||
| 134 | * Saves the current CPU context | 128 | * Saves the current CPU context |
| 135 | * @param ctx Thread context to save | 129 | * @param ctx Thread context to save |
| 136 | */ | 130 | */ |
| @@ -150,9 +144,6 @@ public: | |||
| 150 | return num_instructions; | 144 | return num_instructions; |
| 151 | } | 145 | } |
| 152 | 146 | ||
| 153 | s64 down_count = 0; ///< A decreasing counter of remaining cycles before the next event, | ||
| 154 | /// decreased by the cpu run loop | ||
| 155 | |||
| 156 | protected: | 147 | protected: |
| 157 | /** | 148 | /** |
| 158 | * Executes the given number of instructions | 149 | * Executes the given number of instructions |
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 42ae93ae8..2cb56d12f 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -124,13 +124,6 @@ void ARM_Dynarmic::SetCP15Register(CP15Register reg, u32 value) { | |||
| 124 | interpreter_state->CP15[reg] = value; | 124 | interpreter_state->CP15[reg] = value; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | void ARM_Dynarmic::AddTicks(u64 ticks) { | ||
| 128 | down_count -= ticks; | ||
| 129 | if (down_count < 0) { | ||
| 130 | CoreTiming::Advance(); | ||
| 131 | } | ||
| 132 | } | ||
| 133 | |||
| 134 | MICROPROFILE_DEFINE(ARM_Jit, "ARM JIT", "ARM JIT", MP_RGB(255, 64, 64)); | 127 | MICROPROFILE_DEFINE(ARM_Jit, "ARM JIT", "ARM JIT", MP_RGB(255, 64, 64)); |
| 135 | 128 | ||
| 136 | void ARM_Dynarmic::ExecuteInstructions(int num_instructions) { | 129 | void ARM_Dynarmic::ExecuteInstructions(int num_instructions) { |
| @@ -139,7 +132,7 @@ void ARM_Dynarmic::ExecuteInstructions(int num_instructions) { | |||
| 139 | 132 | ||
| 140 | std::size_t ticks_executed = jit->Run(static_cast<unsigned>(num_instructions)); | 133 | std::size_t ticks_executed = jit->Run(static_cast<unsigned>(num_instructions)); |
| 141 | 134 | ||
| 142 | AddTicks(ticks_executed); | 135 | CoreTiming::AddTicks(ticks_executed); |
| 143 | } | 136 | } |
| 144 | 137 | ||
| 145 | void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { | 138 | void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { |
diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h index 96148a1a5..0b00158a5 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.h +++ b/src/core/arm/dynarmic/arm_dynarmic.h | |||
| @@ -32,8 +32,6 @@ public: | |||
| 32 | u32 GetCP15Register(CP15Register reg) override; | 32 | u32 GetCP15Register(CP15Register reg) override; |
| 33 | void SetCP15Register(CP15Register reg, u32 value) override; | 33 | void SetCP15Register(CP15Register reg, u32 value) override; |
| 34 | 34 | ||
| 35 | void AddTicks(u64 ticks) override; | ||
| 36 | |||
| 37 | void SaveContext(ThreadContext& ctx) override; | 35 | void SaveContext(ThreadContext& ctx) override; |
| 38 | void LoadContext(const ThreadContext& ctx) override; | 36 | void LoadContext(const ThreadContext& ctx) override; |
| 39 | 37 | ||
diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index da955c9b9..4d72aef77 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp | |||
| @@ -77,12 +77,6 @@ void ARM_DynCom::SetCP15Register(CP15Register reg, u32 value) { | |||
| 77 | state->CP15[reg] = value; | 77 | state->CP15[reg] = value; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void ARM_DynCom::AddTicks(u64 ticks) { | ||
| 81 | down_count -= ticks; | ||
| 82 | if (down_count < 0) | ||
| 83 | CoreTiming::Advance(); | ||
| 84 | } | ||
| 85 | |||
| 86 | void ARM_DynCom::ExecuteInstructions(int num_instructions) { | 80 | void ARM_DynCom::ExecuteInstructions(int num_instructions) { |
| 87 | state->NumInstrsToExecute = num_instructions; | 81 | state->NumInstrsToExecute = num_instructions; |
| 88 | 82 | ||
| @@ -90,7 +84,7 @@ void ARM_DynCom::ExecuteInstructions(int num_instructions) { | |||
| 90 | // executing one instruction at a time. Otherwise, if a block is being executed, more | 84 | // executing one instruction at a time. Otherwise, if a block is being executed, more |
| 91 | // instructions may actually be executed than specified. | 85 | // instructions may actually be executed than specified. |
| 92 | unsigned ticks_executed = InterpreterMainLoop(state.get()); | 86 | unsigned ticks_executed = InterpreterMainLoop(state.get()); |
| 93 | AddTicks(ticks_executed); | 87 | CoreTiming::AddTicks(ticks_executed); |
| 94 | } | 88 | } |
| 95 | 89 | ||
| 96 | void ARM_DynCom::SaveContext(ThreadContext& ctx) { | 90 | void ARM_DynCom::SaveContext(ThreadContext& ctx) { |
diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h index 0ae535671..fc1ffed6a 100644 --- a/src/core/arm/dyncom/arm_dyncom.h +++ b/src/core/arm/dyncom/arm_dyncom.h | |||
| @@ -31,8 +31,6 @@ public: | |||
| 31 | u32 GetCP15Register(CP15Register reg) override; | 31 | u32 GetCP15Register(CP15Register reg) override; |
| 32 | void SetCP15Register(CP15Register reg, u32 value) override; | 32 | void SetCP15Register(CP15Register reg, u32 value) override; |
| 33 | 33 | ||
| 34 | void AddTicks(u64 ticks) override; | ||
| 35 | |||
| 36 | void SaveContext(ThreadContext& ctx) override; | 34 | void SaveContext(ThreadContext& ctx) override; |
| 37 | void LoadContext(const ThreadContext& ctx) override; | 35 | void LoadContext(const ThreadContext& ctx) override; |
| 38 | 36 | ||