Hacking New Classic Controller Hacks

  • Thread starter Thread starter Vague Rant
  • Start date Start date
  • Views Views 244,549
  • Replies Replies 687
  • Likes Likes 42
@Vague Rant I played a little bit with Excite Trucks CC Hack, because I wanted to remap some buttons, but now I have two actions on one button and I don't know how to fix it. Here is my idea: Accelerate with Y, Turbo stays at ZR and Brake on ZL. It would make the air tricks easier. So I changed the code of the europe version to this:

042492EC 93C10070
C2047C08 00000002
EFC02028 FFC0F050
FFE0F850 00000000
04047C48 D01F0008
04047C6C D01F0008
04047C90 D01F0008
06047D7C 0000000C
A89E002E 387F000C
A8BE002C 00000000
C204605C 0000001C
7C0802A6 80BD0060
48000045 809D0000
7CA52378 90BD0000
80BD0064 48000031
809D0004 7CA52378
90BD0004 80BD0068
4800001D 809D0008
7CA52378 90BD0008
7C0803A6 4E800020
60000000 38C00000
70A40800 41820008
60C68000 70A40001
41820008 60C60002
70A44000 41820008
60C60001 70A42082
41820008 60C60008
70A48204 41820008
60C60004 70A40020
41820008 60C60100
70A40080 41820008
60C60200 70A40008
41820008 60C60800
70A40020 41820008
60C60400 70A40400
41820008 60C60010
70A41000 41820008
60C61000 7CC53378
4E800020 00000000

Now I have Brake and Turbo on ZL at the same time. I can't find the solution in the code. Is there another trick to this or should I create a new line for that? Thanks a lot
 
  • Like
Reactions: MysticStarlight
No updates on Fluidity yet, I haven't looked at that game at all.

I have some good and bad news about Fluidity.
The good news: It seems more then possible to be done, the ice form and water work great! (Emulated on dolphin)

The bad news: The cloud seems the hardest one to do. I tried it but it just seems confusing, and i forgot the controls it uses, but i know one included shaking to drain the cloud.

It might use that low level motion data you were talking about (possibly) Although its not from next level games, i have a small feeling it does, I dont think it does though since the motion is used a lot, so it wouldnt be low level.
 
@Vague Rant Kirby Return To Dreamland already have a cc hack but needs a gameconfig.txt file stored on sd card to work. So it can't be played as inject with wii u gamepad. Do you think it's possible to make a new cc hack without the needing of this gameconfig.txt file ? Thanks.
 
@Vague Rant Kirby Return To Dreamland already have a cc hack but needs a gameconfig.txt file stored on sd card to work. So it can't be played as inject with wii u gamepad. Do you think it's possible to make a new cc hack without the needing of this gameconfig.txt file ? Thanks.
Ive been wondering about that too - If vague makes an IPS patch it might be possible. Maybe
Post automatically merged:

An IPS patch might be able to work, since it might not trigger metafortress protection, but im not sure
 
Last edited by awesomeee,
@Vague Rant Lmao remember how you could freeze fish in the ice form? That was funny to do! (In fluidity)
(There hasnt been much jokes here, and i know these hacks can be tiring, so i want to start showing funny things to cheer you up!)
 
Last edited by awesomeee,
  • Haha
Reactions: Vague Rant
Update: Cloud form seems to use forward and backward motion controls to move up and down. That will be pretty tricky to emulate 😬
 
@Vague Rant
for reference, several games support the analog triggers of the original (non-pro) classic controller. This is especially superior in the case of racing sims, where the accelerator pedal is begging for an smooth change. It would be great if you could pull the code from one of the games listed in that post and apply it to your mods.
 
Seeing your codes above, I always wanted to try to play Mario Kart like many other racing games, with R/L as Accelerate/Brake, I should try toying with it on Dolphin.
I've just edited the Mario Kart Wii post to add a full remapping assembly hack as I mentioned in a previous post. This hack remaps every button to the button that it already is, i.e. it does absolutely nothing by default. You can edit this any way you like and plug it into CodeWrite to get a custom button mapping.

@Vague Rant I followed your tutorial and I was able to (partially) make a CC hack for Mario Super Sluggers. I picked that game to practice because it doesn't have a "Connect the nunchuk" message, and I don't have any experience with making gecko codes or working with ASM so I don't know how to make a code to skip that. I was able to make the game recognize the Classic Controller thanks to your guide, though I still haven't managed to emulate the motion controls (shake wiimote, tilt, etc). Thank you soo much! I'm still happy with what I managed to do. I will keep practicing!

I was gonna ask, could you explain how to remove or skip the "nunchuk" error message? Because I wanna try that with Project Zero 2: Wii Edition (PAL). I know that the method might vary depending on what game it is, but any explanation will be useful!
We need like a tutorial on how to make the motion parts of wiimote be emulated on a classic controller is the issue for now.
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.

For fixing Nunchuk errors, usually I will load the game up in Dolphin and let it run until it reaches some kind of Nunchuk error screen. Then in the Memory tab I will switch the search type to ASCII and search for the text that shows up in the Nunchuk error (e.g. "Please connect the Nunchuk to the Wii Remote" type of thing). If it is able to locate the error text, I can then set a read breakpoint (check the Read only button, then right click where the error text is located in memory and Toggle Breakpoint) on that text and find the code where the text is loaded.

From there, you want to use the Callstack in the Code tab to trace your way backward through the code trying to find where the actual Nunchuk check occurred which caused the game to display the error. I mostly do this part via trial and error, I'll go back one or two calls and set an execute breakpoint there (click in the left column of the disassembler in the Code tab) then switch to the Nunchuk in Dolphin settings and see whether that code is still running.

What you want to find is the point where different code paths are taken depending on which controller is connected. The extension types important to us are 0 (none), 1 (Nunchuk) and 2 (Classic Controller). So eventually you should reach a point where there's code which only runs if a specific value is not equal to 1. The extension check will generally look something like cmpwi rX, 0x1, but it's important to note that checking if something equals 1 is very generic code that's used all over the place, so finding a cmpwi rX, 0x1 doesn't mean you've found the Nunchuk check.

