2018-05-19 02:51:34 +00:00
|
|
|
auto Program::initializeVideoDriver() -> void {
|
|
|
|
video = Video::create(settings["Video/Driver"].text());
|
|
|
|
video->setContext(presentation->viewport.handle());
|
|
|
|
video->setExclusive(false);
|
|
|
|
video->setBlocking(settings["Video/Blocking"].boolean());
|
|
|
|
if(!video->ready()) {
|
|
|
|
MessageDialog().setText("Failed to initialize video driver").warning();
|
|
|
|
video = Video::create("None");
|
|
|
|
}
|
|
|
|
presentation->clearViewport();
|
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
|
|
|
updateVideoShader();
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::initializeAudioDriver() -> void {
|
|
|
|
audio = Audio::create(settings["Audio/Driver"].text());
|
|
|
|
audio->setContext(presentation->viewport.handle());
|
|
|
|
audio->setExclusive(false);
|
|
|
|
audio->setBlocking(settings["Audio/Blocking"].boolean());
|
2018-05-20 04:39:29 +00:00
|
|
|
if(!audio->availableDevices().find(settings["Audio/Device"].text())) {
|
|
|
|
settings["Audio/Device"].setValue(audio->availableDevices()(0));
|
|
|
|
}
|
|
|
|
audio->setDevice(settings["Audio/Device"].text());
|
|
|
|
if(!audio->availableFrequencies().find(settings["Audio/Frequency"].real())) {
|
|
|
|
settings["Audio/Frequency"].setValue(audio->availableFrequencies()(0));
|
|
|
|
}
|
|
|
|
audio->setFrequency(settings["Audio/Frequency"].real());
|
|
|
|
if(!audio->availableLatencies().find(settings["Audio/Latency"].natural())) {
|
|
|
|
settings["Audio/Latency"].setValue(audio->availableLatencies()(0));
|
|
|
|
}
|
|
|
|
audio->setLatency(settings["Audio/Latency"].natural());
|
2018-05-19 02:51:34 +00:00
|
|
|
audio->setChannels(2);
|
|
|
|
if(!audio->ready()) {
|
|
|
|
MessageDialog().setText("Failed to initialize audio driver").warning();
|
|
|
|
audio = Audio::create("None");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::initializeInputDriver() -> 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
|
|
|
input = Input::create(settings["Input/Driver"].text());
|
2018-05-19 02:51:34 +00:00
|
|
|
input->setContext(presentation->viewport.handle());
|
|
|
|
if(!input->ready()) {
|
|
|
|
MessageDialog().setText("Failed to initialize input driver").warning();
|
|
|
|
input = Input::create("None");
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
|
|
|
|
auto Program::updateVideoShader() -> void {
|
|
|
|
if(settings["Video/Driver"].text() == "OpenGL"
|
|
|
|
&& settings["Video/Shader"].text() != "None"
|
|
|
|
&& settings["Video/Shader"].text() != "Blur"
|
|
|
|
) {
|
|
|
|
video->setSmooth(false);
|
|
|
|
video->setShader(settings["Video/Shader"].text());
|
|
|
|
} else {
|
|
|
|
video->setSmooth(settings["Video/Shader"].text() == "Blur");
|
|
|
|
video->setShader("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::connectDevices() -> void {
|
|
|
|
for(auto& port : emulator->ports) {
|
|
|
|
auto path = string{"Emulator/", port.name}.replace(" ", "");
|
|
|
|
auto name = settings(path).text();
|
|
|
|
for(auto& device : port.devices) {
|
|
|
|
if(device.name == name) {
|
|
|
|
emulator->connect(port.id, device.id);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::showMessage(string text) -> void {
|
|
|
|
statusTime = chrono::timestamp();
|
|
|
|
statusMessage = text;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::updateMessage() -> void {
|
|
|
|
uint64 currentTime = chrono::timestamp();
|
|
|
|
|
|
|
|
string text;
|
|
|
|
if((currentTime - statusTime) <= 2) {
|
|
|
|
text = statusMessage;
|
|
|
|
} else if(!emulator->loaded()) {
|
|
|
|
text = "No game loaded";
|
|
|
|
} else if(presentation->pauseEmulation.checked()) {
|
|
|
|
text = "Paused";
|
|
|
|
} else if(!focused() && settingsWindow->input.pauseEmulation.checked()) {
|
|
|
|
text = "Paused";
|
|
|
|
} else {
|
|
|
|
text = statusText;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(text != presentation->statusBar.text()) {
|
|
|
|
presentation->statusBar.setText(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::focused() -> bool {
|
|
|
|
//exclusive mode creates its own top-level window: presentation window will not have focus
|
|
|
|
if(video->exclusive()) return true;
|
|
|
|
if(presentation && presentation->focused()) return true;
|
|
|
|
return false;
|
|
|
|
}
|