<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>PLEASE FIX: Joystick rotation axis enumeration bug</title>
		<link>http://www.allegro.cc/forums/view/588230</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 10 Nov 2006 04:17:41 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve just ran into the problem of not being able to read two specific joystick axes (Rotation X and Y) which are used for the right analog stick on the Xbox 360 wired controller/gamepad. They&#39;re simply not enumerated by the Allegro 4.2 library.</p><p>It seems like it&#39;s a known bug approached in this thread:<br /><a href="http://www.allegro.cc/forums/thread/507375">http://www.allegro.cc/forums/thread/507375</a></p><p>Peter Wang&#39;s assessment seems correct: &quot;I think the problem is in object_enum_callback() in src/win/wjoydx.c. I suspect the missing axis falls under GUID_RxAxis or GUID_RyAxis which is not being tested for there.&quot;</p><p>Is this going to be fixed? Can someone please follow up on this issue? I don&#39;t want to have to switch to SDL input handling... <img src="http://www.allegro.cc/forums/smileys/sad.gif" alt=":(" /></p><p>Thanks so much in advance!</p><p>(Wait, could I make the bugfix myself to the allegro code? Should I start looking for the sourceforce repository?!)</p><p>- Dan T, working on Cortex Command<br /><a href="http://www.datarealms.com">http://www.datarealms.com</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cortex Commander)</author>
		<pubDate>Fri, 27 Oct 2006 11:11:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
(Wait, could I make the bugfix myself to the allegro code? Should I start looking for the sourceforce repository?!)
</p></div></div><p>

Yes, fix it and send us the patch, either to the [AD] mailing list, here, or on the SF.net bug tracker (as you have found).  It&#39;s unlikely anyone else will fix it for you as we basically have no Windows developers any more.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Fri, 27 Oct 2006 13:52:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
as we basically have no Windows developers any more
</p></div></div><p>
Oh! How come?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (tobing)</author>
		<pubDate>Fri, 27 Oct 2006 13:57:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The problem is that just adding checks for RxAxis and RyAxis doesn&#39;t help - the problem still persists. I tried that the last time around.</p><p>[EDIT]<br />Hmm. Actually, adding that check <i>does</i> make the missing Rotary show up - it just doesn&#39;t update. I think the problem might reside in joystick_dinput_poll() (or rather, that there might be an <i>additional</i> problem in joystick_dinput_poll()).</p><p>I think I&#39;ll try to wrap my head around Allegro&#39;s joystick code and see if I can produce a fix for this tonight. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>[EDIT 2]<br />Way too many edits.</p><p>[EDIT 10<sup>4</sup>]<br />Hah. I was right. It was a <i>combination</i> of all three guesses to what the problem was: not enough MAX_STICKS + no RxAxis/RyAxis checking in object_enum_callback() + a similar problem joystick_dinput_poll().<br />I&#39;ve tested a &quot;proof of concept&quot; fix that works for my joystick at least. I&#39;ll try to convert it into a clean fix and make a diff of it later tonight.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Fri, 27 Oct 2006 20:12:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Good job gnolam <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Though it sounds like the current joystick code is a crock of <span class="cuss"><span><span class="cuss"><span>shit</span></span></span></span>e <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 27 Oct 2006 21:28:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>UPDATE: a proper fix will take a while, since trying to extract relevant information from MSDN is like repeatedly smashing a claw hammer into your groin. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Though it sounds like the current joystick code is a crock of <span class="cuss"><span><span class="cuss"><span>shit</span></span></span></span>e <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div></div><p>
