The Legend of Zelda

From NES Hacker Wiki
Jump to: navigation, search

The Legend of Zelda is an epic birds-eye-view adventure game. You play Link, and elfen boy who is trying to rescue princess Zelda from the evil wizard Gannon. You must defeat monsters to collect money to buy power ups, and visit dungeons to acquire better weapons, and gather the pieces of the Triforce of Wisdom. This will give you the power necessary to defeat Gannon.

Easy Cheats

Icon Addr Val Cmp Description
Icon-HitPoints-Infinite.png 066F
0670
FF
FC
-
-
Infinite Hit Points (1/2)
Infinite Hit Points (2/2)
Icon-Invincible.png 04F0 04 - Invulnerable
Icon-Money-Infinite.png 066D FF - Infinite Rupees
Icon-Item.png 066E 09 - Infinite Keys
Icon-Ammo-Infinite.png 0658 10 - Infinite Bombs
Icon-Weapon.png 0657 03 - Have Magical Sword
Icon-Armor.png 0676 01 - Have Magical Shield
Icon-Armor.png 0662 02 - Have Red Ring (Link's color doesn't change)
Icon-Item.png 065E 02 - Have Red Medicine
Icon-Item.png 0671 FF - Have All Triforce Pieces
Icon-Weapon.png 0674 01 - Have Boomerang
Icon-Weapon.png 0675 01 - Have Magical Boomerang
Icon-Weapon.png 065A 01 - Have Bow
Icon-Ammo.png 0659 02 - Have Silver Arrows
Icon-Item.png 065B 02 - Have Red Candle
Icon-Item.png 0664 01 - Have Magic Key
Icon-Item.png 065C 01 - Have Flute
Icon-Item.png 065D 01 - Have Bait
Icon-Weapon.png 065F 01 - Have Magical Rod
Icon-Item.png 0660 01 - Have Raft
Icon-Item.png 0661 01 - Have Book
Icon-Item.png 0663 01 - Have Step Ladder
Icon-Item.png 0665 01 - Have Bracelet
Icon-Item.png 0667 FF - Have First 8 Compasses
Icon-Item.png 0668 FF - Have First 8 Maps
Icon-Item.png 0669 FF - Have Level 9 Compass
Icon-Item.png 066A FF - Have Level 9 Map
How do I use these?

North America

Legend of Zelda, The.png

Memory Addresses

0000 - Memory offset processing
0001 - Memory offset processing
0002 - ?
0003 - ?
0004 - Memory offset processing
0005 - Memory offset processing
0006 - ?
0007 - Sprite width processing / amount to damage enemy
0008 - Sprite width processing
0009 - ?
000A - Sprite width processing
000B - Player movement processing
000C - Processing sprite's rotation / map loading
000D - Processing sprite's frame
000E - Processing sprite's graphic offset

0029 - Gannon - Visibility Duration (00-3F)

0050 - Enemy Tally (00-0A) (Reset when you get hit or kill an enemy that can drop items)

0058 - Map Loading when moving north/south in rooms
0059 - Something to do with number of sprites on the screen

005B - Memory offset when entering a room

006A - Written to by sound engine
006B - Written to by sound engine

0070 - Link X Position
0071-007A - Enemy X Position
007B - Raft/Ladder X Position
007C - Left Screen Wipe Position
007D - Sword X Position / Right Screen Wipe Position
007E - Sword/Rod Bolt X Position
007F - Boomerang/Bait X Position
0080 - Fire 1 / Bomb X Position
0081 - Fire 2 X Position
0082 - Rod/Arrow Y Position
0083 - Item X Position

0084 - Link Y Position
0085-008E - Enemy Y Position
008F - Raft/Ladder Y Position
0090 - ? Y Position
0091 - Sword Y Position
0092 - Sword/Rod Bolt Y Position
0093 - Boomerang/Bait Y Position
0094 - Fire 1 / Bomb Y Position
0095 - Fire 2 Y Position
0096 - Rod/Arrow Y Position
0097 - Item Y Screen Position

0098-00A3 - Object Direction (01 - Right, 02 - Left, 04 - Down, 08 - Up) Used by Link, monsters, weapons, etc.

00AC - Link Status Flag (40 - Paralyzed)
00AD - Gannon - Arrow Vulnerability Duration (00-FF) Flashes below 2F
00AE-00B7 - Projectile Flags (Stepladder counts as a projectile)

