This is an NES emulator written in Go.
http://www.michaelfogleman.com/static/nes/
The go get
command will automatically fetch the dependencies listed below,
compile the binary and place it in your $GOPATH/bin
directory.
go get github.com/fogleman/nes
github.com/go-gl/gl/v2.1/gl
github.com/go-gl/glfw/v3.1/glfw
code.google.com/p/portaudio-go/portaudio
nes [rom_file|rom_directory]
-
If no arguments are specified, the program will look for rom files in the current working directory.
-
If a directory is specified, the program will look for rom files in that directory.
-
If a file is specified, the program will run that rom.
For 1 & 2, the program will display a menu screen to select which rom to play. The thumbnails are downloaded from an online database keyed by the md5 sum of the rom file.
Joysticks are supported, although the button mapping is currently hard-coded. Keyboard controls are indicated below.
Nintendo | Emulator |
---|---|
Up, Down, Left, Right | Arrow Keys |
Start | Enter |
Select | Right Shift |
A | Z |
B | X |
A (Turbo) | A |
B (Turbo) | S |
Reset | R |
The following mappers have been implemented:
- NROM (0)
- MMC1 (1)
- UNROM (2)
- CNROM (3)
- MMC3 (4)
- AOROM (7)
These mappers cover about 85% of all NES games. I hope to implement more mappers soon. To see what games should work, consult this list:
- there are some minor issues with PPU timing, but most games work OK anyway
- the APU emulation isn't quite perfect, but not far off
Interested in writing your own emulator? Curious about the NES internals? Here are some good resources: