mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-22 20:42:50 +02:00
Added entropy setting (none, low, high) to settings->emulator
This commit is contained in:
@@ -16,6 +16,7 @@ auto Configuration::process(Markup::Node document, bool load) -> void {
|
|||||||
bind(boolean, "Video/BlurEmulation", video.blurEmulation);
|
bind(boolean, "Video/BlurEmulation", video.blurEmulation);
|
||||||
bind(boolean, "Video/ColorEmulation", video.colorEmulation);
|
bind(boolean, "Video/ColorEmulation", video.colorEmulation);
|
||||||
|
|
||||||
|
bind(text, "Hacks/Entropy", hacks.entropy);
|
||||||
bind(natural, "Hacks/CPU/Overclock", hacks.cpu.overclock);
|
bind(natural, "Hacks/CPU/Overclock", hacks.cpu.overclock);
|
||||||
bind(boolean, "Hacks/PPU/Fast", hacks.ppu.fast);
|
bind(boolean, "Hacks/PPU/Fast", hacks.ppu.fast);
|
||||||
bind(boolean, "Hacks/PPU/Deinterlace", hacks.ppu.deinterlace);
|
bind(boolean, "Hacks/PPU/Deinterlace", hacks.ppu.deinterlace);
|
||||||
|
@@ -25,6 +25,7 @@ struct Configuration {
|
|||||||
} video;
|
} video;
|
||||||
|
|
||||||
struct Hacks {
|
struct Hacks {
|
||||||
|
string entropy = "Low";
|
||||||
struct CPU {
|
struct CPU {
|
||||||
uint overclock = 100;
|
uint overclock = 100;
|
||||||
} cpu;
|
} cpu;
|
||||||
|
@@ -109,7 +109,10 @@ auto System::power(bool reset) -> void {
|
|||||||
|
|
||||||
Emulator::audio.reset(interface);
|
Emulator::audio.reset(interface);
|
||||||
|
|
||||||
random.entropy(Random::Entropy::Low);
|
random.entropy(Random::Entropy::Low); //fallback case
|
||||||
|
if(configuration.hacks.entropy == "None") random.entropy(Random::Entropy::None);
|
||||||
|
if(configuration.hacks.entropy == "Low" ) random.entropy(Random::Entropy::Low );
|
||||||
|
if(configuration.hacks.entropy == "High") random.entropy(Random::Entropy::High);
|
||||||
|
|
||||||
cpu.power(reset);
|
cpu.power(reset);
|
||||||
smp.power(reset);
|
smp.power(reset);
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
auto Program::load() -> void {
|
auto Program::load() -> void {
|
||||||
unload();
|
unload();
|
||||||
|
|
||||||
|
emulator->configure("Hacks/Entropy", settings.emulator.hack.entropy);
|
||||||
emulator->configure("Hacks/CPU/Overclock", settings.emulator.hack.cpu.overclock);
|
emulator->configure("Hacks/CPU/Overclock", settings.emulator.hack.cpu.overclock);
|
||||||
emulator->configure("Hacks/PPU/Fast", settings.emulator.hack.ppu.fast);
|
emulator->configure("Hacks/PPU/Fast", settings.emulator.hack.ppu.fast);
|
||||||
emulator->configure("Hacks/PPU/Deinterlace", settings.emulator.hack.ppu.deinterlace);
|
emulator->configure("Hacks/PPU/Deinterlace", settings.emulator.hack.ppu.deinterlace);
|
||||||
|
@@ -22,6 +22,29 @@ auto EmulatorSettings::create() -> void {
|
|||||||
});
|
});
|
||||||
optionsSpacer.setColor({192, 192, 192});
|
optionsSpacer.setColor({192, 192, 192});
|
||||||
|
|
||||||
|
entropyLabel.setText("Entropy (randomness)").setFont(Font().setBold());
|
||||||
|
entropyNone.setText("None").setToolTip(
|
||||||
|
"All memory and registers are initialized to constant values at startup.\n"
|
||||||
|
"Use this for movie recording and compatibility with very old demoscene homebrew games."
|
||||||
|
).onActivate([&] {
|
||||||
|
settings.emulator.hack.entropy = "None";
|
||||||
|
});
|
||||||
|
entropyLow.setText("Low").setToolTip(
|
||||||
|
"All memory is randomized with repeating patterns, all registers are randomized at startup.\n"
|
||||||
|
"Use this for the most accurate representation of a real SNES."
|
||||||
|
).onActivate([&] {
|
||||||
|
settings.emulator.hack.entropy = "Low";
|
||||||
|
});
|
||||||
|
entropyHigh.setText("High").setToolTip(
|
||||||
|
"All memory and registers are randomized as much as possible.\n"
|
||||||
|
"Use this when developing new SNES software to ensure maximum compatibility with real hardware."
|
||||||
|
).onActivate([&] {
|
||||||
|
settings.emulator.hack.entropy = "High";
|
||||||
|
});
|
||||||
|
if(settings.emulator.hack.entropy == "None") entropyNone.setChecked();
|
||||||
|
if(settings.emulator.hack.entropy == "Low") entropyLow.setChecked();
|
||||||
|
if(settings.emulator.hack.entropy == "High") entropyHigh.setChecked();
|
||||||
|
|
||||||
ppuLabel.setText("PPU (video)").setFont(Font().setBold());
|
ppuLabel.setText("PPU (video)").setFont(Font().setBold());
|
||||||
fastPPU.setText("Fast mode").setChecked(settings.emulator.hack.ppu.fast).onToggle([&] {
|
fastPPU.setText("Fast mode").setChecked(settings.emulator.hack.ppu.fast).onToggle([&] {
|
||||||
settings.emulator.hack.ppu.fast = fastPPU.checked();
|
settings.emulator.hack.ppu.fast = fastPPU.checked();
|
||||||
|
@@ -112,6 +112,7 @@ auto Settings::process(bool load) -> void {
|
|||||||
bind(natural, "Emulator/AutoSaveMemory/Interval", emulator.autoSaveMemory.interval);
|
bind(natural, "Emulator/AutoSaveMemory/Interval", emulator.autoSaveMemory.interval);
|
||||||
bind(boolean, "Emulator/AutoSaveStateOnUnload", emulator.autoSaveStateOnUnload);
|
bind(boolean, "Emulator/AutoSaveStateOnUnload", emulator.autoSaveStateOnUnload);
|
||||||
bind(boolean, "Emulator/AutoLoadStateOnLoad", emulator.autoLoadStateOnLoad);
|
bind(boolean, "Emulator/AutoLoadStateOnLoad", emulator.autoLoadStateOnLoad);
|
||||||
|
bind(text, "Emulator/Hack/Entropy", emulator.hack.entropy);
|
||||||
bind(natural, "Emulator/Hack/CPU/Overclock", emulator.hack.cpu.overclock);
|
bind(natural, "Emulator/Hack/CPU/Overclock", emulator.hack.cpu.overclock);
|
||||||
bind(boolean, "Emulator/Hack/PPU/Fast", emulator.hack.ppu.fast);
|
bind(boolean, "Emulator/Hack/PPU/Fast", emulator.hack.ppu.fast);
|
||||||
bind(boolean, "Emulator/Hack/PPU/Deinterlace", emulator.hack.ppu.deinterlace);
|
bind(boolean, "Emulator/Hack/PPU/Deinterlace", emulator.hack.ppu.deinterlace);
|
||||||
|
@@ -95,6 +95,7 @@ struct Settings : Markup::Node {
|
|||||||
bool autoSaveStateOnUnload = false;
|
bool autoSaveStateOnUnload = false;
|
||||||
bool autoLoadStateOnLoad = false;
|
bool autoLoadStateOnLoad = false;
|
||||||
struct Hack {
|
struct Hack {
|
||||||
|
string entropy = "Low";
|
||||||
struct CPU {
|
struct CPU {
|
||||||
uint overclock = 100;
|
uint overclock = 100;
|
||||||
} cpu;
|
} cpu;
|
||||||
@@ -331,6 +332,12 @@ public:
|
|||||||
CheckLabel autoSaveStateOnUnload{&autoStateLayout, Size{0, 0}};
|
CheckLabel autoSaveStateOnUnload{&autoStateLayout, Size{0, 0}};
|
||||||
CheckLabel autoLoadStateOnLoad{&autoStateLayout, Size{0, 0}};
|
CheckLabel autoLoadStateOnLoad{&autoStateLayout, Size{0, 0}};
|
||||||
Canvas optionsSpacer{this, Size{~0, 1}};
|
Canvas optionsSpacer{this, Size{~0, 1}};
|
||||||
|
Label entropyLabel{this, Size{~0, 0}, 2};
|
||||||
|
HorizontalLayout entropyLayout{this, Size{~0, 0}};
|
||||||
|
RadioLabel entropyNone{&entropyLayout, Size{0, 0}};
|
||||||
|
RadioLabel entropyLow{&entropyLayout, Size{0, 0}};
|
||||||
|
RadioLabel entropyHigh{&entropyLayout, Size{0, 0}};
|
||||||
|
Group entropyGroup{&entropyNone, &entropyLow, &entropyHigh};
|
||||||
Label ppuLabel{this, Size{~0, 0}, 2};
|
Label ppuLabel{this, Size{~0, 0}, 2};
|
||||||
HorizontalLayout ppuLayout{this, Size{~0, 0}};
|
HorizontalLayout ppuLayout{this, Size{~0, 0}};
|
||||||
CheckLabel fastPPU{&ppuLayout, Size{0, 0}};
|
CheckLabel fastPPU{&ppuLayout, Size{0, 0}};
|
||||||
|
Reference in New Issue
Block a user