Update FPS to roughly match the actual 3DS rate

This commit is contained in:
xperia64 2020-04-26 03:22:11 -04:00
parent bc14f485c4
commit 5e95b35900
2 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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))