Well, it&#39;s certainly showing its age anyway... it makes me wonder if there&#39;s any chance of introducing an _ex family of joystick functions and structures (with, for example, &gt; 8-bit detail on axis positions, configurable deadzone/range properties, etc).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sat, 28 Oct 2006 00:23:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think we should make Allegro hacking a spectator sport.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Sat, 28 Oct 2006 00:35:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, I have some good news and some bad news...<br />The bad news is that there&#39;s just no clean way to do this without a major rewrite.<br />The good news is that I&#39;ve found out why I never managed to get axis/button name mapping right.</p><p>In more detail:<br />Allegro&#39;s name assignment is completely broken. When a device is initialized, its elements are counted and their names are read and copied into Allegro&#39;s JOYSTICK_INFO structure. However, when the device&#39;s state is actually polled, the order in which the axes are assigned data has nothing to do with their order in that structure.<br />This is also why I can&#39;t fix the polling routine cleanly - without it knowing which axes correspond to which on the physical device, it can&#39;t actually know if lRx and lRy exist or not (an axis which doesn&#39;t exist always has a value of 0, but that is also a valid state of an existing axis). Therefore, the best thing I can do is to tack them onto two additional axes after all the others have been read. It&#39;s a hack, and an ugly one at that, but I don&#39;t <i>think</i> it should break anything (num_axis should make sure they&#39;re never visible unless they&#39;re actually there). <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>The solution to both problems would be to actually associate each Allegro axis with a corresponding DirectX axis, but I&#39;m not sure if I&#39;m allowed to touch the internal structures...</p><p>IMO of course. There might actually be a clean way to do all this, but I&#39;ll leave finding it to someone who&#39;s not as tired. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>I will attach patches for testing in a minute or two.</p><p>[EDIT]<br />Attached.</p><p>[EDIT2]<br />I just realized I didn&#39;t make those patches against the SVN tree. I will rebuild them in a couple of minutes.</p><p>[EDIT3]<br />Reattached.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sat, 28 Oct 2006 01:49:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Good job, gnolam. It&#39;s always good to see progress being made on the Windows port. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edward Sheets)</author>
		<pubDate>Sat, 28 Oct 2006 02:27:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Good work Gnolam! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sat, 28 Oct 2006 02:30:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Unfortunately we can&#39;t bump MAX_JOYSTICK_AXIS and MAX_JOYSTICK_STICKS in the 4.2 branch as it would break ABI compatibility.  Is it really necessary?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sat, 28 Oct 2006 05:17:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes. STICKS, anyway.</p><p>Well, that&#39;s a load of work for nothing then. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sat, 28 Oct 2006 05:55:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Not nothing, it&#39;ll be able to be included in 4.3 at least <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 28 Oct 2006 06:14:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Wow you guys rock! Here I thought I wouldn&#39;t get much response for a while... gnolam you rock.</p><p>Props were due and given:<br /><a href="http://www.datarealms.com/devlog/cortex-command/open-sores-in-action/">http://www.datarealms.com/devlog/cortex-command/open-sores-in-action/</a></p><p>A 4.3 update would be hot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cortex Commander)</author>
		<pubDate>Sat, 28 Oct 2006 06:39:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>4.3 will be a little different than 4.2. some/alot of the api will change, as 4.3 is designated as part of the incremental update to &quot;allegro 5&quot;. So you may have to &quot;port&quot;  over stuff to 4.3, and aditional updates to 4.3 or 4.4+ will also have significant changes.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 28 Oct 2006 06:43:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t install your modified Allegro binary to the system library directory, please!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Sat, 28 Oct 2006 07:02:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Seems like i&#39;ll have to use SDL for the joystick input after all.. oh well! ;p</p><p>Thanks for the quick help and effort though! Looking forward to a rewritten input module sometime!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cortex Commander)</author>
		<pubDate>Sat, 28 Oct 2006 11:09:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Seems like i&#39;ll have to use SDL for the joystick input after all.. oh well! ;p
