Skip to content

Host controller support

Manuel Bilderbeek edited this page Nov 22, 2023 · 3 revisions

This is a work in progress. There are probably contradictions and questions that first must be resolved before we can start implementation.

Requirements

  1. The user must be able to map any of his host controller action buttons, direction buttons and analog sticks to
    1. the A and B action buttons and directions of the MSX joystick/controller
    2. the A, B, C, X, Y, Z and direction buttons of the MSX JoyMega adapter joystick/controller
  2. It must be possible to also map other button-like (2-state) events to MSX device (joystick/JoyMega) buttons, e.g. a host keyboard event.
  3. It must be possible to use a host keyboard mapping for joystick device 1 and joystick device 2, to support a scenario of a 2 player joystick game, without host joystick/controllers available, via the host keyboard.
  4. The mapping is specific for the specific host controller.
    • Having inserted the same host controller, the previously made mapping for that controller must be recalled or used without having to create a new mapping.
    • Rationale: the button layout is specific of a host controller device and the mapping makes sense for that layout. So: same layout (so: same device), same mapping.
      • Note: previously it was specified to store the mapping per device type. This has the advantage that when there are multiple host devices of the same type (i.e. manufacturer/model), the previously made mapping would be directly usable. However, it also has its downsides to support this as such (which is probably a relatively rare case): it blocks having a different mapping for the same device, e.g. if you do have the same device type twice, but each player prefers a different mapping or if you want to have two different mappings depending on the played game (switch devices instead of the alternative of switching mappings).
  5. The user must have the freedom to configure an arbitrary number of mappings for any of these MSX input devices (joystick/JoyMega).
  6. DISCUSSION: should it be possible to give these pluggables a custom name?
  7. It must be possible to use a host controller (with its mapping) to act as MSX joystick 1 or 2, without having to change the mapping.
  8. It must be possible to use a host controller to act as MSX JoyMega controller 1 or 2.
  9. The user must have the freedom to plug in either one of these MSX controllers into the joystick port he desires, without having to change any mapping.

Design

  • openMSX offers a set of pluggables of an MSX device type. E.g. for MSX joysticks there are pluggables like 'msxjoystick1', 'msxjoystick2' (for MSX device type 'joystick') and 'msxjoymega1' and 'msxjoymega2' (for MSX device type 'JoyMega'). These pluggables are just a definition of a mapping. More mappings can be added, which creates more pluggables of that type.
  • These pluggables can be configured with a mapping of host input 2-state events to the MSX device buttons and analog sticks with thresholds or other 2-state inputs to MSX device direction controls.
  • Each of these pluggables can have their own mapping configuration.
  • Users just plug the desired pluggable.