Many thanks to you master @Vague Rant . i want to report 2 games
1. Endless ocean doesn't work on wii u, classic controller or force classic controller, neither works.
2. Resident evil 4 eur region does something VERY usefull, in the past to play in other languages with the gamepad you needed to make a savefile with the pal region, the install the usa region and convert the save file from pal to usa, and then you will be able to play, It is something not too difficult, but little annoying to do. With this awesome cheat code you dont need to do this, you can convert the pal version and voila! get fun killing ganados.
@Vague Rant When you were working on endless ocean, by any chance was the KPAD / WPAD functions different then other games? Same goes for NSMBWII, i think the issue is that both of those games use different code for controller report data then other ones.
@Vague Rant When you were working on endless ocean, by any chance was the KPAD / WPAD functions different then other games? Same goes for NSMBWII, i think the issue is that both of those games use different code for controller report data then other ones.
@Vague Rant When you were working on endless ocean, by any chance was the KPAD / WPAD functions different then other games? Same goes for NSMBWII, i think the issue is that both of those games use different code for controller report data then other ones.
Looks like Endless Ocean turned out to work after all (thanks again @KeinesR! I'll add that note to the EO post), but re: NSMBWii, from my end it looked the same as any other game. I think I only messed with KPAD for that game, so if there were any low-level differences I wouldn't know about them. If I had to speculate why some games don't work I'd say that the ARM-side code (the original game IOS vs. Wii U HAI-IOS) respond differently. Each Wii game specifically tells the console which IOS version it wants to run on, but VC injections ignore this and run them all on HAI-IOS, similar to how USB loaders mostly just force all games to run using a hacked cIOS (e.g. 249). If HAI-IOS is incompatible with the original game's IOS, that might explain the issue.
Is there a list anywhere or which Wii games run on which IOSes? I guess that might be interesting to see, maybe other games which run on the same IOS as NSMBWii would have the same problem?
Sticking with EA Redwood Shores/Visceral Games for a moment, The Simpsons Game was the quasi-tie-in game to The Simpsons Movie. Though featuring its own plot unrelated to the film, both released in 2007 to a resoundingly all right reception. Featuring performances from the entire cast and a story by the show's writers, The Simpsons Game is a licensed 3D action-platformer about the concept of licensed 3D action-platformers, skewering the cliches of game design at the same time as it uses them. The result is a self-awarely generic game, which makes sense for The Simpsons. GameSpot said "The gameplay isn't atrociously bad or anything, though the significantly more irritating control scheme on the Wii version does a lot to drag it down when compared to its other console counterparts." Let's bump that up so the controls are average too!
The separate European releases (UK, France, Italy/Spain and Germany) are all compatible with the EUR code given below.
EDIT: If you're using this to build a Wii VC injection on Wii U, you must enable the "Force Classic Controller connected" option in your injection software. Thanks @KeinesR for reporting!
First up, the Wii version features two bonus, Wii-exclusive, motion controlled minigames, Bite Night and Bart Wings. I really don't care about these or think they're very fun. Fortunately, there's absolutely no requirement that you play them at any time, so I didn't bother implementing support for them.
That said, Bite Night can be made playable if you really want. This game involves alternating Wiimote and Nunchuk shakes. The code above does not accommodate this functionality. If you want to play Bite Night with a Classic Controller for some reason, please see the Technical Notes section for instructions to modify the code with a separate Nunchuk Shake button. It's not going to be much fun, but it's your funeral.
Bart Wings is not playable here at all. This one has you angling the Wiimote to steer Bart as he flies through rings. If you want to play it, you'll have to use real motion controls. Sorry.
The button mapping here is an approximation of the schemes used on the traditional console versions, but some accommodations were necessary. Several abilities which shared inputs in other versions were broken out into different motions on Wii, e.g. Homer's Attack (Wiimote B) and Ball Dash (Wiimote Shake) are both on the left face button in other versions, but here they're on Y/ZR and A respectively due to changes made for the Wii version.
On other consoles, pressing the D-Pad in any direction behaves as a "button" to switch your current character. That has been added here, but the D-Pad is double-mapped to provide regular D-Pad directions as well. This is just so that people who prefer to use the D-Pad for menu navigation can continue to do so. In gameplay, the D-Pad is camera controls, but trying to use it in this way will toggle your character as well. Instead, use the Right Stick for camera controls.
Technical Notes
Code breakdown:
C2 in Platform_Update(): bypass Nunchuk error
C2 in read_kpad_acc(): simulate Wiimote and Nunchuk shakes
C2 in calc_dpd_variable(): IR pointer emulation
04 and C2 in read_kpad_stick(): Classic to Nunchuk stick redirection and Right Stick D-Pad emulation
C2 in KPADRead(): button injector
Bite Night support:
If you absolutely must play Bite Night with a Classic Controller, the easiest thing to do is Ctrl+F inside the cheat code for 610800C0 (Wiimote and Nunchuk shake) and replace it with 61080040 (solo Nunchuk shake), modifying your X button mapping.
This will make Bite Night playable, but since you absolutely never need solo Nunchuk shakes in normal gameplay, you now have to deal with the minor inconvenience of needing to press A and X (Wiimote and Nunchuk shake) simultaneously any time you want to trigger a Power Move.
Alternatively, you can adjust the control scheme however you like using the assembly below and the CodeWrite app. There's a long comment in the source explaining the "button" values for the different shakes, so if you don't want to put your dedicated Nunchuk shake on X you can have it wherever you want.
Code:
; KPADRead
; 80332DE4 for USA
; 80332C38 for EUR
; r4 holds extType
; r7 holds wiimote bitfield
; r8 holds wiimote+nunchuk bitfield
; r9 holds classic bitfield
CLASSIC:
cmpwi r4, 0x2
bne- RETURN
li r4, 0x1 ; i'm a nunchuk
CLASSIC_HOME:
andi. r0, r9, 0x800
beq- CLASSIC_UP
ori r8, r8, 0x8000 ; home
CLASSIC_UP:
andi. r0, r9, 0x1
beq- CLASSIC_DOWN
ori r8, r8, 0x4008 ; c and up (v) / left (h)
CLASSIC_DOWN:
andi. r0, r9, 0x4000
beq- CLASSIC_LEFT
ori r8, r8, 0x4004 ; c and down (v) / right (h)
CLASSIC_LEFT:
andi. r0, r9, 0x2
beq- CLASSIC_RIGHT
ori r8, r8, 0x4001 ; c and left (v) / down (h)
CLASSIC_RIGHT:
andi. r0, r9, 0x8000
beq- CLASSIC_A
ori r8, r8, 0x4002 ; c and right (v) / up (h)
CLASSIC_A:
andi. r0, r9, 0x10
beq- CLASSIC_B
ori r8, r8, 0x80 ; wiimote shake
CLASSIC_B:
andi. r0, r9, 0x40
beq- CLASSIC_X
ori r8, r8, 0x800 ; a
; hi it's vague rant here
; the below value, 0xC0, is a combined wiimote (0x80) and nunchuk (0x40) shake
; if you have enough energy, this triggers your current character's power move
; this combined button layout means you have no standalone nunchuk shake button
; standalone nunchuk shakes are only used in the optional bite night minigame
; if you want to play that game on a classic controller, you should change ...
; ... the below value to 0x40 so that X becomes a solo nunchuk shake
; this will also mean that you need to press X and A simultaneously to trigger
; power moves in normal gameplay. i preferred the single button power moves ...
; ... over supporting a single optional minigame you might play once
CLASSIC_X:
andi. r0, r9, 0x8
beq- CLASSIC_Y
ori r8, r8, 0xC0 ; wiimote + nunchuk shake
CLASSIC_Y:
andi. r0, r9, 0x20
beq- CLASSIC_L
ori r8, r8, 0x400 ; b
CLASSIC_L:
andi. r0, r9, 0x2000
beq- CLASSIC_R
ori r8, r8, 0x1000 ; minus
CLASSIC_R:
andi. r0, r9, 0x200
beq- CLASSIC_ZL
ori r8, r8, 0x10 ; plus
CLASSIC_ZL:
andi. r0, r9, 0x80
beq- CLASSIC_ZR
ori r8, r8, 0x2000 ; z
CLASSIC_ZR:
andi. r0, r9, 0x4
beq- CLASSIC_PLUS
ori r8, r8, 0x400 ; b
CLASSIC_PLUS:
andi. r0, r9, 0x400
beq- CLASSIC_MINUS
ori r8, r8, 0x100 ; 2
CLASSIC_MINUS:
andi. r0, r9, 0x1000
beq- RETURN
ori r8, r8, 0x200 ; 1
RETURN:
or r7, r7, r8
andi. r0, r7, 0x9FFF
but re: NSMBWii, from my end it looked the same as any other game. I think I only messed with KPAD for that game, so if there were any low-level differences I wouldn't know about them. If I had to speculate why some games don't work I'd say that the ARM-side code (the original game IOS vs. Wii U HAI-IOS) respond differently. Each Wii game specifically tells the console which IOS version it wants to run on, but VC injections ignore this and run them all on HAI-IOS, similar to how USB loaders mostly just force all games to run using a hacked cIOS (e.g. 249). If HAI-IOS is incompatible with the original game's IOS, that might explain the issue.
Is there a list anywhere or which Wii games run on which IOSes? I guess that might be interesting to see, maybe other games which run on the same IOS as NSMBWii would have the same problem?
Dolphin can tell you what games run on which ios afaik
The thing is, new super mario bros wii works normally with wii remotes, so maybe HAI-IOS’s module to convert bluetooth signals from the gamepad into wiimote signals is not working properly because of the ios issue?
Post automatically merged:
Now we need the rest of the controller hacks yall!
Featuring:
Guitar controller hacks
Drum kit controller hacks
DJ Turntable controller hacks
uDraw GameTablet controller hacks
Drawsome Tablet controller hacks
Taiko Drum controller hacks
And last but not least, Shinkansen controller hacks!
Almost forgot, vitality sensor controller hacks XD
It would be ridiculous though, but after all it is a joke
Post automatically merged:
@Vague Rant Regarding NES D-pad steering request for mkwii wii remote:
I believe there are enough buttons, but you would have to map B to items, minus button to looking behind you, flipping the camera. And if you wanted to, A for wheelie, or keep wheelie as it is.
The wheelie thing would make it have no motion needed from WPAD at all, but sorry to hear the low level data in MKWII.
The controls would basically be
DPAD: steer
2: accelerate
1: Drift
Minus button: Flip camera
B button: Use items
A button (OPTIONAL): wheelie
The minus button is actually used in MK8, where dpad steering exists in the wiimote!
@Vague Rant
1. No luck on uno sadly, the WPADProbe method works, but KPADRead is going to be very tricky to find, theres a good amount of calls / callers or whatever it is
2. When you made those nunchuk hacks, did you just instead make the instructions be like “NUNCHUK_DOWN”? In codewrite and change the bitfield to wiimote and nunchuk
This is really amazing work. Incredible to see so many more games get this kind of support when I'd been so used to it just being the old Kirby/DKCR/NSMBWii patches and nothing else. Thrown some on my Wii U and they're a godsend.
Saw that some people have asked about Sonic Riders: Zero Gravity earlier in the thread and while I would definitely love to see that, I'd like to propose another Sonic game which might be easier to tackle, that being Sonic and the Black Knight. You shake the wiimote to attack and shake the nunchuk with B for a different attack and that's the extent of the motion controls for the game, everything else is control stick + A/B/Z.
This is really amazing work. Incredible to see so many more games get this kind of support when I'd been so used to it just being the old Kirby/DKCR/NSMBWii patches and nothing else. Thrown some on my Wii U and they're a godsend.
Saw that some people have asked about Sonic Riders: Zero Gravity earlier in the thread and while I would definitely love to see that, I'd like to propose another Sonic game which might be easier to tackle, that being Sonic and the Black Knight. You shake the wiimote to attack and shake the nunchuk with B for a different attack and that's the extent of the motion controls for the game, everything else is control stick + A/B/Z.
Can you try a standard nunchuk waggle instead of a shake? The nunchuk accelerometer is a complicated library, Vague did manage to get waggles working. Thank you!
Post automatically merged:
@Vague Rant Im going to look into Mario Strikers with other people in its discord. If we get anywhere, i might send you a DM, Ill keep you updated
I followed the guide and i actually managed to make a semi working hack! I cant seem to find how to inject the buttons. Do i merge both assemblies together or something? (The button and ir pointer assembly) and insert it at the andi address?
@Vague Rant
1. No luck on uno sadly, the WPADProbe method works, but KPADRead is going to be very tricky to find, theres a good amount of calls / callers or whatever it is
2. When you made those nunchuk hacks, did you just instead make the instructions be like “NUNCHUK_DOWN”? In codewrite and change the bitfield to wiimote and nunchuk
Yeah, WPADProbe() absolutely gets called all over the place. It's definitely my less-preferred way to locate KPADRead().
Nunchuk hacking is very much game-specific. It doesn't happen via the button injector at all, rather it's a fairly tedious process of running Dolphin with a Nunchuk emulated and breakpointing all of the places where the Nunchuk Stick values get read and written. Besides being tedious, it's a fairly involved process and usually involves being able to read/write a little custom assembly. In more detail, the process looks something like:
Configure Dolphin to emulate a Wiimote and Nunchuk and boot into your game
Locate KPADStatus struct (the final controller report from KPADRead)
This is fairly easy to find if you've got any of the KPAD functions, usually r3 will be pointing to the KPADStatus struct at the beginning of any of the major read functions, e.g. if you set a breakpoint on the first instruction of calc_dpd_variable(), r3 is a pointer to KPADStatus. Same goes for read_kpad_button(), etc.
Set a read breakpoint on the value at the offset 0x60 from r3, which is the Nunchuk Stick's X axis (left/right).
It's useful to hold a direction on your emulated stick before doing this so that you can keep following the same value through memory; it's easier to track a meaningful number than a 0.
When the game reads that value in and writes it to somewhere else in memory (KPADRead() usually does this 3 to 6 times, then the game's own code might do it one or two more before actually processing the data), set a read breakpoint on each of those new addresses and run again until they get hit.
Weed out (disable) any breakpoints that are no longer holding the Nunchuk Stick data, sometimes they'll be overwritten with something else and in that case there's no longer any reason for you to keep tracking them, any hits will just be false positives that waste your time.
When the data is just being "moved around", it's usually done by loading to and from the general purpose registers (r0, r3-r31). These registers don't "understand" what floating point numbers are, they're just treating these values as generic hex bytes, so you can be reasonably sure that it isn't being meaningfully processed there.
Locate where the stick data actually starts being read, to be used by the game for movement or whatever else the stick does in this game.
Continuing on from the previous step of just setting read breakpoints until something interesting happens: if you start seeing the stick data being loaded in via lfs (load floating-point single) instructions, you're almost certain to be on the right track. The floating point registers are used to process the values in terms of what the numbers actually represent. Make a note of anywhere you see floating-point operations going on.
Switch the extension controller to Classic Controller in Dolphin.
At this point, you should probably hit Save on your breakpoints, then Clear. You don't strictly need all of those old breakpoints any more and it will get confusing fast having so many around. If you make a mistake and need them back, you can hit Load to get roughly back to where you were.
Breakpoint the location you identified in step 5. If the game no longer hits this address, you've identified where the behavior is different between the Nunchuk and Classic Controller.
Using custom assembly in a Gecko code, rewrite that portion of code to also support reading the Classic Left Stick.
This will look completely different from game to game, there's no generalized solution to what this will look like.
If the Classic Stick is now able to control the game, you've correctly hacked in Nunchuk Stick emulation.
If that didn't help, you either wrote your code incorrectly or this wasn't the final or only place which reads Nunchuk Stick data and you need to do more breakpointing until you find the right one.
This is really amazing work. Incredible to see so many more games get this kind of support when I'd been so used to it just being the old Kirby/DKCR/NSMBWii patches and nothing else. Thrown some on my Wii U and they're a godsend.
Saw that some people have asked about Sonic Riders: Zero Gravity earlier in the thread and while I would definitely love to see that, I'd like to propose another Sonic game which might be easier to tackle, that being Sonic and the Black Knight. You shake the wiimote to attack and shake the nunchuk with B for a different attack and that's the extent of the motion controls for the game, everything else is control stick + A/B/Z.
You know, besides the Nunchuk stuff which is definitely a bit tougher than most other things like awesomeee mentioned, that doesn't sound all that bad, in the scheme of things. I actually discounted the Sonic storybook games pretty early on in the process of looking at games to CC hack, because at that point I had no idea how to do any accelerometer stuff at all. But I'll add it to my investigate list now.
I followed the guide and i actually managed to make a semi working hack! I cant seem to find how to inject the buttons. Do i merge both assemblies together or something? (The button and ir pointer assembly) and insert it at the andi address?
Nice work, congrats. The way you do multiple assembly hacks is to make multiple separate codes then just paste the final results together into one. If you look at the Technical Notes sections for any of the recent hacks, I include a code breakdown which lists how many separate codes there are in each hack and what each one does. I know it seems like it's all one hack because it comes under one heading and then a bunch of gibberish numbers and letters, but each of these hacks is actually multiple codes one after the other. Here's an example:
Code:
; 80004000 for USA
cmpwi r0, 0x1
bne- RETURN
cmpwi r0, 0x2
RETURN:
Code:
; 80005000 for USA
lbz r0, 0x905(r8)
cmpwi r0, 0x2
bne- RETURN
li r0, 0x1
stb r0, 0x905(r8)
RETURN:
Above is two separate code injections, like the buttons and the IR pointer are two separate injections. So you build them in CodeWrite separately, giving you two different codes:
It's useful to keep the codes separate like this while you're working, because if you realize you made a mistake in one, it's easier to fix just that one code while the rest remain unchanged. Then, when it's time to publish your code for other people to use, you just combine them one after the other like they're one big code. It doesn't really matter what order you put them in.
In my hacks I mostly put them in address order from lowest to highest (so in this example, 80004000 first, then 80005000). I always put the button injector last in my hacks because that's the part people are most likely to want to change by editing the button values, so having it reliably in the same place in the full code makes it easier for those people.
As you can see, that's just the two codes we made above stuck together under one heading. Now when somebody enables this code, both of those injections get enabled at the same time. Usually, a Classic Controller hack is a bunch of separate parts all working together to make "one" code. The only way this is different to having all the codes separately is that you don't have to separately go into the cheats menu and enable "Classic Controller Pointer Hack", "Classic Controller Button Hack", "Classic Controller Accelerometer Hack", etc.
In 2007, Strawdog Studios introduced the psychedelic action maze puzzle game Geon: Emotions on XBLA. This was followed by a more refined version for PSN in 2008, simply called Geon. Finally, they released what they referred to as the definitive version in 2009 on the Wii, as Geon Cube. At the base level, the Geon games are pellet-collecting maze chase games ala the original Pac-Man. Geon makes a number of additions to the formula, with attack and defense moves, power-ups and a competitive angle with opposing Geons snatching up the pellets. After enough pellets have been collected, players must strike out to reach their opponents' goal area, leaving their own goal undefended.
What is it with Wii games and broken aspect ratios? Geon Cube uses the incorrect aspect ratio regardless of whether you're playing in 4:3 fullscreen or 16:9 widescreen. In 4:3, the game is actually running at 1:1, and at 16:9 the game is actually running at 4:3. Basically, the aspect ratio needs to be multiplied by a factor of 4/3 across the board. This is particularly distracting in a game about cubes that roll around collecting spheres, so there's a code included above to fix this issue.
The pointer handling here is somewhat awkward. The original game supports navigating the menus with either the IR pointer or the Nunchuk Stick/Wiimote D-Pad. On a traditional controller, it doesn't make much sense to navigate the menus using a virtual pointer, so the pointer is only enabled when you press the Home button. There weren't any free analog sticks to be a permanent pointer and anyway you don't need one to play the game.
You can get yourself into a mildly broken situation if you do something weird like double-tapping Home, or pressing Home during a loading screen or similar where the menu can't open. The hack doesn't actually know whether or not the HBM opened, it only knows you pressed Home and toggles the pointer. If you get into the "wrong" setup, where the pointer is available in-game but not in the HBM, double-tap Home to toggle the pointer off and on again (or vice versa).
The original game doesn't support playing with the D-Pad, only the Nunchuk Stick is recognized for movement. This didn't sit right for me in a game that's entirely based around moving in the cardinal directions, with no support for analog or even diagonal movement, so the Nunchuk Stick has also been mapped to the D-Pad and the D-Pad moved over to the Right Stick. This gives you movement on either the D-Pad or Left Stick, and camera controls on the Right Stick, basically how you'd expect it to work.
Technical Notes
Code breakdown:
C2: support reading the "Nunchuk Stick" even when there is no Nunchuk attached
04: bypass Nunchuk error
C2 in calc_dpd_variable(): IR pointer emulation; this game needed special pointer handling because the virtual cursor is always enabled (even when the Wiimote is not pointed at the TV), so I'm manually moving the pointer off the side of the screen whenever it gets disabled then restoring it when it's enabled again
04, C2 and C2 in read_kpad_ext(): redirect Left Stick into Nunchuk Stick, disable reading the Left Stick if player is using D-Pad currently, and emulate the D-Pad on the Right Stick
C2 in read_kpad_button(): button injector and emulating the Nunchuk Stick via D-Pad direction presses
The button injector got a lot more complicated for this game because of the aforementioned Nunchuk Stick emulation. Counter-intuitively, given this game's four-directional movement, the most complex part of this is how to handle diagonals on the D-Pad. The solution is basically to use whichever D-Pad direction was pressed last, so if you're moving left then press D-Pad Up-Left, you'll start moving Up even if you continue holding Left as well. Effectively, this means the D-Pad will only ever input a single direction, with the oldest part of any diagonal press being discarded. Am I making sense?
Code:
; read_kpad_button
; 80286090 for USA
; r4 holds extType
; r6 holds wiimote bitfield
; r7 holds wiimote+nunchuk bitfield
; r8 holds classic bitfield
cmpwi r4, 0x2
bne- RETURN
; custom previously-held classic
lwz r4, 0x68(r3)
andc r4, r8, r4
stw r8, 0x68(r3)
CLASSIC_HOME:
andi. r9, r8, 0x800
beq- CLASSIC_DPAD_Y
ori r7, r7, 0x8000 ; home
CLASSIC_DPAD_Y:
andi. r9, r8, 0x4001 ; up or down
beq- CLASSIC_DPAD_X
ori r7, r7, 0x80 ; stick emulation only
andi. r9, r8, 0x8002 ; left or right
bne- CLASSIC_DPAD_DIAGONAL
andi. r9, r8, 0x1 ; up
bne- WRITE_UP
b WRITE_DOWN
CLASSIC_DPAD_X:
andi. r9, r8, 0x8002 ; left or right
beq- CLASSIC_A
ori r7, r7, 0x80 ; stick emulation only
andi. r9, r8, 0x8000 ; right
bne- WRITE_RIGHT
b WRITE_LEFT
CLASSIC_DPAD_DIAGONAL:
CLASSIC_UP:
andi. r9, r4, 0x1
beq- CLASSIC_DOWN
WRITE_UP:
lis r9, 0x3F80 ; 0x3F800000 is 1.0f
b WRITE_Y
CLASSIC_DOWN:
andi. r9, r4, 0x4000
beq- CLASSIC_LEFT
WRITE_DOWN:
lis r9, 0xBF80 ; 0xBF800000 is -1.0f
WRITE_Y:
stw r9, 0x64(r3)
li r9, 0x0
stw r9, 0x60(r3)
CLASSIC_LEFT:
andi. r9, r4, 0x2
beq- CLASSIC_RIGHT
WRITE_LEFT:
lis r9, 0xBF80 ; 0xBF800000 is -1.0f
b WRITE_X
CLASSIC_RIGHT:
andi. r9, r4, 0x8000
beq- CLASSIC_A
WRITE_RIGHT:
lis r9, 0x3F80 ; 0x3F800000 is 1.0f
WRITE_X:
stw r9, 0x60(r3)
li r9, 0x0
stw r9, 0x64(r3)
CLASSIC_A:
andi. r9, r8, 0x10
beq- CLASSIC_B
ori r7, r7, 0x800 ; a
CLASSIC_B:
andi. r9, r8, 0x40
beq- CLASSIC_X
ori r7, r7, 0x400 ; b
CLASSIC_X:
andi. r9, r8, 0x8
beq- CLASSIC_Y
ori r7, r7, 0x2000 ; z
CLASSIC_Y:
andi. r9, r8, 0x20
beq- CLASSIC_L
ori r7, r7, 0x4000 ; c
CLASSIC_L:
andi. r9, r8, 0x2000
beq- CLASSIC_R
ori r7, r7, 0x4000 ; c
CLASSIC_R:
andi. r9, r8, 0x200
beq- CLASSIC_ZL
ori r7, r7, 0x800 ; a
CLASSIC_ZL:
andi. r9, r8, 0x80
beq- CLASSIC_ZR
ori r7, r7, 0x2000 ; z
CLASSIC_ZR:
andi. r9, r8, 0x4
beq- CLASSIC_PLUS
ori r7, r7, 0x400 ; b
CLASSIC_PLUS:
andi. r9, r8, 0x400
beq- CLASSIC_MINUS
ori r7, r7, 0x200 ; 1
CLASSIC_MINUS:
andi. r9, r8, 0x1000
beq- CLASSIC_DONE
ori r7, r7, 0x200 ; 1
CLASSIC_DONE:
or r6, r6, r7
li r4, 0x1 ; i'm a nunchuk
RETURN:
andi. r9, r6, 0x9FFF
Wii play was a game known for tanks and target shooting. Wow!
Anyhoo, i have somehow made a mod LMAO!
This hack does not support the left stick as the D pad. I do not know why. I have tried copying @Vague Rant 's D pad assembly and add it to my hack, but it just does not work.
(Any idea why that is?)
This hack is to be intended to use with Tanks. Other modes may or may not work. Controls ZL: Landmine
ZR: Shoot bullet
Right stick: aim
D pad: d pad, move
This hack actually uses the Rhythm Heaven Fever mappings. Thank you @Vague Rant for the handy button mappings. It works well with tanks!
This hack only supports NTSC revision 1.
Classic Controller Hack (Awesomeee) (Vague Rant, gave assembly code example)
@Vague Rant I am sad to report that Uno may be one of those games that does not use KPADRead. I looked into it earlier and i could not trace read_kpad_dpd at all in the KPAD read strategy you use.
master @Vague Rant , as always, many thanks for your work. I tried the last 2 games on wii u and:
1. The simpsons game has 5 different versions:
RSND69 The Simpsons Game (PAL) (not tested)
RSNE69 The Simpsons Game (NTSC-U) - Tested, needs force classic controller, otherwise it will show connect nunchuck message
RSNF69 The Simpsons Game (PAL) (not tested)
RSNP69 The Simpsons Game (PAL) (not tested)
RSNX69 The Simpsons Game (PAL) (doesn't work, but it's because my wii u is USA so it give me a black screen)
2. Geon cube works perfect, doesn't need force classic controller
@Vague Rant I am in the process of making my next hack, but i cant seem to get left stick D pad emulation working. Do you know how to fix that?
Another question: How do you drop Nunchuk values into Codewrite?
Post automatically merged:
Currently im looking into Wii Music. I think my next game will be Sonic and the Secret Rings.
Vague, do you know any of the data you used in Fluidity for tilting? Perhaps that could be re used for this game. Maybe make the job simpler!
EDIT: I scrapped the sonic idea. Would be too tedious.
2010's Blaster Master: Overdrive is perhaps the most forgotten entry in the storied Sunsoft Metroidvania franchise. Released exclusively to the Wii Shop Channel as WiiWare, they had high hopes of reviving the franchise after several previous failed attempts. Instead, this would be yet another unsuccessful title, a pattern which wouldn't turn around until the celebrated Blaster Master Zero trilogy.
Overdrive closely follows the formula of the NES classic, with a sprawling, Metroid-style overworld navigated in the upgradable SOPHIA tank giving way to top-down shooter levels outside the tank. The most prominent additions here are a world map and the ability to save. While it retained the core of what makes Blaster Master fun, critics and players noted two major flaws with this release: the budget presentation (4:3, 480i and a generic art style missing the character of the NES game) and the awkward Wiimote controls (with the Wiimote held sideways and requiring frequent use of the uncomfortable A/B buttons). What to do?
Besides the Classic Controller hack itself, there's a few more codes here to make the game look slightly nicer. It's never going to be a great looking game, but forcing 480p, disabling the copy (deflicker) filter and forcing 4:3 all help to sharpen up the image.
Blaster Master has no widescreen support anyway; it just draws black bars in the extra space, so forcing 4:3 allows the full resolution to be dedicated to drawing the actual gameplay area.
The viWidth mod is more subjective: this will reduce the sharpness slightly but corrects the aspect ratio so that round objects like enemy bullets and SOPHIA's tires are ... round.
The archive above includes several tools, IPS patches and a Windows batch script to make applying this hack directly to a WAD relatively painless.
In addition to that ZIP, you will need:
a Blaster Master: Overdrive WAD (either USA or EUR)
common-key.bin
I will not help you find either of the above.
To use the script:
extract the ZIP file somewhere sensible
add the common-key.bin to that directory
drag and drop your Blaster Master: Overdrive WAD onto the apply-patch.bat file
alternatively, you can run the script directly and drag and drop the WAD into the window that opens or just type the path to your WAD manually
answer the y/n prompts for which patches you want to apply
once you're ready, the script will use the included tools to unpack, patch and repack a new WAD with your chosen patches
the original WAD will not be modified
do whatever you normally would do with a WAD file
if you're making a Wii U Wii VC injection, use the "Force Classic Controller connected" option in your injection software.
if you enabled the Force 4:3 patch, also remember to use the "Force 4:3 (vWii NAND titles only)" option in the injection software, unless you want the game to be stretched to fill 16:9
As a general rule, you shouldn't download and run random executables and batch scripts you find on the Internet. If you can't or don't want to run any of these on your machine, the IPS patches are included in the patches directory and you can figure out how to apply them in whatever way you feel comfortable. There is a readme.txt included with slightly more details on how to apply the patches in platform-agnostic terms (e.g. "Unpack your WAD").
Button Mapping
Wii Remote
Classic Controller
Function
Home
Home
Remember that L/ZL are your A button
Open/Close Home Button Menu
D-Pad
D-Pad
Left Stick
Menus
Navigation Gameplay
Movement
A
L
ZL
Gameplay
Change Weapon
B
R
ZR
SOPHIA
Lock Cannon Angle On-Foot
Strafe
1
Y
A
Menus
Confirm (seriously) Gameplay
Shoot
2
B
Menus
Cancel (seriously) SOPHIA
Jump On-Foot
Bomb
D-Pad + 1 + B
Right Stick
On-Foot
Aim, Shoot and Strafe
Plus
X
Gameplay
Enter/Exit SOPHIA
Minus
Plus
Minus
SOPHIA
Overworld Map
General Notes
You only need to use one or the other of the Gecko codes or pre-patched WAD. If you're booting via a method which can apply Gecko codes, that will be much easier. If you need the hack patched directly into the game (e.g. for use as a Wii U injection), use the WAD patches.
Hacking WiiWare titles is a lot more difficult than I expected. Gecko codes loaded via app work exactly as they do for disc games, but appending a code section to the main.dol prevents the title from booting. That's why the WAD patches are here, primarily for anybody who wants to use this as a Wii U Wii VC injection.
The WAD patches completely break accelerometer compatibility, as I needed somewhere to inject the patches and the accelerometer is not used here except to help the Wii Remote locate the sensor bar while the Home Button Menu is open. Too bad.
This is not a workable solution for games which do use the accelerometer. I don't have a plan for what to do in that situation currently. Besides, this was a lot of extra effort because I had to manually create every branch to and from modified code, since I no longer have a code handler running here. Look at me. I'm the code handler now.
The major addition here is twin-stick controls for the top-down stages. As an alternative to moving and aiming with the D-Pad/Left Stick, this allows you to move with the D-Pad/Left Stick and shoot in any direction with the Right Stick. Blaster Master: Overdrive can be quite challenging, so this is very helpful.
Obviously, if you prefer the traditional controls, they are also preserved here. You can just use the normal movement, shoot and strafe buttons and ignore the Right Stick.
While some mappings might seem odd (A on L/ZL; Plus on X), this control scheme is largely adapted from the Blaster Master Zero trilogy which followed this game. If you've played any of those games, you should be right at home here. The only other slightly weird thing is mapping 1 to both Y and A. This game has inverted Confirm/Cancel controls, so this was solely done to make menu navigation work naturally while keeping Shoot on Y. Or you can shoot with A and Confirm with Y if you're weird like that.
Blaster Master: Overdrive is a pretty 6/10 kind of game. I have a soft spot for it as I really like the Blaster Master franchise, but there's a reason this one has been forgotten. It's not a series low-point like Blaster Master 2 for Sega Genesis but neither does it reach the highs of the original game or the modern Blaster Master Zero trilogy. Still, at the time of release it was probably the second-best mainline game in the series (not as good as the NES original but better than the Game Boy Color version).
Fixing the controls and making it less blurry doesn't completely redeem the game, but maybe it takes it from a 6 to a 6.5. It's not a hidden gem, it's not a forgotten classic, it's just an all right game held back by controls and visuals that aren't all right. Give it a shot if you really like Blaster Master games.
EDIT: Bonus note. Back when this game launched in 2010, publisher Gaijinworks's Victor Ireland made a number of posts on gaming message boards about his intention to push Sunsoft to release an update to add Classic Controller and progressive scan support. That never ended up happening, but even though it took 14 years, we've finally made it to the future.
Technical Notes
Yeesh, this really blew out. Writing the original Gecko codes went about as well as any disc-based game, but when it came to injecting the hacks into the WAD, everything got a lot more complicated. I don't really know anything about the NAND title loading process, but my understanding is that a loader.bin file runs before the actual title contents. I think it must be this which fails to handle the expanded main.dol. At a guess, the situation is something like, the expanded main.dol bumps up the addressing where all other data is placed in memory by the loader.bin, so none of the data is where the code inside main.dol expects to find it any more and it immediately falls apart when it tries to read it. Is this fixable? Can somebody fix this? Please? A way to apply code modifications to WiiWare that is less "manual" would be great.
Quickly skimming through the different parts of the Classic Controller hack, you've got a C2 for the pointer in calc_dpd_variable(), a C2 in read_kpad_ext() for the left stick emulation and twin-stick aiming support (I'll come back to that) and another C2 in read_kpad_button() for the button input.
The twin-stick aiming code is kind of spaghetti. It's derived from the standard D-Pad emulation setup, but has to do a bunch of trickery to accommodate movement on the real D-Pad/Left Stick and aiming on the Right Stick when the original game was controlled entirely on a single D-Pad. The way this is done is that any time you move the Right Stick in a new direction, D-Pad emulation occurs on that stick for a single frame. The right stick also handles "pressing" the shoot and strafe buttons for you. Broken down frame by frame, here's how it works:
frame 0: player is holding D-Pad Right and Alex is running to the right
frame 1: player moves Right Stick to the left
for a single frame, D-Pad emulation occurs on the right stick and Alex turns to face left
at the same time, the shoot button is pressed and held and Alex begins shooting left
frame 2+: the strafe button is pressed and held so that Alex continues facing/shooting left
at the same time, normal D-Pad operation is restored and Alex resumes moving to the right
... time passes ...
frame 201: the player moves the Right Stick from the left to the up-left position
for a single frame, the strafe button is released so that Alex can turn to face the new direction
for that same frame, D-Pad emulation is back on the right stick and Alex turns to face up-left
frame 202+: the strafe button is pressed and held so that Alex continues facing/shooting up-left
at the same time, normal D-Pad operation is restored and Alex resumes moving to the right
In this way, everything that's happening is technically possible in normal gameplay with frame perfect input, since that's all this is. Arguably, it's not twin-stick aiming, it's tool-assisted frame-perfect strafing.
Can you verify your backup in dolphin? Right click the game, properties, and verify the backup.
If its a bad dump, re install it from the Wii Shop Channel, dump it and try again.
Can you verify your backup in dolphin? Right click the game, properties, and verify the backup.
If its a bad dump, re install it from the Wii Shop Channel, dump it and try again.
Dude, piracy is not allowed. Please legally extract your game if this is some joke, if not, please leave. This thread does not support piracy. GBA temp does not support piracy either.
This hack does not support the left stick as the D pad. I do not know why. I have tried copying @Vague Rant 's D pad assembly and add it to my hack, but it just does not work.
(Any idea why that is?)
That's fantastic, great work. I just took a look at Wii Play and like Excite Truck (another launch title), KPAD is quite different to how it works in basically anything else but launch titles. That's why you had trouble with the D-Pad emulation and stuff. The D-Pad assembly hack would need some changes to work on this or other launch titles. If you don't mind, I'll add Wii Play to my investigate list and see if I can add D-Pad emulation or Nunchuk support to your code as a collab.
@Vague Rant I am sad to report that Uno may be one of those games that does not use KPADRead. I looked into it earlier and i could not trace read_kpad_dpd at all in the KPAD read strategy you use.
I took a look at Uno too, it definitely uses KPADRead, it's just a bit tougher to locate because of the newish SDK in use. Once I found it (via WPADProbe()) I was able to get a CC hack up pretty quick, since this game only needs the buttons and pointer. I still need to port the code to other regions and generate an IPS patch/builder script, so I'm not posting the code yet, but I don't foresee any major problems so this should be out soon-ish.
I think the D-Pad thing is probably an issue with the poll count register. IIRC, my assembly hack checks whether r15 is equal to 0x1 before it continues. The tl;dr here is that while the buttons only get polled once, all of the analog stuff (sticks, accelerometers, pointer) get polled multiple times each frame. Since that's not needed for D-Pad emulation, I only do D-Pad emulation using the data from the final poll. The poll count decrements (goes down) from somewhere between 6 and 3, depending on the game. One of the registers holds how many polls are still left to do. Most of the time it's r15, but I've seen it in r19, r20 and r22 as well.
If the game you're looking at is using a different register for the poll count, checking r15 won't work. To find the correct register, set a breakpoint inside read_kpad_stick() (where the bctrl instruction is) and then look at the register list in Dolphin. Hit Play and look at which ones are displayed in red, indicating that their values have changed. If you find one that looks something like: 3, 2, 1, 3, 2, 1, 3, 2, 1 (changing each time you hit Play in Dolphin), you've found the poll register. Then you can edit the assembly to make the poll check use that register which should fix D-Pad emulation.
Unfortunately, there's not really a simple way to just write in Nunchuk values. That will require you to write some code specific to the individual game you're looking at to handle Classic/Nunchuk stick support. I can give an example, but it's only going to be specific to the one game I did it for. Here we go.
Inside the button injector assembly, add an instruction li r4, 1 to make the game skip writing out the Classic Controller button values. You can see examples of this in any of my recent hacks in the Technical Notes section.
These would otherwise write to 0x60(r3). That's where the Classic Controller handles its buttons, but also where the Nunchuk handles its analog stick, so if we're pretending to be a Nunchuk, we can't have CC buttons stored there.
Locate where read_kpad_stick() sets the address to write the Left Stick (or Right Stick if you're emulating the Nunchuk stick there) data in KPADStatus.
This part is pretty easy, especially because you're already tracking down those bctrl instructions. Here's the section you're interested in (example uses Left Stick):
The specific address you want to adjust is the one with the addi r3, r30, 12, so 802a07c8 in this example.
Modify this with an 04 Gecko codetype, replacing the instruction with an mr r3, r30. The code will look like this:
Code:
042A07C8 7FC3F378
The 04 codetype replaces a single word (4 bytes) at a single address. You take the address you want to patch and replace 80 with 04 then put the assembled replacement (In this case, the mr instruction) on the right side.
Follow the process I gave in this previous post to identify where the game handles reading the Nunchuk.
Write some code to tell the game to read the Nunchuk stick even though the Nunchuk is not available.
This will look different for every game, so anything beyond this point won't be particularly useful unless you're hacking the same game as me. Here's the code from the example I'm using currently:
Code:
; classic is nunchuk
; 80224770 for USA
extsb r6, r4
mulli r6, r6, 0xF00
add r6, r3, r6
lbz r0, 0xBC(r6)
cmpwi r0, 0x2
bne- RETURN
li r0, 0x1
stb r0, 0xBC(r6)
RETURN:
li r0, 0x0
lis r6, 0x8032
For this game, it was necessary to generate a pointer to the controller data (that's what the first three instructions are doing), then read in the extension value. Classic Controller is 2, so if the value is not2 we just return (restoring the registers we clobbered with our extension check), otherwise we replace the extension byte with 1 (Nunchuk) and write it back to the controller data so that any future checks will believe we have a Nunchuk connected.
If the Left Stick now handles Nunchuk interactions, you're done.
Currently im looking into Wii Music. I think my next game will be Sonic and the Secret Rings.
Vague, do you know any of the data you used in Fluidity for tilting? Perhaps that could be re used for this game. Maybe make the job simpler!
The main thing to know for Fluidity was that the water and ice forms used the raw accelerometer data (addresses at 0x0C(r3), 0x10(r3) and 0x14(r3) in KPADStatus while the cloud uses the vertical angle (vertical because the Wiimote is held sideways, so this is effectively the horizontal angle of the Wiimote in real terms) generated by calc_dpd_variable() at 0x58(r3). That was probably fairly specific to Fluidity though, it might only be relevant to other heavily tilting-based games like Super Monkey Ball.
This is definitely odd, it sounds like your WAD is missing a file when it unpacks before the rebuild. I'll try to find if I can replicate what's causing this behavior. Thanks for reporting.
Lego Star Wars: The Complete Saga is an enhanced collection of the first two Lego Star Wars games (previously released on GameCube and other platforms). With improved graphics and level designs, new characters, extra collectibles and even the option to go back and play the original unmodified levels, this marked the definitive way to play the original Lego Star Wars games.
Gameplay
Attack
(use B)
Speed Up Building
(get the Red Brick)
Wiimote Pointer
Left Stick
Home Button Menu
Navigation
Nunchuk Stick
Left Stick
Menus
Navigation Gameplay
Movement
Nunchuk C
X
Gameplay
Switch Character
(Story)
Nunchuk Z
A
ZL
Gameplay
Interact
(Build, Force, etc.)
Nunchuk Shake
Not mapped
Gameplay
Speed Up Force/Building
(get the Red Brick)
General Notes
This game has multiple revisions in USA and EUR. I have only hacked the latest revision (Rev 1) for each version. I don't know what will happen if you try to use these codes on a USA/EUR Rev 0 game, but they probably won't work. Maybe try the JPN version code, since that's Rev 0 also. Once again, I have no idea whether that will work.
As mentioned in the Button Mapping table, I have not implemented any of the accelerometer stuff here at all. It's all optional and while it's nice to be able to speed up Force powers and Lego builds, there are Red Bricks which permanently enable Fast Force/Builds, and those are how you get those boosts on all other platforms anyway. This isn't entirely out of laziness, I just wasn't able to get the game to recognize alternating Wiimote/Nunchuk shakes and since they're extremely optional here anyway, they're not included at all.
The control scheme here is cribbed from the other platforms/later Lego games on Wii U, etc. This does give you some mildly weird Confirm/Cancel controls, but you don't spend that much time navigating menus in Lego games, anyway. If you don't like this control scheme, the assembly for the button injector is in the Technical Notes section, so you can remap it any way you like.
Technical Notes
Code breakdown:
C2: enable reading Nunchuk Stick while Classic Controller is connected
C2 in calc_dpd_variable(): IR pointer emulation
04 in read_kpad_stick(): Classic -> Nunchuk stick redirection
C2 in KPADRead(): button injector
Code:
; KPADRead
; 8032F380 for USA (Rev 1)/EUR (Rev 1)
; 8033B608 for JPN
; r4 holds extType
; r7 holds wiimote bitfield
; r8 holds wiimote+nunchuk bitfield
; r9 holds classic bitfield
CLASSIC:
cmpwi r4, 0x2
bne- RETURN
li r4, 0x1 ; i'm a nunchuk
CLASSIC_HOME:
andi. r0, r9, 0x800
beq- CLASSIC_UP
ori r8, r8, 0x8000 ; home
CLASSIC_UP:
andi. r0, r9, 0x1
beq- CLASSIC_DOWN
ori r8, r8, 0x8 ; up (v) / left (h)
CLASSIC_DOWN:
andi. r0, r9, 0x4000
beq- CLASSIC_LEFT
ori r8, r8, 0x4 ; down (v) / right (h)
CLASSIC_LEFT:
andi. r0, r9, 0x2
beq- CLASSIC_RIGHT
ori r8, r8, 0x1 ; left (v) / down (h)
CLASSIC_RIGHT:
andi. r0, r9, 0x8000
beq- CLASSIC_A
ori r8, r8, 0x2 ; right (v) / up (h)
CLASSIC_A:
andi. r0, r9, 0x10
beq- CLASSIC_B
ori r8, r8, 0x2000 ; z
CLASSIC_B:
andi. r0, r9, 0x40
beq- CLASSIC_X
ori r8, r8, 0x800 ; a
CLASSIC_X:
andi. r0, r9, 0x8
beq- CLASSIC_Y
ori r8, r8, 0x4000 ; c
CLASSIC_Y:
andi. r0, r9, 0x20
beq- CLASSIC_L
ori r8, r8, 0x400 ; b
CLASSIC_L:
andi. r0, r9, 0x2000
beq- CLASSIC_R
ori r8, r8, 0x200 ; 1
CLASSIC_R:
andi. r0, r9, 0x200
beq- CLASSIC_ZL
ori r8, r8, 0x100 ; 2
CLASSIC_ZL:
andi. r0, r9, 0x80
beq- CLASSIC_ZR
ori r8, r8, 0x2000 ; z
CLASSIC_ZR:
andi. r0, r9, 0x4
beq- CLASSIC_PLUS
ori r8, r8, 0x400 ; b
CLASSIC_PLUS:
andi. r0, r9, 0x400
beq- CLASSIC_MINUS
ori r8, r8, 0x10 ; plus
CLASSIC_MINUS:
andi. r0, r9, 0x1000
beq- RETURN
ori r8, r8, 0x1000 ; minus
RETURN:
or r7, r7, r8
andi. r0, r7, 0x9FFF
Flip's Twisted World is irredeemably awful, literally the worst game I have played in my life. Here's a Classic Controller hack.
This game is absolutely terrible. I was interested in whether a CC hack could improve it, and maybe it does a little bit, but it's such a miserable experience that nothing short of firing it directly into the Sun would improve it by an appreciable amount. In the brief period I spent testing, I had multiple crashes, culminating in a game-breaking bug which permanently hardlocked my save, forcing me to start a new game to continue testing. I don't think the concept itself is bad but everything about this game is fundamentally broken. Don't play this game, don't use this hack, shun everybody who thought it was acceptable to release this game.
Camera rotation is inverted in the original game, the Right Stick mapping in this hack un-inverts it. I was going to make a version without that feature but I forgot and don't care. Uh, if you want to re-invert the directions, Ctrl+F in the code for C03E0014 FC200850 and replace it with C03E0014 60000000. You monster. Have I told you this game is atrocious yet? Why are you still reading this?
If for whatever disgusting reason you try this game out in Dolphin, let me know whether it works for you. This game (even pre-hack) black screens on Dolphin for me when I try to start a save, so this whole hack was done old-school on real hardware. That's not why I hate the game, it's just that it's incomprehensibly poor, these are unrelated things. Still, if this is a genuine bug, somebody should report it to Dolphin. That said, my PC doesn't meet the minimum specs for Dolphin, so it could just be a me problem.
If it turns out this game doesn't work in Dolphin, then frankly that's a feature, not a bug.
Technical Notes
Code breakdown:
C2: enable reading Nunchuk Stick while Classic Controller is connected (code from example above)
C2: bypass Nunchuk error
C2 in read_kpad_acc(): fake Wiimote shakes, dummy out all real ACC data
C2 in calc_dpd_variable(): IR pointer emulation
04 and C2 in read_kpad_stick(): Classic -> Nunchuk stick redirection, D-Pad emulation
C2 in read_kpad_button(): button injector
Code:
; read_kpad_button
; 8029E734 for USA
cmpwi r4, 0x2
bne- RETURN
li r4, 0x1 ; i'm a nunchuk
CLASSIC_HOME:
andi. r0, r8, 0x800
beq- CLASSIC_UP
ori r7, r7, 0x8000 ; home
CLASSIC_UP:
andi. r0, r8, 0x1
beq- CLASSIC_DOWN
ori r7, r7, 0x8 ; up (v) / left (h)
CLASSIC_DOWN:
andi. r0, r8, 0x4000
beq- CLASSIC_LEFT
ori r7, r7, 0x4 ; down (v) / right (h)
CLASSIC_LEFT:
andi. r0, r8, 0x2
beq- CLASSIC_RIGHT
ori r7, r7, 0x1 ; left (v) / down (h)
CLASSIC_RIGHT:
andi. r0, r8, 0x8000
beq- CLASSIC_A
ori r7, r7, 0x2 ; right (v) / up (h)
CLASSIC_A:
andi. r0, r8, 0x10
beq- CLASSIC_B
ori r7, r7, 0x1000 ; minus
CLASSIC_B:
andi. r0, r8, 0x40
beq- CLASSIC_X
ori r7, r7, 0x800 ; a
CLASSIC_X:
andi. r0, r8, 0x8
beq- CLASSIC_Y
ori r7, r7, 0x10 ; plus
CLASSIC_Y:
andi. r0, r8, 0x20
beq- CLASSIC_L
ori r7, r7, 0x80 ; shake
CLASSIC_L:
andi. r0, r8, 0x2000
beq- CLASSIC_R
ori r7, r7, 0x4000 ; c
CLASSIC_R:
andi. r0, r8, 0x200
beq- CLASSIC_ZL
ori r7, r7, 0x4000 ; c
CLASSIC_ZL:
andi. r0, r8, 0x80
beq- CLASSIC_ZR
ori r7, r7, 0x2000 ; z
CLASSIC_ZR:
andi. r0, r8, 0x4
beq- CLASSIC_PLUS
ori r7, r7, 0x400 ; b
CLASSIC_PLUS:
andi. r0, r8, 0x400
beq- CLASSIC_MINUS
ori r7, r7, 0x200 ; 1
CLASSIC_MINUS:
andi. r0, r8, 0x1000
beq- CLASSIC_DONE
ori r7, r7, 0x100 ; 2
CLASSIC_DONE:
or r6, r6, r7
RETURN:
andi. r0, r6, 0x9FFF
I really appreciate this efforts!
I would really appreciate a Classic Controller hack for Sonic Riders Zero Gravity. For some reason the game supports the GameCube controller but not the Classic Controller and it is one of the cases that I think the motion controls are awful.
That's fantastic, great work. I just took a look at Wii Play and like Excite Truck (another launch title), KPAD is quite different to how it works in basically anything else but launch titles. That's why you had trouble with the D-Pad emulation and stuff. The D-Pad assembly hack would need some changes to work on this or other launch titles. If you don't mind, I'll add Wii Play to my investigate list and see if I can add D-Pad emulation or Nunchuk support to your code as a collab.
I took a look at Uno too, it definitely uses KPADRead, it's just a bit tougher to locate because of the newish SDK in use. Once I found it (via WPADProbe()) I was able to get a CC hack up pretty quick, since this game only needs the buttons and pointer. I still need to port the code to other regions and generate an IPS patch/builder script, so I'm not posting the code yet, but I don't foresee any major problems so this should be out soon-ish.
I think the D-Pad thing is probably an issue with the poll count register. IIRC, my assembly hack checks whether r15 is equal to 0x1 before it continues. The tl;dr here is that while the buttons only get polled once, all of the analog stuff (sticks, accelerometers, pointer) get polled multiple times each frame. Since that's not needed for D-Pad emulation, I only do D-Pad emulation using the data from the final poll. The poll count decrements (goes down) from somewhere between 6 and 3, depending on the game. One of the registers holds how many polls are still left to do. Most of the time it's r15, but I've seen it in r19, r20 and r22 as well.
If the game you're looking at is using a different register for the poll count, checking r15 won't work. To find the correct register, set a breakpoint inside read_kpad_stick() (where the bctrl instruction is) and then look at the register list in Dolphin. Hit Play and look at which ones are displayed in red, indicating that their values have changed. If you find one that looks something like: 3, 2, 1, 3, 2, 1, 3, 2, 1 (changing each time you hit Play in Dolphin), you've found the poll register. Then you can edit the assembly to make the poll check use that register which should fix D-Pad emulation.
Unfortunately, there's not really a simple way to just write in Nunchuk values. That will require you to write some code specific to the individual game you're looking at to handle Classic/Nunchuk stick support. I can give an example, but it's only going to be specific to the one game I did it for. Here we go.
Inside the button injector assembly, add an instruction li r4, 1 to make the game skip writing out the Classic Controller button values. You can see examples of this in any of my recent hacks in the Technical Notes section.
These would otherwise write to 0x60(r3). That's where the Classic Controller handles its buttons, but also where the Nunchuk handles its analog stick, so if we're pretending to be a Nunchuk, we can't have CC buttons stored there.
Locate where read_kpad_stick() sets the address to write the Left Stick (or Right Stick if you're emulating the Nunchuk stick there) data in KPADStatus.
This part is pretty easy, especially because you're already tracking down those bctrl instructions. Here's the section you're interested in (example uses Left Stick):
The specific address you want to adjust is the one with the addi r3, r30, 12, so 802a07c8 in this example.
Modify this with an 04 Gecko codetype, replacing the instruction with an mr r3, r30. The code will look like this:
Code:
042A07C8 7FC3F378
The 04 codetype replaces a single word (4 bytes) at a single address. You take the address you want to patch and replace 80 with 04 then put the assembled replacement (In this case, the mr instruction) on the right side.
Follow the process I gave in this previous post to identify where the game handles reading the Nunchuk.
Write some code to tell the game to read the Nunchuk stick even though the Nunchuk is not available.
This will look different for every game, so anything beyond this point won't be particularly useful unless you're hacking the same game as me. Here's the code from the example I'm using currently:
Code:
; classic is nunchuk
; 80224770 for USA
extsb r6, r4
mulli r6, r6, 0xF00
add r6, r3, r6
lbz r0, 0xBC(r6)
cmpwi r0, 0x2
bne- RETURN
li r0, 0x1
stb r0, 0xBC(r6)
RETURN:
li r0, 0x0
lis r6, 0x8032
For this game, it was necessary to generate a pointer to the controller data (that's what the first three instructions are doing), then read in the extension value. Classic Controller is 2, so if the value is not2 we just return (restoring the registers we clobbered with our extension check), otherwise we replace the extension byte with 1 (Nunchuk) and write it back to the controller data so that any future checks will believe we have a Nunchuk connected.
If the Left Stick now handles Nunchuk interactions, you're done.
The main thing to know for Fluidity was that the water and ice forms used the raw accelerometer data (addresses at 0x0C(r3), 0x10(r3) and 0x14(r3) in KPADStatus while the cloud uses the vertical angle (vertical because the Wiimote is held sideways, so this is effectively the horizontal angle of the Wiimote in real terms) generated by calc_dpd_variable() at 0x58(r3). That was probably fairly specific to Fluidity though, it might only be relevant to other heavily tilting-based games like Super Monkey Ball.
This is definitely odd, it sounds like your WAD is missing a file when it unpacks before the rebuild. I'll try to find if I can replicate what's causing this behavior. Thanks for reporting.
Lego Star Wars: The Complete Saga is an enhanced collection of the first two Lego Star Wars games (previously released on GameCube and other platforms). With improved graphics and level designs, new characters, extra collectibles and even the option to go back and play the original unmodified levels, this marked the definitive way to play the original Lego Star Wars games.
Gameplay
Attack
(use B)
Speed Up Building
(get the Red Brick)
Wiimote Pointer
Left Stick
Home Button Menu
Navigation
Nunchuk Stick
Left Stick
Menus
Navigation Gameplay
Movement
Nunchuk C
X
Gameplay
Switch Character
(Story)
Nunchuk Z
A
ZL
Gameplay
Interact
(Build, Force, etc.)
Nunchuk Shake
Not mapped
Gameplay
Speed Up Force/Building
(get the Red Brick)
General Notes
This game has multiple revisions in USA and EUR. I have only hacked the latest revision (Rev 1) for each version. I don't know what will happen if you try to use these codes on a USA/EUR Rev 0 game, but they probably won't work. Maybe try the JPN version code, since that's Rev 0 also. Once again, I have no idea whether that will work.
As mentioned in the Button Mapping table, I have not implemented any of the accelerometer stuff here at all. It's all optional and while it's nice to be able to speed up Force powers and Lego builds, there are Red Bricks which permanently enable Fast Force/Builds, and those are how you get those boosts on all other platforms anyway. This isn't entirely out of laziness, I just wasn't able to get the game to recognize alternating Wiimote/Nunchuk shakes and since they're extremely optional here anyway, they're not included at all.
The control scheme here is cribbed from the other platforms/later Lego games on Wii U, etc. This does give you some mildly weird Confirm/Cancel controls, but you don't spend that much time navigating menus in Lego games, anyway. If you don't like this control scheme, the assembly for the button injector is in the Technical Notes section, so you can remap it any way you like.
Technical Notes
Code breakdown:
C2: enable reading Nunchuk Stick while Classic Controller is connected
C2 in calc_dpd_variable(): IR pointer emulation
04 in read_kpad_stick(): Classic -> Nunchuk stick redirection
C2 in read_kpad_button(): button injector
Code:
; KPADRead
; 8032F380 for USA (Rev 1)/EUR (Rev 1)
; 8033B608 for JPN
; r4 holds extType
; r7 holds wiimote bitfield
; r8 holds wiimote+nunchuk bitfield
; r9 holds classic bitfield
CLASSIC:
cmpwi r4, 0x2
bne- RETURN
li r4, 0x1 ; i'm a nunchuk
CLASSIC_HOME:
andi. r0, r9, 0x800
beq- CLASSIC_UP
ori r8, r8, 0x8000 ; home
CLASSIC_UP:
andi. r0, r9, 0x1
beq- CLASSIC_DOWN
ori r8, r8, 0x8 ; up (v) / left (h)
CLASSIC_DOWN:
andi. r0, r9, 0x4000
beq- CLASSIC_LEFT
ori r8, r8, 0x4 ; down (v) / right (h)
CLASSIC_LEFT:
andi. r0, r9, 0x2
beq- CLASSIC_RIGHT
ori r8, r8, 0x1 ; left (v) / down (h)
CLASSIC_RIGHT:
andi. r0, r9, 0x8000
beq- CLASSIC_A
ori r8, r8, 0x2 ; right (v) / up (h)
CLASSIC_A:
andi. r0, r9, 0x10
beq- CLASSIC_B
ori r8, r8, 0x2000 ; z
CLASSIC_B:
andi. r0, r9, 0x40
beq- CLASSIC_X
ori r8, r8, 0x800 ; a
CLASSIC_X:
andi. r0, r9, 0x8
beq- CLASSIC_Y
ori r8, r8, 0x4000 ; c
CLASSIC_Y:
andi. r0, r9, 0x20
beq- CLASSIC_L
ori r8, r8, 0x400 ; b
CLASSIC_L:
andi. r0, r9, 0x2000
beq- CLASSIC_R
ori r8, r8, 0x200 ; 1
CLASSIC_R:
andi. r0, r9, 0x200
beq- CLASSIC_ZL
ori r8, r8, 0x100 ; 2
CLASSIC_ZL:
andi. r0, r9, 0x80
beq- CLASSIC_ZR
ori r8, r8, 0x2000 ; z
CLASSIC_ZR:
andi. r0, r9, 0x4
beq- CLASSIC_PLUS
ori r8, r8, 0x400 ; b
CLASSIC_PLUS:
andi. r0, r9, 0x400
beq- CLASSIC_MINUS
ori r8, r8, 0x10 ; plus
CLASSIC_MINUS:
andi. r0, r9, 0x1000
beq- RETURN
ori r8, r8, 0x1000 ; minus
RETURN:
or r7, r7, r8
andi. r0, r7, 0x9FFF
This game is absolutely terrible. I was interested in whether a CC hack could improve it, and maybe it does a little bit, but it's such a miserable experience that nothing short of firing it directly into the Sun would improve it by an appreciable amount. In the brief period I spent testing, I had multiple crashes, culminating in a game-breaking bug which permanently hardlocked my save, forcing me to start a new game to continue testing. I don't think the concept itself is bad but everything about this game is fundamentally broken. Don't play this game, don't use this hack, shun everybody who thought it was acceptable to release this game.
Camera rotation is inverted in the original game, the Right Stick mapping in this hack un-inverts it. I was going to make a version without that feature but I forgot and don't care. Uh, if you want to re-invert the directions, Ctrl+F in the code for C03E0014 FC200850 and replace it with C03E0014 60000000. You monster. Have I told you this game is atrocious yet? Why are you still reading this?
If for whatever disgusting reason you try this game out in Dolphin, let me know whether it works for you. This game (even pre-hack) black screens on Dolphin for me when I try to start a save, so this whole hack was done old-school on real hardware. That's not why I hate the game, it's just that it's incomprehensibly poor, these are unrelated things. Still, if this is a genuine bug, somebody should report it to Dolphin. That said, my PC doesn't meet the minimum specs for Dolphin, so it could just be a me problem.
If it turns out this game doesn't work in Dolphin, then frankly that's a feature, not a bug.
Technical Notes
Code breakdown:
C2: enable reading Nunchuk Stick while Classic Controller is connected (code from example above)
C2: bypass Nunchuk error
C2 in read_kpad_acc(): fake Wiimote shakes, dummy out all real ACC data
C2 in calc_dpd_variable(): IR pointer emulation
04 and C2 in read_kpad_stick(): Classic -> Nunchuk stick redirection, D-Pad emulation
C2 in read_kpad_button(): button injector
Code:
; read_kpad_button
; 8029E734 for USA
cmpwi r4, 0x2
bne- RETURN
li r4, 0x1 ; i'm a nunchuk
CLASSIC_HOME:
andi. r0, r8, 0x800
beq- CLASSIC_UP
ori r7, r7, 0x8000 ; home
CLASSIC_UP:
andi. r0, r8, 0x1
beq- CLASSIC_DOWN
ori r7, r7, 0x8 ; up (v) / left (h)
CLASSIC_DOWN:
andi. r0, r8, 0x4000
beq- CLASSIC_LEFT
ori r7, r7, 0x4 ; down (v) / right (h)
CLASSIC_LEFT:
andi. r0, r8, 0x2
beq- CLASSIC_RIGHT
ori r7, r7, 0x1 ; left (v) / down (h)
CLASSIC_RIGHT:
andi. r0, r8, 0x8000
beq- CLASSIC_A
ori r7, r7, 0x2 ; right (v) / up (h)
CLASSIC_A:
andi. r0, r8, 0x10
beq- CLASSIC_B
ori r7, r7, 0x1000 ; minus
CLASSIC_B:
andi. r0, r8, 0x40
beq- CLASSIC_X
ori r7, r7, 0x800 ; a
CLASSIC_X:
andi. r0, r8, 0x8
beq- CLASSIC_Y
ori r7, r7, 0x10 ; plus
CLASSIC_Y:
andi. r0, r8, 0x20
beq- CLASSIC_L
ori r7, r7, 0x80 ; shake
CLASSIC_L:
andi. r0, r8, 0x2000
beq- CLASSIC_R
ori r7, r7, 0x4000 ; c
CLASSIC_R:
andi. r0, r8, 0x200
beq- CLASSIC_ZL
ori r7, r7, 0x4000 ; c
CLASSIC_ZL:
andi. r0, r8, 0x80
beq- CLASSIC_ZR
ori r7, r7, 0x2000 ; z
CLASSIC_ZR:
andi. r0, r8, 0x4
beq- CLASSIC_PLUS
ori r7, r7, 0x400 ; b
CLASSIC_PLUS:
andi. r0, r8, 0x400
beq- CLASSIC_MINUS
ori r7, r7, 0x200 ; 1
CLASSIC_MINUS:
andi. r0, r8, 0x1000
beq- CLASSIC_DONE
ori r7, r7, 0x100 ; 2
CLASSIC_DONE:
or r6, r6, r7
RETURN:
andi. r0, r6, 0x9FFF
It’s been a good while but we’re back with GBAtemp’s Project Spotlight, a series where we try to shine a light on the incredible projects and creations of our larger...
After months of countless leaks, Nintendo has finally lifted the curtain on the highly anticipated successor to the Nintendo Switch.
In a short teaser trailer we are...
We've seen quite a few leaks, renders and mockups of the so-called "Nintendo Switch 2" recently which could indicate that the official announcement is imminent. After...
Harbour Masters have completed their project of porting a reverse engineered version of Star Fox 64 to PC. The makers of the highly regarded PC port of The Legend of...
Markus Persson, the creator of Minecraft, also known as Notch, soft-announced a Minecraft spiritual successor over X. He had initially announced plans for such a game...
If you've ever wished for Super Mario Galaxy's level design to be crossed over with the gameplay of Super Mario Odyssey, then you're in luck, because fans are making...
Several news outlets and alleged insiders are reporting lately that an imminent Switch 2 reveal is about to happen on this week, specifically on Thursday, January...
The first big Nintendo release of the year also brings about the first big Nintendo game leak of the year. Leaked onto the internet two days before its release is...
Back in October 2024, Game Freak suffered a data breach, with a hacker gaining access to GF's coding repositories and leaking internal data from the company, as well...
Nintendo has remained completely quiet as to all details about the successor console to the Nintendo Switch. Despite that, information has been trickling out, in the...
After months of countless leaks, Nintendo has finally lifted the curtain on the highly anticipated successor to the Nintendo Switch.
In a short teaser trailer we are...
Several news outlets and alleged insiders are reporting lately that an imminent Switch 2 reveal is about to happen on this week, specifically on Thursday, January...
We've seen quite a few leaks, renders and mockups of the so-called "Nintendo Switch 2" recently which could indicate that the official announcement is imminent. After...
Markus Persson, the creator of Minecraft, also known as Notch, soft-announced a Minecraft spiritual successor over X. He had initially announced plans for such a game...
It’s been a good while but we’re back with GBAtemp’s Project Spotlight, a series where we try to shine a light on the incredible projects and creations of our larger...
Merry Christmas, GBAtemp Family!
As the holiday season wraps us in its warm embrace, we want to take a moment to thank each of you for making GBAtemp the incredible...
The first big Nintendo release of the year also brings about the first big Nintendo game leak of the year. Leaked onto the internet two days before its release is...
Originally, Assassin's Creed Shadows was due to launch in November 2024. Citing issues with pacing and polish, Ubisoft pushed the game back to a February 2025 window...
Nintendo has remained completely quiet as to all details about the successor console to the Nintendo Switch. Despite that, information has been trickling out, in the...
If you've ever wished for Super Mario Galaxy's level design to be crossed over with the gameplay of Super Mario Odyssey, then you're in luck, because fans are making...