SameBoy

LIJI32活跃维护

用 C 语言写的 Game Boy 和 Game Boy Color 模拟器,可以准确运行原版掌机游戏,适合怀旧玩家和想研究模拟器实现的人。

Game Boy and Game Boy Color emulator written in C

v1.0.5发布于 2026-11-02 21:54 UTC2,242star +3 / 7 天290fork同步于 2026-11-10 17:46 UTC

怎么上手

由 README 提炼,执行前请确认
make
make sdl
硬件要求按 README 说明

README 未说明具体 CPU/GPU 要求;帧混合与缩放算法需 OpenGL 3.2 以上或 Metal,其余功能未列硬件门槛。

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

项目说明

由 README 自动翻译提炼

用 C 写的 Game Boy / Game Boy Color 模拟器,主打高精度和调试能力

用 C 语言写的 Game Boy 和 Game Boy Color 模拟器,可以准确运行原版掌机游戏,适合怀旧玩家和想研究模拟器实现的人。

核心能力

  • 支持 DMG 与 CGB 两种机型,可无视 ROM 强制选机型
  • 自带开源 DMG/CGB Boot ROM,覆盖全部 CGB 游戏调色板
  • T-cycle 级 LCD 时序模拟,可跑 Demotronic、GBVideoPlayer 等 demo
  • 内置文本调试器,支持表达式求值、反汇编、条件断点与回溯
  • 提供 Cocoa、SDL 前端和 libretro 核心,可作静态库链接

容易踩的坑

编译需先装 libsdl2,非 Windows/macOS 平台还需 libpng;构建 Boot ROM 依赖 rgbds,作库编译依赖 cppp;Windows 上需先跑 vcvars64.bat 并自备 make(Git Bash 不含)。

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

最近发版

