move Movie::DoFrameStep to Core::DoFrameStep

This commit is contained in:
Michael M
2017-07-01 13:17:18 -07:00
parent 030dc11c6e
commit d217e797f2
6 changed files with 29 additions and 27 deletions

View File

@ -103,6 +103,7 @@ static StoppedCallbackFunc s_on_stopped_callback;
static std::thread s_cpu_thread;
static bool s_request_refresh_info = false;
static bool s_is_throttler_temp_disabled = false;
static bool s_frame_step = false;
struct HostJob
{
@ -473,6 +474,7 @@ static void EmuThread(std::unique_ptr<BootParameters> boot)
// For a time this acts as the CPU thread...
DeclareAsCPUThread();
s_frame_step = false;
Movie::Init(*boot);
Common::ScopeGuard movie_guard{Movie::Shutdown};
@ -859,6 +861,12 @@ void Callback_VideoCopiedToXFB(bool video_update)
s_drawn_frame++;
Movie::FrameUpdate();
if (s_frame_step)
{
s_frame_step = false;
CPU::Break();
}
}
void UpdateTitle()
@ -1024,4 +1032,21 @@ void HostDispatchJobs()
}
}
// NOTE: Host Thread
void DoFrameStep()
{
if (GetState() == State::Paused)
{
// if already paused, frame advance for 1 frame
s_frame_step = true;
RequestRefreshInfo();
SetState(State::Running);
}
else if (!s_frame_step)
{
// if not paused yet, pause immediately instead
SetState(State::Paused);
}
}
} // Core