diff --git a/bsnes/target-bsnes/settings/enhancements.cpp b/bsnes/target-bsnes/settings/enhancements.cpp index d3ed73dff..372c8e33c 100644 --- a/bsnes/target-bsnes/settings/enhancements.cpp +++ b/bsnes/target-bsnes/settings/enhancements.cpp @@ -50,7 +50,7 @@ auto EnhancementSettings::create() -> void { emulator->configure("Hacks/SuperFX/Overclock", settings.emulator.hack.superfx.overclock); sfxValue.setText({settings.emulator.hack.superfx.overclock, "%"}); }).doChange(); - + note.setText("Note: Overclocking will break games, cause bugs and reduce performance."); overclockingSpacer.setColor({192, 192, 192}); ppuLabel.setText("PPU (video)").setFont(Font().setBold()); @@ -133,6 +133,54 @@ auto EnhancementSettings::create() -> void { }).setChecked(settings.emulator.hack.hotfixes).onToggle([&] { settings.emulator.hack.hotfixes = hotfixes.checked(); }); + hotfixesSpacer.setColor({192, 192, 192}); + + ppuModeLabel.setText("Mode Presets:").setFont(Font().setBold()); + ppuModeRequirements.setText( + "Accuracy Mode: Maximum hardware accuracy, disables performance shortcuts and all enhancements.\n" + "Performance Mode: Best compromise between hardware accuracy and performance." + ); + accuracyMode.setText("Accuracy Mode").onActivate([&] { + runAhead0.setChecked(); settings.emulator.runAhead.frames = 0; + cpuClock.setPosition(0).doChange(); + sa1Clock.setPosition(0).doChange(); + sfxClock.setPosition(0).doChange(); + fastPPU.setChecked(false).doToggle(); + fastDSP.setChecked(false).doToggle(); + cubicInterpolation.setChecked(false).doToggle(); + coprocessorDelayedSyncOption.setChecked(false).doToggle(); + coprocessorPreferHLEOption.setChecked(false).doToggle(); + hotfixes.setChecked(false).doToggle(); + + if(!emulator->loaded()) return; + MessageDialog().setAlignment(settingsWindow).setTitle("Success").setText({ + "Accuracy Mode applied.\n" + "You must reload the game in order for all changes to take effect." + }).information(); + }); + + performanceMode.setText("Performance Mode").onActivate([&] { + runAhead0.setChecked(); settings.emulator.runAhead.frames = 0; + cpuClock.setPosition(0).doChange(); + sa1Clock.setPosition(0).doChange(); + sfxClock.setPosition(0).doChange(); + fastPPU.setChecked(true).doToggle(); + deinterlace.setChecked(true).doToggle(); + noSpriteLimit.setChecked(false).doToggle(); + mode7Scale.item(0).setSelected(); emulator->configure("Hacks/PPU/Mode7/Scale", settings.emulator.hack.ppu.mode7.scale = 1); + mode7Perspective.setChecked(true).doToggle(); + mode7Supersample.setChecked(false).doToggle(); + mode7Mosaic.setChecked(true).doToggle(); + fastDSP.setChecked(true).doToggle(); + cubicInterpolation.setChecked(false).doToggle(); + coprocessorDelayedSyncOption.setChecked(true).doToggle(); + coprocessorPreferHLEOption.setChecked(false).doToggle(); + hotfixes.setChecked(true).doToggle(); - note.setText("Note: some settings do not take effect until after reloading games."); + if(!emulator->loaded()) return; + MessageDialog().setAlignment(settingsWindow).setTitle("Success").setText({ + "Performance Mode applied.\n" + "You must reload the game in order for all changes to take effect." + }).information(); + }); } diff --git a/bsnes/target-bsnes/settings/settings.hpp b/bsnes/target-bsnes/settings/settings.hpp index 5108352d5..1f2089466 100644 --- a/bsnes/target-bsnes/settings/settings.hpp +++ b/bsnes/target-bsnes/settings/settings.hpp @@ -349,6 +349,9 @@ struct EnhancementSettings : VerticalLayout { Label cpuLabel{&overclockingLayout, Size{0, 0}}; Label cpuValue{&overclockingLayout, Size{50_sx, 0}}; HorizontalSlider cpuClock{&overclockingLayout, Size{~0, 0}}; + // + Widget spacer{this, Size{~0, ~0}}; + Label note{this, Size{~0, 0}}; Canvas overclockingSpacer{this, Size{~0, 1}}; // Label sa1Label{&overclockingLayout, Size{0, 0}}; @@ -385,10 +388,14 @@ struct EnhancementSettings : VerticalLayout { Canvas coprocessorSpacer{this, Size{~0, 1}}; // Label gameLabel{this, Size{~0, 0}, 2}; - CheckLabel hotfixes{this, Size{0, 0}}; + CheckLabel hotfixes{this, Size{0, 0}}; + Canvas hotfixesSpacer{this, Size{~0, 1}}; // - Widget spacer{this, Size{~0, ~0}}; - Label note{this, Size{~0, 0}}; + Label ppuModeLabel{this, Size{~0, 0}, 0}; + Label ppuModeRequirements{this, Size{~0, 0}}; + HorizontalLayout modeLayout{this, Size{~0, 0}}; + Button accuracyMode{&modeLayout, Size{0, 0}}; + Button performanceMode{&modeLayout, Size{0, 0}}; }; struct CompatibilitySettings : VerticalLayout {