4 releases (2 breaking)

Uses new Rust 2024

new 0.3.0-beta.1 Nov 10, 2025
0.2.1 Mar 22, 2025
0.2.0 Oct 27, 2024
0.1.6 Sep 7, 2024
0.1.4 Jun 30, 2024

#56 in Emulators

Download history 182/week @ 2025-10-20 6/week @ 2025-10-27

188 downloads per month
Used in lorelei_simulator

GPL-3.0-only

1MB
21K SLoC

C 17K SLoC // 0.0% comments Bitbake 3K SLoC Rust 1K SLoC // 0.0% comments

safeboy

This crate provides a safe Rust wrapper for SameBoy, an accurate Game Boy emulator written in C.

What does it do?

  • Provides a thread-safe abstraction of SameBoy's interface
    • Most thread safety is statically provided by Rust's type system and borrow checker.
  • Provides an ergonomic callback API using Rust traits and dynamic dispatch
  • Provides a number of comfort types to help you use the crate, like Rust wrappers over the C types

Requirements

In order to use this crate, you need the following:

  • alloc must be available (std is not required)
  • usize must be at least 32 bits in width

Additionally, SameBoy must be able to compile for your target. Note that as it is building just the emulator core, itself, most of its requirements do not apply (e.g. SDL). You really just need a C compiler like GCC or Clang.

For Windows, you also do not need Visual Studio installed. You can use the i686-pc-windows-gnu and x86_64-pc-windows-gnu targets to build this crate, and cross-compiling should generally work.

Boot ROMs

Since only the emulator core is being compiled, none of the SameBoy boot ROMs will be provided. If you want those, you will need to compile those separately using rgbds.

Dependencies

~0–2.1MB
~42K SLoC