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:
|base + 0x08
|Which character's cap you're wearing (Mario=0, Luigi=1, Wario=2, Yoshi=3)
|base + 0x5C, 0x60, 0x64
|Character's X, Y and Z positions
|base + 0xA4, 0xA8, 0xAC
|Character's X, Y and Z speeds (Y speed is always set to -32768 on the ground)
|base + 0x8E
|base + 0x94
|base + 0x98
|base + 0x6E3
|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
|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
|Air/Ground state. This value holds 1 when you're on the ground and 0 when you're in the air.
|base + 0x706
|Water state. When in the water, this address holds a value of 1, else it will hold 0.
|base + 0x370
|This address has to do with what mode you're in (walking/jumping/swimming/crouching/etc.)
|base + 0x644
|The Y position of the floor that is under you (-2,147,483,648 if there is no floor under you)
|base + 0xCC
|Room reference (unsigned, more explanation below the board)
|base(clam's) + 0x16E
|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.
|Frame counter associated to RNG. The RNG will be set to the value that this address is holding when you enter a new area.
|Red coin counter
|SSL Pillar counter (also used for some other counters in the game)
|Next object's unique ID (hexadecimal)
|Bowser's revolution speed, the higher it is the faster you’re spinning him.
|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).
|base - 0x12C, 0x128, 0x124
|Camera X, Y and Z positions
|base - 0x3A
|Camera up/down angle
|base - 0x3C
|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.
The game represents non-integer numbers using fixed-point 20.12 numbers
(20 integer bits and 12 fractional bits). For example, the number 1.5 is represented by 0x00001800. However this page will consider these numbers as signed 32-bit integers, so 0x00001800 will be interpreted as 6144. To get the "real value" in fixed-point units (fxu), divide by 0x1000 or 4096.
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 :
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
- Heaven's portal: When you do a slidekick, dive or long jump into a glitchy corner (meaning the character slightly enters the wall), if you do it with a certain angle and while moving downwards, the character is sent upwards to the ceiling above them. Most of the places where you can do a heaven's portal have no in-course ceiling, therefore the ceiling above the character is the hard-coded limit, which is very high. The trick can also be done by going into a wall with high speed while in a slidekick. Heaven's portals can be used to do major skips (e.g. Moat Skip) or reach stars faster.
- Hell's portal : This is the same as Heaven's portal, but it can get the character stuck into the animation he is in and go forward forever. Until you recover or jump (press A or B) and you will be sent to the death barrier, or if you're lucky and get over a floor at some point, recover or jump to prevent getting stuck again.
- Deathwarp clip : This also works by glitching into a corner, but in some instances the glitch happens while you have upwards speed, therefore you will be sent downwards (to the hard-coded death barrier). Can be useful to exit the castle quickly from the character's room.
- Corner clipping: Some glitchy corners let the character gain a lot height during a long jump, a slidekick or a dive with a precise angle, thus getting to the ceiling very quickly. If the ceiling at the top is slanted, in some instances you will be able to clip through the wall by the top and get out of bounds with sometimes precise speed manipulation needed. Examples of those are the corner used for 8 star door skip in the character's room, and the pillars at the side of the mirror on the castle 2nd floor.
- Free movement transition glitch: The normal behavior during a transition is that you have absolutely no control over the character (moves, angles, state), the speed address holds 0, and the position is being forced to certain coordinates on a certain axis (doesn't have to be the regular X, Y or Z axes). However, by eating a coin early before the transition but late enough that the character doesn't start running before it, you will actually be able to run even if the transition has started, and you can control the character freely during the transition. However, you are still being forced to the same coordinates on the same axis, so you will only be able to truly move on a plane (the plane of which the axis is perpendicular to) no matter what your angle is. This also works with a 100-coin star (or any star that doesn't make you exit the course in secret stages), and you will actually get the star dance during the transition even if you've already started to be moved, and you won't be forced to any coordinate during the star dance animation, but it will resume once that animation ends, and you can move freely during it.
- Star cancel: This trick allows you to skip the celebration after collecting a star. On top of gaining time, this allows you to skip the star text boxes if the star cancelled is the 1st, 3rd, 8th, 12th, 30th, 50th or 80th. There are a few ways to cancel a star:
- Backwards star licking: Some stars (such as HMC Metal-Head Wario Can Move) are positioned close to a void that kills the player. If Yoshi eats the star with high enough backwards speed (often with a sideflip), he can collect the star while falling into the void, and die instead of collecting the star normally. This saves time in most places since the void is often close enough to the star vertically and the death animation is faster than the normal celebration. In addition, you can do the same thing with stars that are positioned close to a loading zone that doesn't act like a painting (such as THI Pluck the Piranha Flower with the pipe), and enter a new area within the level instead of actually dying. Precise timing is needed for that though, because if the star falling animation starts too early, the loading zone will be bypassed and the celebration won't be cancelled, and if it stars too late, the transition will interrupt Yoshi from getting onto the ground.
- Mid-air walk: By having a fly guy, a spindrift, an owl or a shell next to a star, you can eat the star, cancel the star dance with the object (bouncing on the fly guy or the spindrift, grab the owl or get onto the shell) and keep the star in your mouth. The only way to get the star dance after that is to start walking, stand still, or enter the water. By continuously jumping (if needed), getting near a death barrier makes the star cancel possible by doing the following: jump towards the edge of the floor, wait for the character to start falling vertically (not the actual falling state's model) and press a direction. This will make you walk mid-air for 2 frames, thus the star falling animation happens. This is also possible with loading zones that don't act like a painting, but as before, it's needed to press a direction mid-air with specific timing to get the transition and the star at the same time.
- Travelling star: By doing the same method mentioned just above to get the star in your mouth without getting the star dance, you can afterwards actually spit out the star towards the loading zone. If that loading zone doesn't act like a painting, then you can simply run towards it and lick the star before getting into the loading zone. However, with loading zones that act like a painting (works for other loading zones too), you will require to perform the free movement transition glitch and collect the star during the transition. It will still be counted as long as you get it before the sceren becomes completely white. This method is useful for TTM and SL, as the transitions act like paintings.
- No-direction trick: This trick works by not pressing any direction while doing any sort of jump. When doing so, the character's speed will aim to go to 0 by decreasing/increasing (depending if your speed in positive or negative) by 2048, until it reaches 0. It's useful to do it while the character's speed is above maximum speed, since the speed goes down slower than if you pressed any direction. It works with all moves except punches, kicks, dives and slidekicks since their speed doesn't decrease in the same way.
- Direction reset: By pressing a backwards direction compared to the character's facing angle while in the air, the speed starts decreasing until it gets close to 0. If your speed gets past 0, it becomes negative and you simply start moving in the opposite direction of your motion angle. However, if the speed reaches 0 (can be achieved by pressing neutral right before the speed is supposed to become negative if needed), any direction that you will press resets your motion angle to that direction instantly, and the speed becomes positive.
- Landing model reset: Normally when landing, the character's motion angle is set to their facing angle. However, if they differ by more than 16384 units, then the facing angle is set to the motion angle instead. This can be done by turning a lot in the air, or by doing a direction reset.
- Frame sliding: By pressing backwards and then neutral when running, the character's facing and motion angles are locked, as well as the speed (unless it's higher than the maximum running speed beforehand, in which case it's set to that instantly). This can be useful to go in a straight line strictly (which is not always possible while running normally, even with L and forwards held) and keep the facing angle lagged behind the motion angle to redirect faster afterwards if needed. This can also be used to get up slopes since your speed is locked, however it's only faster to do it in specific situations, like when you can start doing it with maximum speed and if it's on a very steep slope.
- Glitchy long jump: Usually, when you do a long jump, it is necessary that the character is facing roughly the same direction he is moving in order to get a long jump with the highest speed. However, while walking, if you turn very fast so that the facing angle lags behind the motion angle and long jump by pressing B and R at the same time (to not crouch), by using a specific direction with the touch screen during the long jump you can keep high speed even if the facing and motion angles are completely different. You can even reach top speed with the straight backwards direction if the difference is higher than 8192. Here is a more detailed explanation of this trick: Glitchy Long Jump Explanation
- Sideways long jump: Glitchy long jumps can be useful for going up slopes. In particular, some slopes are too steep to long jump up, but you can long jump down them. The player's facing angle is used to determine whether you can long jump, so by creating a significant difference between your motion angle and facing angle, you can face slightly downhill to be able to long jump while moving uphill. This is especially fast in some cases because you can land immediately and long jump repeatedly, staying above 240k speed.
- Delayed long jump: By running and pressing R you can slide for up to 16 frames (or longer on some floor types) while maintaining the speed you were running at. This can be useful for preserving Y run when you need to travel a bit farther than 1 long jump since the timer doesn't decrease when you are crouching. However, when you start crouching your motion angle is set to your facing angle, so it's impossible to do a glitchy long jump like this.
- Before reading these tricks, it is important to note that when doing a punch, your speed will decrease by 2048 every frame if you're on the ground. If you're in the air, the speed becomes locked. When doing a kick, you're not affected by the floor (if it's a moving floor, you are not affected by its movement), and the kick will keep the speed you had until you reach the ground. Also, after a kick you can instantly run after landing. Same with a punch, but your speed will be set to 0 after the animation finishes. Therefore, punches and kicks are useful for being faster than running in some instances.
- Kick trick: By pressing and holding B when you do an air move, if you press A (and don't release B) immediately when you land, you will do a kick. It usually isn't possible to kick while in the landing animation, and this lets you conserve speed from a long jump for example.
- Punch trick: If you release B just after pressing A and B for 2 frames, you won't kick, you will punch instead. Thus you can punch at any speed using this.
- Slow vertical acceleration kick : After doing 2 consecutive punches, if your kick is done with only A held and not B and while on the ground, you will do a kick different than the regular kick, your vertical acceleration will be much smaller. However the initial vertical speed for that kick is set lower so this doesn't give any vertical advantage, but it can give a horizontal advantage.
- Regular kick trick : After doing a punch, if you hold A and B at the same time, you will do a regular kick.
- No slowdown kick : When kicking something from far away, you won't slow down when hitting that thing. The window is pretty specific though.
- No slowdown punches : When punching something (except bricks) from far away, you won't slow down when hitting that thing. The window is pretty specific though.
- No bonk trick : When doing a dive or a long jump, you would usually have a damaging bonk when reaching a wall. Though, if your speed is less than 65536, you will get the regular jump behavior instead. If you're playing as Mario, you can wall jump after that, and with any other character you will get the regular jump bonk. For a dive, you need to have a really low speed dive, and that's only possible with triple jumps, slope jumps, and sideflips, because they are the only moves that allow you to dive at any speed.
- There are several tricks that allow you to count as standing on ground while in the air for one frame, meaning you can jump, backflip, kick, and in some cases even long jump from mid-air.
- Dive reset: When doing a dive onto the ground as Mario, Luigi or Wario, if you let your speed reach 0 (by letting it slowly decrease or grabbing something) you will automatically recover in a standing up animation. While in the air, you can't decrease speed during a dive, so the game assumes you're on ground after doing this animation. However, while doing a sideflip, wall jump, or triple jump (very hard with a triple jump), if you get the right amount of negative speed, you can do a dive that sets your speed to exactly 0. Thus, the standing up animation will play in mid-air as soon as you do the dive. After the animation finishes, you will be able to move for 2 frames, allowing you to jump, backflip, or kick. This trick allows us to reach new heights, as it allows infinite height gain as Mario using a wall. Here is a more detailed explanation
- Spit reset: After spitting something out as Yoshi, there are 2 frames when Yoshi switches from the spitting out animation to the walking animation where you can jump, spit, backflip, or even long jump if you are travelling fast enough.
- Egg reset: This works the same way as the spit reset, but you can also do it by making an egg.
- Eat reset: The same, except it's only possible by eating a coin (not an enemy).
- Throw reset: After throwing an egg (as Yoshi) or another object, there will be 2 frames when the character switches back from the throwing animation to the walking animation where you can do the same moves as recalled before.
- Falling off a ledge: The landing animation for most moves takes 4 frames (from when you touch the ground until when you are able to walk again). The end of this animation allows you jump or do other moves as above. You can end the landing animation midair by falling off a ledge during those 4 frames. You can delay the end of the animation even more by holding neutral.
- Wide angle wall jumps : Usually when doing wall jumps, it happens in situations where the walls you work with are facing each other. But it's also possible to do it with walls that are a lot wider than that (90° walls for example) by doing directions resets before every wall jump. You can either slow down right away during the wall jump and eventually reach a speed of 0, or if your motion angle is good enough, you can go towards the wall you want to jump off and hold backwards as soon as your speed is about to be set to 15616, and eventually reach a speed of 0. For example, this is used in TTM Scale the Mountain
- Igloo clip: In Snowman's Land, the igloo's outside loading zone extends a little out of the actual igloo. By jumping onto a precise spot you can reach the trigger without having to crawl to access it. Example : Old SL 100+Reds TAS where Igloo clip is used
- SSL pillar glitch: If you start walking onto a pillar in Shifting Sand Land with quite high speed (running speed is sufficient), depending of your position and motion angle, you can upwarp a little, or sometimes you can lose all your speed, especially while on the shell.
- Fast pole grabbing: When jumping or sideflipping, if your speed is less than 40961 when grabbing a pole you will be able to jump or climb the pole instantly. Normally, you would have a second where you can't do anything and your facing angle altered, as there is a short animation. You can manipulate the speed to be negative since any negative speed is below 40961, so you can get as mcuh backwards speed as you want. If you are jumping off the pole, hold backwards, and just before reaching a speed of 0, press neutral so that then if you press backwards again, your speed will become negative instead of going to 0 and becoming positive.
- Grate upwarp glitch: In Goomboss Battle, if you jump under the grate with a precise position and an angle to the left, there is a glitchy spot where you can hang at the very edge and cannot move at all if you stay hanging. If you manage to have the perfect position and perfect angle you will not hang on the grate, and instead enter the wall. This means a failsafe occurs and you are sent upwards to the edge of the grate, in a landing state.
- Dialogue in air: The check for dialogue in this game only cares about X and Z position, not Y position. This means that by using a dive reset or spit reset you can start the dialogue in mid-air. While the text is on screen the character will float, and after that you have 2 frames to do an action. However, the character will always look directly at anyone who is talking to them, so being too high above whoever's talking will lose frames because they have to tilt their head downwards. They also have to get their head back to a normal position after the text, once again wasting a few frames.
- NPC clipping: This works by talking to a bunny or a Toad that is close to a wall while you are between it and the wall. The game pushes you out of the NPC, making you go through walls with the right position and timing.
- Block clip: Blocks are only loaded when on camera, so by manipulating the camera by zooming and putting it out of bounds, you can unload a block for long enough to clip through it. This is useful to activate switch stars that normally require Wario (like in BBH), and also to simply get out of bounds by being clipped out of the block at the side after succesfully clipping in from the top, especially in HMC.
- Pause clip: You can also unload objects by getting them off camera by pausing, but only in courses in which the camera zooms far out when you pause. This is primarily used to get inside The Secret Under the Moat as any character and to use cannons without opening the lid. More explanation here
- Star text skips: After collecting 1, 3, 8, 12, 30, 50, and 80 stars, a textbox appears. These textboxes can be skipped by either cancelling the star celebration, or by spawning a 100-coin star at the same time as another star, and then pressing an input on the first possible frame after collecting the 100-coin star (you have to choose to NOT save).
- Walk underwater (using a shell with Yoshi): To perform this trick, you have to be Yoshi. Eat a shell and quickly run near the water surface and spit out the shell in such a way that it stands on the water surface instead of travelling forwards, which can be done by having it touch the surface of the water the first frame after being spat out (easier after jumping). If you enter the swimming animation before riding the shell, you will stay in the swimming state, meaning that you will bypass water checks completely. If you were to close to the surface so that riding the shell upwarped you onto the water, you can get off the shell later and get underwater. You get rid of the swimming state if you get off the shell and start walking or wait until you stand still.