Gradius
Konami's 1985 horizontal shoot 'em up, read here in its US NES release, in the ROM.
On this page
The atlas reads Gradius’s US NES release in the ROM, which it disassembled with da65; it found no public disassembly. The byte names in the claims are the atlas’s, tied to the meter through the routine that grays out its slots. Nothing has been measured in the ROM yet.
Capsules move a cursor along the six slots of the power-up meter, and a button press buys the lit one. Missile can be bought once and the shield only while none is up, Double and Laser replace each other, and options stop at two1.
While the game is paused it checks for Up Up Down Down Left Right Left Right B A, the cheat code that Contra later checked on its title screen2. Here it sets the speed count to 1 and gives Missile, two options, and the shield3. A second sequence, Down Up B A B A B A B A, entered while the game-over screen waits, brings the player back with the lives byte set to 34.
Mechanics
| Mechanic | Kind | How |
|---|---|---|
| Power-up meter | Cursor | six slots from Speed Up to ?; capsules move the cursor and a button buys the lit slot |
| Option | bought on the meter, up to 2 | |
| Cheat code | While paused | Up Up Down Down Left Right Left Right B A while paused: speed, missile, two options, and the shield |
| Continue | Code | Down Up B A B A B A B A at game over restores the lives |
Every claim about this game, by concept (3)
References
- ^In the US NES Gradius each capsule moves the meter's cursor one slot along six, back to the first after the sixth, and a press of the power-up button buys the lit slot and clears the cursor. Taking the slots in the bar's order, Speed Up adds 1 to a speed count; Missile can be bought once; Double and Laser write 2 or 1 to one shared byte, so each replaces the other; Option adds 1 up to 2; and ? sets a shield counter to 5 when it's 0. A slot that can't be bought leaves the cursor where it is.Code“Gradius (USA)”
How we know
In the cartridge (“Gradius (USA)”): $894B-$8973, a capsule: increment the cursor at $42; at 7, set it back to 1; $8974-$89E2: on bit `$40` of the player's button byte, jump through a seven-entry table by $42 (0 does nothing). Slot 1 increments $40 with no check; slot 2 increments $41 only if it's 0; slots 3 and 4 store 2 and 1 to $44 unless it already holds that value; slot 5 increments $45 only below 2; slot 6 stores 5 to $46 only if it's 0. Each purchase stores 0 to $42 and calls $EC1E with `$0E`; each refusal returns first.. We don't reproduce the bytes.
Checked against the evidence by its author, an AI model, 2026-10-21.
Checked by a second AI model, 2026-10-21.
- ^While the title screen scrolls in, the US NES Contra compares each new d-pad, A, or B press with a ten-entry table, Up Up Down Down Left Right Left Right B A. A wrong press sets the count to
$FF, which stops the check until the title starts over. The full sequence sets a flag, and a new game then gives each player 29 lives in reserve instead of 2: 30 lives instead of 3.Codevermiceli/nes-contra-usHow we know
750game_routine_01: 751 jsr konami_input_check ; check if current input is part of Konami code (30-lives code)
src/bank7.asm lines 749–752 at 687d651 · upstream ↗ 930konami_input_check: 931 ldy KONAMI_CODE_NUM_CORRECT ; load the number of successful inputs of Konami code 932 bmi konami_code_exit ; if #$ff (invalid Konami input), exit 933 lda CONTROLLER_STATE_DIFF ; buttons pressed (only care on input change so held button doesn't affect code) 934 and #$cf ; only care about input from d-pad and A/B buttons (not select nor start) 935 beq konami_code_exit ; if no input detected, exit 936 cmp konami_code_lookup_table,y ; compare with Konami code sequence at index y 937 beq konami_input_index_correct ; on success, goto konami_input_index_correct 938 lda #$ff ; incorrect sequence for Konami code 939 sta KONAMI_CODE_NUM_CORRECT ; since incorrect set KONAMI_CODE_NUM_CORRECT (number of successful inputs) to $ff ⋮ 945 cpy #$0a ; Konami code is 10 inputs, compare against how many successfully entered 946 bcc konami_code_exit ; Konami code not yet fully entered, exit ⋮
src/bank7.asm lines 930–955 at 687d651 · upstream ↗ 716game_routine_00: ⋮ 720 sty KONAMI_CODE_NUM_CORRECT ; initialize konami check to #$00 (see konami_input_check)
src/bank7.asm lines 716–720 at 687d651 · upstream ↗ 1165init_player_lives: 1166 lda #$02 ; start off with #$02 lives 1167 ldy KONAMI_CODE_STATUS ; 30-lives code switch ($01 = code activated) 1168 beq init_player_num_lives ; if KONAMI_CODE_STATUS is not set, then just set 2 lives 1169 lda #$1d ; KONAMI_CODE_STATUS active so set lives to #$1d (29 decimal) ⋮ 1174 sta P1_NUM_LIVES,x ; if X is 1, then set P2_NUM_LIVES to accumulator (a is either #$02 or #$1d)
src/bank7.asm lines 1165–1174 at 687d651 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-21.
Checked by a second AI model, 2026-10-21.
- ^Start pauses the US NES Gradius, and while it's paused a routine compares each new press with a ten-entry table, Up Up Down Down Left Right Left Right B A: the same ten bytes as Contra's table. A wrong press sends the count back to 0, unlike Contra's, where a miss stores
$FFand ends the check. The full sequence sets the speed count to 1, buys Missile, sets the options to 2 and the shield counter to 5, and leaves Double or Laser as they were. It also decrements a per-player byte that must not be negative for the check to run.Code“Gradius (USA)” · vermiceli/nes-contra-usrevisedHow we know
In the cartridge (“Gradius (USA)”): $9ADA-$9B3D: with the pause flag $15 clear, Start (`$10`) sets it and saves the sound registers; with it set, if the player's byte at $3B is not negative, run the check with table 2, and at a count of 10 call $9C5E, decrement $3B, and zero the count; Start clears $15 and restores the sound; $9765-$9784, the check: point at table X, skip when the count at $33 is negative or no button is new, increment it on a match and set it to 0 on a miss; $9785-$979C: two table pointers ($9789, $9793), then the two ten-byte tables; the second is 08 08 04 04 02 01 02 01 40 80; $9C5E-$9C6C, the grant: 5 to $46 (shield), 1 to $41 (missile) and $40 (speed), 2 to $45 (options); $44 (Double or Laser) is not written. We don't reproduce the bytes.
954konami_code_lookup_table: 955 .byte $08,$08,$04,$04,$02,$01,$02,$01,$40,$80
src/bank7.asm lines 954–955 at 687d651 · upstream ↗ 937 beq konami_input_index_correct ; on success, goto konami_input_index_correct 938 lda #$ff ; incorrect sequence for Konami code 939 sta KONAMI_CODE_NUM_CORRECT ; since incorrect set KONAMI_CODE_NUM_CORRECT (number of successful inputs) to $ff
src/bank7.asm lines 937–940 at 687d651 · upstream ↗ Checked against the evidence by its author, an AI model, 2026-10-21.
Revised after a check by a second AI model, 2026-10-21.
- ^When a player's lives byte drops below 0 in the US NES Gradius, the game-over state waits, for as long as $B0 is nonzero and then 120 frames (
$78), and meanwhile runs the code check with its other ten-entry table, Down Up B A B A B A B A. If the count has reached ten when the wait ends, the player comes back with the lives byte at 3, the value a new game sets.Code“Gradius (USA)”revisedHow we know
In the cartridge (“Gradius (USA)”): $979D-$97C4: decrement the player's lives byte at $20,X; if it's negative, branch to $97F1; $97F1-$9829: clear the player's bit in $0A, set the state $1B to `$C0`, draw text `$1C`, and store `$78` in the timer $4C; $96FB-$9764, state bit `$40`: while $B0 is nonzero, run the check with table 1 ($9789) without counting $4C down ($96FF branches to $975D); after that, while $4C is nonzero, count it down and run the check; when $4C reaches 0 with the count at 10, store 3 in $20,X, set the player's bit in $0A again, and resume; $9785-$979C: the first table, at $9789, is 04 08 40 80 40 80 40 80 40 80; $82F8-$8306, in the new-game setup: store 3 in both players' lives bytes, $20 and $21. We don't reproduce the bytes.
Checked against the evidence by its author, an AI model, 2026-10-21.
Revised after a check by a second AI model, 2026-10-21.
Sources
Code
- 1986. “Gradius (USA).” · licence, all uses
- (vermiceli), Michael Miceli. 2026. “Contra (US), annotated disassembly (vermiceli).” Commit 687d651. vermiceli/nes-contra-us @ 687d651 · licence, all uses