Hacking New Classic Controller Hacks

  • Thread starter Thread starter Vague Rant
  • Start date Start date
  • Views Views 252,408
  • Replies Replies 690
  • Likes Likes 42
Hello, thank you for the amazing work you've done on these hacks (along with the contributions of the other members as well)!

For the case of the missing shake support in super paper mario, can i still utilize the shake of the wiimote while using the classic control hack? and is there a way any one of us can help add it to the classic control hack? thanks again.
 
  • Like
Reactions: Vague Rant
Hello, thank you for the amazing work you've done on these hacks (along with the contributions of the other members as well)!

For the case of the missing shake support in super paper mario, can i still utilize the shake of the wiimote while using the classic control hack? and is there a way any one of us can help add it to the classic control hack? thanks again.
Hi! I think Paper Mario should work with shaking Wiimote. It might require unplugging the extension for a moment though. If you guys know PPC assembly, you could theoretically help us fix shaking for paper mario. We currently need Tilting implemented (Left and Right directions) And a standard shake. Motion controls are 100% the hardest part though. It has stumped Vague in some instances.
That's awesome, congrats on the progress! Especially impressive without having any prior experience, great work. I don't really have a "generic" way to trigger motion controls across different games since they all tend to have different setups for their motion controls, so I generally have to write a different hack for each game that needs accelerometer stuff. It would be hard to really write up a tutorial on that because it's different for each game. The general idea is that inside read_kpad_acc() you need to force the game to load some specific accelerometer data instead of the real data whenever a certain button is pressed.

My usual trick for doing this is to map various accelerometer functions as buttons 0x80, 0x40 and 0x20 on the Wii Remote in the button injector. These are all unused bits on the Wiimote, i.e. technically possible button values which simply don't exist on the Wiimote. Then inside read_kpad_acc(), I'll write a routine which checks if the user pressed one of those fake buttons and load fake data in before calc_acc() (the function which processes that data) can run. calc_acc() is pretty easy to find because it always runs three times in a row, once for each axis. Before each function call will be an lfs f1, 0xXXX(r30) which is reading in the real accelerometer data, so that's the ideal place to insert some code to replace the real data.

I can't really give an example that applies to many games simultaneously (like the button or pointer support) because the read_kpad_acc() function changed a lot over the course of the Wii's lifespan, so my accelerometer hacks are never the same between any two games. Basically you have to locate where the accelerometer data gets loaded into read_kpad_acc() (where this data is pulled from also varies) and insert your own floating point values. Here's an example of a basic single-frame, single-axis swing:
Code:
lfs f1, 0x???(r3) ; load in the real accelerometer data

lwz r4, 0x4(r3) ; read newly pressed buttons this frame
andi. r0, r4, 0x80 ; was fake shake 0x80 pressed?
beq- RETURN ; if not, don't do anything

; magic
bl GRAB
MAGIC:
SHAKE: .float 3.4 ; maximum value registered by the wiimote accelerometer
GRAB:
mflr r5

lfs f1, SHAKE-MAGIC(r5) ; replace real accelerometer data with 3.4

RETURN:

You can sometimes locate where the data gets read from by looking for calc_acc() as I mentioned in a previous post, but older games don't use calc_acc() at all. Also, because different games have different expectations for what swinging, shaking, etc. looks like, they all have different requirements. Some games want a swing or shake to last for multiple frames, some expect the shake to first go in one direction then return again (as the forces would naturally from you moving the Wiimote), etc.

Accelerometer support is 100% the toughest part of any of these hacks. To the extent that many of them have stumped me, the two things I hit up against are the accelerometers (both Wiimote and Nunchuk have eluded me many times) and games not using KPAD at all. Since I don't have a solid handle on it myself and it's just something I have to work on individually each game, I don't really have much in the way of general advice for accelerometer stuff.

So obviously it varies from title to title, but here's an example from a recent hack, Rygar. I'll add some comments for good places to do some code insertions. This is specifically the USA version, EUR is different again.

