Avoid override of variable `throttle` for turbo.
It is not needed to set `throttle` on neither case. There is actually a bug when using turbo/speedup and closing the emulator. The test case is the following: https://github.com/visualboyadvance-m/visualboyadvance-m/issues/627 On Windows: 1. use opengl; 2. load GBA game; 3. set throttle to `100%`; 4. set turbo throttle to `200%`; 5. enable turbo on menu; 6. save game; 7. close emulator && open emulator; 8. load GBA game; ==> throttle is `200%`. This is definitely not expected.
This commit is contained in:
parent
bd2483cae7
commit
6b257d52f2
|
@ -4953,7 +4953,7 @@ void gbEmulate(int ticksToStop)
|
|||
if (turbo_button_pressed) {
|
||||
if (!speedup_throttle_set && throttle != speedup_throttle) {
|
||||
last_throttle = throttle;
|
||||
throttle = speedup_throttle;
|
||||
//throttle = speedup_throttle;
|
||||
soundSetThrottle(speedup_throttle);
|
||||
speedup_throttle_set = true;
|
||||
}
|
||||
|
@ -4970,7 +4970,7 @@ void gbEmulate(int ticksToStop)
|
|||
framesToSkip = speedup_frame_skip;
|
||||
}
|
||||
else if (speedup_throttle_set) {
|
||||
throttle = last_throttle;
|
||||
//throttle = last_throttle;
|
||||
soundSetThrottle(last_throttle);
|
||||
|
||||
speedup_throttle_set = false;
|
||||
|
|
|
@ -3799,7 +3799,7 @@ void CPULoop(int ticks)
|
|||
if (turbo_button_pressed) {
|
||||
if (!speedup_throttle_set && throttle != speedup_throttle) {
|
||||
last_throttle = throttle;
|
||||
throttle = speedup_throttle;
|
||||
//throttle = speedup_throttle;
|
||||
soundSetThrottle(speedup_throttle);
|
||||
speedup_throttle_set = true;
|
||||
}
|
||||
|
@ -3816,7 +3816,7 @@ void CPULoop(int ticks)
|
|||
framesToSkip = speedup_frame_skip;
|
||||
}
|
||||
else if (speedup_throttle_set) {
|
||||
throttle = last_throttle;
|
||||
//throttle = last_throttle;
|
||||
soundSetThrottle(last_throttle);
|
||||
|
||||
speedup_throttle_set = false;
|
||||
|
|
Loading…
Reference in New Issue