fixed palette and custom BLARGG settings saving (see #787)

This commit is contained in:
thrust26 2021-04-12 22:38:41 +02:00
parent df7cb5639a
commit 6bd4987b22
2 changed files with 22 additions and 25 deletions

View File

@ -1066,14 +1066,6 @@ void FrameBuffer::saveConfig(Settings& settings) const
{ {
// Save the last windowed position and display on system shutdown // Save the last windowed position and display on system shutdown
saveCurrentWindowPosition(); saveCurrentWindowPosition();
if(myTIASurface)
{
Logger::debug("Saving TV effects options ...");
tiaSurface().ntsc().saveConfig(settings);
Logger::debug("Saving palette settings...");
tiaSurface().paletteHandler().saveConfig(settings);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -682,46 +682,47 @@ void VideoAudioDialog::updateSettingsWithPreset(AudioSettings& audioSettings)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void VideoAudioDialog::saveConfig() void VideoAudioDialog::saveConfig()
{ {
Settings& settings = instance().settings();
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Display tab // Display tab
// Renderer setting // Renderer setting
instance().settings().setValue("video", settings.setValue("video", myRenderer->getSelectedTag().toString());
myRenderer->getSelectedTag().toString());
// TIA interpolation // TIA interpolation
instance().settings().setValue("tia.inter", myTIAInterpolate->getState()); settings.setValue("tia.inter", myTIAInterpolate->getState());
// Fullscreen // Fullscreen
instance().settings().setValue("fullscreen", myFullscreen->getState()); settings.setValue("fullscreen", myFullscreen->getState());
// Fullscreen stretch setting // Fullscreen stretch setting
instance().settings().setValue("tia.fs_stretch", myUseStretch->getState()); settings.setValue("tia.fs_stretch", myUseStretch->getState());
#ifdef ADAPTABLE_REFRESH_SUPPORT #ifdef ADAPTABLE_REFRESH_SUPPORT
// Adapt refresh rate // Adapt refresh rate
instance().settings().setValue("tia.fs_refresh", myRefreshAdapt->getState()); settings.setValue("tia.fs_refresh", myRefreshAdapt->getState());
#endif #endif
// Fullscreen overscan // Fullscreen overscan
instance().settings().setValue("tia.fs_overscan", myTVOverscan->getValueLabel()); settings.setValue("tia.fs_overscan", myTVOverscan->getValueLabel());
// TIA zoom levels // TIA zoom levels
instance().settings().setValue("tia.zoom", myTIAZoom->getValue() / 100.0); settings.setValue("tia.zoom", myTIAZoom->getValue() / 100.0);
// Aspect ratio correction // Aspect ratio correction
instance().settings().setValue("tia.correct_aspect", myCorrectAspect->getState()); settings.setValue("tia.correct_aspect", myCorrectAspect->getState());
// Aspect ratio setting (NTSC and PAL) // Aspect ratio setting (NTSC and PAL)
const int oldAdjust = instance().settings().getInt("tia.vsizeadjust"); const int oldAdjust = settings.getInt("tia.vsizeadjust");
const int newAdjust = myVSizeAdjust->getValue(); const int newAdjust = myVSizeAdjust->getValue();
const bool vsizeChanged = oldAdjust != newAdjust; const bool vsizeChanged = oldAdjust != newAdjust;
instance().settings().setValue("tia.vsizeadjust", newAdjust); settings.setValue("tia.vsizeadjust", newAdjust);
Logger::debug("Saving palette settings...");
// Note: Palette values are saved directly when changed! instance().frameBuffer().tiaSurface().paletteHandler().saveConfig(settings);
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// TV Effects tab // TV Effects tab
// TV Mode // TV Mode
instance().settings().setValue("tv.filter", settings.setValue("tv.filter",
myTVMode->getSelectedTag().toString()); myTVMode->getSelectedTag().toString());
// TV Custom adjustables // TV Custom adjustables
NTSCFilter::Adjustable ntscAdj; NTSCFilter::Adjustable ntscAdj;
@ -732,15 +733,19 @@ void VideoAudioDialog::saveConfig()
ntscAdj.bleed = myTVBleed->getValue(); ntscAdj.bleed = myTVBleed->getValue();
instance().frameBuffer().tiaSurface().ntsc().setCustomAdjustables(ntscAdj); instance().frameBuffer().tiaSurface().ntsc().setCustomAdjustables(ntscAdj);
Logger::debug("Saving TV effects options ...");
instance().frameBuffer().tiaSurface().ntsc().saveConfig(settings);
// TV phosphor mode // TV phosphor mode
instance().settings().setValue("tv.phosphor", settings.setValue("tv.phosphor",
myTVPhosphor->getState() ? "always" : "byrom"); myTVPhosphor->getState() ? "always" : "byrom");
// TV phosphor blend // TV phosphor blend
instance().settings().setValue("tv.phosblend", myTVPhosLevel->getValueLabel() == "Off" settings.setValue("tv.phosblend", myTVPhosLevel->getValueLabel() == "Off"
? "0" : myTVPhosLevel->getValueLabel()); ? "0" : myTVPhosLevel->getValueLabel());
// TV scanline intensity // TV scanline intensity
instance().settings().setValue("tv.scanlines", myTVScanIntense->getValueLabel()); settings.setValue("tv.scanlines", myTVScanIntense->getValueLabel());
if(instance().hasConsole()) if(instance().hasConsole())
{ {