If you suspect you have found the Nunchuk check, set a breakpoint on that instruction and try letting the game run with no extension, Nunchuk and Classic Controller. If the register that gets checked matches the values I mentioned above based on which controller you have connected, you can be reasonably sure that it is checking the extension type. If that check fails (is not equal to 1), it means the current connected controller is not a Nunchuk. At that point, you can change this check to also accept Classic Controller, usually looking something like this in assembly which you can paste into CodeWrite:
Code:
  cmpwi r0, 0x1
  beq- RETURN
  cmpwi r0, 0x2

RETURN:
This isn't doing anything too complex: instead of just checking if the value is 1, this checks if it's 1, then checks if it's 2. That way, whatever behavior the game was going to run if the extension type was 1 (like skipping over running the Nunchuk error) will also run if the extension type is 2. A lot of the exact process for how the Nunchuk is checked for varies wildly from game to game, but the extension type values are part of the SDK, so they're something reliable to look for.

@Vague Rant I played a little bit with Excite Trucks CC Hack, because I wanted to remap some buttons, but now I have two actions on one button and I don't know how to fix it. Here is my idea: Accelerate with Y, Turbo stays at ZR and Brake on ZL. It would make the air tricks easier.

Now I have Brake and Turbo on ZL at the same time. I can't find the solution in the code. Is there another trick to this or should I create a new line for that? Thanks a lot
Ah, yeah, that one is a bit more difficult to edit. In a couple of my early hacks I was trying to optimize the button injector down to be as small as possible by checking multiple buttons at the same time. You can see me doing that in instructions like 70A42082. This is checking buttons 0x2000, 0x80 and 0x2 (2082) all at once, so the lines like that are where your problem is occurring, since the buttons are already mapped there. In later hacks I decided to stop optimizing the button checks just so they'd be easier to edit exactly for this reason. I should come back to Excite Truck to add IR pointer support anyway, since I made that one before I knew how to do that, so if you don't mind the wait I'll "modernize" the button injector when I do that, otherwise yeah, it will be a bit tougher to change the button values.

@Vague Rant Kirby Return To Dreamland already have a cc hack but needs a gameconfig.txt file stored on sd card to work. So it can't be played as inject with wii u gamepad. Do you think it's possible to make a new cc hack without the needing of this gameconfig.txt file ? Thanks.
Ive been wondering about that too - If vague makes an IPS patch it might be possible. Maybe
Post automatically merged:

An IPS patch might be able to work, since it might not trigger metafortress protection, but im not sure
Yeah, I think it should be possible to convert crediar's existing Metafortress fixes into IPS patches which can apply to the main.dol. I don't know what the format of gameconfig.txt files is like but I think it's just a list of patches to the binary, which is essentially what an IPS is as well. I'm definitely not sure of this though, that's just roughly how I think it works.

Hi! Is there any chance you could release a variation of this to better fit Wild World's controls?

This would be the layout:
Wiimote -> Classic Controller
A -> A, R
B -> B
- -> Y
+ -> X
1 -> -
2 -> +
Z -> ZL, ZR

Having "R" act as the select button makes menu navigation with the right stick very seamless!

Thanks so much!!
I think the easiest way to do this would be to edit the code yourself. It's somewhat complex for this game due to the different pointer modes, so I'll put my (and crediar's, this button injector is based on crediar's work) original assembly in a spoiler below:
Code:
; 803BF784 for USA
; 803BF9EC for USA (Rev 1)
; 803BF5D4 for EUR
; 803BF83C for EUR (Rev 1)
; 803BF928 for JPN (Rev 1)
; 803C8330 for KOR (Rev 1)
  stw r0, 0x68(r31)

INJECTOR:
; held
  lwz r8, 0x60(r31)
  bl TRANSLATOR
  lwz r6, 0x0(r31)
  or r8, r8, r6
  stw r8, 0x0(r31)
; released
  not r8, r8
  lwz r6, 0x8(r31)
  and r8, r6, r8
  stw r8, 0x8(r31)
; pressed
  lwz r8, 0x64(r31)
  bl TRANSLATOR
  lwz r6, 0x4(r31)
  or r8, r8, r6
  stw r8, 0x4(r31)
; enable pointer
  andi. r6, r8, 0x40        ; enable
  beq- TOGGLE
  li r6, 0x2
  stb r6, 0x5E(r31)
  b RETURN
TOGGLE:
; toggle pointer
  andi. r6, r8, 0x80        ; toggle
  beq- RETURN
  lbz r6, 0x5E(r31)
  xori r6, r6, 0x2
  stb r6, 0x5E(r31)
  b RETURN

TRANSLATOR:
      li r7, 0x0

    BTN_HOME:
      andi. r6, r8, 0x800
      beq- BTN_UP
      ori r7, r7, 0x8000    ; Home

    BTN_UP:
      andi. r6, r8, 0x1
      beq- BTN_DOWN
      ori r7, r7, 0x8       ; up

    BTN_DOWN:
      andi. r6, r8, 0x4000
      beq- BTN_LEFT
      ori r7, r7, 0x4       ; down

    BTN_LEFT:
      andi. r6, r8, 0x2
      beq- BTN_RIGHT
      ori r7, r7, 0x1       ; left

    BTN_RIGHT:
      andi. r6, r8, 0x8000
      beq- BTN_A
      ori r7, r7, 0x2       ; right

    BTN_A:
      andi. r6, r8, 0x10
      beq- BTN_B
      ori r7, r7, 0x800     ; A

    BTN_B:
      andi. r6, r8, 0x40
      beq- BTN_X
      ori r7, r7, 0x400     ; B

    BTN_X:
      andi. r6, r8, 0x8
      beq- BTN_Y
      ori r7, r7, 0x1080    ; - and toggle pointer

    BTN_Y:
      andi. r6, r8, 0x20
      beq- BTN_L
      ori r7, r7, 0x180     ; 2 and toggle pointer

    BTN_L:
      andi. r6, r8, 0x2000
      beq- BTN_R
      ori r7, r7, 0x80      ; toggle pointer

    BTN_R:
      andi. r6, r8, 0x200
      beq- BTN_ZL
      ori r7, r7, 0x2000    ; Z

    BTN_ZL:
      andi. r6, r8, 0x80
      beq- BTN_ZR
      ori r7, r7, 0x1040    ; - and enable pointer

    BTN_ZR:
      andi. r6, r8, 0x4
      beq- BTN_PLUS
      ori r7, r7, 0x50      ; + and enable pointer
      b BTN_PLUS

    BTN_PLUS:
      andi. r6, r8, 0x400
      beq- BTN_MINUS
      ori r7, r7, 0x90      ; + and toggle pointer

    BTN_MINUS:
      andi. r6, r8, 0x1000
      beq- DONE
      ori r7, r7, 0x200     ; 1

    DONE:
      mr r8, r7
      blr

RETURN:
The ; comments at the start are the addresses to insert the code which you can paste into CodeWrite along with the assembly to get a Gecko code of the same, and from there you can adjust it however you see fit. I know it's pretty daunting to look at, but the parts you want to change are the lines that go ori r7, r7, 0xXXXX. They have comments after them like ; 1 to indicate what button that number means. Some of them are pressing multiple buttons simultaneously, like 0x90 means 0x80 (toggle pointer) plus 0x10 (the Wiimote Plus button).

Update: Cloud form seems to use forward and backward motion controls to move up and down. That will be pretty tricky to emulate 😬
Yeah, Fluidity does seem like a bit of a complicated one overall. I still haven't looked into it yet, but it's a game I really like, so definitely one I'll make an attempt at. Whether that will be fruitful, who knows; there's plenty of games I've looked into but haven't been successful in hacking, with those games falling onto kind of a spectrum from "I want to keep trying on that one" to "I'll die if I look at that game for one more second." :D

@Vague Rant
for reference, several games support the analog triggers of the original (non-pro) classic controller. This is especially superior in the case of racing sims, where the accelerator pedal is begging for an smooth change. It would be great if you could pull the code from one of the games listed in that post and apply it to your mods.
That is definitely a cool feature, but sorry, not likely to be something I can do. That would require an understanding of how each individual game handles acceleration and braking, since that's all game-specific code. Finding how it works in a one game wouldn't really help me to understand how/where vehicle movement is handled in a different game entirely. I think the case where it would be most likely to be achievable by me would be if there's games that support using the right analog stick to accelerate/brake. It would probably be possible to reconfigure the analog shoulder input to handle existing right stick accelerating/braking, and it would have to be truly analog already--unlike Mario Kart Wii where the right stick behaves like two buttons rather than the analog values being meaningful.



I'll die if I look at this game for one more second.

SI_Wii_EpicMickey_enGB_image1600w.jpg


Epic Mickey is somehow another paint-based 3D platformer developed by a third-party which broke through Nintendo's stranglehold on the Wii. Developed exclusively for the console by Warren Spector's Junction Point Studios, Epic Mickey features the gameplay hook of an interactive world that Mickey can change at will using paint or thinner. With an RPG-influenced quest system, the player's choices also affect Mickey's appearance and skill growth. Lauded for its creative design and reimagining of Disney history, the game was also derided for its poor camera and complex controls. A recent HD remake saw much improved review scores, but ... here's this one!

Highlights for @NestorM and @blue-spirit who were both interested in this game.

USA / EUR (En,Fr,Nl) / EUR (De,Es,It) (Rev 1) / SCN (En,Sv,Da) / SCN (Sv,No,Da)Japan

  1. Code:
    Classic Controller Support [Vague Rant]
    C2440BCC 00000002
    28000001 41820008
    28000002 00000000
    C25EF7C8 00000008
    4800000D 4059999A
    BF800000 7C6802A6
    C0230000 801E0004
    70000080 40820008
    C03E05BC 801E0000
    70000020 4182000C
    C0030004 D01E05C4
    7FC3F378 00000000
    C25EF898 00000003
    28030001 41820010
    28030002 38000005
    981F0040 00000000
    C25EFB34 00000007
    C0210028 881F0028
    2C000002 40820028
    4800000D 4059999A
    BF800000 7C6802A6
    C0230004 801E0004
    70000040 41820008
    C0230000 00000000
    C25F0358 00000025
    90010024 2C040000
    4082011C 8803005C
    2C000002 40820110
    80030000 70004000
    40820104 48000021
    805D16D0 3FAAAAAB
    3C75C28F 00000000
    00000000 3DCCCCCD
    3F800000 7CA802A6
    90A1000C 5727083C
    38E7000C C003FFF8
    FC000210 C023FFFC
    FC200A10 FC00082A
    C0450014 FC001040
    4180000C 38C0012C
    48000014 7CC53AAE
    28060000 408100A0
    38C6FFFF 7CC53B2E
    38C00002 98C3005E
    81850000 7D8803A6
    4E800021 2C030001
    7FE3FB78 80A1000C
    C0450004 40820008
    EC4200B2 C0650008
    C0030020 C023FFF8
    FC211024 4800002D
    D0030020 C0030024
    C023FFFC FC200850
    48000019 D0030024
    80010024 7C0803A6
    38210020 4E800020
    FC0100FA C0250018
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 00000000
    045F12A8 7FC3F378
    045F12C8 387EFF98
    C25F12E0 00000013
    4E800421 2C160001
    40820088 4800000D
    3F000000 00000000
    7C6802A6 C0430000
    C0630004 809EFFA0
    70804000 41820064
    80BEFFA4 80DEFFA8
    C03EFF98 39000001
    48000021 C03EFF9C
    39000004 48000015
    909EFFA0 90BEFFA4
    90DEFFA8 48000034
    FC000A10 FC001040
    4D800020 FC011840
    41800008 5508083C
    7CC04039 40820008
    7CA54378 7C844378
    7CC64079 4E800020
    60000000 00000000
    C25EF214 0000001A
    2C040002 408200C0
    38800001 71000800
    41820008 60C68000
    71000001 41820008
    60C60200 71004000
    41820008 60C60100
    71000002 41820008
    60C60001 71008000
    41820008 60C60002
    71000010 41820008
    60C60800 71000040
    41820008 60C60800
    71000008 41820008
    60C60020 71000020
    41820008 60C60080
    71002000 41820008
    60C64000 71000200
    41820008 60C60040
    71000080 41820008
    60C62000 71000004
    41820008 60C60400
    71000400 41820008
    60C60010 71001000
    41820008 60C61000
    7CC73378 70C09FFF
    60000000 00000000
  2. Code:
    Classic Controller Support [Vague Rant]
    C2440BCC 00000002
    28000001 41820008
    28000002 00000000
    C25EF7F8 00000008
    4800000D 4059999A
    BF800000 7C6802A6
    C0230000 801E0004
    70000080 40820008
    C03E05BC 801E0000
    70000020 4182000C
    C0030004 D01E05C4
    7FC3F378 00000000
    C25EF8C8 00000003
    28030001 41820010
    28030002 38000005
    981F0040 00000000
    C25EFB64 00000007
    C0210028 881F0028
    2C000002 40820028
    4800000D 4059999A
    BF800000 7C6802A6
    C0230004 801E0004
    70000040 41820008
    C0230000 00000000
    C25F0388 00000025
    90010024 2C040000
    4082011C 8803005C
    2C000002 40820110
    80030000 70004000
    40820104 48000021
    805D1700 3FAAAAAB
    3C75C28F 00000000
    00000000 3DCCCCCD
    3F800000 7CA802A6
    90A1000C 5727083C
    38E7000C C003FFF8
    FC000210 C023FFFC
    FC200A10 FC00082A
    C0450014 FC001040
    4180000C 38C0012C
    48000014 7CC53AAE
    28060000 408100A0
    38C6FFFF 7CC53B2E
    38C00002 98C3005E
    81850000 7D8803A6
    4E800021 2C030001
    7FE3FB78 80A1000C
    C0450004 40820008
    EC4200B2 C0650008
    C0030020 C023FFF8
    FC211024 4800002D
    D0030020 C0030024
    C023FFFC FC200850
    48000019 D0030024
    80010024 7C0803A6
    38210020 4E800020
    FC0100FA C0250018
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 00000000
    045F12D8 7FC3F378
    045F12F8 387EFF98
    C25F1310 00000013
    4E800421 2C160001
    40820088 4800000D
    3F000000 00000000
    7C6802A6 C0430000
    C0630004 809EFFA0
    70804000 41820064
    80BEFFA4 80DEFFA8
    C03EFF98 39000001
    48000021 C03EFF9C
    39000004 48000015
    909EFFA0 90BEFFA4
    90DEFFA8 48000034
    FC000A10 FC001040
    4D800020 FC011840
    41800008 5508083C
    7CC04039 40820008
    7CA54378 7C844378
    7CC64079 4E800020
    60000000 00000000
    C25EF244 0000001A
    2C040002 408200C0
    38800001 71000800
    41820008 60C68000
    71000001 41820008
    60C60200 71004000
    41820008 60C60100
    71000002 41820008
    60C60001 71008000
    41820008 60C60002
    71000010 41820008
    60C60800 71000040
    41820008 60C60800
    71000008 41820008
    60C60020 71000020
    41820008 60C60080
    71002000 41820008
    60C64000 71000200
    41820008 60C60040
    71000080 41820008
    60C62000 71000004
    41820008 60C60400
    71000400 41820008
    60C60010 71001000
    41820008 60C61000
    7CC73378 70C09FFF
    60000000 00000000

Button Mapping​

Wii Remote & NunchukClassic ControllerFunction
Wiimote HomeHome
Works relatively normally but very slow
Open/Close Home Button Menu
Wiimote D-PadL + Right StickGameplay
Move Camera
Wiimote D-Pad Left/RightD-Pad Left/RightGameplay
Move Camera Left/Right
Wiimote AA
B
Menus
Confirm
Gameplay
Interact
Jump
Wiimote BZRMenus
Cancel
Gameplay
Paint
Wiimote 1D-Pad UpGameplay
First-Person Camera
Wiimote 2D-Pad DownGameplay
Pause
Wiimote PlusPlusMenus
View Quests
Gameplay
Select Sketch
Wiimote MinusMinusMenus
View Map
Gameplay
Use Sketch
Wiimote ShakeYGameplay
Spin Attack
Wiimote TiltXGameplay
Guardian Guidance
Wiimote IR PointerRight StickMenus
Navigation
Gameplay
Aim Paint/Thinner
Nunchuk StickLeft StickGameplay
Movement
Nunchuk CLGameplay
Re-Center Camera (press)
Lock-On (hold)
Nunchuk ZZLGameplay
Thinner
Nunchuk ShakeRGameplay
Guardian Attack

General Notes​

  • There is one motion input which I did not solve here: when you simultaneously shake both the Wii Remote and Nunchuk, Mickey fires off all three Guardians (Tint/Turp spirits) at once. You won't be able to do that move with this hack; instead, you'll have to fire off all three individually using separate Nunchuk shakes (R button). It would be nice, but it's entirely playable without it.

    • The accelerometer in the Nunchuk is probably the single part of KPAD that I understand the least. I started looking at this game about seven weeks ago. This is the closest I've gotten to understanding how the Nunchuk works, which was just barely enough to get a generic Nunchuk waggle working.

  • The total number of different inputs in this game is more than the number of buttons on a Classic Controller. Epic Mickey uses 8 buttons and four motion inputs, plus the infra-red pointer. The Classic Controller has 10 buttons and a Right Stick to cover all of that. I had to sacrifice the D-Pad to get some extra inputs, hence having L+Right Stick emulate the D-Pad.

    • Epic Mickey already has an infamously difficult camera; losing direct camera control here would not be great, so D-Pad Left/Right are intact for lateral camera movements in addition to the L+Right Stick method. However, for looking up/down, only the L+Right Stick method is available here. This can occasionally be awkward because L is also your lock-on button when near enemies. This does mean you may have trouble moving the camera up/down when enemies are nearby, but you'll usually only need to do this during platforming segments, not combat.

  • Controls here are a mix of the remake and just mapping button-for-button. As mentioned, this game has a lot of inputs and mapping everything like the remake would make things like the menus completely incomprehensible (e.g. I can't really move the Plus and Minus buttons because when the game shows a button prompt in the menu it will be completely wrong and confusing). This is also why the A (confirm/jump) button is double-mapped on both A and B, so that menu and interaction prompts which want you to press A will work normally, but you still jump with B like a normal game. The one thing to be careful of is that when a prompt wants you to press B to cancel, that's ZR.

Technical Notes​

Codes:
  • C2: bypass Nunchuk check

  • C2, C2 and C2 in read_kpad_acc(): Wiimote shakes and tilts; forcing the Nunchuk accelerometer to be "read" even when the extension controller type is Classic Controller; injecting fake Nunchuk accelerometer data before processing

    • these changes will overwrite memory where actual Classic Controller input is normally stored, so this needs to be backed up

  • C2 in calc_dpd_variable(): infra-red pointer emulation

  • 04, 04 and C2 in read_kpad_ext(): redirect left stick into Nunchuk analog stick; redirect right stick into (hopefully) free memory so it isn't erased by accelerometer; right stick D-pad emulation

  • C2 in read_kpad_button(): inject button inputs
 
Last edited by Vague Rant,
@Vague Rant FORCE Classic controller mode in UWUVCI / Teconmoons injector uses GetExtTypePatcher. Thats the tool that somehow allows Super sluggers to work with the gamepad. It patches wiivc titles to work with classic controller for more info, but thats more details 👍
It patches to the main.dol
Post automatically merged:

There is one motion input which I did not solve here: when you simultaneously shake both the Wii Remote and Nunchuk, Mickey fires off all three Guardians (Tint/Turp spirits) at once. You won't be able to do that move with this hack
Oh no! Hopefully the nunchuk accelorometer is figured out soon, that must suck
 
Last edited by awesomeee,
  • Like
Reactions: Vague Rant
I've just edited the Mario Kart Wii post to add a full remapping assembly hack as I mentioned in a previous post. This hack remaps every button to the button that it already is, i.e. it does absolutely nothing by default. You can edit this any way you like and plug it into CodeWrite to get a custom button mapping.



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.

For fixing Nunchuk errors, usually I will load the game up in Dolphin and let it run until it reaches some kind of Nunchuk error screen. Then in the Memory tab I will switch the search type to ASCII and search for the text that shows up in the Nunchuk error (e.g. "Please connect the Nunchuk to the Wii Remote" type of thing). If it is able to locate the error text, I can then set a read breakpoint (check the Read only button, then right click where the error text is located in memory and Toggle Breakpoint) on that text and find the code where the text is loaded.

From there, you want to use the Callstack in the Code tab to trace your way backward through the code trying to find where the actual Nunchuk check occurred which caused the game to display the error. I mostly do this part via trial and error, I'll go back one or two calls and set an execute breakpoint there (click in the left column of the disassembler in the Code tab) then switch to the Nunchuk in Dolphin settings and see whether that code is still running.

What you want to find is the point where different code paths are taken depending on which controller is connected. The extension types important to us are 0 (none), 1 (Nunchuk) and 2 (Classic Controller). So eventually you should reach a point where there's code which only runs if a specific value is not equal to 1. The extension check will generally look something like cmpwi rX, 0x1, but it's important to note that checking if something equals 1 is very generic code that's used all over the place, so finding a cmpwi rX, 0x1 doesn't mean you've found the Nunchuk check.

If you suspect you have found the Nunchuk check, set a breakpoint on that instruction and try letting the game run with no extension, Nunchuk and Classic Controller. If the register that gets checked matches the values I mentioned above based on which controller you have connected, you can be reasonably sure that it is checking the extension type. If that check fails (is not equal to 1), it means the current connected controller is not a Nunchuk. At that point, you can change this check to also accept Classic Controller, usually looking something like this in assembly which you can paste into CodeWrite:
Code:
  cmpwi r0, 0x1
  beq- RETURN
  cmpwi r0, 0x2

RETURN:
This isn't doing anything too complex: instead of just checking if the value is 1, this checks if it's 1, then checks if it's 2. That way, whatever behavior the game was going to run if the extension type was 1 (like skipping over running the Nunchuk error) will also run if the extension type is 2. A lot of the exact process for how the Nunchuk is checked for varies wildly from game to game, but the extension type values are part of the SDK, so they're something reliable to look for.


Ah, yeah, that one is a bit more difficult to edit. In a couple of my early hacks I was trying to optimize the button injector down to be as small as possible by checking multiple buttons at the same time. You can see me doing that in instructions like 70A42082. This is checking buttons 0x2000, 0x80 and 0x2 (2082) all at once, so the lines like that are where your problem is occurring, since the buttons are already mapped there. In later hacks I decided to stop optimizing the button checks just so they'd be easier to edit exactly for this reason. I should come back to Excite Truck to add IR pointer support anyway, since I made that one before I knew how to do that, so if you don't mind the wait I'll "modernize" the button injector when I do that, otherwise yeah, it will be a bit tougher to change the button values.



Yeah, I think it should be possible to convert crediar's existing Metafortress fixes into IPS patches which can apply to the main.dol. I don't know what the format of gameconfig.txt files is like but I think it's just a list of patches to the binary, which is essentially what an IPS is as well. I'm definitely not sure of this though, that's just roughly how I think it works.


I think the easiest way to do this would be to edit the code yourself. It's somewhat complex for this game due to the different pointer modes, so I'll put my (and crediar's, this button injector is based on crediar's work) original assembly in a spoiler below:
Code:
; 803BF784 for USA
; 803BF9EC for USA (Rev 1)
; 803BF5D4 for EUR
; 803BF83C for EUR (Rev 1)
; 803BF928 for JPN (Rev 1)
; 803C8330 for KOR (Rev 1)
  stw r0, 0x68(r31)

INJECTOR:
; held
  lwz r8, 0x60(r31)
  bl TRANSLATOR
  lwz r6, 0x0(r31)
  or r8, r8, r6
  stw r8, 0x0(r31)
; released
  not r8, r8
  lwz r6, 0x8(r31)
  and r8, r6, r8
  stw r8, 0x8(r31)
; pressed
  lwz r8, 0x64(r31)
  bl TRANSLATOR
  lwz r6, 0x4(r31)
  or r8, r8, r6
  stw r8, 0x4(r31)
; enable pointer
  andi. r6, r8, 0x40        ; enable
  beq- TOGGLE
  li r6, 0x2
  stb r6, 0x5E(r31)
  b RETURN
TOGGLE:
; toggle pointer
  andi. r6, r8, 0x80        ; toggle
  beq- RETURN
  lbz r6, 0x5E(r31)
  xori r6, r6, 0x2
  stb r6, 0x5E(r31)
  b RETURN

TRANSLATOR:
      li r7, 0x0

    BTN_HOME:
      andi. r6, r8, 0x800
      beq- BTN_UP
      ori r7, r7, 0x8000    ; Home

    BTN_UP:
      andi. r6, r8, 0x1
      beq- BTN_DOWN
      ori r7, r7, 0x8       ; up

    BTN_DOWN:
      andi. r6, r8, 0x4000
      beq- BTN_LEFT
      ori r7, r7, 0x4       ; down

    BTN_LEFT:
      andi. r6, r8, 0x2
      beq- BTN_RIGHT
      ori r7, r7, 0x1       ; left

    BTN_RIGHT:
      andi. r6, r8, 0x8000
      beq- BTN_A
      ori r7, r7, 0x2       ; right

    BTN_A:
      andi. r6, r8, 0x10
      beq- BTN_B
      ori r7, r7, 0x800     ; A

    BTN_B:
      andi. r6, r8, 0x40
      beq- BTN_X
      ori r7, r7, 0x400     ; B

    BTN_X:
      andi. r6, r8, 0x8
      beq- BTN_Y
      ori r7, r7, 0x1080    ; - and toggle pointer

    BTN_Y:
      andi. r6, r8, 0x20
      beq- BTN_L
      ori r7, r7, 0x180     ; 2 and toggle pointer

    BTN_L:
      andi. r6, r8, 0x2000
      beq- BTN_R
      ori r7, r7, 0x80      ; toggle pointer

    BTN_R:
      andi. r6, r8, 0x200
      beq- BTN_ZL
      ori r7, r7, 0x2000    ; Z

    BTN_ZL:
      andi. r6, r8, 0x80
      beq- BTN_ZR
      ori r7, r7, 0x1040    ; - and enable pointer

    BTN_ZR:
      andi. r6, r8, 0x4
      beq- BTN_PLUS
      ori r7, r7, 0x50      ; + and enable pointer
      b BTN_PLUS

    BTN_PLUS:
      andi. r6, r8, 0x400
      beq- BTN_MINUS
      ori r7, r7, 0x90      ; + and toggle pointer

    BTN_MINUS:
      andi. r6, r8, 0x1000
      beq- DONE
      ori r7, r7, 0x200     ; 1

    DONE:
      mr r8, r7
      blr

RETURN:
The ; comments at the start are the addresses to insert the code which you can paste into CodeWrite along with the assembly to get a Gecko code of the same, and from there you can adjust it however you see fit. I know it's pretty daunting to look at, but the parts you want to change are the lines that go ori r7, r7, 0xXXXX. They have comments after them like ; 1 to indicate what button that number means. Some of them are pressing multiple buttons simultaneously, like 0x90 means 0x80 (toggle pointer) plus 0x10 (the Wiimote Plus button).


Yeah, Fluidity does seem like a bit of a complicated one overall. I still haven't looked into it yet, but it's a game I really like, so definitely one I'll make an attempt at. Whether that will be fruitful, who knows; there's plenty of games I've looked into but haven't been successful in hacking, with those games falling onto kind of a spectrum from "I want to keep trying on that one" to "I'll die if I look at that game for one more second." :D


That is definitely a cool feature, but sorry, not likely to be something I can do. That would require an understanding of how each individual game handles acceleration and braking, since that's all game-specific code. Finding how it works in a one game wouldn't really help me to understand how/where vehicle movement is handled in a different game entirely. I think the case where it would be most likely to be achievable by me would be if there's games that support using the right analog stick to accelerate/brake. It would probably be possible to reconfigure the analog shoulder input to handle existing right stick accelerating/braking, and it would have to be truly analog already--unlike Mario Kart Wii where the right stick behaves like two buttons rather than the analog values being meaningful.



I'll die if I look at this game for one more second.

View attachment 468373

Epic Mickey is somehow another paint-based 3D platformer developed by a third-party which broke through Nintendo's stranglehold on the Wii. Developed exclusively for the console by Warren Spector's Junction Point Studios, Epic Mickey features the gameplay hook of an interactive world that Mickey can change at will using paint or thinner. With an RPG-influenced quest system, the player's choices also affect Mickey's appearance and skill growth. Lauded for its creative design and reimagining of Disney history, the game was also derided for its poor camera and complex controls. A recent HD remake saw much improved review scores, but ... here's this one!

Highlights for @NestorM and @blue-spirit who were both interested in this game.

USA / EUR (En,Fr,Nl) / EUR (De,Es,It) (Rev 1) / SCN (En,Sv,Da) / SCN (Sv,No,Da)Japan

  1. Code:
    Classic Controller Support [Vague Rant]
    C2440BCC 00000002
    28000001 41820008
    28000002 00000000
    C25EF7C8 00000008
    4800000D 4059999A
    BF800000 7C6802A6
    C0230000 801E0004
    70000080 40820008
    C03E05BC 801E0000
    70000020 4182000C
    C0030004 D01E05C4
    7FC3F378 00000000
    C25EF898 00000003
    28030001 41820010
    28030002 38000005
    981F0040 00000000
    C25EFB34 00000007
    C0210028 881F0028
    2C000002 40820028
    4800000D 4059999A
    BF800000 7C6802A6
    C0230004 801E0004
    70000040 41820008
    C0230000 00000000
    C25F0358 00000025
    90010024 2C040000
    4082011C 8803005C
    2C000002 40820110
    80030000 70004000
    40820104 48000021
    805D16D0 3FAAAAAB
    3C75C28F 00000000
    00000000 3DCCCCCD
    3F800000 7CA802A6
    90A1000C 5727083C
    38E7000C C003FFF8
    FC000210 C023FFFC
    FC200A10 FC00082A
    C0450014 FC001040
    4180000C 38C0012C
    48000014 7CC53AAE
    28060000 408100A0
    38C6FFFF 7CC53B2E
    38C00002 98C3005E
    81850000 7D8803A6
    4E800021 2C030001
    7FE3FB78 80A1000C
    C0450004 40820008
    EC4200B2 C0650008
    C0030020 C023FFF8
    FC211024 4800002D
    D0030020 C0030024
    C023FFFC FC200850
    48000019 D0030024
    80010024 7C0803A6
    38210020 4E800020
    FC0100FA C0250018
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 00000000
    045F12A8 7FC3F378
    045F12C8 387EFF98
    C25F12E0 00000013
    4E800421 2C160001
    40820088 4800000D
    3F000000 00000000
    7C6802A6 C0430000
    C0630004 809EFFA0
    70804000 41820064
    80BEFFA4 80DEFFA8
    C03EFF98 39000001
    48000021 C03EFF9C
    39000004 48000015
    909EFFA0 90BEFFA4
    90DEFFA8 48000034
    FC000A10 FC001040
    4D800020 FC011840
    41800008 5508083C
    7CC04039 40820008
    7CA54378 7C844378
    7CC64079 4E800020
    60000000 00000000
    C25EF214 0000001A
    2C040002 408200C0
    38800001 71000800
    41820008 60C68000
    71000001 41820008
    60C60200 71004000
    41820008 60C60100
    71000002 41820008
    60C60001 71008000
    41820008 60C60002
    71000010 41820008
    60C60800 71000040
    41820008 60C60800
    71000008 41820008
    60C60020 71000020
    41820008 60C60080
    71002000 41820008
    60C64000 71000200
    41820008 60C60040
    71000080 41820008
    60C62000 71000004
    41820008 60C60400
    71000400 41820008
    60C60010 71001000
    41820008 60C61000
    7CC73378 70C09FFF
    60000000 00000000
  2. Code:
    Classic Controller Support [Vague Rant]
    C2440BCC 00000002
    28000001 41820008
    28000002 00000000
    C25EF7F8 00000008
    4800000D 4059999A
    BF800000 7C6802A6
    C0230000 801E0004
    70000080 40820008
    C03E05BC 801E0000
    70000020 4182000C
    C0030004 D01E05C4
    7FC3F378 00000000
    C25EF8C8 00000003
    28030001 41820010
    28030002 38000005
    981F0040 00000000
    C25EFB64 00000007
    C0210028 881F0028
    2C000002 40820028
    4800000D 4059999A
    BF800000 7C6802A6
    C0230004 801E0004
    70000040 41820008
    C0230000 00000000
    C25F0388 00000025
    90010024 2C040000
    4082011C 8803005C
    2C000002 40820110
    80030000 70004000
    40820104 48000021
    805D1700 3FAAAAAB
    3C75C28F 00000000
    00000000 3DCCCCCD
    3F800000 7CA802A6
    90A1000C 5727083C
    38E7000C C003FFF8
    FC000210 C023FFFC
    FC200A10 FC00082A
    C0450014 FC001040
    4180000C 38C0012C
    48000014 7CC53AAE
    28060000 408100A0
    38C6FFFF 7CC53B2E
    38C00002 98C3005E
    81850000 7D8803A6
    4E800021 2C030001
    7FE3FB78 80A1000C
    C0450004 40820008
    EC4200B2 C0650008
    C0030020 C023FFF8
    FC211024 4800002D
    D0030020 C0030024
    C023FFFC FC200850
    48000019 D0030024
    80010024 7C0803A6
    38210020 4E800020
    FC0100FA C0250018
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 00000000
    045F12D8 7FC3F378
    045F12F8 387EFF98
    C25F1310 00000013
    4E800421 2C160001
    40820088 4800000D
    3F000000 00000000
    7C6802A6 C0430000
    C0630004 809EFFA0
    70804000 41820064
    80BEFFA4 80DEFFA8
    C03EFF98 39000001
    48000021 C03EFF9C
    39000004 48000015
    909EFFA0 90BEFFA4
    90DEFFA8 48000034
    FC000A10 FC001040
    4D800020 FC011840
    41800008 5508083C
    7CC04039 40820008
    7CA54378 7C844378
    7CC64079 4E800020
    60000000 00000000
    C25EF244 0000001A
    2C040002 408200C0
    38800001 71000800
    41820008 60C68000
    71000001 41820008
    60C60200 71004000
    41820008 60C60100
    71000002 41820008
    60C60001 71008000
    41820008 60C60002
    71000010 41820008
    60C60800 71000040
    41820008 60C60800
    71000008 41820008
    60C60020 71000020
    41820008 60C60080
    71002000 41820008
    60C64000 71000200
    41820008 60C60040
    71000080 41820008
    60C62000 71000004
    41820008 60C60400
    71000400 41820008
    60C60010 71001000
    41820008 60C61000
    7CC73378 70C09FFF
    60000000 00000000

Button Mapping​

Wii Remote & NunchukClassic ControllerFunction
Wiimote HomeHome
Works relatively normally but very slow
Open/Close Home Button Menu
Wiimote D-PadL + Right StickGameplay
Move Camera
Wiimote D-Pad Left/RightD-Pad Left/RightGameplay
Move Camera Left/Right
Wiimote AA
B
Menus
Confirm
Gameplay
Interact
Jump
Wiimote BZRMenus
Cancel
Gameplay
Paint
Wiimote 1D-Pad UpGameplay
First-Person Camera
Wiimote 2D-Pad DownGameplay
Pause
Wiimote PlusPlusMenus
View Quests
Gameplay
Select Sketch
Wiimote MinusMinusMenus
View Map
Gameplay
Use Sketch
Wiimote ShakeYGameplay
Spin Attack
Wiimote TiltXGameplay
Guardian Guidance
Wiimote IR PointerRight StickMenus
Navigation
Gameplay
Aim Paint/Thinner
Nunchuk StickLeft StickGameplay
Movement
Nunchuk CLGameplay
Re-Center Camera (press)
Lock-On (hold)
Nunchuk ZZLGameplay
Thinner
Nunchuk ShakeRGameplay
Guardian Attack

General Notes​

  • There is one motion input which I did not solve here: when you simultaneously shake both the Wii Remote and Nunchuk, Mickey fires off all three Guardians (Tint/Turp spirits) at once. You won't be able to do that move with this hack; instead, you'll have to fire off all three individually using separate Nunchuk shakes (R button). It would be nice, but it's entirely playable without it.

    • The accelerometer in the Nunchuk is probably the single part of KPAD that I understand the least. I started looking at this game about seven weeks ago. This is the closest I've gotten to understanding how the Nunchuk works, which was just barely enough to get a generic Nunchuk waggle working.

  • The total number of different inputs in this game is more than the number of buttons on a Classic Controller. Epic Mickey uses 8 buttons and four motion inputs, plus the infra-red pointer. The Classic Controller has 10 buttons and a Right Stick to cover all of that. I had to sacrifice the D-Pad to get some extra inputs, hence having L+Right Stick emulate the D-Pad.

    • Epic Mickey already has an infamously difficult camera; losing direct camera control here would not be great, so D-Pad Left/Right are intact for lateral camera movements in addition to the L+Right Stick method. However, for looking up/down, only the L+Right Stick method is available here. This can occasionally be awkward because L is also your lock-on button when near enemies. This does mean you may have trouble moving the camera up/down when enemies are nearby, but you'll usually only need to do this during platforming segments, not combat.

  • Controls here are a mix of the remake and just mapping button-for-button. As mentioned, this game has a lot of inputs and mapping everything like the remake would make things like the menus completely incomprehensible (e.g. I can't really move the Plus and Minus buttons because when the game shows a button prompt in the menu it will be completely wrong and confusing). This is also why the A (confirm/jump) button is double-mapped on both A and B, so that menu and interaction prompts which want you to press A will work normally, but you still jump with B like a normal game. The one thing to be careful of is that when a prompt wants you to press B to cancel, that's ZR.

Technical Notes​

Codes:
  • C2: bypass Nunchuk check

  • C2, C2 and C2 in read_kpad_acc(): Wiimote shakes and tilts; forcing the Nunchuk accelerometer to be "read" even when the extension controller type is Classic Controller; injecting fake Nunchuk accelerometer data before processing

    • these changes will overwrite memory where actual Classic Controller input is normally stored, so this needs to be backed up

  • C2 in calc_dpd_variable(): infra-red pointer emulation

  • 04, 04 and C2 in read_kpad_ext(): redirect left stick into Nunchuk analog stick; redirect right stick into (hopefully) free memory so it isn't erased by accelerometer; right stick D-pad emulation

  • C2 in read_kpad_button(): inject button inputs
Unbelievable job. Thank you.
 
  • Like
Reactions: Vague Rant
70A42082. This is checking buttons 0x2000, 0x80 and 0x2 (2082) all at once, so the lines like that are where your problem is occurring
Thanks. That was the clue. I changed 2082 to 2002 and the Turbo action was gone from ZL. The only downside now is that I have the back button on ZL in the menu instead of B, but that's just a little thing to keep in mind. 🙏
 
  • Like
Reactions: Vague Rant
Hi guys. I have a tip for people who have injected little king's story on Wii u.
When you press home button or when you lose Wii u signal, you can't reconnecting gamepad.
All you gotta do is download wiiscrubber, extract the main.dol of your iso, open it in HxD, search 4BFFE7E1 line on hexadecimal research tool, and replace it with 60000000. Then replace the original main.dol with this modified main.dol and inject your new modified iso.
You'll still need to shutdown Wii u for leaving the game but this tip avoid the gamepad reconnection issue.
Found this tip on wiivc injector compatibility list (issue related for nascar kart racing).
So i managed to apply this method for little king's story, and it works !
 
Hi guys. I have a tip for people who have injected little king's story on Wii u.
When you press home button or when you lose Wii u signal, you can't reconnecting gamepad.
All you gotta do is download wiiscrubber, extract the main.dol of your iso, open it in HxD, search 4BFFE7E1 line on hexadecimal research tool, and replace it with 60000000. Then replace the original main.dol with this modified main.dol and inject your new modified iso.
You'll still need to shutdown Wii u for leaving the game but this tip avoid the gamepad reconnection issue.
Found this tip on wiivc injector compatibility list (issue related for nascar kart racing).
So i managed to apply this method for little king's story, and it works !
Have you tried the deflicker filter option as well? I would love to play this game on the wii u gamepad, but it's just too much blur for my eyes. Maybe it's possible to integrate the deactivated deflicker to the main.dol just like in super mario galaxy.
@Vague Rant do you know if the deflicker code of super mario galaxy will also work on little king's story?
 

Site & Scene News

Popular threads in this forum