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
Lightguns Arcade1Up Try the site in https mode Site News

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

  

Author Topic: LEDBlinky and control.ini question.  (Read 10591 times)

0 Members and 1 Guest are viewing this topic.

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
LEDBlinky and control.ini question.
« on: April 17, 2011, 05:29:57 pm »
So, I finally got all my controls, and spent a good 3 days soldering and connecting all my controls and putting LEDs in all my buttons (14 of them), and putting my LEDs in my Sanwa joysticks, and putting "Angel Eyes" around my spinners, and wiring up my 3 color trackball LEDs. 

Turns out the control.ini (.141) is missing A LOT of entries, and LedBlinky really doesn't want me to turn on my "Angel Eyes" around my spinners and joystick LEDs individually. 
(Ok, I did get the joysticks to spiti by not using a "Primary Control" but P1_JOYSTICK_UP|P1_JOYSTICK_DOWN|P1_JOYSTICK_LEFT|P1_JOYSTICK_RIGHT|KEYCODE_LEFT|KEYCODE_RIGHT|KEYCODE_UP|KEYCODE_DOWN for P1 and JOYCODE_2_LEFT|JOYCODE_2_RIGHT|JOYCODE_2_UP|JOYCODE_2_DOWN|KEYCODE_D|KEYCODE_F|KEYCODE_G|KEYCODE_R for P2,  shouldn't it have been just P1_JOYSTICK and P2_JOYSTICK?)

It took a while, but it looks like LEDBlinky looks at all these files in this order.
mame-xml.cfg -> controls.ini -> default.cfg -> NewInputCodes.ini -> LEDBlinkyControls.xml -> DevicePort-Input.ini

Code: [Select]
-------------------------------mame-xml.cfg--------------------------
<player number="1" numButtons="2">
<controls>
<control name="Spinner">
<constant name="dial"/>
</control>
</controls>
<labels>
<label name="P1_BUTTON1" value="Fire"/>
<label name="P1_BUTTON2" value="Super Zapper"/>
<label name="P1_DIAL" value="Left"/>
<label name="P1_DIAL_EXT" value="Right"/>
</labels>
</player>

-------------------------------controls.ini--------------------------
[tempest]
gamename=Tempest (rev 3)
numPlayers=2
alternating=1
mirrored=1
tilt=1
cocktail=1
usesService=0
miscDetails=Super Zapper kills all enemies.  Three Zaps per level.
P1NumButtons=2
P1Controls=Spinner+dial
P1_BUTTON1=Fire
P1_BUTTON2=Super Zapper
P1_DIAL=Left
P1_DIAL_EXT=Right

--------------------------------default.cfg---------------------
            <port type="P1_DIAL">
                <newseq type="standard">
                    MOUSECODE_3_YAXIS
                </newseq>
                <newseq type="decrement">
                    NONE
                </newseq>
                <newseq type="increment">
                    NONE
                </newseq>
            </port>
            <port type="P1_DIAL_EXT">
                <newseq type="standard">
                    MOUSECODE_3_YAXIS
                </newseq>
                <newseq type="decrement">
                    NONE
                </newseq>
                <newseq type="increment">
                    NONE
                </newseq>
            </port>

---------------------------------NewInputCodes.ini-------------
MOUSECODE_3_ANALOG_X = MOUSECODE_3_XAXIS
MOUSECODE_3_ANALOG_Y = MOUSECODE_3_YAXIS

---------------------------------LEDBlinkyControls.xml---------------
    <control name="P1_DIAL" inputCodes="|MOUSECODE_1_ANALOG_X" allowConfigPlayerNum="1"/>
    <control name="P1_DIAL_EXT" inputCodes="|MOUSECODE_1_ANALOG_X" allowConfigPlayerNum="1"/>

--------------------------------DevicePort-Input.ini---------------
Port31=SPINNER1,S,P1_DIAL|P1_DIAL_EXT|P1_PADDLE|DIAL|MOUSECODE_3_ANALOG_Y
Port32=SPINNER2,S,P2_DIAL|P2_PADDLE|MOUSECODE_3_ANALOG_X


Is there an easier way for me to make a LED control map, other than to make sure all these files are populated correctly, and without having to hack up an fake a default.cfg just to get it to light up one spinner if the game uses just one, and both for something like Pong.

I did manage to get it to work, but like I said, I had to fake out LEDBlinky to do it, because the chain of names it follows is SOOOO long and using MOUSECODE_?_ANALOG_Y is a bad idea because it is not always going to be the same number (depending on how windows picks it up).
I mean, look at P1_DIAL;  it goes from P1_DIAL->P1_DIAL->MOUSECODE_3_YAXIS->MOUSECODE_3_YAXIS->SPINNER1.  and in the end, it reads the voice name in control.ini from P1_DIAL again.  Why can't I just map SPINNER1 to P1_DIAL and be done with it, without having to make a fake default.cfg with the entry:
Code: [Select]
            <port type="P1_DIAL">
                <newseq type="standard">
                    P1_DIAL
                </newseq>
                <newseq type="decrement">
                    NONE
                </newseq>
                <newseq type="increment">
                    NONE
                </newseq>
            </port>
            <port type="P1_DIAL_EXT">
                <newseq type="standard">
                    P1_DIAL
                </newseq>
                <newseq type="decrement">
                    NONE
                </newseq>
                <newseq type="increment">
                    NONE
                </newseq>
            </port>
just to keep it working when Windows changes the order the device was detected? 

And is there a place where a complete control.ini is kept, if not, I'll have to make one, which is fine, but it will take a while, but I'll post it somewhere when I'm done.  I just don't want to remake the wheel.
Any help from fellow LedBlinky users would be greatly appreciated.  Do you guys have all controls at 100%?

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
  • Last login:January 26, 2025, 08:51:53 am
  • Robots WILL kill you.
    • LEDBlinky
Re: LEDBlinky and control.ini question.
« Reply #1 on: April 18, 2011, 11:43:09 am »
Wow - where to start with this post? :)

