summaryrefslogtreecommitdiff
path: root/src/core/hw/gpu.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-10-27 22:51:10 -0400
committerGravatar bunnei2014-10-27 22:51:10 -0400
commit48f80bb79efc3b27f8ff965c43aafeffff99e0e1 (patch)
tree3d08f714f3392ba6aadb0641bac420d8f24c29dc /src/core/hw/gpu.cpp
parentMerge pull request #141 from archshift/crash-hunt (diff)
parentAdded `gpu_refresh_rate` config setting for the new interpreter speed hack. (diff)
downloadyuzu-48f80bb79efc3b27f8ff965c43aafeffff99e0e1.tar.gz
yuzu-48f80bb79efc3b27f8ff965c43aafeffff99e0e1.tar.xz
yuzu-48f80bb79efc3b27f8ff965c43aafeffff99e0e1.zip
Merge pull request #151 from archshift/dyncom-enabled
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.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 33a0e0fe7..76dbe3fdc 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
24u64 g_last_line_ticks = 0; ///< CPU tick count from last vertical screen line 25u64 g_last_line_ticks = 0; ///< CPU tick count from last vertical screen line
25u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame 26u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame
26 27
28static u32 kFrameCycles = 0; ///< 268MHz / 60 frames per second
29static u32 kFrameTicks = 0; ///< Approximate number of instructions/frame
30
27template <typename T> 31template <typename T>
28inline void Read(T &var, const u32 raw_addr) { 32inline void Read(T &var, const u32 raw_addr) {
29 u32 addr = raw_addr - 0x1EF00000; 33 u32 addr = raw_addr - 0x1EF00000;
@@ -214,6 +218,9 @@ void Update() {
214 218
215/// Initialize hardware 219/// Initialize hardware
216void Init() { 220void Init() {
221 kFrameCycles = 268123480 / Settings::values.gpu_refresh_rate;
222 kFrameTicks = kFrameCycles / 3;
223
217 g_cur_line = 0; 224 g_cur_line = 0;
218 g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks(); 225 g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks();
219 226