all repos — mgba @ 8fd76bc9f53f208c511c776e8406eb05d50e0443

mGBA Game Boy Advance Emulator

PSP2: Simplify frame limiter code
Vicki Pfau vi@endrift.com
Mon, 08 Oct 2018 20:02:32 -0700
commit

8fd76bc9f53f208c511c776e8406eb05d50e0443

parent

357e2e2d6be4c31d25404e29421468a2c8e6d6ac

1 files changed, 5 insertions(+), 6 deletions(-)

jump to
M src/platform/psp2/main.csrc/platform/psp2/main.c

@@ -25,18 +25,17 @@

#include <vita2d.h> static void _drawStart(void) { - vita2d_set_vblank_wait(false); + static int vcount = 0; + extern bool frameLimiter; + int oldVCount = vcount; + vcount = sceDisplayGetVcount(); + vita2d_set_vblank_wait(frameLimiter && vcount + 1 >= oldVCount); vita2d_start_drawing(); vita2d_clear_screen(); } static void _drawEnd(void) { - static int vcount = 0; - extern bool frameLimiter; - int oldVCount = vcount; vita2d_end_drawing(); - vcount = sceDisplayGetVcount(); - vita2d_set_vblank_wait(frameLimiter && vcount + 1 >= oldVCount); vita2d_swap_buffers(); }