MAXSTEELTURBOGO / mupen64plus

Automatically exported from code.google.com/p/mupen64plus
0 stars 0 forks source link

Multiple controllers per device SDL Joystick ID Bug #424

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe your system:
 - Operating System (be specific): Ubuntu 10.10
 - Machine type (32-bit or 64-bit): amd64
 - Mupen64Plus version: 1.99.4 (Compiled from source 4/13/2011)
 - Plugins used: Defaults

Describe the problem:
I purchased two Controller adapters for use with my computer. Each adapter has 
two N64 controller ports so that two controllers can be connected to each for a 
total of 4 controllers. The auto-configure already had this device programmed 
in, but only one of the pairs of controllers would work. It would be nice if 
these controllers were auto-detected, but I decided to manually setup the 
configuration file, and set it up as shown below, but it still did not work.

I did some digging through the source and found a bug that pops up when there 
is more than one SDL joystick connected that supports multiple controllers. I 
modified source/mupen64plus-input-sdl/src/config.c and got it working. It was 
using the n64 controller id for the SDL joystick index, which works for a 
one-to-one device to controller ratio, but not with these adapters. It should 
have been using the device id from the configuration.

http://www.amazon.com/May-Flash-Controller-Adapter-Nintendo-64/dp/B002B9FIUU

Please provide any additional information below.

mupen64plus-bundle-src-1.99.4//source/mupen64plus-input-sdl/src/config.c
402c402,407
<         JoyName = get_sdl_joystick_name(i);

---
>         if (controller[i].device >= 0)
>         {
>             JoyName = get_sdl_joystick_name(controller[i].device);
>         } else {
>             JoyName = NULL;
>         }

The settings in the config file are mostly the same as in InputAutoCfg.ini for 
HuiJia USB GamePad. I just added device=0 for the first pair and device=1 for 
the second.

Original issue reported on code.google.com by rocknme2...@gmail.com on 14 Apr 2011 at 12:49

Attachments:

GoogleCodeExporter commented 9 years ago
If someone could take a look at this I would really appreciate it. I already 
solved the problem for myself, but I would like for this to be solved for 
everyone who is trying to use the setup that I have. It's a simple fix.

Original comment by rocknme2...@gmail.com on 16 May 2011 at 10:57

GoogleCodeExporter commented 9 years ago

Original comment by richard...@gmail.com on 22 May 2011 at 4:39

GoogleCodeExporter commented 9 years ago
I have been having that exact issue.  Unfortunately, I know little about 
writing code.  I am using WXMupen64Plus with the HuiJia USB hub and have been 
unable to get the joysticks to function but all of the other buttons are 
correct. If there's anyway you could send me your contents pack for Mupen64Plus 
I think I should be able to get it to work.

Original comment by nicholas...@gmail.com on 23 Aug 2011 at 5:19

GoogleCodeExporter commented 9 years ago
It sounds like you are dealing with a separate issue. The joysticks worked on 
the controllers that worked, but I had a problem using 4 controllers 
simultaneously. Either way you should also check and see if you can reproduce 
the problem in Mupen64Plus 2 before it can be addressed here.

Original comment by rocknme2...@gmail.com on 24 Aug 2011 at 12:08

GoogleCodeExporter commented 9 years ago
rocknme2349, can you please make a new build from the Hg repository and test 
this again?  I have just refactored this code in a way which should resolve 
your problem.

Original comment by richard...@gmail.com on 13 Dec 2011 at 6:28

GoogleCodeExporter commented 9 years ago
It works.

Thanks for the fix.

Original comment by rocknme2...@gmail.com on 14 Dec 2011 at 1:43