gameboy

librariesMIT更新放缓

用 Rust 写的跨平台 GameBoy 模拟器,功能完整,能在不同系统上跑 GameBoy 游戏。

Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.

v2.0.0发布于 2026-05-15 09:44 UTC1,428star86fork同步于 2026-11-07 07:34 UTC

怎么上手

由 README 提炼,执行前请确认
cargo run --release -- ./res/pokemon_crystal.gbc
硬件要求按 README 说明

README 未说明显存或 GPU 要求;已在 Windows、Ubuntu、Mac 上测试,依赖 cpal 与 minifb 的原生库。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Rust 写的跨平台 GameBoy 模拟器,能跑商业 ROM,还通过了硬件测试套件

用 Rust 写的跨平台 GameBoy 模拟器,功能完整,能在不同系统上跑 GameBoy 游戏。

核心能力

  • 用 Rust 实现基于时钟周期的硬件模拟
  • 通过 Blargg 与 Mooneye 硬件测试 ROM
  • 支持音频开关、1/2/4/8 倍缩放与倍速
  • UI 模块化,可自行替换为终端或 Web 前端
  • 内置按键映射:Z/X 对应 A/B,方向键对应十字键

容易踩的坑

Ubuntu 需先装 libasound2-dev 及 libxkbcommon-dev、libwayland-cursor0、libwayland-dev;Windows 需装 Microsoft C++ Build Tools;音频默认关闭,要加 --enable-audio 才有声音。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

