Hacking New Classic Controller Hacks

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
Many Wii games required the use of the Wiimote (or Nunchuk), while not including support for the other major Wii input device, the Classic Controller. Some games benefited from these specialized controls, while others didn't. Listed below are several Classic Controller hacks for games that seemed like they could benefit from some more flexibility in their controller options. I don't claim that all of these are improvements over their official control schemes, as the sensitivity of accelerometer input and immediacy of infra-red cannot always be replicated well on a traditional controller.


SI_Wii_LittleKingsStory.jpg

Little King's Story is a cult hit RTS/city builder/life sim/RPG from the creator of Harvest Moon/Story of Seasons, Yasuhiro Wada. It was originally released on the Wii, is currently available on Steam and briefly had a reimagined PS Vita release, which has since been delisted. In the game, you play as a child (canonically named Corobo, but chosen by the player) who comes to rule over a tiny kingdom. Tasked with expanding your empire, the moment-to-moment gameplay is somewhat reminiscent of Pikmin, with Corobo being almost powerless on his own and "Charging" recruits at different tasks (tossing them at the target like Olimar). The Wii release has no motion or pointer controls whatsoever, but can only be played with the Wii Remote and Nunchuk. This made it a good candidate for a Classic Controller hack, which you can find in the spoiler below.

USAEuropeJapan

  1. Code:
    Classic Controller Support [Vague Rant, crediar]
    04060E74 60000000
    04078FA4 28000002
    04079550 28000002
    04079558 C0230178
    04079580 28000002
    04079588 C023017C
    C242A1B4 00000029
    7C0802A6 80BF0060
    48000041 809F0000
    7CA52378 90BF0000
    80BF0064 4800002D
    809F0004 7CA52378
    90BF0004 80BF0068
    48000019 809F0008
    7CA52378 90BF0008
    7C0803A6 4E800020
    38C00000 70A40800
    2C040000 41820008
    60C68000 70A40001
    2C040000 41820008
    60C60008 70A44000
    2C040000 41820008
    60C60004 70A40002
    2C040000 41820008
    60C60001 70A48000
    2C040000 41820008
    60C60002 70A40010
    2C040000 41820008
    60C60800 70A40040
    2C040000 41820008
    60C60400 70A40008
    2C040000 41820008
    60C60004 70A40020
    2C040000 41820008
    60C64000 70A42000
    2C040000 41820008
    60C60001 70A40200
    2C040000 41820008
    60C60002 70A40080
    2C040000 41820008
    60C62000 70A40004
    2C040000 41820008
    60C60008 70A40400
    2C040000 41820008
    60C60010 70A41000
    2C040000 41820008
    60C60300 7CC53378
    4E800020 00000000
  2. Code:
    Classic Controller Support [Vague Rant, crediar]
    04060B3C 60000000
    0407837C 28000002
    04078928 28000002
    04078930 C0230178
    04078958 28000002
    04078960 C023017C
    C2428858 00000029
    7C0802A6 80BF0060
    48000041 809F0000
    7CA52378 90BF0000
    80BF0064 4800002D
    809F0004 7CA52378
    90BF0004 80BF0068
    48000019 809F0008
    7CA52378 90BF0008
    7C0803A6 4E800020
    38C00000 70A40800
    2C040000 41820008
    60C68000 70A40001
    2C040000 41820008
    60C60008 70A44000
    2C040000 41820008
    60C60004 70A40002
    2C040000 41820008
    60C60001 70A48000
    2C040000 41820008
    60C60002 70A40010
    2C040000 41820008
    60C60800 70A40040
    2C040000 41820008
    60C60400 70A40008
    2C040000 41820008
    60C60004 70A40020
    2C040000 41820008
    60C64000 70A42000
    2C040000 41820008
    60C60001 70A40200
    2C040000 41820008
    60C60002 70A40080
    2C040000 41820008
    60C62000 70A40004
    2C040000 41820008
    60C60008 70A40400
    2C040000 41820008
    60C60010 70A41000
    2C040000 41820008
    60C60300 7CC53378
    4E800020 00000000
  3. Code:
    Classic Controller Support [Vague Rant, crediar]
    04060CB0 60000000
    04078F98 28000002
    04079544 28000002
    0407954C C0230178
    04079574 28000002
    0407957C C023017C
    C2429B74 00000029
    7C0802A6 80BF0060
    48000041 809F0000
    7CA52378 90BF0000
    80BF0064 4800002D
    809F0004 7CA52378
    90BF0004 80BF0068
    48000019 809F0008
    7CA52378 90BF0008
    7C0803A6 4E800020
    38C00000 70A40800
    2C040000 41820008
    60C68000 70A40001
    2C040000 41820008
    60C60008 70A44000
    2C040000 41820008
    60C60004 70A40002
    2C040000 41820008
    60C60001 70A48000
    2C040000 41820008
    60C60002 70A40010
    2C040000 41820008
    60C60800 70A40040
    2C040000 41820008
    60C60400 70A40008
    2C040000 41820008
    60C60004 70A40020
    2C040000 41820008
    60C64000 70A42000
    2C040000 41820008
    60C60001 70A40200
    2C040000 41820008
    60C60002 70A40080
    2C040000 41820008
    60C62000 70A40004
    2C040000 41820008
    60C60008 70A40400
    2C040000 41820008
    60C60010 70A41000
    2C040000 41820008
    60C60300 7CC53378
    4E800020 00000000

Button (Re-)Mapping​

The button mapping used here is a combination of common sense, the Steam version button layout and advice from Deadweight in the Little King's Story community. That said, the code is relatively easy to customize if you want to use a different layout. First off, here's our layout as set up in the above codes:

Wii Remote/NunchukClassic ControllerGame Function
HomeHome
Classic Controller analog stick is not supported in the Home Button Menu, you will need to use a Wii Remote to quit
Open/Close Home Button Menu
D-Pad UpD-Pad Up
ZR
Change Formation
D-Pad DownD-Pad Down
X
Change Rank (party order, i.e. selected job type)
D-Pad Left/RightD-Pad Left/Right
L/R
Camera Rotation
Wiimote AAConfirm/Action/Charge
Wiimote BBCancel
Recruit (town)
Call Back (field)
Nunchuk CYZoom Camera (town)
Scepter Attack (field)
Nunchuk ZZLTarget
Plus/MinusPlusOpen/Close Field Menu
Wiimote 1
Wiimote 2
MinusDismiss Party (town)
Return to Castle (field)

If you prefer the D-Pad, you can use that to access its original functions (and to navigate menus), but its functions have all been mirrored to the face and shoulder buttons, which is closer to how the original control scheme has you mostly using the action buttons with your right hand. The most contentious change is that the Nunchuk C button has moved to the Y face button. This is how Corobo attacks and feels better with the other action buttons than it does up on the Nunchuk-equivalent L-button. Realistically, the original devs put it on C because that's the only other button you really have access to in the Wiimote and Nunchuk layout. The base game already does a lot of re-using buttons for different functions depending on whether you're in town or the field, and this hack added one more with the Wiimote 1/2 Dismiss (town)/Return (field) buttons being combined into Classic Controller Minus. It feels pretty intuitive combining these since they're both cancel/quit type inputs which are out of the way so you don't accidentally press them.

If you want to change any of these mappings, you'll need to edit the end section of the code. Here it is again with labels for the buttons from the above scheme:
Code:
   |  Wii Output |     xxxx     xxxx | Classic Input
------------------------------------------------------
 1 |             |          70A40800 | Home
 2 |             | 2C040000 41820008 |
 3 |        Home | 60C68000 70A40001 | D-Pad Up
 4 |             | 2C040000 41820008 |
 5 |    D-Pad Up | 60C60008 70A44000 | D-Pad Down
 6 |             | 2C040000 41820008 |
 7 |  D-Pad Down | 60C60004 70A40002 | D-Pad Left
 8 |             | 2C040000 41820008 |
 9 |  D-Pad Left | 60C60001 70A48000 | D-Pad Right
10 |             | 2C040000 41820008 |
11 | D-Pad Right | 60C60002 70A40010 | A
12 |             | 2C040000 41820008 |
13 |           A | 60C60800 70A40040 | B
14 |             | 2C040000 41820008 |
15 |           B | 60C60400 70A40008 | X
16 |             | 2C040000 41820008 |
17 |  D-Pad Down | 60C60004 70A40020 | Y
18 |             | 2C040000 41820008 |
19 |           C | 60C64000 70A42000 | L
20 |             | 2C040000 41820008 |
21 |  D-Pad Left | 60C60001 70A40200 | R
22 |             | 2C040000 41820008 |
23 | D-Pad Right | 60C60002 70A40080 | ZL
24 |             | 2C040000 41820008 |
25 |           Z | 60C62000 70A40004 | ZR
26 |             | 2C040000 41820008 |
27 |    D-Pad Up | 60C60008 70A40400 | Plus
28 |             | 2C040000 41820008 |
29 |        Plus | 60C60010 70A41000 | Minus
30 |             | 2C040000 41820008 |
31 |         1+2 | 60C60300 00000000 |

I know it's a bit lopsided and confusing to look at, but each button value on the right side triggers the next button down on the left side. Just look at the first mapping, where Classic Controller 0800 Home on line 1 (right) triggers Wiimote 8000 Home on line 3 (left), to get a feel for how it works. Personally, I'd suggest changing the left column if you want to customize this layout, keeping the Classic Controller inputs in their default order. Otherwise, it gets confusing really fast.

