Joymappings: Difference between revisions

From vice-emu
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
* performing event UI_FUNCTION (shortcuts to menu actions)
* 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.
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. (if what you mean is for SDL, then yes, it worked, analog host axis was converted to analog potentiometer values and it was used for paddles and analog joysticks, and it worked, tested on windows and linux [blacky_stardust])

Revision as of 22:54, 1 February 2023

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. (if what you mean is for SDL, then yes, it worked, analog host axis was converted to analog potentiometer values and it was used for paddles and analog joysticks, and it worked, tested on windows and linux [blacky_stardust])