aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Teh2022-02-22 23:01:27 +0000
committerJonathan Teh2022-02-22 23:05:46 +0000
commit09334d546982a354ccf73e64966191aac2d22083 (patch)
tree0fc9fbe5da98be0056e797bfa52d15afd2b99b0f
parent01564ac5d9d7a6b910c6d2b4389cdf9076044787 (diff)
downloadsnes9x2005-09334d546982a354ccf73e64966191aac2d22083.tar.gz
snes9x2005-09334d546982a354ccf73e64966191aac2d22083.tar.bz2
snes9x2005-09334d546982a354ccf73e64966191aac2d22083.zip
gfx: Use simpler equality test for IPPU.FrameCount
As it's only incremented here and then reset to 0, avoids integer division, which can be be expensive on CPUs without this instruction such as pre-ARMv7 classic ARMs.
-rw-r--r--source/gfx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/gfx.c b/source/gfx.c
index 85b58f3..5eac5b9 100644
--- a/source/gfx.c
+++ b/source/gfx.c
@@ -423,7 +423,7 @@ void S9xStartScreenRefresh(void)
GFX.Delta = (GFX.SubScreen - GFX.Screen) >> 1;
}
- if (++IPPU.FrameCount % Memory.ROMFramesPerSecond == 0)
+ if (++IPPU.FrameCount == (uint32_t)Memory.ROMFramesPerSecond)
IPPU.FrameCount = 0;
}