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");
|
|
|
|
}
|
|
|
|
|
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";
|
2015-04-21 11:51:57 +00:00
|
|
|
} else if(pause) {
|
2015-04-13 11:16:33 +00:00
|
|
|
text = "Paused";
|
|
|
|
} else {
|
|
|
|
text = statusText;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(text != presentation->statusBar.text()) {
|
|
|
|
presentation->statusBar.setText(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
auto Program::updateVideoFilter() -> void {
|
2015-11-08 08:54:42 +00:00
|
|
|
if(config->video.driver == "OpenGL" && config->video.shader != "None" && directory::exists(config->video.shader)) {
|
|
|
|
video->set(Video::Filter, Video::FilterNearest);
|
|
|
|
video->set(Video::Shader, (string)config->video.shader);
|
|
|
|
} else {
|
|
|
|
video->set(Video::Filter, config->video.filter == "Blur" ? Video::FilterLinear : Video::FilterNearest);
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::updateVideoPalette() -> void {
|
2015-04-21 11:51:57 +00:00
|
|
|
if(!emulator) return;
|
2015-06-15 22:26:47 +00:00
|
|
|
emulator->paletteUpdate(config->video.colorEmulation
|
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
|
|
|
? Emulator::Interface::PaletteMode::Emulation
|
|
|
|
: Emulator::Interface::PaletteMode::Standard
|
|
|
|
);
|
|
|
|
}
|
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();
|
2015-06-20 05:44:05 +00:00
|
|
|
audio->set(Audio::Frequency, config->audio.frequency);
|
|
|
|
audio->set(Audio::Latency, config->audio.latency);
|
2015-06-15 22:26:47 +00:00
|
|
|
if(auto resampler = config->audio.resampler) {
|
|
|
|
if(resampler == "Linear" ) dsp.setResampler(DSP::ResampleEngine::Linear);
|
|
|
|
if(resampler == "Hermite") dsp.setResampler(DSP::ResampleEngine::Hermite);
|
|
|
|
if(resampler == "Sinc" ) dsp.setResampler(DSP::ResampleEngine::Sinc);
|
|
|
|
}
|
|
|
|
dsp.setResamplerFrequency(config->audio.frequency);
|
|
|
|
dsp.setVolume(config->audio.mute ? 0.0 : config->audio.volume * 0.01);
|
|
|
|
updateDSP();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Program::updateDSP() -> void {
|
|
|
|
if(!emulator) return;
|
|
|
|
if(!config->video.synchronize) return dsp.setFrequency(emulator->audioFrequency());
|
|
|
|
|
|
|
|
double inputRatio = emulator->audioFrequency() / emulator->videoFrequency();
|
|
|
|
double outputRatio = config->timing.audio / config->timing.video;
|
|
|
|
dsp.setFrequency(inputRatio / outputRatio * config->audio.frequency);
|
|
|
|
}
|