The NEW Build Your Own Arcade Controls
Software Support => controls.dat => Topic started by: headkaze on August 18, 2013, 11:49:12 pm
-
Mame has had a control format change again and I'm working to write a converter to the current Controls.dat constants. I've written a method that should work for most cases but I'm not so sure about some of the new values such as way2/way3 and 1/3 (half4)/5 (half8)/strange2. If anyone can provide some insight into some of the changes and how to improve on the converter it would be much appreciated. This should also help others update their software to work with the latest Mame.
Type
====
triplejoy
doublejoy
joy
stick
paddle
pedal
lightgun
positional
dial
trackball
mouse
keypad
keyboard
mahjong
hanafuda
gambling
Basic Info
==========
players
buttons
coins
service
tilt
Analog Types
============
type
minimum
maximum
sensitivity
keydelta
reverse
Ways/Ways2/Ways3
================
1
2
3 (half4)
4
5 (half8)
8
vertical2
strange2
Type | Ways | Ways2 | Ways3 | Constant |
joy | 1 | - | - | ? |
joy | 2 | - | - | joy2way |
joy | 3 (half4) | - | - | joy4way |
joy | 4 | - | - | joy4way |
joy | 5 (half8) | - | - | joy8way |
joy | 8 | - | - | joy8way |
joy | vertical2 | - | - | vjoy2way |
doublejoy | 2 | - | - | doublejoy2way |
doublejoy | 8 | 2 | - | doublejoy4way |
doublejoy | 4 | 4 | - | doublejoy4way |
doublejoy | 8 | 8 | - | doublejoy8way |
doublejoy | vertical2 | vertical2 | - | vdoublejoy2way |
triplejoy | - | - | - | - |
? | strange2 | - | - | - |
stick | - | - | - | stick |
paddle | - | - | - | paddle |
pedal | - | - | - | pedal |
lightgun | - | - | - | lightgun |
positional | - | - | - | positional |
dial | - | - | - | dial |
trackball | - | - | - | trackball |
mouse | - | - | - | mouse |
keypad | - | - | - | keypad |
keyboard | - | - | - | keyboard |
mahjong | - | - | - | mahjong |
hanafuda | - | - | - | hanafuda |
gambling | - | - | - | gambling |
Examples
<input players="4" buttons="3" coins="4" service="yes" tilt="yes">
<control type="joy" ways="8"/>
</input>
<input players="2" buttons="4" coins="2" tilt="yes">
<control type="joy" ways="4"/>
</input>
<input players="2" buttons="2" coins="2">
<control type="joy" ways="2"/>
</input>
<input players="2" buttons="3" coins="1">
<control type="joy" ways="vertical2"/>
</input>
<input players="1" coins="1">
<control type="keypad"/>
</input>
<input players="1" buttons="4" coins="1" service="yes">
<control type="dial" minimum="0" maximum="255" sensitivity="25" keydelta="20"/>
</input>
<input players="1" buttons="16" coins="2">
<control type="gambling"/>
</input>
<input players="2" buttons="7" coins="1">
<control type="mahjong"/>
</input>
<input players="2" buttons="1" coins="4">
<control type="lightgun" minimum="0" maximum="255" sensitivity="70" keydelta="10"/>
</input>
<input players="3" buttons="9" coins="4" service="yes">
<control type="joy" ways="5 (half8)"/>
</input>
<input players="1" coins="2" service="yes">
<control type="doublejoy" ways="8" ways2="8"/>
</input>
<input players="4" buttons="1" coins="2">
<control type="joy" ways="8"/>
<control type="stick" minimum="0" maximum="255" sensitivity="100" keydelta="10"/>
</input>
<input players="1" buttons="2" coins="2" service="yes">
<control type="stick" minimum="64" maximum="255" sensitivity="100" keydelta="79" reverse="yes"/>
</input>
<input players="2" buttons="1" coins="2" tilt="yes">
<control type="trackball" minimum="0" maximum="255" sensitivity="100" keydelta="10" reverse="yes"/>
</input>
<input players="2" coins="1">
<control type="mahjong"/>
<control type="hanafuda"/>
</input>
<input players="1" buttons="5" coins="2" service="yes" tilt="yes">
<control type="paddle" minimum="0" maximum="65280" sensitivity="30" keydelta="30" reverse="yes"/>
<control type="pedal" minimum="0" maximum="65280" sensitivity="100" keydelta="40"/>
</input>
<input players="4" buttons="1" coins="2" service="yes">
<control type="pedal" minimum="0" maximum="127" sensitivity="100" keydelta="10"/>
<control type="stick" minimum="0" maximum="255" sensitivity="100" keydelta="30"/>
<control type="positional" minimum="0" maximum="10" sensitivity="10" keydelta="1"/>
<control type="trackball" minimum="0" maximum="255" sensitivity="100" keydelta="30" reverse="yes"/>
</input>
<input players="2" buttons="4" coins="2">
<control type="joy" ways="vertical2"/>
<control type="paddle" minimum="0" maximum="255" sensitivity="100" keydelta="10"/>
<control type="pedal" minimum="0" maximum="255" sensitivity="100" keydelta="10"/>
</input>
Conversion Code
public static string GetControlConstant(string type, string ways, string ways2, string ways3)
{
if (type.EndsWith("joy"))
{
string vertical = String.Empty;
if (ways.Equals("3 (half4)"))
ways = "4";
else if (ways.Equals("5 (half8)"))
ways = "8";
else if (ways.Equals("vertical2"))
{ ways = "2"; vertical = "v"; }
return String.Format("{0}{1}{2}way", vertical, type, ways);
}
return type;
}
-
Well on the plus side it's nice that they've FINALLY updated their constants. On the negative we've already did various "hacks" in the controls.dat to work around these guys.
There really isn't any way to do these via a converter because in controls.dat if we saw there was a "half 4 way" as mame is putting it. We would define it as a 4-way and then leave the 4th label blank and add a note about it in misc details.
Also the problem I see with these new constants in mame is that they are STILL not specific enough. Half 3 way is almost undoubtedly a tetris or a tetris clone and what it means is that the "up" control on the joystick isn't hooked up. Half 8 way on the other hand, well I've seen that used in tank games, meaning one "half8" is facing left and the other facing right and also the way you'd expect, with the down lever unhooked.
Joy 1 way is just a lever, which is the same as a switch essentially. Tapper comes to mind.
I've never seen a triple joy game. How the hell would you control it with only two hands?
Are these changes recent, because my guess is at least a few of them are going to be redacted.