5 个版本v1.0.5
  1. v1.0.5SameBoy v1.0.5最新正式版2026-11-02 · 2026-11-02 21:54 UTC

    This version is backwards compatible with save states from SameBoy 0.14.3 and newer, as well as save states from any BESS compliant emulator

    New/Improved Features

    • Better ZIP file compatibility in iOS
    • Added keyboard shortcuts for the VRAM and Memory Viewers in the Cocoa frontends
      • VRAM Viewer tabs can be switched using ^1 - ^4
    • 0x can now be used an an alternative hexadecimal prefix in the debugger and Memory Viewer

    Accuracy Improvements/Fixes

    • More accurate emulation of invalid MLT_REQ SGB commands
    • Fixed a bug where certain Game Boy Printer margin configurations were not emulated correctly
    • When emulating an RTC cartridge in Sync-to-Host mode, the RTC will now correctly halt if instructed by the ROM
    • Improved Game Boy Printer accuracy and timings
    • More realistic IR emulation, fixes IR features in certain games
    • Improved DAC emulation, especially on pre-GBC models
    • Improved LFSR stepping on pre-GBC models
    • Emulate a quirk where square channels keep running "in the background" after their timer expired on pre-GBC models
    • On pre-GBC models, the duty cycle of square channels is now latched between frequency clocks
    • Improved emulation of Wave RAM corruption on affected models
    • Correctly emulate noise channel background behavior on pre-GBC models

    Thanks to Jeff Lynn for contributing many of this release's APU improvements!

    Bug Fixes

    • Fix Printer emulation and UI on iOS 27
    • Invalid SGB multiplayer modes are now correctly saved and loaded from states
    • Fixed a bug where WX writes would corrupt the Game Boy Camera state
    • Various fixes involving BESS serialization of RTC, HuC1, and TPP cartridges
    • Fixed a bug that caused Cheat Search to not scan HRAM when running ROMs without cartridge RAM
    • Fixed a regression that caused the libretro frontend to crash when running ROMs that has a cartridge battery but no RTC
    • Fixed a memory leak when taking screenshots in the SDL frontend on systems that use libpng
    • Fixed an issue that could cause ROMs filenames with no extensions to read and write from incorrect paths on Windows
    • Fixed an issue where SameBoy would behave incorrect when running from certain long Unicode paths on Windows
    • Fixed screenshots on Wine in the SDL port
    • Improved serialization of the Game Boy Printer state
    • Fixed a bug where certain Game Genie codes where not interpreted correctly
    • Fixed an issue where searching for cheats might return less results if two matching 16-bit results are overlapping
    • The camera and rumble states are now BESS-serialized
    • Fixed a bug where cheats modifying cartridge RAM addresses would ignore their configured bank
    • Fixed a bug where DST would interfere with the intended behavior of the Workboy's internal clock
    • Fixed a bug where loading states could connect an accessory that might have not been supported by the frontend
    • Fixed a bug where resetting the Game Boy would disconnect a connected accessory
    • Fixed errors that caused audio recordings saved to AIFF and WAV files to use slightly invalid headers
    • Fixed a memory leak when using Cheat Search
    • SDL's --model flag incorrectly handled MGB as DMG
    • Fixed a memory leak in the SDL frontend's Cheats menu
    • Improved validation of ISX ROMs
    • Fixed a bug that could trigger phantom button presses, which in rare occasions could trigger game resets in the Cocoa and iOS frontends
    • Fixed a crash that could happen when handling with large selections in the Cocoa Memory Viewer
    • Fixed a potential crash when trying to change Cartridge RAM banks in the Memory Viewer while there is no Cartridge RAM
    • Fixed a potential freeze when trying to rename a palette in the Cocoa frontend and there are already palettes sharing the same name or prefix
    • Fixed a bug where deleting the last cheat code in the Cocoa or SDL frontends would not persist after reopening the ROM
    • Improved audio quality in the Cocoa and iOS frontends when dealing with
  2. v1.0.4SameBoy v1.0.42026-10-09 · 2026-10-09 11:43 UTC
    查看更新说明

    This version is backwards compatible with save states from SameBoy 0.14.3 and newer, as well as save states from any BESS compliant emulator

    New/Improved Features

    • The libretro core now supports API extensions to retrieve additional metadata and create more portable battery save files
    • The iOS frontend has been updated with improved iOS 27 support
    • iPhone Duo support was added to the iOS frontend
    • The CRT scaling filter has been updated with an improved look
    • A new Pixelated/Sharp Bilinear scaling filter
      • This new filter is now the default filter in the Cocoa and SDL frontends
    • VFS support was added to the libretro core
    • Logging support was added to the libretro core
    • The libretro core will now render audio directly in the frontend's audio sample rate, if supported
    • Recording audio to a VGM log file is now possible in the Cocoa and SDL frontends
    • Minor UI improvements in the Cocoa frontend

    Accuracy Improvements/Fixes

    • Workboy emulation now correctly reports the current weekday
    • Fixed a bug that made certain small ROM files be incorrectly detected as MMM01 cartridges
    • More accurate emulation of SGB command processing

    Bug Fixes

    • Fixed a bug where periodic battery saves were performed from the wrong thread in the Cocoa frontend, causing debug builds to crash
    • Fixed controller hotkeys not working on newer macOS versions in the Cocoa frontend
    • Fixed a bug that prevented mapping Load State commands to a controller hotkey in the Cocoa frontend
    • The libretro core no longer reports an RTC memory region when emulating cartridges without an RTC
    • Fixed a bug that could trigger memory corruptions on x86-64 platforms when loading malformed save states
    • Improved sanitization of the Game Boy Printer save state data
    • Fixed an incorrectly label “Rumble strength” label in the Cocoa frontend
    • File dialogs on Windows now switch Full Screen mode off before they appear, working around bugs in Windows' windowing system
    • Fixed a bug that made the Joycon autopair button not work in the Cocoa frontend
    • Fixed a bug that made breakpoints created by the GB_debugger_execute_command API would not trigger under some conditions when using SameBoy as a library

    Misc Internal Changes

    • The build system no longer prints ignored errors when building SameBoy without RGBDS installed if prebuilt boot ROMs are used
    • ibtool no longer silently fails when building the Cocoa or iOS frontends
    • The logging API now has attribute flags that mark if a log line is an error or a warning caused by the previous API call
  3. v1.0.3SameBoy v1.0.32026-03-04 · 2026-03-04 21:42 UTC
    查看更新说明

    This version is backwards compatible with save states from SameBoy 0.14.3 and newer, as well as save states from any BESS compliant emulator

    New/Improved Features

    • Added support for more controllers in the iOS frontend, including singular Joy-Cons
    • Pressing buttons while in a locked rewind state now exits rewind mode in the iOS frontend
    • The iOS frontend now handles save conflicts with a dialog, making syncing saves across different machines and emulators easier
    • An examine/x command can now use the /s modifier to change its output style to RGBDS-compatible assembly
    • An examine/x command can now use $ in its modifier to use hexadecimal count values
    • It is now possible to adjust the maximum rumble strength
    • It is now possible to modify and save a running ROM file from the Memory Viewer in the Cocoa frontend
    • Controller buttons can now be assigned to one of 4 hotkey commands in the iOS frontend
    • Periodic saves were added to the iOS frontend
    • A new screenshot hotkey was added to the SDL frontend
    • Controller UI hiding in the iOS frontend can now optionally disable the centering of the game screen
    • The Cocoa and SDL frontends now save the battery more frequently

    Accuracy Improvements/Fixes

    • Added silence detection to eliminate rounding artifacts when playing nothing but frequencies above Nyquist
    • Prevented abnormal vblank events from updating the SNES-side buffers prematurely
    • Fixed a bug that made reading the PCM registers non-deterministic when emulating a CGB in CPU revision C or older
    • Fixed a bug that caused ROMs to be running in the background under some cases in the Cocoa frontend
    • Fixed a bug that caused channel PCM12 to output incorrect channel 2 values when emulating CGB in CPU revision C or older
    • Improved the accuracy of the PCM registers when emulating CGB in CPU revision C or older
    • Emulated a new quirk where volume envelope ticks are delayed while emulating a CGB in CPU revisions D or E
    • Corrected the channel alignment of channels 1 and 2 while emulating CGB in CPU revision C or older
    • Fixed a bug where a volume envelope quirk that was only applicable to channels 1 and 2 was also applied to channel 4
    • Major improvements to emulation of channel 4 start delays
    • Emulated a quirk where one of channel 4's internal counters counts while the channel is inactive
    • Emulated LFSR corruptions and "zombie steps" when writing to NR43, including revision differences

    Bug Fixes

    • Fixed mouse cursor hiding behavior while debugging in the Cocoa frontend
    • Fixed an issue where rewinding could reset the ROM under some circumstances in the iOS frontend
    • Fixed a visual glitch in the reverse search functionality of the Cocoa debugger console
    • Fixed a memory leak in scenarios where getline fails on some platforms
    • Fixed a resource leak in scenarios where loading a cheat file fails
    • Fixed resource leaks in certain scenarios where loading a battery save or an ISX ROM fails
    • Fixed a bug that caused the SDL frontend to be stuck on the greyscale palette
    • Fixed a bug where starting an audio recording could crash on Windows on some systems
    • Fixed a bug where the Game Boy Camera could not be emulated correctly on some iPhone models
    • Fixed a spelling mistake in an iOS tip message
    • Fixed a bug where certain versions of macOS did not display SameBoy's icon
    • Fixed an issue that made it impossible to change the RTC mode in link mode in the libretro frontend

    Misc Internal Changes

    • Updated the boot ROMs so they can be built with the latest version of RGBDS
    • Removed code for supporting legacy Windows save states from versions no longer compatible with modern versions of SameBoy
    • Fixed compilation of the SDL frontend on unsigned char platforms
    • Made it possible to build the Cocoa frontend using older SDKs
    • Removed accidentally committed debugging code from the Cocoa frontend
  4. v1.0.2SameBoy v1.0.22025-08-03 · 2025-08-03 14:04 UTC
    查看更新说明

    This version is backwards compatible with save states from SameBoy 0.14.3 and newer, as well as save states from any BESS compliant emulator

    New/Improved Features

    • New usage debugger command, displaying the Game Boy CPU's time outside of halt/stop modes
    • The debugger window in the Cocoa frontend now has a CPU usage graph
    • The debugger print/eval command no longer adds zero padding by default
    • The Cocoa frontend now has an option to force an integer scaling factor with black borders, similar to the SDL frontend
    • The iOS frontend can now configure rapid A and rapid B buttons on a controller
    • The SDL frontend now supports two optional V-sync modes
    • The Cocoa and iOS frontends were updated with UI and UX improvements for macOS and iOS 26, respectively
      • This also includes new icons when using on these operating systems, as well as on watchOS 26
    • Minor UI improvements were also done for older versions of macOS and iOS
    • SameBoy now supports the new menu bar on iPad OS 26
    • Improved frame skipping during turbo mode
    • Turbo mode can now have a configurable speed cap on all frontends
      • In the iOS frontend, this supersedes the 200% and 400% overclocking-based turbo mode options
    • Major improvements to audio quality, eliminating aliasing when playing high frequency tones
    • The iOS frontend will now alert the user if automatic save states could not be created for some reason (e.g. lack of disk space)
    • The iOS frontend will now ask for confirmations before resetting a ROM

    Accuracy Improvements/Fixes

    • Fixed an inaccuracy where the channel bias is applied to disconnected channel when mixing audio while emulating the Game Boy Advance

    Bug Fixes

    • Fixed a bug that caused certain GameShark codes to be imported incorrectly
    • Pressing the Zoom button with alt/option pressed now resizes the window to the next integer scale even on newer macOS versions
    • The debugger side view in the Cocoa frontend no longer scrolls to the bottom on longer outputs
    • Fixed a bug that causes cheat search to crash when used on a ROM with no cartridge RAM
    • Fixed a bug that prevented the Game Boy Printer from saving printed images to the iOS photo library
    • Fixed a bug where certain addresses would be described incorrectly in the Cocoa frontend's memory viewer
    • Fixed a bug that caused GBS files to play the boot ROM jingle upon loading instead of the first track
    • Fixed a bug that made the cheat search window remain open even after closing its ROM
    • Fixed a bug where imported ROMs were copied instead of moved, and vice versa, on iOS
    • Fixed a bug where Cocoa's VRAM viewer would not show scrolling on some macOS versions
    • Fixed a bug where emulation would not automatically resume after reaching the end of the rewind buffer on iOS
    • Fixed a bug where the Cocoa frontend will fail update itself if it wasn't moved to the Applications folder
    • The iOS fronted now correctly handles cases where a user tries to open a ROM from an internal iOS or SameBoy folder
    • Mitigated a rare bug where certain actions could spontaneously reset a ROM on iOS
    • Fixed a bug with the GB_save_state API where it returned success even on failures
    • Fixed a bug that prevented the binary releases of the Cocoa frontend from using the Mac's camera while emulating the Game Boy Camera
    • Fixed a bug where the interface would rotate while playing motion-controlled games on some iOS devices

    Misc Internal Changes

    • Fix build on OpenBSD
    • SameBoy's headers are now compatible with ANSI C and C++ compilation modes
    • The DISABLE_* flags can now be used while building subsets of the lib target, as well as the newly-added headers target
    • The Windows build process was changed to require Git Bash and Make instead of the GNUWin package
  5. v1.0.1SameBoy v1.0.12025-04-04 · 2025-04-04 21:31 UTC
    查看更新说明

    This version is backwards compatible with save states from SameBoy 0.14.3 and newer, as well as save states from any BESS compliant emulator

    New/Improved Features

    • UI improvements to the Cocoa palette editor
    • Improved audio quality on libretro; audio is now rendered by SameBoy at 2MHz, and downsampling is now handled by the libretro frontend itself
      • In the Wii U build, downsampling is still done by SameBoy
    • With the meaning of register $FF75 discovered, it is now referred to as rPGB in the debugger
    • The output of the watchpoint debugger command now includes the watchpoint type (read-only, write-only, or read-write)
      • This makes the default watchpoint type (write-only) more obvious
    • Windows 11 users can now optionally disable rounded corners in the Graphics Options menu
    • Official Windows builds no longer require installing MSVC runtimes by linking against mvscrt.dll
    • Major improvements to debugging in the SDL frontend:
      • The main emulator window is no longer unresponsive when the debugger is stopped
      • Pressing keys in the emulator window while the debugger is paused now triggers a terminal bell
      • On Windows, sameboy.exe and sameboy_debugger.exe have been merged. Press Ctrl+C at any time to interrupt the debugger and open the debugger console, and close the console window at any time to resume normal gameplay.
      • Async debugging now supports all compatible versions of Windows, adding support for Windows 7, 8.x, and earlier builds of Windows 10
    • When using an external controller, joysticks can now optionally be used as faux analog controls
      • This feature quickly alternates D-pad buttons between pressed and release states to simulate analog inputs
    • The SDL frontend will now automatically resize the window when switching between models and border modes as long as the window hasn't been manually resized
    • A workaround for an old RetroArch bug has been removed, audio in the Wii U libretro port is now louder
    • It is now possible to enable audio for both Game Boys in the Link Cable mode of the libretro port

    Accuracy Improvements/Fixes

    • OAM randomization is now more accurate
    • Fixed a bug where certain SGB transfers would copy data incorrectly when running SameBoy on big endian platforms
      • This fixes many SGB games suffering from garbled graphics when playing on the Wii U
    • Fixed a potential accuracy issue when emulating MBC7 games
    • The number of band-limited phases was increased in order to reduce overtones in high-pitched sounds

    Bug Fixes

    • New palettes will now appear on the Cocoa frontend even if the user have previously customized palettes
    • Fixed a bug that caused the Pink Pop theme to modify itself once opened in the palette editor, in both the Cocoa and iOS frontends
    • Fixed a bug where the vertical layout was not usable on certain iPads
    • Resetting emulation in the SDL version while the emulator is paused will now resume emulation
    • Fixed a bug where changing the emulated model in the SDL frontend does not immediately closes the menu
    • Removed Unicode characters from libretro settings, as many frontends cannot display them
    • Fixed a bug that caused ROMs to run without a window in the Cocoa port after changing the emulated revision
    • Several iOS and watchOS crashes have been fixed

    Removed Features

    • Integration with the Homebrew Hub has been removed from the iOS frontend

    Misc Internal Changes

    • The OpenDesktop thumbnailer is now stripped when built in release configuration, rather than being stripped only upon installation
    • Official releases of SameBoy now build using the latest version of Clang, gaining speed boost of around 8%
    • The FM synthesis routines used while rendering the SGB jingle have been optimized for speed

