What's new

NRage V2.1 rumble fix

Gonetz

Plugin Developer (GlideN64)
I'm using GameCube controller attached via an USB adapter with N64 emulators. It's very convenient controller for N64 games btw. Until now I used Nrage v.1.82. It works ok, but rumble does not work at all. I tried latest 2.1, but with no luck: rumble does not work too, and besides C buttons assigned to the C stick on the gamepad do not work. So, 1.82 was my only choice. But I want rumble support! Since Nrage development seems to be stopped, there was no hope that somebody would help me. Thus, I decided to help myself and downloaded sources from the repository. I have no experience with DirectInput and I did not dig the sources very deeply. My only goal was to find what causes the problems and to fix them somehow. I did it. Attached is the result, which satisfies me. The archive includes release binaries and sources changes. I'm not sure that the changes made are correct, but it works for me.

The list of fixed issues:
1. Rumble does not work at all.
2. Rumble does not work after savestate load.
3. Rumble does not work if plugged by shortcut (‘-‘ by default)
4. 'C' buttons assigned to 'C' stick do not work at all
5. Crash if gamepad is unplugged.
6. Rumble effect does not stop in some cases.

Download:
http://glide64.emuxhaven.net/files/nrage_fix.rar
 
Last edited:

squall_leonhart

The Great Gunblade Wielder
I'm not sure what you did here, because rumble works perfectly across all my rumble capable directinput controls.

As for gamecube controls though, the adapter drivers usually do not contain a force feedback driver, so the only way is via raw :\.

As for the C buttons, i've also had no problems assigning them either, driver level bugs should not be corrected in apps, they should be reported to the product support team so they can be fixed.

So to address

The list of fixed issues:
1. Rumble does not work at all. ( This was never broken )
2. Rumble does not work after savestate load. - ( This also is not a problem )
3. Rumble does not work if plugged by shortcut (‘-‘ by default) ( Again not a problem. )
4. 'C' buttons assigned to 'C' stick do not work at all ( Straight flush so far, again, not a problem )
5. Crash if gamepad is unplugged. ( also not a problem )

These all appear to be driver bugs with your adapter.

Know very bad issue:
When Zelda OOT run with rumble pack plugged, the gamepad rumbles non-stop and continues to rumble even after the emulator is closed. I'm not going to play Zelda OOT anytime soon, so I did not try to fix it.

I tried your dll, and this is also not a problem.
like i said, your drivers are not working properly, none of these issues occur across motionjoy or xbcd, or logitech drivers.
 
Last edited:
OP
Gonetz

Gonetz

Plugin Developer (GlideN64)
Very strange response. The current version works for you? Lucky you.
For me it does not. But I made it working. Drivers issues? Not sure, may be. Anyway, I can't fix drivers, but I can fix the sources. This is great benefit of open-source projects. Not sure what I've done? Read the included sources, if you can understand C++.
Again, why you even bother to reply and reply like this if everything is working for you? You don't need these fixes, just don't use them. I'm sure, I'm not the only one, who have these problems. Besides, included sources can be useful for people with development skill.
 

squall_leonhart

The Great Gunblade Wielder
im replying because theres a chance those idiots on the 1964 project will apply it and break something lol.

I've tried and tried btw, and i can't get the rumble to lock on like you did with OoT, so thats pretty much conclusive that its a driver bug.
 
P

Pokemaniacs

Guest
I tried the original codes, the rumble works for my Saitek Force Feedback gamepad. It also works with Gonetz modified codes.

Both works for constant force only but ramp force does not work.
 

death--droid

Active member
Moderator
im replying because theres a chance those idiots on the 1964 project will apply it and break something lol.

I've tried and tried btw, and i can't get the rumble to lock on like you did with OoT, so thats pretty much conclusive that its a driver bug.

Why would i apply it, i do actually test it before i apply them to SVN.
 
OP
Gonetz

Gonetz

Plugin Developer (GlideN64)
I tried the original codes, the rumble works for my Saitek Force Feedback gamepad. It also works with Gonetz modified codes.

