void Application::init() { if(config().system.crashedOnLastRun == true) { //emulator crashed on last run, disable all drivers QMessageBox::warning(0, "bsnes Crash Notification", string() << "
Warning:
bsnes crashed while attempting to initialize device "
"drivers the last time it was run.
To prevent this from occurring again, all drivers have been disabled. Please " "go to Settings->Configuration->Advanced and choose new driver settings, and then " "restart the emulator for the changes to take effect. Video, audio and input " "will not work until you do this!
" "Settings that caused failure on last run:
"
<< "Video driver: " << config().system.video << "
"
<< "Audio driver: " << config().system.audio << "
"
<< "Input driver: " << config().system.input << "
Warning: " << config().system.video << " video driver failed to initialize. " "Video driver has been disabled.
" "Please go to Settings->Configuration->Advanced and choose a different driver, and " "then restart the emulator for the changes to take effect.
" ); video.driver("None"); video.init(); } audio.driver(config().system.audio); audio.set(Audio::Handle, (uintptr_t)mainWindow->canvas->winId()); audio.set(Audio::Frequency, config().audio.outputFrequency); audio.set(Audio::Latency, config().audio.latency); audio.set(Audio::Volume, config().audio.volume); if(audio.init() == false) { QMessageBox::warning(0, "bsnes", string() << "Warning: " << config().system.audio << " audio driver failed to initialize. " "Audio driver has been disabled.
" "Please go to Settings->Configuration->Advanced and choose a different driver, and " "then restart the emulator for the changes to take effect.
" ); audio.driver("None"); audio.init(); } input.driver(config().system.input); input.set("Handle", (uintptr_t)mainWindow->canvas->winId()); if(input.init() == false) { QMessageBox::warning(0, "bsnes", string() << "Warning: " << config().system.input << " input driver failed to initialize. " "Input driver has been disabled.
" "Please go to Settings->Configuration->Advanced and choose a different driver, and " "then restart the emulator for the changes to take effect.
" ); input.driver("None"); input.init(); } //didn't crash, note this in the config file now in case a different kind of crash occurs later config().system.crashedOnLastRun = false; config().save(configFilename); //hide pixel shader settings if driver does not support them videoSettingsWindow->synchronizePixelShaderSettings(); utility.resizeMainWindow(); utility.updateAvSync(); utility.updateColorFilter(); utility.updatePixelShader(); utility.updateHardwareFilter(); utility.updateSoftwareFilter(); utility.updateEmulationSpeed(); utility.updateControllers(); }