Emulators

RetroArch : Overlays

[ This article is available in French / Cet article est disponible en Francais ]


Today, I’m going to give you my feedback about the overlays in RetroArch.


But what is an overlay?

Overlays allow to add visual effects to an emulated game, it allows to simulate CRT screens or to add on the sides of the game an image that can be related to the console type, or in relation to the game itself.
The screens, at the time, were in a 4/3 format (rather square), now most screens are in 16/9 (rectangular), which leaves a blank space on the sides of the game.
Here’s what it can do with and without overlays :

Almost all emulators have a system of overlays, and when the emulator does not have it is possible to go through external program like RocketLauncher.

My opinion, which can be questionable, is to avoid going through this kind of program. Why ? because the configuration is already not very simple, if in addition you add an extra layer, you will quickly get lost and especially spend a lot of time. The simplest is to have a FrontEnd (Launcher-Box, HyperSpin, EmulationStation …) that directly launch your emulator (Retrorarch, Mame, Fba, Fba-Neo …)
Moreover, if the emulator changes its display system or changes its system of options, RocketLauncher will not succeed, it also seems to me that RocketLauncher is dependent on “AutoIt”
Retroarch handles overlays, as much as using it.


Overlays in RetroArch

I’ll quickly describe how RetroArch handles overlays,
The directory of Retroarch contains a tree of this form, look well the directory C:\retroarch\config\ et C:\retroarch\overlays\ , it is these 2 directories which are used to manage our overlays :

C:\retroarch\ 
    C:\retroarch\assets\
    C:\retroarch\autoconfig\
    C:\retroarch\cheats\
    ...
    C:\retroarch\config\
    C:\retroarch\config\FB Alpha\
    C:\retroarch\config\FinalBurn Neo\
    C:\retroarch\config\MAME\ 
    C:\retroarch\config\Reicast\ 
    ...
    C:\retroarch\overlays\
    C:\retroarch\overlays\FB Alpha\
    C:\retroarch\overlays\FinalBurn Neo\
    C:\retroarch\overlays\MAME\ 
    C:\retroarch\overlays\Reicast\ 
    ...
    C:\retroarch\system\
    C:\retroarch\thumbnails\

When you start a game, Retroarch will test the presence of several files and load them if they exist. This is the closest configuration to the game that has priority :

  1. First reading the general configuration (retroarch.cfg)
  2. Reading the general configuration of the core for the loaded game, examples :
    • C:\retroarch\config\FB Alpha\FB Alpha.cfg (for fbalpha_libretro.dll)
    • C:\RetroArch\config\MAME\MAME.cfg (fot mame_libretro.dll)
  3. Reading of the configuration of the platform type (CPS1, CPS2 …) OR reading of the configuration set with the option “–appendconfig PATH_AND_FILENAME.cfg“.
    Warning: Retroarch does not load the 2 files, it is one or the other, in priority the file which bears the name of the platform emulated.
    • C:\RetroArch\config\MAME\Capcom Play System.cfg
    • C:\RetroArch\config\MAME\Capcom Play System II.cfg
    • C:\RetroArch\config\MAME\Capcom Play System III.cfg
    • C:\retroarch\config\FB Alpha\Capcom Play System.cfg
    • C:\retroarch\config\FinalBurn Neo\Capcom Play System.cfg
  4. Last, read the configuration for the loaded game, examples:
    • C:\retroarch\config\FB Alpha\sfiii3.cfg (for Street Fighter III with FBAlpha)
    • C:\RetroArch\config\MAME\jojo.cfg (for JoJo’ with Mame)

It is therefore in these files, in text format, that the configuration tells Retroarch whether to load a overlay configuration or not: This file DOES NOT contain the overlay configuration, it just indicates the path and the name of the file that contains the overlay settings.
Take the example of C:\RetroArch\config\MAME\MAME.cfg, this file contains the configuration of the core mame_libretro.dll :

state_slot = "0"
input_overlay = ".\overlays\mame\mame.cfg"
input_overlay_scale = "1.020000"

This configuration file contains the path and name of the configuration file for the overlay, so in our example the real configuration file is “.\overlays\mame\mame.cfg“.

Here is the contents of the file C:\RetroArch\overlays\mame\mame.cfg :

overlays = 1
overlay0_overlay = "mame.png"
overlay0_full_screen = true
overlay0_descs = 0

It is in this file that you will find the configuration of the overlay of our core. Warning for FBA: if you put a relative path in a configuration file (not in the overlay file), example input_overlay = “.\overlays\mame\mame.cfg” in C:\retroarch\config\FB Alpha\FB Alpha.cfg , it will absolutely be necessary that the directory of launching (or directory of work) corresponds to the directory containing “retroarch.exe”.

