sarckk/rust-chip8

Chip-8 Emulator in Rust

install rust on your computer

Running the emulator for desktop

First, install rust on your computer.

Then run:

cargo run <file_path> [-d]

file_path is the path to the .ch8 file containing the opcodes. -d is an optional flag which enables debug mode:

Debug mode has several commands (type help):

USAGE: 
r        - run until next checkpoint
b <addr> - add breakpoint at address <addr>
ni       - execute next instruction
p        - print current state of CHIP-8
help     - print list of commands available

Currently, the web/programs/ directory contains several ROMs and their descriptions from here.

Key mapping

      Chip-8                           Keyboard
+────+────+────+────+            +────+────+────+────+     
| 1  | 2  | 3  | C  |            | 1  | 2  | 3  | 4  |
+────+────+────+────+            +────+────+────+────+
| 4  | 5  | 6  | D  |            | Q  | W  | E  | R  |
+────+────+────+────+     -->    +────+────+────+────+    
| 7  | 8  | 9  | E  |            | A  | S  | D  | F  |
+────+────+────+────+            +────+────+────+────+
| A  | 0  | B  | F  |            | Z  | X  | C  | V  |
+────+────+────+────+            +────+────+────+────+

Building for WASM

Additionally, we allow compiling to the wasm32-unknown-unknown target with wasm-bindgen. First, get wasm-pack here. After that, to build wasm binaries, run:

wasm-pack build

Running on browser

After generating the WASM binaries, go to /web, install depenencies with npm i and run:

npm run

Then go to localhost:8080 to view the result.

Credits

The /web directory was bootstrapped with npm init wasm-app.

Here are some helpful resources for getting started on Chip8 and WASM:

  • https://tobiasvl.github.io/blog/write-a-chip-8-emulator/
  • https://rustwasm.github.io/docs/book/

Information - Updated Sep 11, 2022

Stars: 0
Forks: 0
Issues: 0

Repositories & Extras

This is an example of a Rust server that functions as a remote schema for...

Rust + Hasura Rust server that functions as a Hasura

This is an example of a Rust server that functions as a remote schema for...

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

It is designed to be easily extendable and easy to use

Newport Engine is a modular 2D and 3D game engine built in Rust for Rust

liboqs-rust: Rust bindings for liboqs

Qyantum Safe liboqs rust bindings

liboqs-rust: Rust bindings for liboqs

msgflo-rust: Rust participant support for MsgFlo

Flowhub visual programming IDE

msgflo-rust: Rust participant support for MsgFlo
Actix

1.2K

How to be a full stack Rust Developer

Read Rust the Rust blog posts at Steadylearner

How to be a full stack Rust Developer

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

This is the place to translate Having a documentation in your native language is essential if you don't speak English, and still enjoyable even if...

Rust library translation (rust-src/rust-std/stdlib/rustlib translation)

False Positive for rust-lang/rust#83583

The deprecation lint proc_macro_derive_resolution_fallback is intended to catch proc macro generated code that refers to items from parent modules that should not be in scope:

False Positive for rust-lang/rust#83583

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling...

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling and

xbuild is a build tool for rust and rust/flutter projects with support for cross compiling...

Rust: setup Rust with rustup

wabt: --sysroot value in the Makefiles when using a different target localtion for wasi-sdk)

Rust: setup Rust with rustup

How to be a full stack Rust Developer

Read Rust the Rust blog posts at Steadylearner

How to be a full stack Rust Developer

Snake game developed in Rust using rust-sdl2 crate

Snake game developed in Rust using

Snake game developed in Rust using rust-sdl2 crate

This is a game engine for rust in rust

I'm building it as a learning experience to try and better understand rust and what goes into making a game engine

This is a game engine for rust in rust
Facebook Instagram Twitter GitHub Dribbble
Privacy