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
22
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
22
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,336
Trophies
4
Location
Space
XP
13,913
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
43
Location
UK
XP
315
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
  • Xdqwerty @ Xdqwerty:
    Penisapiens
  • cearp @ cearp:
    Tempus Bannus
    +2
  • Xdqwerty @ Xdqwerty:
    @cearp, okie dokie i'm sorry
  • cearp @ cearp:
    lol I meant nothing by it - and for the record I have no powers, so no worries :D
    +1
  • cearp @ cearp:
    still, you're forgiven
    +2
  • AncientBoi @ AncientBoi:
    Well I don't forgive him. He's been eating ALL the Tempus Bannus's :angry:
  • Xdqwerty @ Xdqwerty:
    @AncientBoi, it was only once :angry:
    +1
  • AncientBoi @ AncientBoi:
    ROFL :rofl2::rofl2::rofl2::rofl2::rofl2:
  • cearp @ cearp:
    There's not even one left for me? :(
    +1
  • AncientBoi @ AncientBoi:
    nope
  • AncientBoi @ AncientBoi:
    I was able to get 1 atleast :D
  • cearp @ cearp:
    That's why I only had carrots and cheese for breakfast
    +1
  • AncientBoi @ AncientBoi:
    Oh, that was you that answered my Thread
  • Xdqwerty @ Xdqwerty:
    @cearp, just swear a lot and you will get one
    +1
  • Xdqwerty @ Xdqwerty:
    Or share piracy sites
    +1
  • K3Nv2 @ K3Nv2:
    @AncientBoi, just wants to eat temps burrito
    +1
  • cearp @ cearp:
    Yep, very jealous of your frosted wheat things plus fruit
    +1
  • K3Nv2 @ K3Nv2:
    She's sweeter when she eats pineapple
    +1
  • cearp @ cearp:
    I guess your mother's ran out of pipeapple since 2020
    +1
  • AncientBoi @ AncientBoi:
    Stop telling MY secrets 😡
    +1
  • K3Nv2 @ K3Nv2:
    That's what you get for putting your mouth at places it shouldn't be
    +1
  • cearp @ cearp:
    no no, I can just read my dog's mind
  • K3Nv2 @ K3Nv2:
    A female dog knows a female dog
    +1
    K3Nv2 @ K3Nv2: A female dog knows a female dog +1