# Controllers Configuration

RetroBat has a built-in feature that will automatically configure a controller based on the SDL library, in most cases, if you own a branded controller (XBox, Sony, Nintendo Switch Pro, 8BitDo...), there should be no user action to perform, the controller will be configured automatically.

In some cases however, if the autoconfiguration does not work or if the mapping generated by RetroBat is not correct, RetroBat has 2 additional options to let you configure your controller properly:

* [disable RetroBat auto-configuration](#disabling-autoconfiguration) completely and perform your own configuration for each system (or for a specific game)
* [override RetroBat configuration](#using-retrobat-overrides) with override files

{% hint style="warning" %}
Controller configuration is performed at emulator level. This means that if you configure your controller manually (for example in RetroArch) and later launch a game for another system but on the same emulator and if you enable autoconfiguration, it will erase your manual configuration.
{% endhint %}

## General Controller Configuration

RetroBat automatically detects and configures most of the branded controllers available on the market, however, if the controller is not directly recognized, just press a key on the controller and the following menu will appear:

<figure><img src="https://i.imgur.com/C8T3fn5.png" alt=""><figcaption><p>Press and hold any button</p></figcaption></figure>

Press and hold any button to go to the **CONFIGURATION** screen

<div align="left"><figure><img src="https://i.imgur.com/NhgVTbZ.png" alt=""><figcaption></figcaption></figure></div>

Press each button according to its position in order to finalize your controller mapping.

{% hint style="info" %}
If your controller does not have that many buttons, hold a button (long-press) to ignore the current line and skip to the next one.

Note that at least you need to map A, B, D-PAD, START, SELECT and Hotkey.
{% endhint %}

The table hereunder gives you the standard mapping for the following controllers:

* Microsoft XBOX
* Playstation
* Nintendo controller

<table><thead><tr><th width="184">Retrobat Key</th><th>Microsoft XBOX</th><th>PlayStation</th><th>Nintendo</th></tr></thead><tbody><tr><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FW8q8wzu0yW9Htt5h4zEA%2Fimage.png?alt=media&#x26;token=a4ae3ad3-3a80-4c28-8b15-92a1b5a80da7" alt="A"></td><td>A</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FbHRmzwoI5wClB8FbYiNw%2Fimage.png?alt=media&#x26;token=4732dd67-7a1b-4b66-a57d-c2184c1ab908" alt=""></td><td>B</td></tr><tr><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FQlIryQa7tR2pBTWHhMXR%2Fimage.png?alt=media&#x26;token=e1940a32-2494-4e92-a8b1-df9a722ed4f8" alt=""></td><td>B</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FEc8Bfz4XUJRkD3NjYzly%2Fimage.png?alt=media&#x26;token=ae588362-a0ef-43ec-9370-0ba371f9a7b1" alt=""></td><td>A</td></tr><tr><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FxHRhyw00NGOZ8cEPrQdp%2Fimage.png?alt=media&#x26;token=d6027ace-7176-4b82-b702-e3b2b65d7cd4" alt=""></td><td>Y</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FnDcjqVOqc9lMUOtypL1A%2Fimage.png?alt=media&#x26;token=6576404a-4712-4f49-a253-3df7900866a1" alt=""></td><td>X</td></tr><tr><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2F5yYVjQu41LdiMVCXpyNa%2Fimage.png?alt=media&#x26;token=e43f5c0f-2c53-49cc-9271-2385216d89df" alt="" data-size="line"></td><td>X</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FJ4CtxULQ7Skwj6ssDiUb%2Fimage.png?alt=media&#x26;token=2c59c00d-2d93-46a4-bd9e-d1effdbcc79a" alt=""></td><td>Y</td></tr><tr><td>START</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FrKwbRqD6T7Y7ZUk9OxGS%2Fimage.png?alt=media&#x26;token=9b71c241-a8ed-46f1-9ed3-ebbb0f0659f2" alt=""></td><td>START / OPTIONS</td><td>+</td></tr><tr><td>SELECT</td><td><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FuopSAjeBJMlQh4eWRA7V%2Fimage.png?alt=media&#x26;token=c8fff4cf-71ce-4d46-816a-50e38ba22c09" alt=""></td><td>SELECT / SHARE</td><td>-</td></tr><tr><td>D-PAD UP</td><td>D-PAD UP</td><td>D-PAD UP</td><td>D-PAD UP</td></tr><tr><td>D-PAD DOWN</td><td>D-PAD DOWN</td><td>D-PAD DOWN</td><td>D-PAD DOWN</td></tr><tr><td>D-PAD LEFT</td><td>D-PAD LEFT</td><td>D-PAD LEFT</td><td>D-PAD LEFT</td></tr><tr><td>D-PAD RIGHT</td><td>D-PAD RIGHT</td><td>D-PAD RIGHT</td><td>D-PAD RIGHT</td></tr><tr><td>L1</td><td>Left Bottom</td><td>L1</td><td>L</td></tr><tr><td>R1</td><td>Right Bottom</td><td>R1</td><td>R</td></tr><tr><td>Left Analog UP</td><td>Left Analog UP</td><td>Left Analog UP</td><td>Left Analog UP</td></tr><tr><td>Left Analog Left</td><td>Left Analog Left</td><td>Left Analog Left</td><td>Left Analog Left</td></tr><tr><td>Right Analog UP</td><td>Right Analog UP</td><td>Right Analog UP</td><td>Right Analog UP</td></tr><tr><td>Right Analog Left</td><td>Right Analog Left</td><td>Right Analog Left</td><td>Right Analog Left</td></tr><tr><td>L2</td><td>Left Top</td><td>L2</td><td>ZL</td></tr><tr><td>R2</td><td>Right Top</td><td>R2</td><td>ZR</td></tr><tr><td>L3</td><td>Left Thumb</td><td>Left Thumb</td><td>Left Thumb</td></tr><tr><td>R3</td><td>Right Thumb</td><td>Right Thumb</td><td>Right Thumb</td></tr></tbody></table>

## Disabling autoconfiguration

If, for any reason, the default controller configuration does not work for you or if you want to tweak your system manually, there is a possibility to deactivate controller autoconfiguration and to manage controller configuration directly in the emulator/core itself.

Autoconfiguration can be disabled globally, per system or per game.

### **Global deactivation**

Open the [Main Menu](https://wiki.retrobat.org/navigation/main-menu) and go to **GAME SETTINGS.**

<div align="left"><figure><img src="https://i.imgur.com/LL6eTfL.png" alt=""><figcaption></figcaption></figure></div>

Disable **AUTOCONFIGURE CONTROLLERS.**

<div align="left"><figure><img src="https://i.imgur.com/USc60bs.png" alt=""><figcaption></figcaption></figure></div>

### **Per system d**eactivation

Open the [System View Options](https://wiki.retrobat.org/navigation/view-options) and go to **ADVANCED SYSTEM OPTIONS.**

<div align="left"><figure><img src="https://i.imgur.com/OwqDv4H.png" alt=""><figcaption></figcaption></figure></div>

Then set **AUTOCONFIGURE CONTROLLERS** to **OFF.**

<div align="left"><figure><img src="https://i.imgur.com/DnYtGMf.png" alt=""><figcaption></figcaption></figure></div>

### **Per Game d**eactivation

Open the [Game Options](https://wiki.retrobat.org/navigation/game-options) menu and go to **ADVANCED GAME OPTIONS.**

<div align="left"><figure><img src="https://i.imgur.com/tUJldiK.png" alt=""><figcaption></figcaption></figure></div>

Set **AUTOCONFIGURE CONTROLLERS** to **OFF**

<div align="left"><figure><img src="https://i.imgur.com/b6Z10Rc.png" alt=""><figcaption></figcaption></figure></div>

{% hint style="warning" %}
With AUTOCONFIGURE CONTROLLERS set to OFF, you need to configure your controllers directly in the Emulator.

To access the Emulator, you can go in the Retrobat System in the System View.

For RetroArch cores, you can create your own Game Controller mapping for the game by pressing F1 (hotkey + ![A](https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FW8q8wzu0yW9Htt5h4zEA%2Fimage.png?alt=media\&token=a4ae3ad3-3a80-4c28-8b15-92a1b5a80da7)) during game emulation and changing the controller configuration.
{% endhint %}

## Using RetroBat overrides

For some emulators, RetroBat has embedded a way to override the standard autoconfigure mechanism. Depending on the emulator, this can be achieved:

* by selecting among a set of different layouts (from the RetroBat options),
* by using override yml / json files (in RetroBat inputmapping folder)
* by enabling the detection for special controller types (gamepads with N64 or Genesis layouts, original controllers adapters...)

Here is the list of emulators that allow these override or that offer multiple layouts:

<table><thead><tr><th width="225.75">Emulator</th><th width="163" align="center">Multiple layouts ?</th><th width="138.5" align="center">File override ?</th><th width="217.75" align="center">Special controllers ?</th></tr></thead><tbody><tr><td><a href="specific_mapping/retroarch-controller-mapping">RETROARCH</a></td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr><tr><td><a href="specific_mapping/mame64-controller-mapping">MAME</a></td><td align="center">X</td><td align="center">X</td><td align="center"></td></tr><tr><td>FBNEO (standalone)</td><td align="center">X</td><td align="center">X</td><td align="center"></td></tr><tr><td>FLYCAST</td><td align="center">X</td><td align="center">X</td><td align="center"></td></tr><tr><td><a href="specific_mapping/dolphin-controller-mapping">DOLPHIN</a></td><td align="center">X</td><td align="center">X</td><td align="center">X</td></tr><tr><td>ARES</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>BIZHAWK</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>JGENESIS</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>KEGA-FUSION</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>MEDNAFEN</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>MUPEN64 (RMG)</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>SIMPLE64</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>2SHIP, SOH, GHOSTSHIP</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>PLAY!</td><td align="center"></td><td align="center">X</td><td align="center"></td></tr><tr><td>KRONOS</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>YABASANSHIRO</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>YMIR</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td>SSF</td><td align="center">X</td><td align="center"></td><td align="center">X</td></tr><tr><td><a href="../../systems-and-emulators/supported-game-systems/arcade/sega/sega-model-3#controls">SUPERMODEL</a></td><td align="center"></td><td align="center">X</td><td align="center"></td></tr><tr><td><a href="specific_mapping/model2-controller-mapping">MODEL2</a></td><td align="center"></td><td align="center">X</td><td align="center"></td></tr><tr><td><a href="specific_mapping/teknoparrot-controller-mapping">TEKNOPARROT</a></td><td align="center"></td><td align="center">X</td><td align="center"></td></tr></tbody></table>

{% hint style="info" %}
Click on the link on the emulator name to reach the emulator specific page.

To see the multiple layouts offered for an emulator/system, visit the [system page](https://wiki.retrobat.org/systems-and-emulators/supported-game-systems).
{% endhint %}

### File override general principle

Override files provided with RetroBat are located in the `\system\resources\inputmapping` folder of your RetroBat installation. These files might be updated with a RetroBat upgrade, so it's recommended to copy them into the `\user\inputmapping` folder in case you are amending them.

Override files are YAML files (.yml), they contain several containers (usually per-game or per-core for RetroArch, along with a "default" container) that RetroBat will look through in order to find the correct mapping to apply.

#### Example 1: Flycast standalone

The file "`flycast_arcade.yml`" contains the mapping for many arcade games that can be ran with Flycast emulator (Atomiswave, Naomi and Naomi2), here is an example of the file's content:

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FD1zRpnwdq1IWlXMx2zGS%2Fimage.png?alt=media&#x26;token=233f0741-77cb-44f5-a834-86219ca519a1" alt=""><figcaption></figcaption></figure></div>

Each container contains the mapping for a game, as arcade games rom naming is fixed, this will always work and automatically apply this mapping for the game.

For example, the line `l2: btn_trigger_left` means that the "btn\_trigger\_left" value in Flycast emulator configuration file will be mapped to the left trigger of the controller, RetroBat will convert L2 into whatever your controller uses as L2 (axis or button):

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FlnZWLPsZTHFj7fnpt4BF%2Fimage.png?alt=media&#x26;token=2ad02560-87cc-4107-9935-68c1dd390439" alt=""><figcaption><p>btn_trigger_left assigned to axis 4+ (L2 on xbox controller)</p></figcaption></figure></div>

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FCMM2bgJfWPfV35C5VIUR%2Fimage.png?alt=media&#x26;token=bc8c8974-b009-48d4-82b1-e18ac6bcd137" alt=""><figcaption><p>In the emulator, you can see L2 assigned to BRAKE command</p></figcaption></figure></div>

#### Example 2: RetroArch (Flycast core)

The file "`libretro_flycast_naomi.yml`" contains the mapping for naomi games that can be ran with Libretro-Flycast emulator, here is an example of the file's content:

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FWMNaXrcyJnlptovEjAR3%2Fimage.png?alt=media&#x26;token=96a48cd5-b567-4e4f-8737-1a6a234d6649" alt=""><figcaption></figcaption></figure></div>

Each container contains the remap information that will be used to remap the default "RetroPad" buttons to the flycast core. As arcade games rom naming is fixed, this will always work and automatically apply this mapping for the game.

For example, the line `btn_b: 4` means that the SOUTH face button on the controller will be mapped with the button with ID 4 in the libretro flycast core (ID 4 corresponds to the DRIVE GEAR command):

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2Fg33zeLbQtknAjaY3ZLFA%2Fimage.png?alt=media&#x26;token=ed62d249-ccbe-4579-928f-cb20aeb13803" alt=""><figcaption><p>Flycast core remap file created by RetroBat</p></figcaption></figure></div>

<div align="left"><figure><img src="https://990680527-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FexdzL60ZuqPLldz2AYta%2Fuploads%2FrzDPOg1rEwPwQCzcWgBJ%2Fimage.png?alt=media&#x26;token=34b04aab-0f50-40d5-b6a3-5d39504e8fa6" alt=""><figcaption></figcaption></figure></div>

{% hint style="info" %}
For RetroArch, these files will not change the mapping between the physical controller and the generic RetroArch retropad. It will create a Core remap file. Core remaps can be found in the folder `\emulators\retroarch\config\remaps\<core name>` folder.
{% endhint %}

## Fixing controller configuration issues

In case of issue with controls, follow the steps below:&#x20;

1. Try to reconfigure your controller mapping
2. Check the configuration created by RetroBat (save the file for later)
3. Configure the controller directly in the emulator (save the file for later)
4. Contact the RetroBat team and share the files created at steps 2 and 3
