Mario Kart Wii - Unused Item Position Debug Print #2
This video shows an unused debug print functionality that would have printed the position of a given item, in the following format:
"%s = (%.1f, %.1f, %.1f)"
where the first three "%.1f" are the X, Y and Z position of the item, and the "%s" is the coordinates "type" being printed.
As for the "type", four possible types can be printed:
"pos": The current item's position
"posS": The current item's position when the player first throws the item?
"posD": The position of the Blue Shell while it's flying towards its target?
"????": Anything else
In PAL, this function can be found at VRAM address 0x807A34CC. It is unknown where the strings would have been printed, as the code that exists only formats the strings, but calling this function doesn't print the strings anywhere.
For this showcase, I changed the function so that the string is printed to the debugging console by calling OSReport instead. Not only that, but I also changed the string to replace the last parenthesis ")" with a newline character, so that it's more readable.
This code calls the debug function in one of the item's update functions, which means that everytime an item is actively in the course, its coordinates will be printed every frame. Again, this is just for demonstration purposes, as said function doesn't appear to be called anywhere in the code.
You can see this by yourself using this Gecko code. If using Dolphin Emulator, you can open the debug console by opening the emulator in Debug mode (-d), and then clicking on View - Show Log.
(Code, PAL)
C279F498 00000004
7FA3EB78 3C80807A
608434CC 7C8903A6
4E800421 807D007C
60000000 00000000
047a3540 4b9ff090
008a5321 0000000A
(Source, PAL)
Injected assembly code ###
C279F498 00000004
7FA3EB78 3C80807A
608434CC 7C8903A6
4E800421 807D007C
60000000 00000000
Inject at 8079f498 (PAL)
.set debugPrintPosition2, 0x807a34cc # PAL
mr r3, r29
lis r4, debugPrintPosition2@h
ori r4, r4, debugPrintPosition2@l
mtctr r4
bctrl
Original instruction
lwz r3, 0x7C(r29)
Call OSReport instead of vsnprintf in order to print the debug strings to the console ###
047a3540 4b9ff090
Replace the last parenthesis ")" of the string with a newline character, so that it's more readable ###
008a5321 0000000A
Other Videos By B_squo
Other Statistics
Mario Kart Wii Statistics For B_squo
There are 305,794 views in 173 videos for Mario Kart Wii. The game makes up 5 hours of published video on his channel, roughly 28.21% of Mario Kart Wii content that B_squo has uploaded to YouTube.