{"id":13731407,"url":"https://github.com/kgabis/agnes","last_synced_at":"2025-10-06T13:57:01.019Z","repository":{"id":53929875,"uuid":"176733561","full_name":"kgabis/agnes","owner":"kgabis","description":"NES emulation library with an easy to use API.","archived":false,"fork":false,"pushed_at":"2023-04-06T07:29:00.000Z","size":437,"stargazers_count":130,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T10:01:33.318Z","etag":null,"topics":["c","cpp","emulation","emulator","library","nes"],"latest_commit_sha":null,"homepage":"","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/kgabis.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["kgabis"]}},"created_at":"2019-03-20T12:54:40.000Z","updated_at":"2025-02-08T06:45:42.000Z","dependencies_parsed_at":"2024-11-07T14:01:11.991Z","dependency_job_id":"cdf0b854-730e-4dfd-a822-e79e5af1d6d6","html_url":"https://github.com/kgabis/agnes","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/kgabis%2Fagnes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgabis%2Fagnes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgabis%2Fagnes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgabis%2Fagnes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgabis","download_url":"https://codeload.github.com/kgabis/agnes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248589171,"owners_count":21129549,"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":["c","cpp","emulation","emulator","library","nes"],"created_at":"2024-08-03T02:01:29.505Z","updated_at":"2025-10-06T13:56:55.985Z","avatar_url":"https://github.com/kgabis.png","language":"C","funding_links":["https://github.com/sponsors/kgabis"],"categories":["Engines"],"sub_categories":[],"readme":"## About\nagnes is a NES emulation library written in C with an easy to use API. It consists of only 2 files (agnes.h and agnes.c).\n\n## Features\n* Only 2 files (agnes.h and agnes.c).\n* Easy to use.\n* MIT licensed.\n* Supports NROM, UxROM, MMC1 and MMC3 mappers.\n\n## API example\n```c\nagnes_t *agnes = agnes_make();\nagnes_load_ines_data(agnes, game_data, game_data_size);\nwhile (true) {\n    agnes_input_t input;\n    get_input(\u0026input);\n\n    agnes_set_input(agnes, \u0026input, NULL);\n\n    agnes_next_frame(agnes);\n\n    for (int y = 0; y \u003c AGNES_SCREEN_HEIGHT; y++) {\n        for (int x = 0; x \u003c AGNES_SCREEN_WIDTH; x++) {\n            agnes_color_t c = agnes_get_screen_pixel(agnes, x, y);\n            display_pixel(x, y, c);\n        }\n    }\n}\nagnes_destroy(agnes);\n```\n\nFull and working examples can be found in [examples directory](http://github.com/kgabis/agnes/tree/master/examples).\n\n## Screenshots\n\u003cp float=\"left\"\u003e\n    \u003cimg src=\"screens/smb.png\" alt=\"Super Mario Bros\" width=\"256\"/\u003e\n    \u003cimg src=\"screens/smb3.png\" alt=\"Super Mario Bros 3\" width=\"256\"/\u003e\n    \u003cimg src=\"screens/kirby.png\" alt=\"Kirby's Adventure\" width=\"256\"/\u003e\n    \u003cimg src=\"screens/radracer2.png\" alt=\"Rad Racer II\" width=\"256\"/\u003e \n    \u003cimg src=\"screens/contra.png\" alt=\"Contra\" width=\"256\"/\u003e \n    \u003cimg src=\"screens/dk.png\" alt=\"Donkey Kong\" width=\"256\"/\u003e \n\u003c/p\u003e\n\n## Installation\nRun:\n```\ngit clone https://github.com/kgabis/agnes.git\n```\nand copy agnes.h and agnes.c to you source code tree.\n\n## Testing\nRun ```run_tests.sh ROM_DIRECTORY``` (in tests directory) to compile and run tests.\n\nSince I cannot add roms to this project they must be downloaded manually. Please look at contents of [examples/recs.tar.gz](http://github.com/kgabis/agnes/tree/master/examples/recs.tar.gz) for names of roms that are required to run tests. Emulator testing roms (such as nestest.nes or official_only.nes) can be obtained from [here](https://wiki.nesdev.com/w/index.php/Emulator_tests). If you want to update add a recording or update an existing one run ```recorder``` (located in tests dir).\n\n## TODO\n* APU emulation.\n* Optimizations.\n* More mappers.\n* Being able to access CPU and PPU state using API.\n\n## Splitting and joining\nagnes.c can be split into separate files by running ```utils/split.py```:\n```bash\nutils/split.py --input agnes.c --output-path src\n```\n\nIt can be joined back into a single file with ```utils/join.py```:\n```bash\nutils/join.py --template utils/agnes.c.templ --path src --output agnes.c\n```\n\n## Contributing\nI will always merge *working* bug fixes. However, if you want to add something new to the API, please create an \"issue\" on github for this first so we can discuss if it should end up in the library before you start implementing it.  \n\n## Acknowledgements\n*[NesDev Wiki](http://wiki.nesdev.com/w/index.php/Nesdev_Wiki)*\n\nOther open-source NES emulators, that were extremely helpful as a reference:\n* https://github.com/fogleman/nes\n* https://github.com/AndreaOrru/LaiNES\n* https://github.com/ulfalizer/nesalizer/blob/master/src/ppu.cpp\n* https://github.com/daniel5151/ANESE\n\nAlso, many thanks to [Mateusz Belicki](https://github.com/mbelicki/) for all his suggestions and help.  \n\n## License\n[The MIT License (MIT)](http://opensource.org/licenses/mit-license.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgabis%2Fagnes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgabis%2Fagnes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgabis%2Fagnes/lists"}