• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Controllers v
« Previous 1 ... 151 152 153 154 155 ... 305 Next »

How does Wiimote rumble strength work?
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
How does Wiimote rumble strength work?
10-16-2014, 07:27 AM
#1
livingsilver94
Unregistered
 
Question 
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
Reply
10-16-2014, 07:46 AM (This post was last modified: 10-16-2014, 07:46 AM by DJBarry004.)
#2
DJBarry004 Offline
Don't even bother...
*******
Posts: 2,441
Threads: 32
Joined: Sep 2013
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?
Rig 1: Windows 10 Home | AMD A6-1450 @ 600/1000/1400 MHz | AMD Radeon HD Graphics 8250 | 4GB RAM | HP Pavilion TouchSmart 11.

Rig 2: Windows 10 Pro | Intel Core i7-2640M @ 800/2800/3500 MHz | Intel HD 3000 Mobile | 8GB RAM | Dell Latitude 6320.
Find
Reply
10-16-2014, 08:08 AM
#3
livingsilver94
Unregistered
 
Yes, I did, but I could not locate the code involved in rumble intensity... I'm noob about this.
Reply
10-17-2014, 02:16 AM (This post was last modified: 10-17-2014, 02:19 AM by ulao.)
#4
ulao Offline
Above and Beyond
*******
Posts: 1,029
Threads: 79
Joined: May 2009
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.
[Image: newLogo_white_small.png]

main page
Working controllers


[url=http://spreadsheets.google.com/pub?key=tGD-U_eW1Rc7rNyqkpgJuIg&output=html][/url]
Find
Reply
10-17-2014, 03:01 AM
#5
livingsilver94
Unregistered
 
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
Reply
10-17-2014, 11:04 PM (This post was last modified: 10-17-2014, 11:16 PM by ulao.)
#6
ulao Offline
Above and Beyond
*******
Posts: 1,029
Threads: 79
Joined: May 2009
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.
[Image: newLogo_white_small.png]

main page
Working controllers


[url=http://spreadsheets.google.com/pub?key=tGD-U_eW1Rc7rNyqkpgJuIg&output=html][/url]
Find
Reply
11-05-2014, 01:41 AM
#7
livingsilver94
Unregistered
 
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!
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode