GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - binji/binjnes: NES emulator implemented in C, that also runs in the browser

BranchesTags
Open more actions menu

Latest commit

 

History

454 Commits
454 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
py
py
 
 
scripts
scripts
 
 
src
src
 
 
test
test
 
 
third_party
third_party
 
 
.clang-format
.clang-format
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
test_results.md
test_results.md
 
 

Repository files navigation

Github CI Status

binjnes

A simple NES emulator.

Features

  • Cycle accurate, passes many timing tests (see below)
  • Supports quite a few mappers
    • 0, 1, 2, 3, 4, 5, 7, 9, 10, 11, 13, 16, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 32, 33, 34, 38, 65, 66, 67, 69, 71, 75, 76, 78, 79, 80, 85, 87, 89, 93, 111, 118, 146, 163, 180, 206, 210, 232
    • Has built-in cart database
    • Supports additional audio channels for mapper 19, 24, 26
  • Save/load battery backup
  • Save/load emulator state to file
  • Pause and step one frame
  • Rewind and seek to specific cycle
  • Convenient Python test harness using hashes to validate

Cloning

Use a recursive clone, to include the submodules:

$ git clone --recursive https://github.com/binji/binjnes

If you've already cloned without initializing submodules, you can run this:

$ git submodule update --init

Building

Requires CMake and sokol.

Building (Linux/Mac)

If you run make, it will run CMake for you and put the output in the bin/ directory.

$ make
$ bin/binjnes foo.nes

You can also just use cmake directly:

$ mkdir build
$ cd build
$ cmake ..
$ make

Building WebAssembly

You can build binjnes as a WebAssembly module. You'll need an incoming build of emscripten. See https://github.com/kripken/emscripten/wiki/WebAssembly and http://kripken.github.io/emscripten-site/docs/building_from_source/index.html#installing-from-source.

Put a symlink to Emscripten in the emscripten directory, then run make.

$ ln -s ${PATH_TO_EMSCRIPTEN} emscripten
$ make wasm

Or set Makefile variables via command line:

$ make wasm EMSCRIPTEN_CMAKE="/path/to/Emscripten.cmake"

Changing the Build Configuration

If you change the build config (e.g. update the submodules), you may need to run CMake again. The simplest way to do this is to remove the out/ directory.

$ rm -rf out/
$ make

Running

$ bin/binjnes <filename>

Keys:

Action Key
P0 DPAD-UP ↑
P0 DPAD-DOWN ↓
P0 DPAD-LEFT ←
P0 DPAD-RIGHT →
P0 B Z
P0 A X
P0 START Enter
P0 SELECT Tab
P1 DPAD-UP Y
P1 DPAD-DOWN H
P1 DPAD-LEFT G
P1 DPAD-RIGHT J
P1 B K
P1 A L
P1 START O
P1 SELECT I
Reset Delete
Save state F6
Load state F9
Rewind Backspace
Pause Space
Step one frame N

Running tests

scripts/tester.py will only run the tests that match a filter passed on the command line. Some examples:

# Run all tests
$ scripts/tester.py

# Run all apu tests
$ scripts/tester.py apu

Test status

See test results

About

NES emulator implemented in C, that also runs in the browser

binji.github.io/binjnes/

Topics

emulatornesnes-emulatornintendo

Resources

Readme
MIT license
Activity

Stars

38 stars

Watchers

2 watching

Forks

5 forks
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.