| Each frame the NMI handler loads the MMC3's scanline counter with 192, and the IRQ it raises points the PPU at the status bar's nametable rows and swaps in the status bar's tile banks. | PRG/prg031.asm L1595–1601PRG/prg031.asm L2197–2203 | Code |
| At the status bar the IRQ handler switches the background's two 2 KB CHR banks to the status bar's tiles and all four 1 KB sprite banks to blank tiles, so no sprite shows over the bar. | PRG/prg031.asm L2214–2230 | Code |
In ordinary levels the game picks the 2 KB background bank at PPU $0800 from PT2_Anim, banks $60, $62, $64, $66, by frame-counter bits 3-4, so the animated tiles step every 8 frames on a 32-frame loop; an active P-Switch forces bank $3E. | PRG/prg030.asm L2294–2305PRG/prg030.asm L423smb3.asm L2019–2024PRG/prg030.asm L2257–2262 | Code |
| In the N-Spade card game three IRQs, at scanlines 32, 84, and 136, each give one row its own horizontal scroll and set the next IRQ 52 lines on, and a fourth restores the status bar, so three bands of the screen slide independently. | PRG/prg022.asm L2602–2606PRG/prg031.asm L2491–2496PRG/prg031.asm L2474–2478PRG/prg031.asm L2550–2559 | Code |
The music data has a sample track beside the other channels' tracks; each note byte on it queues a sample, and Music_PlayDMC loads that sample's rate, address, and length from three 16-entry tables and restarts the DMC. | PRG/prg031.asm L926–936PRG/prg031.asm L950PRG/prg031.asm L91–110 | Code |
The 16 sample entries play 9 recordings, some reused at a lower rate or cut short; their rate bytes are $0F (33,144 Hz) for most, and $0E (24,858 Hz) or $0D (21,307 Hz) for some of the reused copies. | PRG/prg031.asm L163–179PRG/prg031.asm L113–117 | Code |
Super Mario Bros. 3 keeps Mario's speeds as 4.4 fixed point: the high nibble is whole pixels per frame, the low nibble sixteenths. Player_ApplyYVelocity caps the fall at FALLRATE_MAX, $40, before the frame's gravity is added, so the move never exceeds 4 px a frame. Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, a jump's fall levels off at 4 px a frame. | PRG/prg008.asm L6945–6950PRG/prg024.asm L21 | Verified |
A jump takes off at PLAYER_JUMP, -$38, minus Player_SpeedJumpInc indexed by the whole part of Mario's horizontal speed: -$38, -$3A, -$3C, or -$40. Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, a jump from a standstill and one at the full-meter speed $38 take off at -$38 and -$40 (the first frame's speed, one more after that frame's held-A gravity). | smb3.asm L3563PRG/prg008.asm L1199–1204PRG/prg008.asm L2604–2612 | Verified |
In the air Player_JumpFlyFlutter adds 5 to Mario's vertical speed each update, or 1 while A is held and he rises faster than $20; a Micro-Goomba stuck to him keeps the 5 even with A held. A tail wag can then overwrite the speed (flight-time, tail-wag), and a Tanooki statue skips this routine (tanooki-statue). Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, a jump with A held gains 1 a frame until the rise slows to -$20, then 5 a frame; with A pressed for one frame it gains 5 a frame from the frame after the take-off. | PRG/prg008.asm L2644–2672 | Verified |
| Measured in Mesen from power-on as Raccoon Mario standing at World 1-1's start, a jump with A held rises 71 px, about four and a half tiles, and a jump with A pressed for one frame rises 21 px. Both follow from the take-off (jump-speed) and the two gravities (gravity). | smb3.asm L3563PRG/prg008.asm L2644–2654 | Verified |
A jump starts on the frame A goes down if Mario is on the ground, or in the air while Player_AllowAirJump is counting down. | PRG/prg008.asm L2548–2565 | Code |
Some objects Mario rides set Player_AllowAirJump, a countdown in which a jump still starts in the air, to 5, 8, or 16; the Parabeetle sets 5 as it droops. Player_JumpFlyFlutter decrements the count before testing it, so those values leave 4, 7, or 15 updates in which a press of A jumps. | smb3.asm L1279PRG/prg005.asm L2450–2452PRG/prg005.asm L3561–3565PRG/prg005.asm L4035–4036PRG/prg008.asm L2548–2562 | Code |
Off uphill slopes, Mario's speed tops out at $18 walking, $28 holding B, and $38 while the P-meter is full; walking uphill, the cap comes from Player_UphillSpeedVals instead. Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, holding Right levels off at $18, and Right with B at $28 until the meter fills, then at $38. | smb3.asm L3559–3562PRG/prg008.asm L2320–2382 | Verified |
Below the top speed, a held direction adds the suit's entry in Player_XAccelMain plus the carry from adding its Player_XAccelPseudoFrac entry to Counter_Wiggly, on the ground and in the air. Each frame Counter_Wiggly becomes its high nibble minus $90, so it steps through all 16 high nibbles: computed, an $E0 fraction carries on 14 of every 16 frames, so every suit but the Frog gains 1 on 14 frames in 16, about 0.88 a frame, while the Frog's entry adds 2 every frame. Pressing against the motion adds 2 the other way for every suit. With no direction held on the ground, or over the top speed on the ground, the friction entry takes 1 on each frame without a carry: 14 in 16 for Super, Fire, and Raccoon Mario ($20), 10 in 16 for small, Tanooki, and Hammer Mario ($60), and every frame for the Frog ($00). Over the top speed in the air nothing changes it, and slippery ground uses other entries. Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, holding Right from rest gains 1 on 14 of any 16 frames and reaches $28 (with B) on the 46th. | PRG/prg008.asm L1141–1152PRG/prg008.asm L1167–1178PRG/prg008.asm L2383–2497PRG/prg008.asm L339–343 | Verified |
The P-meter, Player_Power, is seven bits. Mario runs, for the meter, on a frame he is on the ground and not sliding, with B held and his speed already $28 or more. Each time Player_PMeterCnt reaches 0, a running frame adds a step and sets it to 8, and any other frame takes one away and sets it to 24; at 0 steps the counter stays 0, so the next run adds one at once. A full meter, $7F, takes 7 steps, and each running frame at full sets the counter to 16, so the meter stays full 16 frames past the last one. While Player_FlyTime is counting, none of this runs (flight-time). Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, with Right and B held from rest the first step comes the frame after he reaches $28, then one every 8 frames to full; with B let go, it drops 16 frames later and then every 24. | PRG/prg008.asm L2346–2375PRG/prg008.asm L981–1058PRG/prg008.asm L378–389smb3.asm L1545–1555 | Verified |
A jump with the meter full and no flight time left sets Player_FlyTime to $80, which counts down every other frame, about 256 frames; when it reaches 0 the meter empties ($FF, the P-Wing's value, never counts down). In the Raccoon or Tanooki suit, the suits with the flight bit in PowerUp_Ability, each press of A in the air starts a 16-frame wag. During a wag, unless he is rising faster than -$18, his vertical speed is set to -$18 while the timer is $0F or more, to -$10 from $0E to $08, and to 0 from $07 to $01; since the timer ticks every other frame, those two stages last 14 frames each. At 0 the tail only slows a fall (tail-wag). Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, a jump at full speed with A pressed every 4 frames sets the timer to $80, climbs at -$18, then for 14 frames at -$10 and 14 at 0, and the timer and meter run out 255 frames after the take-off. | PRG/prg008.asm L2621–2629PRG/prg008.asm L981–999PRG/prg008.asm L2673–2730PRG/prg000.asm L558–560 | Verified |
On the ground, Player_JumpFlyFlutter clears Player_FlyTime unless the suit has the flight bit, so Raccoon and Tanooki Mario keep the rest of a flight through a landing, with the meter still full, and can take off again; for the other suits a full-meter jump's timer ends when they land. | PRG/prg008.asm L2631–2642 | Code |
Out of flight time, a wag of A with the Raccoon or Tanooki tail caps Mario's fall at PLAYER_TAILWAG_YVEL, $10, and leaves a rise or a slower fall alone. Measured in Mesen from power-on as Raccoon Mario at World 1-1's start, wagging every 4 frames after a flight runs out, his fall levels off at $10, 1 px a frame. | PRG/prg008.asm L2683–2691PRG/prg008.asm L2720–2730 | Verified |
Raccoon and Tanooki Mario swing the tail on a press of B when Down isn't held and no swing is under way: Player_TailAttack is set to $12, 18 frames of the swing. | PRG/prg008.asm L3574–3591PRG/prg008.asm L2010–2015 | Code |
| With neither Left nor Right held, Mario's horizontal speed gets friction only on the ground; in the air the routine returns and he keeps his speed. | PRG/prg008.asm L2413–2421 | Code |
Holding only Down on a slope starts a slide, except in the Frog or Hammer suit (bit 1 of PowerUp_Ability) or Kuribo's Shoe. Each update the slope's push is added to the slide speed, which is capped at $40 and then loses 1 toward 0, so it tops out at $3F. | PRG/prg008.asm L5990–6017PRG/prg008.asm L6024–6042smb3.asm L1590 | Code |
A hit that doesn't kill Mario, including one that only takes Kuribo's Shoe, sets Player_FlashInv to $71, and Player_GetHurt ignores hits while it is nonzero. Player_Draw counts it down each time it runs, blinking Mario in 2-tick halves. | PRG/prg000.asm L5620–5629PRG/prg000.asm L5744–5746PRG/prg029.asm L423–429 | Code |
PowerUp_Ability gives each form two flags: bit 0, flight and the tail wag, for the Raccoon and Tanooki suits; bit 1, which keeps Mario from starting a slope slide, for the Frog and Hammer suits. Small, Super, and Fire Mario have neither. | PRG/prg000.asm L558–560PRG/prg008.asm L583–590 | Code |
In the Tanooki suit, a press of B while Down is held, when he isn't a statue already, queues the statue: Player_Update sets Player_Statue to $C0, and it counts down one a frame while Down stays held, about 3.2 seconds at most; letting go of Down, or the count reaching 1, ends it. A statue doesn't move sideways, gets 7 a frame of gravity in the air in place of the jump routine's, and skips the suit's other moves; at $60 left, Player_FlashInv is set so he blinks for the rest. | PRG/prg008.asm L3319–3400PRG/prg008.asm L794–815PRG/prg008.asm L2238–2244 | Code |
Enemies and their fireballs don't hurt a Tanooki statue: Player_GetHurt, the enemy-contact check, and the special objects' contact check all return while Player_Statue is set. Where an enemy can't otherwise be stomped, or Mario is in water, landing on it from above as a statue (or in Kuribo's Shoe) leaves an enemy flagged OA2_STOMPDONTCARE as it was, since the routine returns; any other enemy is stomped, then squashed if a stomp would squash it, or else killed outright. | PRG/prg000.asm L5620–5631PRG/prg000.asm L3862–3904PRG/prg000.asm L4070–4075PRG/prg007.asm L4769–4777 | Code |
Out of water and not holding anything, Frog Mario hops. On the ground, when no hop is under way, his horizontal speed is set to 0, and a held direction starts a hop (Player_FrogHopCnt = $1F), during which the Frog's acceleration entry adds 2 a frame (ground-accel). In the air, unless he is sinking in quicksand, the hop count is cleared and Player_GroundHControl steers him as it does the other suits. Holding something, he moves like the other suits on the ground too. | PRG/prg008.asm L2019–2063 | Code |
| Under water the Frog suit sets Mario's speed straight from the d-pad: 16 (1 px/frame) each way, doubled to 32 while A is held, and with a direction released that speed eases back toward 0 by 1 a frame; Up gives 0 while he is above the top of the screen. | PRG/prg008.asm L2082–2175 | Code |
| With the Fire Flower or the Hammer Suit, a press of B throws a weapon unless Mario is ducking, kicking, in a pipe, or the game is halted: Fire Mario's fireball starts downward, the Hammer Suit's hammer upward. Ducking in the Hammer Suit, the fireballs of Piranha Plants, Nippers, Fire Bros., and Fire Chomps collide with him as if he had a Starman's invincibility, which destroys the fireball instead of hurting him. | PRG/prg007.asm L479–499PRG/prg007.asm L586–601PRG/prg007.asm L3184–3198PRG/prg007.asm L5213–5242PRG/prg007.asm L4805–4824 | Code |
| In this release a hit takes Mario down one step: from the Fire Flower or any suit (Raccoon, Frog, Tanooki, Hammer) back to Super Mario, from Super to small, and as small Mario he dies. In Kuribo's Shoe the hit takes the shoe and he keeps his form. A hit is ignored while he blinks from the last one, is a statue, has a Starman, has just lost a suit, or the game is halted, and while the debug no-hit flag is set. | PRG/prg000.asm L5620–5632PRG/prg000.asm L5673–5755 | Code |
Player_GetHurt jumps over a block that Southbird's comments mark as the Japanese version's code, and a comment says the Japanese version "always" shrinks Mario: in that block, any hit on a powered Mario queues small Mario, with the Frog, Tanooki, and Hammer suits flying off. | PRG/prg000.asm L5631–5671PRG/prg000.asm L5678 | Code notes |
Touching a shell as a statue or in Kuribo's Shoe kicks it. Otherwise the touch does nothing while he is already holding something; with B held he picks the shell up, and without B he kicks it. A carried shell is kicked when B is let go, except while he is in a pipe or dying. A kicked shell gets 3 px/frame ($30) the way he faces, or for a shell on the ground away from him, plus half his speed when he moves the same way. A Bob-omb is thrown instead (bobomb-throw), and a carried shell let go against a wall dies (shell-wall-kill). | PRG/prg000.asm L4042–4066PRG/prg000.asm L2794PRG/prg000.asm L2810–2849PRG/prg000.asm L2934–2988 | Code |
Kicking a Bob-omb, lit or not, throws it instead: it keeps its normal state, bounces up at -$20, and moves away from Mario at $28, or at $30 plus half his speed when he moves that way. | PRG/prg000.asm L2794–2800PRG/prg000.asm L2844–2879 | Code |
Kicking a carried object other than a Bob-omb or an ice block first gives it a speed of 1 the way Mario faces and tests it against the level. If it touches a wall it dies instead, flying up at -$40, for 100 points; otherwise the kick goes ahead (shell-carry). | PRG/prg000.asm L2880–2933 | Code |