Main > Driving & Racing Cabinets
Adding Race Leader lights - advice needed
buttersoft:
Just to add it back again...
I'm struggling! Any chance someone with M2emu, Supermodel, and ideally some TP games, could please zip up working mamehooker ini and settings folders and link them? I'd love to check to see if i've missed anything :/
jorgenjl2:
--- Quote from: buttersoft on January 26, 2023, 12:28:39 am ---Just to add it back again...
I'm struggling! Any chance someone with M2emu, Supermodel, and ideally some TP games, could please zip up working mamehooker ini and settings folders and link them? I'd love to check to see if i've missed anything :/
--- End quote ---
Did you have any luck? I will be doing this at some point as well and can share if no one has anything by then.
buttersoft:
Boom kindly replied to me on discord. Easiest way to do it is to use his FFB plugin for m2emu, and check the enable outputs box in there.
jorgenjl2:
--- Quote from: buttersoft on February 07, 2023, 05:51:09 pm ---Boom kindly replied to me on discord. Easiest way to do it is to use his FFB plugin for m2emu, and check the enable outputs box in there.
--- End quote ---
Awesome. Do you have a couple example ini files you can upload? I realize the com port and little things will change but at least it would be a good head start. I just bought everything to make a race leader light and I will make a post with exactly how I am doing it and how I am making the race leader light. There is so little info on this I figure I need to get it to a point where someone can easily copy it and not spend hours researching and still not find much.
buttersoft:
So you run MAMEhooker as admin, set mame path and enable hooking. Then, I hope Baritonomarchetto's is ok with me cribbing from his post and site(http://forum.arcadecontrols.com/index.php/topic,167200.msg1761662.html#msg1761662)
--- Quote ---/*
Arduino - Mamehooker outputs read setup sketch
This sketch lets Arduino read outputs signals from
Howard Casto's Mamehooker.
Pins from #2 to #13 are set to outputs and can be used
to send hardware outputs signals.
Here is an example of mamehooker .ini code
(message sent to Arduino serial port COM4):
[General]
MameStart=cmo 4 baud=9600_parity=N_data=8_stop=1
MameStop=cmc 4
StateChange=
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
lamp0=
lamp1=cmw 4 3., cmw 4 %s%, cmw 4 x
lamp2=cmw 4 4., cmw 4 %s%, cmw 4 x
lamp3=cmw 4 5., cmw 4 %s%, cmw 4 x
lamp4=cmw 4 6., cmw 4 %s%, cmw 4 x
lamp5=cmw 4 7., cmw 4 %s%, cmw 4 x
lamp6=cmw 4 8., cmw 4 %s%, cmw 4 x
lamp7=cmw 4 9., cmw 4 %s%, cmw 4 x
lamp8=cmw 4 10., cmw 4 %s%, cmw 4 x
lamp9=cmw 4 11., cmw 4 %s%, cmw 4 x
lamp10=cmw 4 12., cmw 4 %s%, cmw 4 x
lamp11=cmw 4 13., cmw 4 %s%, cmw 4 x
Code adapted from fruit-emu.com (majoris and eric)
by Barito, 2018
*/
int pin;
int value;
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
Serial.begin(9600);
}
void loop(){
while (Serial.available()>0){
pin = Serial.parseInt();
value = Serial.parseInt();
if (Serial.read() == 'x'){
digitalWrite(pin, value);
}
}
--- End quote ---
The actual arduino code is the part from "int pin;". Before that in an example ini file. When you run a MAME game and everything is set right, MAMEhooker generates an ini file with the same name as the game zip. That way you know what the outputs are called. Outrunners is a side-by-side driving game running from a single board. One instance of the game is for two players, and generates the orunners.ini file below, to which has been added some com port config info to start and stop things.
--- Quote ---[General]
MameStart=cmo 9 baud=9600_parity=N_data=8_stop=1
MameStop=cmc 9
StateChange=
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
MA_Check_Point_lamp=cmw 9 2., cmw 9 %s%, cmw 9 x
MA_Race_Leader_lamp=cmw 9 6., cmw 9 %s%, cmw 9 x
MA_Steering_Wheel_motor=
MA_DJ_Music_lamp=
MA_<<_>>_lamp=
MB_Check_Point_lamp=cmw 9 4., cmw 9 %s%, cmw 9 x
MB_Race_Leader_lamp=cmw 9 5., cmw 9 %s%, cmw 9 x
MB_Steering_Wheel_motor=
MB_DJ_Music_lamp=
MB_<<_>>_lamp=
--- End quote ---
MAMEhooker sends a message each time the state of one of those outputs changes - as long as there's any instructions next to that output. in this example the com port is configured up the top, and the Leader and Checkpoint lamps for P1 and P2 are sending data over it. So, each time the MA checkpoint lamp turns on or off it writes "2." to com port 9, then writes the state of the lamp (%s%) to com port 9, then terminates (x's) the com port write). The arduino code, above, reads the serial message, and acts on it to turn on an output.
The MAMEhooker docs folder goes into much more detail about different devices and different commands and ways to use them. Most TP games, M2emu, and others can be directly seen by MAMEhooker once you turn outputs on in either TP itself, or Boom's FFB plugin. Howard's site contains info about titlebar hooking for emulators/games that MAMEhooker doesn't automatically see, like Supermodel.
Note that an arduino can't deliver much current. You should use transistors or relays to deliver more. Baritono's site linked above provides some options for doing that.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version