Super Mario Bros.
Nintendo's 1985 side-scrolling platformer for the Famicom and NES.
Facts
- Released
- 1985
- Genre
- Platformer
- Platforms
- Famicom, NES
- Developer
- Nintendo
- Publisher
- Nintendo
- Series
- Super Mario, part of Mario
- Code
- Disassembly by doppelganger and Xkeeper
- Evidence
- Code (19)
Interview (12)
Verified (8)
Manual (6)
Magazine (4)
Publisher (2)
Code notes (2)
Wiki (1) - Sources
- 18
Super Mario Bros. is Nintendo’s side-scrolling platformer for the Famicom and NES. Nintendo dates its release to 13 September 19851, and Nintendo of America’s list of NES games gives October 19852 for North America. The player is Mario, out to free Princess Toadstool from the Koopa king, whose tribe of turtles has put a spell on the Mushroom Kingdom3. A second player takes turns as Luigi4. The screen scrolls right through worlds of four areas each, and the fourth area of every world ends in a castle5. The game has eight worlds, and hidden warps let a skilled player skip ahead6. Mushrooms, flowers, and stars hidden in blocks make Mario bigger, let him throw fireballs, or make him invincible7.
Shigeru Miyamoto wrote the game’s specifications. Takashi Tezuka, a designer in his first year at Nintendo, worked with him, programmers from Toshihiko Nakago’s company SRD built it, and Koji Kondo did the sound8. Miyamoto set out to make something like his arcade Mario Bros., but with a scrolling screen, a bright background, and bigger characters, and scrolling cost it Mario Bros.’ simultaneous two-player play9. The specification borrowed slopes, lifts, ropes, springs, and enemies from Nintendo’s earlier games10, and Miyamoto says the warps came from the arcade Excitebike, which let a player choose the course to start on11. Miyamoto says the team meant it as their last cartridge game before the Famicom Disk System and packed in all they could12. Iwata recalls 256 kilobits of memory at first, and Miyamoto 64 for the characters13. The cartridge holds 256 kilobits of program and 64 of graphics14. With 20 bytes to spare at the end, Miyamoto added a crown as a reward for players with ten or more extra lives15.
Nintendo’s Satoru Iwata recalled that the game wasn’t released to great fanfare and didn’t catch fire at once, but that everyone who played it was drawn in. In January 1986 the Asahi Graph, a magazine of the Asahi Shimbun, ran a feature on it that Masayuki Uemura calls a strategy guide for adults, and a shop in his photo from those days hung a sign saying it was sold out16. In 2010 he said it had sold more packaged copies in Japan than any other game17. Izuhiko Imanishi, who ran Nintendo’s general affairs at the Famicom’s launch, says newspapers had been mostly negative about video games, and Japan’s parliament had taken up their influence on children, until the game’s bright atmosphere cleared away that prejudice against the Famicom18. In North America it was one of the games on sale as the NES spread out from New York19. From June 1986 it came packed with a cheaper NES set, the Control Deck20, and from 1988 on multicarts with Duck Hunt21. Computer Entertainer’s review called it “sheer delight” and said no NES owner should be without it22. Electronic Gaming Monthly’s 1997 list of the best games of all time ranked it 37th, in its Super NES All-Stars version, saying it brought the video game market back from the dead and set the standard for side-scrolling platform games23. Nintendo also made an arcade version, VS. Super Mario Bros., for its VS. System cabinets24.
#How it plays
The d-pad walks Mario, and holding B with it runs. A run raises his top speed by two-thirds25. From a standstill he takes under a second to reach either top speed, and about as long to stop once the d-pad is let go26.
A jumps, but only from the ground and only on the press27. How fast Mario is moving when he leaves the ground picks one of five sets of jump settings, and the faster the take-off, the higher he goes28,29. Holding A makes the jump higher. Gravity is light while A is held on the way up, and turns heavier for the rest of the jump once it is let go or he reaches the top30. A tapped jump rises less than two blocks, and a held jump four to five (66–83 px held, 24–29 px tapped31, with held peaks of 66 px standing, 71 px walking, and 83 px running32 on flat ground, where a block is 16 px). This is variable jump height. The game keeps his height and vertical speed in fractions of a pixel, or subpixels33, and a fall levels off at 4 px/frame34 once it reaches 4.5 px a frame35.
In the air, a held direction speeds Mario toward it, and once it is let go he keeps the speed he has36. Out of water, he keeps facing the way he jumped37. A jump has to start on solid ground: a press after he walks off a ledge does nothing, so the game has no coyote time38. He walks a few pixels past the edge before he drops39. A walk-off before his first jump in an area falls more gently than one after it40.
Big Mario breaks a plain brick he jumps into from below. Small Mario only bumps it, and either size only bumps a ? block41. A hit shrinks Super or Fiery Mario back to regular Mario7, and he can’t be hurt again for about two and a half seconds42.
#Wall jump
Mario can jump off the side of a wall, by a glitch in how the game checks his feet. After he moves each frame, the game tests a point at his head, two at his feet, and then points at his sides against the level’s blocks43. A foot inside a solid block lands him if he isn’t moving up and the foot is less than 5 px into the block44. The test doesn’t ask whether the block is a floor or part of a wall. So a foot that dips into a wall near the top of one of its blocks stands him on the wall’s side. He starts the next frame on the ground, and a fresh press of A jumps45.
The side test pushes him back out of the wall by 1 px a frame46, so he stays caught only while his foot is inside it. With big Mario, the window for the press was 1 or 2 frames47, depending on how deep his foot went, not on his speed. That held for a walking jump into a wall built into World 1-1’s start, a running hop at the level’s first pipe, and a hop at World 2-1’s last wall47. TASVideos explains the move as a floor check that still runs while the game pushes Mario out of a wall. Super Mario Wiki lists it among the glitches that resemble the series’ later, designed wall jump48.
#Unused
- Super Mario Bros.'s song table has a second entry for the game-over song that none of the stores that name the event-music queue asks for: entry
$04, bit 4 of that queue, points at$F966, the game-over song's header, as entry$01does.49 - Super Mario Bros.'s song table has an entry for steps of the aboveground theme that no store naming the area-music queue reaches: entry
$08, which the engine's bit search gives for bit 0 of that queue, points at$F976, the header that steps 2, 3, 16 and 17 of the aboveground theme play.50 - Super Mario Bros. has a song header that no entry of its song table points at, so no request can play it.51
Controls
Data
Releases
Cartridge
Other releases: Super Mario Bros. (Europe), Super Mario Bros. (Japan) (En).
Code lineage
Mechanics
| Mechanic | Kind | How |
|---|---|---|
| Status bar split | Sprite 0 hit | the status bar holds still while the level scrolls under it |
| Sprite flicker | Rotating slots | when too many sprites share a line, a different one drops out each frame, so they flicker in turn |
| Palette cycling | Color step | ? blocks and coins shimmer through six colors, a step every eighth frame |
| CHR bank switching | Fixed | one set of tiles for the whole game |
| Raster effects | Two bands | one split a frame, between the status bar and the level |
| Music driver | Length table | each song times its notes in whole frames from its own row of lengths; the hurry-up tunes take a faster row |
| Variable jump height | Gravity switch | gravity stays light while A is held on the way up, and turns heavier for good on release or at the top |
| Jump | Speed from the run | the faster Mario moves at take-off, the faster and higher he jumps: standing, walking, and running jumps differ |
| Gravity | Switch on release | a light pull while A is held on the way up, a heavier one after |
| Air control | Momentum | a held direction speeds him toward it, let go he keeps his speed, and he faces the way he jumped |
| Running | Run button | holding B raises his top speed from 1.5 to 2.5 px a frame |
| Destructible terrain | Breakable tiles | big Mario breaks a plain brick he hits from below; small Mario only bumps it, and either size only bumps a ? block |
| Wall jump | a foot that dips into a wall near the top of one of its blocks stands Mario on its side for a frame, and A then jumps glitch | |
| Hitbox | Points and a box | points at his head, feet, and sides meet the level, and a box meets enemies |
| Invincibility frames | Slow timer | after a hit he can't be hurt again for about two and a half seconds |
| Demo playback | Input script | the title screen's demo is a recording of button presses, played through the ordinary game |
| Coyote time | None | a jump starts only from the ground |
Every claim about this game, by concept (169)
References
- ^InterviewIwata Asks, SMB 25th, Vol. 2 p. 1 · Iwata Asks, SMB 25th, Vol. 5 p. 1 · Nintendo, Company History
How we know
Nintendo dates the release of Super Mario Bros. to 13 September 1985.
This September 13th marked the 25th anniversary of the release of the game Super Mario Bros.
Vol. 2, p. 1, opening · archived copy ↗ A side-scrolling action game released for the Family Computer System (Famicom) and the Nintendo Entertainment System (NES) in September 1985.
Vol. 5, p. 1, note 1 · archived copy ↗ Started selling the Super Mario Bros. game software for the Nintendo Entertainment System.
1985 · archived copy ↗ - ^PublisherNintendo, NES Games
How we know
Nintendo of America's list of NES games dates the North American release October 1985.
Super Mario Bros. Nintendo October 1985
PDF p. 12 · archived copy ↗ - ^ManualSuper Mario Bros. instruction booklet
How we know
In the manual's story the Koopa, a tribe of turtles, have invaded the Mushroom Kingdom and turned its people into stones, bricks, and plants. Only Princess Toadstool, the Mushroom King's daughter, can undo the spell, and the Koopa king holds her; Mario sets out to free her.
One day the kingdom of the peaceful mushroom people was invaded by the … Mushroom People were turned into mere stones, bricks and even field horse- … The only one who can undo the magic spell on the Mushroom People and … the Mushroom King. Unfortunately, she is presently in the hands of the great … plight and sets out on a quest to free the Mushroom Princess from the evil
Object of the Game · archived copy ↗ Bowser,
Characters · archived copy ↗ - ^ManualSuper Mario Bros. instruction booklet · Computer Entertainer, June 1986
How we know
A second player plays Luigi on controller 2, taking turns with the first.
Controller 2 — for second player in 2 player game … moves Mario (Luigi
2. Names of Controller Parts · archived copy ↗ (Solo or 2-player alternating; Pause.)
review of Super Mario Bros. · archived copy ↗ - ^ManualSuper Mario Bros. instruction booklet
How we know
The screen scrolls to the right as Mario goes. The kingdom is a number of worlds of four areas each, the fourth ending in a castle, and Mario has to reach each world's castle within the given time. A lost life halfway through an area restarts there, and an area ends at a flagpole whose bonus rises with how high Mario lands on it.
As this game proceeds the screen gradually advances … a number of worlds, and each world is divided into 4 … areas. The fourth area of each world ends in a big … to make it to the castle at the end of each world with- … in the given time. Along the way are mountains, pits,
3. How to Play · archived copy ↗ ever, once Mario gets about halfway through an area, he doesn't have to go all
3. How to Play, Starting position and time progress · archived copy ↗ flagpole, the higher the bonus … the end of each area there … jump onto a flagpole. The … higher you jump onto the
3. How to Play, Finish Area · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3 · Nintendo Power 3
How we know
The game has eight worlds; Miyamoto says warps let a good player go from World 1 straight to World 8, to reach the end.
So we made warps possible for people who want to play to the end. If the players figure out the warps, they can jump to World 8 right away.
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ dream your way through all 8 Worlds of Super Mario Bros.?
PDF p. 34, holiday gift guide · archived copy ↗ - ^ abManualSuper Mario Bros. instruction booklet
How we know
Power-ups hidden in bricks and invisible blocks change Mario: the manual's chart sets the Magic Mushroom, the Fire Flower, and the Starman beside Super Mario and Fiery Mario, and after the Fire Flower, B throws fireballs. A hit turns Super or Fiery Mario back into regular Mario, who flickers and can't be hurt for a short while. An extra life comes from a 1-up mushroom or 100 coins.
If you come across mushrooms who have been turned … into bricks or made invisible, they reward you by … *When Super Mario or Fiery Mario are bumped into by a bad guy, they don't die … but simply return to their old regular-Mario selves. … For a short while after turning back into his regular-Mario self, Mario flickers. … During this time, he can not be killed by bad guys (he's invincible).
Mario's Friends · archived copy ↗ Fireballs ...... After you pick up the fire flower, you can use this button to throw
2. Names of Controller Parts, B button · archived copy ↗ If Mario picks up 1 up mushroom, he gets an extra life. … If Mario picks up 100 coins, he gets an extra life.
Bonus Prizes · archived copy ↗ Magic Mushroom … Starman
Mario's Friends, chart · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 1 · Iwata Asks, SMB 25th, Vol. 5 p. 2 · Iwata Asks, SMB 25th, Vol. 5 p. 3
How we know
Nintendo names the game's original developers as Shigeru Miyamoto, who wrote its specifications; Takashi Tezuka, a designer in his first year at Nintendo when the first plans were drawn up; Toshihiko Nakago, president of SRD, the contractor whose programmers built it; and Koji Kondo, whom Miyamoto appointed to sound.
I have gathered the original developers, four men who continue to be active in development of the Super Mario Bros. series.
Vol. 5, p. 1, opening · archived copy ↗ These are Miyamoto-san's first specifications for Super Mario Bros.
Vol. 5, p. 1 · archived copy ↗ Super Mario Bros. was completed your second year at the company, so when the first plans were drawn up, you two were still new guys in your first year. … Back then, before Tezuka-san came, I was doing all the design work myself, so it was a big help just to have another designer.
Vol. 5, p. 2, The New Guys, Too! · archived copy ↗ A company established in 1979 that contracts to develop video game software programs and develops and sells CAD packages. The head office is in Osaka, but their Kyoto office is inside Nintendo headquarters. Toshihiko Nakago is company president.
Vol. 5, p. 1, note 4 · archived copy ↗ so I asked the programmers at Nakago-san's company, SRD
Vol. 5, p. 1 · archived copy ↗ the SRD members who had made, for example, the Springs in Donkey Kong Jr.12, were also participating in the Super Mario Bros. project
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ After Kung-Fu, we started making Super Mario Bros., and I appointed Kondo-san to sound.
Vol. 5, p. 2, The New Guys, Too! · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3
How we know
Miyamoto says he set out to make something like his arcade Mario Bros. (1983), which didn't scroll and had a black background, but scrolling, bright, and with bigger characters. To make the screen scroll, he gave up on the two-player game that Mario Bros. had.
About two years before Super Mario Bros., I made the arcade version of Mario Bros., but the screen didn't scroll, the background was black, and it was sort of plain. … So I decided to test out something like Mario Bros., but which scrolled, had a bright background, and had bigger characters moving around. … I wanted the screen to scroll, so at that point, I gave up on a two-player game. … Two people could enjoy playing Mario Bros., but it didn't scroll sideways.
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3
How we know
The game drew on Nintendo's earlier ones. Its specification lists refinements of Donkey Kong's slopes, lifts, conveyor belts, and ladders, Donkey Kong Jr.'s ropes, logs, and springs, and Mario Bros.' enemies, frozen platforms, and POW Blocks. Iwata says the scrolling came from Excitebike and the large characters from Devil World, and Nakago that SRD's makers of Donkey Kong Jr.'s springs brought them in.
Add refinements focusing on Donkey Kong's slopes, lifts, conveyor belts and ladders; Donkey Kong Jr.'s ropes, logs and springs; and Mario Bros.'s enemy attacks, enemy movement, frozen platforms and POW Blocks. … you brought in the partial scrolling technology from Excitebike, which allowed you to scroll part of the screen, and the two-character mode technology from Devil World, which allowed characters twice the size of those in Mario Bros. … Right. It was a combination of elements from previous games. … the SRD members who had made, for example, the Springs in Donkey Kong Jr.12, were also participating in the Super Mario Bros. project, so they brought that straight in.
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3
How we know
Miyamoto says the warps came from Excitebike's arcade version, which let a player choose which of its three levels to start on: since a cartridge couldn't save, a good player could skip ahead instead of playing from the start every time.
perhaps the most important one was Excitebike. For example, the idea for warps came from there. … The arcade version of Excitebike had three levels, and you could choose where you wanted to start playing. … Right. Every time, you had to play from the beginning.
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3 · Iwata Asks, SMB 25th, Vol. 2 p. 4
How we know
Miyamoto says that, a year before the Disk System, the team meant it to be their last cartridge game, and packed in as much as they could to show what Nintendo could do with one. In another interview Izuhiko Imanishi recalled him making it on cartridge on purpose against the expectation of the Disk System, and Masayuki Uemura disputed it.
It was the year before the Disk System came out, and we intended it to be the last game we released on a cartridge. I wanted to put in as much as possible that would make people think, "Nintendo sure does know cartridges!"
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ I had the impression that Miyamoto-kun* purposely made Super Mario Bros. on cartridge against everyone's anticipation surrounding the Disk System. … No, not true! Not true!
Vol. 2, p. 4 · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3
How we know
Iwata says the game used 256-kilobit memory at first, and Miyamoto that its characters stayed at 64 kilobits.
When you first made Super Mario Bros., you used 256-kilobit memory at first. … That's right. The characters stayed at 64 kilobits, though.
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ - ^CodeXkeeper0/smb1smb1.asm 4–10
How we know
The cartridge header declares two 16 KB PRG ROM pages and one 8 KB CHR ROM page, so the game's tile set never changes.
4 .db "NES", $1a ; identification of the iNES header ⋮ 6 .db 2 ; number of 16KB PRG-ROM pages 7 .db 1 ; number of 8KB CHR-ROM pages ⋮ 10 .db 1 ; mapper/mirroring/whatever
smb1.asm lines 4–10 at 1cc3c92 · upstream ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 5 p. 3
How we know
At the end of development the team used up the spare bytes usually left for bug fixes: with 20 bytes left, Miyamoto added a crown as a reward for ten or more extra lives, and with eight left, more blocks.
And 20 bytes were left over, so Miyamoto-san said, "Let's make a crown!" … I wanted to make a crown as a reward for people who got ten or more extra lives. … Usually you would leave about 100 bytes as a precaution against bugs that might need to be fixed … "There are eight bytes left, so is there anything you want to put in?" … I really wanted to put some blocks here!
Vol. 5, p. 3, The Grand Culmination · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 2 p. 4
How we know
Iwata recalled that the game wasn't released to great fanfare and didn't catch fire at once, but drew in everyone who played it. In January 1986 the Asahi Shimbun's Asahi Graph ran a feature on it that Uemura calls a strategy guide for adults, and a store sign in his photo from those days says it is sold out with no stock due. Iwata calls it a social phenomenon.
It's not like Super Mario Bros. was released to great fanfare or really caught fire just after release, either. … Without exception, though, those who played it were drawn in. … "Super Mario Bros. and Portopia Renzoku Satsujin Jiken14 are sold out. No further stock scheduled. Our apologies." … "Take a Bite Out of Super Mario Bros." It's dated January 1986. … This feature article was in the Asahi Graph, published by Asahi Shimbun. … If you think about the reader demographic, this is a strategy guide for adults. … I've got this photo from those days... … At that time, it truly was a social phenomenon.
Vol. 2, p. 4 · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 2 p. 1
How we know
In 2010 Iwata said Super Mario Bros. had sold more packaged copies in Japan than any other game.
when it comes to the number of packaged copies of a game sold in Japan, Super Mario Bros. still far surpasses all other games.
Vol. 2, p. 1 · archived copy ↗ - ^InterviewIwata Asks, SMB 25th, Vol. 2 p. 4 · Iwata Asks, SMB 25th, Vol. 2 p. 1
How we know
Imanishi, then Nintendo's head of general affairs, recalled that before the game the Diet had taken up video games' influence on children and newspapers were mostly negative, and that Mario's bright atmosphere cleared away that prejudice against the Famicom.
Before Super Mario Bros. came out, even the parliament had taken up the issue of the influence of video games on children, and newspaper articles were mostly negative. But Mario's bright atmosphere cleared away that prejudice against the Famicom.
Vol. 2, p. 4 · archived copy ↗ When the Famicom (Nintendo Entertainment System) came out, Imanishi-san was heading the General Affairs Department
Vol. 2, p. 1 · archived copy ↗ - ^MagazineComputer Entertainer, February 1986
How we know
In February 1986 Computer Entertainer listed Super Mario Bros. among the 15 games sold with the NES in the markets it had reached, as a $30 Action Series game. After New York, shipments to southern California were about to begin.
is accompanied by 15 games in the markets where it is
Nintendo Update (printed page unmarked in the OCR) · archived copy ↗ CLIMBER, KUNG FU, SUPER MARIO BROS., and PINBALL … (Action Series at $30) … this issue went to press, shipments into southem California were about
Nintendo Update · archived copy ↗ - ^MagazineComputer Entertainer, June 1986
How we know
From June 1986 Nintendo offered the NES in a new, cheaper set, the Control Deck, with two controllers and the Super Mario Bros. Game Pak, while the Deluxe Set kept its robot, light gun, and two games.
this month, Nintendo will offer its system in a new
New Way to Buy Nintendo System (printed page unmarked in the OCR) · archived copy ↗ allowing consumers an inexpensive way to … The new option is to puhase the NES Control Deck, which includes two corollers and the “Super Mario Bros." Game Pak … rot and "Duck Hunt" and “Gyromite” Game Paks will
New Way to Buy Nintendo System · archived copy ↗ - ^PublisherNintendo, NES Games
How we know
In North America the game was later sold on two multicarts, with Duck Hunt from November 1988 and with Duck Hunt and World Class Track Meet from December 1990, by Nintendo of America's list.
2-in-1 Super Mario Bros/Duck Hunt Nintendo November 1988 … 3-in-1 Super Mario Bros/Duck Hunt/World Class Track Meet Nintendo December 1990
PDF p. 1 · archived copy ↗ - ^MagazineComputer Entertainer, June 1986
How we know
Computer Entertainer's June 1986 review called the game "sheer delight" and placed it among "truly addictive action games", saying the depth of its action keeps one playing and that no NES owner should be without it. It was rated Recommended.
For the game player, it's sheer delight
review of Super Mario Bros. (printed page unmarked in the OCR) · archived copy ↗ reserved for truly addictive action games … action that keeps you playing again and again … the Nintendo Entertainment System should be without … game--it's a must! … Recommended. (MSR $29.95)
review of Super Mario Bros. · archived copy ↗ - ^MagazineEGM 100
How we know
Electronic Gaming Monthly's 1997 list of the 100 best games ranked it 37th, counting the Super NES All-Stars version, and said it brought the video game market back from the dead and set the standard for side-scrolling platform games after it.
37 Super Mario Bros. (All-Stars Edition) … this game brought the video game market back from the dead … it set the standard for all side-scrolling platform titles from that point on
100 Best Games of All Time, no. 37 · archived copy ↗ - ^ManualVS. Super Mario Bros. operation manual
How we know
VS. Super Mario Bros. is an arcade version for Nintendo's VS. System, sold as six software ROMs and two custom chips to fit a VS. board. A two-monitor VS. DualSystem takes one copy, on its main side, and the operator's switches set coins per credit or free play, the number of lives, the coins for an extra life, and a continue mode.
“VS. SUPER MARIO BROS.” contains 6 Software ROMs and 2 Custom ICs … For VS. DUAL SYSTEM (two monitors) : Only one“VS. SUPER MARIO BROS.” can … the main Cleft) side of the cabinet.
1. How to install Software ROMs · archived copy ↗ CREDIT/COIN … FREE PLAY … NUMBER OF LIVES … EXTRA LIFE COINS … CONTINUE MODE
2. Game Option Settings · archived copy ↗ - ^CodeXkeeper0/smb1 · Jdaster64 n.d. · “Super Mario Bros. (World)”prg.asm 4873–4874, 5000–5014
How we know
Mario's top ground speed is
$18walking and$28running (B held).4873MaxRightXSpdData:src/prg.asm lines 4873–4874 at 1cc3c92 · upstream ↗ 5009 AND #B_Button 5010 BNE SetRTmr ; if pressed, skip ahead to set timer ⋮ 5014 INY ; if running timer not set or level type is water,
src/prg.asm lines 5000–5014 at 1cc3c92 · upstream ↗ Maximum walk speed (normal, castle cutscene) 01900 | Maximum running speed 02900
SMB PHYSICS 101 / GROUND PHYSICS, Mario table · archived copy ↗ In the cartridge (“Super Mario Bros. (World)”): MaxRightXSpdData. We don't reproduce the bytes.
- ^VerifiedXkeeper0/smb1 · “Super Mario Bros. (World)”prg.asm 4877–4878, 5042–5047, 4870–4874, 5028–5036
How we know
Measured from a standstill in World 1-1, Mario reaches
$18on frame 40 walking and$28on frame 45 running, and let go at those speeds he stops in 40 and 49 frames.4877FrictionData:src/prg.asm lines 4877–4878 at 1cc3c92 · upstream ↗ 5042 LDA PlayerFacingDirsrc/prg.asm lines 5042–5047 at 1cc3c92 · upstream ↗ 4870MaxLeftXSpdData: ⋮ 4873MaxRightXSpdData:
src/prg.asm lines 4870–4874 at 1cc3c92 · upstream ↗ In the cartridge (“Super Mario Bros. (World)”): FrictionData; MaxLeftXSpdData, MaxRightXSpdData. We don't reproduce the bytes.
Measured by a script in MesenCE 2.2.1 (build 4b8a196), on Super Mario Bros. (World) (SHA-1
33d23c2f2cfa…). It fails if the result disagrees with the claim. - ^CodeXkeeper0/smb1prg.asm 4913–4923, 4931–4942, 4139–4141
How we know
A jump starts only on the frame A goes down while Mario is grounded; the jump setup zeroes the vertical subpixel and sets the jumping state.
4913 LDA A_B_Buttons ; check for A button press ⋮ 4916 AND PreviousA_B_Buttons ; if button not pressed in previous frame, branch ⋮ 4922 LDA Player_State ; check player state 4923 BEQ InitJS ; if on the ground, branch
src/prg.asm lines 4913–4923 at 1cc3c92 · upstream ↗ 4935 STY Player_YMF_Dummy ⋮ 4941 LDA #$01 ; set player state to jumping/swimming
src/prg.asm lines 4931–4942 at 1cc3c92 · upstream ↗ 4141 STA PreviousA_B_Buttons ; into temp variable to be used on next framesrc/prg.asm lines 4139–4141 at 1cc3c92 · upstream ↗ - ^CodeXkeeper0/smb1 · Jdaster64 n.d.prg.asm 4943–4955
How we know
The jump setup picks one of five jump rows by take-off horizontal speed, stepping up at
$09,$10,$19, and$1C.4943 LDA Player_XSpeedAbsolute ; check value related to walking/running speed 4944 CMP #$09 ⋮ 4947 CMP #$10 4948 BCC ChkWtr ⋮ 4950 CMP #$19 4951 BCC ChkWtr ⋮ 4953 CMP #$1c 4954 BCC ChkWtr ; note that for jumping, range is 0-4 for Y
src/prg.asm lines 4943–4955 at 1cc3c92 · upstream ↗ Less than 01000 | 01000 – 024FF | 02500 or greater
JUMPING/VERTICAL PHYSICS, Mario table · archived copy ↗ - ^ManualSuper Mario Bros. instruction booklet
How we know
The manual says the d-pad walks Mario and B held with it runs; A jumps, higher the longer it is held, and higher from a run; the d-pad steers him in mid-air; and Super Mario jumps as high as Mario. The pad's chart also lists a crouch, for Super Mario only.
(Push button B at the
2. Names of Controller Parts · archived copy ↗ Mario (Luigi) jumps higher if you hold the button down longer.
2. Names of Controller Parts, A button · archived copy ↗ Accelerate ... Press this button to speed up, then jump and you can go all the
2. Names of Controller Parts, B button · archived copy ↗ hook to the left or right even in mid-air! … Jumping.......Mario and Super Mario both jump the
3. How to Play, Pointers · archived copy ↗ (Super Mario only.) … Crouch.
2. Names of Controller Parts · archived copy ↗ - ^CodeXkeeper0/smb1 · Jdaster64 n.d.prg.asm 4756–4769
How we know
The jump-and-swim routine swaps in falling gravity, never back, once speed is zero or downward, or once the jump has risen at least a set minimum (smb1/diff-to-halt-jump) on a frame when A is not held, or was not held the frame before.
4757 BPL DumpFall ; or moving downwards, branch to falling ⋮ 4760 AND PreviousA_B_Buttons ; and was pressed in previous frame 4761 BNE ProcSwim ; if so, branch elsewhere ⋮ 4765 CMP DiffToHaltJump ; compare to value set here to see if player is in mid-jump ⋮ 4768 LDA VerticalForceDown ; otherwise dump falling into main fractional 4769 STA VerticalForce
src/prg.asm lines 4756–4769 at 1cc3c92 · upstream ↗ so long as they are moving upward in a jump, holding “A” will make them rise more slowly
JUMPING/VERTICAL PHYSICS · archived copy ↗ - ^VerifiedXkeeper0/smb1prg.asm 4756–4769, 6664–6696, 4957–4958
How we know
Measured in the game on flat ground, the apexes, tapped/held, are 24/66 px standing, 27/71 px walking, and 29/83 px running.
4758 LDA A_B_Buttons ⋮ 4763 SEC ⋮ 4767DumpFall: ⋮ 4769 STA VerticalForce
src/prg.asm lines 4756–4769 at 1cc3c92 · upstream ↗ 6681 LDA SprObject_Y_MoveForce,x 6682 CLC ⋮ 6684 STA SprObject_Y_MoveForce,x ⋮ 6686 ADC #$00 6687 STA SprObject_Y_Speed,x ⋮ 6690 LDA SprObject_Y_MoveForce,x
src/prg.asm lines 6664–6696 at 1cc3c92 · upstream ↗ 4958 STA DiffToHaltJumpsrc/prg.asm lines 4957–4958 at 1cc3c92 · upstream ↗ - Rests on Measured in the game with A held, Mario's jumps peak at 66 px standing, 71 px walking, and 83 px running. (the same run, whose held peaks name the second row walking and the fourth running)
Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^VerifiedXkeeper0/smb1prg.asm 4756–4769, 6664–6696, 4957–4958
How we know
Measured in the game with A held, Mario's jumps peak at 66 px standing, 71 px walking, and 83 px running.
4758 LDA A_B_Buttons ⋮ 4763 SEC ⋮ 4767DumpFall: ⋮ 4769 STA VerticalForce
src/prg.asm lines 4756–4769 at 1cc3c92 · upstream ↗ 6681 LDA SprObject_Y_MoveForce,x 6682 CLC ⋮ 6684 STA SprObject_Y_MoveForce,x ⋮ 6686 ADC #$00 6687 STA SprObject_Y_Speed,x ⋮ 6690 LDA SprObject_Y_MoveForce,x
src/prg.asm lines 6664–6696 at 1cc3c92 · upstream ↗ 4958 STA DiffToHaltJumpsrc/prg.asm lines 4957–4958 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^CodeXkeeper0/smb1prg.asm 6666–6687
How we know
Vertical motion is 8.8 fixed point; each frame, the gravity routine adds speed to position, the fraction via a subpixel byte, then gravity to speed.
6668 ADC SprObject_Y_MoveForce,x 6669 STA SprObject_YMF_Dummy,x ⋮ 6676 ADC SprObject_Y_Position,x ; add vertical position to vertical speed plus carry ⋮ 6683 ADC $00 ; add downward movement amount to contents of $0433 ⋮ 6685 LDA SprObject_Y_Speed,x ; add carry to vertical speed and store
src/prg.asm lines 6666–6687 at 1cc3c92 · upstream ↗ - ^CodeXkeeper0/smb1 · Jdaster64 n.d.prg.asm 6547–6550, 6688–6696
How we know
The vertical-move routine gives the gravity routine 4 px/frame as Mario's maximum fall speed; the clamp sets the speed back to 4 only when its whole part is at least 4 and its fraction byte at least
$80.6549 LDA #$04 ; set maximum vertical speed here 6550 JMP ImposeGravitySprObj ; then jump to move player vertically
src/prg.asm lines 6547–6550 at 1cc3c92 · upstream ↗ 6688 CMP $02 ; compare to maximum speed ⋮ 6691 CMP #$80 ; if less positively than preset maximum, skip this part ⋮ 6694 STA SprObject_Y_Speed,x ; keep vertical speed within maximum value ⋮ 6696 STA SprObject_Y_MoveForce,x ; clear fractional
src/prg.asm lines 6688–6696 at 1cc3c92 · upstream ↗ their vertical downward velocity caps at 04800 in most cases, wrapping back to 04000 when exceeded
JUMPING/VERTICAL PHYSICS · archived copy ↗ - ^CodeXkeeper0/smb1 · Jdaster64 n.d.prg.asm 6688–6696
How we know
The gravity routine clamps a fall of 4 px/frame or more only when the fraction byte is at least
$80.6688 CMP $02 ; compare to maximum speed 6689 BMI ChkUpM ; if less than preset value, skip this part 6690 LDA SprObject_Y_MoveForce,x 6691 CMP #$80 ; if less positively than preset maximum, skip this part 6692 BCC ChkUpM
src/prg.asm lines 6688–6696 at 1cc3c92 · upstream ↗ their vertical downward velocity caps at 04800 in most cases, wrapping back to 04000 when exceeded
JUMPING/VERTICAL PHYSICS · archived copy ↗ - ^CodeXkeeper0/smb1prg.asm 4783–4788, 4748–4751
How we know
The air steering routine runs the friction routine only while Left or Right is held, so in the air a held direction accelerates Mario toward it up to the cap and a released d-pad keeps his speed.
4783LRAir: 4784 LDA Left_Right_Buttons ; check left/right controller bits (check for jumping/falling) 4785 BEQ JSMove ; if not pressing any, skip 4786 JSR ImposeFriction ; otherwise process horizontal movement 4787JSMove: 4788 JSR MovePlayerHorizontally ; do a sub to move player horizontally
src/prg.asm lines 4783–4788 at 1cc3c92 · upstream ↗ 4748FallingSub: 4749 LDA VerticalForceDown 4750 STA VerticalForce ; dump vertical movement force for falling into main one 4751 JMP LRAir ; movement force, then skip ahead to process left/right movement
src/prg.asm lines 4748–4751 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^CodeXkeeper0/smb1prg.asm 4735–4740, 4771–4784
How we know
On the ground the on-ground routine turns Mario toward a held Left or Right before friction runs; the jumping and falling routines change his facing only while he swims.
4735OnGroundStateSub: 4736 JSR GetPlayerAnimSpeed ; do a sub to set animation frame timing 4737 LDA Left_Right_Buttons 4738 BEQ GndMove ; if left/right controller bits not set, skip instruction 4739 STA PlayerFacingDir ; otherwise set new facing direction 4740GndMove:
src/prg.asm lines 4735–4740 at 1cc3c92 · upstream ↗ 4771 LDA SwimmingFlag ; if swimming flag not set, 4772 BEQ LRAir ; branch ahead to last part ⋮ 4779LRWater: 4780 LDA Left_Right_Buttons ; check left/right controller bits (check for swimming) 4781 BEQ LRAir ; if not pressing any, skip 4782 STA PlayerFacingDir ; otherwise set facing direction accordingly 4783LRAir: 4784 LDA Left_Right_Buttons ; check left/right controller bits (check for jumping/falling)
src/prg.asm lines 4771–4784 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^CodeXkeeper0/smb1prg.asm 4921–4925
How we know
Mario gets no grace window after leaving a ledge; the jump check refuses airborne jumps unless he is swimming.
4922 LDA Player_State ; check player state 4923 BEQ InitJS ; if on the ground, branch 4924 LDA SwimmingFlag ; if swimming flag not set, jump to do something else 4925 BEQ NoJump ; to prevent midair jumping, otherwise continue
src/prg.asm lines 4921–4925 at 1cc3c92 · upstream ↗ - ^VerifiedXkeeper0/smb1prg.asm 11185–11195
How we know
Mario leaves a ledge on the frame his horizontal move leaves neither foot point over a block; the falling state that the background collision routine sets first then stays, so he ends that frame in the air, with a vertical speed of 0, and starts falling on the next. Walking right, the left foot point decides, so he walks 5 px past the edge (measured); walking left, the right foot point decides, 4 px past it (from the code's points).
11185 JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom left of player ⋮ 11189 JSR BlockBufferColli_Feet ; do player-to-bg collision detection on bottom right of player 11190 STA $00 ; save bottom right metatile here 11191 PLA 11192 STA $01 ; pull bottom left metatile and save here 11193 BNE ChkFootMTile ; if anything here, skip this part 11194 LDA $00 ; otherwise check for anything in bottom right metatile 11195 BEQ DoPlayerSideCheck ; and skip ahead if not
src/prg.asm lines 11185–11195 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^VerifiedXkeeper0/smb1prg.asm 2324–2328, 4748–4751, 4965–4969
How we know
A falling Mario's gravity is a stored falling gravity, which the falling routine copies in every frame. Each area's entrance sets it to $28 (40/256 px/frame²), and only a jump changes it, to its row's falling gravity, so a walk-off before any jump falls at $28 and one after a jump at that jump's falling gravity.
2324Entrance_GameTimerSetup: ⋮ 2327 LDA #$28 ; store value here 2328 STA VerticalForceDown ; for fractional movement downwards if necessary
src/prg.asm lines 2324–2328 at 1cc3c92 · upstream ↗ 4748FallingSub: 4749 LDA VerticalForceDown 4750 STA VerticalForce ; dump vertical movement force for falling into main one 4751 JMP LRAir ; movement force, then skip ahead to process left/right movement
src/prg.asm lines 4748–4751 at 1cc3c92 · upstream ↗ 4965GetYPhy: 4966 LDA JumpMForceData,y ; store appropriate jump/swim 4967 STA VerticalForce ; data here 4968 LDA FallMForceData,y 4969 STA VerticalForceDown
src/prg.asm lines 4965–4969 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^VerifiedXkeeper0/smb1 · “Super Mario Bros. (World)”prg.asm 6151–6159, 6168–6176, 6218–6224, 6304–6320
How we know
The head-hit routine bumps the block unless Mario is big and the metatile is missing from a list of ? blocks (
$C0,$C1), hidden blocks ($5F,$60), and bricks with items ($55–$5E); then it breaks it (smb1/brick-break). So big Mario breaks plain bricks ($51–$53) and bumps the rest, and small Mario bumps everything. Size is the player-size byte, so by the code a crouching big Mario breaks bricks too (not probed). Measured: big Mario, standing, broke a brick and bumped a ? block and a hidden block; small Mario bumped a brick and a ? block.6151PlayerHeadCollision: 6152 PHA ; store metatile number to stack 6153 LDA #$11 ; load unbreakable block object state by default 6154 LDX SprDataOffset_Ctrl ; load offset control bit here 6155 LDY PlayerSize ; check player's size 6156 BNE DBlockSte ; if small, branch 6157 LDA #$12 ; otherwise load breakable block object state 6158DBlockSte: 6159 STA Block_State,x ; store into block object buffer
src/prg.asm lines 6151–6159 at 1cc3c92 · upstream ↗ 6168 JSR BlockBumpedChk ; do a sub to check which block player bumped head on ⋮ 6173ChkBrick: 6174 BCC PutMTileB ; if no match was found in previous sub, skip ahead 6175 LDY #$11 ; otherwise load unbreakable state into block object buffer 6176 STY Block_State,x ; note this applies to both player sizes
src/prg.asm lines 6168–6176 at 1cc3c92 · upstream ↗ 6218 LDY Block_State,x ; get block object state 6219 CPY #$11 6220 BEQ Unbreak ; if set to value loaded for unbreakable, branch 6221 JSR BrickShatter ; execute code for breakable brick 6222 JMP InvOBit ; skip subroutine to do last part of code here 6223Unbreak: 6224 JSR BumpBlock ; execute code for unbreakable brick or question block
src/prg.asm lines 6218–6224 at 1cc3c92 · upstream ↗ In the cartridge (“Super Mario Bros. (World)”): BrickQBlockMetatiles. We don't reproduce the bytes.
Measured by a script in MesenCE 2.2.1 (build 4b8a196), on Super Mario Bros. (World) (SHA-1
33d23c2f2cfa…). It fails if the result disagrees with the claim. - ^CodeXkeeper0/smb1prg.asm 10583–10592, 126–139; ram.asm 60–78
How we know
A hit on big Mario sets the injury timer to 8, and enemy contact is skipped until it is back at 0. It is one of the interval timers, which the timer routine counts down once every 21 frames, so the window lasts 8 such ticks, 148 to 168 frames while the game's timers run.
10583InjurePlayer: 10584 LDA InjuryTimer ; check again to see if injured invincibility timer is 10585 BNE ExInjColRoutines ; at zero, and branch to leave if so ⋮ 10591 LDA #$08 10592 STA InjuryTimer ; set injured invincibility timer
src/prg.asm lines 10583–10592 at 1cc3c92 · upstream ↗ 127 LDX #$14 ; load end offset for end of frame timers 128 DEC IntervalTimerControl ; decrement interval timer control, 129 BPL DecTimersLoop ; if not expired, only frame timers will decrement 130 LDA #$14 131 STA IntervalTimerControl ; if control for interval timers expired, 132 LDX #$23 ; interval timers will decrement along with frame timers
src/prg.asm lines 126–139 at 1cc3c92 · upstream ↗ 60Timers = $0780 ⋮ 78InjuryTimer = $079e
src/ram.asm lines 60–78 at 1cc3c92 · upstream ↗ - ^CodeXkeeper0/smb1 · “Super Mario Bros. (World)”prg.asm 11108–11118, 11235–11269, 11287–11297, 11149–11154, 11180–11195, 11202–11204, 11273–11286, 12295–12302, 12317–12319
How we know
Mario's background-collision routine runs after the frame's movement (smb1/frame-order). It first sets a swimming Mario's state to 1, and any other Mario in the normal or climbing state to falling (2), then tests the head, then the two foot points, then the side points, the left pair before the right. The first side point that finds a tile ends the check, though the first point of each pair passes over a pipe's top or a climbable. The side check then stops Mario unless the tile is a hidden block, a coin, a climbable, or a jumpspring in motion, or Mario, in the normal state and facing right, meets the bottom of a sideways or water pipe.
src/prg.asm at 1cc3c92 Our readingA ← 1, swimming's state (by the comment)11108swimming: to SetPSte11109–11110state 0, normal: to SetFallS11111–11112not 3, climbing: to ChkOnScr, state kept (not quoted)11113–11114SetFallS, normal or climbing: A ← 2, falling11115–11116SetPSte: state ← A11117–11118offset + 2, to the side adders11236–11238counter ← 211239–11240SideCheckLoop: next adder11242–11244in the status bar: to BHalf11245–11247too low: leave11248–11249side collision for one half11250nothing, or a pipe top: to BHalf11251–11255not climbable: to CheckSideMTiles11256–11257BHalf: the next adder11258–11260Y under $08, or $D0 and over: leave11261–11265side collision for the other half11266something found: to CheckSideMTiles11267counter − 1, until both sides11268–11269ChkPBtm: state not normal: StopPlayerMove (by its label)11287–11290facing left: StopPlayerMove (by the comment)11291–11293sideways pipe bottom: to PipeDwnS (by the comment)11294–11295not the water pipe bottom: StopPlayerMove (by the comment)11296–11297HeadChk: too high: to DoFootCheck11149–11152head collision (by its label)11153nothing: to DoFootCheck11154DoFootCheck: too low: to DoPlayerSideCheck11180–11184left foot (by the comment)11185a coin: to AwardTouchedCoin (not quoted)11186–11187right foot (by the comment)11188–11190left foot not empty: to ChkFootMTile (not quoted)11191–11193right foot empty too: to DoPlayerSideCheck11194–11195ChkFootMTile: climbable: to DoPlayerSideCheck (by its label)11202–11204hidden or coin 1-up block: leave (by the comment)11273–11275climbable: HandleClimbing (by its label)11276–11278a coin: HandleCoinMetatile (by its label)11279–11281a jumpspring (by its label)11282–11283 animating: leave11284–11285 else: StopPlayerMove11286adder sets at 0, 7 and $0E12295–12296each set: points 3-4 at x + 2, 5-6 at x + $0D12298–12302BlockBufferColli_Side: horizontal, for the player (by the comment)12317–12319In the cartridge (“Super Mario Bros. (World)”): BlockBufferAdderData, BlockBuffer_X_Adder. We don't reproduce the bytes.
- ^CodeXkeeper0/smb1prg.asm 11202–11220
How we know
When a foot point finds an ordinary solid block and Mario isn't moving up, the background collision routine lands him if his Y is less than 5 px into the block's 16 px row; 5 px or more, it calls the push-back routine in his moving direction instead, which pushes him 1 px back unless he is already moving away, and leaves without checking his sides.
11202ChkFootMTile: ⋮ 11205 LDY Player_Y_Speed ; check player's vertical speed 11206 BMI DoPlayerSideCheck ; if player moving upwards, branch ⋮ 11215 LDY $04 ; check lower nybble of vertical coordinate returned 11216 CPY #$05 ; from collision detection routine 11217 BCC LandPlyr ; if lower nybble < 5, branch 11218 LDA Player_MovingDir 11219 STA $00 ; use player's moving direction as temp variable 11220 JMP ImpedePlayerMove ; jump to impede player's movement in that direction
src/prg.asm lines 11202–11220 at 1cc3c92 · upstream ↗ - ^CodeXkeeper0/smb1prg.asm 11214–11233, 4921–4923
How we know
Mario can jump off a wall because the foot check counts a block in the wall's side as ground. If his move into a wall puts a foot point in a wall block while he is falling and less than 5 px below a block boundary, the background collision routine lands him there; he starts the next frame on the ground, so a fresh press of A then jumps.
11215 LDY $04 ; check lower nybble of vertical coordinate returned 11216 CPY #$05 ; from collision detection routine 11217 BCC LandPlyr ; if lower nybble < 5, branch ⋮ 11221LandPlyr: ⋮ 11223 LDA #$f0 11224 AND Player_Y_Position ; mask out lower nybble of player's vertical position 11225 STA Player_Y_Position ; and store as new vertical position to land player properly ⋮ 11227 LDA #$00 ⋮ 11231InitSteP: 11232 LDA #$00 11233 STA Player_State ; set player's state to normal
src/prg.asm lines 11214–11233 at 1cc3c92 · upstream ↗ 4922 LDA Player_State ; check player state 4923 BEQ InitJS ; if on the ground, branch
src/prg.asm lines 4921–4923 at 1cc3c92 · upstream ↗ - ^VerifiedXkeeper0/smb1prg.asm 11547–11584, 5091–5093
How we know
A side point in a block calls the push-back routine, which moves Mario 1 px away from the block and zeroes his speed byte, unless he is already moving away; either way it clears that side's d-pad bit in a collision byte, which the next frame's friction routine ANDs with the d-pad, so the next frame's friction ignores the direction into the wall.
11547ImpedePlayerMove: 11548 LDA #$00 ; initialize value here 11549 LDY Player_X_Speed ; get player's horizontal speed 11550 LDX $00 ; check value set earlier for 11551 DEX ; left side collision 11552 BNE RImpd ; if right side collision, skip this part 11553 INX ; return value to X 11554 CPY #$00 ; if player moving to the left, 11555 BMI ExIPM ; branch to invert bit and leave 11556 LDA #$ff ; otherwise load A with value to be used later ⋮ 11566 LDY #$00 11567 STY Player_X_Speed ; nullify player's horizontal speed ⋮
src/prg.asm lines 11547–11584 at 1cc3c92 · upstream ↗ 5091ImposeFriction: 5092 AND Player_CollisionBits ; perform AND between left/right controller bits and collision flag 5093 CMP #$00 ; then compare to zero (this instruction is redundant)
src/prg.asm lines 5091–5093 at 1cc3c92 · upstream ↗ Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^ abVerifiedXkeeper0/smb1prg.asm 11214–11217, 11550–11575, 11221–11233, 4921–4923
How we know
A wall jump's press has to come on a frame that starts with Mario caught on the wall's side. Measured in the cartridge with big Mario, the window was one frame for a walking jump into a wall laid into World 1-1's start, two for a running hop into the level's first pipe, unedited, and one for a running hop from the bricks into World 2-1's last wall; a press on the catch frame itself, or one frame after the window, did nothing.
LDY $04 CPY #$05 BCC LandPlyr
src/prg.asm#L11214-L11217 · upstream ↗ 11550 LDX $00 ; check value set earlier for 11551 DEX ; left side collision 11552 BNE RImpd ; if right side collision, skip this part 11553 INX ; return value to X 11554 CPY #$00 ; if player moving to the left, 11555 BMI ExIPM ; branch to invert bit and leave 11556 LDA #$ff ; otherwise load A with value to be used later 11557 JMP NXSpd ; and jump to affect movement 11558RImpd: 11559 LDX #$02 ; return $02 to X 11560 CPY #$01 ; if player moving to the right, 11561 BPL ExIPM ; branch to invert bit and leave ⋮
src/prg.asm lines 11550–11575 at 1cc3c92 · upstream ↗ 11221LandPlyr: ⋮ 11227 LDA #$00 ⋮ 11231InitSteP: 11232 LDA #$00
src/prg.asm lines 11221–11233 at 1cc3c92 · upstream ↗ 4921ProcJumping:src/prg.asm lines 4921–4923 at 1cc3c92 · upstream ↗ - Rests on A side point in a block calls the push-back routine, which moves Mario 1 px away from the block and zeroes his speed byte, unless he is already moving away; either way it clears that side's d-pad bit in a collision byte, which the next frame's friction routine ANDs with the d-pad, so the next frame's friction ignores the direction into the wall. (the push out of the wall, 1 px a frame)
- Rests on No jump from the floor or the bricks in front of it clears World 2-1's last wall, and a wall jump from the bricks does. Measured in the cartridge with big Mario, starting from the wall's screen: after a running hop onto the bricks, a running jump from them with A held peaked 147 px above the floor, short of the wall's top at 160 (computed from the level data), and he next stood on the floor. From the floor, by arithmetic rather than a run, his highest jump's 83 px rise can't reach 160. A 4-frame hop from the bricks brought his foot to the wall's side 80 px up on the way down, at the end of frame 91; a press on frame 92 jumped him to 163 px and onto the top, and presses on frames 91 and 93 didn't jump. The level has another way up without a wall jump: the hidden coin block over the second brick, once hit, is a ledge 128 px up (computed), and a jump from it reaches the top. (the one-frame window from the bricks into World 2-1's last wall)
Measured by a script in MesenCE 2.2.1 (build 4b8a196), on . It fails if the result disagrees with the claim.
- ^WikiSuper Mario Wiki, “Wall Jump” · TASVideos, “Game Resources: NES Super Mario Bros.”
How we know
Mario can jump off the side of a wall when his feet meet it at a block boundary, a glitch that Super Mario Wiki counts among maneuvers resembling the later, designed Wall Jump, with "frame-perfect timing". TASVideos' resource page explains it by the floor check running during the push out of a wall, and asks for an X speed above 16 toward the wall.
maneuvers similar to the Wall Jump exist as glitches. For example, in Super Mario Bros., if Mario lands on a wall on a 16×16 boundary (so that his foot is on the top corner of a block), the player is able to jump from that point with frame-perfect timing.
History, Super Mario series · archived copy ↗ Walljump happens because the game does a floor check (a simple "is there a solid block below him?" test) even during a wall-ejection. … Some horizontal speed towards the wall (facing right: X speed > 16, facing left: X speed < 240) … Mario's feet must hit the wall at a block boundary (every 16 pixels)
Walljump · archived copy ↗ - ^Code notesXkeeper0/smb1music-data.asm 4–8; defs.asm 41–47; +1 files
How we know
Super Mario Bros.'s song table has a second entry for the game-over song that none of the stores that name the event-music queue asks for: entry
$04, bit 4 of that queue, points at$F966, the game-over song's header, as entry$01does. Those stores write$08,$04,$02,$20,$40,$80, or 1. The square channels' code treats bit 4 as it treats bits 0 and 7, the death song and silence: for an event song with any of those bits (it tests%10010001), both square channels skip their envelope table.4 .db DeathMusHdr-MHD ; event music 5 .db GameOverMusHdr-MHD 6 .db VictoryMusHdr-MHD 7 .db WinCastleMusHdr-MHD 8 .db GameOverMusHdr-MHD
src/music-data.asm lines 4–8 at 1cc3c92 · upstream ↗ 41TimeRunningOutMusic = %01000000 42EndOfLevelMusic = %00100000 43AltGameOverMusic = %00010000 44EndOfCastleMusic = %00001000 45VictoryMusic = %00000100 46GameOverMusic = %00000010 47DeathMusic = %00000001
src/defs.asm lines 41–47 at 1cc3c92 · upstream ↗ src/music-engine.asm at 1cc3c92 Our readingsquare 2 free, and the event song has bit 7, 4 or 0: skip the envelope749–753square 1 free, and the event song has bit 7, 4 or 0: skip the envelope796–800Measured by a script. It fails if the result disagrees with the claim.
- ^Code notesXkeeper0/smb1music-data.asm 13–14; music-engine.asm 640–660
How we know
Super Mario Bros.'s song table has an entry for steps of the aboveground theme that no store naming the area-music queue reaches: entry
$08, which the engine's bit search gives for bit 0 of that queue, points at$F976, the header that steps 2, 3, 16 and 17 of the aboveground theme play. The area byte$01alone goes to the aboveground theme's steps, entries$10on; the search reaches entry$08only for a byte with bit 0 and another bit set. Every store that names the area queue writes one bit:$80,$40, or one of$02,$01,$04,$08,$10and$20from a table, and the engine's own restarts pass on a byte it took from the queue.13 .db GroundLevelPart1Hdr-MHD ; area music 14 .db WaterMusHdr-MHD
src/music-data.asm lines 13–14 at 1cc3c92 · upstream ↗ src/music-engine.asm at 1cc3c92 Our readingarea buffer ← the byte643exactly $01: the aboveground theme's next step644–652any other byte: Y ← 8, then + 1 per shift right until a set bit654–660Measured by a script. It fails if the result disagrees with the claim.
- ^CodeXkeeper0/smb1 · “Super Mario Bros. (World)”music-data.asm 45–48; music-engine.asm 662–676
How we know
Super Mario Bros. has a song header that no entry of its song table points at, so no request can play it. The five bytes at
$F94Egive note-length offset$20, as the level-clear song's header does, and song data at$FCC4, 20 bytes into the level-clear song's data, which starts at$FCB0; its triangle and square 1 offsets are$3Fand$1D, where the level-clear song's are$3Dand$21.45EndOfLevelMusHdr: 46 .db $20, <WinLevelMusData, >WinLevelMusData, $3d, $21 47ResidualHeaderData:
src/music-data.asm lines 45–48 at 1cc3c92 · upstream ↗ In the cartridge (“Super Mario Bros. (World)”): $F949-$F952: the level-clear song's header, then the one at $F94E. We don't reproduce the bytes.
src/music-engine.asm at 1cc3c92 Our readingheader ← the table's byte at entry Y − 1663–664its six bytes: note-length offset, data address, triangle, square 1 and noise offsets665–676Measured by a script. It fails if the result disagrees with the claim.
- ^CodeSuper Mario Bros. instruction booklet · Xkeeper0/smb1prg.asm 4913–4918, 5000–5010, 5024–5025, 5142–5161, 4372–4378, 4702–4711, 213–216, 186–188, 4080–4083
How we know
On land in Super Mario Bros., A jumps, and B held while walking runs; Fire Mario's B also throws a fireball. Left and Right walk, and Down crouches big Mario, Super or Fire, on the ground; small Mario doesn't crouch. Start on controller 1 pauses the game and resumes it.
Jump... ... Mario (Luigi) jumps higher if you hold the button down longer.
p. 4, 2. Names of Controller Parts, A button · archived copy ↗ Accelerate ... Press this button to speed up, then jump and you can go all the … Fireballs ...... After you pick up the fire flower, you can use this button to throw
p. 4, 2. Names of Controller Parts, B button · archived copy ↗ Walk to the right. … (Push button B at the … Crouch. … (Super Mario only.)
p. 3, 2. Names of Controller Parts, Control Pad · archived copy ↗ If you wish to interrupt play in the middle of a game, press the START button. … The pause tone will sound, and the game will stop. Press the START button again
p. 5, START button · archived copy ↗ 4913 LDA A_B_Buttons ; check for A button press 4914 AND #A_Button 4915 BEQ NoJump ; if not, branch to something else 4916 AND PreviousA_B_Buttons ; if button not pressed in previous frame, branch 4917 BEQ ProcJumping 4918NoJump:
src/prg.asm lines 4913–4918 at 1cc3c92 · upstream ↗ 5000ProcPRun: 5001 INY ; if mario on the ground, increment Y 5002 LDA AreaType ; check area type 5003 BEQ ChkRFast ; if water type, branch 5004 DEY ; decrement Y by default for non-water type area 5005 LDA Left_Right_Buttons ; get left/right controller bits 5006 CMP Player_MovingDir ; check against moving direction 5007 BNE ChkRFast ; if controller bits <> moving direction, skip this part 5008 LDA A_B_Buttons ; check for b button pressed 5009 AND #B_Button 5010 BNE SetRTmr ; if pressed, skip ahead to set timer
src/prg.asm lines 5000–5010 at 1cc3c92 · upstream ↗ 5024SetRTmr: 5025 LDA #$0a ; if b button pressed, set running timer
src/prg.asm lines 5024–5025 at 1cc3c92 · upstream ↗ Walk to the left.
p. 3, 2. Names of Controller Parts, Control Pad · archived copy ↗ - ^CodeSuper Mario Bros. instruction booklet · Xkeeper0/smb1prg.asm 2337–2341, 4921–4930, 5000–5003, 4361–4371, 213–216
How we know
In Super Mario Bros.'s water areas, A swims: each press sends Mario up a stroke, except while he is still rising after the last stroke's timer has run out. B no longer runs there, but Fire Mario's B still throws fireballs. The Control Pad moves him and crouches big Mario on the floor, and Start pauses as on land. Below a line near the bottom of the screen, or off the screen vertically, the game ignores the Control Pad, A, and B, though Start still pauses.
Swim... ..When you're in the water, each press of this button makes you bob
p. 4, 2. Names of Controller Parts, A button · archived copy ↗ 2337 LDA AreaType ; check area type 2338 BNE ChkStPos ; if water type, set swimming flag, otherwise do not set 2339 INY 2340ChkStPos: 2341 STY SwimmingFlag
src/prg.asm lines 2337–2341 at 1cc3c92 · upstream ↗ 4921ProcJumping: 4922 LDA Player_State ; check player state 4923 BEQ InitJS ; if on the ground, branch 4924 LDA SwimmingFlag ; if swimming flag not set, jump to do something else 4925 BEQ NoJump ; to prevent midair jumping, otherwise continue 4926 LDA JumpSwimTimer ; if jump/swim timer nonzero, branch 4927 BNE InitJS 4928 LDA Player_Y_Speed ; check player's vertical speed 4929 BPL InitJS ; if player's vertical speed motionless or down, branch 4930 JMP X_Physics ; if timer at zero and player still rising, do not swim
src/prg.asm lines 4921–4930 at 1cc3c92 · upstream ↗ 5000ProcPRun: 5001 INY ; if mario on the ground, increment Y 5002 LDA AreaType ; check area type 5003 BEQ ChkRFast ; if water type, branch
src/prg.asm lines 5000–5003 at 1cc3c92 · upstream ↗ - ^CodeSuper Mario Bros. instruction booklet · Xkeeper0/smb1prg.asm 330–353, 364–376, 402–407, 428–433, 622–626, 638–645
How we know
On Super Mario Bros.'s title screen, Select moves the mushroom between the one- and two-player games and Start begins, from either controller. Holding A with Start begins at the first area of the world where the last game ended. Once the game has been beaten and B pressed on the ending screen, B on the title screen steps through the worlds.
Use this button to move the mushroom mark to the
p. 4, SELECT button · archived copy ↗ Press this button to begin.
p. 5, START button · archived copy ↗ 330GameMenuRoutine: 331 LDY #$00 332 LDA SavedJoypad1Bits ; check to see if either player pressed 333 ORA SavedJoypad2Bits ; only the start button (either joypad) 334 CMP #Start_Button 335 BEQ StartGame 336 CMP #A_Button+Start_Button ; check to see if A + start was pressed 337 BNE ChkSelect ; if not, branch to check select button 338StartGame: 339 JMP ChkContinue ; if either start or A + start, execute here 340ChkSelect: 341 CMP #Select_Button ; check to see if the select button was pressed ⋮
src/prg.asm lines 330–353 at 1cc3c92 · upstream ↗ 364 CPY #$01 ; was the B button pressed earlier? if so, branch 365 BEQ IncWorldSel ; note this will not be run if world selection is disabled 366 LDA NumberOfPlayers ; if no, must have been the select button, therefore 367 EOR #%00000001 ; change number of players and draw icon accordingly 368 STA NumberOfPlayers 369 JSR DrawMushroomIcon 370 JMP NullJoypad 371IncWorldSel: 372 LDX WorldSelectNumber ; increment world select number 373 INX 374 TXA 375 AND #%00000111 ; mask out higher bits ⋮
src/prg.asm lines 364–376 at 1cc3c92 · upstream ↗ 402ChkContinue: 403 LDY DemoTimer ; if timer for demo has expired, reset modes 404 BEQ ResetTitle 405 ASL ; check to see if A button was also pushed 406 BCC StartWorld1 ; if not, don't load continue function's world number 407 LDA ContinueWorld ; load previously saved world number for secret
src/prg.asm lines 402–407 at 1cc3c92 · upstream ↗
Sources
Code
- doppelganger and Xkeeper. 2022. “smb1: Super Mario Bros. disassembly for asm6f (Xkeeper0/smb1).” Commit 1cc3c92. Xkeeper0/smb1 @ 1cc3c92 · licence, all uses
- 1985. “Super Mario Bros. (World).” · licence, all uses
Primary
- Iwata, Satoru and Nintendo Co., Ltd. 2010. “Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 2, p. 1 (Bringing Video Games Home).” Iwata Asks, Wii, Super Mario Bros. 25th Anniversary, Vol. 2, p. 1. Nintendo Co., Ltd. original · archived · licence, all uses
- Iwata, Satoru and Nintendo Co., Ltd. 2010. “Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 5, p. 1 (Using the D-pad to Jump).” Iwata Asks, Wii, Super Mario Bros. 25th Anniversary, Vol. 5, p. 1. Nintendo Co., Ltd. original · archived · licence, all uses
- Co., Nintendo and Ltd. 2026. “Corporate Information: Company History (Nintendo).” original · archived · licence, all uses
- America, Nintendo of. n.d. “NES Games (Nintendo of America release list).” Nintendo of America. original · archived · licence, all uses
- Nintendo. 1985. “Super Mario Bros. instruction booklet (NES).” Super Mario Bros. instruction booklet, pp. 1-16. Nintendo of America. original · archived · licence, all uses
- Iwata, Satoru and Nintendo Co., Ltd. 2010. “Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 5, p. 3 (The Grand Culmination).” Iwata Asks, Wii, Super Mario Bros. 25th Anniversary, Vol. 5, p. 3. Nintendo Co., Ltd. original · archived · licence, all uses
- Iwata, Satoru and Nintendo Co., Ltd. 2010. “Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 5, p. 2 (The New Guys, Too!).” Iwata Asks, Wii, Super Mario Bros. 25th Anniversary, Vol. 5, p. 2. Nintendo Co., Ltd. original · archived · licence, all uses
- Iwata, Satoru and Nintendo Co., Ltd. 2010. “Iwata Asks: Super Mario Bros. 25th Anniversary, Vol. 2, p. 4 (The Grand Culmination of Famicom Cartridges).” Iwata Asks, Wii, Super Mario Bros. 25th Anniversary, Vol. 2, p. 4. Nintendo Co., Ltd. original · archived · licence, all uses
- Nintendo. n.d. “VS. Super Mario Bros. operation manual (Nintendo VS. System).” VS. Super Mario Bros. operation manual, pp. 1-3. Nintendo of America. original · archived · licence, all uses
Secondary
- Computer Entertainer editors. 1986. “Computer Entertainer, Vol. 5, No. 3 (June 1986).” Computer Entertainer, vol. 5, no. 3 (June 1986). Computer Entertainer. original · archived · licence, all uses
- Nintendo Power editors. 1988. “Nintendo Power, issue 3 (1988-11).” Nintendo Power, vol. 3. Nintendo of America. original · archived · licence, all uses
- Computer Entertainer editors. 1986. “Computer Entertainer, Vol. 4, No. 11 (February 1986).” Computer Entertainer, vol. 4, no. 11 (February 1986), pp. 12-13. Computer Entertainer. original · archived · licence, all uses
- Davis, Ziff. 1997. “Electronic Gaming Monthly, issue 100 (November 1997).” original · archived · licence, all uses
- Jdaster64. n.d. “A Complete Guide to SMB's Physics Engine.” original · archived · licence, all uses
- Super Mario Wiki contributors. n.d. “Wall Jump.” Super Mario Wiki. original · archived · licence, all uses
- TASVideos contributors. n.d. “Game Resources: NES Super Mario Bros.” TASVideos. original · archived · licence, all uses