aboutsummaryrefslogtreecommitdiff
path: root/frontend/libretro.c
diff options
context:
space:
mode:
authortwinaphex2012-12-04 14:36:01 +0100
committertwinaphex2012-12-04 14:36:01 +0100
commit12990fb369a8b2a63c6a16f45dcce2c7ed93ef5d (patch)
treef97db3042809bee7b4a3322537fb0ba303058e5d /frontend/libretro.c
parent89d7ac2a566bc0ca8a12bdc6f920d9ee0578163a (diff)
downloadpcsx_rearmed-12990fb369a8b2a63c6a16f45dcce2c7ed93ef5d.tar.gz
pcsx_rearmed-12990fb369a8b2a63c6a16f45dcce2c7ed93ef5d.tar.bz2
pcsx_rearmed-12990fb369a8b2a63c6a16f45dcce2c7ed93ef5d.zip
(Libretro) We need to do video_cb in retro_run every frame instead of
just once every time the video callback is called - otherwise we will get very bad/skippy framerates. Performance is much improved now in nearly all games.
Diffstat (limited to 'frontend/libretro.c')
-rw-r--r--frontend/libretro.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 49e346b..e505804 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -62,6 +62,9 @@ static void convert(void *buf, size_t bytes)
}
#endif
+static unsigned game_width;
+static unsigned game_height;
+
static void vout_flip(const void *vram, int stride, int bgr24, int w, int h)
{
unsigned short *dest = vout_buf;
@@ -94,8 +97,8 @@ out:
#ifndef FRONTEND_SUPPORTS_RGB565
convert(vout_buf, w * h * 2);
#endif
- video_cb(vout_buf, w, h, w * 2);
- pl_rearmed_cbs.flip_cnt++;
+ game_width = w;
+ game_height = h;
}
static void vout_close(void)
@@ -353,6 +356,8 @@ void retro_run(void)
psxCpu->Execute();
samples_to_send += 44100 / 60;
+ video_cb(vout_buf, game_width, game_height, game_width * 2);
+ pl_rearmed_cbs.flip_cnt++;
}
void retro_init(void)