Super Mario Bros. Hidden 1-Ups
There are eight invisible 1-up mushroom blocks in Super Mario Bros. Sometimes they are not just invisible, but actually missing. These are the rules for when the player can hit them.
In Super Mario Bros., there are a total of ten blocks with 1-up mushrooms inside. Two of them are visible, on levels 1-2 and 8-2. Eight of them are invisible, on level 1 of every world (1-1, 2-1, 3-1, etc.). It might be more accurate to say that there are “up to ten” 1-up blocks, because the eight invisible blocks are sometimes present and sometimes missing when the player attempts to hit the block.
In order to determine how the game decides when these blocks are present or missing, I reviewed a disassembly of the game and modified an NES emulator to display the game’s internal state. While I am sure that speedrunners know this information, I could not find it previously published on the Internet. Most of the sites I reviewed and even Nintendo’s official publication are wrong, and even the ones which are mostly correct are not complete.
I use the letter N to refer to the world after world M. In other words, N = M + 1. For example, if I refer to level N-1 and M-3, this could refer to level 4-1 and 3-3, or 6-1 and 5-3, etc. I mean the levels in a strict numeric sense; in the case of a warp zone I do not mean the world the player warped from.
When I refer to a 1-up opportunity, I mean that the invisible 1-up block in a particular level is initially present. I say “initially present” because, if the player loses a life in certain areas on that level, that invisible 1-up block will no longer be present. I call this unfortunate scenario “losing” the 1-up opportunity which causes the 1-up block to be “missing.” When the player has a 1-up opportunity on a level, the player can hit the block, the player can choose not to hit the block, or the player can lose the opportunity before hitting the block.
When I say the invisible 1-up block is “on-screen” I mean that if the block weren’t invisible, it would be visible on-screen at that moment. In other words, the player is in the area of the map where the block is. When I say the player has “reached” the invisible 1-up block I mean that the 1-up block has been on-screen. When I say the player has “almost reached” the invisible 1-up block I mean that the 1-up block is not yet on-screen, but is just ahead, and the game has unset the 1-up opportunity flag (see below).
When the player starts a new game, the player always has an 1-up opportunity in level 1 of the starting world. This means that in a normal game, there is a 1-up opportunity in level 1-1. After beating the game, the player can choose which world to start on, and the player always has a 1-up opportunity in level 1 of that starting world. Additionally, if the player warps to a world, he always has a 1-up opportunity on level 1 of the world he warps to.
Otherwise, it’s the player’s performance in level M-3 that determines whether the player has a 1-up opportunity in level N-1. Specifically, the player needs to get the required number of coins in level M-3 and then finish level M-3 in the same life. In each world, except world 1, the required number of coins is all the coins in level 3. (In level 1-3 the player can miss two coins, i.e., 21 of 23 is sufficient.) There is no world where level 3 has a multi-coin block or a hidden coin room; on every level 3, the coins are all in plain sight.
It is necessary to give a little more detail in order to explain how the player can lose a 1-up opportunity. The game has an internal flag which tracks whether the player has a 1-up opportunity. The game sets the flag when starting a new game, when the player goes down a warp pipe or when the player finishes level M-3 having obtained the requisite number of coins. The flag is unset when the player is in the immediate vicinity of the invisible 1-up block, while the invisible 1-up block is still slightly off-screen. The levels are designed so that there is no way to use a pipe etc. to skip past the point where the flag is unset.
- It does not matter how many coins the player enters level M-3 with. There is a separate coin counter for the invisible 1-up block.
- It is technically possible to die on level 3 and still get the next 1-up block, but only if the player is able to collect the necessary coins and finish the level on a subsequent life. In other words, the player basically can die only at the very beginning of level 3 if the player is to get a 1-up opportunity.
- Dying does not cause the flag to be unset. However, the player will lose the 1-up opportunity if the player dies after reaching or almost reaching the 1-up block.
- Being hit and becoming small never causes the flag to be unset.
- It is not possible to “save” a 1-up opportunity for a subsequent world. The flag is always unset on world N-1, even if the player chooses not to hit the 1-up block.
To summarize, there are two reasons the invisible 1-up block can be missing:
- The player reached or almost reached the 1-up block and died without hitting the block; or
- The player didn’t collect the required number of coins on a previous level.
Nintendo’s Wrong Guidance
Nintendo published a booklet in 1987 called “How to Win at Super Mario Bros” describing each level in detail and it is not accurate on this topic. Note that below [C] means “coin block” and  means “1-up block.”
- Level 1-1: “In LEVEL 1-1, you'll find that the 1-UP MUSHROOM and the pipe leading to the COIN ROOM are quite close. Go for both!” Actually, the 1-up block is not always there, if the player dies after reaching (or almost reaching) the block.
- Level 2-1: “Watch for the two TROOPAs under the three block set. They will bounce back-and-forth between the walls when you kick them. Go under the block that's farthest to the left, and move left yet another block. Jump to find a [C]. Then jump on top of that, and jump to score a .” Actually, the 1-up block is not always there.
- Level 3-1: “There is a  hidden above the right end of the bridge, but sometimes this hidden character will not appear if you have lost your power and become regular MARIO before you get there.” Actually, being made small will never cause the 1-up to be missing.
- Level 4-1: “Collect all the coins, then quickly get back to the top. Stand on top of the third block, and jump to collect the hidden 1-UP MUSHROOM.” Actually, the 1-up block is not always there.
- Level 5-1: “If you can get to this point without getting hit, go for the 1-UP MUSHROOM between the wall and the 2-block set. This 1-UP MUSHROOM usually doesn't show up if you were hit before in this area.” Actually, this is not a question of probability. Being made small will never cause the 1-up block to be missing, and dying will only cause the 1-up block to be missing if the player has reached or almost reached the 1-up block.
- Level 5-3: “If you are a beginner, it's better to ignore the coins above the lifts. It's very dangerous to jump on the moving lifts, and those four coins are not worth the risk of a fall.” Actually, the decision is not based on the value of four coins, but the value of a 1-up mushroom in the next world.
- Level 6-1: “First, take care of the LAKITUs from the top, then get down to the lower block and jump to find a hidden . This , however, might not appear if you've been hit before in this area.” Actually, this is not a question of probability. Being made small will never cause the 1-up block to be missing, and dying will only cause the 1-up block to be missing if the player has reached or almost reached the 1-up block.
- Level 7-1: “Before using the pipe to enter the coin room, jump up to release the 1-UP MUSHROOM. Then go down to the right to catch it, and return to enter the coin room.” Actually, the 1-up block is not always there.
- Level 8-1: “If you reach this area without getting hit, you'll probably find a  inside the third block from the left, between the two pipes.” Actually, it’s not a matter of probability. Being made small will never cause the 1-up block to be missing, and dying before the player has reached (or almost reached) the block has no bearing on whether the 1-up block is missing.
The booklet contains a sidebar in the level 7-2 description which is slightly more accurate than the individual level instructions, but is still wrong in the details. It reads:
“UNVEIL SECRETS OF THE 1-UP MUSHROOM Actually there are two 1-UP MUSHROOMS. The ones inside the visible blocks always appear. The ones inside the mid-air invisible blocks don't always appear. It all depends on whether or not you have collected the coins in the preceding world (missing just a few is usually okay). The type of 1-UP MUSHROOM also depends on whether you already passed one by or whether you've been hit before you reached the block. Go for all of them!”
The writing is slightly garbled but seems to mean the following:
“UNVEIL SECRETS OF THE 1-UP MUSHROOM Actually there are two types of 1-UP MUSHROOMS. The ones inside the visible blocks always appear. The ones inside the mid-air invisible blocks don't always appear. It partly depends on whether or not you have collected the coins in the preceding world (missing just a few is usually okay). Whether the 1-UP MUSHROOM appears also depends on whether you already passed this one by or whether you've been hit before you reached the block. Go for all of them!”
This corrected paragraph is still inaccurate for the following reasons:
- The “coin test” is not whether the player has collected the coins in the previous world. It is specifically whether the player collected the requisite number of coins in level three of the previous world.
- The “coin test” does not allow missing any coins, except in the case of level 1-3 where the player is allowed to miss up to two. It is not “usually okay” to miss a few coins.
- The “coin test” also requires that the player collect all the requisite coins and finish the level in the same life.
- The mushroom will not appear if the player dies while the 1-up block is still slightly off-screen.
- Getting hit (being made small, or dying elsewhere on the level) does not affect whether the mushroom appears.