R-Type: PC Engine to SuperGrafx Port
A retro reverse-engineering project to remove the sprite flicker from R-Type on the PC Engine.
About the Project
R-Type on the TurboGrafx-16 / PC Engine is famous for its sprite flicker: the console's single video chip can only show 16 sprites per scanline, so in busy scenes the game rotates which ones it draws. This project ports the game to NEC's SuperGrafx, whose second video chip doubles that to 32 sprites per scanline and 128 on screen. Starting from a disassembly that rebuilds byte-for-byte against the original ROM, I rewrote the sprite builder to spread objects across both chips: objects sharing the same screen lines alternate between chips, lighter scenes place each object on whichever chip is less loaded, and the player ship and HUD always stay on top. The new builder is cheaper per object than the original, and it switches to faster placement in heavy scenes, so the port has slightly less slowdown than the original rather than more. Deterministic, frame-locked test runs in Mesen 2 confirm the port's game state matches the original frame for frame through all 8 stages, the ending and into the second loop. Across the whole game, frames with sprite flicker drop from 23.3% to 2.4%, lag frames from 358 to 324, and the work also fixes an original-game bug that sometimes drew the same object twice.
Before and After
Download the Patch
Apply the BPS patch to an unmodified, headerless R-Type (USA) PC Engine ROM with any BPS patcher, such as Flips. Name the result with a .sgx extension.
The port needs a SuperGrafx, or an emulator in SuperGrafx mode, and won't run on a standard PC Engine or TurboGrafx-16. In Mesen 2, go to Settings, then PC Engine, and set Console type to SuperGrafx. Geargrafx detects SuperGrafx mode from the .sgx extension. It has been tested on the Analogue Duo, validation on real hardware soon.
Download BPS Patch- Base ROM CRC32 (headerless, 524,288 bytes):
- 91CE5156
- Patched ROM CRC32 (1,048,576 bytes):
- 04DA565A
Cheat Codes
RAM codes that work on both the original game and the port.
| Code | Effect |
|---|---|
| F82166:01 | Invincibility, all stages |
| F82AC4:00 | Immune to enemy shots only, stages 1–4 |
| F82AB9:00 | Immune to enemy shots only, stages 5–8 |
| F82142:02 | Infinite lives |
Raw cheat list
{-,F82166:01,"INVINCIBLE....."}
{-,F82AC4:00,"SHOT.IMMUNE.1-4"}
{-,F82AB9:00,"SHOT.IMMUNE.5-8"}
{+,F82142:02,"INFINITE.LIVES."}