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
This commit is contained in:
xkiv 2008-11-25 12:11:12 +00:00
parent 72e033ba19
commit 5f63a1a04a
1 changed files with 4 additions and 2 deletions

View File

@ -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--;
}
}