From f7e4d83fb0986c11404b6527543c10aac65f53b0 Mon Sep 17 00:00:00 2001 From: bsnesFan <79463574+bsnesFan@users.noreply.github.com> Date: Sat, 25 Sep 2021 00:16:45 +0200 Subject: [PATCH 1/2] Update enhancements.cpp --- bsnes/target-bsnes/settings/enhancements.cpp | 53 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/bsnes/target-bsnes/settings/enhancements.cpp b/bsnes/target-bsnes/settings/enhancements.cpp index d3ed73dff..ce70830f9 100644 --- a/bsnes/target-bsnes/settings/enhancements.cpp +++ b/bsnes/target-bsnes/settings/enhancements.cpp @@ -25,7 +25,7 @@ auto EnhancementSettings::create() -> void { if(settings.emulator.runAhead.frames == 4) runAhead4.setChecked(); runAheadSpacer.setColor({192, 192, 192}); - overclockingLabel.setText("Overclocking").setFont(Font().setBold()); + overclockingLabel.setText("Overclocking (this will break games, cause bugs and reduce performance!)").setFont(Font().setBold()); overclockingLayout.setSize({3, 3}); overclockingLayout.column(0).setAlignment(1.0); overclockingLayout.column(1).setAlignment(0.5); @@ -124,7 +124,6 @@ auto EnhancementSettings::create() -> void { ).onToggle([&] { settings.emulator.hack.coprocessor.preferHLE = coprocessorPreferHLEOption.checked(); }); - coprocessorSpacer.setColor({192, 192, 192}); gameLabel.setText("Game Enhancements").setFont(Font().setBold()); hotfixes.setText("Hotfixes").setToolTip({ @@ -133,6 +132,54 @@ auto EnhancementSettings::create() -> void { }).setChecked(settings.emulator.hack.hotfixes).onToggle([&] { settings.emulator.hack.hotfixes = hotfixes.checked(); }); + hotfixesSpacer.setColor({192, 192, 192}); - note.setText("Note: some settings do not take effect until after reloading games."); + ppuModeLabel.setText("Mode Presets:").setFont(Font().setBold()); + ppuModeRequirements.setText( + "Accuracy Mode: Maximum hardware accuracy, but PPUs timings aren't 100% correct yet.\n" + "Compatibility Mode: Most compatible way to play games paired with good performance. [Recommended]" + ); + 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" + "Reload the game in order for all changes to take effect." + }).information(); + }); + + compatibilityMode.setText("Compatibility 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(false).doToggle(); + cubicInterpolation.setChecked(false).doToggle(); + coprocessorDelayedSyncOption.setChecked(false).doToggle(); + coprocessorPreferHLEOption.setChecked(false).doToggle(); + hotfixes.setChecked(true).doToggle(); + + if(!emulator->loaded()) return; + MessageDialog().setAlignment(settingsWindow).setTitle("Success").setText({ + "Compatibility Mode applied.\n" + "Reload the game in order for all changes to take effect." + }).information(); + }); } From 029c3e51cd9f7be1416c376cef9e03821052225c Mon Sep 17 00:00:00 2001 From: bsnesFan <79463574+bsnesFan@users.noreply.github.com> Date: Sat, 25 Sep 2021 00:17:25 +0200 Subject: [PATCH 2/2] Update settings.hpp --- bsnes/target-bsnes/settings/settings.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bsnes/target-bsnes/settings/settings.hpp b/bsnes/target-bsnes/settings/settings.hpp index 5108352d5..7ac338d75 100644 --- a/bsnes/target-bsnes/settings/settings.hpp +++ b/bsnes/target-bsnes/settings/settings.hpp @@ -382,13 +382,16 @@ struct EnhancementSettings : VerticalLayout { HorizontalLayout coprocessorLayout{this, Size{~0, 0}}; CheckLabel coprocessorDelayedSyncOption{&coprocessorLayout, Size{0, 0}}; CheckLabel coprocessorPreferHLEOption{&coprocessorLayout, Size{0, 0}}; - 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 compatibilityMode{&modeLayout, Size{0, 0}}; }; struct CompatibilitySettings : VerticalLayout {