2015-04-21 11:51:57 +00:00
|
|
|
auto Program::powerCycle() -> void {
|
|
|
|
if(!emulator) return;
|
|
|
|
emulator->power();
|
|
|
|
showMessage("Power cycled");
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::softReset() -> void {
|
|
|
|
if(!emulator) return;
|
|
|
|
if(!emulator->information.resettable) return powerCycle();
|
|
|
|
emulator->reset();
|
|
|
|
showMessage("System reset");
|
|
|
|
}
|
|
|
|
|
Update to v097r12 release.
byuu says:
Nothing WS-related this time.
First, I fixed expansion port device mapping. On first load, it was
mapping the expansion port device too late, so it ended up not taking
effect. I had to spin out the logic for that into
Program::connectDevices(). This was proving to be quite annoying while
testing eBoot (SNES-Hook simulation.)
Second, I fixed the audio->set(Frequency, Latency) functions to take
(uint) parameters from the configuration file, so the weird behavior
around changing settings in the audio panel should hopefully be gone
now.
Third, I rewrote the interface->load,unload functions to call into the
(Emulator)::System::load,unload functions. And I have those call out to
Cartridge::load,unload. Before, this was inverted, and Cartridge::load()
was invoking System::load(), which I felt was kind of backward.
The Super Game Boy really didn't like this change, however. And it took
me a few hours to power through it. Before, I had the Game Boy core
dummying out all the interface->(load,save)Request calls, and having the
SNES core make them for it. This is because the folder paths and IDs
will be different between the two cores.
I've redesigned things so that ICD2's Emulator::Interface overloads
loadRequest and saveRequest, and translates the requests into new
requests for the SuperFamicom core. This allows the Game Boy code to do
its own loading for everything without a bunch of Super Game Boy special
casing, and without any awkwardness around powering on with no cartridge
inserted.
This also lets the SNES side of things simply call into higher-level
GameBoy::interface->load,save(id, stream) functions instead of stabbing
at the raw underlying state inside of various Game Boy core emulation
classes. So things are a lot better abstracted now.
2016-02-08 03:17:59 +00:00
|
|
|
auto Program::connectDevices() -> void {
|
|
|
|
if(!emulator) return;
|
|
|
|
for(auto& port : emulator->port) {
|
|
|
|
auto path = string{emulator->information.name, "/", port.name}.replace(" ", "");
|
|
|
|
auto name = settings(path).text();
|
|
|
|
for(auto& device : port.device) {
|
|
|
|
if(device.name == name) {
|
|
|
|
emulator->connect(port.id, device.id);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-13 11:16:33 +00:00
|
|
|
auto Program::showMessage(const string& text) -> void {
|
|
|
|
statusTime = time(0);
|
|
|
|
statusMessage = text;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::updateStatusText() -> void {
|
|
|
|
time_t currentTime = time(0);
|
|
|
|
|
|
|
|
string text;
|
|
|
|
if((currentTime - statusTime) <= 2) {
|
|
|
|
text = statusMessage;
|
2015-04-21 11:51:57 +00:00
|
|
|
} else if(!emulator || emulator->loaded() == false) {
|
2015-04-13 11:16:33 +00:00
|
|
|
text = "No cartridge loaded";
|
2016-01-15 10:28:51 +00:00
|
|
|
} else if(pause || (!presentation->focused() && settings["Input/FocusLoss/Pause"].boolean())) {
|
2015-04-13 11:16:33 +00:00
|
|
|
text = "Paused";
|
|
|
|
} else {
|
|
|
|
text = statusText;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(text != presentation->statusBar.text()) {
|
|
|
|
presentation->statusBar.setText(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-15 10:28:51 +00:00
|
|
|
auto Program::updateVideoShader() -> void {
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Video/Driver"].text() == "OpenGL"
|
|
|
|
&& settings["Video/Shader"].text() != "None"
|
2016-01-15 10:28:51 +00:00
|
|
|
&& settings["Video/Shader"].text() != "Blur"
|
2015-11-16 08:38:05 +00:00
|
|
|
&& directory::exists(settings["Video/Shader"].text())
|
|
|
|
) {
|
2015-11-08 08:54:42 +00:00
|
|
|
video->set(Video::Filter, Video::FilterNearest);
|
2015-11-16 08:38:05 +00:00
|
|
|
video->set(Video::Shader, settings["Video/Shader"].text());
|
2015-11-08 08:54:42 +00:00
|
|
|
} else {
|
2016-01-15 10:28:51 +00:00
|
|
|
video->set(Video::Filter, settings["Video/Shader"].text() == "Blur" ? Video::FilterLinear : Video::FilterNearest);
|
2015-11-08 08:54:42 +00:00
|
|
|
video->set(Video::Shader, (string)"");
|
|
|
|
}
|
Update to v094r13 release.
byuu says:
This version polishes up the input dialogue (reset, erase, disable
button when item not focused, split device ID from mapping name), adds
color emulation toggle, and add dummy menu items for remaining features
(to be filled in later.)
Also, it now compiles cleanly on Windows with GTK.
I didn't test with TDM-GCC-32, because for god knows what reason, the
32-bit version ships with headers from Windows 95 OSR2 only. So I built
with TDM-GCC-64 with arch=x86.
And uh, apparently, moving or resizing a window causes a Visual C++
runtime exception in the GTK+ DLLs. This doesn't happen with trance or
renshuu built with TDM-GCC-32. So, yeah, like I said, don't use -m32.
2015-03-07 10:21:47 +00:00
|
|
|
}
|
|
|
|
|
2015-06-15 22:26:47 +00:00
|
|
|
auto Program::updateAudio() -> void {
|
2015-06-20 05:44:05 +00:00
|
|
|
if(!audio) return;
|
2015-08-24 09:42:11 +00:00
|
|
|
audio->clear();
|
Update to v097r12 release.
byuu says:
Nothing WS-related this time.
First, I fixed expansion port device mapping. On first load, it was
mapping the expansion port device too late, so it ended up not taking
effect. I had to spin out the logic for that into
Program::connectDevices(). This was proving to be quite annoying while
testing eBoot (SNES-Hook simulation.)
Second, I fixed the audio->set(Frequency, Latency) functions to take
(uint) parameters from the configuration file, so the weird behavior
around changing settings in the audio panel should hopefully be gone
now.
Third, I rewrote the interface->load,unload functions to call into the
(Emulator)::System::load,unload functions. And I have those call out to
Cartridge::load,unload. Before, this was inverted, and Cartridge::load()
was invoking System::load(), which I felt was kind of backward.
The Super Game Boy really didn't like this change, however. And it took
me a few hours to power through it. Before, I had the Game Boy core
dummying out all the interface->(load,save)Request calls, and having the
SNES core make them for it. This is because the folder paths and IDs
will be different between the two cores.
I've redesigned things so that ICD2's Emulator::Interface overloads
loadRequest and saveRequest, and translates the requests into new
requests for the SuperFamicom core. This allows the Game Boy code to do
its own loading for everything without a bunch of Super Game Boy special
casing, and without any awkwardness around powering on with no cartridge
inserted.
This also lets the SNES side of things simply call into higher-level
GameBoy::interface->load,save(id, stream) functions instead of stabbing
at the raw underlying state inside of various Game Boy core emulation
classes. So things are a lot better abstracted now.
2016-02-08 03:17:59 +00:00
|
|
|
audio->set(Audio::Latency, (uint)settings["Audio/Latency"].natural());
|
2015-11-16 08:38:05 +00:00
|
|
|
if(settings["Audio/Resampler"].text() == "Linear" ) dsp.setResampler(DSP::ResampleEngine::Linear);
|
|
|
|
if(settings["Audio/Resampler"].text() == "Hermite") dsp.setResampler(DSP::ResampleEngine::Hermite);
|
|
|
|
if(settings["Audio/Resampler"].text() == "Sinc" ) dsp.setResampler(DSP::ResampleEngine::Sinc);
|
Update to v098r01 release.
byuu says:
Changelog:
- SFC: balanced profile removed
- SFC: performance profile removed
- SFC: code for handling non-threaded CPU, SMP, DSP, PPU removed
- SFC: Coprocessor, Controller (and expansion port) shared Thread code
merged to SFC::Cothread
- Cothread here just means "Thread with CPU affinity" (couldn't think
of a better name, sorry)
- SFC: CPU now has vector<Thread*> coprocessors, peripherals;
- this is the beginning of work to allow expansion port devices to be
dynamically changed at run-time
- ruby: all audio drivers default to 48000hz instead of 22050hz now if
no frequency is assigned
- note: the WASAPI driver can default to whatever the native frequency
is; doesn't have to be 48000hz
- tomoko: removed the ability to change the frequency from the UI (but
it will display the frequency used)
- tomoko: removed the timing settings panel
- the goal is to work toward smooth video via adaptive sync
- the model is broken by not being in control of the audio frequency
anyway
- it's further broken by PAL running at 50hz and WSC running at 75hz
- it was always broken anyway by SNES interlace timing varying from
progressive timing
- higan: audio/ stub created (for now, it's just nall/dsp/ moved here
and included as a header)
- higan: video/ stub created
- higan/GNUmakefile: now includes build rules for essential components
(libco, emulator, audio, video)
The audio changes are in preparation to merge wareya's awesome WASAPI
work without the need for the nall/dsp resampler.
2016-04-09 03:40:12 +00:00
|
|
|
dsp.setResamplerFrequency(audio->get(Audio::Frequency).get<uint>());
|
2015-11-16 08:38:05 +00:00
|
|
|
updateAudioVolume();
|
2015-06-15 22:26:47 +00:00
|
|
|
updateDSP();
|
|
|
|
}
|
|
|
|
|
2015-11-16 08:38:05 +00:00
|
|
|
auto Program::updateAudioVolume() -> void {
|
|
|
|
dsp.setVolume(settings["Audio/Mute"].boolean() ? 0.0 : settings["Audio/Volume"].natural() * 0.01);
|
|
|
|
}
|
|
|
|
|
2015-06-15 22:26:47 +00:00
|
|
|
auto Program::updateDSP() -> void {
|
|
|
|
if(!emulator) return;
|
Update to v098r01 release.
byuu says:
Changelog:
- SFC: balanced profile removed
- SFC: performance profile removed
- SFC: code for handling non-threaded CPU, SMP, DSP, PPU removed
- SFC: Coprocessor, Controller (and expansion port) shared Thread code
merged to SFC::Cothread
- Cothread here just means "Thread with CPU affinity" (couldn't think
of a better name, sorry)
- SFC: CPU now has vector<Thread*> coprocessors, peripherals;
- this is the beginning of work to allow expansion port devices to be
dynamically changed at run-time
- ruby: all audio drivers default to 48000hz instead of 22050hz now if
no frequency is assigned
- note: the WASAPI driver can default to whatever the native frequency
is; doesn't have to be 48000hz
- tomoko: removed the ability to change the frequency from the UI (but
it will display the frequency used)
- tomoko: removed the timing settings panel
- the goal is to work toward smooth video via adaptive sync
- the model is broken by not being in control of the audio frequency
anyway
- it's further broken by PAL running at 50hz and WSC running at 75hz
- it was always broken anyway by SNES interlace timing varying from
progressive timing
- higan: audio/ stub created (for now, it's just nall/dsp/ moved here
and included as a header)
- higan: video/ stub created
- higan/GNUmakefile: now includes build rules for essential components
(libco, emulator, audio, video)
The audio changes are in preparation to merge wareya's awesome WASAPI
work without the need for the nall/dsp resampler.
2016-04-09 03:40:12 +00:00
|
|
|
return dsp.setFrequency(emulator->audioFrequency());
|
2015-06-15 22:26:47 +00:00
|
|
|
}
|