First, let me make sure I understand what you're trying to do - you have LEDs (angle eyes?) mounted around your spinners and also illuminated joysticks. And when you play a single player game you only want the P1 joystick (or spinner) to light up - correct? When a 2-player game is running you want both P1 and P2 joysticks (or spinners) to light up - correct?

I'll start by saying that the concept of a "primary control" as defined by LEDBlinky is any control that's not a button. In my original design, I added a set of generic primary control input codes (JOY8WAY, JOY4WAY, TRACKBALL, DIAL, etc.) as a way to speak the controls that are not normally illuminated. So for example, LEDBlinky will speak "Primary Control... 8-Way Joystick", telling the user what to expect for the current game. Since these were non-illuminated controls, there was no need to distinguish between player 1 and player 2 primary controls. Later I added the feature to also light the primary controls using the generic input codes. That's a brief history of the code evolution.

So there's two ways that LEDBlinky can illuminate the primary controls; you can use the mame input codes (JOYCODE_1_UP, JOYCODE_1_DOWN, JOYCODE_1_ANALOG_X, MOUSECODE_1_ANALOG_X, P1_DIAL, etc.) OR you can use the generic primary control input codes (JOY8WAY, JOY4WAY, TRACKBALL, DIAL, etc.). Each method may have advantages or disadvantages depending on what you are trying to achieve.

Using the generic primary control input codes is the easiest, but has the disadvantage that it does not distinguish between P1, P2, P3, and P4 controls. This is commonly used with the Trackball as most control panels only have a single illuminated trackball. But if your cp has 4 illuminated joysticks for example, and you play a single player game, all 4 sticks will light up.

The second method uses the mame primary control input codes. These give you the ability to identify each set of player controls, and also identify each individual control axis/action. The higher resolution works great for lighting the controls, but can be a problem when speaking the control actions. If you are not using the LEDBlinky feature to speak the control actions, then you may only need to assign one of the mame input codes. For example, with your spinners, you could just assign P1_DIAL to the P1 spinner and P2_DIAL to the P2 spinner. Then any game that is defined as using P1_DIAL or P2_DIAL in controls.ini or mame.xml will illuminate correctly. For your joysticks, you could just use JOYCODE_1_UP and JOYCODE_2_UP since any game that uses the joystick will most likely use the "UP" axis. BUT, as I said above, the problem arises with speaking the control actions. With my joystick example, LEDBlinky would most likely speak "UP" while blinking the joystick. The only way around this would be to edit the controls.ini file and edit all the actions for the primary controls. For example, you could do a replace on "P1_JOYSTICK_UP=Up" and change it to "P1_JOYSTICK_UP=" (effectively lighting the joystick but preventing LEDBlinky from speaking any action).

