2018-05-18 05:21:22 +00:00
|
|
|
#include "../bsnes.hpp"
|
2018-05-19 02:51:34 +00:00
|
|
|
#include "interface.cpp"
|
2018-05-20 04:39:29 +00:00
|
|
|
#include "game.cpp"
|
2018-05-24 02:14:17 +00:00
|
|
|
#include "paths.cpp"
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
#include "state.cpp"
|
2018-05-19 02:51:34 +00:00
|
|
|
#include "utility.cpp"
|
2018-05-18 05:21:22 +00:00
|
|
|
unique_pointer<Program> program;
|
|
|
|
|
2018-05-20 04:39:29 +00:00
|
|
|
Program::Program(string_vector arguments) {
|
2018-05-18 05:21:22 +00:00
|
|
|
program = this;
|
|
|
|
Emulator::platform = this;
|
|
|
|
|
|
|
|
new Presentation;
|
|
|
|
presentation->setVisible();
|
|
|
|
|
2018-05-19 02:51:34 +00:00
|
|
|
if(settings["Crashed"].boolean()) {
|
|
|
|
MessageDialog().setText("Driver crash detected. Hardware drivers have been disabled.").information();
|
|
|
|
settings["Video/Driver"].setValue("None");
|
|
|
|
settings["Audio/Driver"].setValue("None");
|
|
|
|
settings["Input/Driver"].setValue("None");
|
|
|
|
}
|
|
|
|
|
|
|
|
settings["Crashed"].setValue(true);
|
|
|
|
settings.save();
|
|
|
|
|
|
|
|
initializeVideoDriver();
|
|
|
|
initializeAudioDriver();
|
|
|
|
initializeInputDriver();
|
|
|
|
|
|
|
|
settings["Crashed"].setValue(false);
|
|
|
|
settings.save();
|
|
|
|
|
|
|
|
new InputManager;
|
|
|
|
new SettingsWindow;
|
2018-05-18 05:21:22 +00:00
|
|
|
new AboutWindow;
|
|
|
|
|
2018-05-20 04:39:29 +00:00
|
|
|
arguments.takeLeft(); //ignore program location in argument parsing
|
|
|
|
for(auto& argument : arguments) {
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
if(argument == "--fullscreen") {
|
|
|
|
presentation->toggleFullscreenMode();
|
|
|
|
} else if(file::exists(argument)) {
|
|
|
|
gameQueue.append(argument);
|
2018-05-20 04:39:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
if(gameQueue) load();
|
2018-05-18 05:21:22 +00:00
|
|
|
Application::onMain({&Program::main, this});
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::main() -> void {
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
updateMessage();
|
2018-05-19 02:51:34 +00:00
|
|
|
inputManager->poll();
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
inputManager->pollHotkeys();
|
2018-05-19 02:51:34 +00:00
|
|
|
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
if(!emulator->loaded()
|
|
|
|
|| presentation->pauseEmulation.checked()
|
|
|
|
|| (!focused() && settingsWindow->input.pauseEmulation.checked())
|
|
|
|
) {
|
|
|
|
audio->clear();
|
2018-05-19 02:51:34 +00:00
|
|
|
usleep(20 * 1000);
|
Update to v106r25 release.
byuu says:
Changelog:
- bsnes:
- added full input mapping support (multi-mapping, digital+analog
inputs, rumble, hotkeys, etc)
- can now load multi-part games (eg Super Game Boy) from the
command-line
- added recent games menu with list clear function; supports
multi-part games (sorting logic incomplete)
- added automatic binding of gamepads on new configuration files
- added view scaling support with aspect correction, overscan
cropping, and integral scaling modes
- added video shader support
- added status bar (can be hidden)
- added save states (both menu and hotkeys)
- added fullscreen mode support
- added support for loading compressed (ZIP) archives for any
supported media type (SNES, GB, etc)
- added frame counter
- added auto-memory saving
- added pause / block-input modes when main window loses focus
- added --fullscreen command-line option to start bsnes in
fullscreen mode
- added input settings panel
- added hotkeys settings panel
- added path settings panel (paths aren't actually used set, but
can be assigned)
- higan: fixed macOS install rule [Sintendo]
- higan: minor UI code cleanups
- nall: renamed Processor to Architecture to fix macOS builds
[Sintendo]
Yeah, you read right: recent games menu, path settings. And dynamic rate
control + screensaver suppression is on the todo list. I'm not fucking
around this time. I really want to make something special here.
2018-05-23 03:45:24 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
emulator->run();
|
|
|
|
if(settings["Emulator/AutoSaveMemory/Enable"].boolean()) {
|
|
|
|
auto currentTime = chrono::timestamp();
|
|
|
|
if(currentTime - autoSaveTime >= settings["Emulator/AutoSaveMemory/Interval"].natural()) {
|
|
|
|
autoSaveTime = currentTime;
|
|
|
|
emulator->save();
|
|
|
|
}
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
2018-05-18 05:21:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::quit() -> void {
|
2018-05-19 02:51:34 +00:00
|
|
|
unload();
|
|
|
|
settings.save();
|
|
|
|
video.reset();
|
|
|
|
audio.reset();
|
|
|
|
input.reset();
|
2018-05-18 05:21:22 +00:00
|
|
|
Application::quit();
|
|
|
|
}
|