{"id":13580663,"url":"https://github.com/RamiHg/RustyBoy","last_synced_at":"2025-04-06T02:32:21.508Z","repository":{"id":137655207,"uuid":"49313020","full_name":"RamiHg/RustyBoy","owner":"RamiHg","description":"A Gameboy emulator written in Rust.","archived":false,"fork":false,"pushed_at":"2020-02-12T03:15:40.000Z","size":3180,"stargazers_count":233,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-05T19:44:12.658Z","etag":null,"topics":["emulator","gameboy","gameboy-emulator","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RamiHg.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","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}},"created_at":"2016-01-09T06:02:15.000Z","updated_at":"2024-08-26T15:09:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f843a69-5ef5-4b3f-8a67-428ac9f9393c","html_url":"https://github.com/RamiHg/RustyBoy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamiHg%2FRustyBoy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamiHg%2FRustyBoy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamiHg%2FRustyBoy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamiHg%2FRustyBoy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RamiHg","download_url":"https://codeload.github.com/RamiHg/RustyBoy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247426303,"owners_count":20937099,"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":["emulator","gameboy","gameboy-emulator","rust"],"created_at":"2024-08-01T15:01:54.064Z","updated_at":"2025-04-06T02:32:19.537Z","avatar_url":"https://github.com/RamiHg.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# RustyBoy\n\n![](https://github.com/RamiHg/RustyBoy/workflows/master%20(unstable)/badge.svg \"Master Branch Status\")\n![](https://github.com/RamiHg/RustyBoy/workflows/Latest%20Release%20(v1.1.0)/badge.svg \"Latest Release Status\")\n\nRustyBoy is a cycle-accurate Gameboy emulator written to be as close to the real hardware as\npossible.\n\nThe emulator is designed to mimic the environment of FPGA development. It is therefore not written\nfor speed or efficiency (but still runs pretty fast).\n\n## Getting Started\n\nRustyBoy works on any target supported by Rust. The audio backend works on Linux, Mac OS X, and\nWindows.\n\n### Prerequisites\n\ncmake is required in all platforms to build the 3rd-party audio backend (libsoundio). Install using\nyour favorite package manager: `sudo apt/brew/scoop install cmake`.\n\nIf you are still not able to build the audio dependencies, remove \"audio\" from the default features\nin `soc`.\n\n#### Linux\n\npkg-config and PulseAudio are required for audio playback on Linux. To install (on Debian-based\nsystems):\n\n```sh\nsudo apt install pkg-config pulseaudio\n```\n\n### Usage\n\nTo run a ROM:\n\n```bash\ncargo run --release -- path_to_rom.gb\n```\n\n## [1.1.0] What's New\n\nFull [changelog here](Changelog.md).\n\nAudio now works! Tested on Mac OS X and Windows. There are still some minor issues regarding some\nunimplemented features, but all-in-all, it works quite well. libsamplerate is used to accurately\ndownsample the audio to 48kHz.\n\nIf you are running into issues getting the audio dependencies to compile, simply remove \"audio\" from\nthe default feature set in soc/Cargo.toml.\n\nFixed a pretty gnarly bug regarding interrupt servicing.\n\nRustyBoy currently only supports MBC1 and MBC3 cartridges.\n\n## Implementation\n\n### CPU\n\nRustyBoy's CPU is based on a microcode specification that is completely written in a\n[Google Sheets document](https://docs.google.com/spreadsheets/d/1kMCDI1IlQtenE8m_Q8PhgFFZF4yk-pS-j0KrA0_e-DM/edit).\nThe document describes each opcode's t-cycle execution at the micro-code level.\n\nThe [microcode csv](soc/instructions.csv) is then read by the [asm compiler](soc/src/cpu/asm), which\nverifies and compiles the microcode into its [final structure](soc/src/cpu/micro_code.rs). This\nmicrocode is what is actually used **both** by the Rust emulator, **and** the FPGA CPU.\n\nThis has the interesting side-effect that the [CPU control unit](soc/src/cpu/control_unit.rs) is\nrelatively simple - almost 260 lines. Most of the heavy lifting is in the data!\n\n### GPU\n\nMost demoscene and video game ROMs that fully utilize the GPU rely on behavior that is accurate to\nthe T (no pun intended). Having a perfectly accurate CPU without an equally accurate GPU is like\ninstalling a race car engine in the body of a Lada - it's just not going to look very impressive.\n\nUnfortunately, most GPU behavior is undocumented. There are even slight edge-case differences\nbetween different revisions of the same model.\n\nBut due to recent [heroic efforts](https://www.youtube.com/watch?v=HyzD8pNlpwI) by researchers, I\nwas able to put together [something](soc/src/gpu.rs) that is fairly accurate. Watching that video\nshould give you a good understanding of about 90% of the GPU's inner workings.\n\n## Status\n\nAt this point, I consider the emulator to be feature-complete (except audio). It's (almost)\nperfectly cycle accurate; at least in the areas that I care about.\n\nIt passes all Blargh, all (but one) MooneyeGB, and almost all Wilbert Pol tests. See the\n[complete test status](docs/test_details.md) for a more detailed list of all passing/failing tests.\n\nOf course, passing unit tests is all fine and dandy. The real fun is being able to run demo-scene\nROMs (and video games). oh.gb and pocket.gb run almost flawlessly. Here is a montage of my favorite\nparts:\n\n\u003cp align=\"center\"\u003e\n    \u003cimage src=\"docs/rustyboy.gif\" /\u003e\n\u003c/p\u003e\n\n## License\n\nRustyBoy is currently released as GPLv3, because I see no reason why anyone would derive from it. If\nyou'd like a more permissive license, email me!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRamiHg%2FRustyBoy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRamiHg%2FRustyBoy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRamiHg%2FRustyBoy/lists"}