https://github.com/Amjad50/plastic Skip to content Navigation Menu Toggle navigation Sign in * Product + GitHub Copilot Write better code with AI + Security Find and fix vulnerabilities + Actions Automate any workflow + Codespaces Instant dev environments + Issues Plan and track work + Code Review Manage code changes + Discussions Collaborate outside of code + Code Search Find more, search less Explore + All features + Documentation + GitHub Skills + Blog * Solutions By company size + Enterprises + Small and medium teams + Startups By use case + DevSecOps + DevOps + CI/CD + View all use cases By industry + Healthcare + Financial services + Manufacturing + Government + View all industries View all solutions * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} Amjad50 / plastic Public * Notifications You must be signed in to change notification settings * Fork 5 * Star 72 NES emulator in rust with egui and TUI License MIT license 72 stars 5 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 2 * Pull requests 0 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights Amjad50/plastic master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 375 Commits .github/workflows .github/ workflows images images plastic_core plastic_core plastic_tui plastic_tui plastic_ui plastic_ui test_roms test_roms .cirrus.yml .cirrus.yml .codecov.yml .codecov.yml .gitignore .gitignore CHANGELOG.md CHANGELOG.md Cargo.lock Cargo.lock Cargo.toml Cargo.toml LICENSE LICENSE README.md README.md View all files Repository files navigation * README * MIT license plastic NES emulator in Rust Build status codecov dependency status license Crates.io Version docs.rs Crates.io Version Crates.io Version plastic is a NES emulator built from scratch using Rust. This is a personal project for fun and to experience emulating hardware and connecting them together. * Building and installation + Installing + Building * Components * Interfaces + EGui UI + TUI * Controls + Keyboard + Gamepad * License * References Building and installation Installing You can install the latest version of plastic or plastic_tui using cargo: cargo install plastic cargo install plastic_tui Building If you want to experience the latest development version, you can build Plastic yourself. For example: cargo run --release Components * [*] 6502 CPU, all official and unofficial instructions with accurate timing (without BCD mode). * [*] Picture Processing Unit, almost accurate with some small timing issues that would not effect most games. * [*] Cartridge and INES file handling (still missing INES2.0) * [*] Mappers: + [*] Mapper 0 + [*] Mapper 1 + [*] Mapper 2 + [*] Mapper 3 + [*] Mapper 4 + [ ] Mapper 5 (Milestone) + [ ] Mapper 6 + [*] Mapper 7 + [ ] Mapper 8 + [*] Mapper 9 + [*] Mapper 10 + [*] Mapper 11 + [*] Mapper 66 * [*] Audio Processing Unit: + [*] 2 Pulse wave(square) + [*] Triangle + [*] Noise + [*] DMC + [*] IRQ support * [*] Controller: controllable using the keyboard and controller (tested with PS4 controller) Interfaces The main emulator is at plastic_core And its a struct NES, where the UI would clock it, and then take the resulting audio and pixel buffers to handle them. We have 2 UIs, one main and the other just for fun. EGui UI Simple ui built with egui Advantages 1. Very simple and easy to use immediate mode UI. TUI TUI demo This is just for fun, but it is actually working way better than I expected. Check the demo. If you have one of these terminals mentioned in this docs Then you will have a much better experience, since these terminals support detecting button Release, normally other terminals don't have this feature, so the input for this UI can be a bit wonky. I used gilrs for gamepad support and its working very nicely, keyboard on the other hand is not very responsive, so it is advised to use gamepad. Also since this uses one character for each pixel, it is advised to use the smallest font size your terminal emulator supports. Have fun. Controls In all the UI providers I followed the same controlling scheme, as well as the ability to reset through : Keyboard keyboard nes controller J B K A U Select I Start W Up S Down A Left D Right Gamepad gamepad (PS4) nes controller X B O A Select Select Start Start Button Up Up Button Down Down Button Left Left Button Right Right For now its static, and there is no way to change it except for doing it in the code, TODO later. License This project is under MIT license. NES is a product and/or trademark of Nintendo Co., Ltd. Nintendo Co., Ltd. and is not affiliated in any way with Plastic or its author References Most of the documentation for NES components can be found in the NES dev wiki For the CPU(6502), this has the instruction set, and I used Klaus2m5's tests for testing the CPU alone without the other NES components. About NES emulator in rust with egui and TUI Topics emulator rust terminal tui nes nes-emulator hacktoberfest ratatui Resources Readme License MIT license Activity Stars 72 stars Watchers 3 watching Forks 5 forks Report repository Releases 5 v0.3.1 Release Latest Oct 19, 2024 + 4 releases Contributors 2 * @Amjad50 Amjad50 Amjad Alsharafi * @dependabot[bot] dependabot[bot] Languages * Rust 100.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.