A tiny IPS patch for Contra (Famicom / Japan) on NES that makes two weapons feel better, without touching anything else.
| Weapon | Original | Patched |
|---|---|---|
| M (machine gun) | one shot every 8 frames, 15-frame pause after 6 shots | one shot every 5 frames, pause after 6 shots unchanged (15 frames) |
| L (laser) | 4 px/frame | 6 px/frame (1.5x) |
| S, F, normal gun (with or without R) | – | unchanged |
The laser only has one speed in this game: it moves the same with or without R, so L and L+R are both faster after patching.
No ROM is included. This repository only contains a patch (a list of changed bytes). You must provide your own legally obtained ROM.
- Contra (J), a 256 KB ROM: 262,160 bytes (16-byte iNES header + 128 KB PRG + 128 KB CHR). Also known as Contra (Japan) or Gryzor (J).
- Works on top of the English translation patches for the Japanese version (tested with MFerraro's version, built on Stardust Crusaders). Apply the translation first, then this patch.
- Not for the US ROM. It has a different layout.
ROM used for testing (Contra (J) with the English translation applied, before this patch):
Name: Contra (J) patched.nes
Size: 262160 bytes (256 KiB)
CRC32: C8581D8A
SHA-1: 6d3392ee34df77c96651385e0722aa871b7fed4a
If your ROM has different hashes (for example a different translation or the untranslated ROM), the patch may still work because it only changes bytes that the translation does not touch, but it was only tested on the ROM above. apply_patch.py checks the bytes at the patch locations before writing anything.
Option A – any IPS patcher
- Get an IPS patcher, for example Floating IPS (Flips), Lunar IPS, or the in-browser RomPatcher.js (links may change; search the names if they are broken).
- Select your ROM and
Contra_J_MGun_Laser.ips, apply, and save under a new name. - IPS does not check that the ROM is the right version. If you are unsure, use Option B.
Option B – apply_patch.py (checks the ROM first)
Requires Python 3.
python apply_patch.py "Contra (J).nes" "Contra (J) MGun Laser.nes"
The script refuses to write anything if the ROM size or the original bytes do not match what it expects, and it never overwrites your input file.
Open the patched ROM in FCEUX (Debug > Hex Editor > View > ROM File, Ctrl+G) and check:
| Offset | Expected bytes |
|---|---|
0x180CA |
C9 60 A0 05 90 02 A0 0F |
0x1832B |
53 83 F0 8E |
0x18F00 |
00 00 FA 00 04 3E FB C2 |
File offsets include the 16-byte iNES header (same numbers as the FCEUX Hex Editor in ROM File view).
| Offset | Original | New | Purpose |
|---|---|---|---|
0x0180CD |
08 |
05 |
M gun: frames between shots |
0x01832D–0x01832E |
53 83 |
F0 8E |
Laser speed-table pointer now points to $8EF0 |
0x018F00–0x018F2F |
FF x 48 |
new table | Laser speed table, 1.5x |
- Tested by the author only on Contra (J) with the MFerraro English translation. Other versions are untested.
- The M gun code is shared by both players, so player 2 should be affected as well. This was not tested.
- A 2x laser (8 px/frame) is possible but the beam gets spaced out and looks wrong, so 1.5x was chosen.
Tools: FCEUX debugger and hex editor. CPU address $8000-$BFFF in bank 06 maps to file offset CPU + 0x10010.
M gun. RAM $00AC is the player 1 fire counter (see the Data Crystal RAM map). A write breakpoint on it stops at 06:8038. The fire-rate logic is at 06:80B6:
80B6 INC $AC,X counter +1 per frame while firing
80BA CMP #$60 6 shots fired yet? (high nibble)
80BC LDY #$08 not yet: wait 8 frames <- file 0x180CD
80C0 LDY #$0F yes: pause 15 frames <- file 0x180D1 (left unchanged)
80C6 CMP $0F counter reached the threshold? then spawn a bullet (JSR $81A1)
The CMP #$07 at 06:8032 is not the fire rate. It only caps the counter while the button is not held so the first shot fires immediately.
Laser. Speed tables are 48 bytes: 12 directions x 4 bytes [X int][X frac][Y int][Y frac], signed (for example 04 00 = 4.0, FC 00 = -4.0, 02 D4 = 2.83). A pointer table at file 0x18327 selects the table per weapon and R state:
| Pointer (file) | Table | Used by |
|---|---|---|
0x18327 |
$8323 (3 px) |
normal/M/S, no R |
0x18329 |
$8353 (4 px) |
normal/M/S, with R |
0x1832D |
$8353 (4 px) |
laser (both with and without R, found by testing) |
0x1832F, 0x18331 |
$83B3, $8383 |
F gun |
So R on the other guns is just a switch to the faster 4 px table, and the laser already sits on it. Editing $8353 directly would speed up the other guns with R too. The patch instead writes a new table into free space (FF padding) and changes only the laser's pointer.
Lessons learned: do not reuse or overwrite another weapon's table (overwriting the F gun's table made its bullets wrap around the screen forever), and always check which weapons read a table before editing it.
- English translation of Contra (J): Pennywise (Stardust Crusaders) and MFerraro.
- RAM/ROM maps: Data Crystal. Reference disassembly of the US version: vermiceli/nes-contra-us.
- Patch by mr.Big.
This is an unofficial fan modification, not affiliated with or endorsed by Konami. Contra is a trademark of Konami. This repository contains no game data or ROM. Use at your own risk and back up your ROM first.
The patch, apply_patch.py and the documentation are released under the MIT License.
This does not cover the game itself (Contra, © Konami) or the English translation patches, which belong to their respective owners.