Hacking GameCube Analog L and R Coding Question

CJB100

Programmer, Media Producer, Hardware Repair
OP
Member
Joined
May 8, 2016
Messages
491
Trophies
0
Age
31
Location
USA
XP
448
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.
 

Deleted member 391145

Active Member
Newcomer
Joined
May 19, 2016
Messages
43
Trophies
0
Age
23
XP
90
Country
Gambia, The
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

CJB100

Programmer, Media Producer, Hardware Repair
OP
Member
Joined
May 8, 2016
Messages
491
Trophies
0
Age
31
Location
USA
XP
448
Country
United States
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.
 

Deleted member 391145

Active Member
Newcomer
Joined
May 19, 2016
Messages
43
Trophies
0
Age
23
XP
90
Country
Gambia, The
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

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,825
Trophies
5
Location
Space
XP
14,822
Country
Norway
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

CJB100

Programmer, Media Producer, Hardware Repair
OP
Member
Joined
May 8, 2016
Messages
491
Trophies
0
Age
31
Location
USA
XP
448
Country
United States
I appreciate the effort guys! I will keep searching online and let you know if I find anything.
 
  • Like
Reactions: NexoCube

NexoCube

Well-Known Member
Member
Joined
Nov 3, 2015
Messages
1,222
Trophies
0
Age
29
Location
France
XP
1,340
Country
France
- 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

CJB100

Programmer, Media Producer, Hardware Repair
OP
Member
Joined
May 8, 2016
Messages
491
Trophies
0
Age
31
Location
USA
XP
448
Country
United States
- 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!
 

ARVI80

Well-Known Member
Member
Joined
Feb 25, 2016
Messages
197
Trophies
0
Age
44
Location
UK
XP
326
Country
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

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtu.be/ZtNtSVIiitE?si=vQHuSAiWxlBVO3Yn