fix bugs with SPI shutdown
This commit is contained in:
parent
9ad89d8cb5
commit
1975efaeea
|
@ -346,6 +346,7 @@ void Reset()
|
||||||
void Stop()
|
void Stop()
|
||||||
{
|
{
|
||||||
printf("Stopping: shutdown\n");
|
printf("Stopping: shutdown\n");
|
||||||
|
Running = false;
|
||||||
Platform::StopEmu();
|
Platform::StopEmu();
|
||||||
GPU::Stop();
|
GPU::Stop();
|
||||||
SPU::Stop();
|
SPU::Stop();
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void Stop();
|
void Stop(bool internal);
|
||||||
|
|
||||||
|
|
||||||
namespace Platform
|
namespace Platform
|
||||||
|
@ -75,7 +75,7 @@ u8 PacketBuffer[2048];
|
||||||
|
|
||||||
void StopEmu()
|
void StopEmu()
|
||||||
{
|
{
|
||||||
Stop();
|
Stop(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -320,10 +320,11 @@ void Run()
|
||||||
uiMenuItemSetChecked(MenuItem_Pause, 0);
|
uiMenuItemSetChecked(MenuItem_Pause, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Stop()
|
void Stop(bool internal)
|
||||||
{
|
{
|
||||||
EmuRunning = 2;
|
EmuRunning = 2;
|
||||||
while (EmuStatus != 2);
|
if (!internal) // if shutting down from the UI thread, wait till the emu thread has stopped
|
||||||
|
while (EmuStatus != 2);
|
||||||
RunningSomething = false;
|
RunningSomething = false;
|
||||||
|
|
||||||
uiMenuItemDisable(MenuItem_Pause);
|
uiMenuItemDisable(MenuItem_Pause);
|
||||||
|
@ -449,7 +450,7 @@ void OnStop(uiMenuItem* item, uiWindow* window, void* blarg)
|
||||||
{
|
{
|
||||||
if (!RunningSomething) return;
|
if (!RunningSomething) return;
|
||||||
|
|
||||||
Stop();
|
Stop(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnOpenEmuSettings(uiMenuItem* item, uiWindow* window, void* blarg)
|
void OnOpenEmuSettings(uiMenuItem* item, uiWindow* window, void* blarg)
|
||||||
|
|
Loading…
Reference in New Issue