mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2026-10-12 02:11:42 +00:00
* double-click a cheat finder result to add a new cheat code * fixed v108.1 regression not enabling coprocessor LLE when requested * add "[HLE] " title bar indicator for HLE mode * default to LLE mode for coprocessors * simplify game titles in main window (eg omit SGB BIOS name) * add more GUI tooltips to explain options * pause emulator during modal loops (helps Windows menubar navigation) * add support for decoding Game Genie + Pro Action Replay SNES cheats * add support for decoding Game Genie + GameShark Game Boy cheats * add tool-tip explanation to verified/unverified status bar icon
117 lines
2.6 KiB
C++
117 lines
2.6 KiB
C++
#include "../bsnes.hpp"
|
|
#include "platform.cpp"
|
|
#include "game.cpp"
|
|
#include "game-pak.cpp"
|
|
#include "game-rom.cpp"
|
|
#include "paths.cpp"
|
|
#include "states.cpp"
|
|
#include "movies.cpp"
|
|
#include "rewind.cpp"
|
|
#include "video.cpp"
|
|
#include "audio.cpp"
|
|
#include "input.cpp"
|
|
#include "utility.cpp"
|
|
#include "patch.cpp"
|
|
#include "hacks.cpp"
|
|
#include "filter.cpp"
|
|
#include "viewport.cpp"
|
|
Program program;
|
|
|
|
auto Program::create() -> void {
|
|
Emulator::platform = this;
|
|
|
|
presentation.create();
|
|
presentation.setVisible();
|
|
presentation.viewport.setFocused();
|
|
|
|
settingsWindow.create();
|
|
videoSettings.create();
|
|
audioSettings.create();
|
|
inputSettings.create();
|
|
hotkeySettings.create();
|
|
pathSettings.create();
|
|
speedSettings.create();
|
|
emulatorSettings.create();
|
|
driverSettings.create();
|
|
|
|
toolsWindow.create();
|
|
cheatFinder.create();
|
|
cheatDatabase.create();
|
|
cheatWindow.create();
|
|
cheatEditor.create();
|
|
stateWindow.create();
|
|
stateManager.create();
|
|
manifestViewer.create();
|
|
|
|
if(settings.general.crashed) {
|
|
MessageDialog(
|
|
"Driver crash detected. Hardware drivers have been disabled.\n"
|
|
"Please reconfigure drivers in the advanced settings panel."
|
|
).setAlignment(*presentation).information();
|
|
settings.video.driver = "None";
|
|
settings.audio.driver = "None";
|
|
settings.input.driver = "None";
|
|
}
|
|
|
|
settings.general.crashed = true;
|
|
settings.save();
|
|
updateVideoDriver(presentation);
|
|
updateAudioDriver(presentation);
|
|
updateInputDriver(presentation);
|
|
settings.general.crashed = false;
|
|
settings.save();
|
|
|
|
driverSettings.videoDriverChanged();
|
|
driverSettings.audioDriverChanged();
|
|
driverSettings.inputDriverChanged();
|
|
|
|
if(gameQueue) load();
|
|
if(startFullScreen && emulator->loaded()) {
|
|
presentation.toggleFullscreenMode();
|
|
}
|
|
Application::onMain({&Program::main, this});
|
|
}
|
|
|
|
auto Program::main() -> void {
|
|
updateStatus();
|
|
video.poll();
|
|
|
|
if(Application::modal()) {
|
|
audio.clear();
|
|
return;
|
|
}
|
|
|
|
inputManager.poll();
|
|
inputManager.pollHotkeys();
|
|
|
|
if(inactive()) {
|
|
audio.clear();
|
|
usleep(20 * 1000);
|
|
viewportRefresh();
|
|
return;
|
|
}
|
|
|
|
rewindRun();
|
|
emulator->run();
|
|
if(emulatorSettings.autoSaveMemory.checked()) {
|
|
auto currentTime = chrono::timestamp();
|
|
if(currentTime - autoSaveTime >= settings.emulator.autoSaveMemory.interval) {
|
|
autoSaveTime = currentTime;
|
|
emulator->save();
|
|
}
|
|
}
|
|
}
|
|
|
|
auto Program::quit() -> void {
|
|
//make closing the program feel more responsive
|
|
presentation.setVisible(false);
|
|
Application::processEvents();
|
|
|
|
unload();
|
|
settings.save();
|
|
video.reset();
|
|
audio.reset();
|
|
input.reset();
|
|
Application::exit();
|
|
}
|