Main > Software Forum
LED control from Mame--in over my head again?
1UP:
So after many years, I've finally got a hardware combo that works to control a solenoid board from my PC. Terminator 2 recoil is my goal and last night it seemed so close. Using LEDBlinky or Mame Hooker I am able to trip the trigger circuit that makes my recoil board fire--awesome! But now I'm at the last step--getting the LED software to read outputs from Mame lamp status. This is where I'm stumped.
In Mame Hooker I can manually send a state change with a command like "lws 1 01 1", but a command to have the state passed from Mame like "led0=lws 1 1 %s%" does nothing. I have tried setting the "led0" part to various values in case led0 does not exist, but nothing.
Is this something that is supported on a game-by-game basis, at the whims of the Mamedevs? AM I going to have to rewrite the midyunit.c to output an led value based on a state change in the game? If so, I do have a hack from the old wmsyunit.c that someone did wayyy back to make T2 light the keyboard LEDs, but not sure that will work in this case.
I'm totally not a coder, not even sure what the first step should be, but I'll give it a shot if someone can point me in the right direction. I would appreciate any help! Examples would be awesome! And if someone has info on where I can find a master list of configs to get a bunch of Mame LED supported games to work with LED-Wiz, I think I will cry.
Thanks!
Rob
smalltownguy:
I worked a little bit with the ledutil.exe program in my setup, but it was only to light my Atari volcano LED's. I'm not sure of any other LED output from MAME, but maybe someone like urebelscum could assist?
Howard_Casto:
--- Quote from: 1UP on March 07, 2010, 06:47:49 pm ---In Mame Hooker I can manually send a state change with a command like "lws 1 01 1", but a command to have the state passed from Mame like "led0=lws 1 1 %s%" does nothing. I have tried setting the "led0" part to various values in case led0 does not exist, but nothing.
Thanks!
Rob
--- End quote ---
Well that's your first problem. Look at your example.... in the first one you have "01" which is the proper syntax, but in the second you do not. Also led0 denotes a led output. With one glaring exception guns do NOT use the name "led" as an output name.
That aside...... A game must have outputs hooked up.... that's why mamehooker has a debug mode! Fire up mamehooker and click on the icon in the taskbar to make the debug window appear. Now fire up the game in mame but in windowed mode (so you can still see the debug menu.) If a bunch of outputs dont' appear in the debug menu while playing then there aren't any outputs.
With that being said, I can tell you ahead of time that the only positional gun game that has it's outputs hooked up in mame is operation thunderbolt and they are erroneously labeled as "led0" and "led1".... it's on my list of things to fix and re-submit to the mame devs. And no, terminator 2 and revolution X are NOT hooked up. If you want to send me the hacked source code I can look at it as thunderbolt is included in mame's source and it's a pretty bad hack as well. I see no reason why it couldn't be added to the mame source.
Howard_Casto:
Oh and btw... hey 1up long time no type! Hated to just tear into the issue like that but I needed to get done with the technical details first. :cheers: Mr. Do, myself and a few others (mostly me though) are currently trying to document what outputs are in mame and then deal with any issues and try to get other games hooked up.
To answer your question... yes, they are just hooked up at random at the whim of whoever chooses to do so.
You've really got five types of games with outputs:
Type #1 was immediately supported upon the creation of the output system. These are games that were already hooked up to keyboard leds before the outputs system was created. Since the keyboard leds are now automatically routed to the output system they work (this is thunderbolt's deal) but of course they are almost always labeled wrong.
Type #2 was also immeditaly supported. These are games that had "blinking" artwork before the output system was created. If a game has artwork then it's artwork states are automatically passed on to the output system as well. These are generally labeled better. Also these are generally the first to get "fixed" in terms of games that currently don't have their outputs working because lots of people use the artwork system and Mr. Do will generally bug a mame dev to hook them up when he gets a new scan of their bezel or what not. ;)
Type #3 are games that have known outputs, but they are "complicated" outputs that require precise knowledge of the pcb and a lot of data-manipulation in-driver to be able to send anything to the output system that's useful. Afterburner and the games that run on it's boards are great examples of this. Aaron Giles was a great fan of afterburner, so he personally hooked up the lamps when he made the output system but that's as far as it's ever gotten, even though the output addresses are generally known for all the games on those boards. Open up the source and see all the crap that had to be done just to get INPUTS in these games and you'll soon understand why. I fear these games may never get hooked up unless a fan of the particular game, who also happens to be a mame dev, gives it a go we are screwed. I tried working on afterburner and others a few months back and failed miserably. Because it's a midway board, terminator 2 also falls into this group. Don't get me wrong, it's not "sega y board" hard, but it's still a little hard.
Type #4 are games that have known outputs but the driver in mame is ANCIENT and the original author, who would be more apt to know the memory address of the outputs are long gone. These games probably won't ever get hooked up either unless someone takes interest. As far as most of the mame devs are concerned these drivers are finished and done with, so they are neglected. Fortunately they aren't that difficult to hook up though, it'd just take a great investment of time.
Type #5 are games newly added to the driver. We are very fortunate that the output system is also used for artwork because thus far nearly every new game added since the output system was created has had it's outputs hooked up so mr. do can do a bezel for it. Since the non-artwork outputs are just as easy to hook up, they get fixed as well. This means at least new drivers aren't going to be a bother.
Anyway.. ramble over. I'm currently making a list of all mame games with outputs, but it isn't ready and I'm also going to have a go at cleaning up the output system in mame. So if you wanna help that'd be great and if you have "hacks" send me the drivers.
1UP:
--- Quote from: Howard_Casto on March 07, 2010, 08:49:03 pm ---Well that's your first problem. Look at your example.... in the first one you have "01" which is the proper syntax, but in the second you do not.
--- End quote ---
LOL, Howard then you need to clean up your docs...I pasted those examples from the Mame Hooker readme file! ;) But that's good to know.
I'll send you the driver hack. I cant get the Contact link to work on your site, so I'll try your profile email. I'm perfectly happy to help test stuff in my spare time, but I won't be able to help much on the coding side....
Thanks for the info. Maybe I'll even try pasting the hacked part into the latest source and see what happens.
Rob
Navigation
[0] Message Index
[#] Next page
Go to full version