Within 25 min codex-cli with GPT-5 codex made fully working NES emulator in pure c!
By Holidays in Europe / October 18, 2025 / No Comments / Uncategorized
Innovative NES Emulator Development Achieved in Just 25 Minutes Using GPT-5 and Codex-CLI
The rapid evolution of artificial intelligence continues to push the boundaries of software development, and recent experiments demonstrate how AI can assist in creating complex systems efficiently. A striking example is the development of a fully functional NES (Nintendo Entertainment System) emulator in just 25 minutes, utilizing the power of GPT-5’s Codex-CLI.
Project Overview and Methodology
Leveraging a Plus subscription, the developer used GPT-5’s Codex-CLI to generate the emulator code in a single “shot,” completing the task remarkably quickly. The initial attempt, which aimed for a high-level prompt, took about 45 minutes and resulted in a non-playable emulator that only displayed the title screen of some NES games.
Encouraged by these results, the developer refined their approach, providing GPT-5 with a comprehensive prompt outlining the specifications for a robust NES emulator. The prompt emphasized clarity, correctness, and portability, specifying the use of clean C (C11 standard), SDL2 for multimedia handling, and well-defined emulation features aligned with the original hardware.
Key Specifications Provided to GPT-5 Included:
- Accurate CPU emulation of the Ricoh 2A03 (MOS 6502 derivative), cycle-accurate with no BCD instructions.
- PPU implementation with scanline-accurate background and sprite rendering, support for name and attribute tables, and scrolling features.
- Audio emulation covering pulse channels, triangle wave, noise, and DMC, with SDL2 audio callbacks.
- Support for two standard gamepads using strobe and shift register protocols.
- Mapper support: NROM, MMC1, UxROM, CNROM, MMC3—covering most classic cartridges.
- Compatibility with iNES 1.0 ROM files, rejecting unsupported NES 2.0 headers.
- Timing aligned with NTSC standards, maintaining approximately a 3:1 ratio between PPU and CPU cycles.
- Optional features like save states and battery-backed PRG-RAM for persistent game data.
Results and Observations
The resulting code produced a NES emulator capable of loading games and making them playable, albeit with some graphic glitches. The developer suspects that a more detailed prompt or iterative debugging prompts could reduce these visual artifacts, ultimately producing a smoother gaming experience.
This experiment underscores how AI-powered tools like GPT-5, combined with focused prompts and code generation via Codex-CLI,