Joymappings

From vice-emu
Revision as of 22:36, 1 February 2023 by Fabbo2 (talk | contribs)
Jump to navigation Jump to search

For a long time the SDL port has had a joystick mappings file. There are 2 sample ones: data/C64/sdl_joymap_thec64.vjm and data/C64/sdl_joymap_ps3.vjm.

These files contain associations between host joystick actions and emulator actions. Possible actions include a corresponding emulated joystick action, a shortcut to an emulator menu action etc.

The branch branches/fabrizio/3.7-joystick-mapping-2 moves the joystick mappings file to the generic joystick code, therefore making it available to the Gtk3 port as well.

The file name has the form {sdl,gtk3,headless}-joymap-{C64,C64SC,...}.vjm. Its format is documented in a comment in the sample file itself.

In order to port the feature to the generic code, some aspects got lost, and must be ported over. Known things are:

  • editing mappings with SDL menu
  • performing event UI_ACTIVATE (enter SDL menu)
  • performing event UI_FUNCTION (shortcuts to menu actions)

There was an event POT_AXIS, which was intended to emulate potentiometer values with a host joystick's axis position, but it is not clear whether that actually worked.