Skip to content

Commit

Permalink
UI: Prevent rendering during reboot.
Browse files Browse the repository at this point in the history
Can sometimes crash.
  • Loading branch information
unknownbrackets committed Oct 2, 2022
1 parent d3f6b9b commit a8c1238
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ bool EmuScreen::bootAllowStorage(const Path &filename) {
}

void EmuScreen::bootGame(const Path &filename) {
if (PSP_IsRebooting())
return;
if (PSP_IsInited()) {
bootPending_ = false;
invalid_ = false;
bootComplete();
return;
}

if (PSP_IsIniting()) {
std::string error_string;
bootPending_ = !PSP_InitUpdate(&error_string);
Expand Down Expand Up @@ -1097,6 +1106,11 @@ void EmuScreen::update() {
}

void EmuScreen::checkPowerDown() {
if (PSP_IsRebooting()) {
bootPending_ = true;
invalid_ = true;
}

if (coreState == CORE_POWERDOWN && !PSP_IsIniting() && !PSP_IsRebooting()) {
if (PSP_IsInited()) {
PSP_Shutdown();
Expand Down

0 comments on commit a8c1238

Please sign in to comment.