diff --git a/src/emucore/Console.cxx b/src/emucore/Console.cxx index b18cf0098..867eee9d9 100644 --- a/src/emucore/Console.cxx +++ b/src/emucore/Console.cxx @@ -583,7 +583,13 @@ void Console::togglePhosphor() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Console::changePhosphor(int direction) { - int blend = stoi(myProperties.get(PropType::Display_PPBlend)); + int blend = 0; + + try + { + blend = stoi(myProperties.get(PropType::Display_PPBlend)); + } + catch (...) {} if(direction == +1) // increase blend { diff --git a/src/emucore/TIASurface.cxx b/src/emucore/TIASurface.cxx index 95e22fa65..b99f33be0 100644 --- a/src/emucore/TIASurface.cxx +++ b/src/emucore/TIASurface.cxx @@ -91,7 +91,11 @@ void TIASurface::initialize(const Console& console, } else { - p_blend = stoi(console.properties().get(PropType::Display_PPBlend)); + try + { + p_blend = stoi(console.properties().get(PropType::Display_PPBlend)); + } + catch (...) {} enable = console.properties().get(PropType::Display_Phosphor) == "YES"; } enablePhosphor(enable, p_blend); diff --git a/src/gui/GameInfoDialog.cxx b/src/gui/GameInfoDialog.cxx index 3929268ad..9ed16a231 100644 --- a/src/gui/GameInfoDialog.cxx +++ b/src/gui/GameInfoDialog.cxx @@ -460,7 +460,14 @@ void GameInfoDialog::loadEmulationProperties(const Properties& props) myPPBlend->setEnabled(!alwaysPhosphor && usePhosphor); const string& blend = props.get(PropType::Display_PPBlend); - myPPBlend->setValue(stoi(blend)); + try + { + myPPBlend->setValue(stoi(blend)); + } + catch (...) + { + myPPBlend->setValue(0); + } // set vertical center Int32 vcenter = stoi(props.get(PropType::Display_VCenter));