diff options
| author | 2014-10-25 12:54:44 -0700 | |
|---|---|---|
| committer | 2014-10-27 18:35:21 -0700 | |
| commit | 0783498f570e7d5c00174cd10a3c1ff105d1eae6 (patch) | |
| tree | 10f64506a8f5111f56c4db17c95f6aba19baf0b9 /src/core/hw/gpu.cpp | |
| parent | Merge pull request #150 from lioncash/typo (diff) | |
| download | yuzu-0783498f570e7d5c00174cd10a3c1ff105d1eae6.tar.gz yuzu-0783498f570e7d5c00174cd10a3c1ff105d1eae6.tar.xz yuzu-0783498f570e7d5c00174cd10a3c1ff105d1eae6.zip | |
Use configuration files to enable or disable the new dyncom interpreter.
Diffstat (limited to 'src/core/hw/gpu.cpp')
| -rw-r--r-- | src/core/hw/gpu.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 33a0e0fe7..94768b101 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 6 | 6 | ||
| 7 | #include "core/settings.h" | ||
| 7 | #include "core/core.h" | 8 | #include "core/core.h" |
| 8 | #include "core/mem_map.h" | 9 | #include "core/mem_map.h" |
| 9 | 10 | ||
| @@ -24,6 +25,9 @@ u32 g_cur_line = 0; ///< Current vertical screen line | |||
| 24 | u64 g_last_line_ticks = 0; ///< CPU tick count from last vertical screen line | 25 | u64 g_last_line_ticks = 0; ///< CPU tick count from last vertical screen line |
| 25 | u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame | 26 | u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame |
| 26 | 27 | ||
| 28 | static u32 kFrameCycles = 0; ///< 268MHz / 60 frames per second | ||
| 29 | static u32 kFrameTicks = 0; ///< Approximate number of instructions/frame | ||
| 30 | |||
| 27 | template <typename T> | 31 | template <typename T> |
| 28 | inline void Read(T &var, const u32 raw_addr) { | 32 | inline void Read(T &var, const u32 raw_addr) { |
| 29 | u32 addr = raw_addr - 0x1EF00000; | 33 | u32 addr = raw_addr - 0x1EF00000; |
| @@ -214,6 +218,18 @@ void Update() { | |||
| 214 | 218 | ||
| 215 | /// Initialize hardware | 219 | /// Initialize hardware |
| 216 | void Init() { | 220 | void Init() { |
| 221 | switch (Settings::values.cpu_core) { | ||
| 222 | case Core::CPU_FastInterpreter: | ||
| 223 | kFrameCycles = 268123480 / 2048; | ||
| 224 | break; | ||
| 225 | case Core::CPU_Interpreter: | ||
| 226 | default: | ||
| 227 | kFrameCycles = 268123480 / 60; | ||
| 228 | break; | ||
| 229 | } | ||
| 230 | |||
| 231 | kFrameTicks = kFrameCycles / 3; | ||
| 232 | |||
| 217 | g_cur_line = 0; | 233 | g_cur_line = 0; |
| 218 | g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks(); | 234 | g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks(); |
| 219 | 235 | ||