patlParticipant05/24/2015 at 20:35Post count: 56
To explain my settings:
Nearly every (emulated) system use its own resolution. (e.g. NES 256×240)
And with this resolution nearly every system have its own natively aspect ratio.
In the case of NES it is 1,06666667.
But on real hardware with an real CRT TV the image is stretched to an aspect ratio of 1,333333 (4:3).
The result is that the pixel width is not the same as the pixel height.
And because of the resolution you have also on a real CRT something patrickm says pixel warping.
On an emulated system the aspect ratio is not automatically set to an aspect ratio 4:3 (1,33333), but the natively aspect ratio (NES=1.06666667 256×240).
You have the possibility to change the resolution and aspect ratio manually, but you have to chose between a realistic aspect ratio of 1.3333333 (4.3) and warping pixels or no warping pixels but also no realistic aspect ratio.
I really prefer realistic aspect ratio… I don’t want a to fat or thin Mario ;-)
Fortunately with smooth on settings you won’t see this warping pixels anymore, because of the of the softness similar to a real (consumer) CRT.
I will not write where you can see these pixels exactly, because if you do not know what to look for, it will not attract attention.
That’s also why I set the Integer Scale option to off because as already written each system has its own vertical resolution and each line should be a multiple of each emulated vertikal pixels, and I still want the image has an aspect ratio of 4:3.
For the current consoles, except for the Master system (and Handhelds), I always use a 4 times the vertical resolution of the original vertikal system resolution.
Because each vertikal line on the LCD should be a multiple of each emulated vertikal pixels, I use also a border around the image. Otherwise the emulated image is to small or to big for the resolution of a LCD display as i write later.
And most of the systems offers different resolutions and have games that sometimes have different vertical resolution in some games or some games show some lines that are only black and so on…
e.g. NES has a PAL resolution 256×240 and a NTSC 256×224.
But the libretto NES cores always show 256×240 as native resolution.
The SNES cores shows 256×239 !! pixels as nativ resolution.
With integer scale on you can only use scanline overlays if the integer scale a multiple of of the original resolution at x1, x2, x4, x6 because with x3 or x5 you will get 3×239= 717 or 5×239= 1.195 vertical lines, and with this resolution you can’t create a overlay scanlineimage in which the vertical pixel spacing is always the same and fit eh pixelborder.
And with a 239 vertical resolution the whole image “looks to high“ because of PAL. So I don’t use 240 but i resize the vertikal Resolution to NTSC 224 x4 = 896 Pixels. And to get an authentic 4:3 aspect ratio, I set the horizontal Resolution to 896 * 1,33333333 = 1.194(,66666)
So 1194×896 for SNES.
1080p (or also 720p) is sometimes the exactly a multiple of the resolution of the emulated system, but mostly not.
If so, you don’t need a black or TV border to get a fullscreen image, if you don’t want.
I want it, because i want the same look of all emulators the border around the image are not only black
I want to see the whole picture, as it was designed.
(PAL games would still another chapter, rare games use the extra PAL resolution, mostly the image is only compressed so you have the ugly black PAL borders at the upper and lower ends of the image.)
At the end you have in all these resolutions and aspect ratios a lot to consider in order to get a good looking „authentic“ image.
Plus, of course, everyone has a different meaning “good” looks like.
One like the picture a bit softer and less blocky. The other may prefer ultra-sharp and with or without scanlines, … and so on
There is no „best method“ .. ;-)
I designed my Overlay Images for a 1080p LCD Resolution.
On a LCD with other resolution these images does not look good.
A 720p Display for example needs custom scanlines. The result would be you can see lines that do not fit or the whole image will be only darker or so…
Now the Settings:
The overlay image should be at the same resolution as the display resolution.
– To do this edit the file:
Note: Entries will be only automatically in the file when each emulator was called already once.
Otherwise, you can simply paste the entries. If the file does not exist, create the file.
The file should look like this:
Entries are only necessary for emulators that you use and scanlines want to have.
– Save the file.
– You can edit the retroarch.cfg’s for the respective emulators
The file should look like this:
( All comments starting with “#” can be omitted, except for the line “#include …”
and all the entries that the same for alle emulators like „video_fullscreen_x“ must not in this config, ist can also be in the config:
video_shader_enable = false
# We don’t need them + RP1/2 is to slow for most shaders
video_fullscreen_x = 1920
# Horizontal Monitor resolution
video_fullscreen_y = 1080
# Vertical Monitor resolution
custom_viewport_width = 1194
# Horizontal emulator resolution
custom_viewport_height = 896
# Vertical emulator resolution
custom_viewport_x = 363
# The first X pixel of the emulator image
custom_viewport_y = 90
# The first Y pixel of the emulator image
aspect_ratio_index = 22
# Aspect Ratio set to custom
input_overlay = /opt/retropie/emulators/retroarch/overlays/16-9/TV_16-9_SNES-MD.cfg
input_overlay_enable = true
# Overlay Image enable
input_overlay_opacity = 1.000000
# opacity of the overlayimage
input_overlay_scale = “1.000000”
# Scalesize of the overlay image
video_smooth = true
# Smoth the emulated image, not the overlay, If you set it to false, it will remain sharp but blocky.
# The line must remain so, otherwise the settings of /opt/retropie/configs/all/retroarch.cfg are not applied
I’ve uploaded the retroarch.cfg’s for the individual emulators I use, in my Dropbox. Individual entries that you not need, you can delete.
e.g. rewind_enable = true
Download and unzip the file and copy each retrorch.cfg in every folder in each system config folder on the RaspberryPi.
-MegaDrive / Genesis + Sega32x + SegaCD + SNES (It’s the same retroarch.cfg)
-NES + PSX (It’s the same retroarch.cfg)
PSX is a little problem because some games use different resolutions.
Also in the game the resolution change sometimes, e.g. cinematics.
I think the best overall image is the same as my NES Settings except:
rewind_enable = false
Because with setting on, the emulator would be really slow and unplayable
There is another small problem similar PSX. fba does not emulate one system with one native resolution, but many systems as CPS1 2 3, Konami, NeoGeo and so on. And the resolution differs from system to system.
I have chosen a resolution that looks good in the most games i tried.
The solution would be if emulationstaion supports configs for each game not only each system.
For the handhelds I solved it very similar.
But the emulated image I set smaller.
And for GB I set the 4 green colors by the emulator itself.
-GB: For the nearly realistic green GameBoy colors i use the lr-gambatte core and set up individual colors in a extra file.
Therefore download and unzip the file from my Dropbox and copy the whole folder “palettes“ with the file „palettes.pal“ to „/home/pi/RetroPie/BIOS“
– I also uploaded on my Dropbox the scanline overlay images with the TV border i created for 1080p displays:
Download and unzip the file and copy the whole folder „16-9“ with the PNG images and .cfg files to the RaspberryPi to
– Start a game and as the result you should look like this:
I find the smooth one looks much better, especially when the image is moving.
Also the aspect ratio is correct and the whole picture is not as dark as if the scan lines are all black, I find much better. Especially on a larger screen or television.
But of course everyone see that differently.
(open the images in a new window and resize it to fullscreen at a minimum resolution of 1080p to see it how it really looks, especially because of the scanlines )
Of course in this guide can be still logical errors (and write errors because I am german) or there are better solutions for some things.
If questions remains, please ask ;-)
Here are the scanline overlays without borders for all Systems except MasterSystem:
And here is the scanline overlay without borders for MasterSystem
–> Scanlines_1080p_MasterSystem.pngFloobMember05/24/2015 at 21:06Post count: 1629
Thanks for posting that patl!
I’ll have to check those settings out, it certainly looks like a good alternative to shaders.
In a couple of places you have said “retroarch.Snes”, do you mean “retroarch.cfg”?patlParticipant05/24/2015 at 21:27Post count: 56
Thanks Floob :)
Of course I mean retrorch.cfg, now ist corrected.
edit: Bullshit german autocorrection ;-)InsecureSpikeParticipant05/24/2015 at 21:48Post count: 571
thanks for this info, any guidance on setting up/converting these to 720p?
thankspatlParticipant05/25/2015 at 11:57Post count: 56
[quote=98342]thanks for this info, any guidance on setting up/converting these to 720p?
The border itself can easily downsized to fit 720p.
But the scanlines have to adjusted.
At a display resolution 720p Your Y scale factor could be max 3x.
So every emulated Y line must be 3 lines of your 720p display.
First I tried with these settings and the best was:
1. Line 100% opacity
2. Line around 10-20% opacity
3. Line Around 60-80% opacity
The rest guide is the same. If you want and i have a litte time a will make some scanlineimages in 720pFloobMember05/25/2015 at 21:51Post count: 1629zonitzParticipant05/26/2015 at 10:11Post count: 11
Would it be possible to attach the scanlines as a separate .png file without the Retrostation TV borders?patlParticipant05/26/2015 at 10:54Post count: 56patlParticipant05/26/2015 at 17:12Post count: 56
Here you can download the scanline overlay images without the TV borders:
This scanlineimage works for all systems if the custom_viewport_height is a 4x Y-scalefactor of the original resolution.
With my configs it works out of the box for all except Mastersystem, because with it I use 5x Y-scalefactor.
So for MasterSystem you need this file:
To use them with my configs, you have to copy the file Scanlines_4x_Y-Scale.png to the folder
and rename the file to e.g. TV_16-9_SNES-MD.png
Repeat this for each system you want the scaliness.
For Mastersystem just copy the file TV_16-9_MasterSystem.png to
/opt/retropie/emulators/retroarch/overlays/16-9/patrickmParticipant05/26/2015 at 17:14Post count: 171
You can use the scanline overlays I posted in “how to get scanlines” if you don’t want the TV border.patlParticipant05/26/2015 at 18:09Post count: 56
A really nice video;-)
Well you said the configuration is for retropie 3.
I forgot to write. Under 2.6 and below it is indeed technically work, but needs to be set up differently.
For what “overlay0_descs = 0” in the overlay config I do not right now.
I have the config simply copied from another overlay and adapted to the filename. To my knowledge you can thus define for touchscreen displays overlay buttons.
Here it is described in detail:zonitzParticipant05/26/2015 at 22:32Post count: 11
I tried all the configs and it looked good, great work!
Could you please explain how to get the green colors for the Gameboy? I placed the palette folder with the “default.pal” file into /home/pi/RetroPie/BIOS but I guess there is more to it.
I also noticed a diagonal “/” line in the GBC overlay when playing the gbc super mario game. It was only seen in that game by the few I tested. The right side of the / was darker and the left brighter. It was fading away the more I lowered the input_overlay_opacity.patlParticipant05/26/2015 at 23:01Post count: 56
Thank you :)
I’ll have a look on it tomorrow (in germany it’s now to late ;-) )
Concerning, as i think about it, i believe you have to setup the an entry in the core setup…
And I made a little mistake in the SNES/Genesis config.
Also I adjusted the scanlines overlays and the brightness of the emulated image a bit,
I’ll post it …. tomorrow ;-)FloobMember05/27/2015 at 19:47Post count: 1629
hmm, why does the original 1080p png image along with the original settings appear to work fine on my 720p TV. It doesnt seem to look any different to the 1080p TV in terms of aspect ratio etc..
Although technically my TV is 1366 x 768
The basis for this otherwise odd seeming resolution is similar to that of other “wide” standards – the line scan (refresh) rate of the well-established “XGA” standard (1024×768 pixels, 4:3 aspect) extended to give square pixels on the increasingly popular 16:9 widescreen display ratio without having to effect major signalling changes other than a faster pixel clock, or manufacturing changes other than extending panel width by 1/3rd.
Well, as I grab the video capture before it hits the TV, it shouldnt affect the guides anyway. I hope.patlParticipant05/27/2015 at 22:44Post count: 56
After a while and the comments on Youtube on Floobs’s video, I have realized that the whole image was i bit too dark.
The easiest way os to increase the brightness on the TV.
I have made it so but I use this TV only for Retropie. If someone uses the the TV also for other things like watching movies or so you have to change the brightness always.
I found some shaders in the shader folder that increase the brightness of the image within retroarch. It’s a bit difficult because some contrast is lost. Therefore i use another filter so I find the contrast is a better again.
And the best ist, the filters have nearly none speed effects with the default settings ;-)
In addition i found some failures with the resolution of some emulators.
Nothing very much but sometimes the scanlines haven’t match exactly the pixellines.
– I updated the ZIP files with the emulator configs and scanline overlay images+overlay configs, download these files:
Scanline Overlay Images:
Just copy the files and folders a I explained in the first comment.
The overlay for NeoGeo are no longer needed. Now it#s the same as MD and SNES.
SO you can delete the old files.
The files for all handheld are still the same.
– Here is the glslp file for setup the shaders:
Download and copy it to /opt/retropie/emulators/retroarch/shader/
Here is a original image without any shader or overlay only :
Here is the same image with the old settings:
And here is the image with the new settings:
Best way open the images in a new window to enlarge
Another mistake was a little config with the Gameboy core.
My palette ist working but custom colors must enabled:
Edit the file:
and edit the line gambatte_gb_colorization to
gambatte_gb_colorization = “custom”
Open RGUI, go to
RGUI -> Options -> Core Options -> GB Colorization
and set it to custom. If you leave RGUI and go back to game the setting will be automatically saved in the same file as above.
Now the Gameboy should be green:
I also updated the links for the files in the first comment.
Thanks and have fun :-)patlParticipant05/27/2015 at 23:04Post count: 56
hmmm… difficult to say..
with an 720p TV ( also with 768 Y-lines ) it cannot be that the scanline look as it should because of the resizing of the overlay image as the HDMI output is set to 720p or if HDMI is set to 1080p, then the TV shelf would resize the image.
Anyway, the scaliness could not look an fact as they should.
The Youtube Video looks good.
Stupid Question, but are you sure your TV is a 720p?
Or maybe the HDMI Output is set to 1080i on the RaspberryPi?
In my last comment I explained what I forgotten but for the green colors.
But at my TV a cannot find any diagonal lines in the image.
The image above looks exactly so as it look on my TV and the image is only a screenshot through Retroarch.
I would imagine that it comes through the resolution of the TV or the resolution settings of the Pi?
Or it’s a similar problem that patrickm have with his vertikal scaliness overlay?patrickmParticipant05/27/2015 at 23:17Post count: 171
[quote=98516]I tried all the configs and it looked good, great work!
Could you please explain how to get the green colors for the Gameboy? I placed the palette folder with the “default.pal” file into /home/pi/RetroPie/BIOS but I guess there is more to it.
I also noticed a diagonal “/” line in the GBC overlay when playing the gbc super mario game. It was only seen in that game by the few I tested. The right side of the / was darker and the left brighter. It was fading away the more I lowered the input_overlay_opacity.
I am having a similar issue with my aperture grill/phosphor overlay that I’m trying to do. There is a static diagonal tear, starting from the lower left corner of the monitor and going to the upper right corner. The upper/left half is darker and the right/bottom is brighter.
I think this might be a bug with overlays :(zonitzParticipant05/28/2015 at 07:46Post count: 11
patl, first of all, thanks for the updates! Regarding the diagonal line on GBC, I can only see it on the Super Mario Bros. Deluxe (U), have you tried that game as well?
Regarding my settings, they are default regarding video in config.txt so EDID should be used, have you specifically set HDMI modes etc there?
I could also recommend anyone with a PI2 to try turning “v-sync” on and disable “threaded video”, I feel that the games are running smoother with these settings (PI is overclocked, 1050, 550, 550, voltage 6).patlParticipant05/28/2015 at 19:15Post count: 56
Also Super Mario Bros. Deluxe on GBC looks ok:
(Open the image in a new window)
My HDMI Settings in the /boot/config.txt are:
hdmi_mode=16 (=1080p60)zonitzParticipant05/28/2015 at 21:32Post count: 11
I tried to add the HDMI settings as well in config.txt, but the line is still there. It’s the same problem that patrickm has with his overlay. I also noticed it in GB now, but never in any overlay with scanlines. Could it be the grid pattern?patlParticipant05/28/2015 at 22:03Post count: 56
I don’t think so, because the handheld grid looks absolutely clear and nice at my display. Exact as in the Mario Bros. image I postet above.
But I also have the same issue as patrickm has, as I wrote in his thread.
Do you have the same problem with GameGear?
It’s 100% the same grid pattern as the GBC, only another Border.
And is the problem only with Mario Bros. or also with other GBC games?
Maybe someone else can test the handheld overlays and write something … ?kitchukParticipant05/29/2015 at 16:56Post count: 207
I tried using the glslp shader but Retroarch does seem to recognise it. I can only see glsl shaders.
Am I doing something wrong?patrickmParticipant05/29/2015 at 17:10Post count: 171
[quote=98618]I tried to add the HDMI settings as well in config.txt, but the line is still there. It’s the same problem that patrickm has with his overlay. I also noticed it in GB now, but never in any overlay with scanlines. Could it be the grid pattern?
I’m noticing the diagonal tear in any overlay that has a lot of vertical lines. Tried making a phosphor pattern last night, same thing.zonitzParticipant05/30/2015 at 22:12Post count: 11
patl, could you please tell me how the config should look and which overlay to use for PC Engine, lr-mednafen-pce? I tried the NES setup but something seem to differ look odd.FloobMember05/30/2015 at 22:43Post count: 1629
[quote=98733]patl, could you please tell me how the config should look and which overlay to use for PC Engine, lr-mednafen-pce? I tried the NES setup but something seem to differ look odd.
Most seem to use 256×239, so a multiple of that would be needed.
I think thats the same as the SNESpatlParticipant05/31/2015 at 00:28Post count: 56
I haven’t testet it yet.
“X (Horizontal) Resolution: variable, maximum of 565 (programmable to 282, 377 or 565 pixels, or as 5.3693175 MHz, 7.15909 MHz, and 10.738635 MHz pixel dot clock) Taking into consideration overscan limitations of CRT televisions at the time, the horizontal resolutions were realistically limited to something a bit less than what the system was actually capable of. Consequently, most game developers limited their games to either 256, 352, or 512 pixels in display width for each of the three modes.
Y (Vertical) Resolution: variable, maximum of 242 (programmable in increments of 1 scanline). It is possible to achieve an interlaced “mode” with a maximum vertical resolution of 484 scanlines by alternating between the two different vertical resolution modes used by the system. However, it is unknown, at this time, if this interlaced resolution is compliant with (and hence displayed correctly on) NTSC televisions.
The majority of TurboGrafx-16 games use 256×239, though some games, such as Sherlock Holmes Consulting Detective did use 512×224″
So Floob should be right and the SNES Overlay should work.
I will test overlays tomorrow or the next days ;-)kitchukParticipant05/31/2015 at 12:51Post count: 207
Which overlays would you recommend for Doom and Cave Story?FloobMember06/02/2015 at 19:50Post count: 1629
If you take the SNES as an example:
256×239 native resolution
If using a 1080p screen you would have a max of 1920 x 1080
So in order that the height not lose native aspect ration = 1080 / 239 = 4.51(plus rounding).
So height is 4.51 x 239 = 1078 (rounded)
Using same multiplier to keep aspect ratio for width would be 4.51 x 256 = 1154
So SNES could be 1154 x 1078
Although I know you have suggested 1194×896 for SNES.
So why might you not want to use the calculation above? Because as far as I can see it maintains the native resolution as well as maximises screen area.
Or are you saying because most CRTs would have forced an effective 4:3 view, you want to maintain that aspect ratio?patlParticipant06/02/2015 at 22:53Post count: 56
First I want to have a nearly 4:3 aspect ratio.
Your calculation is indeed the native aspect ratio but this would be rounded 4:3.75
So the image would look stretched in height.
The next point is the scanline overlay image.
So that each scanline fits each emulated Y pixel line, each scanline must be a multiple of the emulated Y pixel.
Theoretically e.g. 239 x4 or x5 = 956 or 1195 Y lines on the scanline overlay image.
I testet a view things with the resolution and found out that the MegaDrive and SNES libretto cores are buggy within the render resolution of the system. I made some scanline overlay with 1.274×956 for SNES but the scanlines doesn’t fit all pixels over the whole screen…
The same with MegaDrive. The native render resolution in retroarch for MegaDrive is 320×240 x4 = 1280×960, but the scanlines doesn’t fit…
Only if I use a native Y resolution of 224, the scanlines fit the pixels.
So I use 1194×896 for SNES, MegaDrive and NeoGeo (1194 because of the 4:3 aspect ratio)
For PC-Engine the retroarch core uses a 320×232 !?! resolution.
x4 = 1236×928
I’ve made an extra overlay for this system.
I also cleaned up the filepaths and names a bit.
And I noticed that the shaders I used for the better brightness causes slowdowns anyway. Especially with PSX it’s very laggy. Without shaders it’s flawless.
So I deactivated the shader again and reworked the overlays a bit.
The result is not so much brighter but I think it’s ok for now.
I uploaded the new files to my dropbox:
Download and unzip the files and copy
– The whole folder „1080p_4-3“ to —> /opt/retropie/emulators/retroarch/overlays/1080p_4-3
– All folders of the config.zip (atarilynx, fba, gamegear…) to —> /opt/retropie/configs/
!! Be carefully if you edited your systemconfigs with your
Then you can simply copy the necessary settings of my configs into your
system configs !!
– Copy the whole folder „palettes“ to /home/pi/RetroPie/BIOS/
If you want to use the overlays without the TV border just edit all retroarch.cfg’s
overwrite e.g. the line :
input_overlay = /opt/retropie/emulators/retroarch/overlays/1080p_4-3/NeoGeo-SNES-MegaDrive_1080p.cfg
input_overlay = /opt/retropie/emulators/retroarch/overlays/1080p_4-3/Scanlines_4x_1080p_Borderless.cfg
except for MasterSystem, here you must overwrite the line with:
input_overlay = /opt/retropie/emulators/retroarch/overlays/1080p_4-3/Scanlines_5x_1080p_Borderless.cfg
For FBA I must rework a little due to different resolutions I explained earlier. Currently I just use the Neo Geo settings.
There comes an update soon.
I haven’t testet both.
CaveStory… I don’t know ;-)
Doom I think it has a VGA resolution of 320×340, so the overlay for NES-PSX should work.FloobMember06/02/2015 at 23:07Post count: 1629
Thanks for the update. I’ll get those changes applied to my tool soon.
I agree, the shader, whilst brightening the image does appear to slow it down a little.
I think a lot of the definition of your sizing relates to you wanting the 4:3 ratio – would that relate to the “nostalgia look” mentioned here?
I quite like your TV overlay, so I keep that version with my setup :)
Also, I find there is a lot of variation in FBA roms, so I tend not to force the resolution there.kitchukParticipant06/03/2015 at 10:00Post count: 207
I am very grateful for the work you have put into these overlays and configs. They look excellent!patrickmParticipant06/03/2015 at 14:46Post count: 171
I am very grateful for the work you have put into these overlays and configs. They look excellent!
He told you the wrong resolution for Doom. It’s 320×200 native so you are going to lose a lot of screen space at 4x scale. I recommend using 5x scale or 1280×1000 and the 5x overlay I provided.patlParticipant06/03/2015 at 22:47Post count: 56
I knew not this thread so far.
Since it is more about getting the native aspect ratio of the system resolution.
And there is written the games use different resolutions.(8:7)
The course you can use also this Aspect ratios and resolutions, but I think it looks nicer with a 4:3 aspect ratio because the CRT TV’s picture is also 4:3 stretched.
That’s why I make only 4:3 overlays for me and those who likes it ;-)
As I said, I havn’t testet it. If the Y Resolution is really 200, patrickm is right of course. 200 x 4 would result in too much black borders.
200 x5 should work with the Scanlines_5x_1080p_Borderless.cfg without TV border and only a little black border
or with the MasterSystem TV Border Overlay but then about 40 Y Lines would be cut off.
And it could be that you have to play a bit with the custom_viewport_y in the retroarch.cfg so that the scanlines fit the pixels and the image is in middle of the screen.jamesandjome-comParticipant06/08/2015 at 10:05Post count: 46
I am having a little bit of difficulty getting the TV Boarder to show and was hoping you could help.
I have downloaded the configs, palettes and 1080p 4-3 zip linked in post #19, however I seem to have no TV Boarder.
Am I correct in thinking that this can only be achieved with the 16-9.zip in the first post? (link no longer works).
Heres what I have done,
Copied config for each system to /opt/retropie/configs (all working)
Copied 1080p folder to /opt/retropie/emulators/retroarch/shaders/overlays/1080p_4-3 (all working, however I changed the path because I could only put the overlays folder in the shaders folder because of permissions. In any case I changed the config paths to match this and all configs are working as intended)
Copied Pallete folder to /home/pi/retropie/bios (Little confused with this one as there are two folders in the download and both have files. Do just the files go in there or both files go into the pallettes folder then in bios?)
So with this all done everything looks great, I just dont have the TV Boarder. What am I missing?
- The forum ‘Video Output on RetroPie’ is closed to new topics and replies.