wsandst/gameboy-emulator

CorrodedBoy, a Gameboy Emulator written in Rust

Try out the emulator online here!

Video showcase

CorrodedBoy is a Gameboy (DMG) Emulator written in Rust. The emulator has two available frontends: one native frontend using SDL2, and a web frontend (through WASM) written using Svelte. The emulator is decently accurate, but lacks certain CPU and GPU cycle accuracies.

Functionality

Tetris, Dr Mario and Super Mario Land, The Legend of Zelda: Link's Awakening and Pokemon Red have been tested and work well. Most other DMG games should also work.

Implemented parts:

  • Complete CPU implementation, lacking certain cycle accuracies. Passes the blargg cpu_instrs and instr_timing test ROMs, but not the mem_timing.
  • Complete GPU implementation, passes Acid2 test rom
  • Complete sound implementation
  • Interrupts
  • Timer
  • Joypad input
  • ROM-only, MBC1 and MBC3 rom support
  • Optional bootrom
  • Savestates using Serialization
  • CPU debugging tool
  • Native frontend (using SDL2)
  • Web frontend (through WASM, Canvas, WebAudio)

Test roms

Passing blargg cpu_instrs and instr_timing. Large refactor needed to pass mem_timing. Passes Acid2 GPU test (except for sprite x-ordering which has been intentionally left out due to planned future Gameboy Color support).

Frontend options

Native

Uses SDL2 in Rust for Graphics, Input and Sound.

Web

Compiles the emulator core to WASM and uses wasm-pack to create a NPM module interface to the emulator. This module is then used to create a Javascript frontend, which uses Canvas and WebAudio.

Build instructions

Native

cargo build --release --package gb-emulator-native
Run:
./target/release/gb-emulator-native

Web

cd frontend_web/site
npm install
Run (dev):
npm run dev
Build:
npm run build
The site will now be available under site/public

Key bindings

Key Action
W Up
S Down
A Left
D Right
Space or Z A
Shift or X B
Enter Start
Shift Select
Ctrl Speedup
P Pause/unpause
O Toggle audio
F1 Save Game
F2 Screenshot

Future work

  • Implement proper frequency modulation audio sync for web frontend
  • MBC RTC support (for Pokemon Gold)
  • Implement halting bug correctly
  • Implement proper FIFO GPU pipeline
  • Gameboy Color support

Resources

https://www.youtube.com/watch?v=HyzD8pNlpwI
https://gbdev.io/pandocs/
https://gbdev.gg8.se/wiki/articles/Main_Page
http://imrannazar.com/GameBoy-Emulation-in-JavaScript
https://izik1.github.io/gbops/

Information - Updated Aug 15, 2022

Stars: 0
Forks: 0
Issues: 0

Wasm template for Rust hosting without npm-deploy on github pages using Travis script

It automatically hosts your wasm projects on gh-pages using a travis script on the latest commit

Wasm template for Rust hosting without npm-deploy on github pages using Travis script

A rust github template for ease of use

Install the rust toolchain in order to have cargo installed by following

A rust github template for ease of use

📓 Relnotes: Automatic GitHub Release Notes

Tera templates for release notes format

📓 Relnotes: Automatic GitHub Release Notes

Rust-generated WebAssembly GitHub action template

A template to bootstrap the creation of a Rust-generated WebAssembly GitHub action

Rust-generated WebAssembly GitHub action template

cargo_auto_github_lib

Library for cargo-auto automation tasks written in rust language with functions for github

cargo_auto_github_lib

Renote is a CLI to extend GitHub operation experience, which is a complementary tool to...

Renote is a CLI to extend GitHub operation experience, which is a complementary tool to use with gh advanced search options

Renote is a CLI to extend GitHub operation experience, which is a complementary tool to...

Droid is a GitHub based package manager for unix systems

The goal is to create a way

Droid is a GitHub based package manager for unix systems

Droid is a GitHub based package manager for unix systems

The goal is to create a way

Droid is a GitHub based package manager for unix systems

This project builds a simple bdk-wasm based testnet wallet as a single page web app

be hosted locally or automatically deployed to GitHub Pages

This project builds a simple bdk-wasm based testnet wallet as a single page web app

Trying PhoneGap with Wasm with the game mem1

0 date: 2019-04-06 author: GitHub

Trying PhoneGap with Wasm with the game mem1

git clone [email protected]

でコンテナに入ってからやると良いです

git clone git@github
Facebook Instagram Twitter GitHub Dribbble
Privacy