Welcome! Log In Create A New Profile

Advanced

Use any controller with most Wii games?

Posted by umaggot 
Use any controller with most Wii games?
May 15, 2011 02:00AM
I was wondering if it was possible to make a hack that would enable the usage and configuration of any controller with any Wii game? (Such configurations would include mapping a nunchuck/wiimote shake to a button, and mapping the pointer to either the left or right joystick on a classic controller -- or even a gamecube controller.) Please let me know, thank you.
Re: Use any controller with most Wii games?
May 15, 2011 02:36AM
You could do it via a special loader, like what Gecko OS does and insert a hook to the re-map code. Of course it's not quite that easy.
Re: Use any controller with most Wii games?
May 15, 2011 03:09AM
How would I get started with something like that? I have Gecko 1.9.3, but I don't understand hooking. Are there any beginner's resources? I have some prior experience with 6502 ASM, would that help?
Re: Use any controller with most Wii games?
May 15, 2011 04:02AM
Quote
umaggot
How would I get started with something like that? I have Gecko 1.9.3, but I don't understand hooking. Are there any beginner's resources? I have some prior experience with 6502 ASM, would that help?

Take a look at the Gecko OS source. If I remember correctly it injects a jump in the video flipper that calls the cheat code then returns. I've not done this on Wii but the general term used for this is code injection.

Yes experience with asm will help but when you inject a hook it's actually the byte code you are writing to memory. I have no skill with PPC ASM so can't help you with that.

Once you've figured this out you still need to re-map the controls and know which controller mem/registers to change. Again here you'd have to look a the memory map (http://wiibrew.org/wiki/Wiimote#Control_Registers) and see how to access the controller.
Re: Use any controller with most Wii games?
May 15, 2011 10:27AM
There's no real need to reinvent the wheel. There are already Ocarina cheat codes (Ocarina is the cheat engine used by Gecko OS) for remapping controls to other controllers. There is one for Donkey Kong Country and I think one for NSMB. If you google a bit, I think you'll find their source (the DKC one was by crediar) in ASM, port it to your game and then its just a question of compiling it to an Ocarina code. It does have to be done on a game-to-game basis though.

EDIT: These links may help: [wiird.l0nk.org] [wiird.l0nk.org]



Edited 1 time(s). Last edit at 05/15/2011 10:35AM by SifJar.
Re: Use any controller with most Wii games?
May 15, 2011 11:42AM
That is a very cool find! As for it being on a game-to-game basis though, it does seem to be inconvenient for hackers and average joes alike. Instead of making almost 500 Ocarina codes, I think it would be simpler to limit it to a single app. Regardless, the resources are helpful; so thank you!
Re: Use any controller with most Wii games?
May 15, 2011 08:09PM
Quote
SifJar
There's no real need to reinvent the wheel. There are already Ocarina cheat codes (Ocarina is the cheat engine used by Gecko OS) for remapping controls to other controllers. There is one for Donkey Kong Country and I think one for NSMB. If you google a bit, I think you'll find their source (the DKC one was by crediar) in ASM, port it to your game and then its just a question of compiling it to an Ocarina code. It does have to be done on a game-to-game basis though.

EDIT: These links may help: [wiird.l0nk.org] [wiird.l0nk.org]

Interesting. Nice one. I don't actually don't play games on my Wii :) At least not Wii games.

Quote
umaggot
That is a very cool find! As for it being on a game-to-game basis though, it does seem to be inconvenient for hackers and average joes alike. Instead of making almost 500 Ocarina codes, I think it would be simpler to limit it to a single app. Regardless, the resources are helpful; so thank you!

Unless you want to map the same controls to every game I think you'd need some per game config.
Re: Use any controller with most Wii games?
May 15, 2011 09:10PM
The thing is, I'm pretty sure the variables holding the buttons pressed on each controller will vary depending on the game, so it'd need to be game specific anyway. Unless there is a way to write a universal code which would find that variable.
Re: Use any controller with most Wii games?
May 16, 2011 03:10PM
scanff:
That's actually what I had in mind. Considering that a lot of apps allow you to save configuration files, one could have it set to load and save to gamename.ext. Starting from the defaults, it would allow you to build your own configuration, similar to how Wii64 handles input configuration. (Except of course, it'd hopefully be less buggy.)

SifJar:
I could be wrong, but I would think an external app would be able to "act as the Wiimote itself", as opposed to the functions programmed into each game. I don't see why it couldn't trick the game into thinking that the Classic Controller is the Wiimote, instead of actually remapping buttons -- it'd be more like "forwarding". Every NES, N64, PC, etc. game has its own addresses for where the controller programming goes, but that didn't stop us from developing emulators with the same functionality. In effect, it'd be a "controller emulator" / "Joy2Key" (or in this case, Joy2Joy) for the Wii. It more than likely couldn't be done with Ocarina/Gecko, however.

Either way, the informative resources are all appreciated -- thank you both very much. I'll see what I can do with it in my free time. I can't promise much if anything as my time is scarce. If anyone else would like to give it a shot, be my guest.
Re: Use any controller with most Wii games?
May 16, 2011 04:39PM
There is very limited free space available in memory on the Wii, and no framework for running multiple programs at once. This is why it may not be possible to do what you suggest. Not trying to put you off, just saying it may be an issue.
Re: Use any controller with most Wii games?
May 16, 2011 10:27PM
Just a thought, the simplest method I can think of. I may be totally wrong, not having read all the specs :)

- write a simple loader to load the game.
- the loader injects a jmp to your code.
- your very small stub code cave does something like this.
- read a remap config. file per game (no sure of the overhead with this).
- peek the controllers state. I'm presuming even if the game does not support the specific wii controller the system may register the input in memory, again I may be wrong. If this is not the case you'd have to scan the controller you want to use. Then you can remap.

E.G.

If you wanted to map the CC DPAD to the motes DPAD. First read the CC's DPAD register then poke the values into the motes DPAD register.
Re: Use any controller with most Wii games?
May 16, 2011 11:28PM
scanff: In the DKCR hack I mentioned above, Classic Controller is not supported by the game, there is an offset you have to modify to enable it. Presumably it is the same idea for enabling any other unsupported controller.
Sorry, only registered users may post in this forum.

Click here to login