Main > Software Forum

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

<< < (18/24) > >>

Howard_Casto:
Let me know how it works, and be sure to make pictures/videos.  I'm building an examples page once I figure out wtf is going on with terminator 2.

1UP:
OK, I now have the recoil board hooked up to Operation Thunder!  And boy is it loud!  First time I powered up the board I thought something blew because I heard a loud POW.  After that the LED-Wiz was not responding so I was sure I'd fried it.  Then I realized it was because I had suspended my laptop and Mame Hooker was not seeing the LED-Wiz.  Restarted MH and it was all good.

The kickers are frigging scary now that they're back inside the gun.  It's about as loud as a .22 going off.  Might have to get some rubber bumpers to put inside to tone it down, as well as protect the gun shell and the Aimtrack from shock--the metal plunger just whacks into the plastic shell!  I was counting on some shake and a little noise, but with these the whole house knows I'm playing.  :o

Now I just need to splice the USB cable back together.  Had to cut the end off to run it down the hose.  Should have a good test with the Aimtrak and recoil working together in the next couple nights.  As soon as I have videos, I will post them.

Thanks again Howard for building this neat little program.  I really can't wait to get both guns going in T2.    ;D

Howard_Casto:
holy crap I think I've got it... Or at least I've gotten it enough to be playable.   ;D

in src\drivers\miidyunit.c

at the function "static WRITE16_HANDLER( term2_sound_w )"  immediately after the first "{" add the following monstrosity of code:

------------------------------------------------------------

   if  ( ((data & 2048) != 2048) and ((data & 1024) == 1024 ) )
   {
   
   output_set_value("Left_Flash_1", (data & 1)/1 );
   output_set_value("Left_Flash_2", (data & 2)/2 );
   output_set_value("Left_Flash_3", (data & 4)/4 );
   output_set_value("Left_Flash_4", (data & 8)/8 );
   output_set_value("Right_Flash_1", (data & 16)/16 );
   output_set_value("Right_Flash_2", (data & 32)/32 );
   output_set_value("Right_Flash_3", (data & 64)/64 );
   output_set_value("Right_Flash_4", (data & 128)/128 );
   }


if  ( ((data & 2048) == 2048) and ((data & 1024) != 1024 ) )



   

{



   if  (((data & 16) == 16) and ((data & 32) == 32) and ((data & 64) == 64) and ((data & 128) == 128) and ((data & 1) == 1) and ((data & 2) != 2))
   {
   
   output_set_value("Left_Gun_Recoil", 1 );
   
   }
   else
   {
   output_set_value("Left_Gun_Recoil", 0 );
   }



   if  (((data & 16) == 16) and ((data & 32) == 32) and ((data & 64) == 64) and ((data & 128) == 128) and ((data & 2) == 2) and ((data & 1) != 1))
   {
   
   output_set_value("Right_Gun_Recoil", 1 );
   
   }
   else
   {
   output_set_value("Right_Gun_Recoil", 0 );
   }



   
   if  (((data & 16) == 16) and ((data & 32) != 32) and ((data & 64) == 64) and ((data & 128) == 128))
   {
   
   output_set_value("Left_Gun_Green_Led", 1 );
   
   }
   else
   {
   output_set_value("Left_Gun_Green_Led", 0 );
   }


   if  (((data & 16) != 16) and ((data & 32) == 32) and ((data & 64) == 64) and ((data & 128) == 128))
   {
   
   output_set_value("Left_Gun_Red_Led", 1 );
   
   }
   else
   {
   output_set_value("Left_Gun_Red_Led", 0 );
   }

   if  (((data & 16) == 16) and ((data & 32) == 32) and ((data & 64) == 64) and ((data & 128) != 128))
   {
   
   output_set_value("Right_Gun_Green_Led", 1 );
   
   }
   else
   {
   output_set_value("Right_Gun_Green_Led", 0 );
   }

   if  (((data & 16) == 16) and ((data & 32) == 32) and ((data & 64) != 64) and ((data & 128) == 128))
   {
   
   output_set_value("Right_Gun_Red_Led", 1 );
   
   }
   else
   {
   output_set_value("Right_Gun_Red_Led", 0 );
   }

}
--------------------------------------------------------------------------


I don't think I have it 100% right as sometimes the recoil seems to slow or be a little un-responsive, but it is as far as I can go with it.  I'll clean up my code and send it to mamedev within the week.  I can say this, the problem is NOT with the improper bit-address(es).  I NEVER get a false mis-fire now.  The problem is I think my conditions are a tad too strict, and every once in a while a fire gets missed, but as I said, this is as far as I can go without hardware schematics, the actual hardware to send data to, ect.... 


On a side note, how do you like my output names??  I couldn't decide on a propr standardization, so I simply took the text that appears in the "driver board test" menu.  I pretty much had to use these names as I was debugging because it became too confusing to keep track otherwise.  I think this might be the way I need to do revX as well.  As for operation wolf and thunderbolt, they don't have a debug menu, so we can name them whatever we deem appropriate. 

1UP:
That's awesome Howard!  I wish I had time to patch that in and recompile tonight but it will probably have to wait a couple days.

Regarding the recoil slowing down...are you sure that's not the game itself?  Your gun periodically gets low on power/overheated which slows the rate of fire, and you need to get the power ups (ammo or coolant) to get it going again.

Your naming makes perfect sense, so I say keep it!

BTW, that manual I posted on page 1 has full schematics of the system I think.  You should check it out if you haven't.

I just got done blasting some terrorists in Thunderbolt with the Aimtrak and recoil hooked up for the first time, and I think I need to slow the repeat rate to half.  The recoil is actually affecting my aim.  The gun is also getting pretty warm and I'm worried about eating through its life cycle too soon...

Howard_Casto:
I would be careful using the guns in opwolf/thunderbolt period. 

Judging by every pic I've seen of the inside of a opwolf gun, those guys work with a 12v motor rotating a piston.  This of course explains why we have to use our strobing script but also keep in mind that a piston doesn't have any constant resistance and thus is very hard to overheat. 

I can also tell you that the strobe on the terminator guns is MUCH quicker.  It's so quick that I had to artifically lengthen it via scripts for it to work well with my force-feedback controller.  So that might explain why you are getting such a hard, loud knock with your guns.

I would definately install some padding btw, that's just a good idea all around.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version