Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Need MAMEHooker Gurus Help please  (Read 201 times)

0 Members and 1 Guest are viewing this topic.

MidLifeCrisis

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:March 09, 2024, 10:39:23 am
  • And... It's broke again... and so am I
Need MAMEHooker Gurus Help please
« on: March 05, 2024, 03:02:23 pm »
OK, I am raging against the machine a little bit here.  But I want to get the LED counter of the back of these positional guns to work. 
Are there any coders out there that can answer my question in a way this simpleton can understand?

In regards to the positional guns.  This is the code that is sent to activate the recoil when the game sends a state of '1':
ghd 1 &H04B4 &H6870 8 &h02:&h01:&h01:&h00:&h00:&h00:&h00:&h00

From my understanding:
ghd 1 = Generic Hid Device 1
&H04B4 = The device #
&H6870 = The Vendor #
8 = The Byte Length
&h02 =  The first byte and the specific part of the device being spoken to, in this case the recoil.  On the others it looks like &h03 is the rear LED counter and &h04 is the LED strip.
&h01:&h01:&h00:&h00:&h00:&h00:&h00 = The last bytes sent

So this works to send the recoil signal.  For the rear LED counter (double 7-digit displays), the signal sent is:
ghd 1 &H04B4 &H6870 3 &h03:&h00:&h0%s%

The difference this time is that we are sending only 3 bytes to &h03 and the &h0%s% sends the state, lets say '15' to display.  Here is where my problem starts.  The only thing displayed is '05'  If I change it to &h01:&h%s% it will display '15' but only the 1st digit counts down, the 2nd digit stays a  1.  If I change it to &h0%s%:&h0%s% it will display '55' and both numbers will count down in 44, 33, 22, etc..

I don't know how to get it to read the first digit in the state and send that to the display.

Any help would be greatly appreciated!