Cite as
FiendsOfTheElements/z2disassembly
Original
https://github.com/FiendsOfTheElements/z2disassembly
Pinned
FiendsOfTheElements/z2disassembly @ c4c3a4c7d4156b41f54f726dc40644d45812ad29
Accessed
2026-10-21
Licence
CC0 1.0 Universal (LICENSE)
Credit
Trax, whose commented disassembly of the US NES release the README credits as the original (first published at lemmy.neocities.org/zelda2); Entroper and the Fiends of the Elements randomizer group turned it into ca65 source that builds. The labels and comments quoted in zelda2 claims ("Timer for Link immunity", "Add Life Power (1-8)") are theirs.
Notes
ca65 source for the US NES release, one file per 16 KB PRG bank; each line's comment gives its file offset (header included) and CPU address. Built on 2026-10-21 with ca65 and ld65, with the CHR banks ripped from Zelda II - The Adventure of Link (USA): the PRG differs from that ROM only in each of banks 0-6's last 144 bytes from $BF70 (a commented-out stub that assembles as zeros), five unused bytes in banks 0 and 5 ($BF for $FF), and one branch offset at bank 7 $C181, where `BPL :-` resolves to a nearer anonymous label (its comment gives the ROM's F5). No routine a zelda2 claim cites differs, except that branch, cited from the ROM.

Cited on

Claims (8)

A new game starts with four heart containers and four magic containers. Picking up a container adds one, and a full meter holds 32 units per container less one, so four containers fill to 127.src/prg5.asm L7062–7064src/prg7.asm L6158–6165src/prg7.asm L1815–1831Code
A monster's damage code (0–7) and Link's life level (1–8) pick the life a hit takes from an 8 × 8 table, halved while the Shield spell is on. Code 0 takes 16 units at life level 1 and 4 at level 8; code 6 takes 224 and 80; code 7 takes 255 at every level.src/prg7.asm L5401–5410src/prg7.asm L5436–5451Code
A sword hit takes 2, 3, 4, 6, 9, 12, 18, or 24 hit points from a monster for attack levels 1 to 8, and the Thunder spell's entry is 50.src/prg7.asm L5953–5955src/prg7.asm L6060–6070Code
A hit sets Link's immunity timer to 4 and his injured timer to 32. The game counts the injured timer down every frame but the immunity timer only once every 21 frames, so the immunity lasts 64 to 84 frames, depending on where in the cycle the hit lands.src/prg7.asm L5460–5463src/prg7.asm L5412–5416src/prg7.asm L388–401Code
A monster's body hit sets Link's horizontal speed from a table, $0D or $F3 (−13) by the comments for facing left or right, and his vertical speed to $FE (−2), a hop away.src/prg7.asm L5491–5497src/prg7.asm L5525–5545src/prg7.asm L5469–5470Code
A spell's cost comes from an 8 × 8 table by spell and magic level, in meter units (32 per container). Shield costs 64 at magic level 1 and 32 from level 4; Life costs 140 at level 1 and 100 from level 5; Thunder costs 240 until level 7. Casting fails when the meter can't cover the cost.src/prg0.asm L2161–2177src/prg0.asm L2196–2205Code
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.src/prg0.asm L3824–3834Code
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.src/prg7.asm L4031–4035Code