Hacking Nintendont - wiimote & nunchuck support discussions

del_delly

Well-Known Member
Member
Joined
Sep 21, 2013
Messages
137
Trophies
0
Age
31
XP
163
Country
Norway
The dol posted in post #51 does not give the Wiichuck combo any input. At the least with a original wiimote.
I wouldn't know why. Sorry for not being any help.
 
  • Like
Reactions: pedrobarca

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
Woa-ho-ho...
Easy there.
I said I wasn't going to be in town for the weekend and I already have my inbox filled with complaints.

I didn't say the .dol MOD was going to work from the get-go, did I?
Maybe that was why the patch was removed from the thread in the first place, because it wasn't polished out.

Nevertheless, I will try to look at the code and perhaps taking a look at FPad too.

EDIT:
So in a further analysis, I stumbled upon three things:
  • The initialization code for the Nunchuck is indeed correct, it uses the register address of 0xA420 0000, which is the one for nunchuck, while 0xA4200101 is the one for the CC and CCP.
Code:
if(R32((u32)((u8*)buffer+8)) == 0xA4200000)
{
      stat->controller = C_NUN;
      dbgprintf("Connected Wired Nunchuck\n");
}
  • The second thing I noticed it that apparently the button registers for the Wiimote are not what I thought it would be. In my button file I have that the Wiimote Minus button is 0x0010, but in the Nintendont code it is marked as 0x0100, behind it is the legend that says: "//is normally 0x10, pushed into cc buttons" which makes me think if that is why we aren't getting any button inputs from ANY controller.
  • The Nunchuck button addresses are wrong. They should be simply 0x01 and 0x02, as to which one corresponds to Z or C, I still have to see since I have two sources contradicting as to which is which.
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
Good luck ! Even if I wouldn't use a nuchuck, let's hope you fix this for finaly have people happy.

Thank you :)
Let's really hope so.
I am just trying to help out so people can leave the original thread out of the Nunchuck topic. XD

EDIT: Just made some modifications to the PadReadGC.c code to hopefully get a proper response.

Please, someone compile the code with the .rar files I provide below.

PS: I don't guarantee that it will work, since I cannot test right now, I wouldn't ask you guys to do it if I were home right now.

Here is the .dol link, test it out and reply with what the hell happened :P:
https://www.dropbox.com/s/spmuj5kznfexnwg/Nintendont Nunchuck MOD Attempt.dol?dl=0
 

Attachments

  • Patch.rar
    10.3 KB · Views: 320

nakata6790

True Player
OP
Member
Joined
Sep 17, 2009
Messages
891
Trophies
1
XP
618
Country
Greece
People should not pester Fix94 (it is even mentioned in the 3 things to keep in mind in the OP) or ShadowOne333. WTH...


@ ShadowOne333 thanks for the second dol man. I' ll try it ASAP (living room TV where Wii is connected, is currently occupied). Even if it does not yet work as reported in the above post, you have my sincere thanks for taking the time to look at this again.

I would like to make a single suggestion, if we hit a roadblock.
Look at Wii64 or Quake GX sources for wiimote & nunchuck usage. I KNOW you said they had CC issues, but the target here is getting wiimote & NC. People wanting CC could simply use the default, unmoded Nintendont. After all, USBLGX, CFG & WiiFlow let us use a per game Nintendont build ;)
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
nakata6790 do you know about programming? I dont know how but i looked at the code, and its weird that that + is there http://www.4shared.com/photo/zZQQT5mqce/code.html
If i´m wrong just dont care about this
nakata6790 is not the one responsible of providing the code patches, I am...

And fuck I forgot to delete that + sign from that particular line in the code.
Stupid me, here is the .dol with the variable added properly:
https://www.dropbox.com/s/9rqq7tppfmyr8mo/Nintendont Nunchuck Attempt MOD 3.dol

Edit: Don't forget to test Wiimote+Nunchuck, Wiimote buttons and see if the CC and CCP controls are fucked up in anyway.
 

nakata6790

True Player
OP
Member
Joined
Sep 17, 2009
Messages
891
Trophies
1
XP
618
Country
Greece
Just tested Nintendont Nunchuck Attempt MOD 3.dol.

Results:
I connect wiimote & NC, start Nintendont from HBC. No responce (except power button, see below*).
Only feedback is that when NC is connected, wiimote light #1 is on. When NC is disconnected, all wiimote lights are ON (so the mod recognizes that an attachment NC is on the wiimote, but that's it). If i reconnect NC, light #1 is on again.

*If i keep wiimote Power button pressed, all lights go off, so that is registered.

If i repeat the above with CC connected to the wiimote, i only get feedback from CC left analog stick. If i press any wiimote button (besides the power) simultaneously with CC left stick, i still get no button feedback, only left CC stick. Otherwise (lights & such) are exactly like NC with connect- disconnect attempts.
 

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
Just tested Nintendont Nunchuck Attempt MOD 3.dol.

Results:
I connect wiimote & NC, start Nintendont from HBC. No responce (except power button, see below*).
Only feedback is that when NC is connected, wiimote light #1 is on. When NC is disconnected, all wiimote lights are ON (so the mod recognizes that an attachment NC is on the wiimote, but that's it). If i reconnect NC, light #1 is on again.

*If i keep wiimote Power button pressed, all lights go off, so that is registered.

If i repeat the above with CC connected to the wiimote, i only get feedback from CC left analog stick. If i press any wiimote button (besides the power) simultaneously with CC left stick, i still get no button feedback, only left CC stick. Otherwise (lights & such) are exactly like NC with connect- disconnect attempts.

That's a good feedback.

So the app does detect that the Nunchuck is connected, but doesn't get any button response out of it.
This can only mean that the button input registers are wrong, but how could they if all the information I've been reading has those same registers? O.O
Also, the CC and CCPs should not be affected at all.

Here's the Wii64 source code for the Wiimote+Nunchuck combination, if anyone is willing to give a hand:
https://code.google.com/p/mupen64gc/source/browse/trunk/gc_input/controller-WiimoteNunchuk.c
 
  • Like
Reactions: pedrobarca

nakata6790

True Player
OP
Member
Joined
Sep 17, 2009
Messages
891
Trophies
1
XP
618
Country
Greece
(posting from mobile, sorry for weird formatting) Hmm, could a "hybrid" nintendont mod be compiled with the default pad text/part replaced by wii64 one, only as far as wiimote & nunchuck are concerned. BTW, to your question, maybe CC button behavior is changed because of the patch?
 
  • Like
Reactions: pedrobarca

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
Try left shifting all your wiimote button offsets left 4. Note that minus is defined as 0x0010 normally, but in https://code.google.com/p/nintendon-t/source/browse/trunk/kernel/BT.h it's 0x0100

You mean doing something like this:
0x0010 -> 0x0100
0x0020 -> 0x0200
And so on?

If that were the case, I will be missing the last button:
+#define WM_BUTTON_TWO 0x0001
+#define WM_BUTTON_ONE 0x0002
+#define WM_BUTTON_B 0x0004
+#define WM_BUTTON_A 0x0008
+#define WM_BUTTON_MINUS 0x0010
+#define WM_BUTTON_HOME 0x0080
+#define WM_BUTTON_LEFT 0x0100
+#define WM_BUTTON_RIGHT 0x0200
+#define WM_BUTTON_DOWN 0x0400
+#define WM_BUTTON_UP 0x0800
+#define WM_BUTTON_PLUS 0x1000
Button Plus has 0x1000, if I were to shift it it would be 0x10000 and that would be out of place, unless it is 0x0001.
Is this what you were refering to?
Or... ?
 
  • Like
Reactions: pedrobarca

bobmcjr

Well-Known Member
Member
Joined
Apr 26, 2013
Messages
1,156
Trophies
1
XP
3,242
Country
United States
You mean doing something like this:
0x0010 -> 0x0100
0x0020 -> 0x0200
And so on?

If that were the case, I will be missing the last button:

Button Plus has 0x1000, if I were to shift it it would be 0x10000 and that would be out of place, unless it is 0x0001.
Is this what you were refering to?
Or... ?
It doesn't make sense for Plus, but try it for the other buttons, and if it works Plus can be figured out later.
 
  • Like
Reactions: pedrobarca

ShadowOne333

QVID PRO QVO
Editorial Team
Joined
Jan 17, 2013
Messages
12,236
Trophies
2
XP
34,766
Country
Mexico
It doesn't make sense for Plus, but try it for the other buttons, and if it works Plus can be figured out later.

That was actually my next move, I already had the buttons switched like that but I didn't compile because I had doubts about the Plus button.
Anyway, here is the dol with the buttons changed to those addresses, if anything good changes then let me know:
https://www.dropbox.com/s/qhbbgbyvmnms1wb/Nunchuck Attempt 4.dol?dl=0

