USBJoystick - the binding table
==================================

This documents the binding table (h.binding, c.binding): the editable,
serialisable representation of a slot's whole mapping. A binding is one
"this source drives that target" record; a slot's mapping is a flat list
of them.

The table is the SOURCE OF TRUTH; the resolved fields the hot decode path
reads (mapped_x_16, mapped_buttons[], key_*, mouse_*, axes[].flip - see
struct joydata_struct) are a COMPILED form. binding_compile() clears those
and expands the table into them; the decode path only ever reads them.


Model
-------
  - Fixed 12-byte record, no variable fields; the keycode fits in the
    16-bit target_index, which is why that field is 16 bits not 8.
  - "Unmapped" = no record for that source. JB_TGT_NONE is never stored.
  - Analogue targets (slot axis, mouse move, ADC channel) are SINGULAR:
    one source each. Digital targets (slot button, mouse button, key) are
    SHAREABLE: many sources may OR onto one. binding_validate() enforces
    this.
  - JB_FLAG_INVERT reverses a binding's direction. For SLOT_AXIS and
    MOUSE_MOVE targets the decode engine's flip is per PHYSICAL AXIS
    (axes[a].flip, shared by slot scaling and mouse), so invert on those
    compiles by OR-ing into that one axes[a].flip - a single axis
    therefore inverts the same way for its slot and mouse targets. ADC
    and KEY targets carry invert independently (ADC via channels[c].flip;
    axis->key via which directional key it fills), so they do NOT feed
    axes[a].flip.
  - axis->key lands in the directional keys (key_up/down/left/right),
    which update_keys() drives from the 8-bit stick axes; Invert selects
    the half (positive axis value = down/right; Invert = up/left).
  - axis->ADC maps the axis's full min..max onto the channel (Invert =
    the channel's own flip). param is reserved (0).
