An NES emulator in Rust
Go to file
Henry Sloan cb1742e26f
Merge pull request #23 from henryksloan/audio-sync-fix
Improve audio sync with basic dynamic sampling
2023-08-20 13:07:03 -07:00
.github/workflows Temporarily simplify CI 2021-03-23 15:44:53 -04:00
apu Change NT and APU logic so 4-screen games work 2021-03-31 14:57:37 -04:00
cpu Add NMI delay and more unofficial instructions 2021-03-31 11:43:29 -04:00
memory Improve audio sync with basic dynamic sampling 2023-08-20 12:43:09 -07:00
nes Make iNES parsing more robust, and add mapper 71 2021-04-03 18:04:32 -04:00
ppu Fix counter overflows in dev profile 2021-03-26 10:23:56 -04:00
sdl-ui Add simple volume attenuation 2023-08-20 12:58:39 -07:00
windows-ui Add pause feature 2021-03-28 10:52:39 -04:00
.gitignore Initial commit 2021-01-31 18:00:44 -05:00
Cargo.lock Re-add simple, cross-platform UI 2021-03-24 18:40:30 -04:00
Cargo.toml Re-add simple, cross-platform UI 2021-03-24 18:40:30 -04:00
README.md Update README 2021-04-03 18:10:22 -04:00

KindNES

KindNES is a reasonably accurate NES emulator written in Rust. It strives for portability, performance, and a balance of hardware accuracy and codebase clarity. The code should pair well with NESdev as a resource for learning about the NES.

Usage

Either give a .NES ROM file as a command line argument, or use the File > Open ROM menu bar option (currently only on the Windows version).

Button Key Gamepad
D-Pad Arrow keys D-Pad or joystick
A button X A (Playstation X)
B button Z B (Playstation O)
Start Enter Start
Select Right shift Select

Downloads

Downloads can be found on the releases page. Currently, only the Windows version is packaged, so users of other platforms should build KindNES as described below. There are plans for Linux (AppImage) packages in the near future, and eventually MacOS packages.

Building

Dependencies

Both the Windows and cross-platform frontends require Rust-SDL2. To build the frontends, first check out the dependency instructions here: https://github.com/Rust-SDL2/rust-sdl2#sdl20-development-libraries

Windows

To run the native Windows frontend, run:

cargo run --release --bin windows-ui

To build a binary, run:

cargo build --release --bin windows-ui

This should produce a .exe file in target/release/. Place SDL2.dll from the runtime binary here in the same directory as the exe.

Linux, MacOS, etc.

To run the cross-platform frontend, run:

cargo run --release --bin sdl-ui <NES ROM file>

Replacing <NES ROM file> with a .nes file.

To build a binary, run:

cargo build --release --bin sdl-ui

This should produce an executable file in target/release/.

Progress

KindNES supports most of the common NES mappers, meaning that it supports the majority of licensed titles. Most supported games run smoothly with minimal glitches. The basic gameplay experience is in a semi-complete state, so progress moving forward will add UI/UX improvements and improved game/peripheral support.

Next steps

  • Improved UI
    • More menubar features
    • An improved cross-platform UI with the same menubar features as the Windows version
      • First priority: Centralize basic features like file dialogs to sdl-ui shortcuts
      • Still looking for a GUI framework with great menubar support and SDL2 integration
  • Saving
    • Safe panic handler that displays an error message and autosaves

Eventual goals

  • More mappers
  • Speed control
    • First, get perfect FPS control (it currently sleeps slightly too long at the end of frames)
    • Variable audio sample rate
  • Controls
    • Modifiable controls
    • Local multiplayer?

Stretch goals

  • Web version (likely using WebAssembly)
  • Mobile versions (possibly merged with web version?)
  • Netplay
  • Better hardware accuracy
    • Automated validation with test ROMs
  • Video filters
  • Extended controller support
    • Popup windows for R.O.B., etc.
    • Light gun with mouse
  • Debug features
    • PPU viewer
    • Sound channel mixer
    • Step-in debugger
      • A GDB-style command prompt would be awesome
  • Distinguish between hard and soft reset
  • Cheats
  • TAS creation