Main > Software Forum
LED control from Mame--in over my head again?
1UP:
Yeah, I know. I just got really lucky that a bunch of the stuff I've been wishing for is also stuff you've had an interest in. Doesn't mean I can't enjoy it though. :D
Howard_Casto:
Agreed....
I used the speak command to make the computer speak to me when I pressed a key (for fullscreen testing). You haven't lived until you've played digdug with microsoft anna constantly yelling "Control On..... Control Off" :afro:
Howard_Casto:
I woke up WAAAAAY too early this morning and I was bored go I looked at the outputs on the segay board games (rail chase, gloc, strike fighter and power drift) to see how hard it would be to hook up the outputs for these ride-on games.
My conclusion is very easy AND very difficult.
The first "problem" is that all the games use the same generic output function. Since they all have VERY different hardware, this would have to be parted out for each individual game. This isn't difficult per-say but it is a pain in the butt as the driver would have to be extensively re-written.
The second problem, and this is a legitimate one, are the safety switches. Each motor/piston/whatever in a sega game has a safety switch that trips whenever the actuator goes beyond it's limits to prevent damage to the machine. Mame has them all forced to "on." This does two things. Firstly, it makes the games fail their output tests in the debug menu, making it difficult for me to hook up the right data to the right outputs. Secondly, depending upon the cabinet, it nullifies all output data, putting the data into an error state. Now for some games the data is still sent, so we could just ignore the error data, but for games like rail chase and galaxy force, it turns off all piston outputs.
Of course we could hook the safety switches up to regular inputs and that would allow the motors and pistons to work properly, but then the switches actually have to be hooked up to something or else your motors/pistons could burn out. This means generic implementation of the outputs might be impossible... I honestly don't know though as I'm not a disney imagineer. ;)
The good news is the data doesn't seem to be too complex. Powerdrift, in particular is suprisingly easy to figure out and I could probably hook it up right now. It seems to ignore the errors as well. Also the non "dangerous" ouputs are not only easy to hook up, but they don't error out, so like afterburner, these could be hooked up to proper lamps easily. The gun soleniod in the rail chase guns is included in this. :)
Even the more complex ones have logic to them that make them easy to follow. Basically you have a byte or so of data, not unlike terminator 2. (Minus all the annoying strobing) Inside the btye you have 7 or 8 bits reserved for telling the power level of the motor and the rest are for direction/position.
So the bottom line is, it would be a lot of work, but I could definately hook up most of the outputs for the sega games given enough time and maybe some help.
I think I would be willing to spend most of my free time on this assuming I could get together a small team of volunteers to help me with the programming and we could gather another small team of hardware-minded individuals that would look into practical applications of the data (in other words, motion sim rigs like you see for racing games.)
Speaking of which, maybe I should start a new thread for this?
Maybe we need a new forum or maybe a new site just for developments on mame outputs and output-related hardware?
headkaze:
Speaking of using MS Speech in a cab, check out this video using my LED Plugin for GameEx ;)
I'm happy to help out where I can Howard, although quite busy these days. I can help clean up code and stuff. I've written a few HID drivers for Ultimarc products like the UltraStik, U-HID and PacDrive so I can help with things like that. It's unfortunate we don't have a hardware interface like the U-HID for sending data to hardware. What sort of hardware interface do you have in mind? I'm also wondering how many outputs could be supported in a single cab (besides LED's) or are you thinking about dedicated cabs?
Howard_Casto:
Nice!
Well I don't think the interface at the pc level (usb device) is all that important. It's the interface between that and the actual hardware (relays, speed controllers, ect) that might need work.
I was thinking both the dedicated cabinets AND more generic implementations. None of the machines in the arcades use THAT many outputs, they all just use different kinds. Generally it's a maximum of 4 motors/rams/whatever and perhaps a motor or pair of motors for the joystick/wheel itself. Some of the atari games also use "butt thumpers" as outputs as well, but I think that might just be a manipulation of the sound data.
Then there are lamps.... generally there are only one or two (start buttons) but afterburner and some of the racing games have up to 10. Since they are digital it isn't out of the realm of possibility though.
For the "buy it and convert it" crowd... the solution is simple... buy a gloc 360 cabinet. It has enough freedom of movement and rotational axis to simulate any other motion cab ever released as well as a force-feedback joystick. Make a removable steering wheel panel and you are good to go.
The trick would be making sure that we can fully support it's hardware.
For the diy crow there are sites out there with various hardware, but I no nothing about them nor how well their stuff works.
This site comes to mind:
http://buggies.builtforfun.co.uk/Sim/
The i/o board they have is actually extremely similar to what they used in games like afterburner. I didn't mention it in my post above but each motor generally has a pot to go with it... that's how they could use regular dc motors and still know the motor's position. Generally speaking they are already hooked up in mame though, so it shouldn't be an issue.
Sega games have an added complexity though. Generally the motor's have an 8 level power setting so that quick jerky and slow lumbering movements can be simulated. I dunno how to do with with high voltage/amperage other than perhaps a speed controller?
I think the main thing would be putting it all-together. At least one prototype rig would need to be built and then when people wanted to build a racing mame cab or a flight-sim mame cab they would have a working example to go by similar to how luscid's plans are used (or over-used) for stand up cabs today.
As for the mame end of things... it isn't difficult, it just takes time and you have to play around with the data. After messing with those gun games I've found a pretty sure fire method for figuring out the outputs, you just need mamehooker running alongisde mame to help with the debugging.
1. Find all the write functions in the game, particularly those already labeled as output data and install an output that constantly send the ENTIRE data string. Something like output_set_value("Debug", data );
2. Compile mame and run it in windowed mode with mamehooker running and mame hooker's debug window open.
3. Fire up the game and go into the dip/debug menu. You should get clean "all off" data inside them because the game isn't running.
If all of your debug outputs are fluctuating, you have data strobing going on and it'll make things more difficult, but you can deal with that later.
3. Now if it exists, go into output/motor/driver menu and let the tests run. You should see the data change on at least one of your debug outputs.
If not then mame doesn't even have the memory addresses for the outputs mapped (I've found this to be rare) so you should try a new game.
4. Anyway, now that you know which debug outputs were effected you go to that function in mame and split out the single chunk of data into it's individual bits and give each one an output, just like I did in the revolution X examples.
5. After that you just keep re-compiling, going into the debug menu and watching the data until you find the pattern and label up the individual outputs.
Some are infuriatingly hard, but many, particularly digit ouputs are real easy. Zombie Raid took me maybe 15 minutes to figure out because all it did was send a 16 for p1's recoil solenoid and a 8 for p2's along with the rest of the gun data. Most are like that, you'd be suprised..... There just isn't enough time in the world for me to go through every game with outputs in mame and try them all. That's why I say we need a team of people. They don't even have to be competant mame devs, just competant C programmers. Hell I barely qualify myself. ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version