{"id":728,"date":"2014-04-01T16:37:31","date_gmt":"2014-04-01T16:37:31","guid":{"rendered":"http:\/\/www.libretro.com\/?p=728"},"modified":"2015-10-18T04:03:24","modified_gmt":"2015-10-18T04:03:24","slug":"retroarch-and-240p","status":"publish","type":"post","link":"https:\/\/www.libretro.com\/index.php\/retroarch-and-240p\/","title":{"rendered":"RetroArch and 240p"},"content":{"rendered":"<p>I got my hands on an old CRT computer monitor (VGA, 31 kHz) this past weekend and wanted to play around with pushing out native-res, &#8220;240p&#8221; signals from RetroArch.<\/p>\n<p>RetroArch doesn&#8217;t have any built-in resolution switching capabilities, but we can use the operating system&#8217;s built-in tools to handle the task. In Windows, that means using CRT_EmuDriver and a compatible GPU, while in Linux we can use xrandr from the desktop environment. You can also theoretically force resolutions via KMS, but I haven&#8217;t had any luck getting it going.<\/p>\n<p>Since I&#8217;m running Ubuntu 14.04 (Trusty Tahr, LTS), I could add my custom resolution modelines to my xorg.conf and then choose between them before launching a game, but instead I am using launch scripts that add and set the desired mode at runtime. So, on my desktop, I have a little bash script that reads like this for SNES (EDIT: forgot a couple of things):<\/p>\n<blockquote><p>#!\/bin\/bash<br \/>\nxrandr &#8211;newmode &#8220;snes&#8221; 5.979 320 332 368 380 240 242 246 263 +CSync<br \/>\nxrandr &#8211;addmode DVI-0 snes \/\/ replace DVI-0 with your active display; you can find it from &#8216;xrandr -q&#8217;<br \/>\nxrandr &#8211;output DVI-0 &#8211;mode snes<br \/>\nwait 5 \/\/ this will ensure that RetroArch doesn&#8217;t launch before the screen fully switches resolution<br \/>\nretroarch &#8211;menu &#8211;fullscreen -c ~\/.config\/retroarch\/snes.cfg \\ \u00a0\/\/ points to my pre-configured SNES controls \ud83d\ude42<br \/>\n&amp;&amp; xrandr &#8211;output DVI-0 &#8211;mode 1024&#215;768 \/\/ this will take us back to a normal resolution upon exiting RA<\/p><\/blockquote>\n<p>Notice that the last line only goes off once RetroArch closes, since it&#8217;s hooked to the launch command with &#8216;&amp;&amp;&#8217;.<\/p>\n<p>RGUI automatically scales to the resolution and looks great. Oddly enough, I had to set my in-game aspect ratio to 16:15 to get everything to map up properly. Regardless, the results speak for themselves (these pictures are huge; click to check out the glorious full-res shots):<\/p>\n<figure style=\"width: 403px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/1.bp.blogspot.com\/-LzfkseJ3ycM\/UzeM3d-CwrI\/AAAAAAAAB94\/U9-4UbGTGEw\/s1600\/IMAG0077.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"   \" alt=\"\" src=\"http:\/\/1.bp.blogspot.com\/-LzfkseJ3ycM\/UzeM3d-CwrI\/AAAAAAAAB94\/U9-4UbGTGEw\/s1600\/IMAG0077.jpg\" width=\"403\" height=\"228\" \/><\/a><figcaption class=\"wp-caption-text\">Super Mario World, native resolution, unfiltered.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure style=\"width: 403px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/4.bp.blogspot.com\/-8_ibEH6-_OU\/UzeM22N0TzI\/AAAAAAAAB9w\/YjezR13wJAU\/s1600\/IMAG0083.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"   \" alt=\"\" src=\"http:\/\/4.bp.blogspot.com\/-8_ibEH6-_OU\/UzeM22N0TzI\/AAAAAAAAB9w\/YjezR13wJAU\/s1600\/IMAG0083.jpg\" width=\"403\" height=\"228\" \/><\/a><figcaption class=\"wp-caption-text\">Super Metroid looking lovely.<\/figcaption><\/figure>\n<p>The only problem I have right now is that RA is detecting a refresh rate of ~47 Hz instead of ~60, for some reason, so it&#8217;s playing a bit slowly\/jumpy. I can get a normal game speed by turning on the &#8216;threaded video&#8217; option, but that&#8217;s suboptimal and leads to jerky scrolling. Regardless, this is a good start and I&#8217;ll be working with Squarepusher to iron out the current issues. If anyone has any experience forcing resolutions in KMS, please leave a comment or drop by IRC at Freenode &#8211; #retroarch.<\/p>\n<figure style=\"width: 403px\" class=\"wp-caption alignnone\"><img decoding=\"async\" loading=\"lazy\" class=\"   \" alt=\"\" src=\"http:\/\/2.bp.blogspot.com\/-igLGlFSOM5Y\/UzeM8pRWwMI\/AAAAAAAAB-w\/HsRX5GYdBqw\/s1600\/IMAG0100.jpg\" width=\"403\" height=\"228\" \/><figcaption class=\"wp-caption-text\">You can use the same process with arcade games, you just have to replace the script&#8217;s modeline with one that corresponds to the game&#8217;s native resolution.<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I got my hands on an old CRT computer monitor (VGA, 31 kHz) this past weekend and wanted to play around with pushing out native-res, &#8220;240p&#8221; signals from RetroArch. RetroArch doesn&#8217;t have any built-in resolution switching capabilities, but we can use the operating system&#8217;s built-in tools to handle the task. In Windows, that means using [&hellip;]<\/p>\n","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,5],"tags":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/728"}],"collection":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/comments?post=728"}],"version-history":[{"count":4,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions"}],"predecessor-version":[{"id":732,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/posts\/728\/revisions\/732"}],"wp:attachment":[{"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/media?parent=728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/categories?post=728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.libretro.com\/index.php\/wp-json\/wp\/v2\/tags?post=728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}