Claim set · data/claims/double-dragon.yaml

Double Dragon (USA) (the NES ROM)

Game: Double Dragon.

In Mode A (one- or two-player alternating story mode), landing an attack adds packed binary-coded decimal points to an internal three-digit experience counter; every 10 carries out of the low byte (1,000 experience units) awards one heart and clears the counter, up to a maximum of 6 earned increments (7 displayed hearts), whereas Mode B disables experience accumulation. double-dragon/heart-xp-threshold

Value: mode Mode A · carries per heart 10 · max earned increments 6 · max displayed hearts 7

CodeDouble Dragon (USA) · 0x1FB9B-0x1FBF0 — fixed bank $FB8B-$FBE0: AddScoreDigits checks $0040 < 6, adds BCD A to $0041, carries decimal tens into $0042, and on $0042 = 10 increments $0040 and clears $0041-$0042Double Dragon (USA) · 0x1FFEE-0x1FFF0 — fixed bank $FFDE-$FFE0: JMP $FB8B entry vector (AddScoreDigits)Double Dragon (USA) · 0x130F3-0x13102 — bank 04 $B0E3-$B0F2: awards hit-record byte +6 via JSR $FFDE only when attacker slot ($0017) is 0 and Mode A ($0032 = 0) is activeDouble Dragon (USA) · 0x1F836-0x1F84A — fixed bank $F826-$F83A: clears $0489-$048F and writes heart tile $FC across indices 0..$0040 inclusive (1 to 7 hearts)Checked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

$0032 = 0 selects Mode A (story mode, both 1P and 2P alternating; $0030 stores player count), while $0032 != 0 selects Mode B (VS mode). $0041 holds the low two BCD digits (00-99); $0042 counts 0-9 hundreds carries; $0040 counts 0-6 earned increments, drawn as 1-7 hearts. AddScoreDigits plays SFX $1B on a heart gain and returns immediately once $0040 >= 6.

In Mode A (one- or two-player alternating story mode), earned heart count gates advanced attacks across six thresholds (1 through 6 earned hearts, or 2 to 7 displayed hearts): 1 enables a stunned-target follow-up check, 2 enables secondary attack animations, 3 and 4 allow close-range finishers against dizzy or downed enemies, 5 upgrades a base standing punch into an 8-damage strike when facing the matching direction against an eligible target, and 6 upgrades a special strike index into an 8-damage knockdown strike; in Mode B, thresholds 3, 5, and 6 are disabled while thresholds 1, 2, and 4 skip the heart-count check. double-dragon/heart-gated-move-unlocks

Value: 1, 2, 3, 4, 5, 6

CodeDouble Dragon (USA) · 0x1AAFC-0x1AB92 — bank 06 $AAEC-$AB82: $AAEC upgrades attack nibble 0 to $0E when $0040 >= 5 (Mode A only, target state in {0, 5, 6, 7, $0C}, facing via $AB2F-$AB30); $AB31 upgrades $0D to $0F when $0040 >= 6 (Mode A only); $AB4A-$AB82 gates stunned-target follow-up on $0040 >= 1 at $AB7B (bypassed when $0032 != 0)Double Dragon (USA) · 0x19053-0x1906D — bank 06 $9043-$905D: requires $0040 >= 2 for action $0433 = 2 on entity types < 3Double Dragon (USA) · 0x1AC42-0x1ACCE — bank 06 $AC32-$ACBE: selects secondary attack byte from $ACAF based on $0040 >= 2 in Mode A ($0032 = 0), or uses $ACAC in Mode BDouble Dragon (USA) · 0x1ACCF-0x1AD79 — bank 06 $ACBF-$AD69: $ACBF gates state $0B/$0F dizzy finisher on $0040 >= 3 and disables it in Mode B (BNE $AD0A->CLC;RTS); $AD0C gates state $03 finisher on $0040 >= 4 while skipping the $0040 check in Mode B ($AD0E BNE $AD22)Double Dragon (USA) · 0x13142-0x131A7 — bank 04 $B132-$B197: slot-0 player hit pointer subtable and 7-byte records ($01-$03 damage on base strikes vs $08 damage at indices $0E and $0F)Checked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

$0040 thresholds 1..6 correspond to 2..7 displayed hearts; $0032 = 0 selects Mode A (1P or 2P alternating story mode, with $0030 as player count) and $0032 != 0 selects Mode B (VS mode). Mode B disables threshold 3 ($ACBF BNE->CLC;RTS) and thresholds 5/6 ($AAEC/$AB31 BNE->RTS), while bypassing the $0040 check on thresholds 1 ($AB74 BNE->SEC;RTS), 2 ($AC5C BNE->$ACAC table), and 4 ($AD0C BNE->$AD22). Threshold 5 ($AAEC-$AB30) also requires target state ($03A8,Y & $7F) in {0, 5, 6, 7, $0C} and facing check ($00CA,X ^ $AB2F[$0427,Y & 1]) & $80 = 0. Base strikes use damage bytes $01, $01, $02, $03; hit records at $B18A ($0E) and $B191 ($0F) use $08.

Landing a hit selects an attack record by attacker type and attack index—seven bytes for Mode A slot-0 player attacks and five bytes for enemy or Mode B attacks—adding 1 to the knockback reaction index and promoting hit reaction state 5 to 6 when attacker and victim face the same direction, before updating the victim's entity state, subtracting damage clamped at zero, applying a six-byte velocity block whose horizontal component negates when facing left, and clearing animation counters on knockdown. double-dragon/hit-application-and-knockback

CodeDouble Dragon (USA) · 0x12FE4-0x13102 — bank 04 $AFD4-$B0F2: ApplyHitToEntity reads 7-byte Mode A slot-0 records (byte +3 SFX via $FFD8, byte +4 BCD score via $FFDB with BMI $B091 advancing Y to byte +5 for $03D0,X damage, byte +6 heart XP via $FFDE) vs 5-byte enemy/Mode B records (BNE $B092 reads byte +4 as damage); increments knockback reaction index $03C0,X and promotes $03CC,X 5 to 6 when ($00CA,X ^ $00CA,Y) & $80 = 0Double Dragon (USA) · 0x1AF61-0x1B03A — bank 06 $AF51-$B02A: consumes $03C0,X (clamped < 9) as a reaction/knockback table index across $B08E, $B097, $B07C, $B02B, $B085, and $B034Double Dragon (USA) · 0x13103-0x1310D — bank 04 $B0F3-$B0FD: HitReactionStateTable (11-byte attacker weapon reaction-state table)Double Dragon (USA) · 0x12A52-0x12A8F — bank 04 $AA42-$AA7F: sets entity state $03A8,X from $03CC,X & $0F, remaps prior $03A8,X & $7F in {2, 3, $0B} to state 4, clears $038E bit 0, subtracts $03D0 from $03B4 clamped at 0Double Dragon (USA) · 0x1DA26-0x1DA9F — bank 07 $DA16-$DA8F: InitEntityKnockbackVelocity skips state 2, copies 6 velocity bytes from $DA6D, and negates only X velocity ($0310/$0318) when $0300,X bit 7 is setDouble Dragon (USA) · 0x1DDA8-0x1DDC4 — bank 07 $DD98-$DDB4: KnockDownEntity sets $03A8,X bit 7, plays SFX $0A from state 8, and zeroes animation counters $B2, $AA, and $C2Checked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

Only Mode A ($0032 = 0) slot-0 ($0017 = 0) attacks read 7-byte records: byte +3 ($B067-$B06E) plays hit SFX via $FFD8 when non-negative, byte +4 ($B06F-$B090) awards BCD score via $FFDB when non-negative (while BMI $B091 still executes INY so byte +5 is always read as damage into $03D0,X), and byte +6 ($B0EB-$B0F1) awards heart XP via $FFDE. Enemy or Mode B records skip the $B06F-$B090 BCD-score step via BNE $B092, reading byte +4 directly as damage (5-byte records). ($00CA,X ^ $00CA,Y) & $80 = 0 tests same-facing hits, incrementing knockback/reaction index $03C0,X (consumed by bank 06 $AF51-$B02A reaction-table lookups) and promoting $03CC,X from 5 to 6. At $AA42-$AA7F, $03CC,X & $0F sets entity state $03A8,X while remapping prior ($03A8,X & $7F) values 2, 3, or $0B to 4, then subtracts $03D0,X from $03B4,X clamped at 0. InitEntityKnockbackVelocity ($DA16) skips state 2 and negates only 16-bit X velocity ($0310/$0318) when $0300,X bit 7 is set; KnockDownEntity ($DD98) zeroes animation counters $B2, $AA, and $C2.

Every enemy type spawns with its Mission 1 health in all four missions because the spawn routine computes the four-column mission health table offset and then discards it by reloading the un-offset base index instead of keeping the computed offset. double-dragon/enemy-hp-mission-scaling-bug

Value: type 1 8 · type 2 10 · type 3 8 · type 4 28 · type 5 32 · type 6 52 (HP)

CodeDouble Dragon (USA) · 0x1925C-0x19282 — bank 06 $924C-9272: spawn index reload from zero-page after mission offset calculationDouble Dragon (USA) · 0x1938C-0x193B4 — bank 06 $937C-93A4: four-column enemy HP tableChecked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

$9269-$926B computes (4 * min(type, 7)) | min(mission, 3) in A, then executes LDY $15 (A4 15) instead of TAY (A8). The mission-column-zero HP values 8, 10, 8, 28, 32, 52 for types 1..6 therefore apply in all four missions.

The random number generator updates a two-byte big-endian state by exclusive-ORing bit 1 of both bytes into the carry flag and rotating both bytes right by one bit—shifting the feedback bit into bit 7 of the high byte and shifting bit 0 of the high byte into bit 7 of the low byte—returning the updated high byte. double-dragon/prng-lfsr-update

