From 0783498f570e7d5c00174cd10a3c1ff105d1eae6 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 25 Oct 2014 12:54:44 -0700 Subject: Use configuration files to enable or disable the new dyncom interpreter. --- src/core/hw/gpu.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/hw/gpu.cpp') 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 @@ #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 inline void Read(T &var, const u32 raw_addr) { u32 addr = raw_addr - 0x1EF00000; @@ -214,6 +218,18 @@ void Update() { /// Initialize hardware void Init() { + switch (Settings::values.cpu_core) { + case Core::CPU_FastInterpreter: + kFrameCycles = 268123480 / 2048; + break; + case Core::CPU_Interpreter: + default: + kFrameCycles = 268123480 / 60; + break; + } + + kFrameTicks = kFrameCycles / 3; + g_cur_line = 0; g_last_frame_ticks = g_last_line_ticks = Core::g_app_core->GetTicks(); -- cgit v1.2.3 From 09e19f9f1ee2e965a581e70b30cbc357f4b5ad21 Mon Sep 17 00:00:00 2001 From: archshift Date: Mon, 27 Oct 2014 18:56:08 -0700 Subject: Added `gpu_refresh_rate` config setting for the new interpreter speed hack. --- src/core/hw/gpu.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/core/hw/gpu.cpp') diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 94768b101..76dbe3fdc 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -218,16 +218,7 @@ void Update() { /// Initialize hardware void Init() { - switch (Settings::values.cpu_core) { - case Core::CPU_FastInterpreter: - kFrameCycles = 268123480 / 2048; - break; - case Core::CPU_Interpreter: - default: - kFrameCycles = 268123480 / 60; - break; - } - + kFrameCycles = 268123480 / Settings::values.gpu_refresh_rate; kFrameTicks = kFrameCycles / 3; g_cur_line = 0; -- cgit v1.2.3