Dragon Warrior

From NES Hacker Wiki
Revision as of 06:09, 8 April 2017 by Novazero (talk | contribs) (Memory Addresses: Fix previous edit causing box break)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Dragon Warrior is an RPG. You play the last descendant of the line of Erdrick in the land of Alefgard. You must fight enemies to gain gold and experience which will let you buy better equipment and become more powerful. You also have to rescue princess Gwaelin, find several relics to make a bridge, and defeat the evil Dragonlord. The game is very attractive for such an early RPG, but too much time is spent grinding to power yourself up.

Easy Cheats

Icon Addr Val Cmp Description
Icon-HitPoints-Infinite.png 00C5 FF - Infinite Hit Points
Icon-Magic.png 00C6 FF - Infinite Magic Points
Icon-Money-Infinite.png 00BD FF - Infinite Gold
Icon-Weapon.png 00BE FF - Have Best Equipment
Icon-Strength.png 00E2 00 - Kill Enemies In One Hit
Icon-Item.png 00BF 09 - Infinite Magic Keys
Icon-Magic.png 00CE
00CF
FF
33
-
-
All Spells (1/2)
All Spells (1/2)
Icon-Magic.png 00DB FF - Repel Lasts Forever
Icon-Powerup.png 00D0 07 - See In the Dark
Icon-Armor.png CDE3 00 02 No Damage From Swamps
Icon-Armor.png CE48 00 0F No Damage From Barriers
Icon-Money.png E344 FF 78 First Chest Has 255 Gold
How do I use these?

North America

Note: Two versions of Dragon Warrior were released in North America. Differences are labeled.

Dragon Warrior.png

Memory Addresses

0000 - Used for manipulating variables (doing damage, gaining xp and gp, etc.)
0047 - Controller 1 poll

008E - Map X Pos
008F - Map Y Pos