00E3 - Flag for drawing the map while scrolling rooms
00E6 - Flips between 01 and 00 as you change rooms
00E7 - Room change direction (01 - Right, 02 - Left, 04 - Down, 08 - Up)
00E8 - Room scrolling counter - left/right
00E9 - Room scrolling counter - up/down. Also timeout before changing rooms (15-00) - If you alter 82E5 to 00, you will see the room before it's drawn
00EB - Room You're In (00-7F) Also cave exit room
00EC - Room You're Going To (00-7F)
00ED - Room scrolling counter up/down
00EE - Direction you entered this room from (01 - Right, 02 - Left, 04 - Down, 08 - Up)
00F3 - Unknown flag, set to 01 while scrolling rooms

00F8 - Controller 1 Press
00F9 - Controller 2 Press
00FA - Controller 1 Down
00FB - Controller 2 Down

00FD - Room scrolling counter - left/right

0100-01FF - Program stack
0200-02FF - PPU memory?
0300-0324 - Info screen drawing

0340 - Counter on which sprites are processed (00-0B)

0350-035E - Object Type
	01 - Blue Lynel
 	02 - Red Lynel
	03 - Blue Moblin
	04 - Red Moglin
	05 - Blue Goryia
	06 - Red Goryia
	07 - Red Octorok
	08 - Red Octorok - Fast
	09 - Blue Octorok
	0A - Blue Octorok - Fast
	0B - Red Darknut
	0C - Blue Darknut
	0D - Blue Tektite
	0E - Red Tektite
	0F - Blue Leever
	10 - Red Leever
	11 - Zora
	12 - Vire
	13 - Zol
	14 - Gel
	15 - 
	16 - Pols Voice
	17 - Like-Like
	18 - Small Digdogger
	19 - 
	1A - Peahat
	1B - Keese
	1E - Armos - Fast & Slow
	1F - Rock Spawner
	20 - Falling Rock
	21 - Ghini
	22 - Ghini - Summoned
	23 - Wizzrobe - Blue
	24 - Wizzrobe - Red
	25 - Patra Eyes - Spiral
	26 - Patra Eyes - Expanding
	2B - Bubble
	2E - Whistle Whirlwind
	2F - Fairy In Pond
	30 - Gibdo
	31 - Dodongo
	37 - Zelda
	38 - Digdogger
	3A - Lanmola - Red
	3B - Lanmola - Blue
	3E - Gannon
	3F - Fire Blocking Zelda
	40 - Fire
	41 - Enemy Bolt
	47 - Patra - Spiral
	48 - Patra - Expanding
	49 - Trap
	4B - Old Man - Triforce Is Needed
	4C - Old Man - Patra Has the Map
	4D - Old Man - Go to the Next Room
	4E - Old Man - Digdogger Hates Sound / Eyes of Skull
	4F - Old Man - More Bombs
	53 - Octorok's Rock
	55 - Zora's Bolt / Statue's Bolt / Fire's Bolt
	56 - Gannon's Bolt
	59 - Wizzrobe's Bolt
	5B - Moblin's Spear
	5E - Whistle Whirlwind For Level 7
	60 - Heart / Rupee / 5 Rupees / Fairy
	63 - Bombable Wall
	62 - Pushable Boulder
	65 - Pushable Tombstone
	68 - Pushable Block
	6A - Old Man - Rusty Sword
	6B - Old Man - Take Medicine / Heart
	6C - Old Man - White Sword
	6D - Old Man - Magic Sword
	6E - Old Man - Warp
	6F - Old Man - Secret Tree At Dead-End
	70 - Old Man - Money Making Game 
	71 - Old Man - Door Repair
	74 - Old Woman - Medicine
	75 - Old Woman - Pay to Talk (Go Up the Mountain)
	77 - Merchant 1 (130 Shield, 20 Bombs, 80 Arrows)
	78 - Merchant 2
	79 - Merchant 3
	7A - Merchant 4 (80 Key, 250 Ring, 60 Bait)
	7B - Secret to Everybody 1
	7C - Secret to Everybody 2
	7D - Secret to Everybody 3

