joystick: Add support for "button axes".

Some gamepads, notably the PS3 SIXAXIS controller, provide the D-pad
not as a pair of axes, but rather as four separate buttons. Define a
special axis numbering scheme that packs two button numbers into a
single number, and allow an axis to be defined this way.
setup: Add support for button axis calibration.

Detect when we need to configure a "button axis" by falling back to
buttons when none of the joystick axes are significantly outside of
the centered range. Add extra calibration stages to get the D-pad
buttons for right and down in these cases.
joystick: Increase 'dead zone' size.

The joystick dead zone is the range within which the joystick is
interpreted as being centered. Increase this range significantly, as
some controllers (eg. the PS2 controller + USB connector) can be very
sensitive, leading to the player spinning randomly even when the stick
is centered.
joystick: Add "hat axis" support.

Just as some controllers have D-pads that are presented as a set of
buttons, some other controllers actually present their D-pads as
joystick hats. Add "hat axis" support where the hat number and
axis can be packed into a single integer value.
setup: Detect and configure hat-based D-pads.

As a second fallback, if all joysticks are centered and no buttons
are pressed, look at the hats on the joystick to see if one of those
is uncentered. Bizarre as it seems, some gamepads actually present the
D-pad as a hat.