Project64 Forums

Project64 Forums (http://forum.pj64-emu.com/index.php)
-   Open Discussion (http://forum.pj64-emu.com/forumdisplay.php?f=9)
-   -   Optimized x360 controller NRagePlugin (http://forum.pj64-emu.com/showthread.php?t=9733)

pcca-matrix 9th August 2019 12:22 PM

Optimized x360 controller NRagePlugin
 
1 Attachment(s)
for those who have probleme to get :

rumble working , mempak switching , no nrage shortcut working when 4 xinput controllers connected , lag on some games when using multiple xinput controllers, unable to use nrage mempak if it default selected and RAW checked , rumble not working after switching from nrage mempak.

here is fixed version for x360 and xbox one controller.

Let me know if it's working as expected.

Hope it helps

ExtremeDude2 12th August 2019 12:07 PM

Did you modify this version? Is there any source available?

pcca-matrix 13th August 2019 09:59 AM

yes I slightly modify the current source to make it more functional with xbox 360 controllers.

I can post here changes to the code if you want

ExtremeDude2 14th August 2019 12:09 PM

Quote:

Originally Posted by pcca-matrix (Post 76466)
yes I slightly modify the current source to make it more functional with xbox 360 controllers.

I can post here changes to the code if you want

That would be nice for others to see, plus I think you're supposed to.

pcca-matrix 15th August 2019 12:20 PM

here is the list of changes

NRagePluginV2.cpp

let MEMpack work with RAW

Code:

case PAK_MEM:
    Controls[i].Plugin = PLUGIN_MEMPAK;
    //Controls[i].RawData = false;
    break;

when you switch from mempak to rumble , rumble pack is never initialized so change at line 1054

Code:

                case SC_RUMBPAK:
                        if (PAK_NONE == g_pcControllers[iControl].PakType)
                        {
                                EnterCriticalSection( &g_critical );
                                g_pcControllers[iControl].PakType = PAK_RUMBLE;
                                g_pcControllers[iControl].fPakInitialized = true; // from false to true

No shortcut working when you have 4 xinput controller plugged, comment continue on line 410.

Code:

               
if( g_pcControllers[i].fPlugged )
                {
                        if (g_pcControllers[i].fXInput)
                        {
                                InitiateXInputController(&g_pcControllers[i].xiController, i);
                                //continue;
                        }

There is a performance hit when you check for a controller that wasn't attached last time you called it.

ex: GT64 Championship is unplayable on a slow PC if a xinput controller is plugged in PJ64 but not available.

This fix minimizes a performance issue with XInput on Windows when checking for a disconnected controller.

If you get ERROR_DEVICE_NOT_CONNECTED from XInputGetState, you shouldn't call that slot for a little while.

line 156 add

Code:

unsigned XcheckTime;                // checks for newly connected gamepads timer
XinputController.cpp

line 178 -> 192

Code:

        if ( !gController->bConfigured )
                return;

        ULONGLONG time = GetTickCount() / 1000;
        if (g_pcControllers[indexController].XcheckTime != NULL && ( time - g_pcControllers[indexController].XcheckTime ) < 3)
                return;

        DWORD result;
        XINPUT_STATE state;
        result = fnXInputGetState(gController->nControl, &state);
        if (result == ERROR_DEVICE_NOT_CONNECTED) {
                g_pcControllers[indexController].XcheckTime = time;
        }else{
                g_pcControllers[indexController].XcheckTime = NULL;
        }


ExtremeDude2 16th August 2019 12:00 PM

Very nice :cool:. Have you thought about making any Pull Requests here?

https://github.com/project64/project64

pcca-matrix 17th August 2019 11:14 AM

I had already posted these changes in the github issue but no pull request.

I made so much change on the original PJ64 for my personal use that I have to put it clear before proposing.

ed rhodes 7th December 2019 01:01 AM

Quote:

Originally Posted by pcca-matrix (Post 76478)
I had already posted these changes in the github issue but no pull request.

I made so much change on the original PJ64 for my personal use that I have to put it clear before proposing.

It didn't help me. I still can't get the controller to stop moving. It backs up the character or spins him around in circles (first person games)

ed rhodes 7th December 2019 06:04 PM

corrections
 
OK, I fiddled around with the mapping, and I got him to stop moving around on his own. Still can't properly play the game as he keeps pointing his gun at the sky! I have to hold the "C-down" button down in order to keep him holding the gun level. That's not really workable.


All times are GMT. The time now is 01:48 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.