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: MAMEHooker + Modified Outputs?  (Read 4879 times)

0 Members and 1 Guest are viewing this topic.

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
MAMEHooker + Modified Outputs?
« on: December 07, 2012, 10:54:03 am »
I've hit a bit of a snag in one of my latest endevours which is 'MAMEing" a Revolution X cabinet.

I've got recoil working great (man are these things ever LOUD) but obviously some games don't use a solenoid for recoil but rather a piston so rather than the game outputting a constant on/off signal it just outputs a solid on signal.

I was wondering if there's a way to make it so I can set the output to fire over and over by making a script or something? I see there's a multiplier command in MH but there's no documentation as to what it does or how to use it?

I suppose I could make up a circuit to do this but I'd prefer to do it in software if possible?
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #1 on: December 07, 2012, 12:23:22 pm »
What would a multiplier do?  A solenoid is on/off so changing the power level isn't going to do anything.  Everything is documented in the readme.txt btw.  ;)

I don't know what interface method you are using so this a generic example, but make a script like this:

functionname  %s%
functionname  0

Functionname obviously refers to which ever function you are using to control your recoil. 

In the ini for the game, you'll call this newly created script via the looping script function.


The %s%  refers to the current output state, so when the piston is on, the script will fire a "1"  wait your specified delay time, fire a "0" and then loop infinately doing the same thing.  When the piston is off, the script will fire two "0"s essentially doing nothing.   


There are other, code-based methods of doing it, but this is just the simplest to understand. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #2 on: December 07, 2012, 01:19:29 pm »
Ah readme, what a beginner's mistake, I know I've read it before too though a few years ago at least :) As I said I had no idea what multiplier did so as that was the only other thing I could think of that might help other than the scripting.

