{"id":13514186,"url":"https://github.com/daniel5151/ANESE","last_synced_at":"2025-03-31T03:30:22.484Z","repository":{"id":40380488,"uuid":"106771696","full_name":"daniel5151/ANESE","owner":"daniel5151","description":"Another NES Emulator - written for fun \u0026 learning - first implementation of wideNES","archived":false,"fork":false,"pushed_at":"2022-01-11T22:34:57.000Z","size":44429,"stargazers_count":396,"open_issues_count":6,"forks_count":27,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-28T16:05:55.350Z","etag":null,"topics":["6502","apu","assembly","cmake","cross-platform","emulation","emulator","emulators","nes","nes-emulator","nestest","ppu","retro","sdl","sdl2"],"latest_commit_sha":null,"homepage":"http://prilik.com/ANESE","language":"C++","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/daniel5151.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-13T03:05:39.000Z","updated_at":"2025-01-31T08:21:25.000Z","dependencies_parsed_at":"2022-08-23T15:50:26.147Z","dependency_job_id":null,"html_url":"https://github.com/daniel5151/ANESE","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2FANESE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2FANESE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2FANESE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel5151%2FANESE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel5151","download_url":"https://codeload.github.com/daniel5151/ANESE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413377,"owners_count":20773053,"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":["6502","apu","assembly","cmake","cross-platform","emulation","emulator","emulators","nes","nes-emulator","nestest","ppu","retro","sdl","sdl2"],"created_at":"2024-08-01T05:00:49.135Z","updated_at":"2025-03-31T03:30:22.478Z","avatar_url":"https://github.com/daniel5151.png","language":"C++","funding_links":[],"categories":["Home Game Console Emulators","Nintendo Entertainment System/Famicom"],"sub_categories":["Nintendo"],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://prilik.com/ANESE\"\u003e\n    \u003cimg height=\"128px\" src=\"resources/icons/anese.ico\"\n      alt=\"ANESE Logo\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/daniel5151/ANESE/actions?query=branch%3Amaster\"\u003e\n    \u003cimg src=\"https://github.com/daniel5151/ANESE/workflows/CI/badge.svg?branch=master\"\n      alt=\"Build Status GitHub Actions\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://ci.appveyor.com/project/daniel5151/anese\"\u003e\n    \u003cimg src=\"https://ci.appveyor.com/api/projects/status/qgy19m8us3ss6ilt?svg=true\"\n      alt=\"Build Status Windows\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/daniel5151/ANESE\"\u003e\n    \u003cimg src=\"https://travis-ci.org/daniel5151/ANESE.svg?branch=master\"\n      alt=\"Build Status macOS/Linux\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n**ANESE** (**A**nother **NES** **E**mulator) is a Nintendo Entertainment System\nEmulator written for fun and learning.\n\nAccuracy and performance are long-term goals, but the primary focus is getting\npopular titles up and running. There are still a lot of bugs, but many games are\nworking quite well already.\n\nANESE is _cross-platform_, and is regularly tested on macOS, Windows, and Linux.\n\nANESE core uses clean and _interesting_ C++11, emphasizing _readability_,\n_maintainability_, and _approachability_. It is well commented, providing\nin-line sources and insights for much of the implementation. It is also\ndependency free (aside from stdlib), making it easy to embed in other projects.\n\n## WideNES\n\n**wideNES** is a novel technique that can automatically \"map-out\" levels and\nworlds in NES games. Check out the [wideNES Readme](/ANESE/wideNES) for details.\n\nA GIF is worth a 1000 words:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"resources/web/wideNES_metroid.gif\" alt=\"wideNES on Metroid\"\u003e\n\u003c/p\u003e\n\nPretty cool huh? Here's another one:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"resources/web/wideNES_smb1.gif\" alt=\"wideNES on SMB1\"\u003e\n\u003c/p\u003e\n\n## Downloads\n\nOfficial releases of ANESE can be found on the Releases tab on GitHub.\n\nAlternatively, for the most up-to-date version of ANESE, nightly builds are\navailable. These are compiled directly from the latest ANESE commit, so there\nmay/will be bugs.\n\n**Windows:** You can download builds of ANESE from\n[AppVeyor](https://ci.appveyor.com/project/daniel5151/anese)'s build artifacts\npage.\n\n**macOS:** Travis uploads ANESE.app bundles to\n[this GDrive folder](https://drive.google.com/drive/folders/1GWiinQ4tjDSZlhjReVMdElwK1b-Zvagf).\n\n## Building\n\n### Dependencies\n\nANESE's emulation core (src/nes) doesn't have any major dependencies, but the UI\ndoes use a couple. Most of these dependencies are bundled with ANESE\n(see: /thirdparty), although some require additional installation:\n\n- **SDL2** (video/audio/controls)\n  - _Linux_: `apt-get install libsdl2-dev` (on Ubuntu)\n  - _MacOS_: `brew install SDL2`\n  - _Windows_:\n    - Download dev libs from [here](https://www.libsdl.org/download-2.0.php) and\n      unzip them somewhere.\n    - EITHER: Set the `SDL` environment variable to point to the dev libs\n    - OR: Unzip them to `C:\\sdl2\\` (Where I put them)\n    - OR: Modify the `SDL2_MORE_INCLUDE_DIR` variable in `CMakeLists.txt` to\n      point to the SDL2 dev libs\n\n### Generating + Compiling\n\nANESE builds with **CMake**\n\nOn macOS / Linux\n```bash\n# in ANESE root\nmkdir build\ncd build\ncmake ..\nmake\n\nmake install # on macOS: creates ANESE.app in ANESE/bin/\n```\n\nOn Windows:\n```bat\nmkdir build\ncd build\ncmake ..\nmsbuild anese.sln /p:Configuration=Release\n```\n\n## Running\n\nANESE opens to a directory-browser, from which ROMs can be launched.\n\nANESE can run from the shell using `anese [rom.nes]` syntax. Certain features\nare _only_ accessible from the command-line at the moment (e.g: movie recording\n/ playback, PPU timing hacks). For a full list of switches, run `anese -h`\n\n**Windows Users:** make sure the executable can find `SDL2.dll`! Download the\nruntime DLLs from the SDL website, and plop them in the same directory as\nanese.exe\n\n## Mappers\n\nMost popular Mappers are implemented:\n\n \\#  | Name  | Some Games\n-----|-------|--------------------------------------------------\n 000 | NROM  | Super Mario Bros. 1, Donkey Kong, Duck Hunt\n 001 | MMC1  | Legend of Zelda, Dr. Mario, Metroid\n 002 | UxROM | Megaman, Contra, Castlevania\n 003 | CNROM | Arkanoid, Cybernoid, Solomon's Key\n 004 | MMC3  | Super Mario Bros 2 \u0026 3, Kirby's Adventure\n 007 | AxROM | Marble Madness, Battletoads\n 009 | MMC2  | Punch Out!!\n\nFeel free to open a PR for any mappers you implement :)\n\n## Controls\n\nCurrently hard-coded to the following:\n\nButton | Key         | Controller\n-------|-------------|------------\nA      | Z           | X\nB      | X           | A\nStart  | Enter       | Start\nSelect | Right Shift | Select\nUp     | Up arrow    | D-Pad\nDown   | Down arrow  | D-Pad\nLeft   | Left arrow  | D-Pad\nRight  | Right arrow | D-Pad\n\nAny xbox-compatible controller should work.\n\nThere are also a couple of emulator actions:\n\nAction             | Key                  | Controller\n-------------------|----------------------|-------------------------\nPause / Open Menu  | Esc                  | Left Thumbstick Button\nReset              | Ctrl - R             |\nPower Cycle        | Ctrl - P             |\nToggle CPU logging | Ctrl - C             |\nSpeed +25%         | Ctrl - =             |\nSpeed -25%         | Ctrl - -             |\nFast-Forward       | Space                | Right Thumbstick Button\nMake Save-State    | Ctrl - (1-4)         |\nLoad Save-State    | Ctrl - Shift - (1-4) |\n\n(there are 4 save-state slots)\n\n## DISCLAIMERS\n\n- ANESE is not the best emulator out there, far from it! Expect bugs!\n- My APU uses a naive sampling algorithm with a basic lookup table grafted from\nthe nesdev wiki. The `blargg-apu` branch has an older version of ANESE that uses\nBlargg's awesome `nes_snd_emu` library for the APU, and while my integration was\na bit unstable at times, it did sound a lot better when it did work.\n- The CPU is _instruction-cycle_ accurate, but not _sub-instruction cycle_\naccurate. While this inaccuracy doesn't affect most games, there are some that\nthat rely on sub-instruction level timings (eg: Solomon's Key).\n  - The `--alt-nmi-timing` flag might fix some of these games.\n\n## TODO\n\nThese are features that will add major value to ANESE:\n\n- [ ] _Implement_: Cycle accurate CPU (will probably fix _many_ bugs)\n- [ ] _Implement_: Better menu (not just fs, also config)\n- [ ] _CMake_: more robust macOS bundles (good way to get SDL2.0 packaged?)\n- [ ] _Implement_: LibRetro Core\n- [ ] _Implement_: Get the Light-gun working\n- [ ] _Debugging_: Add debug GUI\n  - All objects implementing the Memory interface _must also_ implement `peek`,\n    i.e: a `const` read. As such, a debugger could easily inspect any/all memory\n    locations with no side effects!\n\nHere's a couple that have been crossed off already:\n\n- [x] _Implement_: My own APU (don't use Blarrg's)\n- [x] _Refactor_: Modularize `main.cc` - push everything into `src/ui/`\n  - [x] _Refactor_: Split `gui.cc` into more files!\n- [x] _Refactor_: Push common mapper behavior to Base Mapper (eg: bank chunking)\n\nAnd here are some ongoing low-priority goals:\n\n- [ ] _Refactor_: Roll-my-own Sound_Queue (SDL_QueueAudio?)\n- [ ] _Cleanup_: Unify naming conventions (either camelCase or snake_case)\n- [ ] _Cleanup_: Comment the codebase _even more_\n- [ ] _Security_: Actually bounds-check files lol\n- [ ] _Cleanup_: Conform to the `.fm2` movie format better\n- [ ] _Cleanup_: Remove fatal asserts (?)\n- [ ] _Cleanup_: Switch to a better logging system\n               (\\*cough\\* not fprintf \\*cough\\*)\n\n## Roadmap\n\n### Key Milestones\n\n- [x] Parse iNES files\n- [x] Create Cartridges (iNES + Mapper interface)\n- [x] CPU\n  - [x] Set Up Memory Map\n  - [x] Hardware Structures (registers)\n  - [x] Core Loop / Basic Functionality\n    - [x] Read / Write RAM\n    - [x] Addressing Modes\n    - [x] Fetch - Decode - Execute\n  - [x] Official Opcodes Implemented\n  - [x] Handle Interrupts\n- [x] PPU\n  - [x] Set Up Basic Rendering Context (SDL)\n  - [x] Implement Registers + Memory Map them\n  - [x] Implement DMA\n  - [x] Generate NMI -\u003e CPU\n  - [x] Core rendering loop\n    - [x] Background Rendering\n    - [x] Sprite Rendering - _currently not hardware accurate_\n    - [x] Proper Background / Foreground blending\n  - [x] Sprite Zero Hit\n  - [ ] Misc PPU flags (emphasize RGB, Greyscale, etc...)\n- [x] APU\n  - [x] Implement Registers + Memory Map them\n  - [ ] Frame Timer IRQ - _kinda_\n  - [x] Set Up Basic Sound Output Context (SDL)\n  - [x] Channels\n    - [x] Pulse 1\n    - [x] Pulse 2\n    - [x] Triangle\n    - [x] Noise\n    - [x] DMC\n  - [x] DMC DMA\n- [ ] Joypads\n  - [x] Basic Controller\n  - [ ] Zapper - _still needs work_\n  - [ ] NES Four Score\n\n### Secondary Milestones\n\n- [x] Loading Files with picker\n- [x] Reset / Power-cycle\n- [x] Fast Forward\n- [x] Run / Pause\n- Saving\n  - [x] Battery Backed RAM - Saves to `.sav`\n  - [x] Save-states\n    - [ ] Dump to file\n- [x] Config File\n  - [x] Preserve ROM path\n  - [x] Window size\n  - [ ] Controls\n- [x] Running NESTEST (behind a flag)\n- [x] Controller support - _currently very basic_\n- [x] A SDL GUI\n  - [x] SDL-based ROM picker\n  - [ ] Options menu\n\n### Tertiary Milestones (Fun Features!)\n\n- [x] Zipped ROM support\n- [ ] Rewind\n- [ ] Game Genie\n- [x] Movie recording and playback\n- [ ] More ROM formats (not just iNES)\n- [ ] Proper PAL handling?\n- [ ] Proper NTSC artifacting?\n- Multiple Front-ends\n  - [x] SDL Standalone\n  - [ ] LibRetro\n- [ ] Debugger!\n  - [ ] CPU\n    - [ ] Step through instructions\n  - [x] PPU Views\n    - [x] Static Palette\n    - [x] Palette Memory\n    - [x] Pattern Tables\n    - [x] Nametables\n    - [ ] OAM memory\n\n### Accuracy \u0026 Compatibility\n\n- More Mappers! Always more mappers!\n- [ ] Add automatic testing\n  - [ ] Screenshots: compare power-on with 30 seconds of button mashing\n  - [ ] Test ROMs: Parse debug outputs\n- CPU\n  - [ ] Implement Unofficial Opcodes\n  - [ ] Pass More Tests\n  - [ ] _\\(Stretch\\)_ Switch to sub-instruction level cycle-based emulation\n        (vs instruction level)\n- PPU\n  - [x] Make the sprite rendering pipeline more accurate (fetch-timings)\n  - [ ] Pass More Tests\n  - [ ] Make value in PPU \u003c-\u003e CPU bus decay?\n\n## Attributions\n\n- A big shout-out to [LaiNES](https://github.com/AndreaOrru/LaiNES) and\n[fogleman/nes](https://github.com/fogleman/nes), two solid NES emulators that I\nreferenced while implementing some particularly tricky parts of the PPU). While\nI actively avoided looking at the source codes of other NES emulators while\nwriting my initial implementations of the CPU and PPU, I did sneak a peek at how\nothers solved some problems once I got stuck.\n- These awesome libraries are used throughout ANESE's UI and in WideNES:\n  - [cfg_path](https://github.com/Malvineous/cfgpath) - cross-platform config file\n  - [clara](https://github.com/catchorg/Clara) - argument Parsing\n  - [cute_headers](https://github.com/RandyGaul/cute_headers/) - cross-platform directory browsing\n  - [miniz](https://github.com/richgel999/miniz) - zipped ROM support\n  - [sdl2](https://www.libsdl.org/) - A/V and Input\n  - [SDL_inprint](https://github.com/driedfruit/SDL_inprint/) - SDL fonts, without SDL_ttf\n  - [simpleini](https://github.com/brofield/simpleini) - ini config parsing / saving\n  - [stb](https://github.com/nothings/stb) - image loading / writing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel5151%2FANESE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel5151%2FANESE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel5151%2FANESE/lists"}