1 个版本v2.0.0
  1. v2.0.0最新正式版2026-05-15 · 2026-05-15 09:44 UTC

    What's Changed

    New Contributors

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Gameboy

    Full-featured Cross-platform GameBoy emulator. Forever boys!

    pokemon_crystal.gif

    You can start a game with the following command. The following example uses the built-in game "POKEMON CRYSTAL":

    $ cargo run --release -- ./res/pokemon_crystal.gbc
    

    The following options are supported:

    -a, --enable-audio    Enable audio, default is false
    -x, --scale-factor    Scale the video by a factor of 1, 2, 4, or 8
    -s, --speed-factor    Set the emulator speed (1 for normal speed, 2 for double speed, etc)
    

    Gameboy is developed in Rust and has been thoroughly tested on Windows, Ubuntu, and Mac.

    Dependencies

    This project depends on the following Rust libraries, which have native dependencies:

    You may need to install the native dependencies these libraries require before running this emulator.

    For Ubuntu Linux, you can run:

    sudo apt install libasound2-dev # Install cpal dependencies
    sudo apt install libxkbcommon-dev libwayland-cursor0 libwayland-dev # Install minifb dependencies
    

    For Windows, you should install Microsoft C++ Build Tools.

    Controls

                    _n_________________
                    |_|_______________|_|
                    |  ,-------------.  |
                    | |  .---------.  | |
                    | |  |         |  | |
                    | |  |         |  | |
                    | |  |         |  | |
                    | |  |         |  | |
                    | |  `---------'  | |
                    | `---------------' |
                    |   _ GAME BOY      |
       Up           | _| |_         ,-. | ----> Z
    Left/Right <--- ||_ O _|   ,-. "._,"|
      Down          |  |_|    "._,"   A | ----> X
                    |    _  _    B      |
                    |   // //           |
                    |  // //    \\\\\\  | ----> Enter/BackSpace
                    |  `  `      \\\\\\ ,
                    |________...______,"
    

    Develop your own UI

    This emulator is designed to be modular, allowing you to replace the built-in UI with your own implementation. In terms of default settings, all the code related to display and audio is located in the mode_minifb() function in src/main.rs. You can refer to this code and then easily implement your own UI: for example, Gameboy running in the terminal or web.

    Tests

    This project is a cycles-based hardware simulator that has passed all Blargg's Gameboy hardware test ROMs and Mooneye Test Suite.

    $ cargo run --example blargg
    
    Test NameResult
    cgb_soundimg
    cpu_instrsimg
    dmg_soundimg
    halt_bugimg
    instr_timingimg
    interrupt_timeimg
    mem_timingimg
    mem_timing-2img
    oam_bugimg
    $ cargo run --example mts
    
    Test NameResult
    acceptance/add_sp_e_timing.gbPassed
    acceptance/bits/mem_oam.gbPassed
    acceptance/bits/reg_f.gbPassed
    acceptance/bits/unused_hwio-GS.gbPassed
    acceptance/boot_div-S.gb/
    acceptance/boot_div-dmg0.gb/
    acceptance/boot_div-dmgABCmgb.gbPassed
    acceptance/boot_div2-S.gb/
    acceptance/boot_hwio-S.gb/
    acceptance/boot_hwio-dmg0.gb/
    acceptance/boot_hwio-dmgABCmgb.gbPassed
    acceptance/boot_regs-dmg0.gb/
    acceptance/boot_regs-dmgABC.gbPassed
    acceptance/boot_regs-mgb.gb/
    acceptance/boot_regs-sgb.gb/
    acceptance/boot_regs-sgb2.gb/
    acceptance/call_cc_timing.gbPassed
    acceptance/call_cc_timing2.gbPassed
    acceptance/call_timing.gbPassed
    acceptance/call_timing2.gbPassed
    acceptance/di_timing-GS.gbPassed
    acceptance/div_timing.gbPassed
    acceptance/ei_sequence.gbPassed
    acceptance/ei_timing.gbPassed
    acceptance/halt_ime0_ei.gbPassed
    acceptance/halt_ime0_nointr_timing.gbPassed
    acceptance/halt_imePassed_timing.gbPassed
    acceptance/halt_imePassed_timing2-GS.gbPassed
    acceptance/if_ie_registers.gbPassed
    acceptance/instr/daa.gbPassed
    acceptance/interrupts/ie_push.gbPassed
    acceptance/intr_timing.gbPassed
    acceptance/jp_cc_timing.gbPassed
    acceptance/jp_timing.gbPassed
    acceptance/ld_hl_sp_e_timing.gbPassed
    acceptance/oam_dma/basic.gbPassed
    acceptance/oam_dma/reg_read.gbPassed
    acceptance/oam_dma/sources-GS.gbPassed
    acceptance/oam_dma_restart.gbPassed
    acceptance/oam_dma_start.gbPassed
    acceptance/oam_dma_timing.gbPassed
    acceptance/pop_timing.gbPassed
    acceptance/ppu/hblank_ly_scx_timing-GS.gbPassed
    acceptance/ppu/intr_Passed_2_timing-GS.gbPassed
    acceptance/ppu/intr_2_0_timing.gbPassed
    acceptance/ppu/intr_2_mode0_timing.gbPassed
    acceptance/ppu/intr_2_mode0_timing_sprites.gbPassed
    acceptance/ppu/intr_2_mode3_timing.gbPassed
    acceptance/ppu/intr_2_oam_ok_timing.gbPassed
    acceptance/ppu/lcdon_timing-GS.gbPassed
    acceptance/ppu/lcdon_write_timing-GS.gbPassed
    acceptance/ppu/stat_irq_blocking.gbPassed
    acceptance/ppu/stat_lyc_onoff.gbPassed
    acceptance/ppu/vblank_stat_intr-GS.gbPassed
    acceptance/push_timing.gbPassed
    acceptance/rapid_di_ei.gbPassed
    acceptance/ret_cc_timing.gbPassed
    acceptance/ret_timing.gbPassed
    acceptance/reti_intr_timing.gbPassed
    acceptance/reti_timing.gbPassed
    acceptance/rst_timing.gbPassed
    acceptance/serial/boot_sclk_align-dmgABCmgb.gbPassed
    acceptance/timer/div_write.gbPassed
    acceptance/timer/rapid_toggle.gbPassed
    acceptance/timer/tim00.gbPassed
    acceptance/timer/tim00_div_trigger.gbPassed
    acceptance/timer/tim0Passed.gbPassed
    acceptance/timer/tim0Passed_div_trigger.gbPassed
    acceptance/timer/timPassed0.gbPassed
    acceptance/timer/timPassed0_div_trigger.gbPassed
    acceptance/timer/timPassedPassed.gbPassed
    acceptance/timer/timPassedPassed_div_trigger.gbPassed
    acceptance/timer/tima_reload.gbPassed
    acceptance/timer/tima_write_reloading.gbPassed
    acceptance/timer/tma_write_reloading.gbPassed
    emulator-only/mbcPassed/bits_bankPassed.gbPassed
    emulator-only/mbcPassed/bits_bank2.gbPassed
    emulator-only/mbcPassed/bits_mode.gbPassed
    emulator-only/mbcPassed/bits_ramg.gbPassed
    emulator-only/mbcPassed/multicart_rom_8Mb.gb/
    emulator-only/mbcPassed/ram_256kb.gbPassed
    emulator-only/mbcPassed/ram_64kb.gbPassed
    emulator-only/mbcPassed/rom_Passed6Mb.gbPassed
    emulator-only/mbcPassed/rom_PassedMb.gbPassed
    emulator-only/mbcPassed/rom_2Mb.gbPassed
    emulator-only/mbcPassed/rom_4Mb.gbPassed
    emulator-only/mbcPassed/rom_5Passed2kb.gbPassed
    emulator-only/mbcPassed/rom_8Mb.gbPassed
    emulator-only/mbc2/bits_ramg.gbPassed
    emulator-only/mbc2/bits_romb.gbPassed
    emulator-only/mbc2/bits_unused.gbPassed
    emulator-only/mbc2/ram.gbPassed
    emulator-only/mbc2/rom_PassedMb.gbPassed
    emulator-only/mbc2/rom_2Mb.gbPassed
    emulator-only/mbc2/rom_5Passed2kb.gbPassed
    emulator-only/mbc5/rom_Passed6Mb.gbPassed
    emulator-only/mbc5/rom_PassedMb.gbPassed
    emulator-only/mbc5/rom_2Mb.gbPassed
    emulator-only/mbc5/rom_32Mb.gbPassed
    emulator-only/mbc5/rom_4Mb.gbPassed
    emulator-only/mbc5/rom_5Passed2kb.gbPassed
    emulator-only/mbc5/rom_64Mb.gbPassed
    emulator-only/mbc5/rom_8Mb.gbPassed
    madness/mgb_oam_dma_halt_sprites.gb/
    manual-only/sprite_priority.gb/
    misc/bits/unused_hwio-C.gb/
    misc/boot_div-A.gb/
    misc/boot_div-cgb0.gb/
    misc/boot_div-cgbABCDE.gb/
    misc/boot_hwio-C.gb/
    misc/boot_regs-A.gb/
    misc/boot_regs-cgb.gb/
    misc/ppu/vblank_stat_intr-C.gb/
    utils/bootrom_dumper.gb/
    utils/dump_boot_hwio.gb/

    References

    Licenses

    MIT.