Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mode presets for accuracy and performance mode to simplify enhancements settings #158

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions bsnes/target-bsnes/settings/enhancements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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();
});
}
13 changes: 10 additions & 3 deletions bsnes/target-bsnes/settings/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}};
Expand Down Expand Up @@ -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 {
Expand Down