Tool-assisted game movies
When human skills are just not enough

Game Resources / DS / Super Mario 64DS

Table of contents [expand all] [collapse all]

Memory addresses for Super Mario 64 DS (USA, v1.0)

Side note : The DS framerate is around 60 FPS, but most of this game runs at 30 FPS by having a lag frame after every in-game frame (except the star select screen and the title screen), which means that almost all important addresses will update every 2 frames. Also, the input given by the player is counted when the actual game frame finishes, not during the lag itself.

The useful addresses related to a specific object derive from the object's base address. The address 0x02097490 holds a 4-byte pointer to the player's base address (which only changes if you're in the castle grounds or everywhere else). Almost all of the addresses derived from the player's base address listed here will also work for enemies' base addresses (such as speed and positions).

These are the useful addresses that have been decoded so far:

Address Size (bytes) Description
base + 0x08 1 Which character's cap you're wearing (Mario=0, Luigi=1, Wario=2, Yoshi=3)
base + 0x5C, 0x60, 0x64 4 Character's X, Y and Z positions
base + 0xA4, 0xA8, 0xAC 4 Character's X, Y and Z speeds (Y speed is always set to -32768 on the ground)
base + 0x8E 2 Facing angle
base + 0x94 2 Motion angle
base + 0x98 4 Speed
base + 0x6E3 1 Mid-air slide timer. The timer starts from 0 and increases by 1 for every two frames your character is in mid-air and above a floor during a butt slide, belly slide, or slide kick.
The timer will reset back to 0 if your character lands on a floor during the slide or after the timer reaches 30, at which point it will enter the falling state. Seems to have other purposes too.
base + 0x6ED 1 Y run timer. The timer is set to 30 when you've succesfully charged Y run and will decrease by 1 every two frames while you're running with Y held (can be preserved during any other state).
While running, if you release Y or hold neutral, the timer will reset to 0 instantly.
base + 0x391 1 Air/Ground state. This value holds 1 when you're on the ground and 0 when you're in the air.
base + 0x706 1 Water state. When in the water, this address holds a value of 1, else it will hold 0.
base + 0x370 4 This address has to do with what mode you're in (walking/jumping/swimming/crouching/etc.)
base + 0x644 4 The Y position of the floor that is under you (-2,147,483,648 if there is no floor under you)
base + 0xCC 1 Room reference (unsigned, more explanation below the board)
base(clam's) + 0x16E 2 Clam's timer (unsigned). When the clam is rendered, the timer is set to 0 and will increase by 1 every two frames while the clam is rendered. When the timer reaches 151 or more, getting
close to the clam will open it and the timer will restart to 0, and the clam will close again when it reaches 151 or more.
0x02096750 4 RNG (hexadecimal)
0x02099100 4 Frame counter associated to RNG. The RNG will be set to the value that this address is holding when you enter a new area.
0x02097454 1 Coin counter
0x02097408 1 Red coin counter
0x0208FCE5 1 Health points
0x0217A11E 1 SSL Pillar counter (also used for some other counters in the game)
0x02092780 4 Next object's unique ID (hexadecimal)
0x0217B1D4 2 Bowser's revolution speed, the higher it is the faster you’re spinning him.
0x02176464 4 Water level in the basement. Not fully tested, useful for hacking the 30 stars door skip to be easier.

The following addresses are actually less than base; this means they are probably in a separate object, so they might not always be at the same place relative to base (although they are consistent in limited testing).

Address Size (bytes) Description
base - 0x12C, 0x128, 0x124 4 Camera X, Y and Z positions
base - 0x3A 2 Camera up/down angle
base - 0x3C 2 Camera left/right angle

More informations about the addresses given

Angles are 2-byte values that use the full range from 0 to 65535 and then wrap (so an angle of 65535 is almost the same as an angle of 0). The character's facing angle controls what angle the character is drawn on the screen (relevant for long jumps, kicks, crouching, yoshi's tongue, etc.); the character's motion angle controls what direction the character is moving. When you're going in a straight line, the two angles are the same; when you're turning quickly on the ground or holding a different direction than forwards during a jump for example, the motion angle becomes different than the facing angle.

Despite the speed address displaying really high numbers when shown as integers, it stays the most accurate way to show it because of how little it can vary in many situations.

The Y run timer only decreases when you're running/walking and you can conserve it by doing a move. Even crouching keeps it. If the Y run timer eventually reaches 0 and that you want to keep the speed as long as possible, you need to press no-direction for 6 frames, then pressing forward again for 2 frames, then pressing no-direction for 6 frames, etc. (and at the end press a backwards direction instead of forward, and then press no-direction again) This is only useful if you want to go straight forwards or close to.

Also, while using Y run, the maximum acceleration is 122880, as well as the deceleration, therefore you can almost instantly get to a speed of 0 when running, and turn around at will.

The Random Number Generator (RNG) is set to a specific frame counter when entering a new area (mentioned in the board). Therefore we can manipulate it by delaying the entrance to a level (during the star select screen because the game runs at 60 FPS there so we lose half the time with delays), but multiple levels have objects that call the RNG by simply being rendered on the screen, without necessarily having to interact with the player, for example the fishes in JRB. The RNG manipulation is still very limited though, therefore it's common that a few frames will have to be lost on star select delays before a heavy RNG star (such as some 100 coin stars). Here is a more detailed explanation of the RNG in SM64DS

The Room reference address is unsigned and links the character to the main room currently loaded. When unloading the room you're supposed to currently be in and loading another one instead (all of that with cheats), you will need to cheat the value that this address holds to a certain number linked to the new cheated room to keep the character alive (works with any object too). There doesn't need to be another room in the map for this to work though, you can cheat a room fictionally. This address works with objects too (deriving from the object's base), so you can keep objects alive even when they're from a different room. Be aware though, because cheating too many rooms to be loaded can create in-game lag, and your movie could desync when trying to play it back without cheats.

There are specific addresses linked to rooms. Those addresses are all 1 byte signed, and if set to 1 the room is loaded, and 0 if the room is not loaded.

Address Room reference
0x0217BB70 0
0x0217BB7C 1
0x0217BB88 2
0x0217BB94 3
0x0217BBA0 4
0x0217BBAC 5
0x0217BBB8 6
0x0217BBC4 7

Maximum speeds

Note that the maximum speed for a move does not mean you cannot get a higher speed while doing that move. In fact, you can get a higher speed than the maximum speed in some instances. For example, if you jump immediately after doing a long jump with full speed, you will notice that your speed during the jump is much higher than the maximum speed for a jump. In that case, you will need to check about the no-direction trick further below. Also, the maximum speed when you're sliding, regardless of the move you are in, is 409,600.

Here are listed the maximum speeds of every character for every move :

Character Walk Run Y run Jumping/Falling Long Jump Swim Slidekick/Dive Butt Slide/Slip
Mario 36,860 147,440 176,921 121,638 221,160 65,536 163,840 196,608
Luigi 32,760 131,040 157,242 108,108 196,560 98,304 163,840 196,608
Yoshi 32,760 131,040 157,242 108,108 196,560 58,976 163,840 196,608
Wario 30,720 122,880 147,450 101,376 184,320 42,592 163,840 196,608

While doing a backflip or a sideflip, if you try to hold a direction to go full speed, the speed oscillates between 63488 and 57344. This happens because the speed is capped when going backwards (the facing angle is reversed in a sideflip). In fact, if you try to jump or long jump backwards (with POSITIVE speed), the cap happens too. The cap only happens when you're moving backwards compared to your facing angle but with forwards speed. If you start by jumping forwards and hold backwards while skipping the exact speed of 0, you will start moving backwards but with negative speed, and the speed is never capped when it's negative.

Glitches and Tricks

See also

Combined RSS Feed
GameResources/DS/SuperMario64DS last edited by Sharkey91 on 2020-05-13 16:38:51
Page info and history | Latest diff | List referrers | View Source