Giter Site home page Giter Site logo

nes-emu's Introduction

nes-emu

A Nintendo Entertainment System (NES) emulator written in C++

As this is just a pet project, don't expect a full-featured emulator. There is no GUI, many typical features are missing, and only a few mappers have been implemented. However, the code is pretty clean and straightforward, and I think can be useful to learn from. Of course, if someone wanted to fork this code to write a full-featured emulator, that would be cool as well :)

Features

  • Mappers 0,1,2,3,4,7 (~90% of games)
  • Accurate audio emulation (no DMC)
  • Automatic saving of SRAM
  • Save state support
  • Rewind any time up to 1 minute at normal speed
  • Single and multi frame stepping when paused

Controls

Input Keyboard Key(s)
D-Pad arrows
A A
B S
Select Tab
Start Enter
                  |

Open Rom | Ctrl + O Reset | Ctrl + R Quit | Alt + F4 | Rewind | Backspace Pause | P Step frame | [ Step many frames | ] | Toggle audio channels | F1-F4

Challenge

As with most pet projects, the purpose of writing this emulator was mainly to learn. My background is not in hardware, but I have always had a keen interest in computer architecture, so part of my goals was to learn more about how a console works at the hardware level. The NES is simple enough in that respect, although it has enough quirks to make it interesting to emulate.

To further my learning, I challenged myself to write this emulator without looking at any other emulator code. So the implementation is completely my own, and I suspect parts of my code may seem strange or inefficient as compared to other implementations.

Building

  • Install CMake

  • Download 32-bit SDL2 Development Libraries from https://www.libsdl.org/download-2.0.php

    • On Windows, set an environment variable named "SDL2" to the path of the extracted archive (e.g. set SDL2=C:\code\SDL2-2.0.4)
    • On Debian Linux, install SDL2: sudo apt-get install libsdl2-dev
  • Run CMake and build. For example, on Windows:

cd nes-emu
md build
cd build
set SDL2=C:\code\SDL2-2.0.4
cmake ..

Thanks

Although I did not look at other emulator source code, I did get a lot of information and help from other sources:

nes-emu's People

Contributors

amaiorano avatar rveilleux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nes-emu's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.