Go Back   Project64 Forums > Public Version > Project 64 - v2.x - Issues

Reply
 
Thread Tools Display Modes
  #21  
Old 12th May 2017, 06:41 PM
Maniac Maniac is offline
Junior Member
 
Join Date: Mar 2017
Posts: 19
Default

Quote:
Originally Posted by squall_leonhart View Post
This was also a possible working change
Code:
    switch (GET_DIDEVICE_TYPE(lpddi->dwDevType)) {
    case DI8DEVCLASS_GAMECTRL:
        if (IsXInputDevice(&lpddi->guidProduct))        // Check if is XInput device --tecnicors
            return DIENUM_CONTINUE;
        break;
    default:
        break;
    }
I'm a bit confused how this would work, the dwDevType of a device should always be a a DI8DEVTYPE* value, not a DI8DEVCLASS* value, right? If it's a DI8DEVCLASS* value, that seems a lot more simple.

And btw, I don't have anything set up to build this, so I am not able to test my proposed change.
Reply With Quote
  #22  
Old 12th May 2017, 06:55 PM
squall_leonhart's Avatar
squall_leonhart squall_leonhart is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 2,894
Default

who knows , but



Code:
    switch (GET_DIDEVICE_TYPE(lpddi->dwDevType))
    case DI8DEVCLASS_GAMECTRL:
        if (IsXInputDevice(&lpddi->guidProduct))        // Check if is XInput device --tecnicors
            return DIENUM_CONTINUE;

also works!
__________________
Xfire Profile | VBA-M | XBCD 0.2.7

CPU:Intel i7 920 @ 3.8(D0), Mainboard:Asus Rampage II Gene, Memory:12GB Corsair Vengeance 1600
Video:EVGA Geforce GTX 680+ 4GB, Sound:Creative XFI Titanium Fatal1ty Pro, Monitor:BenQ G2400WD
HDD:500GB Spinpoint F3, 1TB WD Black, 2TB WD Red, 1TB WD Black
Case:NZXT Guardian 921RB, PSU:Corsair 620HX, OS:Windows 7 SP1
Reply With Quote
  #23  
Old 12th May 2017, 06:58 PM
Maniac Maniac is offline
Junior Member
 
Join Date: Mar 2017
Posts: 19
Default

Hmm, that's weird. To be safe, should the code be as follows?

Code:
switch (GET_DIDEVICE_TYPE(lpddi->dwDevType)) {
	case DI8DEVCLASS_GAMECTRL:
	case DI8DEVTYPE_JOYSTICK:
	case DI8DEVTYPE_GAMEPAD:
	case DI8DEVTYPE_FLIGHT:
	case DI8DEVTYPE_DRIVING:
		if (IsXInputDevice(&lpddi->guidProduct))		// Check if is XInput device --tecnicors
			return DIENUM_CONTINUE;
		break;
	default:
		break;
	}