Both works for constant force only but ramp force does not work.
Rumble now works in all modes for me. At least it's good that it works for you as good as before. This means I did not broke anything :)

Why would i apply it, i do actually test it before i apply them to SVN.
Testing is necessary of course, but understanding, for what each modification in the sources was made is necessary too.
 
Last edited:

microdev

Member
I don't see the point of this discussion:

Gonetz detected a problem, solved it (not like others who just complain all the time) and contributed it to the community (which I think is the most important part)

As I feel nobody is soo special that he/she is the only one with something, it is very possible that someone else will encounter the same problem sometime.

This means, he helped at least this person, which in turn means it was worth the effort.

Thus: Thanks Gonetz!
 

NES_player4LIFE

Texture Pack Invader
Moderator
I don't see the point of this discussion:

Gonetz detected a problem, solved it (not like others who just complain all the time) and contributed it to the community (which I think is the most important part)

As I feel nobody is soo special that he/she is the only one with something, it is very possible that someone else will encounter the same problem sometime.

This means, he helped at least this person, which in turn means it was worth the effort.

Thus: Thanks Gonetz!

right on microdev

and thanks Gonetz
 

squall_leonhart

The Great Gunblade Wielder
microdev, stop being naieve

He applied a fix for buggy drivers which only means he has deviated outside of the standard api, which could unleash any number of issues elsewhere.

Its not our job to fix bugs in device drivers, doing so only allows the developers of those drivers to get away with sloppy jobs.

Both works for constant force only but ramp force does not work.
This is a driver limitation, your device simply doesn't support RAMP.
 
OP
Gonetz

Gonetz

Plugin Developer (GlideN64)
Actually, squall, naive person here is you. You sentence "driver level bugs should not be corrected in apps" shows that you know little about how real applications work. Simple example: ATI video cards and ATI OpenGL driver. You probably heard, that ATI OpenGL driver is, err, not-so-good as, say, Nvidia one. And this situation exists for years. May be this is problem not with all ATI cards and not with all driers, but it affects lot of users. We could say "reported to the product support team" and lost half of our users. Instead, we analysed the problem and re-wrote the code that it works for both ATI and NVidia. For some bad cases special workarounds were done, search for "ati_sucks" in the code. It's ugly, but this is how it works in reality. And if it is possible to correct this particular plugin to support more devices, better to do it, if it does not broke anything.
Then, if some apps works for you and does not work for others, it's not necessary bug in other device driver - probably your device drivers just have some hacks to avoid some common problems in badly written application. I saw such stuff. Other drivers don't have such hacks and can't avoid the problem.
 
Last edited:
P

Pokemaniacs

Guest
This is a driver limitation, your device simply doesn't support RAMP.

I have checked and found that it supports 16 different ForceFeedback Effects and "Ramp Force" is one of them.

I tested the Rumble effects from "Game Controllers" and it is working fine. I am not sure if it is really a driver limitation.
 

squall_leonhart

The Great Gunblade Wielder
Actually, squall, naive person here is you. You sentence "driver level bugs should not be corrected in apps" shows that you know little about how real applications work. Simple example: ATI video cards and ATI OpenGL driver. You probably heard, that ATI OpenGL driver is, err, not-so-good as, say, Nvidia one. And this situation exists for years. May be this is problem not with all ATI cards and not with all driers, but it affects lot of users. We could say "reported to the product support team" and lost half of our users. Instead, we analysed the problem and re-wrote the code that it works for both ATI and NVidia. For some bad cases special workarounds were done, search for "ati_sucks" in the code. It's ugly, but this is how it works in reality. And if it is possible to correct this particular plugin to support more devices, better to do it, if it does not broke anything.
Then, if some apps works for you and does not work for others, it's not necessary bug in other device driver - probably your device drivers just have some hacks to avoid some common problems in badly written application. I saw such stuff. Other drivers don't have such hacks and can't avoid the problem.

Sorry but no, now go back to glide64 and stop messing with an api you have no idea about. OpenGL is not DirectInput, either the driver supports the feature or it doesn't. Hacking into a functional implementation only adds room for crashes. There is absolutely no issue with the Directinput code used in this plugin and its not up to the app to fix issues that the people who made the drivers for your device were to lazy to address. The fact that you only caused more issues in the Zelda game pretty much makes it a fact that there are underlying issues with your device driver (or device itself, as gamecube adapters are notorious for low quality and degradation) with which adjustments in the app will only cause more problems.

I have checked and found that it supports 16 different ForceFeedback Effects and "Ramp Force" is one of them.

The rumble type being present in the driver does not mean it is supported, XBCD (IE Xbox Controls) display support for the same amount but only Constant, ramp and square actually work as the rest are friction types built into most feedback capable steering wheels.

As a test, get a hold of PCSX and the HariKiri plugin, in this you will be able to test each rumble mode.

The test button in the Device properties does not use the forcefeedback driver instead testing the rumble directly via the main .sys driver.
 
Last edited:
OP
Gonetz

Gonetz

Plugin Developer (GlideN64)
The fact that you only caused more issues in the Zelda game pretty much makes it a fact that there are underlying issues with your device driver (or device itself, as gamecube adapters are notorious for low quality and degradation) with which adjustments in the app will only cause more problems.
Which "more issues" you are talking about? The issue I described in my first post presents in the original code.

There is absolutely no issue with the Directinput code used in this plugin.
How can you be sure? Are you developer of this plugin? Do you understand, how its code works?
 
P

Pokemaniacs

Guest
As a test, get a hold of PCSX and the HariKiri plugin, in this you will be able to test each rumble mode.

Tested and it doesn't work for Ramp Force.
Constant Force (working)
Square Wave (working)
Sine Wave (working)
Triangle Wave (working)
SawtoothUp Wave (working)
Sawtooth Down Wave (working)

Thks
 

PsyMan

Just Another Wacko ;)
blah blah blah, bitching, blah blah

How about you stop with that attitude and eventually check if Gonetz' changes actually broke anything.

It's not like hardware and hardware drivers do not have bugs. There are lots of end users that ended up with buggy, unsupported, legacy hardware and/or drivers for that hardware. Those people were not inside the hardware or something when they bought it to know how broken it is.

Support for this kind of broken stuff by active and/or open source applications is not required, but it is something nice to have. Even if the changes break stuff there is always the choice of using another version of the application, or better, having the developer(s) adding an option to either use the approach that works for most people, as well as the approach that works for buggy/problematic stuff.
 
OP
Gonetz

Gonetz

Plugin Developer (GlideN64)
I have fixed the last issue with NRage and my controller: rumble effect does not stop in some cases. It was with Zelda OOT, Paper Mario and other games.
That can happen when rumble effect stopped right after the start. I did not find in DirectX docs that this situation is illegal, so the issue was not caused by a bug in NRage, rather something is wrong with my hardware/driver, which sometimes ignores Stop command. Workaround for this issue is simple and rather harmless: I added a tiny pause before effect Stop.

Also, I got an advice from KoolSmoky: "the O2 or Ox compiler option should NOT be used to prevent ZeroMemory() from being ignored. If you need to use the O2 or Ox option, ZeroMemory() need to be replaced with SecureZeroMemory()". I followed this advice, since release version is build with O2. Nothing changed, but it's good to know that the code is more secure now :)

Download link is in the first post.
 
P

Pokemaniacs

Guest
I have tried with SecureZeroMemory for the Input plugin but it seems to cause intermittent hang/freeze to Perfect Dark watching the intro movie or gameplay when moving the gamepad stick. Once I revert back to ZeroMemory, everything works fine again.

Just wondering.
a.k.a Pokefan999
 
P

Pokemaniacs

Guest
Tried your build and has been playing Aidyn with it. So far, it hang once when reading from Controller to display save files from Mempak(no such problem previously). It hangs another time during gameplay when browsing book by pressing A button(no such problem previously).

It may just bad luck but I have reverted back to (nRage + Xinput) plugin which works best for me so far. Of course, I included your fix for game crash if unplug(all other fixes don't seem to happen to me so far).
 

Top