This is a cross-platform NES Emulator written in C++ using SDL for graphics, input, and audio. The project focuses on precise hardware emulation to recreate the classic NES gaming experience while maintaining clear and modular code design.
- Hardware Emulation:
- Emulates the NES CPU (6502), PPU (Picture Processing Unit), and memory-mapped I/O for accurate gameplay.
- Cross-Platform:
- Developed with SDL, ensuring compatibility across Windows, macOS, and Linux.
- Simple and Functional Design:
- Modular structure for readability and maintainability.
- Classic NES Games:
- Load and play ROMs of original NES games for a nostalgic retro gaming experience.
- C++ Compiler (e.g., GCC, Clang, or MSVC)
- SDL2 Library:
Install SDL2 on your system:- On Ubuntu/Debian:
sudo apt-get install libsdl2-dev
- On macOS (Homebrew):
brew install sdl2
- On Windows: Download the SDL2 development library from libsdl.org.
- On Ubuntu/Debian:
-
Clone the repository:
git clone https://github.com/SpideR1sh1/nes-emulator.git cd nes-emulator
-
Compile the project:
g++ -std=c++17 main.cpp -o nes_emulator -lSDL2
-
Run the emulator:
./nes_emulator
- Place a valid NES ROM file (e.g.,
game.nes
) in the project directory. - Run the emulator and specify the ROM file as an argument:
./nes_emulator game.nes
- CPU Emulation:
- Implements the 6502 processor instruction set for NES games.
- PPU (Graphics) Emulation:
- Simulates the NES Picture Processing Unit for accurate frame rendering.
- Input Handling:
- Uses SDL to manage keyboard inputs for NES controllers.
- Memory Management:
- Implements memory-mapped I/O for accurate game state emulation.
(Add screenshots here of games running on your emulator)
- Save states for game progress.
- Rewind functionality for enhanced gameplay.
- Improved performance optimization.
- Audio emulation for full NES sound support.
- Language: C++
- Libraries: SDL2
- Tools: G++/Clang (Compiler), Make (Build System)
Contributions are welcome! Feel free to open issues or submit pull requests to improve the emulator or add new features.
This project is licensed under the MIT License. See LICENSE for details.
- Inspired by OneLoneCoder's olcNES.
- Thanks to the NESDev community for documentation and support.