Added a frame counter while recording or playing back a TAS movie. Forced the GC/Wii to poll from the inputs at regular intervals. Disabled frame skip in record/playback mode. This helps the emulator to be determinate.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7128 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau 2011-02-11 12:26:15 +00:00
parent 8e91183897
commit 22553bd625
3 changed files with 24 additions and 10 deletions

View File

@ -530,7 +530,7 @@ void VideoThrottle()
// Update info per second
u32 ElapseTime = (u32)Timer.GetTimeDifference();
if (ElapseTime >= 1000 && DrawnVideo > 0)
if ((ElapseTime >= 1000 && DrawnVideo > 0) || Frame::g_bFrameStep)
{
SCoreStartupParameter& _CoreParameter = SConfig::GetInstance().m_LocalCoreStartupParameter;
@ -567,7 +567,11 @@ void VideoThrottle()
TicksPercentage);
#else // Summary information
std::string SFPS = StringFromFormat("FPS: %u - VPS: %u - SPEED: %u%%", FPS, VPS, Speed);
std::string SFPS;
if (Frame::g_recordfd)
SFPS = StringFromFormat("Frame: %d | FPS: %u - VPS: %u - SPEED: %u%%", Frame::g_frameCounter, FPS, VPS, Speed);
else
SFPS = StringFromFormat("FPS: %u - VPS: %u - SPEED: %u%%", FPS, VPS, Speed);
#endif
// This is our final "frame counter" string

View File

@ -621,6 +621,12 @@ void RunSIBuffer()
int GetTicksToNextSIPoll()
{
// Poll for input at regular intervals (once per frame) when playing or recording a movie
if (Frame::IsPlayingInput() || Frame::IsRecordingInput())
{
return SystemTimers::GetTicksPerSecond() / VideoInterface::TargetRefreshRate;
}
if (!g_Poll.Y && g_Poll.X)
return VideoInterface::GetTicksPerLine() * g_Poll.X;
else if (!g_Poll.Y)

View File

@ -103,15 +103,19 @@ void SetFrameStopping(bool bEnabled)
void FrameSkipping()
{
cs_frameSkip.Enter();
// Frameskipping will desync movie playback
if (!IsPlayingInput() && !IsRecordingInput())
{
cs_frameSkip.Enter();
g_frameSkipCounter++;
if (g_frameSkipCounter > g_framesToSkip || Core::report_slow(g_frameSkipCounter) == false)
g_frameSkipCounter = 0;
g_video_backend->Video_SetRendering(!g_frameSkipCounter);
cs_frameSkip.Leave();
g_frameSkipCounter++;
if (g_frameSkipCounter > g_framesToSkip || Core::report_slow(g_frameSkipCounter) == false)
g_frameSkipCounter = 0;
g_video_backend->Video_SetRendering(!g_frameSkipCounter);
cs_frameSkip.Leave();
}
}
bool IsRecordingInput()