</p></div></div><p>
How did you arrive at this conclusion? Just apply gnolam&#39;s patch on your local SVN copy of Allegro and staticlink your game. Problem solved.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Sat, 28 Oct 2006 12:01:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Not nothing, it&#39;ll be able to be included in 4.3 at least <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div></div><p>
Right. I&#39;ll just come back and resubmit it in 5 years then...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sat, 28 Oct 2006 17:25:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Or you could apply it to 4.3 now.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 28 Oct 2006 17:51:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>AFAIK, 4.3 is still a jumble of broken code with no actual API plan, so no.</p><p>(We&#39;ve only been waiting for Allegro 4.2.1 for what, a year?)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sat, 28 Oct 2006 23:23:37 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>AFAIK 4.3 compiles just fine.</p><p>its the old allegro_new branch or whatever that was totally broken.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sat, 28 Oct 2006 23:33:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Maybe it does. But even if the patch should prove relevant, there&#39;s still the utter lack of documentation and planning. So no, I&#39;m not planning on contributing anything to 4.3.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 29 Oct 2006 02:17:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>And thats why theres a lack to begin with. &quot;I&#39;m not going to do anything if noone else does!&quot;.</p><p><img src="http://www.allegro.cc/forums/smileys/cry.gif" alt=":&#39;(" /></p><p>Actually, I&#39;m nearly done the new file/path handling stuff for allegro 4.3. Including the unix and windows specific code.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 29 Oct 2006 03:47:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
And thats why theres a lack to begin with. &quot;I&#39;m not going to do anything if noone [sic] else does!&quot;.
</p></div></div><p>

No, that&#39;s not it. Try<br />&quot;I&#39;m not going to do anything since nobody has any idea what should be done.&quot;<br />or<br />&quot;I&#39;m not going to do anything unless the people who have done something tells other people what it is they have done.&quot;<br />or<br />&quot;I&#39;m not going to do anything since what I do might prove completely irrelevant because someone else has a different idea.&quot;</p><p>You don&#39;t start building a house without first drawing up detailed plans. Likewise, you don&#39;t contribute to a project with no apparent direction unless you get paid for it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 29 Oct 2006 03:56:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can someone check if the same problem exists in 4.3?  I think I&#39;d already taken gnolam&#39;s change to wjoydx.c into account in the 4.3 branch, and the approach I took was to group Rx,Ry,Rz into a single stick.  It might not be right, but we could do the same for 4.2.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Sun, 29 Oct 2006 09:46:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m pretty hazy on what exactly affects ABI compatbility - would a &quot;shadow array&quot; of element-to-name mapping (to solve the name problem at least) be doable or would it break anything?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Tue, 31 Oct 2006 05:42:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That would be fine.  The problem with bumping the MAX_* constants (except for MAX_JOYSTICKS) is that it changes the size of the elements of the joy[] array, so a program compiled with 4.2.0 would have different ideas of the offset of &amp;joy[N] compared to a DLL compiled with your patch.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Peter Wang)</author>
		<pubDate>Tue, 31 Oct 2006 06:11:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You don&#39;t start building a house without first drawing up detailed plans. Likewise, you don&#39;t contribute to a project with no apparent direction unless you get paid for it.
</p></div></div><p>

I&#39;m kind of out of the loop since I&#39;ve stayed out of the Allegro 5 discussion.  But I was under the impression that a whole freakin wiki existed about what&#39;s been done/planning for allegro 5...</p><p>If there arn&#39;t &quot;planning docs&quot;, then maybe someone should make them.  Has the actual planning not been done?  If so, I&#39;d say gnolam&#39;s right, and that&#39;s not a minor issue. (The absence of planning, not gnolam being right.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Michael Jensen)</author>
		<pubDate>Sat, 04 Nov 2006 12:30:07 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Alright, I didn&#39;t defect to SDL quite yet. Instead, did as Miram suggested: patched my local SVN copy of allegro with gnolam&#39;s fix, built the static libs and finally rebuilt my game with them.</p><p>And... it works! I can now use the rotation axes. You guys rock!</p><p>Please don&#39;t be disheartened and give up development on allegro, folks. It&#39;s worth it!</p><p>Thanks again,<br />- D
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Cortex Commander)</author>
		<pubDate>Fri, 10 Nov 2006 04:17:41 +0000</pubDate>
	</item>
</rss>
