Skip to content

Commit

Permalink
gfx: Use simpler equality test for IPPU.FrameCount
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jSTE0 committed Feb 4, 2022
1 parent f1ac3dc commit 305cafc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 305cafc

Please sign in to comment.