Cite as
“Legend of Zelda, The (USA) (Rev 1)”
Licence
proprietary; never redistributed (docs/data-policy.md#roms)
Credit
Nintendo (developer and publisher)
Notes
NES 2.0 header: 128 KB PRG ROM, CHR RAM, mapper 1 (MMC1), battery-backed PRG RAM. Without the 16-byte header the SHA-1 is be2f5dc8c5ba8ec1a344a71f9fb204750af24fe7.

Cited on

Claims (33)

A Link to the Past fires the sword beam only with the Master Sword or better and less than half a heart missing; The Legend of Zelda fired it with up to half a heart missing and any sword.0x1F86A-0x1F88CCode
The Legend of Zelda keeps three save files in battery-backed cartridge RAM; each holds an 8-byte name, a 40-byte item block, 384 bytes of world flags, and four single bytes (whether the slot is in use, one unlabeled byte, the death count, and the quest), with a 16-bit checksum that is the plain sum of those 436 bytes, and, kept apart and outside the sum, two marker bytes, $5A and $A5.0x6-0x6Code
The PRG0 source of aldonunez's disassembly differs from Rev 1 in the music engine, in bank 5's continue screen and room code, which Rev 1 moves, in bank 7's calls into that code, and in the header checksum; the combat code in banks 1 and 7 and the drop code in bank 4 are byte-identical.0x76A6-0x7760Code
An object's type indexes UpdateObject_JumpTable, whose routines name the monsters: Lynel $01, Moblin $03–$04, Goriya $05–$06, Octorok $07–$0A, Darknut $0B–$0C, Tektite $0D–$0E, Leever $0F–$10, Vire $12, Zol $13, Gel $14–$15, Pols Voice $16, Like Like $17, Keese $1B–$1D, Ghini $21–$22, Wizzrobe $23–$24, Wallmaster $27, Rope $28, Stalfos $2A, Gibdo $30, and Ganon $3E.0x1FBC4-0x1FC97Code
Link's health is HeartValues, whose high nibble is the heart containers less one and whose low nibble is the full hearts, plus a partial heart in HeartPartial from $00 to $FF; a new file starts at $22 and $FF, three containers and three hearts.0x9F00-0x9FD4Code
A monster's contact damage comes from ObjTypeToDamagePoints, one byte per object type, whose low nibble is whole hearts and whose high nibble is sixteenths of a heart; of its 93 entries, 30 are half a heart, 24 one heart, 18 two hearts, and 3 four hearts.0x72CA-0x7326Code
Each level of ring halves the damage before it is subtracted, so the first ring takes half and the second a quarter.0x7327-0x7441Code
When the partial heart can't cover the damage, the game takes a full heart and refills the partial heart to $FF rather than $100, so each such borrow costs Link an extra 1/256 of a heart.0x7327-0x7441Code
Whenever Link is hurt, the game zeroes WorldKillCount, HelpDropCount, and HelpDropValue, the counters behind the fairy and the 10th-kill drops.0x7327-0x7441Code
A monster that touches Link while his invincibility timer is above 0 does nothing; a hit sets the timer to 24 and his shove distance to 32 px.0x76A6-0x7760Code
DecrementInvincibilityTimer lowers an object's invincibility timer by 1 only on frames when FrameCounter is even, so a timer of t lasts 2t frames.0x1FEA8-0x1FEB5Code
While Link holds the clock, BeginUpdateWorld adds 16 to his invincibility timer every frame, and monsters' contact checks return no collision.0x1EC8A-0x1EC97Code
Measured in Rev 1, a Tektite held against Link hurts him every 47 or 48 frames, taking half a heart each time; from three hearts, five hits leave $20 and $7D, 3/256 of a heart under a half heart.0x7327-0x7441Verified
A shoved object moves 4 px a frame, 1 px of shove distance at a time, and the shove ends early when the object reaches the room's edge or, aligned to the grid, an unwalkable tile.0x1EEC8-0x1EFDFCode
Walker_Move moves a walking object by its shove whenever one is set, in place of its walking, so Link can't steer during a shove.0x1EFE0-0x1EFE6Code
When a monster hits Link, the shove points away from the monster along one axis: the horizontal one when Link is between grid squares and faces left or right, the vertical one when he is between squares facing up or down. The monster then turns around, unless bit 7 of its object attributes is set (a flag the disassembly's comments name "reverse after hit Link") or it is a Vire (object type $12).0x76A6-0x7760Code
Measured in Rev 1, each of the Tektite's first three hits shoves Link 32 px to the right in 8 frames.0x1EEC8-0x1EFDFVerified
A weapon that hurts a monster sets the monster's invincibility timer to 16, which lasts 32 frames, and shoves it 64 px in the weapon's direction, unless the monster is already invincible or immune to the weapon's damage type.0x76A6-0x7760Code
The wooden, white, and magical swords take $10, $20, and $40 from a monster's hit points; fire takes $10, a bomb $40, and the boomerang none, only stunning.0x755C-0x76A5Code
SetUpDroppedItem sorts a dead monster's type into one of four drop groups by three type lists, with every unlisted type in the fourth; seven types, among them the Gels, the Keese, and the Like Like, drop nothing.0x1302B-0x13107Code
DropItemTable holds ten items for each group, and the kill cycle picks the column; group A's row is heart, rupee, heart, rupee, fairy, rupee, heart, heart, rupee, rupee.0x1302B-0x13107Code
In TakeItem, item $18 is a rupee, $0F five rupees, $22 a heart, $23 a fairy, $21 the clock, and $00 four bombs; a heart restores 1 heart and a fairy 3.0x6BF0-0x6D36Code
Outside the special cases, a drop happens only when the dead monster's slot's byte of Random is below its group's rate: $50, $98, $68, and $68, or 80, 152, 104, and 104 in 256.0x1302B-0x13107Code
Each kill advances WorldKillCycle from 0 to 9 and back to 0 before the drop is chosen, except kills of types $5D, $14, and $1C, which the comments call a Child Gel and a Red Keese.0x1FCA5-0x1FCE9Code
When WorldKillCount, the kills since Link was last hurt, equals 16 and the monster can drop items, the drop is a fairy, whatever its random byte.0x1302B-0x13107Code
The 10th kill since Link was last hurt brings a guaranteed drop of 5 rupees, or of bombs when that 10th kill was by bomb, and the count starts again from 0.0x1302B-0x13107Code
A dropped item lasts 255 decrements of its lifetime, one every other frame, about 510 frames, and Link can't take it until the 16th decrement, about 32 frames.0x1310C-0x13124Code
Called in Rev 1 for every group, kill-cycle column, and value of the random byte, SetUpDroppedItem drops in 800, 1,520, 1,040, and 1,040 of 2,560 cases for groups A to D, each the item its column names; it gives a fairy at a kill count of 16, and 5 rupees or bombs at a help count of 10.0x1302B-0x13107Verified
A heart container adds one container and one full heart, up to 16 containers; a new file starts with three.0x6BF0-0x6D36Code
MakeSwordShot fires a sword beam only when the low nibble of HeartValues (full hearts) equals its high nibble, as it does when Link's hearts are full, and the partial heart is at least $80 of $FF, so with up to half a heart missing; unless ForceSwordShot ($0529) is set.0x1F86A-0x1F88CCode
Touching a locked door with the magic key opens it for free; otherwise it costs a key, and with no keys the door blocks Link.0x15285-0x152A2Code
Zelda II's sword beam fires only when the life meter is exactly full, containers × 32 − 1; The Legend of Zelda fired it with up to half a heart missing.0x1F86A-0x1F88CCode
Zelda II keeps The Legend of Zelda's locked-door rule. The Magic Key opens a door for free; otherwise a key is spent, and with no keys the door stays shut.0x15285-0x152A2Code