data/claims/dragon-warrior.yamlDragon Warrior (USA) (Rev 1) (the NES ROM)
Game: Dragon Warrior.
Every random-number advance updates a 16-bit state via , and reading controller 1 calls this update before polling the buttons. dragon-warrior/prng-update
About: Dragon Warrior Random number generator
Value: multiplier 771 · increment 129 · modulus 65536
CodeDragon Warrior (USA) (Rev 1) ·0xC56B-0xC596 — bank 03 $C55B-C586: 16-bit state updateDragon Warrior (USA) (Rev 1) · 0xC618-0xC641 — bank 03 $C608-C631: controller 1 reading advances stateChecked by research-agent, 2026-11-25 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.$C55B computes 2s, adds s for 3s, adds the low byte into the high byte for (1 + 256) * 3s = 771s mod 65536, then adds #$0081 (129). $C608 preserves $3C-$3D around JSR $C55B.
Hero stat seeding sums the first four stored character tiles of the name modulo 256, uses the sum modulo 4 to multiply two base stats by (skipping Max MP if zero), and adds a bonus of 0 to 3 from bits 2 and 3 to each reduced stat; remainder 0 scales Strength and Agility, 1 scales Max MP and Agility, 2 scales Strength and Max HP, and 3 scales Max MP and Max HP. dragon-warrior/hero-name-stat-seeding
About: Dragon Warrior Growth rate
Value: name bytes summed 4 · scale 9/10 · bonus range 0, 3
CodeDragon Warrior (USA) (Rev 1) ·0x6E29-0x6E3B — bank 01 $AE19-$AE2B: WndStorePlyrName stores the first 4 entered name tiles at $00B5-$00B8 (DispName0) via $AE1E and tiles 4-7 at $64C6-$64C9 (DispName4) via $AE23Dragon Warrior (USA) (Rev 1) · 0xF095-0xF0DC — bank 03 $F085-$F0CC: sums $00B5-$00B8, uses sum & 3 to choose Strength ($C8) or nonzero Max MP ($CB) and Agility ($C9) or Max HP ($CA), and extracts bonus ($42 = (sum >> 2) & 3)Dragon Warrior (USA) (Rev 1) · 0xF11C-0xF143 — bank 03 $F10C-$F133: ReduceStat computes floor(stat * 9 / 10) + $42Dragon Warrior (USA) (Rev 1) · 0xC1D9-0xC221 — bank 03 $C1C9-$C211: WordMultiply and WordDivide (truncating 8-bit quotient in $3C)Checked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.Each step rolls the random high byte against a tile mask: 1 in 8 on sand and hills (with a 3-frame pause on hills), 1 in 16 on swamp, forest, brick, and barrier floors, and 1 in 32 or 1 in 16 on normal overworld and dungeon tiles depending on whether the step coordinates have matching or opposite parity; in overworld zone 0 an extra roll rejects 3 in 4 hill encounters and 1 in 2 others, and active Repel or Fairy Water suppresses weaker overworld enemies based on hero defense. dragon-warrior/overworld-dungeon-encounter-check
About: Dragon Warrior Random encounter
CodeDragon Warrior (USA) (Rev 1) ·0xCDB2-0xCF58 — bank 03 $CDA2-$CF48: step tile encounter masks ($07/$0F/$1F), coordinate parity ((X^Y) & 1), zone-zero rerolls, dungeon map check, and Repel comparisonDragon Warrior (USA) (Rev 1) · 0xF50A-0xF55E — bank 03 $F4FA-$F54E: RepelTbl ($F4FA), OvrWrldEnGrid ($F522), and dungeon enemy indices ($F542)Dragon Warrior (USA) (Rev 1) · 0xDD63-0xDD7A — bank 03 $DD53-$DD6A: ChkFryWtr activates Fairy Water protection by setting RepelTimer ($DB) to $FEChecked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.(X ^ Y) & 1 selects the coordinate-parity encounter mask. Erdrick's Armor skips swamp and barrier damage. Repel fails to suppress only if floor(RepelTbl / 2) < RepelTbl - floor(Defense / 2).
Physical strikes roll randomized damage from attack minus half defense, falling back to a 50% 0-or-1 hit for heroes when that difference is below 2 and a scaled weak-hit roll for monsters when it does not exceed half monster attack; against non-Dragonlord enemies, heroes also have a 1 in 32 chance for a defense-ignoring excellent move, and awake enemies dodge at probability from their low magic-defense nibble . dragon-warrior/physical-combat-formulas
0xE61C-0xE6A3 — bank 03 $E60C-$E693: hero physical strike path, Dragonlord critical exclusion, 1/32 excellent move, and awake-enemy d/64 dodge checkDragon Warrior (USA) (Rev 1) · 0xEFF5-0xF05F — bank 03 $EFE5-$F04F: PlyrCalcHitDmg ($EFE5) and EnCalcHitDmg ($EFF4) normal and weak damage rollsChecked by research-agent, 2026-11-25 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.The normal-damage branch requires Atk - floor(Def/2) >= 2 for heroes and >= floor(Atk/2) + 1 for monsters. An awake enemy dodges when rand(0..63) < ($0105 & $0F).
Attempting to run succeeds automatically if the enemy is asleep; otherwise the game compares hero agility times a 0-to-255 roll against enemy defense times an enemy-group scalar drawn from 0 to 63, from 0 to 127, from 0 to 255 (including both Dragonlord forms), or as the sum of a 0-to-63 roll and a 0-to-31 roll for mid-tier enemies. dragon-warrior/run-escape-formula
0xE896-0xE8E3 — bank 03 $E886-E8D3: sleep bypass and escape comparisonDragon Warrior (USA) (Rev 1) · 0xEEA1-0xEF0C — bank 03 $EE91-EEFC: enemy-group random scalarDragon Warrior (USA) (Rev 1) · 0xC1D9-0xC1FF — bank 03 $C1C9-C1EF: multiplication helperChecked by research-agent, 2026-11-25 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.Enemy index brackets are 0..$13, $14..$1D, $1E..$22, and $23..$27; $0101 holds monster defense/agility. At $EEBB, ADC $3E has no preceding CLC, so a 65536 RNG carry can add 1 to the scalar.
Dragonlord Form 1 rolls 76 to 100 HP and, against an un-blocked hero, selects Stopspell (25%), Hurtmore (56.25% for 30 to 45 base damage, 20 to 30 with Magic or Erdrick's Armor), or a physical strike (18.75% at 90 Attack); Dragonlord Form 2 skips HP randomization for a fixed 130 HP, 140 Attack, and 200 Defense, splitting turns evenly between physical attacks and Fire 2 breath (65 to 72 base damage, 42 to 48 with Erdrick's Armor), and both forms forbid excellent moves and have zero dodge. dragon-warrior/dragonlord-forms-stats-and-ai
Value
{
"form1": {
"atk": 90,
"def": 75,
"hpRange": [
76,
100
]
},
"form2": {
"atk": 140,
"def": 200,
"hp": 130,
"fire2Base": [
65,
72
],
"fire2ErdrickArmor": [
42,
48
]
}
}0x5971-0x5990 — bank 01 $9961-$9980: LoadEnemyStats copies 16-byte monster stat row into $0100-$010FDragon Warrior (USA) (Rev 1) · 0x60BB-0x60DA — bank 01 $A0AB-$A0CA: 16-byte stat rows for Dragonlord Form 1 ($26) and Form 2 ($27)Dragon Warrior (USA) (Rev 1) · 0xE593-0xE5CB — bank 03 $E583-$E5BB: skips ModEnHitPoints for $27 (fixed 130 HP) while randomizing $26 to 76..100 HPDragon Warrior (USA) (Rev 1) · 0xE625-0xE637 — bank 03 $E615-E627: excellent move exclusionDragon Warrior (USA) (Rev 1) · 0xE687-0xE6A3 — bank 03 $E677-$E693: physical dodge check (LDA $0105; AND #$0F; BEQ) skips dodge when monster dodge nibble is 0Dragon Warrior (USA) (Rev 1) · 0xEB58-0xEBE1 — bank 03 $EB48-$EBD1: Form 1 action selectionDragon Warrior (USA) (Rev 1) · 0xEC44-0xEC78 — bank 03 $EC34-EC68: Hurtmore and armor damageDragon Warrior (USA) (Rev 1) · 0xECF1-0xED23 — bank 03 $ECE1-ED13: Fire 2 and Erdrick armor damageChecked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.If Stopspell is blocked ($DF & $10 != 0), Form 1 selects Hurtmore 75% and physical attack 25%. Armor reduces damage to 2 * floor(dmg / 3), yielding 20..30 Hurtmore damage and 42..48 Fire 2 damage. Form 2 uses AI byte $0E.
While Dragon Warrior is paused, it polls the controller in tight loops that don't wait for the next frame, and every poll first steps the random number, so the generator advances many times in each paused frame (computed). dragon-warrior/pause-spins-random
About: Dragon Warrior Random number generator
CodeDragon Warrior (USA) ·0xCAC9-0xCAE6 — $CAB9-$CAD6: loops waiting for Start to be released, pressed and released again, with no frame waitDragon Warrior (USA) · 0xC618-0xC641 — $C608-$C631: each poll calls the random step, then reads controller 1Dragon Warrior (USA) · 0xC56B-0xC596 — $C55B-$C586: the random stepChecked by claude, 2026-11-30 — Disassembled the pause loops, the poll routine and the random step from the original (Rev 0) USA ROM.Checked by a second AI model, 2026-11-30.Read from the original USA release, not Rev 1.
Cited by: Dragon Warrior
Pressing Start while exploring doesn't pause Dragon Warrior at once: it waits frame by frame until the low four bits of its frame-wait counter equal one. dragon-warrior/pause-entry-sync
About: Dragon Warrior Pause
CodeDragon Warrior (USA) ·0xCAAB-0xCAC8 — $CA9B-$CAB8: clears the counter, tests Start, then waits a frame at a time until counter AND $0F equals 1Dragon Warrior (USA) · 0xCB40-0xCB56 — $CB30-$CB46: the idle loop waits a frame and returns to the Start test without clearing the counterDragon Warrior (USA) · 0xFF84-0xFF8C — $FF74-$FF7C: the frame waitDragon Warrior (USA) · 0xFE77-0xFE93 — $FE67-$FE83: the frame interrupt increments the counter when it interrupts that waitChecked by claude, 2026-11-30 — Disassembled the idle loop, the pause entry, the frame wait and the interrupt's counter update from the original (Rev 0) USA ROM.Checked by a second AI model, 2026-11-30.Read from the original USA release, not Rev 1.
Cited by: Dragon Warrior