Also, I want a little suggestion about the next code movement
WARNING-ONLY PROGRAMMERS/CODERS MIGHT OPEN UP THE SPOILER!
YOU'VE BEEN WARNED. XD
I was about to implement the Wiimote controller buttons into the same nested IF for the Nunchuck, something like this:
Code:
        if(BTPad[chan].used & C_NUN)
        {
            //Pad[chan].triggerZ = BTPad[chan].triggerZ;
            //if(BTPad[chan].button & 0x01)
            //    button |= PAD_TRIGGER_Z;
 
            //Pad[chan].triggerC = BTPad[chan].triggerC;
            //if(BTPad[chan].button & 0x02)
            //    button |= PAD_TRIGGER_R;
 
            if(BTPad[chan].button & 0x01)
                button |= PAD_TRIGGER_Z;
 
            if(BTPad[chan].used & C_WM)
            {  /* Define wiimote buttons */
                if(BTPad[chan].button & WM_BUTTON_B)
                    button |= PAD_BUTTON_B;
                if(BTPad[chan].button & WM_BUTTON_A)
                    button |= PAD_BUTTON_A;
                if(BTPad[chan].button & WM_BUTTON_PLUS)
                    button |= PAD_BUTTON_START;
                if(BTPad[chan].button & WM_BUTTON_HOME)
                    button |= PAD_BUTTON_MENU;
            }
        }
But I am not too sure of it, can someone who knows some programming give me a suggestion?
I think it would be better off this way since we don't want the C_WM register addresses make any conflicts with other IFs in the code.
That way we can be sure that the WM buttons are only activated/enabled if we have a Nunchuck connected, like the IF explicitly says so.
 
  • Like
Reactions: pedrobarca

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,228
Country
Canada
^ Well, I'm not an expert, but having wiimotes buttons in the nunchck IF should make them working the way you mapped them, only with a nuchuck, without having them registered while a CC is connected.
Question, did you look about wiimote shortcuts? would they be registered along with a button press? eg: pressing minus button giving an input AND enable/disable rumble, both at the same time? wondering this issue if something is not specificlly made to avoid a button conflict.
 
  • Like
Reactions: pedrobarca

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    But for $20 he will still let you...
  • BakerMan @ BakerMan:
    @K3Nv2 That's what God's saying to all of us after we die. lmao
  • K3Nv2 @ K3Nv2:
    God has a record cabinet with my name on it
  • K3Nv2 @ K3Nv2:
    "Why did I create this."
    +1
  • BakerMan @ BakerMan:
    I bet he looks at my record and thinks "he fell off."
  • K3Nv2 @ K3Nv2:
    I like how these earbuds put on a light show like PAIR ME PAIR ME
  • Psionic Roshambo @ Psionic Roshambo:
    It's mind control Ken the lights combined with subliminal voices
  • K3Nv2 @ K3Nv2:
    I hear voices now
  • ZeroT21 @ ZeroT21:
    stop calling 1-800- imaginary friends
  • K3Nv2 @ K3Nv2:
    I have imaginary enemies
  • Psionic Roshambo @ Psionic Roshambo:
    Siri make the voices stop telling me to put peanut butter on the neighbors car
  • K3Nv2 @ K3Nv2:
    Don't forget to initial it
  • ZeroT21 @ ZeroT21:
    peanut butter + BMW make excellent sandwich la
  • K3Nv2 @ K3Nv2:
    Elon told me not to give my electric dog peanut butter
  • ZeroT21 @ ZeroT21:
    ya, that's bad, don't want the mut to have explosive diarrea
  • K3Nv2 @ K3Nv2:
    Robots can shit now clean that up
  • ZeroT21 @ ZeroT21:
    do those vacuum cleaner bots even do anything than letting cats have free rides?
  • K3Nv2 @ K3Nv2:
    They suck
  • ZeroT21 @ ZeroT21:
    mine cant even get on a simple flat carpet, totally wasted my money
  • ZeroT21 @ ZeroT21:
    only helps the cat do spins around the room
  • ZeroT21 @ ZeroT21:
    i have a mind putting the cat on dinner duty
  • K3Nv2 @ K3Nv2:
    I recommend getting a treadmill for cats
  • ZeroT21 @ ZeroT21:
    me cat probably wont ever use it, furrball aint ever home, always somewhere down the street, looking for females, even named it ''Chad''
    ZeroT21 @ ZeroT21: me cat probably wont ever use it, furrball aint ever home, always somewhere down the street...