diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/core.cpp | 17 | ||||
-rw-r--r-- | src/core/core.h | 5 | ||||
-rw-r--r-- | src/core/hw/gpu.cpp | 7 | ||||
-rw-r--r-- | src/core/hw/gpu.h | 3 | ||||
-rw-r--r-- | src/core/settings.h | 6 |
5 files changed, 32 insertions, 6 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 01d4f0afa..25c78d33c 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -5,12 +5,14 @@ #include "common/common_types.h" #include "core/core.h" -#include "core/hw/hw.h" + +#include "core/settings.h" #include "core/arm/disassembler/arm_disasm.h" #include "core/arm/interpreter/arm_interpreter.h" - +#include "core/arm/dyncom/arm_dyncom.h" #include "core/hle/hle.h" #include "core/hle/kernel/thread.h" +#include "core/hw/hw.h" namespace Core { @@ -48,9 +50,18 @@ int Init() { NOTICE_LOG(MASTER_LOG, "initialized OK"); g_disasm = new ARM_Disasm(); - g_app_core = new ARM_Interpreter(); g_sys_core = new ARM_Interpreter(); + switch (Settings::values.cpu_core) { + case CPU_FastInterpreter: + g_app_core = new ARM_DynCom(); + break; + case CPU_Interpreter: + default: + g_app_core = new ARM_Interpreter(); + break; + } + g_last_ticks = Core::g_app_core->GetTicks(); return 0; diff --git a/src/core/core.h b/src/core/core.h index 87da252b8..872dc0cd1 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -11,6 +11,11 @@ namespace Core { +enum CPUCore { + CPU_Interpreter, + CPU_FastInterpreter +}; + extern ARM_Interface* g_app_core; ///< ARM11 application core extern ARM_Interface* g_sys_core; ///< ARM11 system (OS) core 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 @@ #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 92097d182..3fa7b9ccf 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])). diff --git a/src/core/settings.h b/src/core/settings.h index d586e2ef4..6a6265e18 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -7,6 +7,7 @@ namespace Settings { struct Values { + // Controls int pad_a_key; int pad_b_key; int pad_x_key; @@ -25,6 +26,11 @@ struct Values { int pad_sleft_key; int pad_sright_key; + // Core + int cpu_core; + int gpu_refresh_rate; + + // Data Storage bool use_virtual_sd; } extern values; |