mirror of https://github.com/mgba-emu/mgba.git
PSP2: Only wait on vblank if we hit the frame target
This commit is contained in:
parent
65c290131a
commit
62304e3aa2
|
@ -13,6 +13,7 @@
|
|||
#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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue