Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: MameInfo.xml input format change in MAME 0149  (Read 2662 times)

0 Members and 1 Guest are viewing this topic.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2912
  • 0x2b|~0x2b?
MameInfo.xml input format change in MAME 0149
« 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

TypeWaysWays2Ways3Constant
joy1--?
joy2--joy2way
joy3 (half4)--joy4way
joy4--joy4way
joy5 (half8)--joy8way
joy8--joy8way
joyvertical2--vjoy2way
doublejoy2--doublejoy2way
doublejoy82-doublejoy4way
doublejoy44-doublejoy4way
doublejoy88-doublejoy8way
doublejoyvertical2vertical2-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
Code: (auto:0) [Select]
<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
Code: (auto:0) [Select]
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;
}
« Last Edit: August 19, 2013, 12:00:50 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 15084
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInfo.xml input format change in MAME 0149
« Reply #1 on: August 19, 2013, 06:15:49 am »
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.

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31