0394 - Link Frame
03A8 - Link Flag
03D0 - Link Animation Counter
03E4 - Link Flag
03E5-03EE - Enemy Frame
03EF-03F7 - Enemy Value?
03F8 - Link Direction (01 - Right, 02 - Left, 04 - Down, 08 - Up)
03F9-0402 - Enemy Direction (01 - Right, 02 - Left, 04 - Down, 08 - Up)

03F8 - Controller 1 Direction

0407-0410 - Enemy Flags?
0411-041A - Enemy Values?
041B-0424 - Enemy Values?
042D-0436 - Enemy Animation Frame
0452-045B - Enemy Delay to Shoot
045A-045C - Enemy Projectile X Delta
0467-046A - Enemy Projectile Y Delta
0479-0482 - Enemy Pattern Count
0485-0490 - Enemy Hit Points (includes bosses), uses high nybble.
0494-049D - Enemy Flags?
049E-04A7 - Enemy Flags?
04BF-04CE - Enemy Graphic Info

04E4 - Get set to different values when link leaves a room and reset to 0 when the scrolling ends.

04F0 - Link Invulnerable Timeout (Palette dependent on value)
04F1-04FA - Enemy Invulnerable Timeouts

0505 - Item Holding up (See Item List)
0506 - Item Holding up timeout

0521 - Get set to different values when link leaves a room and reset to 0 when the scrolling ends.

052F - Lost Mountains Counter (00-03)

05F2 - Sword Timeout (affected by bubbles)

060F-061A - Enemy Flags

0656 - Currently Selected Item
	00 - Boomerang or Empty
	01 - Bomb
	02 - Arrow
	03 - Bow
	04 - Candle
	05 - Flute
	06 - Bait
	07 - Medicine
	08 - Rod
	09 - Raft (Crash if you use)
	0A - Book (Crash if you use)
	0B - Ring (Crash if you use)
	0C - Ladder (Crash if you use)
	0D - Magic Key (Crash if you use)
	0E - Bracelet (Changes last palette group if you use)
	0F - ?
0657 - Sword
	00 - None
	01 - Wooden
	02 - White
	03 - Magical
	04 - Red/Green Sword
	05 - Really weak wood sword
	07 - Regular sword using magical sword palette
0658 - Bombs
0659 - Arrow Flag
	00 - None
	01 - Wooden
	02 - Silver
	03 - Red
	04 - Black
065A - Bow Flag
065B - Candle Flag
	00 - None
	01 - Blue
	02 - Red
	03 - Green
	04 - Brown
065C - Flute Flag
065D - Bait Flag
065E - Medicine Flag
	00 - None
	01 - Blue
	02 - Red
	03 - Black
	04 - Green
065F - Magical Rod Flag
0660 - Raft Flag
0661 - Book Flag
0662 - Ring Flag (Doesn't affect armor or link color)
	00 - None
	01 - Blue
	02 - Red
	03 - Brown
	04 - Green
0663 - Step Ladder Flag
0664 - Magic Key Flag
0665 - Bracelet Flag
0666 - Letter Flag
0667 - Compass Flag (bit flag)
0668 - Map Flag (bit flag)
0669 - Level 9 Compass
066A - Level 9 Map
066B - 
066C - Clock Flag
066D - Rupees
066E - Keys
066F - Heart Containers (High nybble flag for container (0-F), low nybble flag for full (0-F)
0670 - Hit Points Per Heart (00-FF, becomes a half heart at 7F)
0671 - Triforce Flag (Bit flags)
0672 - Triforce of Power Flag
0673 - 
0674 - Boomerang Flag
0675 - Magical Boomerang Flag
	00 - No
	01 - Yes
	02 - Orange
	03 - Dark
	04 - Mini
0676 - Magic Shield Flag
067C - Maximum Bombs
067D - Rupee Incrementer
067E - Rupee Decrementer

06A2 - Affected by hidden passages

06E5 - Sometimes set in some rooms?
06E6 - Revealed Passage Flags
06E7 - Revealed Passage Flags

0700-07FE - Underworld Room Statuses (Odd shape)
	+01 - West Passage Open (Locked door or bomb wall)
	+02 - East Passage Open
	+04 - South Passage Open
	+08 - North Passage Open
	+10 - Room Item Taken
	+20 - Room Visited
	+40 - One Enemy Killed
	+60 - More Than one enemy Killed
	+80 - All Enemies Killed

Save Slot #1
6804 - Link's Tunic Color
6805 - Link's Skin Color
6806 - Link's Belt Color

Save Slot #2
6808 - Link's Tunic Color
6809 - Link's Skin Color
680A - Link's Belt Color

Save Slot #3
680C - Link's Tunic Color
680D - Link's Skin Color
680E - Link's Belt Color

6B81-6BA0 - Game Palettes

In-Game Link Attributes
6B92 - Link's Tunic Color
6B93 - Link's Skin Color
6B94 - Link's Belt Color


Item List

01 - Sword
02 - White Sword
03 - Magic Sword
04 - Bait
05 - Recorder
06 - Blue Candle
07 - Red Candle
08 - Arrow
09 - Silver Arrow
0A - Bow
0B - Magic Key
0C - Raft
0D - Step Ladder
0E - Moblin Error
0F - 5 Rupies
10 - Rod
11 - Book
12 - Blue Ring
13 - Red Ring
14 - Bracelet
15 - Letter
16 - Compass
17 - Map
18 - Rupy
19 - Key
1A - Heart Container
1B - Triforce
1C - Magic Shield
1D - Boomerang
1E - Magic Boomerang
1F - Blue Medicine
20 - Red Medicine
21 - Clock
22 - Heart
23 - Fairy (Flying) ?
24 - Fairy (Stationary) ?
25 - Upsidedown Link
26 - Sword (Shooting)
27 - Magic Bolt
28 - Bomb (Item) ?
29 - Bomb (Exploding) ?

Code

Code

Damage Enemy

Expected:

$0007 - High nybble is damage to deal.
X     - Enemy offset.
Y     - Link's object direction offset.
7C3F:C9 0B     CMP #$0B
7C41:F0 04     BEQ $7C47
7C43:C9 0C     CMP #$0C
7C45:D0 0D     BNE $7C54
7C47:B9 98 00  LDA $0098,Y      ; Load the object's direction.
7C4A:15 98     ORA $98,X
7C4C:C9 0C     CMP #$0C
7C4E:F0 19     BEQ $7C69
7C50:C9 03     CMP #$03
7C52:F0 15     BEQ $7C69
7C54:A9 02     LDA #$02
7C56:8D 04 06  STA $0604
7C59:BD 85 04  LDA 0485,X       ; Load enemy's hit points into A.
7C5C:C5 07     CMP $0007        ; Check for killing hit.
7C5E:90 16     BCC $7C76        ; If hit will put HP below 0, jump to 7C76 (kill monster).
7C60:38        SEC              ; 
7C61:E5 07     SBC $0007        ; Subtract damage amount from A.
7C63:9D 85 04  STA 0485,X       ; Store modified hit points.
7C66:F0 0E     BEQ $7C76        ; If monster's new HP is 0, jump to 7C76 (kill monster).
7C68:60        RTS

Text

The Legend of Zelda uses a single character set throughout the entire game. It features letters, numbers, and some symbols. However, it uses the 8th bit as a carriage return / linefeed flag, so the entire character set is duplicated in the table, the first set is normal letters, the second set is end-of-line letters. Also, EC is a period that causes a full stop in the interpreter.

00=0
01=1
02=2
03=3
04=4
05=5
06=6
07=7
08=8
09=9
0A=A
0B=B
0C=C
0D=D
0E=E
0F=F
10=G
11=H
12=I
13=J
14=K
15=L
16=M
17=N
18=O
19=P
1A=Q
1B=R
1C=S
1D=T
1E=U
1F=V
20=W
21=X
22=Y
23=Z
24= 
28=,
29=!
2A='
2B=&
2C=.
2D="
2E=?
2F=-
30=™
64=+
7A=©
80=0
81=1
82=2
83=3
84=4
85=5
86=6
87=7
88=8
89=9
8A=A
8B=B
8C=C
8D=D
8E=E
8F=F
90=G
91=H
92=I
93=J
94=K
95=L
96=M
97=N
98=O
99=P
9A=Q
9B=R
9C=S
9D=T
9E=U
9F=V
A0=W
A1=X
A2=Y
A3=Z
A4= 
A8=,
A9=!
AA='
AB=&
AC=.
AD="
AE=?
AF=-
EC=.


Japan

Zelda no Densetsu 1 - The Hyrule Fantasy.png


FDS

Zeruda no Densetsu - The Hyrule Fantasy.png


Links