All Projects → aappleby → Metroboy

aappleby / Metroboy

MetroBoy - A playable, circuit-level simulation of an entire Game Boy

Projects that are alternatives of or similar to Metroboy

Wasmboy
Game Boy / Game Boy Color Emulator Library, 🎮written for WebAssembly using AssemblyScript. 🚀Demos built with Preact and Svelte. ⚛️
Stars: ✭ 963 (+469.82%)
Mutual labels:  gameboy, gameboy-emulator, emulator
khedgb
Experiments in Game Boy emulation
Stars: ✭ 15 (-91.12%)
Mutual labels:  emulator, gameboy, gameboy-emulator
gameboyGO
Gameboy emulator in go
Stars: ✭ 24 (-85.8%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Coffee Gb
Gameboy emulator in Java 8.
Stars: ✭ 953 (+463.91%)
Mutual labels:  gameboy, gameboy-emulator, emulator
Gbemu
WebAssembly based Gameboy Emulator
Stars: ✭ 120 (-28.99%)
Mutual labels:  gameboy, gameboy-emulator, emulator
Hades
🔥 A Nintendo Game Boy Advance emulator
Stars: ✭ 44 (-73.96%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Cryboy
A Game Boy (Color) emulator written in Crystal
Stars: ✭ 68 (-59.76%)
Mutual labels:  gameboy, gameboy-emulator, emulator
goboy
Playing GameBoy Emulation in GoLang (ported from https://github.com/racerxdl/GameBoyEmulator)
Stars: ✭ 37 (-78.11%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Gearboy
Game Boy / Gameboy Color emulator for iOS, macOS, Raspberry Pi, Windows, Linux and RetroArch.
Stars: ✭ 528 (+212.43%)
Mutual labels:  gameboy, gameboy-emulator, emulator
Pyboy
Game Boy emulator written in Python
Stars: ✭ 3,326 (+1868.05%)
Mutual labels:  gameboy, gameboy-emulator, emulator
SkyEmu
Game Boy, Game Boy Color, and Game Boy Advanced Emulator
Stars: ✭ 59 (-65.09%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Gameboy
🎮 Game Boy emulator written in Rust
Stars: ✭ 17 (-89.94%)
Mutual labels:  gameboy, gameboy-emulator, emulator
awesome-emu-resources
A curated list of emulator development resources
Stars: ✭ 26 (-84.62%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Vba M Nx
WIP full featured port of VBA-M for Nintendo Switch
Stars: ✭ 11 (-93.49%)
Mutual labels:  gameboy, gameboy-emulator, emulator
worldwide
A toy GameBoy Color emulator written in golang.
Stars: ✭ 563 (+233.14%)
Mutual labels:  emulator, gameboy, gameboy-emulator
rusty-boy
Gameboy emulator in Rust
Stars: ✭ 20 (-88.17%)
Mutual labels:  emulator, gameboy, gameboy-emulator
gameboi
An Original GameBoy emulator?
Stars: ✭ 20 (-88.17%)
Mutual labels:  emulator, gameboy, gameboy-emulator
dashboy
Gameboy Emulator implemented by pure Dart
Stars: ✭ 130 (-23.08%)
Mutual labels:  emulator, gameboy, gameboy-emulator
Elmboy
A Nintendo™ Game Boy™ Emulator written in Elm.
Stars: ✭ 285 (+68.64%)
Mutual labels:  gameboy, gameboy-emulator, emulator
Mooneye Gb
A Game Boy research project and emulator written in Rust
Stars: ✭ 557 (+229.59%)
Mutual labels:  gameboy, gameboy-emulator, emulator

MetroBoy is a Game Boy simulation designed to be mechanically translated into Verilog

November 11 2019 - I've converted the Furrtek schematics to (totally untested) source code. If you want to run MetroBoy, don't build from head - use release 1.02 below.

October 11 2019 - This guy has traced out all the signals (aside from CPU) on the DMG die - https://github.com/furrtek/DMG-CPU-Inside

I'm going to be incrementally converting MetroBoy to use his schematics. Should be interesting ;)

As of build 1.02 all Blargg, Mooneye, and Wpol test suites should be passing.

MetroBoy screenshot


TL;DR - Drag and drop rom files into the window to load them. Only first-gen Game Boy games that use the MBC1 controller are supported - Game Boy Color roms will not work.

Game controls:

  • Dpad = arrow keys
  • B = Z
  • A = X
  • Select = shift
  • Start = enter

Debug controls:

  • R = Reset
  • F = Fast mode
  • V = Vsync mode (default)
  • S = Step mode
  • F1 = Load state
  • F4 = Save state
  • ESC = Quit

In step mode, up/down changes step granularity (frame/line/cycle) and left/right steps forward/back. Shift-right can be used to step over long instructions like loops and halts.


MetroBoy isn't an emulator in the traditional sense

It's comparatively slow, though you can use it to play Game Boy games. It should run at full speed on most modern processors, with my current laptop running at about 2.5x realtime in fast mode.

MetroBoy is more like a Verilog simulation of a Game Boy that's been translated into C++. You can also think of it as being written in a subset of C++ that's designed to to be mechanically translated into synthesizable Verilog.

MetroBoy is part of a larger project named Metron, which is a C-to-Verilog translator based on LLVM that I'm still working on. Portions of MetroBoy have been validated by translating them from C to Verilog using Metron, translating that back to C using Verilator, then asserting that all the registers match up. MetroBoy usually runs between 3x-5x faster than the C->Verilog->Verilator->C version.


MetroBoy screen contents

Left columns

  • CPU registers
  • Memory bus
  • DMA state
  • Timer state
  • PPU registers
  • PPU state
  • Sprite state
  • Disassemby

Center column

  • Gameboy screen
  • 'Oscilloscope' view showing memory accesses per cycle (see Gameboy::trace)

Right column

  • Tile memory
  • Tile map 0
  • Tile map 1

FAQ

  • Why is MetroBoy so slow?
    • MetroBoy simulates a Game Boy the hard way - in vsync mode it's simulating 4213440 full clock ticks per second. In fast mode it runs at about 10M clock ticks per second, or around 300 cycles per tick - not bad considering that the simulation does terrible things to branch predictors.
  • How accurate is MetroBoy's simulation?
    • Very, very accurate. It passes all the test suites I've thrown at it, with the exception of a few PPU rendering issues in the Mealybug test suite.
  • How are you drawing the UI?
    • Raw pixel writes to a SDL surface.

Known Issues

  • Save game support isn't implemented yet
  • Cross-platform support via CMake is coming. Nothing in MetroBoy is OS-specific, I just haven't set it up yet.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].