From 5f63a1a04ae98a338bc6b0d6030a763891d1aa5b Mon Sep 17 00:00:00 2001 From: xkiv Date: Tue, 25 Nov 2008 12:11:12 +0000 Subject: [PATCH] fixed an off-by-one countdown mistake in my previous commit git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@803 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/sdl/inputSDL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sdl/inputSDL.cpp b/src/sdl/inputSDL.cpp index 9e27f116..7457c4b0 100644 --- a/src/sdl/inputSDL.cpp +++ b/src/sdl/inputSDL.cpp @@ -535,11 +535,13 @@ uint32_t inputReadJoypad(int which) res &= (~realAutoFire); if(autoFireToggle) res |= realAutoFire; + autoFireCountdown--; // this needs decrementing even when autoFireToggle is toggled, + // so that autoFireMaxCount==1 (the default) will alternate at the maximum possible + // frequency (every time this code is reached). Which is what it did before + // introducing autoFireCountdown. if (autoFireCountdown <= 0) { autoFireToggle = !autoFireToggle; autoFireCountdown = autoFireMaxCount; - } else { - autoFireCountdown--; } }