Custom Controls - HoraceAndTheSpider/Amiberry-XML-Builder GitHub Wiki


Introduction

Most of Amiga games have been designed for 1-button joystick. Even if some do support 2 or even 3-button it was not standard. Provided modern controllers (eg. Xbox One, PlayStation DualShock/Sense) come with many more buttons it would be nice to assign some of them to keys. This would allow for a more console-like experience. For new users that would help them to enjoy old gems without the need of plugging a mouse/keyboard. Thanks to Amiberry's flexibility it's possible to assign keys to buttons and add such bindings to the whdload_db.xml file for automatic configuration.


SDL2 naming convention

To tell Amiberry what key to bind to what button a simple text file has to be created under the customcontrols folder (check for examples here). Then to be sure everyone is on the same page the SDL2 naming convention must be followed otherwise binding will not be created.

Controller buttons

Hereafter the list of buttons defined currently in SDL2. Note: it matches the Xbox naming convention.

a
b
x
y
back
guide
start
leftstick
rightstick
leftshoulder
rightshoulder
dpup
dpdown
dpleft
dpright
misc1
paddle1
paddle2
paddle3
paddle4
touchpad

For instance to bind the X button (or Square) to M key and Start to F1 of the first controller, the following lines have to be added:

joyport1_amiberry_custom_none_x=M 
joyport1_amiberry_custom_none_start=F1

For triggers and axes (analog sticks):

leftx
lefty
rightx
righty
lefttrigger
righttrigger

For instance to bind the left trigger (or L2) to F3 of the first controller, simply add:

joyport1_amiberry_custom_axis_none_lefttrigger=F3

Ports

Based on the above examples you can see joyport1 has been used to bind keys to the first connected controller (player 1). If you have a second controller connected and needs to bind some keys as well, you will have to rely on joyport0 (player 2).

For instance for a 2-player game like Street Fighter 2 you can set the following:

joyport1_amiberry_custom_none_start=1
joyport0_amiberry_custom_none_start=2

This will assign the start button of the first controller to 1 and start button of the second controller to 2 allowing for 1 or 2-player game depending on what button is pressed.

This can be quite confusing and it's due to the Amiga ports. Typically the game port was port 2 where users should plug a joystick. The mouse is plugged in port 1. Yet for 2-player games the second joystick would be plugged in port 1 instead.

A500_back_ports


Amiga Keys

Once you understand how to name your controller and its button you have to be sure of the keys names supported. Here is the list of Amiga keys supported currently by Amiberry. You can notice it's possible to re-assign a joystick event as well. The common use-case for doing that is to bind the UP command (usually for jumping) to a button. For instance like in James Pond 2.

A500top


Amiga CD32 Controller

Thanks to WHDLoad 'packages' it's now possible to run games from hard drive. Meaning a much easier setup compared to disk images like .adf, faster loading times and no disk-swapping for instance. In addition, some games have been 'rewritten' to take advantage of the CD32 controller which offers more buttons than the traditional 1 or 2-button joysticks of the era. For the record here's such a controller in all its glory.

Amiga-CD32-Controller-L