langurmonkey/playkid
1
0
Fork
You've already forked playkid
0
A Game Boy emulator and debugger written in Rust https://tonisagrista.com/projects/playkid
  • Rust 100%
Find a file
2026年02月12日 09:18:38 +01:00
.github/workflows fix: release.yml, again?. 2026年01月28日 12:13:03 +01:00
.idea fix: debug instructions step-by-step and fix errors. 2024年10月29日 15:50:11 +01:00
.vscode feat: some more work on the PPU. 2024年11月16日 19:10:38 +01:00
img feat: Add toasts for various actions. 2026年01月27日 13:30:38 +01:00
src fix: Remove unused import. 2026年02月12日 09:18:38 +01:00
.gitignore feat: initial import. WIP. 2024年10月15日 15:44:22 +02:00
.project feat: background render works now. 2024年11月12日 12:34:13 +01:00
Cargo.lock feat: Use egui_notify instead of egui_toast to be able to dismiss old toasts. 2026年02月01日 20:24:02 +01:00
Cargo.toml feat: Use egui_notify instead of egui_toast to be able to dismiss old toasts. 2026年02月01日 20:24:02 +01:00
LICENSE feat: Almost done. 2026年01月23日 15:21:27 +01:00
README.md fix: Readme. 2026年01月28日 19:07:49 +01:00

Play Kid is yet another Game Boy emulator, written in Rust. But hey, it is MY Game Boy emulator, and I'm proud of it.

Here are the main features of Play Kid:

  • All CPU instructions implemented.
  • Full memory map implemented.
  • Modes: ROM, MBC1, MBC2, MBC3.
  • Audio is implemented, with 4 channels, envelopes, sweep, and stereo.
  • Supports game controllers.
  • Multiple color palettes.
  • Save screenshot of current frame buffer.
  • FPS counter.
  • Respects 160:144 aspect ratio by letter-boxing.
  • Debug panel:
    • Step instruction.
    • Step scanline.
    • Pause/continue current execution.
    • Displays internal state of CPU, PPU, and Joypad.
    • Full program disassembly, with breakpoints.
  • Save RAM to .sav files to emulate the battery-backed SRAM. Those are saved every minute.
  • Working games/roms:
    • Passes dmg-acid2
    • Tetris
    • Pokémon
    • Super Mario Land
    • Super Mario Land 2: 6 Golden Coins
    • Wario Land (Super Mario Land 3)
    • Wario Land II
    • Bugs Bunny Crazy Castle
    • The Amazing Spider-Man
    • Dr. Mario
    • Probably many, many more
  • Works on Linux, macOS, and Windows.

Download

The easiest way to run Play Kid is getting the package for your operating system:

Build

Build the project with cargo build.

Run

The usual Rust stuff.

 cargo run

You can also pass in a ROM file with cargo run -- your-rom.gb.

Make the binary with:

 cargo build --release

Operation

If you don't pass in any ROM file as an argument, you need to select using the top menu bar, FileOpen ROM....

Here are the Joypad keyboard mappings:

  • enter - Start button
  • space - Select button
  • a - A button
  • b - B button

The keyboard is clumsy for playing Game Boy games, so you can use any game controller. Controllers are detected when hot-plugged. Use LB and RB to cycle through different palettes.

Additionally, there are some more actions available:

  • p - cycle the palette colors
  • w - trigger the SRAM save operation to .sav file.
  • s - save a screenshot, with name screenshot_[time].jpg
  • d - toggle debug panel
  • f - toggle FPS monitor
  • r - reset the CPU
  • Esc - exit the emulator

You can also use the provided UI.

Debug panel

You can open the debug panel any time by pressing d, by clicking on MachineDebug panel..., or activate it at launch with the -d/--debug flag. The debug panel shows up to the right. It provides a view of the internal state of the emulator, with:

  • Current address, instruction, operands, and opcode, to the top.
  • Internal state of CPU, PPU, and JOYP, to the left.
  • Disassembly of the program, to the right.
  • Breakpoints.

You can use the provided UI controls to work with debug mode. You can also use the keyboard. These are the key bindings:

  • F6 - step a single instruction
  • F7 - step a scanline
  • F9 - continue execution until breakpoint (if paused), or pause execution (if running)
  • d - exit debug mode and go back to normal full-speed emulation

You can also use breakpoints. A list with the current breakpoint addresses is provided at the bottom. To create a breakpoint, either click on the address in the disassembly panel, or enter it (in $abcd format) into the text field and click +. Remove a breakpoint by clicking the ×ばつ in the breakpoints list. Clear all current breakpoints with Clear all.

CLI args

There are some CLI arguments that you can use:

Play Kid 0.4.0
Toni Sagristà - tonisagrista.com
Minimalist Game Boy emulator for the cool kids.
Usage: playkid [OPTIONS] [INPUT]
Arguments:
 [INPUT] Path to the input ROM file to load
Options:
 -s, --scale <SCALE> Initial window scale. It can also be resized manually [default: 4]
 -d, --debug Activate debug mode. Use `d` to stop program at any point
 -f, --fps Show FPS counter. Use `f` to toggle on and off
 --skipcheck Skip global checksum, header checksum, and logo sequence check
 -h, --help Print help
 -V, --version Print version

SDL2 version

Play Kid started as an SDL2 application, but it was moved to a pure Rust tech stack using winit, egui, rodio, and gilrs. This makes it much easier to build for different targets (including WASM!). Additionally, the SDL2 version contains a minimalist homegrown UI library that I'm particularly proud about, but it can't hold a candle to egui in terms of functionality. It looks like this:

The SDL2 version is tagged playkid-sdl2 (playkid-sdl2@codeberg, playkid-sdl2@github).

Useful links