aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/hw
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2014-10-27 22:51:10 -0400
committerGravatar bunnei <bunneidev@gmail.com>2014-10-27 22:51:10 -0400
commit48f80bb79efc3b27f8ff965c43aafeffff99e0e1 (patch)
tree3d08f714f3392ba6aadb0641bac420d8f24c29dc /src/core/hw
parenta110b06fb6cca7c60af1707173686d72430c71fb (diff)
parent09e19f9f1ee2e965a581e70b30cbc357f4b5ad21 (diff)
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')
-rw-r--r--src/core/hw/gpu.cpp7
-rw-r--r--src/core/hw/gpu.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 33a0e0fe..76dbe3fd 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -4,6 +4,7 @@
#include "common/common_types.h"
+#include "core/settings.h"
#include "core/core.h"
#include "core/mem_map.h"
@@ -24,6 +25,9 @@ u32 g_cur_line = 0; ///< Current vertical screen line
u64 g_last_line_ticks = 0; ///< CPU tick count from last vertical screen line
u64 g_last_frame_ticks = 0; ///< CPU tick count from last frame
+static u32 kFrameCycles = 0; ///< 268MHz / 60 frames per second
+static u32 kFrameTicks = 0; ///< Approximate number of instructions/frame
+
template <typename T>
inline void Read(T &var, const u32 raw_addr) {
u32 addr = raw_addr - 0x1EF00000;
@@ -214,6 +218,9 @@ void Update() {
/// Initialize hardware
void Init() {
+ kFrameCycles = 268123480 / Settings::values.gpu_refresh_rate;
+ kFrameTicks = kFrameCycles / 3;
+
g_cur_line = 0;
g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks();
diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h
index 92097d18..3fa7b9cc 100644
--- a/src/core/hw/gpu.h
+++ b/src/core/hw/gpu.h
@@ -11,9 +11,6 @@
namespace GPU {
-static const u32 kFrameCycles = 268123480 / 60; ///< 268MHz / 60 frames per second
-static const u32 kFrameTicks = kFrameCycles / 3; ///< Approximate number of instructions/frame
-
// Returns index corresponding to the Regs member labeled by field_name
// TODO: Due to Visual studio bug 209229, offsetof does not return constant expressions
// when used with array elements (e.g. GPU_REG_INDEX(memory_fill_config[0])).