What does GET_DIDEVICE_TYPE( return for the Xbox 360 controller?

Last edited by Maniac; 12th May 2017 at 07:03 PM.
Reply With Quote
  #24  
Old 12th May 2017, 07:08 PM
squall_leonhart's Avatar
squall_leonhart squall_leonhart is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 2,894
Default

it seems to me that the devclass enumerates any dev types beneath it, there appears to be no breaks by using the last [code] block i posted.


testing against Xoutput, the xinput code works as intended, including device notifications for hotplugging.
__________________
Xfire Profile | VBA-M | XBCD 0.2.7

CPU:Intel i7 920 @ 3.8(D0), Mainboard:Asus Rampage II Gene, Memory:12GB Corsair Vengeance 1600
Video:EVGA Geforce GTX 680+ 4GB, Sound:Creative XFI Titanium Fatal1ty Pro, Monitor:BenQ G2400WD
HDD:500GB Spinpoint F3, 1TB WD Black, 2TB WD Red, 1TB WD Black
Case:NZXT Guardian 921RB, PSU:Corsair 620HX, OS:Windows 7 SP1
Reply With Quote
  #25  
Old 12th May 2017, 07:16 PM
Maniac Maniac is offline
Junior Member
 
Join Date: Mar 2017
Posts: 19
Default

Great, thanks. I'm not sure I understand how exactly, as DI8DEVCLASS_GAMECTRL is defined as a 4 and DI8DEVTYPE_GAMEPAD is defined as a 19... they shouldn't hit the same case in a switch statement. I must be missing something.

The code you posted could be reduced to a simple IF statement.

Code:
if (GET_DIDEVICE_TYPE(lpddi->dwDevType) == DI8DEVCLASS_GAMECTRL && IsXInputDevice(&lpddi->guidProduct))        // Check if is XInput device --tecnicors
            return DIENUM_CONTINUE;
Reply With Quote
  #26  
Old 12th May 2017, 07:35 PM
squall_leonhart's Avatar
squall_leonhart squall_leonhart is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 2,894
Default

my guess is it comes down to


Quote:
Parameters

dwDevType
Device type filter.

To restrict the enumeration to a particular type of device, set this parameter to a DI8DEVTYPE_* value. See DIDEVICEINSTANCE.

To enumerate a class of devices, use one of the following values.

DI8DEVCLASS_ALL
All devices.
DI8DEVCLASS_DEVICE
All devices that do not fall into another class.
DI8DEVCLASS_GAMECTRL
All game controllers.
DI8DEVCLASS_KEYBOARD
All keyboards. Equivalent to DI8DEVTYPE_KEYBOARD.
DI8DEVCLASS_POINTER
All devices of type DI8DEVTYPE_MOUSE and DI8DEVTYPE_SCREENPOINTER.
__________________
Xfire Profile | VBA-M | XBCD 0.2.7

CPU:Intel i7 920 @ 3.8(D0), Mainboard:Asus Rampage II Gene, Memory:12GB Corsair Vengeance 1600
Video:EVGA Geforce GTX 680+ 4GB, Sound:Creative XFI Titanium Fatal1ty Pro, Monitor:BenQ G2400WD
HDD:500GB Spinpoint F3, 1TB WD Black, 2TB WD Red, 1TB WD Black
Case:NZXT Guardian 921RB, PSU:Corsair 620HX, OS:Windows 7 SP1
Reply With Quote
  #27  
Old 13th May 2017, 12:43 AM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 803
Default

I made the change but cannot test, as I don't have any XInput controllers to test with.

Here's a build with the code from post #22 to test.
https://www.dropbox.com/s/mgbyng51my...NRage.dll?dl=1

I don't notice any difference in time taken to init.
Reply With Quote
  #28  
Old 13th May 2017, 07:40 PM
theboy181's Avatar
theboy181 theboy181 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2014
Location: Prince Rupert,British Columbia Canada
Posts: 420
Default

Seems to open quick now, however every so often when I try to get into the options it takes 15 seconds to open them. Unsure if its related to other plugins.


Thanks Frank
__________________
So you think you can TECH!! Watch this!! https://www.youtube.com/watch?v=NAUKPq5QjL0
Reply With Quote
  #29  
Old 13th May 2017, 08:06 PM
squall_leonhart's Avatar
squall_leonhart squall_leonhart is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Mar 2007
Location: Sydney, Australia
Posts: 2,894
Default

you should monitor the wmi provider host for possible spikes coming from other applications.
__________________
Xfire Profile | VBA-M | XBCD 0.2.7

CPU:Intel i7 920 @ 3.8(D0), Mainboard:Asus Rampage II Gene, Memory:12GB Corsair Vengeance 1600
Video:EVGA Geforce GTX 680+ 4GB, Sound:Creative XFI Titanium Fatal1ty Pro, Monitor:BenQ G2400WD
HDD:500GB Spinpoint F3, 1TB WD Black, 2TB WD Red, 1TB WD Black
Case:NZXT Guardian 921RB, PSU:Corsair 620HX, OS:Windows 7 SP1
Reply With Quote
  #30  
Old 13th May 2017, 09:10 PM
theboy181's Avatar
theboy181 theboy181 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2014
Location: Prince Rupert,British Columbia Canada
Posts: 420
Default

not sure how to do that tbh..
__________________
So you think you can TECH!! Watch this!! https://www.youtube.com/watch?v=NAUKPq5QjL0
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 09:13 AM.


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