fix bugs with SPI shutdown

This commit is contained in:
StapleButter 2017-10-01 03:19:39 +02:00
parent 9ad89d8cb5
commit 1975efaeea
3 changed files with 7 additions and 5 deletions

View File

@ -346,6 +346,7 @@ void Reset()
void Stop()
{
printf("Stopping: shutdown\n");
Running = false;
Platform::StopEmu();
GPU::Stop();
SPU::Stop();

View File

@ -44,7 +44,7 @@
#endif
void Stop();
void Stop(bool internal);
namespace Platform
@ -75,7 +75,7 @@ u8 PacketBuffer[2048];
void StopEmu()
{
Stop();
Stop(true);
}

View File

@ -320,9 +320,10 @@ void Run()
uiMenuItemSetChecked(MenuItem_Pause, 0);
}
void Stop()
void Stop(bool internal)
{
EmuRunning = 2;
if (!internal) // if shutting down from the UI thread, wait till the emu thread has stopped
while (EmuStatus != 2);
RunningSomething = false;
@ -449,7 +450,7 @@ void OnStop(uiMenuItem* item, uiWindow* window, void* blarg)
{
if (!RunningSomething) return;
Stop();
Stop(false);
}
void OnOpenEmuSettings(uiMenuItem* item, uiWindow* window, void* blarg)