all repos — mgba @ 62304e3aa2a5cabbfab5f5288ab461c59876cf1d

mGBA Game Boy Advance Emulator

PSP2: Only wait on vblank if we hit the frame target
Jeffrey Pfau jeffrey@endrift.com
Sat, 03 Oct 2015 21:27:03 -0700
commit

62304e3aa2a5cabbfab5f5288ab461c59876cf1d

parent

65c290131abe68cf204cf12f7866471753b34935

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

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

@@ -13,6 +13,7 @@ #include "util/gui/file-select.h"

#include "util/gui/menu.h" #include <psp2/ctrl.h> +#include <psp2/display.h> #include <psp2/kernel/processmgr.h> #include <psp2/kernel/threadmgr.h> #include <psp2/moduleinfo.h>

@@ -24,12 +25,17 @@

PSP2_MODULE_INFO(0, 0, "mGBA"); static void _drawStart(void) { + vita2d_set_vblank_wait(false); vita2d_start_drawing(); vita2d_clear_screen(); } static void _drawEnd(void) { + static int oldVCount = 0; + int vcount = oldVCount; vita2d_end_drawing(); + oldVCount = sceDisplayGetVcount(); + vita2d_set_vblank_wait(oldVCount == vcount); vita2d_swap_buffers(); }