Skip to content
Permalink
Browse files

[IDEA] Fix recording when using `speedup/turbo`.

We do not allow to skip frames while recording. The resulting length
will be extended compared to using turbo/speedup modes, because the
recording will be normal time (as in running without turbo/speedup).
  • Loading branch information
denisfa authored and rkitover committed Aug 7, 2019
1 parent 738494a commit f5b19475c92160829fe40cb2bbb9709be4ad9156
Showing with 9 additions and 2 deletions.
  1. +2 −2 src/gb/GB.cpp
  2. +7 −0 src/wx/panel.cpp
@@ -5150,8 +5150,8 @@ void gbEmulate(int ticksToStop)
gbDrawLine();
} else if ((register_LY == 144) && (!systemFrameSkip)) {
int framesToSkip = systemFrameSkip;
if (speedup)
framesToSkip = 9; // try 6 FPS during speedup
//if (speedup)
// framesToSkip = 9; // try 6 FPS during speedup
if ((gbFrameSkipCount >= framesToSkip) || (gbWhiteScreen == 1)) {
gbWhiteScreen = 2;

@@ -2336,10 +2336,15 @@ static const wxString media_err(recording::MediaRet ret)
}
}

int save_speedup_frame_skip;

void GameArea::StartVidRecording(const wxString& fname)
{
recording::MediaRet ret;

// do not skip frames when recording
save_speedup_frame_skip = speedup_frame_skip;
speedup_frame_skip = 0;
vid_rec.SetSampleRate(soundGetSampleRate());
if ((ret = vid_rec.Record(fname.mb_str(), basic_width, basic_height,
systemColorDepth))
@@ -2357,6 +2362,8 @@ void GameArea::StartVidRecording(const wxString& fname)
void GameArea::StopVidRecording()
{
vid_rec.Stop();
// allow to skip frames again
speedup_frame_skip = save_speedup_frame_skip;
MainFrame* mf = wxGetApp().frame;
mf->cmd_enable &= ~CMDEN_VREC;
mf->cmd_enable |= CMDEN_NVREC;

0 comments on commit f5b1947

Please sign in to comment.
You can’t perform that action at this time.