The HUD is the window layer, set to X 7. The main game mode's handler sets window Y to $88 (line 136, the bottom 8 lines), or $80 (16 lines) to show a message while Samus touches a save point or collects a major item. In the Queen's room the HUD moves to the background layer, because her head uses the window. | SRC/bank_001.asm L2946–2989SRC/bank_001.asm L71–79SRC/bank_000.asm L683–690 | Code |
| alex-west's M2RoS disassembly of Metroid II, assembled with rgbds, equals Metroid II - Return of Samus (World) byte for byte. | readme.md L13 | Code |
A jump sets samus_jumpArcCounter to $31, or $21 with the Hi-Jump Boots. While A is held and the counter is below $40, poseFunc_jump lifts Samus 2 px each frame, 3 with the boots, and adds 1 to the counter: up to 15 frames, or 31. Letting go sets the counter to $56, which the comment calls the start of the arc's falling portion. Before this, poseFunc_jumpStart lifts her 2 to 3 px a frame for up to 6 frames while A is held. | SRC/bank_000.asm L3328–3339SRC/bank_000.asm L3884–3903SRC/bank_000.asm L3937–3940SRC/bank_000.asm L4206–4229SRC/constants.asm L26 | Code |
Past the held ascent, a jump follows a table: each frame poseFunc_jump moves Samus by the next entry of jumpArcTable, a signed whole number of pixels from 2 up to 3 down, and the $80 that ends the table starts a fall. | SRC/bank_000.asm L3906–3915SRC/bank_000.asm L3927–3928SRC/bank_000.asm L4857–4860SRC/bank_000.asm L3991–3999 | Code |
Walking has no speed variable to build up: samus_walkRight adds 1 or 2 px to Samus's X position on alternate frames (1.5 px/frame), 2 px/frame with the Varia Suit, and 1 px/frame in water. | SRC/bank_000.asm L4596–4618 | Code |
In a plain jump, poseFunc_jump moves Samus 1 px each frame toward a held direction, and not at all when neither is held. | SRC/bank_000.asm L3953–3967SRC/bank_000.asm L4780–4788 | Code |
Running off a ledge puts Samus straight into the falling pose, and in that pose a jump press starts a jump only while samus_unmorphJumpTimer runs, the 16-frame window after she unmorphs in the air. | SRC/bank_000.asm L3362–3367SRC/bank_000.asm L3048–3066SRC/bank_000.asm L3946–3950SRC/bank_000.asm L744–749 | Code |
Against the background, Samus is tested at points, one x for the side she moves toward and a list of up to five y offsets for her pose. Against enemies, collision_samusEnemies runs first and compares each enemy's hitbox with Samus's, whose top is set per pose. | SRC/bank_000.asm L4981–4996SRC/bank_000.asm L5543–5545SRC/bank_000.asm L9481SRC/bank_000.asm L8708–8714 | Code |
An enemy hit sets samusInvulnerableTimer to $33 (51), and while it is above 0 the hit code returns before any damage. drawSamus takes 1 from it each time it draws her, once per frame of play, and blinks her 4 frames on, 4 off. | SRC/bank_000.asm L7802–7812SRC/bank_001.asm L560–568SRC/bank_000.asm L740 | Code |
A hit sends Samus away from the side of the enemy she touched along a fixed arc from .bombArcTable, 3 px a frame up at first, and 1 px a frame sideways. She can't change direction until the arc's counter reaches $56, which the comment calls the end of the rising portion. | SRC/bank_000.asm L7824–7836SRC/bank_000.asm L8840–8847SRC/bank_000.asm L2439–2442SRC/bank_000.asm L2469–2470SRC/bank_000.asm L2525–2529SRC/bank_000.asm L2491–2495SRC/bank_000.asm L4785–4788 | Code |
During knockback a jump press clears samusInvulnerableTimer and starts a jump in the air with a ground jump's counter, $31 or $21. | SRC/bank_000.asm L2350–2376 | Code |
| A new game starts with 99 units of energy, no energy tanks, and 30 of 30 missiles. | SRC/data/initialSave.asm L20–25SRC/bank_000.asm L9942–9946 | Code |
| An energy tank adds a tank, up to 5, and fills Samus's energy, setting its high byte to the tank count and its low byte to 99. | SRC/bank_000.asm L9895–9907 | Code |
| A missile tank adds 10 to Samus's missile capacity and 10 to her missiles, each capped at 999. | SRC/bank_000.asm L9942–9976 | Code |
The morph ball needs no item: a Down press while crouching calls samus_morphOnGround, and the item bits list bombs, Hi-Jump, Screw Attack, Space Jump, Spring Ball, Spider Ball, and Varia, with no bit for the ball. A new game starts with no item bits set. | SRC/bank_000.asm L3705–3710SRC/bank_000.asm L4524–4527SRC/constants.asm L49–56SRC/data/initialSave.asm L20 | Code |
In the morph ball, A starts a jump only with the Spring Ball, from a counter of $2E. | SRC/bank_000.asm L3780–3793 | Code |
In a spin jump with the Space Jump, a new A press restarts the jump only on frames whose spaceJumpTable entry is nonzero: entries 44 to 63, where jumpArcTable falls 1 to 3 px a frame. The restart sets the counter to $28, or $18 with the Hi-Jump Boots, below $40, so a held A gives a new linear ascent. | SRC/bank_000.asm L4002–4011SRC/bank_000.asm L3997–3998SRC/bank_000.asm L4014–4078 | Code |
With the Screw Attack, an enemy Samus touches in a spin jump or its start pose takes a Screw Attack weapon hit, and the contact doesn't hurt her. Solid enemies, whose damage entry is $FF, are exempt. | SRC/bank_000.asm L8850–8892 | Code |
The three games build the high jump three ways. Metroid's High Jump Boots lower the jump's gravity from $18 to $12 and keep the take-off speed. Metroid II's Hi-Jump starts the held rise at a lower counter and adds 1 px/frame to it, 3 px/frame for up to 31 frames against 2 for up to 15. Super Metroid's Hi-Jump Boots raise the take-off speed from 4.875 to 6 px/frame, with gravity unchanged. | SRC/bank_000.asm L3328–3339SRC/constants.asm L26SRC/bank_000.asm L3884–3887SRC/bank_000.asm L3937–3940SRC/bank_000.asm L3892–3898 | Code |
The timer a hit sets starts at 50 in Metroid (SamusBlink, $32), 51 in Metroid II (samusInvulnerableTimer, $33), and 96 in Super Metroid (SamusInvincibilityTimer, $60). | SRC/bank_000.asm L7810–7812 | Code |
Super Metroid's running acceleration is Metroid's, $30/256 (0.1875) px/frame² in both, but its top speed rises from Metroid's 1.5 px/frame to 2.75. Metroid II, between them, has no acceleration and walks at 1.5 px/frame. | SRC/bank_000.asm L4609–4618 | Code |
| Super Metroid keeps Metroid's release cut, a release during the rise setting the vertical speed to 0, but drops Metroid's 32 px minimum rise. Metroid II, between them, holds a fixed rise for as long as A is held, up to a frame limit. | SRC/bank_000.asm L3884–3903 | Code |