From 5e95b35900bb8c840169c4446634ff67982aa842 Mon Sep 17 00:00:00 2001 From: xperia64 Date: Sun, 26 Apr 2020 03:22:11 -0400 Subject: [PATCH] Update FPS to roughly match the actual 3DS rate --- src/core/dumping/ffmpeg_backend.cpp | 7 +++++-- src/core/hw/gpu.h | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/core/dumping/ffmpeg_backend.cpp b/src/core/dumping/ffmpeg_backend.cpp index 05cc25acf..2816190c0 100644 --- a/src/core/dumping/ffmpeg_backend.cpp +++ b/src/core/dumping/ffmpeg_backend.cpp @@ -124,8 +124,11 @@ bool FFmpegVideoStream::Init(FFmpegMuxer& muxer, const Layout::FramebufferLayout codec_context->bit_rate = Settings::values.video_bitrate; codec_context->width = layout.width; codec_context->height = layout.height; - codec_context->time_base.num = 1; - codec_context->time_base.den = 60; + // TODO(xperia64): Replace with the core timing derived refresh rate + // Verify that an FPS of 59.83... can actually be requested + // (this doesn't seem to be working currently) + codec_context->time_base.num = 1000000; + codec_context->time_base.den = 59833997; codec_context->gop_size = 12; codec_context->pix_fmt = codec->pix_fmts ? codec->pix_fmts[0] : AV_PIX_FMT_YUV420P; if (format_context->oformat->flags & AVFMT_GLOBALHEADER) diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 3252364e2..4e1c92289 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -19,7 +19,10 @@ class MemorySystem; namespace GPU { -constexpr float SCREEN_REFRESH_RATE = 60; +// 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; // Returns index corresponding to the Regs member labeled by field_name #define GPU_REG_INDEX(field_name) (offsetof(GPU::Regs, field_name) / sizeof(u32))