Skip to content
dougvjPublic

About

A cycle-accurate NES emulator written in C

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

70 Commits

Folders and files

Repository files navigation

NES Emulator

A cycle-accurate NES (Nintendo Entertainment System) emulator written in C.

This is a nearly 20-year-old hobby project that has been slowly worked on over the years. It has gone through many refactors as I got better at programming and gradually learned to love C over C++.

Features

  • MOS 6502 CPU emulation with cycle accuracy
  • PPU (Picture Processing Unit) with sprite and background rendering
  • APU (Audio Processing Unit) with pulse, triangle, noise, and DMC channels
  • iNES ROM format loading
  • SDL2 video and audio output
  • Curses-based TUI for debug information
  • Joystick/controller input via SDL2

Supported Mappers

  • NROM (Mapper 0)
  • MMC1 (Mapper 1)
  • UxROM (Mapper 2)
  • CNROM (Mapper 3)
  • MMC3 (Mapper 4)

Building

Requires Meson, SDL2, and ncurses.

meson setup builddir
meson compile -C builddir

Usage

./builddir/nes <rom.nes>

Project Structure

src/
  CPU/      - MOS 6502 processor
  PPU/      - Picture Processing Unit
  APU/      - Audio Processing Unit (pulse, triangle, noise, DMC)
  mapper/   - Cartridge mapper implementations
  INES/     - iNES ROM format parser
  UI/       - SDL2 video output and curses TUI
  JS/       - Joystick input handling
  util/     - Data structure utilities

Test ROMs

Test ROMs are included as a git submodule:

git submodule update --init --recursive

About

A cycle-accurate NES emulator written in C

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages