Retroarch

Retroarch is a frontend for different Libretro cores. You can think of it as a multisystem emulator, altough it can do more than emulate games (like play videos or run stand-alone games).

Libretro doesn't develop versions of Retroarch or Retroarch cores compatible with the SNES Classic. Instead, individuals or groups take this task upon themselves. Among these is KMFDManic, that signalises the versions or Retroarch and cores compiled by him with a "km" prefix, and Mod My Classic, who tipically doesn't rename their versions, but at one point called thir version of Retroarch of "Retroarch Neo". There is also Retroarch Clover, that was compiled by Cluster(?).

Updating Retroarch
When Retroarch is updated from a previous, compatible version, the files retroarch.cfg (regarding global options when no override is in place ?), and retroarch-core-options.cfg (regarding core-specific options, in Quick Menu --> Option, when no override is in place ?) get overwritten by default files.

Overrides, on the /overrides folder, and overlays, in the /overlays folder, don't get deleted.

Directories structure
/etc/libretro/config - where options, overrides, and remaps are stored.

/etc/libretro/joypad_autoconf - where joypad configurations are stored (?).

Dummy Folder method
It is a method used by KMFDManic to load games. It consists in having the games inside a folder and using the Load Content option on Retroarch. KMFDManic tipically calls thes folder _dummy, hence the method name.

Features
There are plenty of options to mess around on Retroarch.

Fast forward
It is possible to enable fast forwarding on Game Boy games.

Retroarch overlays
Retroarch borders are different than the stock system borders. While the SNES Classic stock borders are background images (i.e.: they are situated "behind" the gameplay window), Retroarch uses overlays. These are images that go "on top" of the gameplay area.

There is a project called The Bezel Project that intended to add game-specific borders to all games of all platforms for the Raspberyy Pi. It has been adapted to the Sega Mega Drive/Genesis Mini by a user, but not for the SNES Classic as of yet.

Retroarch overlays can't change hue/luminosity/saturation on the fly.

Overlays by default are stored in /etc/libretro/overlays (?). /media/hakchi/retroarch/overlays ? can also be used.

Run-ahead
It is possible to enable run-ahead in order to reduce input lag in some less demanding cores, like NES emulator cores.

A NES Classic running RetroArch with run-ahead: https://www.reddit.com/r/minines/comments/ev3hiw/super_mario_bros_on_nes_mini_using_retroarch_181/

Cores
Retroarch cores can be installed by either the Modules tab on Hakchi2CE, the transfer folder method, or, for more advanced users, placing the required files (.so file ?) in the directory /etc/libretro/core.

In some cases, RetroArch cores compiled (built ?) for usage on a Raspberry Pi will work on the SNES Classic as well; but individuals and groups have also adapted them and made specific variants.

To run SNES games through Retroarch the user will need a Snes9x core. There are several different Snes9x cores, that come with a number. Usually the SNES9x with lower numbers are less accurate and less resource intensive.

Stand-alone games?

 * 2048


 * Mr.Boom, Bomberman-like game. Allows (online ?) multiplayer of up to ??? players.


 * xRixk, a Rick Dangerous-like game. What button does what?


 * Dinothawr, The first stand-alone game for Libretro (?).

Game engines

 * NXEngine, A port of the NXEngine for Libretro. NXEngine is a clone engine (?) of the original engine of the game Cave Story. It is a game engine that allows the user to play Cave Story. The player needs to add the .exe executable of the original freeware game (or one of its mods, such as translations) to Hakchi2 CE, then add the remaining files from the original game to the CLV game folder. Suspend points do not work (?)


 * PrBoom, PrBoom is a game engine, clone of the engine of the original Doom game. It initially stood for Proff Boom, Proff being the online handle of one of its developers. It was ported as a Libretro core, being available as a Retroarch core for the SNES Classic. Available on the KMFDManic's mod hub. It will run .wad files (obtained separatelly). Wads can't be compressed? It is not compatible with the Brutal Doom game mod. Patton Play's video


 * TyrQuake, Allows to run the game Quake.


 * RPGMaker

Computers, arcades and consoles emulators

 * DosBox, a DOS emulator.


 * Gambatte, Game Boy and Game Boy Color emulator. Gambatte is a japanese word, it means approximatelly "go for it" or "do your best".


 * Genesis Plus GX, An emulator of multi Sega systems. It emulates the Mega Drive, Master System, Game Gear, and the Sega CD (?).


 * GLupeN64, Nintendo 64 emulator. Hit-or-miss performance.


 * mGBA, Overall the best Game Boy Advance emulator. Does not require a separated BIOS file. Some games present audio glitches, like popping audio. Supports save states. Also emulates both Game Boy and Game Boy Color, and has support for Super Game Boy borders (and palletes ?).


 * PCSX ReARMed NEON/PEOPS/Unai, PlayStation emulator. NEON, PEOPS, and Unai are plugins (?). NEON is the most recommended overall, with PEOPS being recommended as an alternative for when NEON has problmens on the plaback of FMV, like in Metal Gear Solid ?


 * Snes9x (various), A SNES emulator. Its name and origins come from Snes97 and Snes98 (?), different emulators that were then merged, creating Snes9x. Usually the bigger the identifier number, the more resource intensive it is. MSU1 games should be tried with Snes9x2016* or Snes9x2018.


 * FB Alpha (various), Emulator of varous arcades machines, and other systems, like Neo-Geo MVS, and Neo-Geo AES (?). Ussually the greater the number identifying the core, the more resource intensive it is.


 * gpSP, Game Boy Advance emulator. An alternative for the games that mGBA can't run well. Requires a BIOS file (the Normatt's open source GBA BIOS can be used, altough it is not as good as the official). Saves states don't work reliably. May present some audio and graphical glitches.


 * MAME (various), MAME stads for Multi Arcade Machine Emulator, and as it implies, MAME is an emulator of various arcades machines (and other systems ?). Usually the bigger the identifier number the more resource intensive it is. Save states don't work reliably.


 * PicoDrive, Multi Sega platforms emulator. Emulates the Sega 32X, unlike Genesis Plus GX. .m3u files do not work in PicoDrive.


 * Stella, An Atari VCS (2600) emulator.


 * Flycast Xtreme, a Dreamcast emulator.


 * Reycast Xtreme, exactly the same core as Flycast Xtreme


 * Patton Play's video on arcade games