Each button is a four digit value. Here's a table of the button values you can substitute in to customize your mapping.
Wii Remote/NunchukClassic Controller
0001 D-Pad Left
0002 D-Pad Right
0004 D-Pad Down
0008 D-Pad Up
0010 +
0020 // no button
0040 // no button
0080 // no button
0100 2
0200 1
0400 B
0800 A
1000 -
2000 Z
4000 C
8000 Home
0001 D-Pad Up
0002 D-Pad Left
0004 ZR
0008 X
0010 A
0020 Y
0040 B
0080 ZL
0100 // no button
0200 R
0400 +
0800 // no button
1000 -
2000 L
4000 D-Pad Down
8000 D-Pad Right

General Notes​

Just stuff you might want to know about the hack and underlying game.
  • this is specifically a hack of the way Little King's Story handles Nunchuk inputs; it can't really be generalized to other games (barring perhaps other games on the same engine, assuming they exist)
  • this code breaks the original Nunchuk input; turn off the code if you want to go back to playing with the original controls
  • sorry, I don't have the slightest idea how to map camera rotation to the right stick
  • has also been tested and works on Wii U as a Wii VC injection with Classic Controller emulation, for semi-portable play
  • if you have the choice, you should probably play the USA or Japan versions, which came out after the European game and include extra content and 60 Hz support
  • fans regard the Steam and Vita versions as inferior to the original Wii release

Technical Notes​

Slightly nerdier stuff. The code is basically made up of 4 main parts. The first three are King-specific while the last can basically be ported to other games as long as you can figure out the rest yourself.
  • the first line patches out the code which determines that the Classic Controller is not an acceptable extension
  • the second line tells the game that it should accept Nunchuk button values when they're "pressed" by a Classic Controller (extension type 2)
  • the next four lines again tell the game to use extension 2 and force it to read the Classic Controller left analog offset instead of the Nunchuk when reading the joystick X/Y values
  • the remainder is crediar's original button remapping hack which injects into the SDK read_kpad_acc() function; it reads the CC button values then translates and injects them into the Wiimote/Nunchuk button field

Credits​

  • DeadweightLKS, the world's #1 Little King's Story expert, for advising on the ideal button layout
  • crediar: creating the original Classic Controller hacks for sideways Wii Remote games, in particular Kirby's Return to Dream Land
  • Vague Rant: hacking Nunchuk inputs (C, Z and the analog stick) and disabling "wrong extension" error
 
Last edited by Vague Rant,

NestorM

Well-Known Member
Newcomer
Joined
Feb 19, 2021
Messages
82
Trophies
0
Age
39
XP
1,005
Country
France
Great job, thank you.
Is this possible to make this kind of hack for metroid other m ? I'm waiting this for years. It would be absolutely amazing.
Post automatically merged:

Great job, thank you.
Is this possible to make this kind of hack for metroid other m ? I'm waiting this for years. It would be absolutely amazing.
Another question. Can you convert this gecko codes to riivolution for patching iso and injecting on wii u with gamepad controls ? Thanks.
 
  • Like
Reactions: Vague Rant

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
Great job, thank you.
Is this possible to make this kind of hack for metroid other m ? I'm waiting this for years. It would be absolutely amazing.

Definitely possible, but would require somebody with a deeper knowledge of controller hacking than I have personally. Because that game uses motion and pointer controls, somebody would have to first understand how those parts work and also how to simulate them in order to somehow replace that behavior with button inputs. Little King's Story was fortunate in that there's zero motion/pointer input in the game, so everything the controllers can do exists on the Classic Controller and can be copied across.

Another question. Can you convert this gecko codes to riivolution for patching iso and injecting on wii u with gamepad controls ? Thanks.

I don't really know much/anything about how Riivolution works, but you can also patch Gecko codes into a Wii game to inject as Wii U VC. First off, you'd want to generate a .gct file for the code of your region. You can do that at this web page by pasting in the code, giving it a name, hitting "Add Code", putting whatever you want in the game ID field (does not actually need to be the Game ID), e.g. "lks-hack", then hitting "Download GCT".

Then to apply that GCT file to Little King's Story, you'd want to use something like Wiimms ISO Tool and Wiimms SZS Tool (download and install both). Putting that GCT file with your Little King's Story disc image, you'd then open that folder in the command line/terminal prompt and do this:
Code:
wit x --psel DATA "Little King's Story (USA) (En,Fr,Es).iso" lks-classic
wstrt patch lks-classic\sys\main.dol --add-section lks-hack.gct
wit copy lks-classic lks-classic.iso
And then you'd inject that lks-classic.iso with your usual injection software.
 

NestorM

Well-Known Member
Newcomer
Joined
Feb 19, 2021
Messages
82
Trophies
0
Age
39
XP
1,005
Country
France
Definitely possible, but would require somebody with a deeper knowledge of controller hacking than I have personally. Because that game uses motion and pointer controls, somebody would have to first understand how those parts work and also how to simulate them in order to somehow replace that behavior with button inputs. Little King's Story was fortunate in that there's zero motion/pointer input in the game, so everything the controllers can do exists on the Classic Controller and can be copied across.



I don't really know much/anything about how Riivolution works, but you can also patch Gecko codes into a Wii game to inject as Wii U VC. First off, you'd want to generate a .gct file for the code of your region. You can do that at this web page by pasting in the code, giving it a name, hitting "Add Code", putting whatever you want in the game ID field (does not actually need to be the Game ID), e.g. "lks-hack", then hitting "Download GCT".

Then to apply that GCT file to Little King's Story, you'd want to use something like Wiimms ISO Tool and Wiimms SZS Tool (download and install both). Putting that GCT file with your Little King's Story disc image, you'd then open that folder in the command line/terminal prompt and do this:
Code:
wit x --psel DATA "Little King's Story (USA) (En,Fr,Es).iso" lks-classic
wstrt patch lks-classic\sys\main.dol --add-section lks-hack.gct
wit copy lks-classic lks-classic.iso
And then you'd inject that lks-classic.iso with your usual injection software.
OK thank you !
 

KelSolaar

Well-Known Member
Member
Joined
May 19, 2023
Messages
207
Trophies
0
Age
41
XP
618
Country
Sweden
Great job, thank you.
Is this possible to make this kind of hack for metroid other m ? I'm waiting this for years. It would be absolutely amazing.
Post automatically merged:

Hah! I came to this forum to ask this very question. I just fired up Other M and man is the control scheme in this game fucked up.
 

Maeson

Well-Known Member
Member
Joined
Apr 3, 2013
Messages
1,253
Trophies
2
XP
3,664
Country
Spain
Man, I remember playing this quite a lot back then, I found it enjoyable all around but I specially remember the soundtrack. Thank you for the code, I need to find time to replay it with this code sometime.


...Well, another thing I can't forget is Sishkebaboo's introduction. It's amazing.

How much I wish the sequel they wanted to make ended up being real. Instead we got a weeb-ized reimagination on PS Vita and a horrible PC port (that got butched TWICE).
 
  • Like
Reactions: Vague Rant

CheeseBurgerwithLove

Well-Known Member
Member
Joined
Jul 3, 2023
Messages
125
Trophies
1
Age
25
XP
535
Country
United States
Is there any possibility to make a "homemade" patch or ocarina code to fix the bug in tyrant mode?

For those who doesn't know, this is a bug in the NTSC versions that prevents you from obtaining certain items in that mode, although it is possible to avoid it.
 

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
Is there any possibility to make a "homemade" patch or ocarina code to fix the bug in tyrant mode?

For those who doesn't know, this is a bug in the NTSC versions that prevents you from obtaining certain items in that mode, although it is possible to avoid it.

That would definitely be amazing. The challenging part is finding where the hell that bug is in the code. There's sort of a few things that make locating stuff easier and that bug doesn't really have any of them.

For a quick breakdown, the first and most helpful thing is if the developers accidentally leave an unstripped binary/map file on the disc. This tells you the names of all the functions and often variables as well, which is obviously a huge help when trying to find what code does what. Unfortunately, this isn't the case for Little King's Story, so you're just left guessing what any given piece of code does, since it's all just reading and writing a bunch of numbers to different numbers.

The next helpful thing is if the code you're looking for is heavily integrated with Nintendo library functions. The controls are actually a really good example of this: Nintendo's KPAD and WPAD libraries for talking to Wii Remotes and accessories are basically the same across every Wii game, so even if you don't have function/variable names for a game, you can use a different game where you do have symbols as a kind of roadmap. Weird tip: I used the demo disc for Madagascar 2 to help me navigate the Nintendo libraries in LKS, because they left an unstripped ELF binary on that disc.

While that doesn't give you any direct understanding of how the game uses those libraries, you can at least tell things like "Well, this function calls KPADRead() here, so clearly I'm looking at code that's related to Wii Remotes and/or accessories." From there you can sort of start to figure out what the game is doing with the info it gets back from the KPAD/WPAD libraries, e.g. does it behave differently when WPADProbe() responds with 2 (Classic Controller) instead of 1 (Nunchuk)? And now you're Classic Controller hacking.

Unfortunately, an in-game bug generally has nothing to do with the system libraries, so it's probably somewhere "far away" from the code which is broadly recognizable and understandable. Probably the best way to find something like that would be to track down where the values for which things you've already obtained are by saving right before you obtain them and right after to see what's changed. If that was successful, you'd then try to find whether there's other code that writes to that same location and try to identify which one of those writes is the culprit. Not impossible, but basically requires you to understand this specific game a lot more than I do personally.