Let’s take an example, if we want to launch the game sfiii3 “Street Fighter III: New Generation (Euro 970204)”, this is what it will give:

  • to run program retroarch.exe -f –verbose -L cores\fbneo_libretro.dll –appendconfig “.\config\MAME\MAME-CPS3.cfg” “D:\Games\Capcom Play System III\sfiii.zip”
  • Reading the general configuration file (retroarch.cfg)
  • Loading core : FinalBurn Neo ( “.\cores\fbneo_libretro.dll” )
  • Loading game : sfiii.zip
  • Retroarch searches for and loads the configuration of the core if its file exists : “.\config\FinalBurn Neo\FinalBurn Neo.cfg
  • Retroarch is looking for an additional configuration file (appending config):
    • Find the file that has the name of the emulated platform : “.\config\FinalBurn Neo\Capcom Play System III.cfg
    • IF the file above ( .\config\FinalBurn Neo\Capcom Play System III.cfg ) does not exist AND the option “– appendconfig ” is present, Retroarch will load the file put with this option : “.\config\MAME\MAME-CPS3.cfg”
    • Warning: Retroarch does not load the 2 files, it is one or the other, in priority the file which bears the name of the platform emulated.
  • Retroarch searches and loads the game’s configuration if its file exists : “.\config\FinalBurn Neo\sfiii.cfg
  • When Retroarch is closed, configuration changes are saved in the “retroarch.cfg” file unless the config_save_on_exit = “false” option is present.
    Warning: if the additional configuration file is loaded (and used) with the “– appendconfig” option, the “input_overlay” option in the “retroarch.cfg” file will be changed with the last overlay loaded! So I recommend you to pass this option config_save_on_exit = “false” in your file “retroarch.cfg”

Overlays according to the Emulated Platform

Some cores like MAME, FBA … emulate different types of platforms (CPS1, CPS2 CPS3, NeoGeo …) and in some cases you will not be able to put the configuration of the superimposition in the configuration file of the core (“MAME.cfg” or “FB Alpha.cfg “).
Two solutions:

  • Use the emulated platform configuration file (“Capcom Play System III.cfg” …) (recommended but not always available)
  • Use the “–appendconfig” option to specify the configuration file for the launched platform.

For example, for the game “sfiii3” with MAME, RetroArch will look for the following configuration files: “config\MAME\MAME.cfg“, “config\MAME\Capcom Play System III.cfg“, then “config\MAME\sfiii3 .cfg“.
If the file “config\MAME\sfiii3.cfg” exists, it is that the visual will be adapted to the game so no problem.
If the file does not exist, this will be the file “config\MAME\MAME.cfg” that will give the configuration, and since MAME is cross-platform, this may be a problem if your overlay displays the image on the screen as the name of the file. the platform (example “CPS3”.)
The solution is to use the “config\MAME\Capcom Play System III.cfg” file that corresponds to the emulated platform.
Here is a list of platform files for MAME:

  • Arcade.cfg
  • Capcom Play System.cfg
  • Capcom Play System II.cfg
  • Capcom Play System III.cfg
  • Cave.cfg
  • SNK Neo Geo.cfg

For example :
Your Frontend launches CPS3 games using the “mame_libretro.dll” core with a command that looks like this:

retroarch.exe -L cores\mame_libretro.dll %PATH_OF_YOUR_GAMES%
or
retroarch.exe -L cores\mame_libretro.dll C:\gmaes\cps3\sfiii3.zip

RetroArch will therefore look for the following configuration files : “config\MAME\MAME.cfg” puis “config\MAME\sfiii3.cfg“.
If the file config\MAME\sfiii3.cfg exist, is that the visual will be adapted to the game so no problem. If the file does not exist, it will be the config file “config\MAME\MAME.cfg” which will give the configuration, and as MAME is multi-platform this poses a problem.

The solution is to delete the config file ” config\MAME\MAME.cfg ” and then create a file per platform like this for example:
config\MAME\MAME-CPS3.cfg :

input_overlay = ".\overlays\mame-cps3\mame-cps3.cfg"

config\MAME\MAME-CPS2.cfg :

input_overlay = ".\overlays\mame-cps2\mame-cps2.cfg"

Then in your Frontend you will add this option –appendconfig config\MAME\MAME-CPS3.cfg ” for launched CPS3 games, it gives something like this:

retroarch.exe -L cores\mame_libretro.dll --appendconfig  config\MAME\MAME-CPS3.cfg %PATH_OF_YOUR_GAMES%
or
retroarch.exe -L cores\mame_libretro.dll --appendconfig  config\MAME\MAME-CPS3.cfg C:\gmaes\cps3\sfiii3.zip

Do the same thing for each platform, on Launch-box it gives this:

Obviously, I let you adapt your configuration files as you want (“config\MAME\MAME-CPS3.cfg’ … ), do not forget to create the directory “overlays\mame-cps3\mame-cps3.cfg” and put the files in with the proper configuration.


Do not change the configuration anymore

To no longer save the configuration when you leave RetroArch, and be sure that your configuration will not change anymore, you can add / modify this option in the file “retroarch.cfg”

config_save_on_exit = "false"

Various

# Activate or not pause when Retroarch is not active :
pause_nonactive = "false"
# Activate or not the pause when the menu of Retroarch is displayed : 
menu_pause_libretro = "false"
# Automatically add the game to the playlist :
automatically_add_content_to_playlist = "true"
# Active log :
content_runtime_log = "true"
input_overlay_show_physical_inputs = "true"
log_verbosity = "true"

Conclusion

As you can see, the configuration is not so simple. But you can, at first, only create the overlays for the core(s) you use. I advise you to download the configuration files already prepared. I will soon post a link to download the ones I own.

One thought on “RetroArch : Overlays

Leave a Reply