From 09334d546982a354ccf73e64966191aac2d22083 Mon Sep 17 00:00:00 2001 From: Jonathan Teh Date: Tue, 22 Feb 2022 23:01:27 +0000 Subject: 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. --- source/gfx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3