Contra

From NES Hacker Wiki
Jump to: navigation, search

Contra is a run-and-gun based on the arcade game with two player simultaneous game play. You control Mad Dog or Scorpion and try to destroy an evil alien force. You get special weapons like the machine gun, flame thrower, and spray gun. There are 8 areas, most of them are side view, but areas 2 and 5 use a 3D perspective.

Easy Cheats

Icon Addr Val Cmp Description
Icon-Lives.png C462 08 02 Start With 9 Lives (Both players) (USA)
Icon-Lives.png C462 62 02 Start With 99 Lives (Both players) (USA)
Icon-Lives-Infinite.png 0032 09 - P1 Infinite Lives
Icon-Invincible.png 00B0 7F - P1 Invincible (B power up)
Icon-Weapon.png 00AA 13 - P1 Has Spray
Icon-Weapon.png 00AA 11 - P1 Has Machine Gun
Icon-Weapon.png 00AA 12 - P1 Has Flame Thrower
Icon-Weapon.png 00AA 14 - P1 Has Laser
Icon-Lives-Infinite.png 0033 09 - P2 Infinite Lives
Icon-Invincible.png 00B1 7F - P2 Invincible (B power up)
Icon-Weapon.png 00AB 13 - P2 Has Spray
Icon-Weapon.png 00AB 11 - P2 Has Machine Gun
Icon-Weapon.png 00AB 12 - P2 Has Flame Thrower
Icon-Weapon.png 00AB 14 - P2 Has Laser
Icon-Weapon.png DAD3 2C 95 Keep Gun After Dying (USA)
Icon-Jump.png D6E9 FA FB High Jump In Side View (USA)
Icon-Jump.png D6EF FB FC High Jump In Bases (USA)
Icon-Challenge.png C462 00 02 Start With 1 Life (Both players) (USA)
Icon-Challenge.png 0032 00 - P1 Start With 1 Life, No 1-Ups
Icon-Challenge.png 0033 00 - P2 Start With 1 Life, No 1-Ups
Icon-Challenge.png 00AA 00 - P1 No Special Guns
Icon-Challenge.png 00AB 00 - P2 No Special Guns
Icon-Challenge.png 8A90 40 80 Snipers Shoot More
Icon-Challenge.png 8472 18 30 Gray Turrets Shoot More
Icon-Challenge.png 85A3 28 50 Red Turrets Shoot More
Icon-Challenge.png 90F4 28 50 Base Turrets Shoot More
Icon-Challenge.png F10D 10 30 Big Gunners Shoot More
Icon-Challenge.png B83D 70 C0 Spider Turrets Shoot More
How do I use these?

North America

Contra.png

Memory Addresses

001C - Game Mode (00 - normal, 01 - demo)
0022 - Game Mode (selected in menu)
0024 - Konami Code Flag (00 - Not entered, 01 - Entered)
0025 - State (00 - playing, 01 - paused)
002C - Screen Type
	00 - menu
	04 - normal gameplay
	05 - credits
	06 - continue
	08 - boss defeated
	09 - boss defeat (minor different from prev. one - hard to describe)
0030 - Stage (00-07)
0032 - P1 Lives
0033 - P2 Lives
0038 - Game Status (00 - playing, 01 - game over)
0040 - Perspective (00 - 2D, 01 - 3D)

0064 - Base Room (00-05)
0065 - Movement increments from room to room (00-03)

0077 - Horizontal scrolling speed (Usually 00, but used to force scrolling for spiked tanks in Snow Field)

0082 - Flag for which generic enemy is active.

0090 - P1 Alive Status (00 - Dead, 01 - Alive, 02 - Dying)

00A0 - P1 Jump Direction
00A1 - P1 Jump Direction

00AA - P1 Weapon
	00 - Regular
	01 - Machine Gun
	02 - Flame Thrower
	03 - Spray
	04 - Laser
	+10 for Rapid fire
00AB - P2 Weapon
00AC - P1 Unknown Machine Gun Counter
00AD - P2 Unknown Machine Gun Counter
00AE - P1 Invulnerability Timer
00AF - P2 Invulnerability Timer
00B0 - P1 Invincibility Timer
00B1 - P2 Invincibility Timer
00B2 - P1 Water Status (00 - Walking, 91 - Entering, 93 - Entering, 15 - In Water, 17 - In Water, 9D - Exiting, 9F - Exiting)
00B3 - P2 Water Status (00 - Walking, 91 - Entering, 93 - Entering, 15 - In Water, 17 - In Water, 9D - Exiting, 9F - Exiting)

00BA - P1 Hidden (00 - Normal, Not Zero - Player and bullets are not drawn)
00BB - P2 Hidden (00 - Normal, Not Zero - Player and bullets are not drawn)

00C6 - P1 Y Delta

00D6 - P1 Sprite

00F1 - Controller 1 Poll

0200-02FF - Sprite Data

031A - P1 Y Position
0334 - P1 X Position

0368-0371 - P1 Bullet Flags
03B8-03C1 - P1 Bullet Y
03C8-03D1 - P1 Bullet X

0538-0547 - Turret Delay (shooting and opening/closing)
0558-0567 - Enemy shooting delay
0568-0577 - Enemy work bytes
0578-0587 - Enemy hit points (F0 - Invincible)
05C8-05D7 - Enemy flags

0698-06F7 - Platforms on the screen

0700-074F - Data on the screen for animations (Readable during stage change / game over)

07E0 - Hi Score x1
07E1 - Hi Score x256
07E2 - P1 Score x1
07E3 - P1 Score x256
07E4 - P2 Score x1
07E5 - P2 Score x256
	All scores are multiplied by 100

Data

8472 - 30 - Turret shooting delay.

Code

Red Turret Between Groups

85A2:A0 50     LDY #$50         ; Load Y with #50.
85A4:98        TYA              ; Transfer Y to A? (This is odd!)
85A5:9D 58 05  STA $0558,X      ; Store A into Enemy Shooting Delay.

Sniper Delay Between Shots

89E5:A9 18     LDA #$18         ; Load A with #18.
89E7:9D 58 05  STA $0558,X      ; Store A into Enemy Shooting Delay.

Sniper Delay Between Groups

8A8F:A9 80     LDA #$80         ; Load A with #80.
8A91:9D 58 05  STA $0558,X      ; Store A into Enemy Shooting Delay.

Base Turret Shooting Delay

90F3:A9 50     LDA #$50         ; 
90F5:9D 58 05  STA $0558,X      ; 

Spider Turret Shooting Delay

B838:A5 34     LDA $0034 = #$5D
B83A:29 1F     AND #$1F
B83C:69 C0     ADC #$C0
B83E:9D 38 05  STA $0538,X @ $0547 = #$00

Starting Lives

C461:A9 02     LDA #$02         ; Load A with #02 (3 lives)
C463:A4 24     LDY $0024        ; Load Y with the Konami Code Flag
C465:F0 02     BEQ $C469        ; If Konami Code Flag not set Goto $C469
C467:A9 1D     LDA #$1D         ; Load A with #1D (30 lives)
C469:95 32     STA $32,X        ; Store Lives into Player Lives, offset X (0 - P1, 1 - P2)

Jumping Code

; In this function, X is the player offset.
D6D3:B5 C2     LDA $C2,X
D6D5:C9 05     CMP #$05
D6D7:A9 91     LDA #$91
D6D9:B0 02     BCS $D6DD
D6DB:A9 11     LDA #$11
D6DD:95 A0     STA $A0,X
D6DF:A9 00     LDA #$00
D6E1:95 9E     STA $9E,X
D6E3:95 A6     STA $A6,X
D6E5:A5 40     LDA $0040
D6E7:4A        LSR
D6E8:A9 FA     LDA #$FB         ; Jump height during side view.
D6EA:A0 F0     LDY #$F0
D6EC:90 04     BCC $D6F2        ;
D6EE:A9 FB     LDA #$FC         ; Jump height in bases.
D6F0:A0 90     LDY #$90
D6F2:95 C6     STA $C6,X
D6F4:98        TYA
D6F5:95 C4     STA $C4,X
D6F7:60        RTS

Reset Gun

This code resets the players' gun upon dying.

DAD1:A9 00     LDA #$00         ; Load A with #00.
DAD3:95 AA     STA $AA,X        ; Store A into Player's Gun, offset player.

Big Gunner Shooting Delay

This is the shooting delay code for the standing up gunner. They shoot at different speeds because of this code.

F104:BD A8 05  LDA $05A8,X      ; Load A with $05A8 (Enemy flag)
F107:0A        ASL              ; Shift Left
F108:0A        ASL              ; Shift Left
F109:0A        ASL              ; Shift Left
F10A:0A        ASL              ; Shift Left
F10B:18        CLC              ; Clear Carry Flag
F10C:69 30     ADC #$30         ; Add A with #30
F10E:9D 38 05  STA $0538,X      ; Store A into Enemy Shooting Delay.


ROM Data

00000-0000F - iNES Header
00010-03D7F - Unpatterened
03D80-0400F - Empty
04010-07DFF - Patterened/Unpatterened
07E00-0800F - Empty
08010-09187 - Patterened/Unpatterened
0918D-0923F - Text (Title Screen)
09240-0925F - Patterened/Unpatterened
09260-0B00F - Graphics
0B010-0BD4F - Patterened/Unpatterened
0BD50-0C00F - Empty
0C010-1000F - Patterened
10010-138CF - Graphics
138D0-13C3A - Patterened
13C3B-13DDF - Text (Credits)
13DE0-1400F - Empty
14010-16DEF - Graphics
16DF0-1764F - Patternded
17650-1800F - Empty
18010-1B26F - Graphics
1B270-1B2A5 - Patterened/Unpatterened
1B2A6-1B3C3 - Text (In between levels / Stage names)
1B3C4-1BD3F - Patterened/Unpatterened
1BD40-1C00F - Empty
1C010-1EEAF - Patterened/Unpatterened
1EEB0-1EFCF - Enemy Data table
1F630-1FC0F - Empty
1FC10-2000F - Patterened

Enemy Data Table

ROM: 1EEB0 Memory: EEA0

EEB1 - Turret HP
EEB5 - Soldier HP

Text

Contra uses standard ASCII for it letters, but the numbers and the symbols are different.

00= 
30=0
31=1
32=2
33=3
34=4
35=5
36=6
37=7
38=8
39=9
40=.
41=A
42=B
43=C
44=D
45=E
46=F
47=G
48=H
49=I
4A=J
4B=K
4C=L
4D=M
4E=N
4F=O
50=P
51=Q
52=R
53=S
54=T
55=U
56=V
57=W
58=X
59=Y
5A=Z
B0=,
C3=©
F7='

Japan

Gryzor.png

In Japan the game is called Gryzor.

Memory Addresses

002C - Screen Type
	00 - menu
	01 - map (JP ver.)
	04 - normal gameplay
	05 - credits
	06 - continue
	08 - boss defeated
	09 - boss defeat (minor different from prev. one - hard to describe)
	0A - cutscene (JP ver.)
0032 - P1 Lives
0033 - P2 Lives
00AA - P1 Weapon
	00 - Regular
	01 - Machine Gun
	02 - Flame Thrower
	03 - Spray
	04 - Laser
	+10 for Rapid fire
00AB - P2 Weapon

Europe

Probotector.png

Due to the censorship in the UK, Contra was called Probotector, and all the humanoid soldiers are replaced with robots.