{"id":22803155,"url":"https://github.com/tiansongyu/6502emulator","last_synced_at":"2025-06-24T19:33:54.247Z","repository":{"id":153929889,"uuid":"365672043","full_name":"tiansongyu/6502Emulator","owner":"tiansongyu","description":"NES模拟器(尽量还原硬件运行逻辑)","archived":false,"fork":false,"pushed_at":"2023-04-22T05:56:18.000Z","size":4558,"stargazers_count":39,"open_issues_count":2,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T13:51:10.250Z","etag":null,"topics":["cpu","emulator","fc","nes","nintendo","x86-x64"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiansongyu.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-09T05:09:05.000Z","updated_at":"2025-03-12T14:10:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7c788a5-6daa-4a20-88c5-134a69acb273","html_url":"https://github.com/tiansongyu/6502Emulator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansongyu%2F6502Emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansongyu%2F6502Emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansongyu%2F6502Emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiansongyu%2F6502Emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiansongyu","download_url":"https://codeload.github.com/tiansongyu/6502Emulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249824042,"owners_count":21330254,"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":["cpu","emulator","fc","nes","nintendo","x86-x64"],"created_at":"2024-12-12T09:42:16.933Z","updated_at":"2025-04-19T22:49:55.379Z","avatar_url":"https://github.com/tiansongyu.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NES 模拟器(Nintendo Entertainment System emulator)\n\n适用于Windows、UNIX、MAC平台的开源NES模拟器，为NES模拟器学习者提供与原NES机器高度相似的运行逻辑展示，源码并没有对运行速度进行优化，这也是为了保证高度还原NES运行机制的妥协。\n\n该项目旨在重现NES游戏机的运行机制，而不注重性能，如果想要学习性能强大的模拟器，可以参照以下模拟器源码,·[fceux](https://github.com/TASEmulators/fceux)、[jsnes(js)](https://github.com/bfirsh/jsnes)、[nes(go)](https://github.com/fogleman/nes)、[SimpleNES](https://github.com/amhndu/SimpleNES)等源码，这些模拟器皆具有较好的性能，但整体代码结构并不利于NES模拟器的学习，因为其中做了大量的性能优化，导致模拟器的运行机制与原机器大相径庭，所以本仓库源码更利于理解NES。\n\n### 控制器按键\n\n| Nintendo              | Emulator    |\n| --------------------- | ----------- |\n| Up, Down, Left, Right | W A S D     |\n| Start                 | T           |\n| Select                | Y           |\n| A                     | K           |\n| B                     | J           |\n| Reset                 | R           |\n\n### 功能键\n\n| function        | key       |\n|-----------------|-----------|\n| save game state | F1        |\n| load game state | F2        |\n| reset game      | Backspace |\n| change palette  | P         |\n\n## 实现的模块\n- BUS\n- Cartridge(卡带)\n- Mapper(0\\1\\2\\3\\4\\66)\n- 2A03(apu)\n- 2C02(ppu)\n- [6502(cpu)](https://github.com/tiansongyu/6502Emulator/blob/master/readme6502.md)\n\n## 编译环境配置\n\n### linux环境\n\n安装cmake\n``` bash \n# ubuntu\n# 安装opengl、alsa\nsudo apt install cmake mesa-common-dev libgl1-mesa-dev \\\nlibglu1-mesa-dev alsa-base alsa-utils alsa-source libasound2-dev libpng-dev -y\n\n```\n### windows\n\n安装vs2019\n## 编译\n\n### linux环境\n``` bash \ngit clone git@github.com:tiansongyu/6502Emulator.git \ncd 6502Emulator \nmkdir build  \ncd build \ncmake  -DCMAKE_BUILD_TYPE=Release .. \ncd 6502/6502Emulator/\nmake -j12 \n./6502Emulator\n```\n### Windows环境\n``` bash \ngit clone git@github.com:tiansongyu/6502Emulator.git \ncd 6502Emulator \nmake_VS2019.bat\n``` \n\n## 可游玩游戏\n\n每个游戏对应一个Mapper，只要实现游戏对应的Mapper，就可以游玩\n本模拟器实现的mapper有\n- Mapper0 (NROM)\n- Mapper1 (MMC1)\n- Mapper2 (UxROM)\n- Mapper3 ( CNROM )\n- Mapper4 (MMC3) 最复杂的一种Mapper，目前可能在存在中断问题，没有解决,metal max 中断不正确\n- Mapper66 (GxROM)  \n\n查看如下游戏列表，查看对应的Mapper，可以用来判断是否可游玩\n* [NES Mapper List](http://tuxnes.sourceforge.net/nesmapper.txt)\n\n0,1,2,3,4为任天堂自己生产的mapper，已经可以游玩大部分游戏，如想实现其他Mapper\n，可以查看[Mapper资料](https://wiki.nesdev.org/w/index.php?title=Mapper),并查看本仓库源码，可以找到实现其他mapper的方法。\n\n## 参考文档资料\n\n* [NES Reference Guide (Wiki)](https://wiki.nesdev.org/w/index.php?title=NES_reference_guide)\n* [6502官网](http://www.6502.org/)\n* [6502 CPU Reference](http://www.obelisk.me.uk/6502/reference.html)\n* [6502 CPU Instruction](https://www.masswerk.at/6502/6502_instruction_set.html)\n* [6502 在线指令实现](https://www.masswerk.at/6502/assembler.html)\n* [NES Documentation (PDF)](http://nesdev.com/NESDoc.pdf)\n\n\n### 其他开发工具\n* [NES Mapper List](http://tuxnes.sourceforge.net/nesmapper.txt)\n* [NES文件下载](https://wowroms.com/en/roms/nintendo-entertainment-system/)\n\n### 未实现功能\n\n- [6502 指令实现情况](https://trello.com/b/ll6HPTJ0/6502emulator)  \n- [NES模拟器功能实现情况](https://trello.com/b/hB8YJmU6/nes%E6%A8%A1%E6%8B%9F%E5%99%A8)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiansongyu%2F6502emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiansongyu%2F6502emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiansongyu%2F6502emulator/lists"}