The First Floor
Entering the Castle
After the intro ends, run toward the castle. Lakitu will give you a message. Now open the front door and enter the castle.
The First Floor: 0-1 Stars
Upon entering, someone will give you a warning; ignore it. There is only one place you can go to now, and it is the door with an unmarked star on it. Going inside, you will find a painting. This leads into the first stage, Bob-omb Battlefield.
After you get a star, there will be several other places you will be able to go to. There are two doors marked with a 1. The bottom one leads to Super Mario 64/Whomp's Fortress, and the other leads to a room with three stained glass windows with Princess Peach on them. However, the stained glass window of Princess Peach to the right contains a secret stage, The Princess' Secret Slide.
In Super Mario 64 DS, the room is a lot bigger than the original. There are four doors with different colored carpets on them, three contain the missing characters, and one contains a Power Star. In any area outside of Korea, there is another room beyond this one. This is the Rec Room. Here was where Peach played games as a child. The Toad, however, lost most of the keys to the games (the mini-games that you can play). To get the keys, you will need to catch rabbits. There are seven for each character (Yoshi, Mario, Luigi and Wario). You will notice that in the Rec Room there is another painting. This one takes you to Sunshine Isles, another secret stage, exclusive to Super Mario 64 DS.
You will notice a door also only in Super Mario 64 DS, but you can't open it until you have eight stars. For now, go to the stages you have unlocked, and get as many stars as you can.
The First Floor: 3-8 Stars
After accumulating three stars, you will be able to go to a few more stages. If you go to the door on the far right, you will find a room with a painting leading to Jolly Roger Bay. There are also two small apetures on the sides of the room. The left has a 1-up mushroom, and the other takes you to The Secret Aquarium.
The door closest to the door to Bob-omb Battlefield has another main course: Cool, Cool Mountain.
In Super Mario 64 DS, after you get eight stars, the door in the Rec Room can be opened. Inside the room is a picture of Mario you can go into. This will lead you to the Goomboss Battle. If you beat Goomboss, you will get a key to Mario's room, thereby unlocking him.
After getting 8 stars in Super Mario 64 (12 are required in Super Mario 64 DS), the door with the big star can be opened. In the DS version, you can only enter the room if you have Mario. Then, any character can go inside. (This applies to all doors that look the same.) The long hallway has a trap pit; go inside to reach Bowser in the Dark World.
When you beat Bowser by throwing him towards the bomb, you will get a key unlocking the basement. Head to the wooden doors, then go down the stairs.
The First Floor: 10-12 Stars
Whether you defeat Bowser in the dark World or not, after you get 10-12 stars, two places are unlocked. The courtyard now has a Big Boo in it. If you defeat it, it will drop a carousel-like object. Jump into it to reach Big Boo's Haunt. The Course does NOT have a hidden picture of Luigi which unlocks him as a playable character, that is only in the DS version.
In the first room of the castle a bright light will be shining onto the sun carpet. Stand in it and look into the "sun" in first person view to reach the stage called Tower of the Wing Cap, where you will be automatically given a Wing Cap. This is where you will find the Wing Cap Switch, which will activate all of the Wing Cap Blocks. In Super Mario 64 DS, the name was changed to ? Switch, and the red ! Switch was being replaced by a ? Switch, and will activate all of the ? Switches in the game. Also, you will need to be Mario to do anything there. If you are Yoshi, Luigi, or Wario, you will just fall and collect three yellow coins.
In the DS remake, it requires 14 Stars to unlock the Wing Cap Stage, and requires 15 Stars to unlock Big Boo's Haunt.
The Basement: 12-29 Stars
There are three stages you can go to now. If you enter the big maze-like room, there will be a door with a star on it. The portal in the room ahead leads to Hazy Maze Cave. The big painting in the center of the maze-like room has two stages itself. The painting leads to Lethal Lava Land. If you go left from the painting, you will reach a dead-end, but the wall leads to another stage, Shifting Sand Land. Explore all of the stages you have now to reach thirty stars and unlock the next big door.
Before you do so, however, go to the wooden door in the maze-like room. Here you will find an underwater section. Swim to the other side, then ground-pound the two pillars to drain the water. This will allow you to access the basement from outside (where you start). You will see a hole in the ground. This leads to Vanish Cap Under the Moat, where you will be automatically given a Vanish Cap. This is where you will find the Vanish Cap Switch, which will activate all of the Vanish Cap Blocks. The Vanish Cap you will be given at the start isn't of much use on the slide. In Super Mario 64 DS, the name was changed to The Secret Under the Moat, and the blue ! Switch was removed. Also, a black brick covered the hole, requiring Wario to enter the course. In Super Mario 64 DS, a rabbit will appear in the moat.
In Super Mario 64, if you get fifteen Power Stars, a rabbit will appear in the basement, and, if you catch him, he'll give you a Star. He reappears once you get fifty Power Stars as well.
If you enter Hazy Maze Cave and go to the underground lake where the Dorrie is, ride on it, and you should see a door. Enter the door, and you will find the entrance to Cavern of the Metal Cap, where you will be automatically given a Metal Cap. This is where you will find the Metal Cap Switch, which will activate all of the Metal Cap Blocks. In Super Mario 64 DS, the name was changed to Behind the Waterfall, and the green ! Switch was removed. Also, the 1-Up Mushroom is replaced by a Bob-omb Buddy, which will give you the locations of the Red Coins. In Super Mario 64 DS, Luigi can run on the water and avoid being swept away.
The Basement: 30-31 Stars
After you open up the big door, you will find that the Bowser stage is blocked by a portal. This leads to Dire, Dire Docks. After you get the first star in there, the portal will move back, allowing you to access Bowser in the Fire Sea. If you beat Bowser, you will get another key, this time to the second floor.
The Second Floor
The Second Floor: 31-49 Stars
Not exactly much will happen on this floor, but it opens up several more stages. If you go into the mirror room, you will find two stages. To get to Snowman's Land, you will need to find the painting not reflected (on the left). To reach the other stage, in Super Mario 64 DS only, Chief Chilly Challenge, enter as Luigi, then grab a flower and run through the mirror and into the Wario painting. In Super Mario 64 DS, if you go through the door on the other end, you will reach a blank room with a star.
In the circular hallway, you will find two stages: Wet-Dry World and Tall, Tall Mountain. Wet-Dry World is found by going into the painting with a water strider, and Tall, Tall Mountain is found by going into a small painting of a mountain surrounded by mushrooms.
The other door in the area leads to a room with three paintings. The middle one is not a portal. However, the other two will take you to Tiny-Huge Island. The left one takes you to the tiny island, and the other takes you to the huge island. Which one you should enter depends on the star.
The Third Floor
The Third Floor: 50-69 Stars
After you get 50 stars, unlocking the big star door (with Mario) will allow you to access the last area in the game. There are a few more stages up here, as well as another big door (you can go in any time, but you cannot go all the way up yet because of the endless stairs). The clock will lead you to Tick Tock Clock. There are two holes on the walls on either side of the room. If you are standing in front of the clock, going into the right one will lead you to Rainbow Ride. The left leads to Wing Mario Over the Rainbow, simply called Over the Rainbows in Super Mario 64 DS.
The Fourth Floor
The Fourth Floor: 70 Stars
After finding 70 stars, Mario will be able to climb the endless stairs and to the top of a tower/the fourth floor, where a hole will lead him to Bowser in the Sky, the final showdown against Bowser, who needs to be thrown against the bombs three times.