Mario Kart Wii Gecko Codes, Cheats, & Hacks

Full Version: Karts Behave Like Bikes [vabold]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Karts Behave Like Bikes [vabold]

0458F550 3BE00001
04581454 40810010

04595D74 3BE00001
04587C78 40810010

045956F4 3BE00001
045875F8 40810010

04583DCC 3BE00001
04575CD0 40810010

Code creator: vabold
this code is funny xd
I forgot about this code. Quick rundown:

A bike's virtual function table differs from a kart's. The virtual function responsible for updating wheelies for karts is obviously an empty definition, but for bikes, it calls additional virtual functions for canceling, trying to start, and starting wheelies. These virtual functions (along with some other wheelie-specific data members) aren't present for karts, which is why something like 048B5FB4 80587D64 (PAL) can't work. Instead, the first patch forces the enum controlling which class to create to be a bike regardless of the settings.

However, this introduces a new crash. Bikes have a pointer to a struct containing turning parameters, and the game assumes the vehicle type must be either an outside drifting bike or inside drifting bike to set it. Because the vehicle type is determined externally by kartParam.bin, the simplest fix is including the outside drifting kart case into the first case. Because the comparison is done with cmplwi against 0x1 (outside drifting bikes) and we need to include 0x0 (outside drifting karts), the second patch replaces beq with ble.