Anyway, while we're here ...

SI_Wii_DisneyUniverse.jpg


Disney Universe exists. It is a game which can be played. Nobody ever has, but the option is there. It's a pretty direct clone of the gameplay of the Lego franchise, developed by Eurocom (Crash Bandicoot: Wrath of Cortex, Sphinx and the Cursed Mummy, G-Force). It got a pretty harsh reception but it's all right. You run around little Disney franchise dioramas smashing stuff and solving basic environmental puzzles with up to four players. You can play with a sideways Wiimote or Wiimote and Nunchuk together. With the below hack, you can also play with a Classic Controller.

USAEurope

  1. Code:
    Classic Controller Support [Vague Rant, crediar]
    C238E88C 00000003
    80A1001C 2C050002
    40820008 38A00001
    60000000 00000000
    C238E8BC 00000003
    80A1001C 2C050002
    40820008 38A00001
    60000000 00000000
    0475E1AC 80030078
    0475E1C8 90030078
    0475E1D4 9003007C
    0475E1DC 90030080
    047601C0 387E0000
    047601E0 387E0008
    C275EB04 00000029
    7C0802A6 80B50078
    48000041 80950000
    7CA52378 90B50000
    80B5007C 4800002D
    80950004 7CA52378
    90B50004 80B50080
    48000019 80950008
    7CA52378 90B50008
    7C0803A6 4E800020
    38C00000 70A40800
    2C040000 41820008
    60C68000 70A40001
    2C040000 41820008
    60C60008 70A44000
    2C040000 41820008
    60C60004 70A40002
    2C040000 41820008
    60C60001 70A48000
    2C040000 41820008
    60C60002 70A40010
    2C040000 41820008
    60C60800 70A40040
    2C040000 41820008
    60C60400 70A40008
    2C040000 41820008
    60C60100 70A40020
    2C040000 41820008
    60C60200 70A42000
    2C040000 41820008
    60C60001 70A40200
    2C040000 41820008
    60C60002 70A40080
    2C040000 41820008
    60C62000 70A40004
    2C040000 41820008
    60C62000 70A40400
    2C040000 41820008
    60C60010 70A41000
    2C040000 41820008
    60C61000 7CC53378
    4E800020 00000000
  2. Code:
    Classic Controller Support [Vague Rant, crediar]
    C238ECCC 00000003
    80A1001C 2C050002
    40820008 38A00001
    60000000 00000000
    C238ECFC 00000003
    80A1001C 2C050002
    40820008 38A00001
    60000000 00000000
    0475E5EC 80030078
    0475E608 90030078
    0475E614 9003007C
    0475E61C 90030080
    04760600 387E0000
    04760620 387E0008
    C275EF44 00000029
    7C0802A6 80B50078
    48000041 80950000
    7CA52378 90B50000
    80B5007C 4800002D
    80950004 7CA52378
    90B50004 80B50080
    48000019 80950008
    7CA52378 90B50008
    7C0803A6 4E800020
    38C00000 70A40800
    2C040000 41820008
    60C68000 70A40001
    2C040000 41820008
    60C60008 70A44000
    2C040000 41820008
    60C60004 70A40002
    2C040000 41820008
    60C60001 70A48000
    2C040000 41820008
    60C60002 70A40010
    2C040000 41820008
    60C60800 70A40040
    2C040000 41820008
    60C60400 70A40008
    2C040000 41820008
    60C60100 70A40020
    2C040000 41820008
    60C60200 70A42000
    2C040000 41820008
    60C60001 70A40200
    2C040000 41820008
    60C60002 70A40080
    2C040000 41820008
    60C62000 70A40004
    2C040000 41820008
    60C62000 70A40400
    2C040000 41820008
    60C60010 70A41000
    2C040000 41820008
    60C61000 7CC53378
    4E800020 00000000

Button Mapping​

Wii Remote/NunchukClassic ControllerGame Function
HomeHome
Classic Controller is not supported in the Home Button Menu, you will need to use a Wii Remote to quit
Open/Close Home Button Menu
D-PadD-PadMenu Selections
Manual says "Emote"?
Wiimote AAConfirm/Jump
Wiimote BBCancel/Attack
Nunchuk CNot used
Nunchuk ZZL/ZRGrab/Interact/Counter-Attack
PlusPlusOpen/Close Pause Menu
MinusMinusCheck Current Objective
Wiimote 1YNot used
Wiimote 2XConfirm character selection (why???)

General Notes​

Why?
I tried this game once like ten years ago and somehow came away with the memory that it had Classic Controller support. I went to try it again the other day and obviously it doesn't. I decided the game should conform to my faulty memory instead of the other way around.​

Really?
Sort of. It also had other unique traits. The game has no "Please remove unsupported extension"-type error screen or anything, it just lets you plug in a Classic Controller if you want, even though it doesn't do anything. Honestly, a decent chunk of the process is just trying to figure out what triggers that error message, so a game not having one shortens it a bit.

The other part that was interesting is that this is a 4-player game. Breaking Nunchuk support is fine in a single-player game, that single player can either use or not use the code depending on whether they want to use a Nunchuk. But with a game like this, maybe you don't have four Classic Controllers, or maybe some players just prefer the Nunchuk controls, etc. It was fun to find a method that preserved the original Wiimote/Nunchuk controls while adding Classic Controller as an additional option.​

Should I play this game?
In theory, you could.​

Technical Notes​

This one is slightly more generalized than the Little King's Story one. More of the patches are in Nintendo libraries than in the Little King's Story hack, so those fixes can in theory be reused in other games if I or anybody else tries to Classic Controller hack something.