Code:
801B7374 lwz r6, 0x000C (r3) read_kpad_acc ; this is what i use for complex games
801B7378 addi r4, r30, 12 read_kpad_acc
801B737C lwz r5, 0x0010 (r3) read_kpad_acc
801B7380 lwz r0, 0x0014 (r3) read_kpad_acc
801B7384 stfs f4, 0x04AC (r3) read_kpad_acc ; the Z axis gets written here
801B7388 mr r3, r30 read_kpad_acc
801B738C lfs f1, 0x04A4 (r30) read_kpad_acc ; this reads in the X axis
801B7390 stw r6, 0x0014 (sp) read_kpad_acc
801B7394 stw r5, 0x0018 (sp) read_kpad_acc
801B7398 stw r0, 0x001C (sp) read_kpad_acc
801B739C bl ->0x801B6EA8 --> calc_acc
801B73A0 lfs f1, 0x04A8 (r30) read_kpad_acc ; this reads in the Y axis (good for simple games)
801B73A4 mr r3, r30 read_kpad_acc
801B73A8 addi r4, r30, 16 read_kpad_acc
801B73AC bl ->0x801B6EA8 --> calc_acc
801B73B0 lfs f1, 0x04AC (r30) read_kpad_acc ; this reads in the Z axis (")
801B73B4 mr r3, r30 read_kpad_acc
801B73B8 addi r4, r30, 20 read_kpad_acc
801B73BC bl ->0x801B6EA8 --> calc_acc
For games with this rough format (probably about 2008 onward?), this gives you a couple of options. I mostly inject at the first instruction because it means I definitely have r0, r4, r5 and r6 available to do GPR stuff and f0, f1, f2 and f3 to do FPR stuff.

The value that's currently in f4 is the Z axis about to be written out (see comment), so you can just load some other value into f4 to replace the real accelerometer data. To replace the X and Y axes, you'll need to write to 0x???? (r30) (offset varies by SDK version but if you find something like the above, you can see the offsets the game is using). In this case, you need to write to 0x04A4 (r30) for the X axis and 0x04A8 (r30) for the Y axis.

If the game you're looking at only needs you to work with a single axis (in particular Y or Z), you can use the points where the Y and Z axes get read in from 0x04A8 (r30) and 0x04AC (r30). In this case, r0, r3 and r4 are definitely free and f1 needs to be replaced with fake data.
 
Hello, I would like to map the B of the Wiimote to the B of the Classic Controller in Epic Mickey. I think it's okay to only jump with A and in return be able to cancel with B in the menu. How do I do that?

I have another question: Has anyone managed to inject the Pal Code from Kirby's Adventure Wii into the Main.dol? I'm having problems with it.

Thanks in advance!
 
Hello, I would like to map the B of the Wiimote to the B of the Classic Controller in Epic Mickey. I think it's okay to only jump with A and in return be able to cancel with B in the menu. How do I do that?

I have another question: Has anyone managed to inject the Pal Code from Kirby's Adventure Wii into the Main.dol? I'm having problems with it.

Thanks in advance!
Hello! I made a simple ISO creator for kirby here. Ill put A link below 👍
It requires WIT and another tool to be installed which is in the builder.

As for epic mickey, that game sadly does not have an .ASM file for me to modify the controls. Apologies
Post automatically merged:

Hello all. I have made a simple Kirby Wii ISO Patcher. This uses the Riivolution ISO Builder and the Easy GCT Embedder, so i have made sure to leave credits in this program.
 
Hello! I made a simple ISO creator for kirby here. Ill put A link below 👍
It requires WIT and another tool to be installed which is in the builder.

As for epic mickey, that game sadly does not have an .ASM file for me to modify the controls. Apologies
Post automatically merged:

Hi, thanks for your help but I can't access your tool. I got it to work nonetheless by using the .xml file to patch instead of the .ips which wouldn't work.
 
  • Like
Reactions: awesomeee
hi there, I had a question about mario kart wii's MK8 controller hack:

if using a mix of classic controller and classic controller pro, should i leave controls to default, or is there a compromise that can be used to improve the experience on both? thanks.
 
Master @Vague Rant despicable me and cars mater working perfect on wii u.

I hope you can do red steel, to me, that game is super underrated, i was never able to finish it for one thing or another.
 
  • Like
Reactions: Vague Rant
@GaryOderNichts Re: WiiU controller hacks: Do you have any more knowledge on it? I saw you talking about VPAD and stuff in the Nintendo Hombrew discord. Any knowledge is appreciated!

@NestorM was interested in those kinds of hacks, like Planes. Player 2 MUST use Wiimote and Nunchuk but cant use the Pro controller etc
1736824709996.png

Post automatically merged:

Hello again @Vague Rant Im running into a new issue with the pointer / buttons.
For some reason, Adding the pointer code is causing everything to drag to the right of the screen. It also causes some buttons (I think) to be held for some reason. Any idea why everything is breaking when the Pointer code is added?

EDIT: I dont know if its specificially the pointer code, but its very weird. It also breaks WPAD inputs (Wii Remote)
EDIT 2: Its not the pointer problem. But it seems to be with the games that use KPAD differently. The one below

On a seperate note, how do you handle games with andi. r6, r9, 0x9FFF? Games that handle KPAD way differently. Im trying to finish one of my hacks but it handles KPAD differently, and that instruction in read_kpad_button looks different. Thanks.
Post automatically merged:

Update: Max and the Magic Marker seems to use andi. r6, r9, 0x9FFF aswell 😬 That will make things complicated if the same issue arises
 
Last edited by awesomeee,
  • Like
Reactions: NestorM
One more thing, @Vague Rant forget about adding D pad emulation to Wii Play. Im fine for now 👍
Post automatically merged:

Since you've done Mater-National i assume you're also going to do Race-o-rama right? I've wanted to try that one for a while.
Does that game have a similar feature where some modes use different control schemes? That might complicate things. Its like the "Ramone" Or whatever its called mode in Mater national championship. Vague spent a lot of work with the control scheme in that game aswell 👍
 
Last edited by awesomeee,
  • Like
Reactions: Vague Rant
@Vague Rant I am currently trying to replicate the button-hack for Lego Star Wars - The Complete Saga from your guide. (I want to get familiar with creating gecko hacks, so that i eventually might be able to fix Lego Star Wars 3, Back To The Future and some others if i stumble upon issues. (I have no idea if that will be possible with my skillset, i am currently in the hubris-phase ;))

The problem with my own hack is, that it does not work. I have identified the adress (8032f380) of the andi-instruction, but it differs from the one in your hack (which does work, as far as i can tell)

The adress in your hack is 8019AC18 which seems to be inside the parent call.

Is this expected, as you chose a better location for the hack for that game, or is the guide only "very" barebones?

There is also the question what happens if it is not easy to find the kpad-functions when the symbols are not recognized. (Both BTTF and LSW3 dont show any results for either kpad or select_1obj_continue).

Do you have any hints on how to approach this? Or is this simply too hard (for me)?

Thank you very much anyway, both for the existing hacks and the guide!
 
  • Like
Reactions: Vague Rant
There is also the question what happens if it is not easy to find the kpad-functions when the symbols are not recognized. (Both BTTF and LSW3 dont show any results for either kpad or select_1obj_continue).

Do you have any hints on how to approach this? Or is this simply too hard (for me)?

Dolphin wont always detect that symbol. Sometimes you need to set a breakpoint at WPADProbe to find KPADRead.

Find a function call that looks like LR = XXXXXXXXXX. I am not sure of the full digits. The X will be different digits. Of course some games might use a different call.

For further confidence check if the call area is white, meaning dolphin has NOT detected it.

Scroll down from the call to find the 3 read functions. Good luck
 
  • Like
Reactions: Vague Rant
Here OG Doknkey Kong Returns Contory

Classic Controller V2

C24A5F70 00000020
38210050 7C0802A6
80B50060 48000041
80950000 7CA52378
90B50000 80B50064
4800002D 80950004
7CA52378 90B50004
80B50068 48000019
80950008 7CA52378
90B50008 7C0803A6
4E800020 70A40020
2C040000 4182000C
38C0012D B0D50186
38C00000 70A40800
2C040000 41820008
60C68000 70A40200
2C040000 41820008
60C60200 70A40040
2C040000 41820008
60C60100 70A40001
2C040000 41820008
60C60002 70A40002
2C040000 41820008
60C60008 70A48000
2C040000 41820008
60C60004 70A44000
2C040000 41820008
60C60001 70A40400
2C040000 41820008
60C60010 70A41000
2C040000 41820008
60C61000 7CC53378
60000000 00000000
04389B90 38A00000
0438710C 28000009
 
  • Love
Reactions: MDLG01
Here OG Doknkey Kong Returns Contory

Classic Controller V2

C24A5F70 00000020
38210050 7C0802A6
80B50060 48000041
80950000 7CA52378
90B50000 80B50064
4800002D 80950004
7CA52378 90B50004
80B50068 48000019
80950008 7CA52378
90B50008 7C0803A6
4E800020 70A40020
2C040000 4182000C
38C0012D B0D50186
38C00000 70A40800
2C040000 41820008
60C68000 70A40200
2C040000 41820008
60C60200 70A40040
2C040000 41820008
60C60100 70A40001
2C040000 41820008
60C60002 70A40002
2C040000 41820008
60C60008 70A48000
2C040000 41820008
60C60004 70A44000
2C040000 41820008
60C60001 70A40400
2C040000 41820008
60C60010 70A41000
2C040000 41820008
60C61000 7CC53378
60000000 00000000
04389B90 38A00000
0438710C 28000009
Isnt this just Crediar's original code?
 
Said the og code never once said it was me who made it. It belong to Crediar.
Okay, but it sounded like you were saying it belonged to you, thats all. You should atleast say in the OG code its by crediar.
Post automatically merged:

@FredericVincent0 @Felold

I decided to take a look at Twilight Princess, and it sadly handles KPAD way differently then usual wii games. Sorry if you were hoping for a hack. Even with the debugging map in the files its still very weird. If there is more interest I will consider looking at it again, but not right now. Sorry.

So TLDR: Its not just that me and Vague arent really interested, its also that the code is different then usual, causing extra hacking issues.
 
@awesomeee

Dolphin wont always detect that symbol. Sometimes you need to set a breakpoint at WPADProbe to find KPADRead.
You mean search for the symbol "WPADProbe"?


Scroll down from the call to find the 3 read functions.
The WPADProbe only calls externally to manage interrupts, otherwise it is pretty much self-contained. Is WPADProbe a child function of KPADRead?

Good luck
Thanks! I will need it!
 
I was wondering if it's possible to add support for the classic controller to Need for Speed ProStreet. : )
 
Any chance you could try with Tenchu: Shadow Assassins? Since the game was ported to PSP maybe it could serve as a prompt guideline for the Classic Controller.
 
  • Like
Reactions: Felold
I was wondering if it's possible to add support for the classic controller to Need for Speed ProStreet. : )
Checking out Need for Speed on StrategyWiki, I see it's got a sideways control scheme that's mostly physical buttons but with tilt steering, and a vertical control scheme that is more motion-based, with flicking the Wiimote to shift gears and stuff. If I look into this game, I'd definitely be doing the former because motion stuff is probably the hardest part of any of these. No guarantees but I'll chuck it on the list.

I did actually look at Need for Speed: ProStreet after a previous request. I got it partially working, but it needs more work to actually be playable. I got a bit stuck and put it aside and moved on to other games, but I do want to come back to it and see if I can figure it out. Need for Speed: Carbon I'm probably less likely to do since you can already play the GameCube version via Nintendont with whatever controller you want. Is there anything the Wii version adds that you don't get from playing the GameCube one?

Like Need for Speed: ProStreet, it's one that I looked at and got stuck so I put it on my to-do list and moved on to other games. In that case, I got lost trying to figure out how to fake the Nunchuk accelerometer, since you have to shake that for one of the abilities Mickey has. I definitely plan to come back to it and try again, especially because understanding the Nunchuk is something I've come up against multiple times at this point without ever finding a "proper" solution (in Donkey Kong Jungle Beat, I modified Wiimote shakes to also count as Nunchuk shakes, and in DKC Returns, I ultimately found where the game judges whether or not you shook the Nunchuk and modified it there instead of actually simulating Nunchuk accelerometer stuff).
^
|
Post automatically merged:

Any chance you could try with Tenchu: Shadow Assassins? Since the game was ported to PSP maybe it could serve as a prompt guideline for the Classic Controller.
Does that game use motion controls a lot? What specific movements happen?
 
Last edited by awesomeee,

Site & Scene News

Popular threads in this forum