diff --git a/config.def.h b/config.def.h index 0113bc6f79..d803afba17 100644 --- a/config.def.h +++ b/config.def.h @@ -163,6 +163,10 @@ static const bool video_smooth = true; // On resize and fullscreen, rendering area will stay 4:3 static const bool force_aspect = true; +// Controls aspect ratio handling. +static const float aspect_ratio = -1.0; // Automatic +static const bool aspect_ratio_auto = false; // 1:1 PAR + // Crop overscanned frames (7/8 or 15/15 for interlaced frames). static const bool crop_overscan = true; diff --git a/driver.c b/driver.c index 96f50b19c4..268c44a156 100644 --- a/driver.c +++ b/driver.c @@ -532,7 +532,7 @@ void init_video_input(void) if (geom->aspect_ratio > 0.0f && g_settings.video.aspect_ratio_auto) g_settings.video.aspect_ratio = geom->aspect_ratio; else - g_settings.video.aspect_ratio = (float)geom->base_width / geom->base_height; + g_settings.video.aspect_ratio = (float)geom->base_width / geom->base_height; // 1:1 PAR. SSNES_LOG("Adjusting aspect ratio to %.2f\n", g_settings.video.aspect_ratio); } diff --git a/settings.c b/settings.c index b8345cffbe..1a761dfeda 100644 --- a/settings.c +++ b/settings.c @@ -160,7 +160,8 @@ void config_set_defaults(void) g_settings.video.smooth = video_smooth; g_settings.video.force_aspect = force_aspect; g_settings.video.crop_overscan = crop_overscan; - g_settings.video.aspect_ratio = -1.0f; // Automatic + g_settings.video.aspect_ratio = aspect_ratio; + g_settings.video.aspect_ratio_auto = aspect_ratio_auto; // Let implementation decide if automatic, or 1:1 PAR. g_settings.video.shader_type = SSNES_SHADER_AUTO; g_settings.video.allow_rotate = allow_rotate; @@ -361,6 +362,7 @@ bool config_load_file(const char *path) CONFIG_GET_BOOL(video.force_aspect, "video_force_aspect"); CONFIG_GET_BOOL(video.crop_overscan, "video_crop_overscan"); CONFIG_GET_FLOAT(video.aspect_ratio, "video_aspect_ratio"); + CONFIG_GET_BOOL(video.aspect_ratio_auto, "video_aspect_ratio_auto"); CONFIG_GET_FLOAT(video.refresh_rate, "video_refresh_rate"); CONFIG_GET_STRING(video.cg_shader_path, "video_cg_shader"); diff --git a/ssnes.cfg b/ssnes.cfg index 472432ce83..2aa582fc63 100644 --- a/ssnes.cfg +++ b/ssnes.cfg @@ -55,8 +55,15 @@ # Forces rendering area to stay equal to SNES aspect ratio 4:3 or as defined in video_aspect_ratio. # video_force_aspect = true -# A floating point value for video aspect ratio (width / height) -# video_aspect_ratio = 1.333 +# A floating point value for video aspect ratio (width / height). +# If this is not set, aspect ratio is assumed to be automatic. +# Behavior then is defined by video_aspect_ratio_auto. +# video_aspect_ratio = + +# If this is true and video_aspect_ratio is not set, +# aspect ratio is decided by libretro implementation. +# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set. +# video_aspect_ratio_auto = false # Forces cropping of overscanned frames. Crops away top 7 scanlines and 8 bottom scanlines. (15/15 for interlaced frames). # video_crop_overscan = false