diff options
author | hizzlekizzle | 2019-06-30 15:21:00 -0500 |
---|---|---|
committer | GitHub | 2019-06-30 15:21:00 -0500 |
commit | f7d6ffe65229fdb9245896d2bd4a9f8937ddd8df (patch) | |
tree | 12099ca64dfeb5ac6a372992e7098f32f21b2acf | |
parent | a3c2efcd073d986f17a4a81617acaf68e07447e1 (diff) | |
parent | 4ce3bd436026de48ec0d984c602325e707081255 (diff) | |
download | pcsx_rearmed-f7d6ffe65229fdb9245896d2bd4a9f8937ddd8df.tar.gz pcsx_rearmed-f7d6ffe65229fdb9245896d2bd4a9f8937ddd8df.tar.bz2 pcsx_rearmed-f7d6ffe65229fdb9245896d2bd4a9f8937ddd8df.zip |
Merge pull request #307 from kamicane/master
Report correct geometry and update geometry when needed
-rw-r--r-- | frontend/libretro.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index 3689297..91f1b51 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -76,6 +76,9 @@ static bool display_internal_fps = false; static unsigned frame_count = 0; static bool libretro_supports_bitmasks = false; +static unsigned previous_width = 0; +static unsigned previous_height = 0; + static int plugins_opened; static int is_pal_mode; @@ -180,6 +183,18 @@ static void vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp) vout_width = w; vout_height = h; + if (previous_width != vout_width || previous_height != vout_height) + { + previous_width = vout_width; + previous_height = vout_height; + + SysPrintf("setting mode width: %d height %d\n", vout_width, vout_height); + + struct retro_system_av_info info; + retro_get_system_av_info(&info); + environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &info.geometry); + } + set_vout_fb(); } @@ -714,11 +729,15 @@ void retro_get_system_info(struct retro_system_info *info) void retro_get_system_av_info(struct retro_system_av_info *info) { + + unsigned geom_height = vout_height > 0 ? vout_height : 240; + unsigned geom_width = vout_width > 0 ? vout_width : 320; + memset(info, 0, sizeof(*info)); info->timing.fps = is_pal_mode ? 50 : 60; info->timing.sample_rate = 44100; - info->geometry.base_width = 320; - info->geometry.base_height = 240; + info->geometry.base_width = geom_width; + info->geometry.base_height = geom_height; info->geometry.max_width = VOUT_MAX_WIDTH; info->geometry.max_height = VOUT_MAX_HEIGHT; info->geometry.aspect_ratio = 4.0 / 3.0; |