Skip to content

Firobe/nes-ml

Repository files navigation

nes-ml

Mario Bros Metal Gear Prince of Persia

A NES emulator from scratch in OCaml (and with sound). Still in development (see development status).

CI

Build & Install

Assuming you have opam installed with an existing switch, either:

  • add a pin to this repo:

    opam pin add nes-ml https://github.com/Firobe/nes-ml.git

  • or clone and run

    opam install .

This will fetch the libraries (two of them are unreleased and will need pins), build and install the emulator. The executable name is nes-ml.

Note: I recommend using a build with flambda activated for more performance.

Usage

Use : nes-ml PATH_TO_ROM

See nes-ml --help for a list of useful options

Controls (hard-coded)

Function Keyboard key
A button S
B button D
Left arrow
Right arrow
Up arrow
Down arrow
Start ⏎ (return)
Select ⌫ (backspace)
Toggle GUI Escape
Save state in slot N N
Load state from slot N Shift+N
Toggle debugging windows Home

Note that the N for save states must be 1, 2 or 3.

Development status

  • Cycle-accurate CPU (see 6502-ml)
  • Cycle-accurate PPU (graphics) (with rough edges)
  • Partially implemented cycle-accurate APU (sound) (with rough edges)
  • Multiple save states
  • Implemented mappers: 0, 2
  • Barebones GUI (with debugging windows showing the internal PPU state)
  • Movie (input log) recording and replaying (in custom format with subframe precision)
  • Ability to record video (lossless mp4) of runs with ffmpeg
  • Headless mode for automatic tests

Next steps

  • Implement mappers 1, 4

Based on

About

NES emulator in OCaml

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages