Fix under clock speed (Should have been 0.5, but ended up as ~0.4 due to rounding errors)

This commit is contained in:
Lior Halphon 2019-06-19 22:25:59 +03:00
parent 431f1f8199
commit 280f609785
2 changed files with 4 additions and 4 deletions

View File

@ -148,11 +148,11 @@
- (void) flip
{
if (underclockKeyDown && clockMultiplier > 0.5) {
clockMultiplier -= 0.1;
clockMultiplier -= 1.0/16;
GB_set_clock_multiplier(_gb, clockMultiplier);
}
if (!underclockKeyDown && clockMultiplier < 1.0) {
clockMultiplier += 0.1;
clockMultiplier += 1.0/16;
GB_set_clock_multiplier(_gb, clockMultiplier);
}
current_buffer = (current_buffer + 1) % self.numberOfBuffers;

View File

@ -318,11 +318,11 @@ static void handle_events(GB_gameboy_t *gb)
static void vblank(GB_gameboy_t *gb)
{
if (underclock_down && clock_mutliplier > 0.5) {
clock_mutliplier -= 0.1;
clock_mutliplier -= 1.0/16;
GB_set_clock_multiplier(gb, clock_mutliplier);
}
else if (!underclock_down && clock_mutliplier < 1.0) {
clock_mutliplier += 0.1;
clock_mutliplier += 1.0/16;
GB_set_clock_multiplier(gb, clock_mutliplier);
}
if (configuration.blend_frames) {