The first 8 lines are the only part which is patching game code rather than Nintendo libraries. These patches take extension type checks and force them to return 1 (Nunchuk) if they would otherwise return 2 (Classic Controller). This way, the game uses the Nunchuk control scheme (with analog stick support rather than sideways Wiimote's D-Pad) when a Classic Controller is connected. Eurocom made a bunch of Wii games with this engine (EngineXT), so these changes may be relevant to other Eurocom games.

The next four lines are altering the read_kpad_button() function to move the button values by +0x18. This is because the Classic Controller puts its button values in the same place where the Nunchuk puts its analog stick data, since the Wii doesn't expect you to ever be using "both" in one controller at the same time, which is sort of what we're doing here. Moving them up a bit gets them out of the way so the Nunchuk and Classic Controller aren't competing.

The next two lines are in read_kpad_ext() and drop the Classic Controller analog stick values into the Nunchuk analog stick field instead of their own.

Lastly is crediar's button injection hack, in read_kpad_acc(), modified slightly because we moved the controls up by 0x18 bytes earlier, so the injector needs to know about that to look in the right place for button values.

Credits​

  • Thomas83Lin: while I didn't actually use any of their code, Thomas's Rune Factory: Tides of Destiny hack was a big inspiration here in terms of moving the buttons around to "make room"
  • crediar: the button injector, of course
  • Vague Rant: bypassing Nunchuk checks, injecting CC analog into Nunchuk field, rearranging button addresses
 
Last edited by Vague Rant,
  • Like
Reactions: lordelan and Maeson

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
'Bout that time, eh chaps?

museum-crop.jpg


Righto.

Namco Museum Megamix is a collection of remixed and original Namco arcade games which, without exaggeration, has possibly the worst control scheme on the console, and maybe on any console. Now, you might be saying, "Doesn't Namco Museum Megamix already support the Classic Controller?" And the answer is yes ... in the classic arcade games. Not in the modern remixes and much worse, not in the menus. The menus and modern games require that a Nunchuk is used. This means if you just want to play Pac-Man with a Classic Controller, you need to insert a Nunchuk first, navigate to the Carnival Arcade and to the Pac-Man cabinet inside, then press A on the Wii Remote. Now, you unplug the Nunchuk from the Wii Remote, insert the Classic Controller and play. Once you're done, you can quit the game using the Classic Controller, but now you're back in the Carnival Arcade and need to attach the Nunchuk again if you want to move over to play some Dig Dug.

This game makes no sense. What's worse is that this Megamix version is an enhanced re-release of the previous Namco Museum Remix from three years earlier which had exactly the same problem, for which it was critically savaged the first time around. But don't fix it or anything, Namco. :blink:

USA

  1. Code:
    Classic Controller Support [Vague Rant, crediar]
    C2140E34 00000002
    C003006C D01C0080
    C0030070 00000000
    04140E38 D01C0084
    C214104C 00000004
    2C000002 40820010
    C023006C C0030070
    D0210018 D001001C
    80A10030 00000000
    C2166130 00000005
    41810024 801F0004
    70008000 40820018
    3C008016 60006354
    7C0803A6 4E800020
    60000000 00000000
    C2198940 00000005
    40820024 801F0004
    70008000 40820018
    3C008019 6000894C
    7C0803A6 4E800020
    60000000 00000000
    C21B5590 00000005
    800D03E4 70008000
    41820018 3C00801B
    600055D4 7C0803A6
    4E800020 60000000
    C03C0004 00000000
    C21F2668 00000005
    41810024 801EFF74
    70008000 40820018
    3C00801F 60002670
    7C0803A6 4E800020
    60000000 00000000
    C209DFA4 00000022
    8804011C 2C000002
    40820048 7C0802A6
    80C40120 48000041
    80A40000 7CC62B78
    90C40000 80C40124
    4800002D 80A40004
    7CC62B78 90C40004
    80C40128 48000019
    80A40008 7CC62B78
    90C40008 7C0803A6
    4E800020 38E00000
    70C50001 41820008
    60E70001 70C54000
    41820008 60E70002
    70C50002 41820008
    60E70004 70C58000
    41820008 60E70008
    70C50010 41820008
    60E70020 70C50040
    41820008 60E70080
    70C50008 41820008
    60E78000 70C50020
    41820008 60E70010
    70C52000 41820008
    60E71000 70C50200
    41820008 60E71000
    70C50080 41820008
    60E70800 70C50004
    41820008 60E70040
    70C50400 41820008
    60E70100 70C51000
    41820008 60E70100
    7CE63B78 4E800020
    60000000 00000000

Button Mapping​

The following describes the Classic Controller support which has been added to the modern games/menu. The classic arcade games have their normal Classic Controller layouts. I will add, this game just controls really weird. Take my word for it that this button layout is not as wrong as it looks, or change it if you don't like it.

Wii Remote/NunchukClassic ControllerGame Function
HomeHome
Since the game natively "supports" the Classic Controller, the Home button menu works great!
Open/Close Home Button Menu
D-PadD-PadMenu Selections
Wiimote AAConfirm (menus)
Shield (Grobda Remix)
Jump (Pac-Motos)
Smoke Screen (Rally-X Remix)
Wiimote BZRConfirm (menus)
Brake (Overworld/Pac 'n Roll Remix)
Shoot (Grobda Remix)
Charge (Pac-Motos)
Nunchuk CL/RCancel (some menus)
Jump (Pac-Motos)
Brake (Rally-X Remix)
Nunchuk ZZLBrake (Overworld/Pac 'n Roll Remix)
Shoot (Grobda Remix)
Charge (Pac-Motos)
Nitro (Rally-X Remix)
PlusNot used
MinusPlus/MinusPause
Wiimote 1YNot used
Wiimote 2BCancel (any menu)
Wiimote PointerNot implemented
... It's a light gun shooter. Sorry, but just use the Wiimote for this one.
Aim (Galaga Remix)
Wiimote ShakeXDash (Overworld/Pac 'n Roll Remix)
Grenade (Grobda Remix)
Hit (Gator Panic Remix)
Charge Attack (Pac-Motos)

Because we're specifically injecting input into the modern games, not just the general Wiimote/Nunchuk inputs, the button values we're using as output are to their Namco Museum-specific values, not Nintendo's ones. As such, I'll include a new button value table, but note that these button values cannot be generalized to other Wii games (except Namco Museum Remix, probably). The Classic Controller button values, on the other hand, are the normal Nintendo-approved versions.

Wii Remote/NunchukClassic Controller
0001 D-Pad Up
0002 D-Pad Down
0004 D-Pad Left
0008 D-Pad Right
0010 1
0020 A
0040 B
0080 2
0100 Minus
0200 Plus
0400 // no button
0800 Nunchuk Z
1000 Nunchuk C
2000 // no button
4000 // no button
8000 // no button
0001 D-Pad Up
0002 D-Pad Left
0004 ZR
0008 X
0010 A
0020 Y
0040 B
0080 ZL
0100 // no button
0200 R
0400 +
0800 // no button
1000 -
2000 L
4000 D-Pad Down
8000 D-Pad Right

General Notes​

  • this hack does not work reliably with Wii U Wii VC injection; if the virtual controller desyncs (no input for 5 minutes), it may not resync again
    you can usually get input working again by walking the GamePad away from the console so that the connection drops, then returning
    this issue does not affect real Classic Controllers​
  • as noted in the button mapping table, Galaga Remix is not playable on the Classic Controller; deal with it
  • this should all be portable to the original Namco Museum Remix, but I'm not doing it
  • the hardest part of this by far was mapping Wiimote Shake to a button, but I think it really paid off and makes all of the games with motion controls more enjoyable
  • I know it takes something away from Gator Panic to not be whacking the Gators with motion control, but the detection was never very good to begin with, so it was pretty unsatisfying anyway
  • the original controls were left intact, so you can still play with Wiimote & Nunchuk while the hack is enabled
    you can also play with the left half of a Classic Controller and a Wiimote in the other hand if you want that for some reason​

Technical Notes​

This one was a bit of a nightmare. It already has native CC support which I don't want to interfere with, so I had to find a way to button hack the modern games while leaving the classic games alone. That means this is an extremely Namco Museum-centric hack: all of the codes are applying to Namco Museum functions, none of it goes via the common system libraries. I'm not going to count off line numbers this time, just look for the C2 codes.

The first two codes apply to what seems to be a generic "analog controls" function which covers all of the modern games. The first code allows Rally-X Remix read the Classic Controller analog stick instead of the Nunchuk if available, and the second does the same for all the other games.

The next four patches, in order, are to the motion control functions in Pac 'n Roll Remix, Grobda Remix, Gator Panic Remix and Pac-Motos. They add a check for a button with value 8000 being pressed as an alternative to the motion checks. I'll get to what button 8000 is later. The motion checks are still intact; if the button check fails they still go through as normal.

Finally, we come to the crediar button injector, although it has been pretty heavily modified this time. Firstly, we check that this is actually a Classic Controller feeding us the inputs before we start injecting. This is because the Nunchuk analog stick and Classic Controller buttons use the same location in RAM. This check allows the Nunchuk to function normally without the injector thinking it's wildly pressing CC buttons all the time. Secondly, we're using Namco-specific button values as mentioned earlier. Thirdly, it's been optimized quite a bit so it takes fewer lines, because this was already such a long code. And fourth, it has a special secret sauce 8000 button (triggered by X) which all the motion functions are checking. This is an unused button value in the original Namco Museum Megamix which we've commandeered as a shake button.

Bonus Codes​

While we're in here, this game has another problem that may or may not bother you. I won't get into the whole thing, but the Wii does not natively display with square pixels. They're skinnier than square, and developers were supposed to account for this when rendering their games, so that you don't get things like spheres (or Pac-Men) that are oval-shaped. Oddly, the team responsible for the classic arcade games here did account for this, but the team working on the modern 3D games did not. The code below bumps the game up to use a viWidth of 704, which approximates square pixels, so that Pac-Man is round in the modern games. This does reduce the image clarity somewhat compared to the original 640, so it's up to you whether you prefer sharp pixels or round circles. If you're using this code and playing the classic arcade games, I recommend going into the Screen Adjustment menu of each game and setting Aspect to -10. The default setting 0 is actually stretching the game to account for the non-square pixels like we talked about, while -10 represents the unstretched equivalent.

USA

  1. Code:
    704 viWidth Adjustment [Vague Rant]
    C209E2A8 00000008
    90030004 3FE0802B
    63E06890 7C0803A6
    3C608048 606348B0
    4E800021 63E072C0
    7C0803A6 4E800021
    63FF6300 7FE803A6
    4E800021 7FE803A6
    4E800021 00000000
    042B69EC 38000008
    042B6A18 38C002C0
Lastly, Namco Museum Megamix is one of a small handful of Wii games which doesn't support widescreen in any way. This sort of makes sense for a collection of classic arcade games, especially since most of them had vertical screens anyway, which are the least wide screens of all. But since the main attraction of Namco Museum Megamix is supposed to be the modern, 3D remix titles, it does come off as a little odd. The code below hacks the game to run in 16:9 widescreen. Note that this only covers 3D rendering, so any 2D graphics like the classic arcade games, the modern games' HUDs, etc. are just stretched. If you're using this code without the 704 viWidth code above and want to play the classic arcade games, set the Aspect setting to -21. If you're using both this code and the 704 viWidth code, set the Aspect to -26.

USA

  1. Code:
    16:9 Widescreen [Vague Rant]
    C22F2C88 00000002
    C002C8F8 EC400032
    D04300B0 00000000
    C214B9BC 00000002
    C022C8F8 EC000072
    D007005C 00000000
 
Last edited by Vague Rant,

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
excite-truck.large.jpg


Excite Truck was one of the earliest showcases of the Wii Remote accelerometer tech, being available at trade shows and in-store kiosks to demonstrate the possibilities of steering with motion controls. The game is very consciously designed around the fact that you're steering by waving around the Wiimote, usually sporting wide-open tracks with generous off-road range, so the motion controls actually work quite well here. That said, let's go ahead and ruin all that hard work by adding conventional analog steering to the game.

USAEuropeJapan

  1. Code:
    Classic Controller Support [Vague Rant, crediar]
    C204775C 00000002
    EFC02028 FFC0F050
    FFE0F850 00000000
    0404779C D01F0008
    040477C0 D01F0008
    040477E4 D01F0008
    060478E4 0000000C
    A89E002E 387F000C
    A8BE002C 00000000
    C2045B68 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 70A40010
    41820008 60C60100
    70A40040 41820008
    60C60200 70A40008
    41820008 60C60800
    70A40020 41820008
    60C60400 70A40400
    41820008 60C60010
    70A41000 41820008
    60C61000 7CC53378
    4E800020 00000000
  2. Code:
    Classic Controller Support [Vague Rant, crediar]
    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 70A40010
    41820008 60C60100
    70A40040 41820008
    60C60200 70A40008
    41820008 60C60800
    70A40020 41820008
    60C60400 70A40400
    41820008 60C60010
    70A41000 41820008
    60C61000 7CC53378
    4E800020 00000000
  3. Code:
    Classic Controller Support [Vague Rant, crediar]
    0424987C 93C10070
    C2047CB4 00000002
    EFC02028 FFC0F050
    FFE0F850 00000000
    04047CF4 D01F0008
    04047D18 D01F0008
    04047D3C D01F0008
    06047E28 0000000C
    A89E002E 387F000C
    A8BE002C 00000000
    C2046108 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 70A40010
    41820008 60C60100
    70A40040 41820008
    60C60200 70A40008
    41820008 60C60800
    70A40020 41820008
    60C60400 70A40400
    41820008 60C60010
    70A41000 41820008
    60C61000 7CC53378
    4E800020 00000000

Button Mapping​

Wii RemoteClassic ControllerGame Function
HomeHome
Classic Controller analog stick is not supported in the Home Button Menu, you will need to use a Wii Remote to quit
Open/Close Home Button Menu
D-PadD-Pad
L/R
ZL/ZR
Navigation (menus)
Turbo boost (in-game)
Wiimote AXReset truck when off track
Wiimote BYNot used
PlusPlusPause
MinusMinusNot used?
Wiimote 1BCancel (menus)
Brake/Reverse (in-game)
Wiimote 2AConfirm (menus)
Accelerate (in-game)
Wiimote AccelerometerLeft StickSteer
Angle (in air)

General Notes​

  • if you're using this as a Wii U injection, you must enable the "Force Classic Controller Connected" option in your injection software; it will not work at all without it
  • before anybody asks, I'm not going to do Excitebots; motion controls are so heavily integrated into that game that it would be a) too hard and b) pointless, it's like making a Classic Controller hack for Mario Party
  • the USA version was a launch title while Europe and Japan got the game later, this shows itself in a couple of minor ways
    • the Europe/Japan versions boot up to a screen telling you to hold the Wii Remote sideways, USA boots straight to the title screen
    • the USA version has no bad extension check, but the Europe and Japan versions do, requiring some extra hacking
    • in the USA version, animations don't pause while the Home Button menu is up; it looks weird
  • the game works really well with analog stick input, the one weird part is doing the Air Spin trick, which requires you to hold Turbo (shoulder buttons/triggers), Brake (B) and tilt the Wiimote (analog stick) left and right; it's just as awkward on a real Wiimote, so tell Monster, not me

Technical Notes​

Code is split into ~5 sections depending on how you count, for example it's a different number if you can't count.

The first line in the Europe/Japan codes disables the extension error which prevents you playing with a Classic Controller in those newer releases. This is the only code in this entire hack that's actually specific to Excite Truck, the rest was all done in Nintendo libraries (great for portability!).

The next code (the C2) patches clamp_stick() in the KPAD library to invert the Classic Controller analog stick's values. The floats for the Wiimote accelerometer read the opposite way (left is positive, right is negative, etc.), so flipping them on the stick was also necessary. clamp_stick() seems to have been phased out of the SDK pretty early, this is the first time I've ever seen it personally. Newer games have two functions, clamp_stick_circle() and clamp_stick_cross(). My understanding is that devs could choose whether the bounding box for analog sticks should be a circle or a square, but that wasn't a feature available at launch. Porting this analog flipping to later games might require some additional work identifying whether the game uses circle or cross and where in code is a good place to do the swap.

The next three lines (04) are again patching clamp_stick(). When that function writes out the analog stick X and Y axes, it writes them to 0x0(r3) and 0x4(r3) (i.e. the address in the first parameter). However, the Wiimote accelerometer values used in Excite Truck are 8 bytes apart, not 4. As such, those next three lines are just poking the second write to output to 0x8 instead of 0x4.

Next up we have the 06 code which modifies read_kpad_stick(). We're changing the output address in r3 to point to the accelerometer fields instead of the CC left analog stick before we call clamp_stick(). We're also swapping which axis gets output where, because the accelerometer (at least when the Wiimote is held sideways) takes the Y axis first then the X axis, while the analog stick does X then Y.

Lastly is the usual crediar button injector. Normally, this is injected into the read_kpad_acc() (accelerometer) function, which runs after read_kpad_button() (you guess). However, I suppose in this early SDK version used by Excite Truck, the order that the read_kpad_* functions were run was different, and the accelerometer was read before the buttons. This made injecting buttons via the accelerometer function not usable, because read_kpad_button() would be called right after and erase all our hard work by overwriting the buttons with the "real" ones. For this reason, the button injector is itself injected directly into read_kpad_button().
 

KelSolaar

Well-Known Member
Member
Joined
May 19, 2023
Messages
207
Trophies
0
Age
41
XP
618
Country
Sweden
Could you please do a hack for Excitebots? It's crazy that that game doesnt give you an option to play without the gyro controls.
Would it be possible to allow the game to be played with a WIi Mote and a Nunchuck instead?
 
Last edited by KelSolaar,
  • Like
Reactions: NestorM

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
madagascar-2c.jpg


Madagascar: Escape 2 Africa is a 3D platform collectathon developed by Toys for Bob (the Skylanders series and more recently the Crash and Spyro remakes). It's actually pretty light on the motion controls, with motions being duplicated to buttons (e.g. swinging the butterfly net with the Wiimote can also be done by pressing Z on the Nunchuk). There are several minigames which use the IR pointer which are the major sticking point for a CC conversion. Ultimately, I'd say this one is better with the native controls, so I'd only recommend this if you don't own a Nunchuk or a sensor bar or something. That said, this hack moves the IR pointer to the Classic Controller right stick.

USAEurope

  1. Code:
    Classic Controller Support [Vague Rant, crediar]
    04076744 387EFFC0
    04076750 7CA500D0
    C2076F10 00000005
    881F005C 2C000002
    40820014 3C008007
    60006F24 7C0903A6
    4E800420 7FE3FB78
    60000000 00000000
    0440E3E4 38000001
    C24997A0 00000006
    41820028 28000002
    3C008049 60009858
    7C0903A6 41820004
    C0630084 38E0000A
    C0830088 4E800420
    60000000 00000000
    0449980C 38000001
    C2076E64 00000021
    901F0068 807F0060
    4800003D 801F0000
    7C630378 907F0000
    807F0064 48000029
    801F0004 7C630378
    907F0004 807F0068
    48000015 801F0008
    7C630378 907F0008
    480000C4 38A00000
    70600800 41820008
    60A58000 70600001
    41820008 60A50008
    70604000 41820008
    60A50004 70600002
    41820008 60A50001
    70608000 41820008
    60A50002 70600010
    41820008 60A50800
    70600040 41820008
    60A50400 70600008
    41820008 60A52000
    70600020 41820008
    60A54000 70602000
    41820008 60A50001
    70600200 41820008
    60A50002 70600080
    41820008 60A52000
    70600004 41820008
    60A50800 70600400
    41820008 60A50010
    70601000 41820008
    60A51000 7CA32B78
    4E800020 00000000
  2. Code:
    Classic Controller Support [Vague Rant, crediar]
    04074160 387EFFC0
    0407416C 7CA500D0
    C207492C 00000005
    881F005C 2C000002
    40820014 3C008007
    60004940 7C0903A6
    4E800420 7FE3FB78
    60000000 00000000
    043E8420 38000001
    C24697E8 00000006
    41820028 28000002
    3C008046 600098A0
    7C0903A6 41820004
    C0630084 38E0000A
    C0830088 4E800420
    60000000 00000000
    04469854 38000001
    C2074880 00000021
    901F0068 807F0060
    4800003D 801F0000
    7C630378 907F0000
    807F0064 48000029
    801F0004 7C630378
    907F0004 807F0068
    48000015 801F0008
    7C630378 907F0008
    480000C4 38A00000
    70600800 41820008
    60A58000 70600001
    41820008 60A50008
    70604000 41820008
    60A50004 70600002
    41820008 60A50001
    70608000 41820008
    60A50002 70600010
    41820008 60A50800
    70600040 41820008
    60A50400 70600008
    41820008 60A52000
    70600020 41820008
    60A54000 70602000
    41820008 60A50001
    70600200 41820008
    60A50002 70600080
    41820008 60A52000
    70600004 41820008
    60A50800 70600400
    41820008 60A50010
    70601000 41820008
    60A51000 7CA32B78
    4E800020 00000000

Button Mapping​

Wii Remote/NunchukClassic ControllerGame Function
HomeHome
Oddly, Classic Controller was already natively supported in the Home Button Menu
Open/Close Home Button Menu
D-PadD-Pad
L/R
Adjust Camera
Wiimote AA
ZR
Confirm (menus)
Jump (platforming)
Action (minigames)
Wiimote BBCancel (menus)
Roar (platforming)
Nunchuk CYCamera (platforming)
Nunchuk ZZL
X
Attack (platforming)
PlusPlusPause
MinusMinusNot used
Wiimote 1
Wiimote 2
Not used
Wiimote IR PointerRight StickAiming (minigames)

General Notes​

  • this one really exists because of that demo disc I mentioned in a previous post; it included a build of Madagascar with full symbols so this was actually the first game I ever looked at trying to understand how CC hacking worked
  • again, while this makes it playable on a CC, I think the experience is hampered by losing IR, so I don't really recommend it
  • I mostly considered this one a learning experience as far as mapping the IR pointer to a stick; the result is functional in a pinch but not very practical in action scenes; this would work better in games which only use the IR pointer very sparingly while Madagascar is sort of mid-range as far as importance of the pointer

Technical Notes​

This one is a bit all over the place. Let's dig in.

The first two lines are in read_kpad_stick(). This is a function that I think got renamed to read_kpad_ext() in later SDK versions, probably because it also handles reading the analog triggers on the original Classic Controller. These patches are to 1) drop the right stick values into the IR pointer field instead of the actual right stick, and 2) negate the Y-axis, because the stick and pointer are opposite. The second code is a bit sneaky; it's replacing an unrelated instruction because its result is identical to the value it already had from configuring the left stick, meaning that line (and the one after it) don't actually achieve anything. Eight bytes and extra chocolate, is it Mardi Gras?

Next up, in KPADRead(), we're injecting a little routine with a C2 which checks if this is a Classic Controller and if yes, skips running read_kpad_dpd(), the function which handles the real IR pointer. Otherwise the IR values would write directly over our fake right stick IR pointer. However, if you don't have a CC attached, this allows the function to run as normal so that IR pointing is still available if you drop back to the original Nunchuk controls. This is mostly portable but you will need to update the branch address we're using to skip over the function for any other game you want to port to.

Now we're getting into Madagascar-specific patches. The next code (another C2), applies to getJoystick(). Similar to what we did in KPADRead(), we're checking if this is a Classic Controller and allowing the function to run unchanged if the answer is no. This preserves Nunchuk analog support. If we are using a CC, we read the joystick values from the CC instead of the Nunchuk. The next line after this (an 04) is also in getJoystick() and disables the IR pointer check so that the game will read our injected right stick values as coming from a working Wiimote IR sensor.

Finally, we come to the button injector. This is back in KPADRead() again. In case you haven't noticed, I do my codes in address order, so the lowest stuff is usually first and the highest stuff last. There's no practical reason to do this, I just find it helps me with readability when I'm trying to follow what I did. The one exception to that is that I always put the button injector at the end just so people can find it without necessarily being able to read Gecko codes if they need to customize the layout. Anyway, this code is injected into what would normally be read_kpad_button(). Since that function is only ever used once, inside KPADRead(), compilers will often inline the function (make it a part of the parent) instead of calling it separately. For this reason, you won't find a separate read_kpad_button() in a lot of games, it's just the code that comes before read_kpad_stick/ext() gets called. Long story short, this time we're injecting the button injector into the part of "read_kpad_button()" which handles reading the CC buttons specifically. This way, button injection only runs if a CC is attached, which prevents clashing between the Nunchuk and Classic Controller which both use the same area in RAM for their inputs. This is done entirely so that Nunchuk input still works with this hack running.
 
  • Like
Reactions: lordelan

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
Those mods of yours don't by any chance support the GameCube Controller as well do they?

Sorry, they do not. The Wii Remote and Nunchuk use the same software library as the Classic Controller, so it's comparatively easier to get Classic Controller working in games that already support Wii Remote/Nunchuk. GameCube is a bit of a different ball park which I'm not sure how you'd go about implementing.



Let's get digital.

TRON_BG_Wallpaper_02-1024x576.jpg


Tron Evolution: Battle Grids is a tie-in game for the 2010 film, Tron: Legacy, developed by n-Space--perhaps best known for making practically the entire Nintendo DS FPS library with their renditions of the Call of Duty and James Bond franchises. In Battle Grids, you get a collection of 7 game modes, about half of which are quite good. Regardless, the game sold very poorly, partly off the back of the Tron: Legacy film underperforming and probably also because collections of motion control minigames were a pretty played out genre by 2010. It also didn't help that the HD consoles received the real Tron: Evolution, a third-person action-platformer, while the Wii (and the DS and PSP) got less ambitious titles based around the Grid Games. That said, Battle Grids actually ended up reviewing slightly better than the HD game, with the focus on the Grid Games resulting in a smoother transition to video game form.

While I'm not a fan of motion-controlled steering, I actually think the light cycle mode in this game is fantastic and I'd say even better with traditional controls. Speaking of controls, this title uses a mix of vertical and horizontal Wiimote, with optional Nunchuk support in the vertical games. Six of the seven games require motion controls to play, with the last requiring the use of the infra-red pointer instead. This hack makes all seven games playable on the Wii Classic Controller.

USA / USA (Championship Edition) / Europe

  1. Same code for all three releases.
    Code:
    Classic Controller Support [Vague Rant, crediar]
    C20D0308 00000002
    2C040001 41820008
    2C040002 00000000
    C20D1D80 00000004
    8806011C 2C000002
    4182000C C0260120
    48000008 C026012C
    60000000 00000000
    C20D1D88 00000004
    8806011C 2C000002
    4182000C C0260124
    48000008 C0260130
    60000000 00000000
    C2102D58 00000005
    41820020 801F0044
    70000080 40820014
    3C008010 60002D70
    7C0903A6 4E800420
    60000000 00000000
    C2172C38 00000005
    41820020 801E0044
    70000080 40820014
    3C008017 60002C40
    7C0903A6 4E800420
    60000000 00000000
    C21F30B4 00000005
    41820020 801F0044
    70000080 40820014
    3C00801F 600030C4
    7C0903A6 4E800420
    60000000 00000000
    C22D6C6C 00000002
    3CA08000 90C52FFC
    3C03FC27 00000000
    04367F50 3860FFFF
    C23A6E90 0000001E
    88130028 2C000002
    408200DC 3CA08000
    80A52FFC 2C050000
    41820008 80A50010
    38E00000 3CC5FC27
    2806A0C6 41820040
    3CC5FFDA 280642D1
    41820034 3CC5FC37
    2806C646 41820028
    C0150074 FC000050
    D015000C FC000028
    D0150010 C0150078
    EC0000F2 D0150014
    48000078 C002CFE0
    D0150010 C015006C
    FC000050 D0150014
    C0150070 FC000050
    C02D000C FC000800
    41800030 80150000
    60000002 90150000
    80150084 2C000000
    40820038 80150004
    60000002 90150004
    90150084 48000024
    80150084 2C000000
    41820018 80150008
    60000002 90150008
    38000000 90150084
    4E800020 9421FFB0
    60000000 00000000
    C23A8160 0000001C
    88B30028 2C050002
    408200CC 7C0802A6
    98A3005E 3CA08000
    80A52FFC 2C050000
    41820008 80A50010
    3CC5FFD9 28062CEA
    38A00000 38C00000
    40820018 38C00001
    3CA08065 80A5DBB0
    7CA53039 4082000C
    C035006C 48000008
    C0350074 C042D070
    C06DC2C0 FC211824
    48000035 38630004
    3AB50004 2C050001
    4182000C C035006C
    48000008 C0350074
    FC200850 48000011
    3AB5FFFC 7C0803A6
    4E800020 C0030020
    EC2100B2 FC00082A
    C022D06C FC000800
    4180000C FC000890
    48000014 FC200850
    FC000800 41810008
    FC000890 D0030020
    4E800020 9421FFC0
    60000000 00000000
    C23A6AEC 0000004E
    90030068 7C0802A6
    3CA08000 80A52FFC
    2C050000 41820008
    80A50010 38E00000
    39000000 39200000
    3CE08065 80E7DBB0
    2C070001 4082005C
    3CC5FC27 2806A0C6
    4182004C 3CC5FFDA
    280642D1 41820040
    3CC5FC37 2806C646
    4082000C 39000001
    4800002C 3CC5FFE0
    28060595 40820008
    48000014 3CC004B9
    60C600D5 7C053000
    40820010 39000001
    48000008 39200001
    80C30060 4800003D
    80830000 7CC62378
    90C30000 80C30064
    48000029 80830004
    7CC62378 90C30004
    80C30068 48000015
    80830008 7CC62378
    90C30008 48000198
    38A00000 70C40800
    41820008 60A58000
    2C070000 4182000C
    2C090001 418200A8
    70C40001 41820008
    60A50008 70C44000
    41820008 60A50004
    70C40002 41820008
    60A50001 70C48000
    41820008 60A50002
    70C40010 41820008
    60A50800 70C40040
    41820018 2C080001
    4182000C 60A50400
    48000008 60A54000
    70C40008 41820008
    60A54000 70C40020
    41820008 60A52000
    70C42000 41820008
    60A52000 70C40200
    41820008 60A50080
    70C40080 41820008
    60A50800 70C40004
    418200BC 60A50400
    480000B4 70C40001
    41820008 60A50002
    70C44000 41820008
    60A50001 70C40002
    41820008 60A50008
    70C48000 41820008
    60A50004 70C40010
    4182000C 2C070001
    60A50100 70C40040
    41820018 2C080001
    4182000C 60A50200
    48000008 60A50400
    70C40008 41820008
    60A50800 70C40020
    41820014 2C080001
    41820008 60A50400
    60A50200 70C42000
    41820008 60A50008
    70C40200 41820008
    60A50004 70C40080
    41820008 60A50001
    70C40004 41820008
    60A50080 70C40400
    41820008 60A50010
    70C41000 41820008
    60A51000 7CA62B78
    4E800020 7C0803A6
    60000000 00000000

Button Mapping​

All right, this one needs some explaining. There are seven different games in here each with their own control schemes. Some of these are sideways Wiimote solo and some are vertical Wiimote with Nunchuk. This means the hack alternates between five different configurations depending on the game that's running currently. As such, I'm going to split this into multiple tables.

I know the tables look super daunting, but if you're interested in giving it a shot, I'd say jump into Light Cycle Arena and you can get away with just using A (accelerate) and ZR (jump) for a decent amount of time before you need to learn any more mechanics at all.

All right. Ready?

General​

Wii Remote/NunchukClassic ControllerGame Function
HomeHome
I also added support for the Home Button Menu, works mostly as normal
Open/Close Home Button Menu
Wiimote AAConfirm
Wiimote BBCancel
PlusPlusPause
MinusMinusVarious
Wiimote IR PointerLeft StickMenu Navigation

Vertical Games​

These games are mostly played using two sticks, so remember that all buttons are also mapped to the bumpers/triggers since your thumbs are busy.

Wii Remote/NunchukClassic ControllerGame Function
Nunchuk Analog Stick
D-Pad
Left Stick
D-Pad
Movement
Wiimote AA
ZL
Light Discs, Grid Tanks
Shield
Hyper Ball
Backspin
Wiimote BB
ZR
Light Discs, Grid Tanks
Attack
Hyper Ball
Forward Spin
Nunchuk CBStory/Light Discs
Jump
Nunchuk ZLGrid Tanks
Mine
Wiimote ShakeRLight Discs
Use Power-Up
Wiimote TiltRight StickHyper Ball
Serve/Throw (Stick Up)
Rebound Angle (Stick Left/Right)
Wiimote IR PointerRight StickGrid Tanks
Aiming

Horizontal Games​

Wii Remote/NunchukClassic ControllerGame Function
D-Pad UpD-Pad Up
Pull Back on Left Stick
Light Cycle
Wheelie
D-Pad DownD-Pad Down
ZL
Power Slide
D-Pad Left/RightD-Pad Left/Right
L/R
Light Cycle
Instant Turn
Wiimote AXLight Cycle
Stealth Mode
Runner
Shoot
Wiimote BLight Cycle
Y
Runner
B
Light Cycle
Reverse Camera
Runner
Boost
Wiimote 1Light Cycle
B
Runner
Y
Brake
Wiimote 2AAccelerate
Wiimote ShakeZRJump
Wiimote TiltLeft StickSteer
Light Cycle
Pull Back to Wheelie

General Notes​

Should I play this game?
Absolutely yes, if only for the Light Cycle Arena mode which is brilliant and basically everything you could want from a Tron game or hectic multiplayer party game. It should be on modern platforms as a $10 download or something, but it's not. Each game also has multiple versions to unlock, e.g. there's a Light Cycle mode where you respawn infinitely and the goal is to get the most Derezzes, and another where the winner is just whoever lasts the longest in a field of light trails that gets progressively more impossible to navigate the longer the game lasts. There's also tons of mechanics at play: you can draft off enemy light trails, the stealth mode can be used to sneak up on opponents before re-enabling the light trail for a surprise attack, there's boosts for drifting and for jumping off ramps. Amazing game mode.

The other modes range from atrocious (Light Discs) to pretty fun (Hyper Ball, this collection's Wii Tennis analogue), but Light Cycle Arena is the reason you're here. It's the reason I hacked the game and I strongly considered stopping as soon as that mode was playable. Really, the reason the rest got done is that Light Cycle Arena shared a lot with Light Cycle Race, Runner Arena and Runner Race, so once I had 4 modes done I figured I may as well do the rest.​

What do I need to know going in?
Version-wise, I recommend playing the Toys 'R Us exclusive Championship Edition, which comes with an additional vehicle, the Outrunner, for use in the Runner modes. It does support less languages than the PAL version (English, French and Spanish vs. English, French, Spanish, German, Italian and Dutch), but if you can understand one of the former, why not get a free extra car?

Story-wise, this is technically a prequel to Tron: Legacy, but it's just a bunch of programs playing games against each other, none of it really matters. It does have Olivia Wilde and Bruce Boxleitner in it, and I don't just mean their characters, they actually reprised their roles. Jeff Bridges's character Flynn is also here, but voiced by a soundalike.

Gameplay-wise, Light Cycle Race and Hyper Ball both have movement assist options enabled by default. Since you're playing on a Classic Controller now, maybe you want to turn these off in the Advanced Options, but that's your business. You can also turn off the control tutorials in the options, which might be a good idea because the controls are completely different now anyway and they're more likely to confuse you.​

Any weirdness I need to deal with in this hack?
I had to break MotionPlus support to get this working. Obviously, you can't do a realistic simulation of a MotionPlus with a Classic Controller anyway and only one game (Hyper Ball) actually supports the MotionPlus, using it for more accurate throws, but you will need to select No when the game asks if you wish to enable WMP. You will get errors if you try to use MotionPlus (even a real one) while this hack is enabled. If you want to play with MotionPlus, turn the hack off.

The controls are going to be a little bit weird in the sideways games (all of the driving-based, Light Cycle and Runner modes). Those obviously use 1/2 as their primary action buttons, but the menu and tutorial screens are still navigated with A/B even in these modes. I did my best to mitigate this (switching back to the vertical style A/B layout when you pause the game), but some screens still tell you to press Wiimote "A" which is Classic Controller X in the horizontal orientation. If you press A and nothing happens, press X instead. Please understand.

Another bit of minor weirdness, during the Grid Tanks game, the right stick is your IR pointer instead of the left stick. While I account for this in the pause menu (reverting to left-stick pointer for menu navigation), if you open the Home Menu during tank mode, you will still need to use the right stick to navigate.​

What else?
Can we give a round of applause to n-Space for using the same binary on all three editions of the game? This meant I only had to hack the game once and it works on all three releases. Thanks n-Space, I'm sorry you went out of business that time, I hope you get better.​

Technical Notes​

Nightmare.

As I mentioned in the intro, this game uses a combination of vertical and horizontal Wiimote, Nunchuk and no Nunchuk, motion control and the infra-red pointer, often multiple at a time. This meant that a one size fits all solution was not at all possible, so each game needed their own game-specific tweaks. Boo and/or hiss.

I'll include the first line of each code to make this a bit easier to follow.

C20D0308 00000002
This hooks into a function in Tron that checks whether a Nunchuk or some other attachment is in the Wiimote extension port. It adds a check for the Classic Controller so that the game knows it should enable reading the "Nunchuk" in games that support it.

C20D1D80 00000004 and C20D1D88 00000004
Some more Nunchuk stuff, here we're checking if the controller in use is a Classic Controller and redirecting the Nunchuk reads to read the CC left stick values instead.

C2102D58 00000005 and C2172C38 00000005 and C21F30B4 00000005
These three are similar patches which cover five of the different game modes' Wiimote shake motions. The first covers Light Cycle Arena and Race modes (shake to jump), the second is for Light Disc mode (shake to trigger power-up) and the third is for Runner Arena and Race modes (shake to jump). After the actual shake check, we're adding an additional check for whether the player pressed the 0x80 button. Similar to what we did for Namco Museum, this is an unused button on the real Wii, so we commandeer the free slot as our shake button, which can be defined in the button injector later.

C22D6C6C 00000002
This is a bit of a hack (isn't all of it?) but I couldn't find a pointer to the address where the current minigame ID reads from, which varies across play sessions. So instead, I hooked into this code which runs after the address has already been determined and write a spare copy of the address to 80002FFC. This way, we can always check what game mode is running currently, which we need later to change the controller mapping on a per-game basis.

04367F50 3860FFFF
This one-liner in WPADiGetMplsStatus() causes the MotionPlus check to always return -1. When a MotionPlus is attached, a whole separate set of KPAD library reads occurs which erase all our hard work hacking the input library. I don't know how to fix this "properly" so just removing MotionPlus support entirely was my solution. If you know, tell me.

C23A6E90 0000001E
This is a completely custom read_kpad_acc() (accelerometer) function which replaces the stock one if the current controller is a Classic Controller. If the Classic Controller check fails, the normal function runs (so regular Wiimote motion still works if the CC is unplugged). After the CC check, there's a check for which game is running, because the different games have different needs for the accelerometer. If this is one of the sideways games (Light Cycles or Runners), we use the left stick's X-axis as Wii Remote tilting, for steering. If this is Light Cycles, we also add in support for performing wheelies by pulling back on the analog stick. Otherwise, if this is a vertical game (which basically means Hyper Ball as it's the only vertical game with in-depth motion controls), we map the right stick as motion controls. The left stick is busy being a Nunchuk in this scenario, so the right stick is how you serve, throw and tilt your shots in Hyper Ball.

C23A8160 0000001C
As above but for read_kpad_dpd() (IR pointer), this implementation checks for a CC and runs normally if not, but if this is a CC it checks whether the current game is Grid Tanks. Again, the left stick is busy being a Nunchuk in that case, so the right stick is our IR pointer. There's an additional check for whether the game is paused currently which reverts the pointer to the left stick so that menu navigation isn't suddenly on the right stick. If you're not playing Grid Tanks currently, the left stick is the pointer.

C23A6AEC 0000004E
Finally, the button injector. Again, this involves checking what the current game is (and whether it's paused) so that we've got custom button layouts for each orientation and specific changes for games that need them. The tl;dr of this is:
  • the 3D platforming-style modes (the story mode Hub and Light Discs modes) get a custom mapping where the Nunchuk C button is placed on the Classic B button so that jumping works as you'd expect in a normal platform-based game
  • Runner remaps the turbo button to be Classic B button
Nightmare.
 
  • Like
Reactions: lordelan

Vague Rant

Deceptively cute
OP
Member
Joined
Aug 7, 2008
Messages
2,494
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,562
Country
SI_Wii_KirbyEpicYarn_enGB_image1600w.jpg


Kirby's Epic Yarn is that Kirby game with the yarn. This 2010 platformer by Good-Feel was mildly controversial on launch for removing Kirby's Copy ability, but everybody calmed down when HAL's Return to Dream Land returned to the standard Kirby formula a year later. Epic Yarn is often considered to be one of the best looking games in the Wii library, not for pushing advanced effects but through its textured fabrics. It's also quite good and requires a Wii Remote due to the inclusion of tilt and pointer controls, unless you don't want that any more.
B/A Mode

USAEuropeJapanKorea

  1. Code:
    Classic Controller Support (B/A Mode) v1.1 [Vague Rant, crediar]
    C26F8080 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F9350 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C60A70
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26F9D00 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F7CDC 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60100
    70E50040 41820008
    60C60200 70E50008
    41820008 60C60800
    70E50020 41820008
    60C60400 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  2. Code:
    Classic Controller Support (B/A Mode) v1.1 [Vague Rant, crediar]
    C26F88E0 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F9BB0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C612D0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26FA560 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F853C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60100
    70E50040 41820008
    60C60200 70E50008
    41820008 60C60800
    70E50020 41820008
    60C60400 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  3. Code:
    Classic Controller Support (B/A Mode) v1.1 [Vague Rant, crediar]
    C26F7DE0 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F90B0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C607D0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26F9A60 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F7A3C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60100
    70E50040 41820008
    60C60200 70E50008
    41820008 60C60800
    70E50020 41820008
    60C60400 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  4. Code:
    Classic Controller Support (B/A Mode) v1.1 [Vague Rant, crediar]
    C26F9200 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26FA4D0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C61BF0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26FAE80 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F8E5C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60100
    70E50040 41820008
    60C60200 70E50008
    41820008 60C60800
    70E50020 41820008
    60C60400 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
Y/B Mode

USAEuropeJapanKorea

  1. Code:
    Classic Controller Support (Y/B Mode) v1.1 [Vague Rant, crediar]
    C26F8080 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F9350 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C60A70
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26F9D00 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F7CDC 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60800
    70E50040 41820008
    60C60100 70E50008
    41820008 60C60400
    70E50020 41820008
    60C60200 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  2. Code:
    Classic Controller Support (Y/B Mode) v1.1 [Vague Rant, crediar]
    C26F88E0 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F9BB0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C612D0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26FA560 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F853C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60800
    70E50040 41820008
    60C60100 70E50008
    41820008 60C60400
    70E50020 41820008
    60C60200 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  3. Code:
    Classic Controller Support (Y/B Mode) v1.1 [Vague Rant, crediar]
    C26F7DE0 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26F90B0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C607D0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26F9A60 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F7A3C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60800
    70E50040 41820008
    60C60100 70E50008
    41820008 60C60400
    70E50020 41820008
    60C60200 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000
  4. Code:
    Classic Controller Support (Y/B Mode) v1.1 [Vague Rant, crediar]
    C26F9200 00000008
    88130028 2C000002
    40820030 7C0802A6
    C0150074 FC000050
    48000005 7CA802A6
    C0250018 EC000072
    D0150014 7C0803A6
    4E800020 3F2AAAAA
    9421FFB0 00000000
    C26FA4D0 0000001B
    88B30028 2C050002
    408200C8 9421FFF0
    7C0802A6 9001000C
    90610008 98A3005E
    3CC0806B 60C61BF0
    7CC803A6 4E800021
    2C030001 80610008
    48000005 7CA802A6
    C0650088 40820008
    EC6300F2 C085008C
    C0030020 C035006C
    C0550074 FC21102A
    FC211824 48000035
    D0030020 C0030024
    C0350070 C0550078
    FC21102A FC200850
    48000019 D0030024
    8001000C 7C0803A6
    38210010 4E800020
    FC01013A C0250090
    FC000800 4180000C
    FC000890 48000014
    FC200850 FC000800
    41810008 FC000890
    4E800020 3FAAAAAB
    3D23D70A 3F800000
    9421FFC0 00000000
    C26FAE80 00000016
    4E800421 C01E000C
    C03E0010 48000005
    7CA802A6 C0450098
    809EFFA0 80BEFFA4
    80DEFFA8 80FE0024
    39000004 FC001040
    48000045 39000002
    FC011040 48000039
    FC000050 39000008
    FC001040 48000029
    FC200850 39000001
    FC011040 48000019
    909EFFA0 90BEFFA4
    90DEFFA8 90FE0024
    4800003C 41800024
    7CE34039 40820008
    7CA54378 7C844378
    7D0340F8 7CC61838
    7CE74378 48000010
    7CE34039 41820008
    7CE74278 4E800020
    3F000000 00000000
    C26F8E5C 00000022
    90030068 7C0802A6
    80E30060 48000039
    80A30000 7CE72B78
    90E30000 7CE738F8
    80A30008 7CA73838
    90E30008 80E30064
    48000015 80A30004
    7CE72B78 90E30004
    480000C4 38C00000
    70E50800 41820008
    60C68000 70E50001
    41820008 60C60002
    70E54000 41820008
    60C60001 70E50002
    41820008 60C60008
    70E58000 41820008
    60C60004 70E50010
    41820008 60C60800
    70E50040 41820008
    60C60100 70E50008
    41820008 60C60400
    70E50020 41820008
    60C60200 70E52000
    41820008 60C60100
    70E50200 41820008
    60C60200 70E50080
    41820008 60C60100
    70E50004 41820008
    60C60200 70E50400
    41820008 60C60010
    70E51000 41820008
    60C61000 7CC73378
    4E800020 7C0803A6
    60000000 00000000

Button Mapping​

I hate doing these tables, gotta say. This is the worst part. Not even kidding.

Wii RemoteClassic ControllerGame Function
HomeHome
Home Menu also works
Open/Close Home Button Menu
D-PadD-Pad
Left Stick
Movement
Wiimote AB/A Mode
X
Y/B Mode
A
Customization Menu
Confirm
Transformations
Action
Wiimote BB/A Mode
Y
Y/B Mode
X
Customization Menu
Cancel
Transformations
Change Direction
PlusPlusPause
MinusMinusHelp Screens
Wiimote 1B/A Mode
B/R/ZR
Y-B Mode
Y/R/ZR
Attack
Wiimote 2B/A Mode
A/L/ZL
Y-B Mode
B/L/ZL
Jump
Wiimote TiltRight StickTransformations
Aiming
Wiimote IR PointerLeft Stick
Right Stick
Customization/Transformations
Aiming

General Notes​

Obviously, there's two codes for each version this time. The B/A version puts your main action buttons on B/A, while the Y/B version puts your main action buttons on Y/B. The codes are practically identical and fairly easy to adjust manually if you wanted to anyway, but if you don't want to dig into editing the codes, here they are. Note that when you're using the tilt controls (e.g. in the tank transformation), your thumbs will be busy on the D-pad and right analog stick, so remember that you can also use the L/R/ZL/ZR buttons to trigger the 1 and 2 buttons.

in addition to the buttons being adjustable, you can also adjust the analog stick IR pointer sensitivity if you want. Do a Ctrl+F for 3D23D70A inside the code, it's roughly around the middle. This is what's called a floating point number, which is the fancy computer word for a decimal number. In this case, it's 0.04. You can use a web page like Greg Stoll's Float to Hex and type your preferred sensitivity into the "Float value" field then press "Convert to hex" and it will give you a hex floating point value which you can replace 3D23D70A with if you want to change the sensitivity. Higher numbers are more sensitive, e.g. the pointer will move faster if you use 0.05.

I learned a ton from doing Tron (which was a nightmare) and that made doing Kirby a Spring Breeze and/or Dream by comparison. I was able to reuse my pointer and tilt hacks from Tron with fairly minor changes. Tron was incredibly frustrating so it was very nice how fast Kirby came together.

Changelog​

v1.1
  • fixed typo in USA codes which broke pointer support
  • added Left Stick D-Pad emulation
  • updated button injector to newer version
  • added Korean version

Technical Notes​

This should be a quick one. The hack is three codes: the accelerometer hack, pointer hack and button injector. The button injector is standard at this point, so I'll briefly go over the first two.

For the most part, they're what I did in Tron, minus all the per-minigame shenanigans. Kirby has broadly one game mode, so thankfully it wasn't necessary. What I did do was this hilarious hack that I'm pretty happy with:
Code:
  mflr r0
  bl MAGIC
    MAGIC:
      mflr r5
      mtlr r0
      lfs f1, MULTIPLIER-MAGIC(r5)

; code omitted here

MULTIPLIER: .float 0.6666666
If you're looking at this like "What?" then you're correct. The reason I'm doing this is to get the current program counter into a register, so that I can load the float relative to wherever the code handler places the hack in memory without needing to know where that is. It makes the hack position-independent without just using hardcoded addresses for my floats. In this instance, the purpose is to multiply the tilt value by 2/3, because Kirby uses quite a gentle tilt and mapping the analog stick directly is a comparatively extreme tilt.

For the pointer, I did a fun trick of running SCGetAspectRatio() to check if the console is running in 4:3 or 16:9. Then I use the magic branch to load in the values which are used to calculate the aspect ratio (so the pointer moves at the correct speed on both axes), as well as the sensitivity multiplier and max range (-1,1). It should be simple enough to generalize this to other games as long as you can find SCGetAspectRatio() which is identical across every game I've ever seen so very easy to locate with a binary search.
 
Last edited by Vague Rant,
  • Like
Reactions: lauty29

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: Anhouser Bush Got drunk n trashed his place. That's all