UI: Set maximum emulation speeds to 5000%

This commit is contained in:
Souryo 2017-09-03 10:54:31 -04:00
parent 6d99d6e2d4
commit d44b690464
4 changed files with 26 additions and 12 deletions

View File

@ -11,6 +11,8 @@ uint8_t EmulationSettings::_versionRevision = 2;
Language EmulationSettings::_displayLanguage = Language::English;
const vector<uint32_t> EmulationSettings::_speedValues = { { 1, 3, 6, 12, 25, 50, 75, 100, 150, 200, 250, 300, 350, 400, 450, 500, 750, 1000, 2000, 4000 } };
SimpleLock EmulationSettings::_lock;
uint64_t EmulationSettings::_flags = 0;

View File

@ -370,6 +370,8 @@ private:
static uint8_t _versionMinor;
static uint8_t _versionRevision;
static const vector<uint32_t> _speedValues;
static uint32_t _ppuPaletteArgb[11][64];
static uint32_t _defaultPpuPalette[64];
static uint32_t _currentPalette[64];
@ -700,19 +702,29 @@ public:
static void IncreaseEmulationSpeed()
{
if(_emulationSpeed > 0 && _emulationSpeed < 450) {
EmulationSettings::SetEmulationSpeed(_emulationSpeed + (_emulationSpeed < 100 ? 25 : 50), true);
} else {
if(_emulationSpeed == _speedValues.back()) {
EmulationSettings::SetEmulationSpeed(0, true);
} else if(_emulationSpeed != 0) {
for(size_t i = 0; i < _speedValues.size(); i++) {
if(_speedValues[i] > _emulationSpeed) {
EmulationSettings::SetEmulationSpeed(_speedValues[i], true);
break;
}
}
}
}
static void DecreaseEmulationSpeed()
{
if(_emulationSpeed == 0) {
EmulationSettings::SetEmulationSpeed(450, true);
} else if(_emulationSpeed > 25) {
EmulationSettings::SetEmulationSpeed(_emulationSpeed - (_emulationSpeed <= 100 ? 25 : 50), true);
EmulationSettings::SetEmulationSpeed(_speedValues.back(), true);
} else if(_emulationSpeed > _speedValues.front()) {
for(size_t i = _speedValues.size() - 1; i >= 0; i--) {
if(_speedValues[i] < _emulationSpeed) {
EmulationSettings::SetEmulationSpeed(_speedValues[i], true);
break;
}
}
}
}

View File

@ -36,9 +36,9 @@ namespace Mesen.GUI.Config
public bool ShowLagCounter = false;
[MinMax(0, 500)] public UInt32 EmulationSpeed = 100;
[MinMax(0, 500)] public UInt32 TurboSpeed = 300;
[MinMax(0, 500)] public UInt32 RewindSpeed = 100;
[MinMax(0, 5000)] public UInt32 EmulationSpeed = 100;
[MinMax(0, 5000)] public UInt32 TurboSpeed = 300;
[MinMax(0, 5000)] public UInt32 RewindSpeed = 100;
public EmulationInfo()
{

View File

@ -183,7 +183,7 @@ namespace Mesen.GUI.Forms.Config
//
this.nudTurboSpeed.Location = new System.Drawing.Point(3, 3);
this.nudTurboSpeed.Maximum = new decimal(new int[] {
500,
5000,
0,
0,
0});
@ -227,7 +227,7 @@ namespace Mesen.GUI.Forms.Config
//
this.nudEmulationSpeed.Location = new System.Drawing.Point(3, 3);
this.nudEmulationSpeed.Maximum = new decimal(new int[] {
500,
5000,
0,
0,
0});
@ -281,7 +281,7 @@ namespace Mesen.GUI.Forms.Config
//
this.nudRewindSpeed.Location = new System.Drawing.Point(3, 3);
this.nudRewindSpeed.Maximum = new decimal(new int[] {
500,
5000,
0,
0,
0});