Git Product home page Git Product logo

nintengo's Introduction

nintengo

Build Status

An NES emulator written in Go

Super Mario Bros.

Donkey Kong

Excitebike

Legend of Zelda

Punch-Out!

Super Mario Bros. 3

Mega Man 2

Build

Mac OS X/Linux/Windows

  1. Install Azul3D by following the official installation instructions for your platform.

  2. go get -u github.com/nwidger/nintengo

WebAssembly

WebAssembly support requires Go 1.11 or higher.

  1. Download nintengo

    go get -d -u github.com/nwidger/nintengo
    
  2. Build wasm/nintengo.wasm

    cd $GOPATH/src/github.com/nwidger/nintengo
    GOOS=js GOARCH=wasm go build -o wasm/nintengo.wasm .
    
  3. Start web server running on port 8000

    cd $GOPATH/src/github.com/nwidger/nintengo/wasm
    go run serve.go -http :8000
    
  4. Open http://localhost:8000 in your browser. Press the Choose File button and select a .nes file to run.

Usage

nintengo OPTIONS FILE
FILE can be a .nes file or a .nes file inside a .zip archive
  -audio-recorder="": recorder to use: none | wav
  -connect="": Connect to address as slave, <rom-file> will be ignored (e.g., 'localhost:8080')
  -cpu-decode=false: decode CPU instructions
  -cpu-profile="": write CPU profile to file
  -http="": HTTP service address (e.g., ':6060')
  -listen="": Listen at address as master (e.g., ':8080')
  -mem-profile="": write memory profile to file
  -recorder="": recorder to use: none | jpeg | gif
  -region="NTSC": system region to emulate: NTSC | PAL

Controls

z - A
x - B
Enter - Start
Right Shift - Select
Arrow keys - Up/Down/Left/Right

p - Pause/Unpause
n - Toggle stepping by cycle/scanline/frame with p
r - Reset
q - Quit

F1 - save state
F5 - load state

F8  - 200% FPS (2x fast forward)
F9  - 100% FPS
F10 - 75% FPS
F11 - 50% FPS
F12 - 25% FPS

` - toggle overscan
1 - 256x240 screen size
2 - 512x480 screen size
3 - 768x720 screen size
4 - 1024x960 screen size
5 - 2560x1440 screen size

9 - Show/hide background
0 - Show/hide sprites

keypad 0 - toggle mute all channels
keypad 1 - toggle mute pulse 1 channel
keypad 2 - toggle mute pulse 2 channel
keypad 3 - toggle mute triangle channel
keypad 4 - toggle mute noise channel
keypad 5 - toggle mute DMC channel

l - Save pattern tables to left/right.jpg

o - Toggle CPU decoding
i - Toggle PPU decoding

with -recorder=gif:
s - Start recording to frame.gif
d - Stop recording

with -recorder=jpeg:
s - Save screenshot to frame.jpg

with -audio-recorder=wav:
keypad - (minus) - Start audio recording to audio.wav
keypad + (plus) - Stop audio recording

Support

Audio support is currently a work in progress. All audio channels are working in some capacity.

Battery backed saves is implemented and are saved to disk with a .sav file extension.

Save states are supported and are saved to disk with a .nst file extension.

Netplay

Nintengo includes two-player netplay support using the -listen and -connect command-line arguments. To use, player one launches nintengo and tells it to listen for incoming connections using the -listen flag:

nintengo -listen=:8080 FILE

Player two then connects to player one using the -connect flag, providing the server's host/port:

nintengo -connect=192.168.1.110:8080

Note that player two does not need to provide a FILE argument.

Mappers

  • NROM
  • MMC1
  • UNROM
  • CNROM
  • MMC3
  • ANROM
  • MMC2

Acknowledgments

This project would not have been possible without the amazing treasure trove of information that is the NESdev Wiki and the fine folks at #nesdev on EFnet.

Being able to read the source code of other NES emulators was also extremely helpful. The following is a short list of the ones I consulted most often, although it is probably not the complete list:

nintengo's People

Contributors

andoryuuta avatar archiloque avatar kaicheng avatar nwidger avatar slimsag 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  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  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

nintengo's Issues

Fragment shader linker error on Linux

When I try to run nintengo on my Linux machine I get this error and the video is blank:

SimpleShader | Linker errors:
Fragment info
-------------
0(12) : error C6013: Only arrays of texcoords may be indexed in this profile, and only with a loop index variable

@slimsag: Any idea what might be causing this?

Build error on ubuntu 20.04

Hi there,

I got build error like this and not sure what to fix

command run

go get -u github.com/nwidger/nintengo

I did install azul3d and run their examples fine.

# azul3d.org/engine/native/al
/usr/bin/ld:/home/stevek/go/pkg/mod/azul3d.org/[email protected]/native/al/blob_linux_amd64.syso: file format not recognized; treating as linker script
/usr/bin/ld:/home/stevek/go/pkg/mod/azul3d.org/[email protected]/native/al/blob_linux_amd64.syso:1: syntax error
collect2: error: ld returned 1 exit status

It looks like it should not pass the linker to the .syso file, syso file is just a text file

cat /home/stevek/go/pkg/mod/azul3d.org/[email protected]/native/al/blob_linux_amd64.syso
version https://git-lfs.github.com/spec/v1
oid sha256:63275bd4866f47b882d4bf4b6e89167ea3ee478dac135b43f0e9757859b95f20
size 1374493

nes: Failed to feed audio to OpenAL fast enough; resynching...

$ nintengo Super_mario_brothers.nes
PRG Banks: 2
CHR Banks: 1
Mirroring: Vertical
Battery: false
Trainer: false
FourScreen: false
VS Cart: false
RAM Banks: 1
Region: NTSC
Mapper: 0 (NROM)
nes: Failed to feed audio to OpenAL fast enough; resynching...
nes: Failed to feed audio to OpenAL fast enough; resynching...
nes: Failed to feed audio to OpenAL fast enough; resynching...
...

You can find the NES file here: http://www.nesfiles.com/NES/Super_Mario_Bros.aspx
The game works great, but the sound stutters continuously while showing the above error over and over again.

Gopherjs compilation fails

Trying to build Nintengo with gopherjs build -m gives me this error:

../../../../../go/src/testing/testing.go:614:13: StartTrace not declared by package pprof
../../../../../go/src/testing/testing.go:636:3: StopTrace not declared by package pprof

I'm running Go 1.5 from the master branch, version +64e48bb, on a Lubuntu x64 machine.

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.