diff --git a/Common/UI/Screen.cpp b/Common/UI/Screen.cpp index 4ec2b48009..903be8a968 100644 --- a/Common/UI/Screen.cpp +++ b/Common/UI/Screen.cpp @@ -127,14 +127,7 @@ void ScreenManager::update() { overlayScreen_->update(); } - // Only the front screen gets update(). - if (!stack_.empty()) { - stack_.back().screen->update(); - passInputToMapper_ = stack_.back().screen->PassInputToMapper(); - } - // Process queued events. - std::deque events; { std::lock_guard eventGuard(eventQueueLock_); @@ -192,6 +185,13 @@ void ScreenManager::update() { break; } } + + // Only the front screen gets update(). + if (!stack_.empty()) { + Screen *backScreen = stack_.back().screen; + backScreen->update(); + passInputToMapper_ = backScreen->PassInputToMapper(); + } } void ScreenManager::switchToNext() { diff --git a/Core/HLE/sceUtility.cpp b/Core/HLE/sceUtility.cpp index 2f351f7442..864bfb0496 100644 --- a/Core/HLE/sceUtility.cpp +++ b/Core/HLE/sceUtility.cpp @@ -1429,7 +1429,7 @@ static int sceUtilityGameSharingUpdate(int animSpeed) { return hleLogWarning(Log::sceUtility, SCE_ERROR_UTILITY_WRONG_TYPE, "wrong dialog type"); } - return hleLogError(Log::sceUtility, 0, "UNIMPL sceUtilityGameSharingUpdate(%i)", animSpeed); + return hleLogError(Log::sceUtility, 0, "UNIMPL"); } static int sceUtilityGameSharingGetStatus() { @@ -1441,30 +1441,21 @@ static int sceUtilityGameSharingGetStatus() { return hleLogError(Log::sceUtility, 0, "UNIMPL"); } -static u32 sceUtilityLoadUsbModule(u32 module) -{ - if (module < 1 || module > 5) - { - ERROR_LOG(Log::sceUtility, "sceUtilityLoadUsbModule(%i): invalid module id", module); +static u32 sceUtilityLoadUsbModule(u32 module) { + if (module < 1 || module > 5) { + return hleLogError(Log::sceUtility, 0, "invalid module id"); } - - ERROR_LOG_REPORT(Log::sceUtility, "UNIMPL sceUtilityLoadUsbModule(%i)", module); - return hleNoLog(0); + return hleLogWarning(Log::sceUtility, 0, "UNIMPL"); } -static u32 sceUtilityUnloadUsbModule(u32 module) -{ - if (module < 1 || module > 5) - { - ERROR_LOG(Log::sceUtility, "sceUtilityUnloadUsbModule(%i): invalid module id", module); +static u32 sceUtilityUnloadUsbModule(u32 module) { + if (module < 1 || module > 5) { + return hleLogError(Log::sceUtility, 0, "invalid module id"); } - - ERROR_LOG_REPORT(Log::sceUtility, "UNIMPL sceUtilityUnloadUsbModule(%i)", module); - return hleNoLog(0); + return hleLogWarning(Log::sceUtility, 0, "UNIMPL"); } -const HLEFunction sceUtility[] = -{ +const HLEFunction sceUtility[] = { {0X1579A159, &WrapU_U, "sceUtilityLoadNetModule", 'x', "x" }, {0X64D50C56, &WrapU_U, "sceUtilityUnloadNetModule", 'x', "x" }, diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 964d6ef215..3ccdba5b7f 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -191,7 +191,6 @@ static Draw::DrawContext *g_draw; static Draw::Pipeline *colorPipeline; static Draw::Pipeline *texColorPipeline; static UIContext *uiContext; -static int g_restartGraphics; static bool g_windowHidden = false; static std::string g_achievementsHostOverride; static std::string g_savedAchievementsHost; @@ -1024,18 +1023,6 @@ void NativeFrame(GraphicsContext *graphicsContext) { } } - // This can only be accessed from Windows currently, and causes linking errors with headless etc. - if (g_restartGraphics == 1) { - // Used for debugging only. - NativeShutdownGraphics(graphicsContext); - g_restartGraphics++; - return; - } - else if (g_restartGraphics == 2) { - NativeInitGraphics(graphicsContext); - g_restartGraphics = 0; - } - double startTime = time_now_d(); ProcessWheelRelease(NKCODE_EXT_MOUSEWHEEL_UP, startTime, false); @@ -1210,7 +1197,6 @@ void NativeFrame(GraphicsContext *graphicsContext) { bool HandleGlobalMessage(UIMessage message, const std::string &value) { if (message == UIMessage::RESTART_GRAPHICS) { - g_restartGraphics = 1; return true; } else if (message == UIMessage::SAVESTATE_DISPLAY_SLOT) { auto sy = GetI18NCategory(I18NCat::SYSTEM); diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index a07222fbb8..0310e3f941 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -334,18 +334,19 @@ void SaveSlotView::OnSaveState(UI::EventParams &e) { void GamePauseScreen::update() { UpdateUIState(UISTATE_PAUSEMENU); - if (!firstFrame_ && g_controlMapper.PollPauseTrigger()) { - TriggerFinish(DR_BACK); - } UIBaseDialogScreen::update(); - firstFrame_ = false; - { std::lock_guard lock(finishNextFrameMutex_); + if (!firstFrame_ && g_controlMapper.PollPauseTrigger()) { + finishNextFrame_ = true; + finishNextFrameResult_ = DR_BACK; + } + firstFrame_ = false; if (finishNextFrame_) { TriggerFinish(finishNextFrameResult_); finishNextFrame_ = false; + finishNextFrameResult_ = DR_BACK; } } @@ -828,6 +829,7 @@ void GamePauseScreen::dialogFinished(const Screen *dialog, DialogResult dr) { if (dr == DR_OK) { std::lock_guard lock(finishNextFrameMutex_); finishNextFrame_ = true; + finishNextFrameResult_ = DR_BACK; } else if (dr != DR_CANCEL && dr != DR_BACK) { // Just go back to the pause menu, but refresh the savestate thumbnails in case something changed. SaveState::Rescan(saveStatePrefix_); diff --git a/android/src/org/ppsspp/ppsspp/PpssppActivity.java b/android/src/org/ppsspp/ppsspp/PpssppActivity.java index 9d16390bf2..ee4a6d47c2 100644 --- a/android/src/org/ppsspp/ppsspp/PpssppActivity.java +++ b/android/src/org/ppsspp/ppsspp/PpssppActivity.java @@ -1111,15 +1111,19 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList joinRenderLoopThread(); Log.i(TAG, "Joined render thread"); } else if (mGLSurfaceView != null) { + Log.i(TAG, "mGLSurfaceView.onPause..."); mGLSurfaceView.onPause(); } + Log.i(TAG, "mSensorManager.unregisterListener..."); mSensorManager.unregisterListener(this); loseAudioFocus(this.audioManager, this.audioFocusChangeListener); sizeManager.onPause(); + Log.i(TAG, "Calling NativeApp.pause..."); NativeApp.pause(); if (mCameraHelper != null) { + Log.i(TAG, "Calling mCameraHelper.pause"); mCameraHelper.pause(); } Log.i(TAG, "onPause end"); @@ -1203,9 +1207,11 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList } if (NativeApp.queryConfig("audioMixWithOthers").equals("0")) { // Shouldn't mix with others - take over. + Log.i(TAG, "Taking audio focus"); audioManager.requestAudioFocus(focusChangeListener, AudioManager.STREAM_MUSIC, AudioManager.AUDIOFOCUS_GAIN); } else { // Mix with others - abandon focus so we don't kick others out. + Log.i(TAG, "Abandoning audio focus"); audioManager.abandonAudioFocus(focusChangeListener); } } @@ -1214,6 +1220,7 @@ public class PpssppActivity extends AppCompatActivity implements SensorEventList // instantiate NativeAudioPlayer public static void loseAudioFocus(AudioManager audioManager, AudioFocusChangeListener focusChangeListener) { if (audioManager != null) { + Log.i(TAG, "Abandoning audio focus"); audioManager.abandonAudioFocus(focusChangeListener); } }