Avoid a race condition during game shutdown.
Hoping this is it.
This commit is contained in:
parent
5c13d482e0
commit
0a92d377b0
2 changed files with 22 additions and 8 deletions
|
@ -485,7 +485,9 @@ void EmuScreen::update(InputState &input) {
|
||||||
PSP_CoreParameter().pixelWidth = pixel_xres * bounds.w / dp_xres;
|
PSP_CoreParameter().pixelWidth = pixel_xres * bounds.w / dp_xres;
|
||||||
PSP_CoreParameter().pixelHeight = pixel_yres * bounds.h / dp_yres;
|
PSP_CoreParameter().pixelHeight = pixel_yres * bounds.h / dp_yres;
|
||||||
|
|
||||||
UpdateUIState(UISTATE_INGAME);
|
if (!invalid_) {
|
||||||
|
UpdateUIState(UISTATE_INGAME);
|
||||||
|
}
|
||||||
|
|
||||||
if (errorMessage_.size()) {
|
if (errorMessage_.size()) {
|
||||||
// Special handling for ZIP files. It's not very robust to check an error message but meh,
|
// Special handling for ZIP files. It's not very robust to check an error message but meh,
|
||||||
|
@ -565,9 +567,25 @@ void EmuScreen::update(InputState &input) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EmuScreen::checkPowerDown() {
|
||||||
|
if (coreState == CORE_POWERDOWN && !PSP_IsIniting()) {
|
||||||
|
if (PSP_IsInited()) {
|
||||||
|
PSP_Shutdown();
|
||||||
|
}
|
||||||
|
ILOG("SELF-POWERDOWN!");
|
||||||
|
screenManager()->switchScreen(new MainScreen());
|
||||||
|
bootPending_ = false;
|
||||||
|
invalid_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void EmuScreen::render() {
|
void EmuScreen::render() {
|
||||||
if (invalid_)
|
if (invalid_) {
|
||||||
|
// It's possible this might be set outside PSP_RunLoopFor().
|
||||||
|
// In this case, we need to double check it here.
|
||||||
|
checkPowerDown();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (PSP_CoreParameter().freezeNext) {
|
if (PSP_CoreParameter().freezeNext) {
|
||||||
PSP_CoreParameter().frozen = true;
|
PSP_CoreParameter().frozen = true;
|
||||||
|
@ -595,13 +613,8 @@ void EmuScreen::render() {
|
||||||
if (coreState == CORE_NEXTFRAME) {
|
if (coreState == CORE_NEXTFRAME) {
|
||||||
// set back to running for the next frame
|
// set back to running for the next frame
|
||||||
coreState = CORE_RUNNING;
|
coreState = CORE_RUNNING;
|
||||||
} else if (coreState == CORE_POWERDOWN) {
|
|
||||||
PSP_Shutdown();
|
|
||||||
ILOG("SELF-POWERDOWN!");
|
|
||||||
screenManager()->switchScreen(new MainScreen());
|
|
||||||
bootPending_ = false;
|
|
||||||
invalid_ = true;
|
|
||||||
}
|
}
|
||||||
|
checkPowerDown();
|
||||||
|
|
||||||
if (invalid_)
|
if (invalid_)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -58,6 +58,7 @@ private:
|
||||||
void setVKeyAnalogY(int stick, int virtualKeyMin, int virtualKeyMax);
|
void setVKeyAnalogY(int stick, int virtualKeyMin, int virtualKeyMax);
|
||||||
|
|
||||||
void autoLoad();
|
void autoLoad();
|
||||||
|
void checkPowerDown();
|
||||||
|
|
||||||
bool bootPending_;
|
bool bootPending_;
|
||||||
std::string gamePath_;
|
std::string gamePath_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue