GithubHelp home page GithubHelp logo

abhaynayar / n2t-wasm Goto Github PK

View Code? Open in Web Editor NEW
45.0 5.0 3.0 28.42 MB

Emulator for the Hack CPU.

License: MIT License

Rust 72.79% JavaScript 23.10% HTML 4.11%
wasm emulator pixels nand2tetris

n2t-wasm's Introduction

n2t-wasm

Emulator for the Hack CPU. (from nand2tetris)

Demo

https://abhaynayar.github.io/n2t-wasm/

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

Build 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.
  • 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

  • Feature: Add keyboard support.
  • Bug: Fix the render loop in wasm.
  • Bug: Sanitize RAM and ROM inputs in wasm.
  • Feature: Transfer words instead of pixels from wasm to js.
  • Feature: Show sample ROMs and a file picker on the web page.

n2t-wasm's People

Contributors

abhaynayar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

isgasho whitten

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.