About: Double Dragon Random number generator

Value: bytes 2 · tap bit mask 2

CodeDouble Dragon (USA) · 0x1FDFF-0x1FE23 — bank 07 $FDEF-$FE13: big-endian two-byte LFSR update and high-byte ($0013) returnChecked by research-agent, 2026-11-26 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

$0013 (high byte) and $0014 (low byte) shift right through carry in big-endian order; the routine returns the updated high byte $0013 in A.

The main entity loop processes 8 fixed slots (0 to 7), where scroll-group waves write up to 3 enemy entries into slots 1 to 3 and weapon or drop spawns search slots 4 to 7; when section completion advances the area counter past [2, 1, 4, 4] areas in Missions 1 through 4, the mission counter increments and wraps from 4 back to 0. double-dragon/entity-slots-and-mission-progression

Value: total slots 8 · areas per mission 2, 1, 4, 4

CodeDouble Dragon (USA) · 0x1D090-0x1D0DB — bank 07 $D080-D0CB: eight-slot entity loopDouble Dragon (USA) · 0x19AB9-0x19B14 — bank 06 $9AA9-9B04: scroll-group enemy wave slotsDouble Dragon (USA) · 0x1D5F0-0x1D60A — bank 07 $D5E0-D5FA: weapon and drop slotsDouble Dragon (USA) · 0x1A4CC-0x1A4E1 — bank 06 $A4BC-A4D1: section completionDouble Dragon (USA) · 0x1E67B-0x1E690 — bank 07 $E66B-$E680: tests $0047 & $E8 for bit 6 ($40) and branches to $E72ADouble Dragon (USA) · 0x1E73A-0x1E782 — bank 07 $E72A-E772: mission increment and wrapChecked by research-agent, 2026-11-25 — Read the cited banked ROM bytes and checked the instructions and tables against the stated behavior.

$004A,X bit 7 marks an active entity; $004B-$004D are group slots. $D5E0 scans slots 4..7 for weapons or drops. $003E is the area counter and $003D (Mission) selects its limit from [2, 1, 4, 4].

While unpaused, Double Dragon's main game loop does one group of update work on even-numbered passes and a different group on odd-numbered passes, and every pass ends by waiting for a frame interrupt. double-dragon/half-rate-main-loop

About: Double Dragon Game loop

CodeDouble Dragon (USA) · 0x1E5BA-0x1E61A — bank 07 $E5AA-$E60A: skips both groups while paused; $E5B8-$E5ED run on even passes (one stage substitutes the routine at $E88D) and $E5F3-$E60A on odd passesDouble Dragon (USA) · 0x1E661-0x1E675 — bank 07 $E651-$E665: sets $0107, waits for the interrupt to clear it, increments the pass counter $0502 and returns to the top on odd countsDouble Dragon (USA) · 0x1E10F-0x1E174 — bank 07 $E0FF-$E164: the gameplay frame interrupt, which clears $0107 when the loop is waitingChecked by claude, 2026-11-30 — Disassembled the main loop, its wait and the gameplay interrupt handler from the USA ROM.Checked by a second AI model, 2026-11-30.

Cited by: Double Dragon

While a game of Double Dragon is being played, its main loop reads the controllers, and checks Start for pausing and unpausing, only on every other pass. Because each pass lasts at least one frame, a button press that begins and ends between two reads is never seen (computed). double-dragon/pause-phase

About: Double Dragon Pause

CodeDouble Dragon (USA) · 0x1E58C-0x1E5A8 — bank 07 $E57C-$E598: on even passes only, reads the controllers and, if a game is running ($33 nonzero) and Start is newly pressed, toggles the pause bitDouble Dragon (USA) · 0x1E661-0x1E675 — bank 07 $E651-$E665: each pass waits for the frame interrupt, then increments the pass counterDouble Dragon (USA) · 0x1FD4D-0x1FD63 — bank 07 $FD3D-$FD53: reads the pads and marks as new only the buttons not held at the previous callDouble Dragon (USA) · 0x1FDB2-0x1FDD3 — bank 07 $FDA2-$FDC3: the controller port readDouble Dragon (USA) · 0x1E33F-0x1E340 — bank 07 $E32F: choosing a mode on the title screen makes $33 nonzeroDouble Dragon (USA) · 0x1E53D-0x1E541 — bank 07 $E52D-$E531: gameplay selects interrupt mode $C0Double Dragon (USA) · 0x1FF26-0x1FF37 — bank 07 $FF16-$FF27: the interrupt picks its handler from that modeDouble Dragon (USA) · 0x1E10F-0x1E174 — bank 07 $E0FF-$E164: the gameplay handler, which does not call the controller readChecked by claude, 2026-11-30 — Disassembled the main loop, the pad routines and the interrupt dispatch from the USA ROM, and searched the program ROM for port reads and calls to the pad routines: the other calls are in title and menu code and in a second game loop, which also reads only on even passes.Checked by a second AI model, 2026-11-30.

Cited by: Double Dragon