From 796ba04d93b5bc871dbbec7c59e0e178d8c7b2f6 Mon Sep 17 00:00:00 2001 From: Themaister Date: Thu, 13 Sep 2012 22:37:38 +0200 Subject: [PATCH] Always make sure that a frame is output every retro_run(). --- libretro/libretro.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 03657b74..c9045ce8 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -366,6 +366,8 @@ static const unsigned binds[] = { RETRO_DEVICE_ID_JOYPAD_L }; +static unsigned has_frame; + void retro_run(void) { poll_cb(); @@ -377,7 +379,8 @@ void retro_run(void) joy = J; - CPULoop(); + has_frame = 0; + do { CPULoop(); } while (!has_frame); } size_t retro_serialize_size(void) @@ -444,6 +447,7 @@ void systemDrawScreen() { video_cb(pix, 240, 160, 512); //last arg is pitch g_video_frames++; + has_frame = 1; } void systemMessage(const char* str, ...)