The Dragon King
Mamehooker: Using force-feedback Effect Files. 
About Mame Hooker Mame Hooker: Using force-feedback Effect Files.

Up until now, force feedback support has been rather limited in mamehooker and it flat out wouldn't work with certain devices (wheels for example). This is due to the rather unstandardized nature of how force feedback motors are binded to joystick axis and how picky directX's ff engine is in regards to this. To combat this I've added support for Microsoft force-feedback effect files, which can be taylor made for a particular device.

In this first tutorial, I will show you how to load a generic effect file for a steering wheel and control it's playback.

We will use the game Outrunners for the purposes of this tutorial. So you'll want to have mamehooker running and Outrunners (orunners) running in windowed mode.

At this point you should have covered the first three generic tutorials on the site so I won't hold your hand this time. Go ahead and select "Edit Ini for Current Rom" from the script editor. The output we want to work with is "ma_steering_wheel_lamp." No, it isn't really a lamp, it's a motor. I worked on this mame driver years ago and it's a typo.

We want to add to state commands to this output, Add a "Force feedback load effect file" command from the Add menu of the editor. The device id is your joystick id. For a wheel it's typically 1 because no other joysticks are plugged in, but your mileage will vary. For the effect name, type "stop" (I'll explain later). Now add a State Break from the menu and add another load effect file. This time leave the effect name "offroad3".

You will have an entry that looks something like this:

ma_steering_wheel_lamp=ffe 1 stop|ffe 1 offroad3

So we are loading an effect called "stop" when the steering wheel output is 0 and an effect called "offroad3" when the output is 1. Pretty simple. It should be noted that the effect "stop" doesn't exist. Whenever a missing effect is called, mamehooker will stop the currently playing effect.

You are essentially done. Save the ini and start playing outrunners. When you run off the road, the wheel will shake. When you go back on the road, it will stop. Easy right?

I've included a bunch of effects from the Microsoft SDK. Some for wheels, some for flight sticks and everything in between. For outrunners offroad3 seems to match the on-screen action the best, but you can try others.

It should be noted that while the method described in this tutorial works, it is NOT the preferred method. Load effect file reloads the effect into the driver each time it's called. While this is speedy and unnoticeable for most devices, it might not be for every device. Also games that max out your system might suffer from this method.

If you want to do things more efficiently, or want to have more control over more complex effects, or perhaps your particular device won't play nice with the included effects, see the tweaking tutorial.