<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forums.obdev.at/app.php/feed/topic/1263" />

	<title>Objective Development Forums</title>
	
	<link href="https://forums.obdev.at/index.php" />
	<updated>2008-03-05T01:20:39+02:00</updated>

	<author><name><![CDATA[Objective Development Forums]]></name></author>
	<id>https://forums.obdev.at/app.php/feed/topic/1263</id>

		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2008-03-05T01:20:39+02:00</updated>

		<published>2008-03-05T01:20:39+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4467#p4467</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4467#p4467"/>
		<title type="html"><![CDATA[Report descriptor for joystick gives weird results in MAME]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4467#p4467"><![CDATA[
Thanks Grendel, you put me on to a solution. On further inspection there is an error in my descriptor. The buttons are in the same collection as the pointer. I moved them to their own collection and that sorted out the naming issues:<br /><br /><div class="codebox"><p>Code: </p><pre><code>ReportDescriptor:<br />      .db 0x05,0x01      ;Usage_Page &#40;Generic Desktop&#41;<br />      .db 0x09,0x05      ;Usage &#40;Game Pad&#41;<br />      .db 0xA1,0x01      ;Collection &#40;Application&#41;<br />      .db 0x09,0x01         ;Usage &#40;Pointer&#41;<br />      .db 0xA1,0x00         ;Collection &#40;Physical&#41;      <br />      .db 0x09,0x30            ;Usage &#40;X&#41;<br />      .db 0x09,0x31            ;Usage &#40;Y&#41;<br />      .db 0x15,0x81            ;Logical_Minimum &#40;-127&#41;<br />      .db 0x25,0x7F            ;Logical Maximum &#40;127&#41;<br />      .db 0x75,0x08            ;Report_Size &#40;8&#41;<br />      .db 0x95,0x02            ;Report_Count &#40;2&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;      <br />      .db 0xC0,0x16         ;End_Collection, dummy<br /><br />      .db 0xA1,0x00         ;Collection &#40;Physical&#41;<br />      .db 0x05,0x09            ;Usage_Page &#40;Button&#41;<br />      .db 0x19,0x01            ;Usage_Minimum &#40;Button 1&#41;<br />      .db 0x29,0x0a            ;Usage_Maximum &#40;Button 10&#41;<br />      .db 0x15,0x00            ;Logical_Minimum &#40;0&#41;<br />      .db 0x25,0x01            ;Logical_Maximum &#40;1&#41;<br />      .db 0x75,0x01            ;Report_Size &#40;1&#41;<br />      .db 0x95,0x0a            ;Report_Count &#40;2&#41;<br />      .db 0x55,0x00            ;Unit_Exponent &#40;0&#41;<br />      .db 0x65,0x00            ;Unit &#40;None&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;<br /><br />;round it out<br />      .db 0x05,0x01            ;Usage_Page &#40;Generic Desktop&#41;<br />      .db 0x09,0x00            ;Usage &#40;Undefined&#41;<br />      .db 0x15,0x01            ;Logical_Minimum &#40;0&#41;<br />      .db 0x25,0x06            ;Logical_Maximum &#40;5&#41;<br />      .db 0x75,0x06            ;Report_Size &#40;6&#41;<br />      .db 0x95,0x01            ;Report_Count &#40;1&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;<br />      .db 0xC0,0x00         ;End_Collection , dummy padding<br /><br />ReportDescriptorEnd:<br /></code></pre></div><br /><br />Another issue was that the usage_page was still set to &quot;button&quot; for the padding bits, which caused an 11th button to be seen in Windows. Changing the page back to &quot;generic desktop&quot; fixed things.<br /><br />Thanks for the push in the right direction <img class="smilies" src="./../../../images/smilies/icon_biggrin.gif" alt=":D" title="Very Happy" /><br /><br />MAME now sees the buttons correctly.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Wed Mar 05, 2008 1:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2008-03-05T00:50:54+02:00</updated>

		<published>2008-03-05T00:50:54+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4466#p4466</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4466#p4466"/>
		<title type="html"><![CDATA[Report descriptor for joystick gives weird results in MAME]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4466#p4466"><![CDATA[
Thanks, but it does not seem to be logging the report descriptor as far as I can see.<br /><br />I did find this descriptor from an XBOX controller:<br /><br /><div class="codebox"><p>Code: </p><pre><code>0501   Usage Page &#40;Generic Desktop&#41;<br />0905   Usage &#40;Game Pad&#41;<br />A101   Collection &#40;Application&#41;<br />   <br />0501      Usage Page &#40;Generic Desktop&#41;<br />093A      Usage &#40;Counted Buffer&#41;      ;XXX<br />A102      Collection &#40;Logical&#41;<br />      <br />         ; padding<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />8101         Input &#40;Constant&#41;<br />   <br />         ; byte count<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />0501         Usage Page &#40;Generic Desktop&#41;<br />093B         Usage &#40;Byte Count&#41;      ;XXX<br />8101         Input &#40;Constant&#41;<br />      <br />         ; D-pad<br />0501         Usage Page &#40;Generic Desktop&#41;<br />0901         Usage &#40;Pointer&#41;<br />A100         Collection &#40;Physical&#41;<br />7501            Report Size &#40;1&#41;<br />1500            Logical Minimum &#40;0&#41;<br />2501            Logical Maximum &#40;1&#41;<br />3500            Physical Minimum &#40;0&#41;<br />4501            Physical Maximum &#40;1&#41;<br />9504            Report Count &#40;4&#41;<br />0501            Usage Page &#40;Generic Desktop&#41;<br />0990            Usage &#40;D-pad Up&#41;<br />0991            Usage &#40;D-pad Down&#41;<br />0993            Usage &#40;D-pad Left&#41;<br />0992            Usage &#40;D-pad Right&#41;<br />8102            Input &#40;Data,Variable,Absolute&#41;<br />C0         End Collection<br />      <br />         ; start, back, stick press<br />7501         Report Size &#40;1&#41;<br />1500         Logical Minimum &#40;0&#41;<br />2501         Logical Maximum &#40;1&#41;<br />3500         Physical Minimum &#40;0&#41;<br />4501         Physical Maximum &#40;1&#41;<br />9504         Report Count &#40;4&#41;<br />0509         Usage Page &#40;Button&#41;<br />1907         Usage Minimum &#40;Button 7&#41;<br />290A         Usage Maximum &#40;Button 10&#41;<br />8102         Input &#40;Data,Variable,Absolute&#41;<br />      <br />         ; reserved<br />7501         Report Size &#40;1&#41;<br />9508         Report Count &#40;8&#41;<br />8101         Input &#40;Constant&#41;<br />      <br />         ; analog buttons<br />7508         Report Size &#40;8&#41;<br />1500         Logical Minimum &#40;0&#41;<br />26FF00         Logical Maximum &#40;255&#41;<br />3500         Physical Minimum &#40;0&#41;<br />46FF00         Physical Maximum &#40;255&#41;<br />9506         Report Count &#40;6&#41;<br />0509         Usage Page &#40;Button&#41;<br />1901         Usage Minimum &#40;Button 1&#41;<br />2906         Usage Minimum &#40;Button 6&#41;<br />8102         Input &#40;Data,Variable,Absolute&#41;<br />      <br />         ; triggers<br />7508         Report Size &#40;8&#41;<br />1500         Logical Minimum &#40;0&#41;<br />26FF00         Logical Maximum &#40;255&#41;<br />3500         Physical Minimum &#40;0&#41;<br />46FF00         Physical Maximum &#40;255&#41;<br />9502         Report Count &#40;2&#41;<br />0501         Usage Page &#40;Generic Desktop&#41;<br />0932         Usage &#40;Z&#41;<br />0935         Usage &#40;Rz&#41;<br />8102         Input &#40;Data,Variable,Absolute&#41;<br />      <br />         ; sticks<br />7510         Report Size &#40;16&#41;<br />160080         Logical Minimum &#40;-32768&#41;<br />26FF7F         Logical Maximum &#40;32767&#41;<br />360080         Physical Minimum &#40;-32768&#41;<br />46FF7F         Physical Maximum &#40;32767&#41;<br />   <br />0501         Usage Page &#40;Generic Desktop&#41;<br />0901         Usage &#40;Pointer&#41;<br />A100         Collection &#40;Physical&#41;<br />9502            Report Count &#40;2&#41;<br />0501            Usage Page &#40;Generic Desktop&#41;<br />0930            Usage &#40;X&#41;<br />0931            Usage &#40;Y&#41;         ;north positive<br />8102            Input &#40;Data,Variable,Absolute&#41;<br />C0         End Collection<br />   <br />0501         Usage Page &#40;Generic Desktop&#41;<br />0901         Usage &#40;Pointer&#41;<br />A100         Collection &#40;Physical&#41;<br />9502            Report Count &#40;2&#41;<br />0501            Usage Page &#40;Generic Desktop&#41;<br />0933            Usage &#40;Rx&#41;<br />0934            Usage &#40;Ry&#41;         ;north positive<br />8102            Input &#40;Data,Variable,Absolute&#41;<br />C0         End Collection<br />   <br />C0      End Collection<br />      <br />0501      Usage Page &#40;Generic Desktop&#41;<br />093A      Usage &#40;Counted Buffer&#41;      ;XXX<br />A102      Collection &#40;Logical&#41;<br />      <br />         ; padding<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />9101         Output &#40;Constant&#41;<br />   <br />         ; byte count<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />0501         Usage Page &#40;Generic Desktop&#41;<br />093B         Usage &#40;Byte Count&#41;      ;XXX<br />9101         Output &#40;Constant&#41;<br />   <br />         ; padding<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />9101         Output &#40;Constant&#41;<br />      <br />         ; left actuator<br />7508         Report Size &#40;8&#41;<br />1500         Logical Minimum &#40;0&#41;<br />26FF00         Logical Maximum &#40;255&#41;<br />3500         Physical Minimum &#40;0&#41;<br />46FF00         Physical Maximum &#40;255&#41;<br />9501         Report Count &#40;1&#41;<br />0600FF         Usage Page &#40;vendor-defined&#41;<br />0901         Usage &#40;1&#41;<br />9102         Output &#40;Data,Variable,Absolute&#41;<br />      <br />         ; padding<br />7508         Report Size &#40;8&#41;<br />9501         Report Count &#40;1&#41;<br />9101         Output &#40;Constant&#41;<br />         <br />         ; right actuator<br />7508         Report Size &#40;8&#41;<br />1500         Logical Minimum &#40;0&#41;<br />26FF00         Logical Maximum &#40;255&#41;<br />3500         Physical Minimum &#40;0&#41;<br />46FF00         Physical Maximum &#40;255&#41;<br />9501         Report Count &#40;1&#41;<br />0600FF         Usage Page &#40;vendor-defined&#41;<br />0902         Usage &#40;2&#41;<br />9102         Output &#40;Data,Variable,Absolute&#41;<br />         <br />C0      End Collection<br />   <br />C0   End Collection<br /></code></pre></div><br /><br />I can't see how it is fundamentally different. I can't figure out why MAME is picking up these strange names either. As I said, it works fine and looks okay in the control panel applet.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Wed Mar 05, 2008 12:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Grendel]]></name></author>
		<updated>2008-03-05T00:23:34+02:00</updated>

		<published>2008-03-05T00:23:34+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4465#p4465</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4465#p4465"/>
		<title type="html"><![CDATA[Report descriptor for joystick gives weird results in MAME]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4465#p4465"><![CDATA[
Report looks ok to me. Try to move the buttons that are on the handle into the pointer collection.<br /><br />On my stick that looks like:<br /><br /><div class="codebox"><p>Code: </p><pre><code>...<br /> 0x05,0x09,              //     USAGE_PAGE &#40;Button&#41;<br /> 0x19,0x01,              //     USAGE_MINIMUM &#40;Button 1&#41;<br /> 0x29,0x04,              //     USAGE_MAXIMUM &#40;Button 4&#41;<br /> 0x81,0x02,              //     INPUT &#40;Data,Var,Abs&#41;<br /> 0xC0,                   //   END_COLLECTION<br /> 0x19,0x05,              //   USAGE_MINIMUM &#40;Button 5&#41;<br /> 0x29,0x08,              //   USAGE_MAXIMUM &#40;Button 8&#41;<br /> 0x81,0x02,              //   INPUT &#40;Data,Var,Abs&#41;<br />...</code></pre></div><p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=101">Grendel</a> — Wed Mar 05, 2008 12:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[STB]]></name></author>
		<updated>2008-03-04T21:10:24+02:00</updated>

		<published>2008-03-04T21:10:24+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4463#p4463</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4463#p4463"/>
		<title type="html"><![CDATA[Report descriptor for joystick gives weird results in MAME]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4463#p4463"><![CDATA[
You can find a tool for recording Reports here:<br /><br /><!-- m --><a class="postlink" href="http://sourceforge.net/projects/usbsnoop/">http://sourceforge.net/projects/usbsnoop/</a><!-- m --><br /><br />Regards,<br /><br />STB<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=722">STB</a> — Tue Mar 04, 2008 9:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[mojo]]></name></author>
		<updated>2008-03-04T16:05:02+02:00</updated>

		<published>2008-03-04T16:05:02+02:00</published>
		<id>https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4460#p4460</id>
		<link href="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4460#p4460"/>
		<title type="html"><![CDATA[Report descriptor for joystick gives weird results in MAME]]></title>

		
		<content type="html" xml:base="https://forums.obdev.at/viewtopic.php?t=1263&amp;p=4460#p4460"><![CDATA[
I have made a USB joystick controller that works perfectly. All buttons are detected properly in Windows. See <a href="http://joystick.world3.net" class="postlink">http://joystick.world3.net</a> for more info.<br /><br />I have found a slight issue with the HID descriptor though. Although it works, MAME sees the buttons not as &quot;Joy 1 Button X&quot; but as &quot;Joy 1 Joystick&quot;, &quot;Joy 1 Pointer&quot;, &quot;Joy 1 Keyboad&quot; etc. until we get to &quot;Joy 1 Button 10&quot;. It works fine, it just looks weird.<br /><br />Here is my current report descriptor:<br /><br /><div class="codebox"><p>Code: </p><pre><code>ReportDescriptor:<br />      .db 0x05,0x01      ;Usage_Page &#40;Generic Desktop&#41;<br />      .db 0x09,0x05      ;Usage &#40;Game Pad&#41;<br />      .db 0xA1,0x01      ;Collection &#40;Application&#41;<br />      .db 0x09,0x01         ;Usage &#40;Pointer&#41;<br />      .db 0xA1,0x00         ;Collection &#40;Physical&#41;      <br />      .db 0x09,0x30            ;Usage &#40;X&#41;<br />      .db 0x09,0x31            ;Usage &#40;Y&#41;<br />      .db 0x15,0x81            ;Logical_Minimum &#40;-127&#41;<br />      .db 0x25,0x7F            ;Logical Maximum &#40;127&#41;<br />      .db 0x75,0x08            ;Report_Size &#40;8&#41;<br />      .db 0x95,0x02            ;Report_Count &#40;2&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;      <br />      .db 0xC0,0x16         ;End_Collection, dummy<br /><br />      .db 0x05,0x09         ;Usage_Page &#40;Button&#41;<br />      .db 0x19,0x01            ;Usage_Minimum &#40;Button 1&#41;<br />      .db 0x29,0x0a            ;Usage_Maximum &#40;Button 10&#41;<br />      .db 0x15,0x00            ;Logical_Minimum &#40;0&#41;<br />      .db 0x25,0x01            ;Logical_Maximum &#40;1&#41;<br />      .db 0x75,0x01            ;Report_Size &#40;1&#41;<br />      .db 0x95,0x0a            ;Report_Count &#40;10&#41;<br />      .db 0x55,0x00            ;Unit_Exponent &#40;0&#41;<br />      .db 0x65,0x00            ;Unit &#40;None&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;<br /><br />;round it out to whole byte for Windows<br />      .db 0x09,0x00            ;Usage &#40;undefined&#41;<br />      .db 0x15,0x01            ;Logical_Minimum &#40;1&#41;<br />      .db 0x25,0x06            ;Logical_Maximum &#40;6&#41;<br />      .db 0x75,0x06            ;Report_Size &#40;6&#41;<br />      .db 0x95,0x01            ;Report_Count &#40;1&#41;<br />      .db 0x81,0x02            ;Input &#40;Data, Var, Abs&#41;<br /><br />      .db 0xC0,0x00         ;End_Collection , dummy padding<br />ReportDescriptorEnd:<br /></code></pre></div><br /><br />I can't see anything obviously wrong with it. I checked MAME with various other USB controllers and it detects the buttons correctly.<br /><br />Is there any software available that can read a report descriptor from a USB device? I couldn't find any, but it would be useful to read the descriptor from a working USB gamepad for comparison.<p>Statistics: Posted by <a href="https://forums.obdev.at/memberlist.php?mode=viewprofile&amp;u=892">mojo</a> — Tue Mar 04, 2008 4:05 pm</p><hr />
]]></content>
	</entry>
	</feed>
