From 11b0fe2a970af43b233cb716681f175617208c24 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 1 May 2018 20:28:01 +0100 Subject: [PATCH 1/5] Linux resolution improvements for CRT --- gfx/video_crt_switch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 07ce0c76a6..126fe7d8cf 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -145,6 +145,11 @@ static void crt_screen_setup_aspect(unsigned width, unsigned height) crt_aspect_ratio_switch(width, height); height = 254; } + if (width < 300) + { + width = width*2; + crt_aspect_ratio_switch(width, height); + { switch_res_crt(width, height); } From 8584e27a81c3d5bd8baaad2e8ed82735d71a365c Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 1 May 2018 20:32:34 +0100 Subject: [PATCH 2/5] res fix --- gfx/video_crt_switch.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gfx/video_crt_switch.c b/gfx/video_crt_switch.c index 126fe7d8cf..07ce0c76a6 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -145,11 +145,6 @@ static void crt_screen_setup_aspect(unsigned width, unsigned height) crt_aspect_ratio_switch(width, height); height = 254; } - if (width < 300) - { - width = width*2; - crt_aspect_ratio_switch(width, height); - { switch_res_crt(width, height); } From c9d89e234a4fbe52a1547214b5b429ea7a655c14 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 1 May 2018 20:55:24 +0100 Subject: [PATCH 3/5] Fix for native low res in Linux --- gfx/display_servers/dispserv_x11.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gfx/display_servers/dispserv_x11.c b/gfx/display_servers/dispserv_x11.c index d001438f33..4fda9dd03c 100644 --- a/gfx/display_servers/dispserv_x11.c +++ b/gfx/display_servers/dispserv_x11.c @@ -19,6 +19,7 @@ #include "../common/x11_common.h" #include "../../configuration.h" #include "../video_driver.h" /* needed to set refresh rate in set resolution */ +#include "../video_crt_switch.h" /* needed to set aspect for low res in linux */ #include #include @@ -44,10 +45,10 @@ static void* x11_display_server_init(void) static void x11_display_server_destroy(void *data) { - - system("xrandr -s 704x480"); dispserv_x11_t *dispserv = (dispserv_x11_t*)data; + system("xrandr -s 704x480"); + if (dispserv) free(dispserv); } @@ -98,14 +99,19 @@ static bool x11_set_resolution(void *data, char fbset[150]; char output[150]; - hsp = width*1.14; + hsp = width*1.12; /* set core refresh from hz */ video_monitor_set_refresh_rate(hz); /* following code is the mode line genorator */ - hfp = width+24; - hbp = width*1.26; + if (width < 300) + { + width = width*2; + crt_aspect_ratio_switch(width, height); + } + hfp = width+16; + hbp = width*1.22; hmax = hbp; if (height < 241) From 97630d7fb139e84f23b3fee02afeebf7b7bfb756 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 1 May 2018 20:56:30 +0100 Subject: [PATCH 4/5] Fix for native low res in Linux --- gfx/video_crt_switch.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfx/video_crt_switch.h b/gfx/video_crt_switch.h index 4e86ec4352..e1ca885780 100644 --- a/gfx/video_crt_switch.h +++ b/gfx/video_crt_switch.h @@ -29,6 +29,8 @@ RETRO_BEGIN_DECLS void crt_switch_res_core(unsigned width, unsigned height, float hz); +void crt_aspect_ratio_switch(unsigned width, unsigned height); + void crt_video_restore(void); RETRO_END_DECLS From 82a2fb955ef843da646e506d620f6388df6d8c09 Mon Sep 17 00:00:00 2001 From: alphanu1 <37101891+alphanu1@users.noreply.github.com> Date: Tue, 1 May 2018 21:07:52 +0100 Subject: [PATCH 5/5] Removed static from function to share aspect changing --- 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 07ce0c76a6..f4dd720f60 100644 --- a/gfx/video_crt_switch.c +++ b/gfx/video_crt_switch.c @@ -66,7 +66,7 @@ static void switch_crt_hz(void) } -static void crt_aspect_ratio_switch(unsigned width, unsigned height) +void crt_aspect_ratio_switch(unsigned width, unsigned height) { /* send aspect float to videeo_driver */ fly_aspect = (float)width / height;