-
Notifications
You must be signed in to change notification settings - Fork 13
RGUI
RGUI is a simple built-in GUI for RetroArch. It is designed to allow the console experience, where everything is controlled from a joypad. It focuses on being useful, and not particularily flashy. It was originally introduced in the Wii port of RetroArch. It has been refitted to serve as the default UI in RetroArch and is now present on Wii, PC and mobile ports.
RGUI is currently only supported on hardware accelerated video drivers (OpenGL / D3D9). Trying to use RGUI with SDL or XVideo drivers will probably crash, or show you a black screen.
From command-line, RetroArch has a simple lifecycle, you start up a game and exit. Starting a new game, you would need to start RetroArch again. RGUI adds a layer on top of this model.
While RGUI cannot configure absolutely everything, it can do the most common things you would want to do while using RetroArch.
- Selecting libretro core
- Load a game
- Tweak per-libretro core options (e.g. colorization in GameBoy)
- Load game from history (previous games played)
- Save/load savestates
- Configure shaders
- Configure aspect ratios
- Configure integer scale
- Toggle fullscreen
- Swap disk images (needed for PlayStation, see notes below!)
- Take screenshots
- Enable/disable real-time rewind
- Simple input configuration
- Mute/unmute audio
- Exit RetroArch (yes, sadly :p)
By default, RetroArch looks for a config in various places depending on OS:
-
Linux/OSX:
$XDG_CONFIG_HOME/retroarch/retroarch.cfg
, then~/.config/retroarch/retroarch.cfg
, then~/.retroarch.cfg
, and finally, as a fallback,/etc/retroarch.cfg
. -
Windows:
retroarch.cfg
in same folder asretroarch.exe
, then%APPDATA%\retroarch.cfg
.
To override this, use retroarch --config customconfig.cfg
. If you have some special options you want to store in separate config files you can use retroarch --config baseconfig.cfg --appendconfig specialconfig.cfg
. See man-page and/or --help
for detail.
To help creating configs with a GUI, RetroArch-Phoenix is a suitable frontend.
The config file with all options are documented here. On Linux and OSX, it is normally installed to /etc/retroarch.cfg
. On Windows releases you'll find it in the directory along with retroarch.exe
after a fresh zip extraction (it quickly gets overwritten).
While you are changing settings in runtime, they are not saved to disk afterwards on PC. By design, the config file is considered immutable as it is likely maintained by the user, and should not be overwritten behind the users back. This is not the case on consoles however, where looking at the config manually isn't really an option for most users.
By default on PC, the F1 button will enter the menu.
To exit the menu, use F1 or Resume Game
.
To start immediately in RGUI without any game or core loaded, use
the --menu
command line option. As a special case, if no arguments are received, it is treated the same as running retroarch --menu
.
Menu toggle button can be mapped to joypad as well, see option input_menu_toggle
option in retroarch.cfg
.
RGUI is controlled like any other libretro core. Regular input binds will apply, and binds here are defined in terms of the RetroPad, RetroArch's joypad abstraction.
- A button (Default PC: X): Accept/OK
- B button (Default PC: Z): Back/Cancel
- Start (Default PC: Return): Go to main settings menu
- Select (Default PC: Right shift): Set a setting to default
- Up/Down D-pad (Default PC: Up/Down keys): Browse settings/files
- Left/Right D-pad (Default PC: Left/Right keys): Toggle settings, or browse several items at once in file browser.
To load a game you need a libretro core to use, and a ROM.
Selecting Core
from top menu, you can browse for a libretro implementation.
Where the browser starts depends on your libretro_path
config.
If blank, it will start in root (tedious to browse). If libretro_path
is a directory,
RGUI will use that as top folder. If libretro_path
is a full path, it will start in the folder where the file is.
Libretro cores are dynamic libraries (dll/so/dylib), and must be built or downloaded from somewhere else. On Windows, cores for x86 and x86_64 can be downloaded from RetroArch-Phoenix's updater. If you want to build from source, or have a look at what's available, see Libretro organization. In particular, check out libretro-super.
After loading a libretro core, you will see the name and version of the core in lower part of screen.
You can then browse for a ROM with Load Game
. To control where RGUI starts to browse for roms, set rgui_browser_directory
in config. If not set, it'll start in root.
The browser will filter out extensions for the last core set in Core
, and use that core when a ROM is loaded. If libretro_path
in config is set with a full path to a core, this core is automatically selected once RGUI boots up (but you can still change the core afterwards).
As ROMs are loaded, ROM and libretro core combinations are saved to history.
To load these recently loaded games, use Load Game (History)
.
The history is saved to a file in same directory as RetroArch config file. If no config file was loaded in startup, history will not be saved or loaded, and will not exist in the main menu.
The format of this history file is a simple plaintext file with format:
rom-path1
libretro-core-path1
core-name1
rom-path2
libretro-core-path2
core-name2
...
If rom-path is blank (just a newline), RetroArch will attempt to load the core without a game.
The old format for history was rom-path1;libretro-core-path1;core-name1
.
However, this was found to be a bad idea as ';' is a valid path name.
The behavior was fixed, and RetroArch used a new default path for history files (.retroarch-game-history.txt
instead of .retroarch-history.txt
). To convert to the new format, just rename the old history file, and replace ';' with newlines directly.
RGUI allows you to mix and match various shaders with arbitrary (up to 8) shader passes, with custom hardware filters and scale factors.
Shaders are user-supplied, and therefore not shipped with RetroArch on PC. We maintain a fairly large repository of various shaders in common-shaders. You can download a .zip of the repo on Github.
While RetroArch supports XML shaders in .shader format, they are deprecated as of 0.9.9-wip1. They will still be supported as before (in video_shader
), but they are considered second class citizen now.
RGUI does not support mixing and matching with XML shaders as they don't fit well into a mixing and matching scenario. Cg shaders (.cg), and straight GLSL formats (.glsl) are supported. Their multi-pass preset variants (.cgp for Cg, .glslp for GLSL) are also supported.
Shader settings can be found in Video Options
. The fundamental options are:
- Apply Shader Changes: After changing shader settings, use this to apply changes. Changing shader settings is a somewhat expensive operation so it has to be done explicitly.
- Default Filter: Choose hardware filter to use if a shader pass is not explicitly defined.
- Load Shader Preset: Load a Cg/GLSL preset directly. The RGUI shader menu is updated accordingly. If the CGP uses scaling methods which are not simple, (i.e. source scaling, same scaling factor for X/Y), the scaling factors displayed in RGUI might not be correct.
- Shader Passes: Number of shader passes to use. If you set this to 0, and use Apply Shader Changes, you use a "blank" shader. The Default Filter option will affect the stretching filter.
For every shader pass you can configure:
-
Shader #N: Path to shader. All shaders must be of the same type (i.e. .cg or .glsl). Set
video_shader_dir
in config to set where browser starts to look for shaders. - Shader #N Filter: Hardware filter. If "don't care" is set, Default Filter will be used.
- Shader #N Scale: Scale for this pass. The scale factor accumulates, i.e. 2x for first pass and 2x for second pass will give you a 4x total scale. If there is a scale factor for last pass, the result is stretched to screen with filter specificed in Default Filter. If "don't care" is set, either 1x scale or stretch to fullscreen will be used depending if it's not the last pass or not.
When you apply shaders, the RGUI shader settings are saved to a temporary file (either rgui.cgp or rgui.glslp) and loaded. The file persists after RetroArch exits. The file is saved to video_shader_dir
directory in config. If you always want to load the RGUI preset on bootup, you can set video_shader
option to this file.
In some cases, Cg shaders cannot be supported. This goes for OpenGL ES drivers, and when EGL OpenGL contexts are used (KMS mode for instance). Using nVidia's cgc
compiler, you can convert Cg shaders to GLSL shaders with the cg2glsl
tool developed by us here. It can convert single shaders as well as whole folder structures in batch.
100% compatibility is not guaranteed, but almost all shaders should work fine. Cg presets (.cgp) are not converted at the moment, but converting them is as simple as copying over the .cgp, rename it to .glslp and replace references to .cg files to .glsl.
Currently you can configure two settings per player (on PC):
- Device: Picks which gamepad to use for player N. A description of the pad is currently only available on Linux.
- Device Type: Picks which device type to use. This is relevant for the libretro core itself, and mostly useful for PlayStation, which needs to know if you're using a DualAnalog device or not.
Android and Wii ports allow you to configure binds more directly.
This part of RGUI is still somewhat immature on PC. We would ideally like a more direct way to configure input binds on PC here.
There are a couple of options available to configure input outside RGUI.
- RetroArch-Phoenix: This is probably the most convenient option at the moment if you like point-and-click GUIs.
-
retroarch-joyconfig: A command-line tool (part of RetroArch package) which lets you get input from a joypad and update or create a config file. To update a config with new binds for player 1 using joypad #0, you would for example do
retroarch-joyconfig --player 1 --joypad 0 --input ~/.config/retroarch/retroarch.cfg --output ~/.config/retroarch/retroarch.cfg
(see--help
or man page for more help). By default, only RetroPad binds are bound. You can use--misc
to bind other hotkeys as well. If you want to useretroarch-joyconfig
, you should build latest from Git (after 0.9.9-wip1) as a couple of needed changes were made to improve usability.
There's currently no support for DirectInput in retroarch-joyconfig so using it on Windows could potentially give wrong binds if SDL and DirectInput bind things differently. Using Phoenix GUI to config input is recommended at the moment.
Linux port recently (after 0.9.9-wip1) got support for joypad hotplugging. This allows joypad to be plugged in and out of your machine while running. To have a more console-like experience, RetroArch supports joypad autoconfiguration, where the input config is updated depending on which devices are plugged in.
To enable this, set the joypad_autoconfig_dir
option to a folder where you store autoconfigs (*.cfg).
Input autoconfigs can be created with recent build of retroarch-joyconfig (--autoconfig
option).
An example command line is: retroarch-joyconfig --joypad 0 --autoconfig ~/.config/retroarch/autoconf/xbox.cfg
.
Input configs have a simple format, e.g.:
input_device = "Xbox 360 Wireless Receiver"
input_driver = "linuxraw"
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "6"
input_start_btn = "7"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "11"
input_right_btn = "12"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "4"
input_r_btn = "5"
input_l2_axis = "+2"
input_r2_axis = "+5"
input_l3_btn = "9"
input_r3_btn = "10"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"
input_rewind_axis = "+4"
input_menu_toggle_btn = "10"
Since binds are per-device and not per-player, input_playerN_* prefixes are changed to just input_*.
Some PlayStation games require disk swapping. To manage disks, libretro has a concept of a disk index (like a multi-disk CD player, remember those? :P).
If a PlayStation core is loaded, Disk Index
and Disk Image Append
options are added to main menu.
In Mednafen PSX, multi-CD images are typically handled with an .m3u playlist. In this case, you can swap disks by cycling through the Disk Index setting. If you don't or can't use a playlist, you can append a disk image on the fly using Disk Image Append
. In this case, you browse for a disk image and append it to the internal disk image list. The Disk Index
is updated appropriately and you are returned to the game.
Replacing the disk inside RGUI is "physically" speaking the same as ejecting, swapping disks and closing the tray instantanously. Some games will not work with this approach, notably Metal Gear Solid because they need to detect an actual eject taking place.
To work around this, set Disk Index
to No Disk
, and exit RGUI. The game will pick up that the tray has been ejected/missing disk after half a second or so. Now you can go back to RGUI, pick the correct disk index and return to the game.
This feature is still fairly new, and might change behavior over time as kinks (as noted above) are worked out.