diff options
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 15 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 15 |
2 files changed, 22 insertions, 8 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index b8d2ce224..99fab6384 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -125,7 +125,9 @@ public: | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | void AddTicks(u64 ticks) override { | 127 | void AddTicks(u64 ticks) override { |
| 128 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 128 | if (parent.uses_wall_clock) { |
| 129 | return; | ||
| 130 | } | ||
| 129 | 131 | ||
| 130 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a | 132 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a |
| 131 | // rough approximation of the amount of executed ticks in the system, it may be thrown off | 133 | // rough approximation of the amount of executed ticks in the system, it may be thrown off |
| @@ -142,7 +144,12 @@ public: | |||
| 142 | } | 144 | } |
| 143 | 145 | ||
| 144 | u64 GetTicksRemaining() override { | 146 | u64 GetTicksRemaining() override { |
| 145 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 147 | if (parent.uses_wall_clock) { |
| 148 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { | ||
| 149 | return minimum_run_cycles; | ||
| 150 | } | ||
| 151 | return 0U; | ||
| 152 | } | ||
| 146 | 153 | ||
| 147 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); | 154 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); |
| 148 | } | 155 | } |
| @@ -172,7 +179,7 @@ public: | |||
| 172 | Core::Memory::Memory& memory; | 179 | Core::Memory::Memory& memory; |
| 173 | std::size_t num_interpreted_instructions{}; | 180 | std::size_t num_interpreted_instructions{}; |
| 174 | bool debugger_enabled{}; | 181 | bool debugger_enabled{}; |
| 175 | static constexpr u64 minimum_run_cycles = 1000U; | 182 | static constexpr u64 minimum_run_cycles = 10000U; |
| 176 | }; | 183 | }; |
| 177 | 184 | ||
| 178 | std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* page_table) const { | 185 | std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* page_table) const { |
| @@ -200,7 +207,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 200 | 207 | ||
| 201 | // Timing | 208 | // Timing |
| 202 | config.wall_clock_cntpct = uses_wall_clock; | 209 | config.wall_clock_cntpct = uses_wall_clock; |
| 203 | config.enable_cycle_counting = !uses_wall_clock; | 210 | config.enable_cycle_counting = true; |
| 204 | 211 | ||
| 205 | // Code cache size | 212 | // Code cache size |
| 206 | config.code_cache_size = 512_MiB; | 213 | config.code_cache_size = 512_MiB; |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 1a4d37cbc..a91b587ce 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -166,7 +166,9 @@ public: | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | void AddTicks(u64 ticks) override { | 168 | void AddTicks(u64 ticks) override { |
| 169 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 169 | if (parent.uses_wall_clock) { |
| 170 | return; | ||
| 171 | } | ||
| 170 | 172 | ||
| 171 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a | 173 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a |
| 172 | // rough approximation of the amount of executed ticks in the system, it may be thrown off | 174 | // rough approximation of the amount of executed ticks in the system, it may be thrown off |
| @@ -181,7 +183,12 @@ public: | |||
| 181 | } | 183 | } |
| 182 | 184 | ||
| 183 | u64 GetTicksRemaining() override { | 185 | u64 GetTicksRemaining() override { |
| 184 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 186 | if (parent.uses_wall_clock) { |
| 187 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { | ||
| 188 | return minimum_run_cycles; | ||
| 189 | } | ||
| 190 | return 0U; | ||
| 191 | } | ||
| 185 | 192 | ||
| 186 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); | 193 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); |
| 187 | } | 194 | } |
| @@ -216,7 +223,7 @@ public: | |||
| 216 | u64 tpidrro_el0 = 0; | 223 | u64 tpidrro_el0 = 0; |
| 217 | u64 tpidr_el0 = 0; | 224 | u64 tpidr_el0 = 0; |
| 218 | bool debugger_enabled{}; | 225 | bool debugger_enabled{}; |
| 219 | static constexpr u64 minimum_run_cycles = 1000U; | 226 | static constexpr u64 minimum_run_cycles = 10000U; |
| 220 | }; | 227 | }; |
| 221 | 228 | ||
| 222 | std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* page_table, | 229 | std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* page_table, |
| @@ -260,7 +267,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 260 | 267 | ||
| 261 | // Timing | 268 | // Timing |
| 262 | config.wall_clock_cntpct = uses_wall_clock; | 269 | config.wall_clock_cntpct = uses_wall_clock; |
| 263 | config.enable_cycle_counting = !uses_wall_clock; | 270 | config.enable_cycle_counting = true; |
| 264 | 271 | ||
| 265 | // Code cache size | 272 | // Code cache size |
| 266 | config.code_cache_size = 512_MiB; | 273 | config.code_cache_size = 512_MiB; |