Dolphin, the GameCube and Wii emulator - Forums
How does Wiimote rumble strength work? - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Controllers (https://forums.dolphin-emu.org/Forum-controllers)
+--- Thread: How does Wiimote rumble strength work? (/Thread-how-does-wiimote-rumble-strength-work)



How does Wiimote rumble strength work? - livingsilver94 - 10-16-2014

Hi all! First time here Smile

I'm writing an application for a hobby project (actually I don't know whether this is section is correct). Well, my troubles start when I need to control rumble intensity of a Wiimote. A Wiimote can only be set to on or off, but I've read that a square wave could fake the intensity. Dolphin does have this kind of control, hence I've looked up in source code but... I can understand nearly nothing Tongue I'm just a novice programmer. Could someone provide me a clue on how to implement it? I don't need code (I'm working in C#, BTW), what I'm looking for is a link to Dolphin git, or maybe an idea of how it works. Thank you very much! Blush


RE: How does Wiimote rumble strength work? - DJBarry004 - 10-16-2014

AFAIK most of Dolphin´s code is written in C++. And here´s the Git page: https://github.com/dolphin-emu/dolphin

EDIT: You did look in there, didn´t you?


RE: How does Wiimote rumble strength work? - livingsilver94 - 10-16-2014

Yes, I did, but I could not locate the code involved in rumble intensity... I'm noob about this.


RE: How does Wiimote rumble strength work? - ulao - 10-17-2014

With a one motor at one given speed the only way to set a "speed" is to throttle the motor.

Full speed. On.........off

Fake lower speed on...off...on..off...on...off...on..off...on...off...on..off...on...off...on..off

The wiki has very little to say on the matter.
Quote: Rumble
Wii remote rumble motor
The Wii Remote includes a rumble feature, which is implemented as a small motor attached to an off-center weight. It will cause the controller to vibrate when activated.

The rumble motor can be turned on or off through any of the Output Reports. Setting the LSB (bit 0) of the first byte of any output report will activate the rumble motor, and unsetting it will deactivate it. For example, the following report will turn the rumble motor on:

(a2) 11 01

However, this will also have the side-effect of turning off all LEDs. Since there is no output report that only affects the rumble motor, and all of them do affect it, an implementation might need to store both the rumble and LED values locally (for example), and use the same Output Report for both. Another possibility would be using the status request report (0x15). The rumble bit needs to be set properly with every single report sent, to avoid inadvertently turning the rumble motor off.

Different photos of the rumble motor hardware show different markings. One example is SEM 8728DA. The Wii Remote drives it at 3.3 VDC and it draws 35 mA. It would be reasonable to think that the rumble motor could be removed and the motor replaced with another device with equal voltage and equal or less current draw.



RE: How does Wiimote rumble strength work? - livingsilver94 - 10-17-2014

I appreciate your reply, but what you've said is also what I've said: a square wave. On and off repeatedly.
To be more technical, my implementation consists of a thread that does:
1) set rumble to on
2) wait a certain amount of milliseconds
3) set rumble to off
4) wait another amount of ms (may be different from the former, in order to enable duty cycle variation made by user)

All this in a loop. The problem is: is this a good way to implement ruble intensity? An endless loop, a huge amount of bluetooth data sent... sound to me an inefficient algorithm.

Sorry if I'm asking for a small piece of Dolphin features, but since it is a Wii emulator, I am pretty sure this is a good place to learn Smile


RE: How does Wiimote rumble strength work? - ulao - 10-17-2014

I'm sorry I may have went too far, but I did mean to make it very clear. "is this a good way to implement ruble intensity?", No, its the only way. You could experiment with the timing in delays like below (as yo suggested in 4) but I dont think it will help much.

loop(on, off, wait x^2)
then at some point come back down
loop(on, off, wait (x^2)*-1)

I'm not sure if slowly increasing the wait time while on or off is best. Again, I'm not sure it will effect much. After all you are trying to control the speed of the motor, and the best way to do that programmatically is to introduce waits.


RE: How does Wiimote rumble strength work? - livingsilver94 - 11-05-2014

Although this is the only correct way, I can notice a pause between two states... Oh I'd wish to implement it like in Wii games!