Mario Kart Wii Gecko Codes, Cheats, & Hacks
Address for checking if player is grounded - Printable Version

+- Mario Kart Wii Gecko Codes, Cheats, & Hacks (https://mariokartwii.com)
+-- Forum: Hacks/Modding (https://mariokartwii.com/forumdisplay.php?fid=14)
+--- Forum: Code Support / Help / Requests (https://mariokartwii.com/forumdisplay.php?fid=61)
+--- Thread: Address for checking if player is grounded (/showthread.php?tid=1795)



Address for checking if player is grounded - Minekonst - 03-24-2021

Hello Guys,
Does somebody know of an memory address which tells, whether the player is currently touching the ground? (If it makes any difference, I need this for timetrails)
I tried searching with the Memory Engine for Dolphin, but the addresses I found did only work on one track. It might be that you have to get them over a pointer. In general, what can I do to search for pointers, if I already have the current address?
 
I am using the US NTSC Version (RMCE01) of the game btw.
Thanks in advanced


RE: Address for checking if player is grounded - CLF78 - 03-24-2021

Check this out: https://github.com/SeekyCt/mkw-structures/blob/master/player.h#L235

Although this is a single bit, so you're gonna have to clear all the other ones to check. Here's a sample ASM (feel free to change the registers)

Code:
# NTSC-U Addresses
.set PlayerHolder, 0x809BD110
.set Racedata, 0x809B8F68

# Change this to whatever Exception Vector address you want
.set IsPlayerOnGround, 0x80001500

# Check gamemode == TT
lis r3, Racedata@ha
lwz r3, Racedata@l(r3)
lwz r3, 0xB70(r3)
cmpwi r3, 2
bne+ end

# Get PlayerHolder->players->player[0]->playerSub1c->bitfield0
lis r3, PlayerHolder@ha
lwz r3, PlayerHolder@l(r3)
lwz r3, 0x20(r3)
lwz r3, 0(r3)
lwz r3, 0x20(r3)
lwz r3, 0x4(r3)

# Get bit
rlwinm r3, r3, 14, 31, 31

# Store it
lis r4, IsPlayerOnGround@ha
stb r3, IsPlayerOnGround@l(r4)

# Return
end:



RE: Address for checking if player is grounded - Minekonst - 03-24-2021

Thank you. Thats exactly what I needed