#1  
Old 9th August 2019, 12:22 PM
pcca-matrix pcca-matrix is offline
Junior Member
 
Join Date: Aug 2019
Location: Belgium
Posts: 6
Default Optimized x360 controller NRagePlugin

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
Attached Files
File Type: zip PJ64_NRage.zip (140.6 KB, 13 views)
Reply With Quote
  #2  
Old 12th August 2019, 12:07 PM
ExtremeDude2's Avatar
ExtremeDude2 ExtremeDude2 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2010
Location: USA
Posts: 2,894
Default

Did you modify this version? Is there any source available?
__________________
Quote:
Originally Posted by dsx! View Post
are you american or something
Reply With Quote
  #3  
Old 13th August 2019, 09:59 AM
pcca-matrix pcca-matrix is offline
Junior Member
 
Join Date: Aug 2019
Location: Belgium
Posts: 6
Default

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
Reply With Quote
  #4  
Old 14th August 2019, 12:09 PM
ExtremeDude2's Avatar
ExtremeDude2 ExtremeDude2 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2010
Location: USA
Posts: 2,894
Default

Quote:
Originally Posted by pcca-matrix View Post
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.
__________________
Quote:
Originally Posted by dsx! View Post
are you american or something
Reply With Quote
  #5  
Old 15th August 2019, 12:20 PM
pcca-matrix pcca-matrix is offline
Junior Member
 
Join Date: Aug 2019
Location: Belgium
Posts: 6
Default

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;
	}
Reply With Quote
  #6  
Old 16th August 2019, 12:00 PM
ExtremeDude2's Avatar
ExtremeDude2 ExtremeDude2 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Apr 2010
Location: USA
Posts: 2,894
Default

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

https://github.com/project64/project64
__________________
Quote:
Originally Posted by dsx! View Post
are you american or something
Reply With Quote
  #7  
Old 17th August 2019, 11:14 AM
pcca-matrix pcca-matrix is offline
Junior Member
 
Join Date: Aug 2019
Location: Belgium
Posts: 6
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:16 PM.


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