NES emulator

用 Go 编写的 NES 模拟器。(NES emulator written in Go.)

  • Owner: fogleman/nes
  • Platform: Linux, Mac, Windows
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

概要

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

标题屏幕

http://www.michaelfogleman.com/static/nes/

依赖性

<code>github.com/go-gl/gl/v2.1/gl
github.com/go-gl/glfw/v3.1/glfw
github.com/gordonklaus/portaudio
</code>

portaudio-go 依赖项需要在你的系统上安装 PortAudio。

要构建 portaudio-go,你必须先安装 PortAudio 的开发头和库。有些系统提供了这样的软件包,例如,在 Ubuntu 上,你可以运行 apt-get install portaudio19-dev。在其他系统上,你可能需要从源代码安装。

在 Mac 上,你可以使用 homebrew。

brew install portaudio

安装

go get 命令会自动获取上面列出的依赖项,编译二进制文件并将其放置在 $GOPATH/bin 目录下。

go get github.com/fogleman/nes

使用方法

nes [rom_file|rom_directory]。

如果没有指定参数,程序将在当前工作目录中查找 rom 文件。
如果指定了一个目录,程序将在该目录中查找 rom 文件。
如果指定了一个文件,程序将运行该 rom 文件。

对于1和2,程序将显示一个菜单屏幕来选择要播放的 rom 文件。缩略图是从在线数据库中下载的,并以 rom 文件的 md5 和为键。

控件

支持操纵杆,尽管按钮映射目前是硬编码的。下面是键盘控制。

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

Mappers

实现了以下的映射器:

  • NROM (0)
  • MMC1(1)
  • UNROM (2)
  • CNROM (3)
  • MMC3(4)
  • AOROM (7)

这些映射器覆盖了大约 85% 的 NES 游戏。我希望能尽快实现更多的映射器。要查看哪些游戏应该可以使用,请参考这个列表。

NES 映射器列表

已知问题

  • 在 PPU 的时间上有一些小问题,但大多数游戏都能正常运行。
  • APU 的模拟并不完美,但也不差。

文档

有兴趣编写自己的模拟器吗?对 NES 的内部结构很好奇?这里有一些不错的资源:


(The first version translated by vz on 2020.10.15)

Main metrics

Overview
Name With Ownerfogleman/nes
Primary LanguageGo
Program languageGo (Language Count: 1)
PlatformLinux, Mac, Windows
License:MIT License
所有者活动
Created At2015-03-02 22:16:13
Pushed At2024-08-17 18:24:23
Last Commit At2023-09-07 18:06:43
Release Count0
用户参与
Stargazers Count5.6k
Watchers Count142
Fork Count524
Commits Count204
Has Issues Enabled
Issues Count33
Issue Open Count7
Pull Requests Count13
Pull Requests Open Count4
Pull Requests Close Count7
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Summary

This is an NES emulator written in Go.

Screenshots

Screenshots

Title Screens

http://www.michaelfogleman.com/static/nes/

Dependencies

github.com/go-gl/gl/v2.1/gl
github.com/go-gl/glfw/v3.1/glfw
github.com/gordonklaus/portaudio

The portaudio-go dependency requires PortAudio on your system:

To build portaudio-go, you must first have the PortAudio development headers
and libraries installed. Some systems provide a package for this; e.g., on
Ubuntu you would want to run apt-get install portaudio19-dev. On other systems
you might have to install from source.

On Mac, you can use homebrew:

brew install portaudio

Installation

The go get command will automatically fetch the dependencies listed above,
compile the binary and place it in your $GOPATH/bin directory.

go get github.com/fogleman/nes

Usage

nes [rom_file