Non-game related cores

 * Imageviewer, Displays image files, like .jpg and .png files (?)


 * ffmpeg, A barebones media player.

BIOS files
Name and location of BIOS files can be found on Libretro's site: https://docs.libretro.com/library/bios/#links-to-the-core-specific-bios-information

In order to work properly, some cores need what are called BIOS files. Sometimes BIOS files are not required but may improve gameplay, so some people recommend using BIOS files. BIOS files may go in  if the user is using an OTG adapter, and should go in /etc/libretro/system in the SNES Classic if the user is not using an USB flash drive. In some cases, however, it may be needed a subfolder inside the system folder, for example  or

To check of the BIOS is being detected by the Retroarch core, the user may go to the Retroarch menu with the core in question loaded, then go to Main Menu --> Information --> Core Information, in the section Firmware(s):.

Criticism
At least one study found out that using Retroarch instead of the stock SNES emulator Canoe would lead to an increased input lag.

The stock rewind function is not available is playing through Retroarch.

It is criticized for being complicated for the end user, apparently some developers aren't woried with it: It is not up to us to educate you on what a ‘shader’ is, everybody who even remotely has any interest in modern day GPU or GL programming knows what it is.

Interface
Called "menu driver". The main ones are rGUI, XMB, and Ozone.

Quick Menu
A number of core-specific options that can be changed.
 * Options


 * Create game-options file - If selected, the options will be saved for the loaded content (game) only.
 * Frameskip - indicates a number of frames to be skipped. May help with audio issues.

For rebinding keys (remaps). These remaps should then be saved by selecting.
 * Controls


 * Save Game Remap File - For saving rebinds set on the  options for the specific game loaded.
 * Save Core Remap File - For saving rebinds set on the  options for the specific core loaded.

Remaps by default are saved into /etc/libretro/config/remaps/CORENAME but it can be changed in settings --> Directory to something with easier access like /media/hakchi/config/remaps

Allows the use of cheats in game. Cheats need to be loaded beforehand (usually by a specific cheats hmod), then the cheats need to be enabled and applied (?).
 * Cheats

Cheats can also be added manually by dropping .cht cheat files on the directory  by using FTP. This address can be changed in Settings --> Directories --> Cheats (for example to media\hakchi\retroarch\cheats). In this case (it seemes like if the directory for cheats is chenged, automatically loaded cheats keep being created in the default location, and they won't be found when the game is loaded; the ollowing workaround mimics the directory and file existing on the default location), in order to cheats load automatically, there should be a folder with the name of the core, and a .cht cheat file with the same name as the game file (for example media\hakchi\retroarch\cheats\GLupeN64\the_legend_of_zelda_ocarina_of_time.cht).

A specifc important case for Ocarina of Time: https://www.reddit.com/r/miniSNESmods/comments/9nsvke/zelda_ocarina_of_time_delay_menu_fix_for_glupen64/

the hmod does not work anymore. It seems to use old Retroarch directories. Instead, copy the .cht cheat file and paste it onto the cheats directory (yyou may want to rename the file to the same name as the game file name, and place it into a folder named as the core, in turn inside the cheats directory, in order for the cheat be loaded automatically).


 * Shaders

For creating or updating an override for the specific game or core loaded. If there's already an override in place and changes are made, but the override is not updated, the override (with the old setup) will be loaded and the recently made changes will be lost. To avoid this, the override should be updated after the desired changes.
 * Overrides

To delete overrides in place, it is necessary to FTP into the SNES Classic to the directory  (or   in older versions of Retroarch - is there any equivalent address on USB ?) and delete the corresponding .cfg files.

Settings

 * User Interface
 * Menu Widgets - This controls if notifications (but not overrides notificatinos?) are displayed or not. If set to OFF, no controller, disk swapping, or achievements will be displayed, but overrides notifications will still be displayed?

Image options
 * Video
 * V-sync - if the game is running faster than ideal, turning v-sync on may help

These changes also change the behavior of keys on the Retroarch menu itself. (?)
 * Input
 * Input Hotkey Bind
 * - this key needs to be held down when pressing a hotkey for the hotkey have effect. The button selected to this function stops working on the RetroArch menus (?).


 * Frame Throttle
 * Rewind
 * - allows for the rewinding of gameplay if it is set to ON. It may impact the performance of games, resulting in slowdowns.
 * - it is possible then to adjust the rewind granularity (what is it?)


 * Onscreen Display
 * Onscreen Notifications - It controls wether or not overrides notifications (?) will be displayed. If set to OFF, no overrides notification ? will be displayed.

Kiosk Mode is a mode where most settings become unavailable to be changed (?).
 * Enable Kiosk Mode

It is possible to set a password to disable the kiosk mode, which can then be done on the Main Menu. If no password is set, it will be necessary to mannually edit a RetroArch configurations file retroarch.cfg to disable the kiosk mode.
 * Set Kiosk Mode password

Compiling RetroArch and RetroArch cores builds
How to compile a RetroArch (and cores) build that can be installed on the SNES Classic?