mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
move Movie::DoFrameStep to Core::DoFrameStep
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user