diff options
Diffstat (limited to 'src/core/hw')
| -rw-r--r-- | src/core/hw/gpu.cpp | 13 | ||||
| -rw-r--r-- | src/core/hw/gpu.h | 3 | ||||
| -rw-r--r-- | src/core/hw/hw.cpp | 4 | ||||
| -rw-r--r-- | src/core/hw/ndma.cpp | 4 |
4 files changed, 14 insertions, 10 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 33a0e0fe7..3ad801c63 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -4,11 +4,12 @@ #include "common/common_types.h" +#include "core/settings.h" #include "core/core.h" #include "core/mem_map.h" #include "core/hle/hle.h" -#include "core/hle/service/gsp.h" +#include "core/hle/service/gsp_gpu.h" #include "core/hw/gpu.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; @@ -31,7 +35,7 @@ inline void Read(T &var, const u32 raw_addr) { // Reads other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) { - ERROR_LOG(GPU, "unknown Read%d @ 0x%08X", sizeof(var) * 8, addr); + ERROR_LOG(GPU, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr); return; } @@ -45,7 +49,7 @@ inline void Write(u32 addr, const T data) { // Writes other than u32 are untested, so I'd rather have them abort than silently fail if (index >= Regs::NumIds() || !std::is_same<T,u32>::value) { - ERROR_LOG(GPU, "unknown Write%d 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); + ERROR_LOG(GPU, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); return; } @@ -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/hw/hw.cpp b/src/core/hw/hw.cpp index efd94f147..33f75c50a 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -50,7 +50,7 @@ inline void Read(T &var, const u32 addr) { break; default: - ERROR_LOG(HW, "unknown Read%d @ 0x%08X", sizeof(var) * 8, addr); + ERROR_LOG(HW, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr); } } @@ -68,7 +68,7 @@ inline void Write(u32 addr, const T data) { break; default: - ERROR_LOG(HW, "unknown Write%d 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); + ERROR_LOG(HW, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); } } diff --git a/src/core/hw/ndma.cpp b/src/core/hw/ndma.cpp index 158241fd6..e29a773f1 100644 --- a/src/core/hw/ndma.cpp +++ b/src/core/hw/ndma.cpp @@ -10,12 +10,12 @@ namespace NDMA { template <typename T> inline void Read(T &var, const u32 addr) { - ERROR_LOG(NDMA, "unknown Read%d @ 0x%08X", sizeof(var) * 8, addr); + ERROR_LOG(NDMA, "unknown Read%lu @ 0x%08X", sizeof(var) * 8, addr); } template <typename T> inline void Write(u32 addr, const T data) { - ERROR_LOG(NDMA, "unknown Write%d 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); + ERROR_LOG(NDMA, "unknown Write%lu 0x%08X @ 0x%08X", sizeof(data) * 8, data, addr); } // Explicitly instantiate template functions because we aren't defining this in the header: |
