Also, gl.tter, you should brush up on the threads on Johnny 5 and CPmaker, which use this file to display what buttons on a CP are used by a game.
I think the light engine would have to use a similar approach to do what Popcorrin (and I) would like.
Here's the approach I've taken:
MAME sends which controls (MAME input codes) are enabled by a particular game to the light driver. The driver can then choose to light up all the controls used by game.
For this to work, the driver has to supply some mechanism to map lights to controls (usually a text file). So for example, you edit the file and say 'light 1' is under hardware button X (ie. MAME input code XXX). That information is then enough to light up the controls used in a game.
That's the basic mapping support I would expect most light drivers to implement. However, drivers could go much further, and for example could let you associate 3 light outputs with an RGB LED. They could then allow you to set colours in various ways, either using a global scheme, or even schemes for each game.
So I think the best places to set colours is in the driver control->light configuration file.
BTW, I'm working on a driver that does all this and much more.
I thought Buddabing was taking care of this, but haven't been following in depth. One thing that would put a slight wrinkle in your logic is this scenario and it's pretty common.
I have button 1 wired up next to my 8-way, 4-way, and let's say trackball. They are all mapped to the same button. Either by configuration or parsing of controls.dat I would want the appropriate button lit for that game.
i.e. When playing centipede the button next to my trackball, Donkey Kong the button next to my 4-way, and for 8-way games the button next to my 8-way.
Just something to think about. The controls.dat is the reason I'm getting this, the rest is just icing for me.
Although, I think the rest is harder to implement, but it is pretty cool what you've been able to do. gl.tter I know you've posted some info on how you are discovering and figuring out some of this, have you thought about posting more info on this and how the other guy(Dr. Romz?) figured out his stuff? I thought you had mentioned he took a different approach. Obviously, I'm not talking about your implementation more of how you used MAME to figure out the signals.