add some OSD messages. prepare shit.

This commit is contained in:
Arisotura 2019-06-11 04:04:49 +02:00
parent 3c70015da7
commit 543a40c7cb
1 changed files with 31 additions and 20 deletions

View File

@ -1502,6 +1502,34 @@ void Run()
uiMenuItemSetChecked(MenuItem_Pause, 0); uiMenuItemSetChecked(MenuItem_Pause, 0);
} }
void TogglePause(void* blarg)
{
if (!RunningSomething) return;
if (EmuRunning == 1)
{
// enable pause
EmuRunning = 2;
uiMenuItemSetChecked(MenuItem_Pause, 1);
SDL_PauseAudioDevice(AudioDevice, 1);
SDL_PauseAudioDevice(MicDevice, 1);
OSD::AddMessage(0, "Paused");
}
else
{
// disable pause
EmuRunning = 1;
uiMenuItemSetChecked(MenuItem_Pause, 0);
SDL_PauseAudioDevice(AudioDevice, 0);
SDL_PauseAudioDevice(MicDevice, 0);
OSD::AddMessage(0, "Resumed");
}
}
void Stop(bool internal) void Stop(bool internal)
{ {
EmuRunning = 2; EmuRunning = 2;
@ -1524,6 +1552,8 @@ void Stop(bool internal)
SDL_PauseAudioDevice(AudioDevice, 1); SDL_PauseAudioDevice(AudioDevice, 1);
SDL_PauseAudioDevice(MicDevice, 1); SDL_PauseAudioDevice(MicDevice, 1);
OSD::AddMessage(0xFFC040, "Shutdown");
} }
void SetupSRAMPath() void SetupSRAMPath()
@ -1877,26 +1907,7 @@ void OnRun(uiMenuItem* item, uiWindow* window, void* blarg)
void OnPause(uiMenuItem* item, uiWindow* window, void* blarg) void OnPause(uiMenuItem* item, uiWindow* window, void* blarg)
{ {
if (!RunningSomething) return; TogglePause(NULL);
if (EmuRunning == 1)
{
// enable pause
EmuRunning = 2;
uiMenuItemSetChecked(MenuItem_Pause, 1);
SDL_PauseAudioDevice(AudioDevice, 1);
SDL_PauseAudioDevice(MicDevice, 1);
}
else
{
// disable pause
EmuRunning = 1;
uiMenuItemSetChecked(MenuItem_Pause, 0);
SDL_PauseAudioDevice(AudioDevice, 0);
SDL_PauseAudioDevice(MicDevice, 0);
}
} }
void OnReset(uiMenuItem* item, uiWindow* window, void* blarg) void OnReset(uiMenuItem* item, uiWindow* window, void* blarg)