Keys and locked doors
Doors that open only by spending a key the player has found.
On this page
A locked door opens by spending a key. The Legend of Zelda keeps one count, and its magic key opens every locked door for free1. Zelda II keeps the same rule2. A Link to the Past gives each dungeon its own count3.
- One countThe Legend of Zelda (1986). One key per locked door, or none with the magic key.1Zelda II: The Adventure of Link (1987). One key spent per locked door, none with the Magic Key, as in The Legend of Zelda.2
- Per dungeonThe Legend of Zelda: A Link to the Past (1991). Each dungeon keeps its own small-key count.3
Games
| Game | Year | How | Note |
|---|---|---|---|
| The Legend of Zelda | 1986 | One count | one key per locked door, or none with the magic key |
| Zelda II: The Adventure of Link | 1987 | One count | one key spent per locked door, none with the Magic Key, as in The Legend of Zelda |
| The Legend of Zelda: A Link to the Past | 1991 | Per dungeon | each dungeon keeps its own small-key count |
Every claim about this mechanic, by game (3)
References
- ^ abTouching a locked door with the magic key opens it for free; otherwise it costs a key, and with no keys the door blocks Link.Codealdonunez/zelda1-disassembly · “Legend of Zelda, The (USA) (Rev 1)”
How we know
3983 LDA InvMagicKey 3984 BNE @TriggerDoor 3985 LDA InvKeys 3986 BEQ BlockAtWall ⋮ 3989 DEC InvKeys ⋮ 3991@TriggerDoor:
src/Z_05.asm lines 3981–3992 at 50a1c86 · upstream ↗ In the cartridge (“Legend of Zelda, The (USA) (Rev 1)”): TouchDoorKey in Rev 1, which moved bank 5's room code (rev1). We don't reproduce the bytes.
Checked against the evidence by its author, an AI model, 2026-10-25.
Checked by a second AI model, 2026-10-21.
Checked by a second AI model, 2026-10-25.
- ^ abZelda 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.CodeFiendsOfTheElements/z2disassembly · aldonunez/zelda1-disassembly · “Legend of Zelda, The (USA) (Rev 1)”
How we know
4031 LDA $078C ; 0x1d9ea $D9DA AD 8C 07 ; Have Magic Key ⋮ 4033 LDA $0793 ; 0x1d9ef $D9DF AD 93 07 ; Current number of keys
src/prg7.asm lines 4031–4035 at c4c3a4c · upstream ↗ 3981 ; If we don't have the magic key nor any normal keys, 3982 ; go block movement. 3983 LDA InvMagicKey 3984 BNE @TriggerDoor 3985 LDA InvKeys 3986 BEQ BlockAtWall ⋮ 3988 ; If we don't have the magic key, decrease the key count. 3989 DEC InvKeys
src/Z_05.asm lines 3981–3989 at 50a1c86 · upstream ↗ In the cartridge (“Legend of Zelda, The (USA) (Rev 1)”): TouchDoorKey in Rev 1, which moved bank 5's room code (zelda/rev1). We don't reproduce the bytes.
Checked against the evidence by its author, an AI model, 2026-10-21.
Checked by a second AI model, 2026-10-21.
- ^ abEach dungeon keeps its own small-key count. Loading a dungeon copies its count from a per-dungeon array into the current count,
SaveDungeonKeyscopies it back, and the overworld sets the current count to$FF. The Sewers and Hyrule Castle share one slot.Codespannerisms/usdasmrevisedHow we know
394|02825A| LSR A 395|02825B| TAX ⋮ 397|02825C| LDA.l $7EF37C,X
bank_02.asm lines 388–398 at bcdd96e · upstream ↗ 6643|02A1D4| LSR A 6644|02A1D5| TAX ⋮ 6646|02A1D6| LDA.l $7EF36F 6647|02A1DA| STA.l $7EF37C,X
bank_02.asm lines 6638–6648 at bcdd96e · upstream ↗ 666|0283E4| LDA.b #$FF 667|0283E6| STA.l $7EF36F
bank_02.asm lines 666–667 at bcdd96e · upstream ↗ 4154BitMasks: 4155|0098C0| dw $8000 ; Sewers 4156|0098C2| dw $4000 ; Hyrule Castle
bank_00.asm lines 4154–4156 at bcdd96e · upstream ↗ 17099RebuildHUD_Keys: 17100|0DFA68| STA.l $7EF36F
bank_0D.asm lines 17099–17100 at bcdd96e · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-21.
Revised after a check by a second AI model, 2026-10-21.
Sources
Code
- Núñez, Aldo. 2021. “zelda1-disassembly: A complete disassembly of The Legend of Zelda.” Commit 50a1c86. aldonunez/zelda1-disassembly @ 50a1c86 · licence, all uses
- n.d. “Legend of Zelda, The (USA) (Rev 1).” · licence, all uses
- Trax and Entroper. 2023. “z2disassembly: Disassembly of Zelda II: The Adventure of Link for NES.” Commit c4c3a4c. FiendsOfTheElements/z2disassembly @ c4c3a4c · licence, all uses
- (spannerisms), kan. 2026. “usdasm: A Link to the Past US Disassembly.” Commit bcdd96e. spannerisms/usdasm @ bcdd96e · licence, all uses