hakchi2 icon indicating copy to clipboard operation
hakchi2 copied to clipboard

3rd Party Wii Classic Controllers - Possible Fix

Open jonholifield opened this issue 9 years ago • 95 comments

Many third-party controllers do not work with the NES Classic but work with the Wii Virtual Console

I believe that commenting out the check in clovercon.c will enable these controllers in clovercon.c these lines can be commented out

332 if (con_info_data[5] != 1) { 333 ERR("unsupported controller id %i", (int)con_info_data[5]); 334 ret = -EIO; 335 goto err; 336 }

There is a possibility that the following check will need to commented out as well and the default case moved up.

603 switch(id->driver_data) { 604 case CLASSIC_ID: 605 DBG("probing classic controller"); 606 break; 607 default: 608 ERR("unknown id: %lu\n", id->driver_data); 609 return -EINVAL;

to

604 switch (id->driver_data) { 605 case CLASSIC_ID: 606 default: 607 DBG("probing classic controller"); 608 break; 609 //default: 610 // ERR("unknown id: %lu\n", id->driver_data); 611 // return -EINVAL; 612 }

I do not have the environment set up to rebuild the clovercon.ko file but would be happy to test my theory if it could be build for me.

Thanks,

jonholifield avatar Feb 26 '17 17:02 jonholifield

Which third parties don't work?

What about the premium Hori branded controllers?

BagginsKQ avatar Feb 26 '17 20:02 BagginsKQ

I have two no-name Wii Classic Controllers that work with the Wii but not the NES classic. I'm fairly certain that it's the same issue that caused the recall of the original version of the EMiO Edge gamepad and Joystick. So, it's not an issue that there are not controllers out there that work, the ones that do cost $25-$30 and the ones that do not cost $5-$10 a piece, (Or free if you already had them for the Wii) From the code, it looks like the NES classic sends a command via I2C and expects a 1, if it doesn't get it, it doesn't even try to connect. My guess is the Wii and Wii U controllers never checked the bit, so third party controllers didn't know what the correct "passcode" was as it was not a requirement for working before the NES classic.

jonholifield avatar Feb 26 '17 21:02 jonholifield

This code just checks that plugged in device is classic controller. Seems like it will not resolve problem. I'll do some tests with https://github.com/ClusterM/nes2wii soon.

ClusterM avatar Feb 27 '17 19:02 ClusterM

I too got cheep controllers. I didn't know they wouldn't work considering they work on the Wii.

archonis83 avatar Mar 02 '17 14:03 archonis83

I still feel like the lines 332 - 336 will fix the issue. It's in the setup routine and keeps the NES from talking to the controller if it feels that it's an unsupported controller based on the identify information the controller provides. As these are copies of the correct controller, I feel that they would work by tricking the NES into accepting them as appropriate controllers. I'll try to set up a cross compiler in Linux to see if I can recompile the clovercon.ko driver.

jonholifield avatar Mar 02 '17 15:03 jonholifield

Any testing?

archonis83 avatar Mar 04 '17 00:03 archonis83

I don't think we are getting any traction on this.

archonis83 avatar Mar 11 '17 03:03 archonis83

Have not tested yet, I was busy. Will test soon.

ClusterM avatar Mar 11 '17 08:03 ClusterM

Please try this clovercon driver mod: http://clusterrr.com/temp/clovercon2.hmod If it will not work try this: http://clusterrr.com/temp/clovercon3.hmod

ClusterM avatar Mar 12 '17 20:03 ClusterM

Sadly, neither 2 or 3 fixed the 3rd party controller issue.

ClusterM, Thank you for taking the time to compile those.

jonholifield avatar Mar 14 '17 16:03 jonholifield

It's weird. I can't find any protection code. I need to find some non-original controller for testing.

ClusterM avatar Mar 14 '17 22:03 ClusterM

I was doing a bit of reading on this lovely website http://wiibrew.org/wiki/Wiimote/Extension_Controllers and comparing it to what the clovercon driver is doing in the clovercon_setup on line 300.

First it writes 55 to address 0xf0 then it writes 00 to address 0xfb This is supposed to disable the encryption and send data without encryption, so that's good

Then the clovercon driver writes DATA_FORMAT (which is 3) to address 0xfe, which is part of the 6 byte controller identification block that is read at line 318 of the code.

Two possibilities come to mind, First, the cheap 3rd party controllers do not have read/write capabilities there, so the controller ignores the write to 0xfe and reports back whatever it originally had in that memory location. If this is the case, commenting out the error check found in in lines 327 through 330 ("failed to set data format") may allow the controller to be read by the NES.

Or Secondly, the NES is using the DATA_FORMAT variable to set the format to one not used by the Wii. If this is the case, the 3rd party controllers may not have that format in it's programming and all of the data being sent to the NES is in an incorrect format. If this is the case, there may not be a way to fix the 3rd party controllers.

Of course, I could just be wrong all together.

jonholifield avatar Mar 15 '17 12:03 jonholifield

You are right. Seems like data format is the cause of the problem. I'll try to change data format to 1 and change polling function to parse this format. I'll share mod soon (today, I think).

ClusterM avatar Mar 16 '17 14:03 ClusterM

Also it's possible that 3rd party controllers can't pass noice check. NESC reading 21 bytes instead of 8. All additional bytes must be zeros to pass check.

ClusterM avatar Mar 16 '17 15:03 ClusterM

Please test this mods:

  1. Data format #1: http://clusterrr.com/temp/clovercon_data-format-1.hmod
  2. Data format auto detection: http://clusterrr.com/temp/clovercon_data-format-auto.hmod
  3. Data format auto detection + alternative noise detection: http://clusterrr.com/temp/clovercon_data-format-auto_alt-denoise.hmod
  4. Data format auto detection + disabled noise detection: http://clusterrr.com/temp/clovercon_data-format-auto_no-denoise.hmod

ClusterM avatar Mar 16 '17 20:03 ClusterM

ClusterM, My hat's off to you sir, here are the results of my tests:

  1. Data format 1 3rd party Wii Classic – Not working Nintendo NES Controller – Works NES 3rd Party controller (EMiO Gamepad Edge V2) – Previously works under standard but now always goes left

  2. Data Format Auto 3rd party Wii Classic – Not working Nintendo NES Controller – Works NES 3rd Party controller (EMiO V2) – Works

  3. Data Format Auto – alt denoise 3rd party Wii Classic – Works Nintendo NES Controller – Works NES 3rd Party controller (EMiO V2) – Works

  4. Data Format Auto – no-denoise 3rd party Wii Classic – Works Nintendo NES Controller – Works NES 3rd Party controller (EMiO V2) – Works

Both the 3rd and the 4th function great with all the controllers that I have. Thank you!

jonholifield avatar Mar 17 '17 00:03 jonholifield

As a side note, synchronizing the game ROMS blows away the updated clovercon hmod on the NES classic and I had to re-install the user hmod afterwards.

jonholifield avatar Mar 17 '17 00:03 jonholifield

Yes! Thank you! You can replace clovercon.hmod into mods/hmods folder. Or just wait for new release, it will be in a few days.

ClusterM avatar Mar 17 '17 00:03 ClusterM

so do we put these in the user_mod folder or hmod folder and rename the file ?

DecanFrost avatar Mar 17 '17 05:03 DecanFrost

For permanent usage it's better to put it into hmods and rename.

ClusterM avatar Mar 17 '17 10:03 ClusterM