Main > Software Forum

LED control from Mame--in over my head again?

<< < (4/24) > >>

Howard_Casto:
Yes BUT.... remember as I said in an earlier post, operation wolf and operation thunderbolt use different types of recoil mechanisims than T2 does.  Bascially the output doesn't "flicker" like T2 does.  It will remain a "1" the whole time you hold a trigger down, unless the gun overheats.  It'll turn to a "0" when you release the trigger. 

So if your solenoid is setup to a board that toggles it on and off rapidly when power is applied then you are good to go.... if not then you'll need to make a script and run that instead to get the "flicker" back.  Fortunately that isn't hard to do at all.

I would suggest you try operation thunderbolt first to see what I mean as it works the same way. (I think it uses the outputs "led0" and "led1")

Howard_Casto:
Ok, I don't think I'm gonna get any farther right now as I'll resume working on mamehooker for a while, but just an update. 

Looked at Terminator 2 for ages last night try to determine how to hook up outputs the "right way" and I was totally lost.  I though I'd take a look at revX instead which uses similar, but slightly different hardware.  Anyway, there's a generic 16 bit write function setup for the input/output of that game and basically it says via comments that they know what bits 0-5 do, but not the rest.  Currently it is outputting any additional bits to the debugger.  Since this is the I/O function and there are tons of unknown bits, it makes sense to me that some of those bits are the outputs. 

Now terminator 2 has basically the same 16 bit i/o address, but it isn't parsed the same way in it's driver because the midway y unit is basically for mortal kombat games.  Assuming I can get revX working, and that is a BIG assumption, then I can copy the function used in revx to the y unit driver and use it for terminator 2. 

Howard_Casto:
You owe me 1up... I'm thinking a pony because it looks like I'm gonna be able to figure this out.   :afro:

hooked up a output just to any "unknown" data in the driver and this is what I came up with when in the dip menu testing outputs:

---------------------------
Logging Results for output "Motor0"
rest= 64496
gun 1 recoil =64497
gun 2 recoil = 64498
gun 3 recoil = 64500
p1 led = 64480
p2 led = 64464
p3 led = 64432
---------------------------
The text above is the value of my test output when the various status messages were on the screen.
These changed consistantly in the debug menu so I know that at the very least they have SOMETHING to do with the outputs.... I went ahead and tried inside the actual game and sure enough when I fired the gun the right-most position of the value "flickered" so I think that this is it.  Also to be sure I fired player 2 gun and again, it only changed the data when I fired.  Now of course this is only half of the battle.  Now that I know the general dataspace I have to filter the data into useable outputs instead of the huge 5-digit blob above.  It shouldn't be too bad, but it might take a while. 

Again, terminator 2 is on the midway y board, not the x board, but the x board was basically for RevX only so x and y are VERY similar.  This should help with getting T2 hooked up. 

So I sure am going about it in a round-about way, getting operation wolf and revX running first, but we'll get there. 

1UP:
 :o  Watching with bated breath...

Howard_Casto:
Ok I figured out RevX... or at least I did mostly.  I DEFINATELY have the individual outputs mapped now, but there seems to be some additional data manipulation needed.  The recoil "flickers" when you fire, but it is really slow... like once every half second.  Either that or my debug window can't keep up, which is also possible. The leds seem to act funny as well.  They are all on (1) by default but seem to turn off when you fire?  Also once you are out of discs (bombs) the light seems to invert.  Revolution X has to be one of the worst gun games out there, but if any poor sap has one let me know so I can see if this is normal behavior. 

Anyway... again, for you impatinet ones....

In src\machine\midwunit.c

Look for the function "WRITE16_HANDLER( midxunit_io_w )" and then after the line "default:" add the following lines of code:

------------------------------------
output_set_value("Debug", data  );
output_set_value("Motor0", (data & 1)/1 );
output_set_value("Motor1", (data & 2)/2 );
output_set_value("Motor2", (data & 4)/4 );
output_set_value("led0", (data & 16)/16 );
output_set_value("led1", (data & 32)/32 );
output_set_value("led2", (data & 64)/64 );
-------------------------------------

Again the "motor" names are just a place holder.  Also note that because I'm not 100% sure that I don't need to do something else, I've put the entire 16 bits of data in the "debug" output.  Maybe somebody else can figure it out.


We are almost there man... almost there.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version