nintengo

一个用 Go 编写的 NES 模拟器。(An NES emulator written in Go)

  • Owner: nwidger/nintengo
  • Platform: Linux, Mac, Windows
  • License:: GNU General Public License v2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

nintengo

一个用 Go 编写的 NES 模拟器。

构建

Mac OS X/Linux/Windows

按照你的平台的官方安装说明安装 Azul3D。

go get -u github.com/nwidger/nintengo

WebAssembly

WebAssembly 支持需要 Go 1.11 或更高版本。

  1. 下载 nintengo
    go get -d -u github.com/nwidger/nintengo    
  2. 构建 wasm/nintengo.wasm
    <code>cd $GOPATH/src/github.com/nwidger/nintengo
    GOOS=js GOARCH=wasm go build -o wasm/nintengo.wasm .
    </code>
        
  3. 启动运行在 8000 端口的 web 服务器
    <code>cd $GOPATH/src/github.com/nwidger/nintengo/wasm
    go run serve.go -http :8000
    </code>
        
  4. 在浏览器中打开 http://localhost:8000 in your browser. Press the Choose File 按钮,选择要运行的 .nes 文件。

使用方法

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

控制(键)

z - A
x - B
Enter - 开始
右Shift - 选择
箭头键 - 上/下/左/右
p - 暂停/不暂停
n - 用p按周期/扫描线/帧切换步进。
r - 重置
q - 退出
F1 - 保存状态
F5 - 负载状态
F8 - 200% FPS (2倍快进)
F9 - 100% FPS
F10 - 75% FPS
F11 - 50% FPS
F12 - 25% FPS
` - 切换过扫描
1 - 256x240屏幕尺寸
2 - 512x480屏幕尺寸
3 - 768x720屏幕尺寸
4 - 1024x960屏幕尺寸
5 - 2560x1440屏幕尺寸
9 - 显示/隐藏背景
0 - 显示/隐藏精灵
小键盘0 - 切换所有通道的静音功能。
小键盘1 - 切换静音脉冲1通道
小键盘2 - 切换静音脉冲2通道
小键盘3 - 切换静音三角通道
小键盘4 - 切换静音通道
小键盘5 - 切换静音DMC通道。
l - 将图案表保存到左/右.jpg。
o - 切换CPU解码
i - 切换PPU解码
with -recorder=gif:
s - 开始录制到frame.gif
d - 停止记录
with -recorder=jpeg。
s - 将截图保存为frame.jpg
with -audio-recorder=wav:
小键盘-(减号)-- 开始录音到 audio.wav。
小键盘+(+) -- 停止录音。

支持

音频支持目前正在进行中。所有的音频通道都能以某种方式工作。

实现了电池备份保存,并以 .sav 文件扩展名保存到磁盘。

支持保存状态,并以 .nst 文件扩展名保存到磁盘。

Netplay

Nintengo 支持双人网络游戏,使用 -listen 和 -connect 命令行参数。使用时,玩家一启动 nintengo 并使用 -listen 标志让它侦听输入的连接。

nintengo -listen=:8080 FILE

然后玩家二使用 -connect 标志连接到玩家一,提供服务器的主机/端口。

nintengo -connect=192.168.1.110:8080

注意,玩家二不需要提供 FILE 参数。

Mappers

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

鸣谢

如果没有NE Sdev Wiki 和 EFnet 上 #nesdev 的好朋友们,这个项目是不可能完成的。

能够阅读其他 NES 模拟器的源代码也是非常有帮助的。以下是我最常参考的一个简短列表,尽管它可能不是完整的列表。


(The first version translated by vz on 2020.08.22)

Main metrics

Overview
Name With Ownernwidger/nintengo
Primary LanguageGo
Program languageMakefile (Language Count: 4)
PlatformLinux, Mac, Windows
License:GNU General Public License v2.0
所有者活动
Created At2014-01-21 01:26:23
Pushed At2020-09-19 17:45:15
Last Commit At2019-02-17 10:27:56
Release Count1
Last Release Namev0.1-alpha (Posted on )
First Release Namev0.1-alpha (Posted on )
用户参与
Stargazers Count1.3k
Watchers Count31
Fork Count52
Commits Count266
Has Issues Enabled
Issues Count5
Issue Open Count3
Pull Requests Count16
Pull Requests Open Count0
Pull Requests Close Count1
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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