From 32525d6bd36a47b756193b155f56a6981a46c817 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 13:59:53 +0000 Subject: [PATCH 1/6] Fixed missing break (#118) --- menu/menu_setting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index e80509d44b..b1ed442f17 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1577,6 +1577,7 @@ static int setting_uint_action_right_crt_switch_resolution_super( break; case 1: /* for dynamic super resolution switching - best fit */ *setting->value.target.unsigned_integer = 1920; + break; case 1920: *setting->value.target.unsigned_integer = 2560; break; From b37c64742fb969610a5adbb2f41be1f73886a9fa Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 14:38:01 +0000 Subject: [PATCH 2/6] Dynamic width - function completed (#119) --- gfx/video_crt_switch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 35586ab9dd..494315653c 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -231,20 +231,20 @@ void crt_video_restore(void) int crt_compute_dynamic_width(int width) { - double p_clock = 18000000; - int min_height = 261; + double p_clock = 18000000; + int min_height = 261; + int dynamic_width = 0; #if defined(HAVE_VIDEOCORE) double p_clock = 32000000; #endif for (int i =1; i < 10; i++) { - if (((width*0.5*i) * min_height * ra_core_hz) > p_clock) - width = width*i; - return width; - break; + dynamic_width = (width*0.5)*i; + if ((dynamic_width * min_height * ra_core_hz) > p_clock) + return dynamic_width; } - return 0; + return width; } #if defined(HAVE_VIDEOCORE) From 84a784e28bc933c369f1f4c012a40a481babdc6d Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 15:16:40 +0000 Subject: [PATCH 3/6] CRT resolution naming (#120) --- menu/menu_setting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index b1ed442f17..d2bd18bc49 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1200,7 +1200,7 @@ static void setting_get_string_representation_crt_switch_resolution_super( snprintf(s, len, "%d", *setting->value.target.unsigned_integer); /* TO DO make 1 read as DYNAMIC */ if (*setting->value.target.unsigned_integer == 1) - strlcpy(s, msg_hash_to_str(MSG_DYNAMIC), len); + strlcpy(s, "DYNAMIC", len); else snprintf(s, len, "%d", *setting->value.target.unsigned_integer); } From bdf2526f80e04db3306d10918c3f7d195c8cda8e Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 15:58:41 +0000 Subject: [PATCH 4/6] Fix native naming after new additions --- menu/menu_setting.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index d2bd18bc49..d95b3bdf88 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1195,10 +1195,11 @@ static void setting_get_string_representation_crt_switch_resolution_super( return; if (*setting->value.target.unsigned_integer == 0) - strlcpy(s, msg_hash_to_str(MSG_NATIVE), len); + strlcpy(s, "NATIVE", len); else snprintf(s, len, "%d", *setting->value.target.unsigned_integer); /* TO DO make 1 read as DYNAMIC */ + if (*setting->value.target.unsigned_integer == 1) strlcpy(s, "DYNAMIC", len); else From 8259bc33acc1da7a3a5f2066a9b9b6e2a39802d1 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 15:59:53 +0000 Subject: [PATCH 5/6] CRT dynamic width changes --- gfx/video_crt_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 494315653c..afa3ac84b2 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -242,9 +242,9 @@ int crt_compute_dynamic_width(int width) { dynamic_width = (width*0.5)*i; if ((dynamic_width * min_height * ra_core_hz) > p_clock) - return dynamic_width; + break; } - return width; + return dynamic_width; } #if defined(HAVE_VIDEOCORE) From 305a15f056af66704778eea9f1fbd6dfe29e6033 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 12 Feb 2019 16:10:23 +0000 Subject: [PATCH 6/6] Change menu detection width --- gfx/video_crt_switch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index afa3ac84b2..1e1b67dec5 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -119,7 +119,7 @@ static void crt_screen_setup_aspect(unsigned width, unsigned height) if (height == 4) { /* detect menu only */ - if (width < 1920) + if (width < 700) width = 320; height = 240;