{"id":16717503,"url":"https://github.com/firobe/nes-ml","last_synced_at":"2025-10-10T01:05:36.944Z","repository":{"id":74791615,"uuid":"136242338","full_name":"Firobe/nes-ml","owner":"Firobe","description":"NES emulator in OCaml","archived":false,"fork":false,"pushed_at":"2023-07-21T13:43:29.000Z","size":4493,"stargazers_count":38,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T00:41:24.414Z","etag":null,"topics":["emulator","nes","ocaml"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Firobe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-05T22:38:56.000Z","updated_at":"2025-03-14T17:16:40.000Z","dependencies_parsed_at":"2024-05-06T00:15:13.022Z","dependency_job_id":null,"html_url":"https://github.com/Firobe/nes-ml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Firobe/nes-ml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fnes-ml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fnes-ml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fnes-ml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fnes-ml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firobe","download_url":"https://codeload.github.com/Firobe/nes-ml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firobe%2Fnes-ml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002409,"owners_count":26083373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emulator","nes","ocaml"],"created_at":"2024-10-12T21:32:10.873Z","updated_at":"2025-10-10T01:05:36.929Z","avatar_url":"https://github.com/Firobe.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nes-ml\n\n\u003cp float=\"center\"\u003e\n  \u003cimg alt=\"Mario Bros\" src=\"screens/mario_bros.png\" width=\"30%\"/\u003e\n  \u003cimg alt=\"Metal Gear\" src=\"screens/metal_gear.png\" width=\"30%\"/\u003e\n  \u003cimg alt=\"Prince of Persia\" src=\"screens/prince_of_persia.png\" width=\"30%\"/\u003e\n\u003c/p\u003e\n\nA NES emulator from scratch in OCaml (and with sound). Still in development (see [development status](#development-status)).\n\n![CI](https://github.com/Firobe/nes-ml/actions/workflows/build.yml/badge.svg)\n\n## Build \u0026 Install\n\nAssuming you have `opam` installed with an existing switch, either:\n- add a pin to this repo: \n   \u003e `opam pin add nes-ml https://github.com/Firobe/nes-ml.git`\n\n- or clone and run\n  \u003e `opam install .`\n\nThis will fetch the libraries (two of them are unreleased and will need pins), build and install the emulator.\nThe executable name is `nes-ml`.\n\nNote: I recommend using a build with `flambda` activated for more performance.\n\n## Usage\n\nUse : `nes-ml PATH_TO_ROM`  \n\nSee `nes-ml --help` for a list of useful options\n\n### Controls (hard-coded)\n\n| Function | Keyboard key |\n| --- | --- |\n| A button | S |\n| B button | D |\n| Left arrow | ← |\n| Right arrow | → |\n| Up arrow | ↑ |\n| Down arrow | ↓ |\n| Start | ⏎ (return) |\n| Select | ⌫ (backspace) |\n| Toggle GUI | Escape |\n| Save state in slot `N` | `N` |\n| Load state from slot `N` | Shift+`N` |\n| Toggle debugging windows | Home |\n\nNote that the `N` for save states must be 1, 2 or 3.\n\n## Development status\n\n- **Cycle-accurate CPU** (see [`6502-ml`](https://github.com/Firobe/6502-ml))\n- **Cycle-accurate PPU** (graphics) (with rough edges)\n- Partially implemented cycle-accurate **APU** (sound) (with rough edges)\n- Multiple **save states**\n- Implemented mappers: 0, 2\n- Barebones GUI (with debugging windows showing the internal PPU state)\n- Movie (input log) recording and replaying (in custom format with subframe precision)\n- Ability to record video (lossless `mp4`) of runs with ffmpeg\n- Headless mode for automatic tests\n\n## Next steps\n\n- Implement mappers 1, 4\n\n## Based on\n\n- separate CPU library: [`6502-ml`](https://github.com/Firobe/6502-ml)\n- fixed-size int literals: [`stdint-literals`](https://github.com/Firobe/ocaml-stdint-literals)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Fnes-ml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirobe%2Fnes-ml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirobe%2Fnes-ml/lists"}