In a future release I may have to reevaluate how this works, but for now, these are your options.

Also, here's a bit of clarification; LEDBlinky uses the controls.ini file to determine the Controls and Control Actions used by each mame game. If a game does not exist in controls.ini, then mame.xml will be used. You can override both these files using the LEDBlinky Controls Editor. When a mame game is loaded, LEDBlinky identifies the Input Codes for each control using these files in this order; <rom>.cfg --> default.cfg --> mame's default input codes. It's a bit more complicated than that but that's the basic logic.

Hope this helps.

By the way, you asked about getting the latest controls.ini data - check here.
Robots will kill you.



Arcade Addiction

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2093
  • Last login:January 26, 2025, 08:51:53 am
  • Robots WILL kill you.
    • LEDBlinky
Re: LEDBlinky and control.ini question.
« Reply #2 on: April 18, 2011, 11:54:24 am »
just to keep it working when Windows changes the order the device was detected? 

Also, can you elaborate on this? How the OS identifies each control should have nothing to do with LEDBlinky.
Robots will kill you.



Arcade Addiction

MacGyver

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 317
  • Last login:December 18, 2023, 12:49:00 am
    • Project Build
Re: LEDBlinky and control.ini question.
« Reply #3 on: April 18, 2011, 03:40:09 pm »
Thanks for the link, but I already have that one. Modifying it by hand as we speak. :(

Sometimes windows likes to detect devices plugged into a usb hub in a different order then it did the last time it was plugged in, so where my spinners are MOUSE3 XY right now, next time, they may get detected as MOUSE5 XY, now your right Ledblinky won't care, but when I reconfigure MAME to know it's spinners are now on MOUSE5, the configuration in LedBlinky where I told it MOUSE3 was the spinners will now be wrong.  So I made a fake default.cfg that Mame can't change, and have LedBlinky use it.  It took forever to figure out, but any changes in the name chain of
P1_DIAL=Left->P1_DIAL=MOUSECODE_3_YAXIS->MOUSECODE_3_ANALOG_X=MOUSECODE_3_XAXIS->MOUSECODE_3_ANALOG_X=SPINNER1
and they won't light. 

I really do like LedBlinky, I just wish someone had already taken the time to make a complete controls.ini, I'm working on mine right now, I'll share when I'm done, as I use a lot of mostly complete packages already, so I have no issue with passing it on. Currently 27,000 lines ;D

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LEDBlinky and control.ini question.
« Reply #4 on: April 18, 2011, 04:57:16 pm »
Thanks for the link, but I already have that one. Modifying it by hand as we speak. :(

Sometimes windows likes to detect devices plugged into a usb hub in a different order then it did the last time it was plugged in, so where my spinners are MOUSE3 XY right now, next time, they may get detected as MOUSE5 XY, now your right Ledblinky won't care, but when I reconfigure MAME to know it's spinners are now on MOUSE5, the configuration in LedBlinky where I told it MOUSE3 was the spinners will now be wrong.  So I made a fake default.cfg that Mame can't change, and have LedBlinky use it.  It took forever to figure out, but any changes in the name chain of
P1_DIAL=Left->P1_DIAL=MOUSECODE_3_YAXIS->MOUSECODE_3_ANALOG_X=MOUSECODE_3_XAXIS->MOUSECODE_3_ANALOG_X=SPINNER1
and they won't light. 

I really do like LedBlinky, I just wish someone had already taken the time to make a complete controls.ini, I'm working on mine right now, I'll share when I'm done, as I use a lot of mostly complete packages already, so I have no issue with passing it on. Currently 27,000 lines ;D

Controls.ini is Controls.dat, just the ini version.  There isn't a such thing as a "complete" one because we can't verify the control panel of every single game in existance.  Like mame, controls.dat is about preserving arcade history, so we try are very best to confirm that labels for controls are arcade accurate.  ;)

There is a forum right here on this site you know....

Btw just a heads up... controls.dat will be revamped soon and the ini version will go away.  Also various changes will be made such as incorporating colors.ini.

Nephasth

  • Guest
  • Trade Count: (0)
Re: LEDBlinky and control.ini question.
« Reply #5 on: November 13, 2011, 04:58:42 pm »
MacGyver,

I'm also running into an issue with controls.ini not being as complete as I would like for my list of games. Before I start hand entering in my info into my controls.ini, I was wondering if you'd share your work. Thanks!