[hatari-devel] joystick subsystem patch for configurable axis mapping
Matthias Arndt
marndt at asmsoftware.de
Sat Dec 10 10:29:29 CET 2011
Hello together,
as I'm still prevented to commit changes myself, I post the files here
for review.
The attached patch includes a mapping table into the joystick subsystem
to map the joystick axis to be used to the given SDL joystick name.
If the joystick name does not match any table entry, the code reverts to
the default mapping of using joystick axis 0 for X input and axis 1 for
Y input.
Atm the table is hardcoded but the longterm goal is to have the table
a) stored inthe Hatari config file
b) have GUI support to configure the data inbetween
Atm it only remaps the axis for my secondary USB gamepad but the table
can be tweaked to match other pads.
I tidied the mapping to the given SDL joystick name and not the SDL ID
as the SDL joystick ID can change if joysticks and pads are plugged in
in a different order.
Please review, if necessary tweak variable naming and commit.
Regards,
Matthias
--
Matthias Arndt <marndt at asmsoftware.de>
PGP-Key: http://www.final-memory.org/files/marndt.asc
Jabber: simonsunnyboy at atari-jabber.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: joy.c
Type: text/x-csrc
Size: 16615 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20111210/579707d3/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: joy.h
Type: text/x-chdr
Size: 1729 bytes
Desc: not available
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20111210/579707d3/attachment.h>
More information about the hatari-devel
mailing list