https://github.com/abhaynayar/n2t-wasm Skip to content Sign up Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up Sign up {{ message }} abhaynayar / n2t-wasm * Notifications * Star 6 * Fork 0 Emulator for the nand2tetris computer. MIT License 6 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights main Switch branches/tags [ ] Branches Tags Nothing to show {{ refName }} default View all branches Nothing to show {{ refName }} default View all tags 1 branch 0 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/a] Use Git or checkout with SVN using the web URL. [gh repo clone abhayn] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @abhaynayar abhaynayar Merge branch 'main' of github.com:abhaynayar/n2t-wasm into main ... f5cc917 Apr 12, 2021 Merge branch 'main' of github.com:abhaynayar/n2t-wasm into main f5cc917 Git stats * 17 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time screen Adding demo screencast Apr 12, 2021 src Added ROM selection Apr 12, 2021 tests Initial commit Dec 31, 2020 www Added ROM selection Apr 12, 2021 .appveyor.yml Initial commit Dec 31, 2020 .cargo-ok Initial commit Dec 31, 2020 .gitignore Fast version restored Apr 11, 2021 .travis.yml Initial commit Dec 31, 2020 Cargo.toml Pong working fine Jan 25, 2021 LICENSE Fast version restored Apr 11, 2021 README.md Merge branch 'main' of github.com:abhaynayar/n2t-wasm into main Apr 12, 2021 View code n2t-wasm Demo Build Instructions Backlog README.md n2t-wasm Emulator for the nand2tetris computer. Demo https://abhaynayar.com/n2t-wasm/ [ezgif] Build Instructions Tested on Ubuntu 20.04 LTS. Tools setup: * Install rust: curl --proto '=https' --tlsv1.2 -sSf https:// sh.rustup.rs | sh * Install wasm-pack: curl https://rustwasm.github.io/wasm-pack/ installer/init.sh -sSf | sh * Install node through nvm: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash nvm install node Clone this repository: $ git clone https://github.com/abhaynayar/n2t-wasm Building the emulator: * Run wasm-pack build in the root directory. This will create a new pkg/ directory for the wasm modules. * Run npm init wasm-app www in the root directory. This will generate a web page in a new www/ directory. See if you already have a www/ directory. If so, you don't need to do create one. * Run npm install in www directory to install the node modules. * Run npm run start in the www directory to start a local testing instance. * Run npm run build in the www directory to publish the results to dist. Backlog * [ ] Bug: Fix keyboard responsiveness. * [ ] Bug: Sanitize RAM and ROM inputs in wasm. * [ ] Bug: Index of instruction should be within ROM size. * [ ] Bug: Crash when Rect.hack is running with RAM[0] > 513. * [ ] Feature: Support for Hack assembly not just machine code. * [ ] Feature: Separate targets for wasm and pixels. Shouldn't have to comment code. * [*] Feature: Add keyboard support. * [*] Bug: Fix the render loop in wasm. * [*] Feature: Transfer words instead of pixels from wasm to js. * [*] Feature: Show sample ROMs and a file picker on the web page. * [*] Bug: Only first key press is being registered. (=> keymap had to be zeroed) About Emulator for the nand2tetris computer. Resources Readme License MIT License Releases No releases published Packages 0 No packages published Languages * Rust 67.2% * JavaScript 24.0% * HTML 8.8% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. 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.