Dive into the nostalgia of classic gaming with this NES emulator built entirely in Go! ⚡ Experience the charm of 8-bit gaming by running NES ROMs on this emulator.
Here’s a glimpse of the emulator in action:
Watch the emulator in action:
-
Install Dependencies:
go mod tidy
-
Run the Emulator:
go run main.go
-
Start Gaming:
Drag and drop any compatible NES ROM (with a supported mapper) into the GUI, and you're good to go! 🎉
- 🎵 Enhance Audio: Expand APU functionality beyond the basic pulse oscillator.
- 📦 Add More Mappers: Increase compatibility with more NES ROMs.
- 🖥️ Dynamic Screen Upscaling: Improve display resolution for modern screens.
- 64KB RAM: The NES system views 2KB of physical RAM as a mirrored 8KB block.
- 6502 CPU: Features registers (A, X, Y), a stack pointer, a program counter (PC), and a status register.
- Instructions may vary in size and cycles.
- olc2c02 PPU (Picture Processing Unit):
- 8KB Pattern Memory: Stores sprite and background graphics.
- 2KB Nametable: Holds layout data for the background.
- Color Palettes: Manage graphical color schemes.
- Programmable ROM (P-ROM): Contains both program and graphical data for the PPU.
- Mapper: Dynamically switches ROM banks and recognizes writable memory regions.
- Understand patterns, nametables, and palettes to see how tiles are rendered on the screen:
- PPU Memory Map
- Pattern Tables: Define sprite shapes in CHR ROM/RAM.
- Nametable Layout: Details the complex display system and scrolling.
- The NES uses 8 buttons mapped to a single byte, with memory-mapped controls for reading and writing:
- Parallel write, serial read.
- Supports 2 controllers.
- Stored in Object Attribute Memory (OAM).
- Each sprite requires 4 bytes (x, y, tile ID, attributes).
- Only 64 sprites in total, with a max of 8 sprites per scanline.
- Integrated into the CPU, the APU acts like a "fire-and-forget" sound system for music and effects.
- ✅ Ensure the CPU operates independently. Test using updated versions of nestest.
- 🖌️ PPU is complex—build it step by step. Start with loading and displaying the pattern table.
- 🔧 Components need careful synchronization (e.g., CPU & PPU with vertical blank status).
- Video Tutorials: javidx9 NES Emulator Series
- Datasheets:
- Testing:
- NES Architecture: Diagram & Explanation

