citra-emu
/
citra-canary
Archived
1
0
Fork 0

Add measured frame cycles

This commit is contained in:
xperia64 2020-04-26 18:02:25 -04:00
parent 5e95b35900
commit 03145e307b
2 changed files with 7 additions and 6 deletions

View File

@ -30,8 +30,6 @@ namespace GPU {
Regs g_regs;
Memory::MemorySystem* g_memory;
/// 268MHz CPU clocks / 60Hz frames per second
const u64 frame_ticks = static_cast<u64>(BASE_CLOCK_RATE_ARM11 / SCREEN_REFRESH_RATE);
/// Event id for CoreTiming
static Core::TimingEventType* vblank_event;

View File

@ -12,6 +12,7 @@
#include "common/bit_field.h"
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "core/core_timing.h"
namespace Memory {
class MemorySystem;
@ -19,10 +20,12 @@ class MemorySystem;
namespace GPU {
// TODO(xperia64): This should be defined by the number of
// ARM11 cycles per vblank interval once that value is measured
// and not the other way around
constexpr double SCREEN_REFRESH_RATE = 59.833997376556916;
// Measured on hardware to be 2240568 timer cycles or 4481136 ARM11 cycles
constexpr u64 frame_ticks = 4481136ull;
// Refresh rate defined by ratio of ARM11 frequency to ARM11 ticks per frame
// (268,111,856) / (4,481,136) = 59.83122493939037Hz
constexpr double SCREEN_REFRESH_RATE = BASE_CLOCK_RATE_ARM11 / static_cast<double>(frame_ticks);
// Returns index corresponding to the Regs member labeled by field_name
#define GPU_REG_INDEX(field_name) (offsetof(GPU::Regs, field_name) / sizeof(u32))