From 305cafc8c8523f499e8a1c5935c854c8bed37c93 Mon Sep 17 00:00:00 2001 From: jSTE0 <98854293+jSTE0@users.noreply.github.com> Date: Fri, 4 Feb 2022 22:48:48 +0000 Subject: [PATCH] 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. --- gfx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx.cpp b/gfx.cpp index bbeae228..e73b7d1a 100644 --- a/gfx.cpp +++ b/gfx.cpp @@ -191,7 +191,7 @@ void S9xStartScreenRefresh (void) memset(GFX.SubZBuffer, 0, GFX.ScreenSize); } - if (++IPPU.FrameCount % Memory.ROMFramesPerSecond == 0) + if (++IPPU.FrameCount == (uint32)Memory.ROMFramesPerSecond) { IPPU.DisplayedRenderedFrameCount = IPPU.RenderedFramesCount; IPPU.RenderedFramesCount = 0;