joystick_map
Option Category #
# CORE INPUT OPTIONS
#
Description

Sorry I'm cheating by using the description of the MAME documentation as it explains this command quite well.

What this command does is control how joystick values map to digital joystick controls. MAME accepts all joystick input from the system as analog data. For true analog joysticks, this needs to be mapped down to the usual 4-way or 8-way digital joystick values. To do this, MAME divides the analog range into a 9x9 grid. It then takes the joystick axis position (for X and Y axes only), maps it to this grid, and then looks up a translation from a joystick map.

Maps are defined as a string of numbers and characters. Since the grid is 9x9, there are a total of 81 characters necessary to define a complete map.

Below is an example map for an 8-way joystick:

777888999 Note that the numeric digits correspond to the keys
777888999 on a numeric keypad. So '7' maps to up+left, '4' maps
777888999 to left, '5' maps to neutral, etc. In addition to the
444555666 numeric values, you can specify the character 's',
444555666 which means "sticky". In this case, the value of the
444555666 map is the same as it was the last time a non-sticky
111222333 value was read.
111222333
111222333

To specify the map for this parameter, you can specify astring of rows separated by a‘.’ (which indicates the end of a row), like so...

777888999.777888999.777888999.444555666.444555666.444555666.111222333.111222333.111222333

There is a really complicated way to shorten the string by using a special shorthand. This is explained in the MAME documentation.

Full Command -joystick_map <custom>
Alt. Command -joymap
Reverse Command none
Example mame64.exe pacman -joymap 777888999.777888999.777888999.444555666.444555666.444555666.111222333.111222333.111222333
mame.ini Command joystick_map
Command Default auto
Argument Format <custom>.<custom>.<custom>