Mario Kart Wii - Unused Item Position Debug Print #1

Channel:
Subscribers:
1,090
Published on ● Video Link: https://www.youtube.com/watch?v=NU9rzxxkQls



Game:
Duration: 0:00
184 views
8


This video shows an unused debug print functionality that would have printed the position of a given item, in the following format:

"%d, %d, %d #%d"

where the first thre "%d" are the X, Y and Z position of the item as integers, and the "#%d" is the current course ID in decimal (in this case, SNES Mario Circuit 3 has a course ID of 24 in decimal, 0x18 in hexadecimal).
At 0:01, the live position coordinates are shown for a Green Shell, and at 0:20 the coordinates for a Blue Shell are shown as it travels the course searching for the player in 1st.

In PAL, this function can be found at VRAM address 0x807A3544. It is unknown where the strings would have been printed, as the code that exists only formats the strings to add the item position and the course ID, 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 add a newline character at the end, for demonstration purposes.
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
60843544 7C8903A6
4E800421 807D007C
60000000 00000000
047a359c 4b9ff035
008a5345 0000000A

(Source, PAL)
Injected assembly code ###
C279F498 00000004
7FA3EB78 3C80807A
60843544 7C8903A6
4E800421 807D007C
60000000 00000000

Inject at 8079f498 (PAL)

.set debugPrintPosition, 0x807a3544 # PAL

mr r3, r29
lis r4, debugPrintPosition@h
ori r4, r4, debugPrintPosition@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 ###
047a359c 4b9ff035

Add newline to the string so that it's more readable ###
008a5345 0000000A







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.