So I assume then in the script (let's call it piston) file it should look like this:

uls 1 1 %s%
uls 1 1 0

Then call like this in the ini (assuming 10 is the correct delay time):

Player1_Recoil_Piston=lfs piston 10 %s%

Is that right or do I not need the %s% at the end of the call?

I'll try it out later, I'm deathly ill at the moment  :dizzy:
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #3 on: December 07, 2012, 01:58:32 pm »
Yeah that should do it. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #4 on: December 07, 2012, 03:11:08 pm »
Ok I tried it since I couldn't wait :)

Works great with operation thunderbolt but for some reason with operation wolf it just does what it'd do if there were no script. Odd thing is, in mamehooker's debug window I can see it's working?

So then I tried beast busters and now it does nothing :( It won't even work now if I just add uls 1 1 %s% to the output.

Then I tried Alien 3 and it works fine??  ???

I even copied the ini and just edited out the outputs which weren't applicable to make sure I didn't mis-type anything.

Very odd! Any ideas?
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #5 on: December 07, 2012, 03:32:03 pm »
Ok so I just configured mechanized attack and this game uses a solenoid and I noticed the recoil was a little erratic then I noticed mamehooker was still running the script  ???

I restarted mamehooker and it stopped doing this but it didn't help operation wolf. In the debug window it says "Setting Output uls 1 1 0" but when I hit the trigger it just stays on the normal window telling me what outputs there are etc.

Beast busters actually doesn't use a piston, just a normal solenoid. I still had to restart mamehooker to get it to work right though. So every time I run a game with a script it just stays loaded and screws with the other games using that output.

« Last Edit: December 07, 2012, 03:35:56 pm by retrorepair »
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: MAMEHooker + Modified Outputs?
« Reply #6 on: December 07, 2012, 03:33:42 pm »
I was about to post that Beast Busters used solenoids when you replied.

Operation Wolf used a crazy geared contraption, but in the end it's just a motor and would be treated the same as a vibration motor.
I'm at a loss on that one.





retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #7 on: December 07, 2012, 03:37:13 pm »
Yeah it's weird, op thunderbolt uses the same piston recoil system and that works fine with this script. Both games only output an "on" signal so I don't get why op wolf isn't playing ball  ???
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #8 on: December 07, 2012, 07:12:28 pm »
Looping scripts run until you tell them to stop, so you need to add a end looping script function to the "MAMEStop" section of your ini

Also thinking on it, it might save you some processess (and be much cleaner) to put the loop from script call at "MAMEStart" instead. 

Beast busters and many of the other games you are talking about use a pulse system like rev x, not an always on like op wolf.  You might not be able to see it in the debug window because it happens so stupidly fast. 

I know the third operation wolf game (which I'm sure was manufactured by the devil) is just erratic period... I hooked it up in MAME myself and let me tell you, the game is a mess. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #9 on: December 07, 2012, 08:49:44 pm »
Ah ok that explains that little issue then.

Still not sure why operation wolf won't work with the script though. It just stays on like it would with just the uls 1 1 %s% command  :-\

Op wolf 3 is a complete mess overall then, pretty sure they ran out of time and just said "that'll do".
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #10 on: December 08, 2012, 03:43:11 pm »
It's most likely a timing issue, so you'll probably have to manually instert a wait command inside the script.  OpWolf is an odd little duck and due to timing issues the output state is constantly reset, which might be your issue.

Try a script something like this:

uls 1 1 0
wat 33
uls 1 1 %s%

Edit the value of the wait command until you get a good pulse.  For some relays this has to be really long like 200 ms or more. 


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #11 on: December 08, 2012, 04:00:28 pm »
Yeah OpWolf is a special case..... I looked up my own test scripts to see how it did it:


======================================================
[General]
MameStart=
MameStop=kls 1
StateChange=kls1,lfs 360strobe 10 %Player1_Recoil_Piston%
[Output]
Rrecoil_Piston=
Recoil_Piston=
Player1_Recoil_Piston=
=======================================================


I'm calling it at the state change, to prevent issues.  If you call it at mamestart the value of the recoil piston is going to be null instead of 0 and it'll error out. 
Also note I'm calling the script by passing %Player1_Recoil_Piston% specifically and killing any existing scripts before launching it.  This is to prevent a back log of commands due to rapidly pressing/releasing the trigger. 

That should do it and sorry about the confusion... I haven't messed with OpWolf's recoil in quite some time. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #12 on: December 08, 2012, 07:49:09 pm »
Ah that's great thanks Howard, I'll give that a go  :cheers:
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #13 on: December 09, 2012, 04:40:12 pm »
Hmm, still not working. Actually doing nothing at all now. I added the info you posted from the last two posts you posted (script and ini) and nowt.

I changed the wat 33 to wait 33, I'm guessing that's what you meant?
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #14 on: December 09, 2012, 04:49:46 pm »
Hmm, still not working. Actually doing nothing at all now. I added the info you posted from the last two posts you posted (script and ini) and nowt.

I changed the wat 33 to wait 33, I'm guessing that's what you meant?

Nope... the command is "wat"

All mamehooker commands are three characters for brevity. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #15 on: December 09, 2012, 05:48:40 pm »
Ah ok. Well I changed it and still doesn't work :(

Is the formatting above correct?
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #16 on: December 10, 2012, 12:16:54 am »
Ok well I got it to work, it's pretty authentic too, having owned the real thing.

Here's how my opwolf.ini looks:

Code: [Select]
[General]
MameStart=
MameStop=kls 1
StateChange=kls1,lfs pistonwolf 20 %Player1_Recoil_Piston% %s%
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
Player1_Recoil_Piston=

And the script file (which I called pistonwolf.mhs):

Code: [Select]
uls 1 1 0
wat 33
uls 1 1 %s%

Thought I'd post in case it helped someone else, or since I'm good at losing my data me later on :)

Thanks for all the help Howard! Only thing I have to do now is figure out how to get Gunblade NY to work with these joysticks!
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #17 on: December 10, 2012, 12:42:08 am »
That's essentially what I posted before, so you must have had a typo or something. 

There was a typo in my original post btw... the first line of state change should be "kls 1" not "kls1"  Now technically it shouldn't matter as kls doesn't use the variable passed for anything, but it could cause errors I suppose. 

You shouldn't need that extra "%s%" at the end of your StateChange line either.... mamehooker again will error correct for this and ignore the extra variable, but just so we don't confuse anyone. 


Glad you got it working!

We can get gunblade to work via hacking I just haven't had time to fool with emulation stuff as of late.  I can whip up something rather quickly, but I was working on a new-fangled troubleshooter app that would allow joystick input for any lightgun game. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #18 on: December 10, 2012, 12:51:20 am »
Yeah I figured the typo since it was formatted differently just above it but as you say it didn't make a difference either way. It only started working though when I added the %s% at the end of the line. Without that it literally did nothing at all.

We can get gunblade to work via hacking I just haven't had time to fool with emulation stuff as of late.  I can whip up something rather quickly, but I was working on a new-fangled troubleshooter app that would allow joystick input for any lightgun game.

That sounds REALLY cool :) Hooking up lamps/recoil to this is so easy even I can do it but the joystick input values were what I was concerned with. Thing is Gunblade is a joystick game rather than a lightgun game. I imagine actually that makes it much easier. In the other thread I posted a zip with the memory locations for the analog data.
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Yesterday at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEHooker + Modified Outputs?
« Reply #19 on: December 10, 2012, 01:15:43 am »
Must be a bug I've since corrected then.  I really need to get this version of mamehooker out.

For once I have nothing going on this week, so hopefully that can happen. 


Yeah I know Gunbalde NY is a analog gun game, but what I meant was all those pc lightgun games like House of the Dead 3 and ect.  I basically lifted the ini file from the original troubleshooter and I'm rebuilding it. Of course I would add support for m2 as well since it's so easy. 

retrorepair

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 252
  • Last login:July 06, 2025, 06:47:43 pm
Re: MAMEHooker + Modified Outputs?
« Reply #20 on: December 10, 2012, 02:23:27 am »
Cool I look forward to both!

Thanks again Howard  :cheers:
My arcade racing setup:
My Youtube Channel: http://www.youtube.com/user/RetroRepair
My Twitter: http://twitter.com/retrorepair

Francis2013

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:February 04, 2014, 09:03:44 am
  • I want to build my own arcade controls!
Re: MAMEHooker + Modified Outputs?
« Reply #21 on: January 13, 2014, 08:38:38 pm »
Hello Everybody
I have tried the script for operation wolf, and its working perfectly, thanks to you two.

However, when I tried Operation Thunderbolt, I have a constant output  (not a pulsing one)
This is very weird since  Operation thunderbolt  use a solenoid (like t2)  and not a motor like operation wolf

I have tried to fix this by doing the following script


===============
[General]
MameStart=
MameStop=kls 1
StateChange=kls 1,lfs pistonthunder2 20 %Player2_Recoil_Piston%, lfs pistonthunder1 20 %Player1_Recoil_Piston%
OnRotate=
OnPause=
[KeyStates]
RefreshTime=
[Output]
Player1_Recoil_Piston=
Player2_Recoil_Piston=
 ======================

But only the first script (pistonthunder1) who  is working, not the other one  and when I change the order of the line:

StateChange=kls 1, , lfs pistonthunder1 20 %Player1_Recoil_Piston%  lfs pistonthunder2 20 %Player2_Recoil_Piston%

its the other script who work

So how Could  I fix this

thanks

Francis





Francis2013

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:February 04, 2014, 09:03:44 am
  • I want to build my own arcade controls!
Re: MAMEHooker + Modified Outputs?
« Reply #22 on: January 14, 2014, 09:24:07 pm »
Hello
I have tried some other things today with my issue with Operation Thunderbolt
Still no clue.

I was just wondering if the constant output was related to maybe a bad rom I have.

Any Idea?