Boytacean - Game Boy Emulator

Boytacean is a Game Boy and Game Boy Color emulator written in the Rust programming language. This project, intended primarily for educational purposes, emulates a wide range of Game Boy features and supports various front-ends, including web, SDL, and Libretro.

Boytacean Boytacean

Features

Boytacean offers a comprehensive set of features:

  • Game Boy (DMG) and Game Boy Color (CGB) emulation
  • Simple and navigable source code
  • Front-ends: Web, SDL, and Libretro
  • Audio: Accurate APU emulation
  • Serial Data Transfer: Supports Link Cable
  • Game Boy Printer emulation
  • Multiple Memory Bank Controllers (MBC): MBC1, MBC3, and MBC5
  • Save state support: Using the BESS Specification for cross-compatibility with other emulators
  • Cheat support: Compatible with Game Genie and GameShark codes
  • Variable CPU clock speed
  • Accurate PPU: Passes dmg-acid2 and cgb-acid2 tests

Web Front-End Features

The web front-end provides additional functionalities:

  • Mobile-first experience
  • Transparent RAM saving: Using Web Storage API
  • GamePad support: Via Web Gamepad API
  • On-screen GamePad: Unobstructive and effective
  • Rumble emulation and haptic feedback
  • Custom display palettes: Created by TheWolfBunny64
  • Fullscreen browser mode
  • Debug mode: View VRAM and registers

Missing Features

There are still some features under development:

  • Low-level cycle accurate system emulation
  • Game Boy Camera emulation
  • NetPlay gaming support

Deployments

Boytacean is available on several deployment platforms:

ProviderStableURL
CloudflareTrueboytacean.joao.me
CloudflareTrueboytacean.pages.dev
CloudflareTrueprod.boytacean.pages.dev
CloudflareTruestable.boytacean.pages.dev
CloudflareFalsemaster.boytacean.pages.dev

Building Boytacean

Library

To build the library:

cargo build

Python Library

Install the Python library with:

pip install .

or

python setup.py install

WASM for Node.js

Build the WebAssembly package for Node.js:

cargo install wasm-pack
wasm-pack build --release --target=nodejs -- --features wasm

WASM for Web

Build the WebAssembly package for the web:

cargo install wasm-pack
wasm-pack build --release --target=web --out-dir=frontends/web/lib -- --features wasm
cd frontends/web
npm install && npm run build
cd dist && python3 -m http.server

Web Front-End Configuration

The web front-end uses EmuKit, a UI toolkit for creating emulation interfaces in a web context. You can control the emulator's initial behavior with the following GET parameters:

ParameterTypeDescription
rom_urlStringURL of the initial ROM to load (must support CORS).
urlStringAlias for rom_url.
fullscreenBooleanIf true, starts the emulator in fullscreen mode.
fsBooleanAlias for fullscreen.
debugBooleanIf true, starts with the debugger visible.
keyboardBooleanIf true, shows the on-screen keyboard.
paletteStringName of the initial palette (e.g., christmas, hogwards, mariobros).

Palettes

The palettes available in the web version were provided by TheWolfBunny64.

Inspiration

For information about the resources that inspired the creation of Boytacean, see the Inspiration page.

Similar Projects