Mario Kart Wii Gecko Codes, Cheats, & Hacks
Karts Behave Like Bikes [vabold] - Printable Version

+- Mario Kart Wii Gecko Codes, Cheats, & Hacks (https://mariokartwii.com)
+-- Forum: Cheat Codes (https://mariokartwii.com/forumdisplay.php?fid=51)
+--- Forum: Offline Non-Item (https://mariokartwii.com/forumdisplay.php?fid=53)
+--- Thread: Karts Behave Like Bikes [vabold] (/showthread.php?tid=2039)



Karts Behave Like Bikes [vabold] - Vega - 03-24-2023

Karts Behave Like Bikes [vabold]

NTSC-U
0458F550 3BE00001
04581454 40810010

PAL
04595D74 3BE00001
04587C78 40810010

NTSC-J
045956F4 3BE00001
045875F8 40810010

NTSC-K
04583DCC 3BE00001
04575CD0 40810010

Code creator: vabold


RE: Karts Behave Like Bikes [vabold] - marito_yo - 03-31-2023

this code is funny xd


RE: Karts Behave Like Bikes [vabold] - vabold - 11-16-2023

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.