00B5-00B8 - First 4 characters of player's name
00B9 - Loaded with #FA at game load, and doesn't seem to change
00BA - Experience: x1
00BB - Experience: x256
00BC - Gold: x1
00BD - Gold: x255
00BE - Equipment (See Equipment List below)
00BF - Magic Keys
00C0 - Herbs (00-09)
00C1 - Items 2/1 (See Item List below)
00C2 - Items 4/3
00C3 - Items 6/5
00C4 - Items 8/7
00C5 - Hit Points
00C6 - Magic Points
00C7 - Level
00C8 - Strength place holder for Status (The following don't save to the character)
00C9 - Agility place holder for Status
00CA - Max HP place holder for Status
00CB - Max MP place holder for Status
00CC - Attack Power place holder for Status
00CD - Defense Power place holder for Status
00CE - Spells Bit Flag (Gets overwritten from battery)
	01 - Heal
	02 - Hurt
	04 - Sleep
	08 - Radiant
	10 - Stopspell
	20 - Outside
	40 - Return
	80 - Repel
00CF - Misc Player Variables Bit Flag
	01 - Healmore spell
	02 - Hurtmore spell
	04 - 
	08 - 
	10 - Dragon Scale
	20 - Fighter's Ring
	40 - Cursed Belt
	80 - Cursed Necklace
00D0 - Vision distance in the dark (Dark = 1, Torch = 3, Radiant = 7/5/3) - Note: Max value = 7, greater values do not reveal more, just graphical glitches

00D1 - Used for palette shifting while scrolling vertically
00D2 - Cursor X
00D3 - Cursor Y

00D7 - Last chosen menu item (00-09, FF - None)
00D8 - Highlighted menu item Col 1 (00-03)
00D9 - Highlighted menu item Col 2 (00-09)
00DA - Radiant Spell Countdown
00DB - Fairy Water / Repel Countdown (Even for fairy water, odd for repel)

00DE - Monster Injury Flash Countdown
00DF - Carrying Princess (08 - No, 09 - Yes)
00E0 - Tile walking on
	00 - Grass
	01 - Desert
	02 - Hills
	03 - Stairs Up
	04 - Tiles
	05 - Stairs Down
	06 - Swamp
	07 - Town
	08 - Cave
	09 - Castle
	0A - Bridge
	0B - Forest
	0C - Chest
	0D - Force Field

00E2 - Enemy HP

00E5 - Message Speed (00 - Fast, 01 - Normal, 02 - Slow) - Note: Can increase beyond normal means for -really- slow text

00E6-00FF - Sound Variables

0110-01FF - Stack
0200-02FF - Sprite Memory
0400-07BF - Tile layout for screen menus

E344 - Initial Chest Gold (78)

Item List

Items are stored two to a byte. Item 1 is right nybble, item 2 is the left nybble. So if you wanted your first two items to be a torch and the death necklace, you set 00C1 to B1.

1 - Torch
2 - Fairy Water
3 - Wings
4 - Dragon's Scale
5 - Fairy Flute
6 - Fighter's Ring
7 - Erdrick's Token
8 - Gwaelin's Love
9 - Cursed Belt
A - Silver Harp
B - Death Necklace
C - Stones of Sunlight
D - Staff of Rain
E - Rainbow Drop
F - Herb

Equipment List

The designers of the equipment didn't base it on the usual bit flag (using powers of 2) for each item. However, since you can't have more than one type of equipment at a time, they were able to fit all of the items in a single byte. Simply take one item from each list, add them together, and the sum is the equipment value.

00 - Nothing

01 - Small Shield
02 - Large Shield
03 - Silver Shield

04 - Clothes
08 - Leather Armor
0C - Chain Mail
10 - Half Plate Armor
14 - Full Plate Armor
18 - Magic Armor
1C - Erdrick's Armor

20 - Bamboo Pole
40 - Club
60 - Copper Sword
80 - Hand Axe
A0 - Broad Sword
C0 - Flame Sword
E0 - Erdrick's Sword

Code

Swamp Damage

This subroutine is called when the player takes damage from swamps.

CDDF:A5 C5     LDA $00C5        ; Load Hit Points into A.
CDE1:38        SEC              ; Set Carry Flag
CDE2:E9 02     SBC #$02         ; Subtract #02 from A.
CDE4:B0 02     BCS $CDE8        ; If A didn't go below #00, goto CDE8
CDE6:A9 00     LDA #$00         ; A went below #00, set it to #00.
CDE8:85 C5     STA $00C5        ; Store A into Hit Points.
CDEA:20 74 FF  JSR $FF74

Barrier Damage

This subroutine is called when the player takes damage from barriers.

CE44:A5 C5     LDA $00C5        ; Load Hit Points into A.
CE46:38        SEC              ; Set the Carry Flag.
CE47:E9 07     SBC #$0F         ; Subtract #0F from A.
CE49:B0 04     BCS $CE4F        ; If A didn't go below #00, goto CE4F
CE4B:A9 00     LDA #$00         ; A went below #00, set it to #00.
CE4D:F0 00     BEQ $CE4F        ; If A is equal to #00, goto CE4F (Compiler mistake?)
CE4F:85 C5     STA $00C5        ; Store A into Hit Points.

Get Initial Attack Damage

Takes the player's attack power and subtracts a pseudo-random amount and stores the result in A.

E649:A5 CC     LDA $00CC        ; Load Attack Power.
E64B:38        SEC              ; 
E64C:E5 41     SBC $0041        ; Subtract $0041 ?
E64E:4C 64 E6  JMP $E664        ; Goto Modify Attack Damage.

Modify Attack Damage

Takes whatever is in A and does that amount of damage to the enemy.

E664:85 00     STA $0000
E666:A9 00     LDA #$00
E668:85 01     STA $0001
E66A:24 DF     BIT $00DF
E66C:70 2C     BVS $E69A
E66E:20 5B C5  JSR $C55B

Damage Player

Called when the player is to take damage. The amount of damage is stored in $0000.

ED25:A9 00     LDA #$00         ; Clear A.
ED27:85 01     STA $0001        ; Clear $0001.
ED29:A5 C5     LDA $00C5        ; Load Hit Points into A.
ED2B:38        SEC              ; 
ED2C:E5 00     SBC $0000        ; Subtract damage from Hit Points.
ED2E:B0 02     BCS $ED32        ; If result > 0 (carry is set)...
ED30:A9 00     LDA #$00         ; Load A with 0.
ED32:85 C5     STA $00C5        ; Store A into Hit Points.

Text

Dragon Warrior has a complicated character set. There are three sets, two of them overlap each other to save space. They are then interpreted at a bit level when drawn, it seems like only one of them is actually used though because a third, more straight forward, set is used for all the dialogue.

Title

00=0
01=1
02=2
03=3
04=4
05=5
06=6
07=7
08=8
09=9
24=A
25=B
26=C
27=D
28=E
29=F
2A=G
2B=H
2C=I
2D=J
2E=K
2F=L
30=M
31=N
32=O
33=P
34=Q
35=R
36=S
37=T
38=U
39=V
3A=W
3B=X
3C=Y
3D=Z
5F= 
60=!
61=.
62=©
63=-

Game

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=A
25=B
26=C
27=D
28=E
29=F
2A=G
2B=H
2C=I
2D=J
2E=K
2F=L
30=M
31=N
32=O
33=P
34=Q
35=R
36=S
37=T
38=U
39=V
3A=W
3B=X
3C=Y
3D=Z
3E=“
3F=”
40=’
41=*
42=→
43=↓
44=:
45=…
47=.
48=,
49=-
4B=?
4C=!
4D=;
4E=)
4F=(
50=‘
51=´
52=.’
53='
54=´
5F= 
F8=<player>


Japan

Dragon Quest.png


Links