Notes

This is useful for codes that you only want to execute while the game is in menu/paused or if a race/battle is happening in multiplayer. I need to find a more universal code for single player and multiplayer.

If in menu or paused... D015A788 00?? D115A788 ????

If race/battle is running... D215A788 00?? D315A788 ????

States and State Activators

Steering

800F6A50 is a signed 1 byte float for player 1 that controls causes the kart to steer, with values similar to those found in the control stick activators. It might be related to "AB" spinning where you hold the breaks, gas, and turn all the same time and spin around fast. The other players presumably have the same byte separated by 0DD8 in memory like all the other state and state activators. I will make a table later. This will probably be useful for making bots that randomly turn, without the need to use control stick activators.

Character color modifiers

The color modifiers tint the color of a character. Likely used in game to make the characters flash various colors like yellow when a star is used, or to add dark or yellow tints like when going through the tunnel in Luigi's Raceway. Setting these 2 bytes to FFFF achieves a nice tinting effect. Other values can be set for all sorts of psychedelic colors. In memory, each color is separated by 10 and each player is separated by 02. Below is a table showing all the memory locations for each player's color modifier.

MK64 Character Color Modifiers

Laps

The default starting lap number and how laps are incremented when crossing the finish line can be set with the following codes. Setting the starting lap modifier to negative numbers allows more laps per race.

Source: HyperHacker's old website https://web.archive.org/web/20090423093334/http://hyperhacker.kicks-ass.org:55555/index.php?p=Codes/Mario_Kart_64

Starting lap modifier (default FFFF)
8100F94A ????
You can reduce this value to have more laps per race by starting on a negative lap number.

Number of laps counted when crossing finish line
81009562 ????

Number of laps counted when crossing finish line backward
810096AA ????

Endless race
81009564 2400

Messed up laps
81009564 AC48

It is possible to invert how laps are counted when crossing the finish line to create a "backwards race." This was attempted in this video: https://www.youtube.com/watch?v=fZfZkFYkEBQ&t=4s

Each player's current lap is stored as a 32 bit integer. Each player starts on lap 0, so the integer is 0xFFFFFFFF. After immediately crosses the finish line to start lap 1, the integer increments up to 0x00000000. Lap 2 increments to 0x00000001. Lap 3 increments to 0x00000002. When the player has finished their final lap, the integer increments to 0x00000003 and the race ends for that player. In general we can ignore the first 16 bits so that the laps progress is as follows on the second 16 bits: 0xFFFF, 0x0000, 0x0001, 0x0002, and 0x0003.

-3 = 0xFFFFFFFC
-2 = 0xFFFFFFFD
-1 = 0xFFFFFFFE
0 (default start) = 0xFFFFFFFF
1 = 0x00000000
2 = 0x00000001
3 = 0x00000002
4 and above (finish race and win) = 0x00000003

These bytes are stored in the following memory addresses for each player:

Player / CPU  First 16 bits Second 16 bits
Player 1 81164390 81164392
Player/CPU 2 81164394 81164396
Player/CPU 3 81164398 8116439A
Player/CPU 4 8116439C 8116439E
CPU 5 811643A0 811643A2
CPU 6 811643A4 811643A6
CPU 7 811643A8 811643AA
CPU 8 811643AC 811643AE

Starting a race with negative laps will not show up on the on screen "Lap ?/3" lap counter until the final three laps. It seems that this lap counter is a series of premade textures and trying to set it above 3 results in loading a glitchy texture in place of the lap number. The lap counter modifier for player 1 is as follows:

On screen lap counter modifier for Player 1

8018CAE2 00??

?? = 00 Lap 1
?? = 01 Lap 2
?? = 02 Lap 3
?? = 03 and above, nonsense texture in place of number
?? = 80 start win sequence and freeze?
?? = 90 and above, start win sequence and not freeze, Lakitu flying around waving flag

HyperHacker made an alternate lap counter which can handle more than 3 laps (Note: does not work in mpuen64+).

See: https://www.kodewerx.org/forum/viewtopic.php?f=18&t=2763#p38213yer

Distance around track