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());
|
Update to v106r27 release.
byuu says:
Changelog:
- nall: merged Path::config() and Path::local() to Path::userData()
- ~/.local/share or %appdata or ~/Library/ApplicationSupport
- higan, bsnes: render main window icon onto viewport instead of
canvas
- should hopefully fix a brief flickering glitch that appears on
Windows
- icarus: improved Super Famicom heuristics for Starfox / Starwing RAM
- ruby/Direct3D: handle viewport size changes in lock() instead of
output()
- fixes icon disappearing when resizing main window
- hiro/Windows: remove WS_DISABLED from StatusBar to fix window
resize grip
- this is experimental: I initially used WS_DISABLED to work
around a focus bug
- yet trying things now, said bug seems(?) to have gone away at
some point ...
- bsnes: added advanced settings panel with real-time driver change
support
I'd like feedback on the real-time driver change, for possible
consideration into adding this to higan as well.
Some drivers just crash, it's a fact of life. The ASIO driver in
particular likes to crash inside the driver itself, without any error
messages ever returned to try and catch.
When you try to change a driver with a game loaded, it gives you a scary
warning, asking if you want to proceed.
When you change a driver, it sets a crash flag, and if the driver
crashes while initializing, then restarting bsnes will disable the
errant driver. If it fails in a recoverable way, then it sets the driver
to “None” and warns you that the driver cannot be used.
What I'm thinking of further adding is to call emulator→save() to
write out the save RAM contents beforehand (although the periodic
auto-saving RAM will handle this anyway when it's enabled), and possibly
it might be wise to capture an emulator save state, although those can't
be taken without advancing the emulator to the next frame, so that might
not be a good idea.
I'm also thinking we should show some kind of message somewhere when a
driver is set to “None”. The status bar can be hidden, so perhaps on the
title bar? Or maybe just a warning on startup that a driver is set to
“None”.
2018-05-25 08:02:38 +00:00
|
|
|
|
|
|
|
if(video->ready()) {
|
|
|
|
presentation->clearViewport();
|
|
|
|
updateVideoShader();
|
2018-05-19 02:51:34 +00:00
|
|
|
}
|
2018-06-10 08:07:19 +00:00
|
|
|
|
|
|
|
video->onUpdate([&](uint width, uint height) {
|
|
|
|
if(!emulator->loaded()) presentation->clearViewport();
|
|
|
|
});
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
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());
|
|
|
|
}
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-11 04:50:18 +00:00
|
|
|
auto Program::applyHacks() -> void {
|
|
|
|
bool fastPPU = settingsWindow->advanced.fastPPUOption.checked();
|
|
|
|
bool fastDSP = settingsWindow->advanced.fastDSPOption.checked();
|
|
|
|
|
|
|
|
auto label = superNintendo.label;
|
|
|
|
if(label == "AIR STRIKE PATROL" || label == "DESERT FIGHTER") fastPPU = false;
|
|
|
|
if(label == "KOUSHIEN_2") fastDSP = false;
|
|
|
|
|
|
|
|
emulator->set("Fast PPU", fastPPU);
|
|
|
|
emulator->set("Fast DSP", fastDSP);
|
|
|
|
}
|
|
|
|
|
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::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;
|
|
|
|
}
|