diff options
| author | Arisotura <thetotalworm@gmail.com> | 2019-06-11 04:04:49 +0200 | 
|---|---|---|
| committer | Arisotura <thetotalworm@gmail.com> | 2019-06-11 04:04:49 +0200 | 
| commit | 543a40c7cb402bfd8cb556bf47a1d1d751562070 (patch) | |
| tree | 9a297098da4ae652000b03ae96ca4f5c50308860 /src/libui_sdl/main.cpp | |
| parent | 3c70015da77cbaf8df6d0ec130942aaef5854c90 (diff) | |
add some OSD messages. prepare shit.
Diffstat (limited to 'src/libui_sdl/main.cpp')
| -rw-r--r-- | src/libui_sdl/main.cpp | 51 | 
1 files changed, 31 insertions, 20 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 064be0b..cc01fb6 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -1502,6 +1502,34 @@ void Run()      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)  {      EmuRunning = 2; @@ -1524,6 +1552,8 @@ void Stop(bool internal)      SDL_PauseAudioDevice(AudioDevice, 1);      SDL_PauseAudioDevice(MicDevice, 1); + +    OSD::AddMessage(0xFFC040, "Shutdown");  }  void SetupSRAMPath() @@ -1877,26 +1907,7 @@ void OnRun(uiMenuItem* item, uiWindow* window, void* blarg)  void OnPause(uiMenuItem* item, uiWindow* window, void* blarg)  { -    if (!RunningSomething) return; - -    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); -    } +    TogglePause(NULL);  }  void OnReset(uiMenuItem* item, uiWindow* window, void* blarg)  |