用户点评

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

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

    README 原文

    未翻译

    SameBoy

    SameBoy is an open source Game Boy (DMG) and Game Boy Color (CGB) emulator, written in portable C. It has a native Cocoa frontend for macOS, an SDL frontend for other operating systems, and a libretro core. It also includes a text-based debugger with an expression evaluator. Visit the website.

    Features

    Features common to both Cocoa and SDL versions:

    • Supports Game Boy (DMG) and Game Boy Color (CGB) emulation
    • Lets you choose the model you want to emulate regardless of ROM
    • High quality 96KHz audio
    • Battery save support
    • Save states
    • Includes open source DMG and CGB boot ROMs:
      • Complete support for (and documentation of) all game-specific palettes in the CGB boot ROM, for accurate emulation of Game Boy games on a Game Boy Color
      • Supports manual palette selection with key combinations, with 4 additional new palettes (A + B + direction)
      • Supports palette selection in a CGB game, forcing it to run in 'paletted' DMG mode, if ROM allows doing so.
      • Support for games with a non-Nintendo logo in the header
      • No long animation in the DMG boot
    • Advanced text-based debugger with an expression evaluator, disassembler, conditional breakpoints, conditional watchpoints, backtracing and other features
    • Extremely high accuracy
    • Emulates PCM_12 and PCM_34 registers
    • T-cycle accurate emulation of LCD timing effects, supporting the Demotronic trick, Prehistorik Man, GBVideoPlayer and other tech demos
    • Real time clock emulation
    • Retina/High DPI display support, allowing a wider range of scaling factors without artifacts
    • Optional frame blending (Requires OpenGL 3.2 or later)
    • Several scaling algorithms (Including exclusive algorithms like OmniScale and Anti-aliased Scale2x; Requires OpenGL 3.2 or later or Metal)

    Features currently supported only with the Cocoa version:

    • Native Cocoa interface, with support for all system-wide features, such as drag-and-drop and smart titlebars
    • Game Boy Camera support

    Read more.

    Compatibility

    SameBoy passes all of blargg's test ROMs, all of mooneye-gb's tests (Some tests require the original boot ROMs), and all of Wilbert Pol's tests. SameBoy should work with most games and demos, please report any broken ROM. The latest results for SameBoy's automatic tester are available here.

    Contributing

    SameBoy is an open-source project licensed under the Expat license (with an additional exception for the iOS folder), and you're welcome to contribute by creating issues, implementing new features, improving emulation accuracy and fixing existing open issues. You can read the contribution guidelines to make sure your contributions are as effective as possible.

    Compilation

    SameBoy requires the following tools and libraries to build:

    • clang (Recommended; required for macOS) or GCC
    • make
    • macOS Cocoa frontend: macOS SDK and Xcode (For command line tools and ibtool)
    • SDL frontend: libsdl2
      • When building for operating systems other than Windows and macOS, libpng is also required
    • rgbds, for boot ROM compilation
    • cppp, for cleaning up headers when compiling SameBoy as a library

    On Windows, SameBoy also requires:

    • Visual Studio (For headers, etc.)
    • Git Bash or another distribution of basic Unix utilities
      • Git Bash does not include make, you can get it here.
    • Running vcvars64.bat or vcvarsx86_amd64.bat before running make. Make sure all required tools, libraries, and headers are in %PATH%, %lib%, and %include%`, respectively. (see Build FAQ for more details on Windows compilation)

    To compile, simply run make. The targets are:

    • cocoa (Default for macOS)
    • sdl (Default for everything else)
    • lib (Creates libsameboy.o and libsameboy.a for statically linking SameBoy, libsameboy.dylib/so/dll for dynamically linking SameBoy, as well as a headers directory with corresponding headers)
      • Static libraries are currently not supported on Windows due to linker limitations.
    • ios (Plain iOS .app bundle), ios-ipa (iOS IPA archive for side-loading), ios-deb (iOS deb package for jailbroken devices)
    • libretro
    • bootroms
    • tester

    You may also specify CONF=debug (default), CONF=release, CONF=native_release or CONF=fat_release to control optimization, symbols and multi-architectures. native_release is faster than release, but is optimized to the host's CPU and therefore is not portable. fat_release is exclusive to macOS and builds x86-64 and ARM64 fat binaries; this requires using a recent enough clang and macOS SDK using xcode-select, or setting them explicitly with CC= and SYSROOT=, respectively. All other configurations will build to your host architecture, except for the iOS targets. You may set BOOTROMS_DIR=... to a directory containing precompiled boot ROM files, otherwise the build system will compile and use SameBoy's own boot ROMs.

    The SDL port will look for resource files with a path relative to executable and inside the directory specified by the DATA_DIR variable. If you are packaging SameBoy, you may wish to override this by setting the DATA_DIR variable during compilation to the target path of the directory containing all files (apart from the executable, that's not necessary) from the build/bin/SDL directory in the source tree. Make sure the variable ends with a / character. On FreeDesktop environments, DATA_DIR will default to /usr/local/share/sameboy/. PREFIX and DESTDIR follow their standard usage and default to an empty string an /usr/local, respectively

    Linux, BSD, and other FreeDesktop users can run sudo make install to install SameBoy as both a GUI app and a command line tool.

    SameBoy is compiled and tested on macOS, Ubuntu and 64-bit Windows 10.