Monday, October 14, 2013

RetroArch Overlay Borders

RetroArch has long had support for fun borders/backgrounds that can fill the unused black space on HDTVs using a specially crafted shader combined with an image, as described in a previous post. However, this system can be finicky and it isn't very forgiving of different screen sizes and aspect ratios. There is another way to achieve a similar outcome, though, using RetroArch's built-in overlay system.
Gameboy border pictured with Harlequin's Gameboy shader
This system was designed to provide onscreen touch controls for the Android and iOS ports of RetroArch, but we can use the same hooks on PC to display our borders. All you have to do is add this to the bottom of your retroarch.cfg:
input_overlay = "/path/to/overlay.cfg"
You can also load overlays directly from the in-game RGUI menu under Settings > Overlay Options.

The overlay.cfg file is extremely simple, containing only 4 short lines (you can either copy these into a blank text file yourself or use the one I include in the download at the bottom of the post):
overlays = 1
overlay0_overlay = border.png
overlay0_descs = 0
overlay0_fullscreen = true
 
This file tells RetroArch that there will only be 1 overlay, which image to load as the border (in this case, border.png, located in the same directory as the overlay.cfg), that there will be no buttons attached to the overlay (that is, for touchscreen controls) and that it will take up the full screen, including any black space.

In addition to these border effects, you can also use this system to apply semi-transparent overlay effects, such as scanlines, which can be useful in very low-power settings, such as on Raspberry Pis, homebrew-capable Nintendo Wiis or older cell phones that can't handle even lightweight scanline shaders. Even some MAME "rgb" effects can be used with this system with minor modification.

This system will work fine with the borders from my previous post, and here's a bunch more (formatted for 1920x1200 displays) from NeoGaf user richisawesome.

Here is the download (contains border.cfg, two example borders and an integer scale Cg shader, though the shader should not be necessary now that you can force integer scaling through RGUI):

7 comments:

Aaron said...

Are you Hunter Kaller, Sewanee C'04? Aaron Brown here.

Hunter K. said...

Hey man, yeah, that's me. How're things??

Gnalvl said...

Sorry to change the subject slightly, but do you know if Retroarch has does any emulation of GB and GBA link cables? In other words, is VBA Link still the only way to do i.e. LTTP: Four Swords?

Hunter K. said...

@Gnalvl
No problem. No link functionality in libretro-VBA-next or libretro-VBAM, though I could be mistaken. I believe libretro-TGB-Dual does GB/C linking, but I'm not totally sure on that.

Gnalvl said...

Hmm, well at least in regards to GBA, it seems we found the one thing Retroarch DOESN'T do.

Do you know anything about the new "Phoenix-Retroarch" front end? It comes separately now, and I downloaded the zip, but then there's no exe in it. I'm hoping that if I can at least get that working, then setting up netplay will become less daunting.

Hunter K. said...

Heh, it's actually the other way around. The Phoenix launcher is deprecated, so it's not in the "megapack" download. You can still get the source from github, though, and it still works for configuring most things, particularly netplay, which is otherwise only accessible via command line, IIRC. Some things are broken, though, such as input mapping for xinput devices.

If you're wanting to use netplay, there will likely be an overhaul at some point in the future that either replaces or provides an alternative to the existing (often finicky) GGPO/rollback-style implementation.

Gnalvl said...

That would explain why the current "in-game" GUI seems to work fine for most things... netplay really seems to be the only thing it's missing. I suppose if I googled up someone's command line launch examples for netplay I could scrape by without phoenix. It does make me miss ZSNES 1.42's simple "punch in the IP and press go" netplay dialog window.

Analytics Tracking Footer