Combining Border Overlays with different screen resolutions

One feature that I have become very fond of, is having Border Overlays while emulating old handhelds that have a relative low native pixel resolution. Gameboy/Color and the Sega Game Gear. On the Gameboy Color I have a purple Gameboy Color Border Overlay surrounding the actual image (I use Integer Scale, Custom Aspect Ratio and a screen size that is 5x the native resolution, 800x720).

I personally don’t like to enlarge the image too much on those older handhelds because the pixels then becomes way too big, Border Overlays can help by making a smaller image both stylish and seamless in my opinion.

This is all well and good on both of my 1080p screens, but sooner or later I’m going to migrate to a 4K TV, and than this setup becomes a bit more troublesome. Since my RetroArch setup is configured to display 5x the native resolution to fit the Border Overlays (I have an overlay scale of 1.25), to my limited knowledge there is no way to automatically turn the Custom Aspect Ratio Width- and Height from 5x to 10x when RetroArch detects that I’m now have switched screen resolution from 1080p to 2160p and vice versa.

Maybe there is an automated solution for this, but I haven’t found it yet, so I would need some guidance regarding this issue.

I like to use handheld shaders for portable consoles. They come with borders and will automatically set integer scaling for you as well. The end result is quite nice.

Link to a thread where i posted some screenshots:

Please show off your Handheld Shaders (GB, GBC, ETC.)

You can get the shaders from this thread:

Handheld Border Shaders

This is my first time trying out shaders (shaders was never my cup of tea), and I found one that I really liked the border overlay of (shaders\shaders_cg\handheld\console-border\dmg-5xcgp) which uses a really nice Game Boy overlay.

However, I only like the border and it’s effect on screen scaling itself, and not all those fancy retro-effects (green screen with grids between the pixels and such).

I have tried to disable some of the shader passes and such, but being new to shaders makes this a bit overwhelming at first (maybe there isn’t any easy way of just keeping the effects that I like).

I might create a separate topic in the Overlays section on this forum, if the question I have regarding disabling the fancy effects hasn’t been answered there before.

These shaders try to emulate the look of the screen which is why the dmg shader is green. You can try the GB-Pocket shader for GB games and/or the GBColor. The effect is not as strong and in my opinion the GB-Pocket-high-contrast shader make the monochrome gameboy games look fantastic.

If you just want the overlays, here are some.

Nice overlays; I think I have another way of facing this issue now:

I will try to somehow write a script that edits the core configs’s scaling values at the start, by checking for the actual display resolution of Windows 10 first. If the desktop resolution is 1080p, then apply 5x scaling in both width- and height before startup of RetroArch, and if the desktop resolution is 2160p, use 10x scaling instead.

That could be a good enough fix for my personal use, but I’ll have to do some research first to find out the proper syntax’s to make the script check if a desktop resolution is true or false (I’ll use CodeBlocks).

If all you want is a specific integer scale I don’t think a script is necessary. You can set overrides per core or even per directory. So for example, say you want all your gameboy games to use 4x scaling, just set the scaling to 4x under video and then simply save the override to the directory your game boy games are in (do this through the core, under overrides).

I myself do this for cores that support multiple consoles, such as Sameboy, where i have a specific shader for gameboy games and another for gameboy color.

Well, I want different scaling factors based on the actual native monitor/TV resolution. If I use say 4x scaling because that fits my current overlay on a 1080p screen, on a 4K screen 4x scaling on a GameBoy libretro core would appear as a tiny postal stamp in the middle of the border overlay itself. Having a script running on the startup and editing the config text-files on the go before starting RetroArch would be beneficial (I’m a massive user of overrides myself for my emulation setup; I use overrides all the time).

I’m working on long forgotten super limited programing knowledge now to make a script; I’ve gotten some guidance already (“cheating” by browsing the web for syntax’s).

My script written in CodeBlocks seems good enough now to run different parameters based on separate if statements. The if statements checks for your current screen-resolution, and starts the selected batch file or exe file based on your screen resolution.

The issue now is to combine all this with the way I usually run RetroArch, through Kodi via a now deprecated plugin called Advanced Launcher. There I can launch any rom on a big list, and it’s configured with the right commands to successfully launch the right core from RetroArch and then inject the rom from the list to RetroArch itself.

I tried creating different batch-files for various screen-resolution (1080p, 1440p and 2160p), having the batch-files pointing to the RetroArch.exe file and using the command line argument --config to select a different config-file based on how many times I want to scale the image’s width- and height of the libretro core (based on the chosen screen resolution).

The script I created would then see what’s your current screen resolution, then start the 1080p config file if 1920x1080 is the selected screen resolution via the batch-file. The issue now is that I have currently no idea how to inject a game rom file-location to the batch file itself automatically. I can currently run any rom if I write the exact file location of that specific rom inside the batch-file, but I would love to be able to inject a game rom into a batch-file (which includes the location to RetroArch.exe and its command line arguments) simply by drag & drop, thereby making it possible to make it possible to run batch-files from Advanced Launcher.

I suppose I need some guidance when it comes to running game roms via batch-files without writing the exact file-location for each and every game (that would force me to make a whole lot of batch files). I know that the Advance Launcher plugin uses the “%rom%” command so games gets auto injected in RetroArch, but since I’m now using batch files to make RetroArch run different config-files, that kind of rom-injection doesn’t work any longer.

My retroarch guru friends, I really hope you can help me. Here’s the question.

Scenario: retroarch + mame core + arcade overlays.

When I use retroarch on my raspberry, the “general” video output of the hdmi port is set 1080p, so that when i “resize” the mame gaming area to fit inside the cabinet overlay (selecting custom viewport x,y, etc.), it suits perfectly as much as I connect my rasp to a huge 4k tv or if i connect it to a small 32 1080p TV. It’s because the whole screen (overlay and game) is set at the maximum resolution of 1080p, then the game area is resized (viewport) to a box inside the cabinet overlay.

But, when I use retroarch on my pc the “general” video output depends on the monitor/desktop resolution, so that when i resize the mame gaming area to fit inside the cabinet overlay (selecting custom viewport x,y, etc.) if it correctly displays on my lower resolution laptop, it doesn’t equally fit on my big monitor where I see a correct overlay but only a very small letterbox gaming area. It’s because the whole screen (overlay and game) is set at a different resolution, so that the gaming area appears of different dimensions.

Is there a way to force retroarch to output at a fixed resolution (not only menu, but mame too) so that when i resize the gaming area of games (custom viewport) it looks the same dimensions on different monitors/pcs?

Thanks a lot in advance.

matt