bsnes/higan/target-bsnes/program/program.cpp
Tim Allen 372e9ef42b Update to v106r45 release.
byuu says:

Changelog:

  - sfc/ppu-fast: added hires mode 7 option (doubles the sampling rate
    of mode 7 pixels to reduce aliasing)
  - sfc/ppu-fast: fixed mode 7 horizontal screen flip [hex_usr]
  - bsnes: added capture screenshot function and path selection
      - for now, it saves as BMP. I need a deflate implementation that
        won't add an external dependency for PNG
      - the output resolution is from the emulator: (256 or 512)x(240 or
        480 minus overscan cropping if enabled)
      - it captures the NEXT output frame, not the current one ... but
        it may be wise to change this behavior
      - it'd be a problem if the core were to exit and an image was
        captured halfway through frame rendering
  - bsnes: recovery state renamed to undo state
  - bsnes: added manifest viewer tool
  - bsnes: mention if game has been verified or not on the status bar
    message at load time
  - bsnes, nall: fixed a few missing function return values
    [SuperMikeMan]
  - bsnes: guard more strongly against failure to load games to avoid
    crashes
  - hiro, ruby: various fixes for macOS [Sintendo]
  - hiro/Windows: paint on `WM_ERASEBKGND` to prevent status bar
    flickering at startup
  - icarus: SPC7110 heuristics fixes [hex_usr]

Errata:

  - sfc/ppu-fast: remove debug hires mode7 force disable comment from
    PPU::power()

[The `WM_ERASEBKGND` fix was already present in the 106r44 public
beta -Ed.]
2018-07-02 11:57:04 +10:00

93 lines
2.1 KiB
C++

#include "../bsnes.hpp"
#include "interface.cpp"
#include "game.cpp"
#include "game-pak.cpp"
#include "game-rom.cpp"
#include "paths.cpp"
#include "states.cpp"
#include "video.cpp"
#include "audio.cpp"
#include "input.cpp"
#include "utility.cpp"
#include "patch.cpp"
#include "hacks.cpp"
unique_pointer<Program> program;
Program::Program(string_vector arguments) {
program = this;
Emulator::platform = this;
new Presentation;
presentation->setVisible();
new InputManager;
new SettingsWindow;
new CheatDatabase;
new CheatWindow;
new StateWindow;
new ToolsWindow;
new AboutWindow;
if(settings["Crashed"].boolean()) {
MessageDialog(
"Driver crash detected. Hardware drivers have been disabled.\n"
"Please reconfigure drivers in the advanced settings panel."
).setParent(*presentation).information();
settings["Video/Driver"].setValue("None");
settings["Audio/Driver"].setValue("None");
settings["Input/Driver"].setValue("None");
}
settings["Crashed"].setValue(true);
settings.save();
updateVideoDriver();
updateAudioDriver();
updateInputDriver();
settings["Crashed"].setValue(false);
settings.save();
arguments.takeLeft(); //ignore program location in argument parsing
for(auto& argument : arguments) {
if(argument == "--fullscreen") {
presentation->toggleFullscreenMode();
} else if(inode::exists(argument)) {
gameQueue.append(argument);
}
}
if(gameQueue) load();
Application::onMain({&Program::main, this});
}
auto Program::main() -> void {
if(Application::modal()) return;
updateStatus();
video->poll();
inputManager->poll();
inputManager->pollHotkeys();
if(paused()) {
audio->clear();
usleep(20 * 1000);
return;
}
emulator->run();
if(settingsWindow->advanced.autoSaveMemory.checked()) {
auto currentTime = chrono::timestamp();
if(currentTime - autoSaveTime >= settings["Emulator/AutoSaveMemory/Interval"].natural()) {
autoSaveTime = currentTime;
emulator->save();
}
}
}
auto Program::quit() -> void {
unload();
settings.save();
video.reset();
audio.reset();
input.reset();
Application::quit();
}