Hacking GameCube Analog L and R Coding Question

  • Thread starter Thread starter CJB100
  • Start date Start date
  • Views Views 2,657
  • Replies Replies 10

CJB100

Programmer, Media Producer, Hardware Repair
Member
Joined
May 8, 2016
Messages
491
Reaction score
358
Trophies
0
Age
33
Location
USA
XP
468
Country
United States
So I'm attempting to program an easy to use library for vWii, and hopefully get that finished up within the next few months. I have most of the Wiimote and Wii Expansion functions programmed, and a lot of screen controls. I'm starting GameCube controls, and its pretty similar to classic controller except for L and R analog presses.

It appears L and R are measured in a range of 0 to 210? Can anyone (preferably a dev for obvious reasons) confirm? It is very hard to find good info on the devkitpro libraries and 210 doesn't seem like a... well, "program-y" number. I'd expect something more like 256.
 
While I can't do that myself since I don't have an exploit for vWii, why not make a small program using the library that renders a bar with a outline. The outline ist static and the bar fills with the GC L and R input - If you do [input] / 210 * 100 and press it all the down, it should fill the outline if it is a 0 to 210 range.

Sorry if it sounds stupid, not very experienced with programming. Probably an easier way...
 
  • Like
Reactions: CJB100
While I can't do that myself since I don't have an exploit for vWii, why not make a small program using the library that renders a bar with a outline. The outline ist static and the bar fills with the GC L and R input - If you do [input] / 210 * 100 and press it all the down, it should fill the outline if it is a 0 to 210 range.

Sorry if it sounds stupid, not very experienced with programming. Probably an easier way...

No, it's actually a really good suggestion. But wouldn't help I'm afraid.

The issue is analog controls tend to degrade slowly over time. For instance, the functions for analog stick magnitude (harshness of a stick push) are in range of 0 to 1, but usually stops at between .8 and .9 even when the stick is fully pressed. This does not mean my function is incorrect, as new controllers with less used analog sticks almost always reach the full 1 when pushed in a cardinal direction. It's just that my test controllers are old.

L and R could be suffering from the same issue, but my L and R both stop at 208 and 210 respectively. L is used far less than R in most games, so you'd expect to see L degraded far less than R if degradation is to blame. It seems more likely that the range is actually 0 to 210, but I can't be absolutely certain without a brand new first party GameCube controller, or someone confirming for me.
 
Well then, how about this?

I have a defective GC aftermarket controller lying around, but the LR triggers are functional. Maybe it's possible to short the contacts and therefore get the range?
If yes, I'd happily tear the thing apart for research.
 
Last edited by Deleted member 391145,
  • Like
Reactions: CJB100
Well then, how about this?

I have a defective GC aftermarket controller lying around, but the LR triggers are functional. Maybe it's possible to short the contacts and therefore get the range?
If yes, I'd happily tear the thing apart for research.
I'm not sure what you mean by "short the contacts" but there's no guarantee a 3rd party controller will even use the same analog range as the official controllers.
 
  • Like
Reactions: CJB100
I'm not sure what you mean by "short the contacts" but there's no guarantee a 3rd party controller will even use the same analog range as the official controllers.
I meant bridging the 2 contacts of the analog slider. Can't do it anyway because the thing is completely broken by now.
 
I appreciate the effort guys! I will keep searching online and let you know if I find anything.
 
  • Like
Reactions: NexoCube
- Log on your GC Controller
- Use the functions to read controller (Like HIDRead or VPADRead for Wii U)
- Prints out the results !

Code:
printf(buf, 256, "Pad Pressed = 0x%08X", result_of_read)
- Then translate it to decimal then you have your number :)

--------------------- MERGED ---------------------------

http://www.codemii.com/2008/08/24/tutorial-3-controller-input/
 
Last edited by NexoCube,
  • Like
Reactions: CJB100
- Log on your GC Controller
- Use the functions to read controller (Like HIDRead or VPADRead for Wii U)
- Prints out the results !

Code:
printf(buf, 256, "Pad Pressed = 0x%08X", result_of_read)
- Then translate it to decimal then you have your number :)

--------------------- MERGED ---------------------------

http://www.codemii.com/2008/08/24/tutorial-3-controller-input/

Wouldn't this still wind up with the same issue as stated in my second post? We would have to make the assumption that my GameCube analog triggers have not degraded and are actually giving correct results.

I do appreciate the effort though! Thank you!
 
The shoulder triggers sliding potentiometers use values from 0 to 255.

The control stick and C-stick use two potentiometers that induce values from 0 to 255 with 128 considered to be the center. (0,0) input would be diagonally down and left 225°. Values 106 to 150 are considered to be neutral inputs and behave just like 128.

Hope that helps :D
 
Last edited by ARVI80,

Site & Scene News

Popular threads in this forum