mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Core/Movie: Add ability to run code in Host context
EndPlayInput runs on the CPU thread so it can't directly call UpdateWantDeterminism. PlayController also tries to ChangeDisc from the CPU Thread which is also invalid. It now just pauses execution and posts a request to the Host to fix it instead. The Core itself also did dodgy things like PauseAndLock-ing from the CPU Thread and SetState from EmuThread which have been removed.
This commit is contained in:
@ -101,6 +101,7 @@ bool DolphinApp::OnInit()
|
||||
|
||||
Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||
Bind(wxEVT_IDLE, &DolphinApp::OnIdle, this);
|
||||
|
||||
// Register message box and translation handlers
|
||||
RegisterMsgAlertHandler(&wxMsgAlert);
|
||||
@ -359,6 +360,12 @@ void DolphinApp::OnFatalException()
|
||||
WiimoteReal::Shutdown();
|
||||
}
|
||||
|
||||
void DolphinApp::OnIdle(wxIdleEvent& ev)
|
||||
{
|
||||
ev.Skip();
|
||||
Core::HostDispatchJobs();
|
||||
}
|
||||
|
||||
// ------------
|
||||
// Talk to GUI
|
||||
|
||||
@ -395,6 +402,12 @@ CFrame* DolphinApp::GetCFrame()
|
||||
|
||||
void Host_Message(int Id)
|
||||
{
|
||||
if (Id == WM_USER_JOB_DISPATCH)
|
||||
{
|
||||
// Trigger a wxEVT_IDLE
|
||||
wxWakeUpIdle();
|
||||
return;
|
||||
}
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, Id);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user