{"id":26857140,"url":"https://github.com/ltriant/nes","last_synced_at":"2025-05-05T23:16:15.406Z","repository":{"id":31767969,"uuid":"128839522","full_name":"ltriant/nes","owner":"ltriant","description":"NES emulator","archived":false,"fork":false,"pushed_at":"2022-06-07T06:19:02.000Z","size":901,"stargazers_count":25,"open_issues_count":3,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T23:16:11.498Z","etag":null,"topics":["emudev","emulator","emulator-programming","emulators","gamedev","nes","nes-emulator","rust","sdl2"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ltriant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-09T22:08:55.000Z","updated_at":"2024-09-21T17:43:18.000Z","dependencies_parsed_at":"2022-07-09T19:00:51.637Z","dependency_job_id":null,"html_url":"https://github.com/ltriant/nes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriant%2Fnes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriant%2Fnes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriant%2Fnes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ltriant%2Fnes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ltriant","download_url":"https://codeload.github.com/ltriant/nes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590635,"owners_count":21772941,"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","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":["emudev","emulator","emulator-programming","emulators","gamedev","nes","nes-emulator","rust","sdl2"],"created_at":"2025-03-31T00:31:26.153Z","updated_at":"2025-05-05T23:16:15.386Z","avatar_url":"https://github.com/ltriant.png","language":"Rust","readme":"## nes\n\nA NES emulator, so that I can waste a lot of time playing old games, but also feel like I did something constructive.\n\nI've tried to keep the code as simple as possible, have included relevant links to [the NesDev Wiki](https://wiki.nesdev.com/w/index.php/Nesdev_Wiki) in the comments, and have added extra comments from other documentation sources in order to facilitate others in learning how the NES works.\n\nAn accompanying blog post can be read here: https://ltriant.github.io/2019/11/22/nes-emulator.html\n\n![It's dangerous to go alone. Take this!](zelda.gif)\n\n## Limitations\n\nOnly a subset of the full system has been emulated. The following limitations apply, in order of most likely to be fixed:\n\n1. Sunsoft 5B sound support isn't added, but the only game that uses the extra sound channels, Gimmick!, plays fine (and is awesome)\n2. No PAL cartridge support\n3. No second controller support\n\nThe following cartridge mappers are supported:\n\n1. NROM (mapper 0)\n2. MMC1/SxROM (mapper 1)\n3. UxROM (mapper 2)\n4. CNROM (mapper 3)\n5. MMC3/TxROM (mapper 4)\n6. AxROM (mapper 7)\n7. BxROM/NINA-001 (mapper 34)\n8. GxROM (mapper 66)\n9. Sunsoft-4 (mapper 68)\n10. Sunsoft FME-7/5a/5b (mapper 69)\n\n## Building and Running\n\n[SDL2](https://www.libsdl.org/) is required for the graphics, and it can be installed via many different package managers:\n\n```\n$ brew install sdl2\n$ sudo apt-get install libsdl2-dev\n$ sudo yum install SDL2-devel\n```\n\nOr see the [libsdl installation documentation](https://wiki.libsdl.org/Installation) for more options.\n\nThe emulator is written in Rust, so the easiest way to build it is with [Cargo](https://doc.rust-lang.org/cargo/).\n\n```\n$ cargo build --release\n```\n\nThe emulator can then be run by supplying the path to the ROM as an argument:\n\n```\n$ target/release/nes roms/donkey_kong.nes\n```\n\n## Controller 1 Keys\n\n```\nUp     -- W\nLeft   -- A\nDown   -- S\nRight  -- D\n\nA      -- N\nB      -- M\n\nStart  -- Enter\nSelect -- Space\n\nP      -- Pause\n\nF12    -- Reset\n```\n\n## Debugging Information\n\nSome graphical debugging information can be displayed by toggling the `NES_PPU_DEBUG` environment variable. At the moment this shows the palettes and the pattern table information.\n\n```\n$ NES_PPU_DEBUG=1 cargo run --release -- roms/donkey_kong.nes\n```\n\nTo get full CPU debugging output printed to standard output, the `NES_CPU_DEBUG` environment variable can be toggled.\n\n```\n$ NES_CPU_DEBUG=1 cargo run -- roms/donkey_kong.nes\n``` \n\nIn order to run the nestest ROM, the CPU debugging output can be combined with the `NES_CPU_NESTEST` environment variable to also start the program counter at 0xc000.\n\n```\n$ NES_CPU_NESTEST=1 NES_CPU_DEBUG=1 cargo run -- roms/nestest.nes\n``` \n\nEnabling of individual sound channels can be achieved with the `NES_APU_CHANNELS` environment variable. This value is an 8-bit bitmask with a bit for each channel and combinations of channels may be enabled this way. The bits are:\n\n```\nSquare 1 = 1\nSquare 2 = 2\nTriangle = 4\nNoise    = 8\nDMC      = 16\n```\n\nAs an example:\n\n```\n$ NES_APU_CHANNELS=5 cargo run --release roms/zelda.nes\n```\n\nThis will enable the first square wave channel, and the triangle wave.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltriant%2Fnes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fltriant%2Fnes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fltriant%2Fnes/lists"}