Re: [AD] Joystick patches

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2010-10-07, John Murphy <wonsungi@xxxxxxxxxx> wrote:
> The attached fix_joystick_axis.patch fixes: DirectInput capabilities were
> not properly mapped to the Allegro joystick info.
> - fixes missing stick and improperly mapped axes.
> - fixes all joystick axis events look like X axis events.

Oops, thanks.

> 
> The attached fix_MP_8866_joystick.patch fixes: MP-8866 Dual USB Joypad sends
> bad information to DirectInput:
> - this work-around is specific to "MP-8866 Dual USB Joypad" only
> - fixes analog R-stick is mapped to the Z and RZ axes (two different
> sticks!)
> - fixes first four button names contain junk that cannot be printed.
> - also gives some better names to buttons

Applied this one as well.

> 
> Two questions:
> 1. What is the difference between ADD_STRING("my name") vs "my name"? Does
> ADD_STRING prevent a memory leak or is it possible that the string literal
> could be modified/deleted? I thought C++ stored string literals statically.

Previously on cleanup we would free each string individually (button,
stick names, etc.) so we couldn't point to static strings -- trying to
free a static string could crash.  Then I decided to stuff all the
strings into a single buffer, so we didn't need to free each string
individually.  So, it's not strictly necessary to copy static strings
into the buffer.

> 2. Any ideas what the four junk button names were supposed to be? They
> correlate with the "shape" buttons on Playstation controllers: "Triangle,
> Circle, X, and Square." I'm guessing the junk was something like Unicode
> (respectively: 0xA1F7, 0xA1F0, 0xA877, 0xA1F5). Does DirectInput support
> Unicode names for buttons? Just curious...

No idea.  It doesn't seem right there was junk though.

Peter




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/