https://github.com/ryp/gb-emu-zig
Gameboy emulator written in Zig
https://github.com/ryp/gb-emu-zig
emulator gameboy zig
Last synced: about 1 year ago
JSON representation
Gameboy emulator written in Zig
- Host: GitHub
- URL: https://github.com/ryp/gb-emu-zig
- Owner: Ryp
- License: mit
- Created: 2024-05-26T19:58:31.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-03-10T19:35:24.000Z (over 1 year ago)
- Last Synced: 2025-03-28T03:32:28.955Z (about 1 year ago)
- Topics: emulator, gameboy, zig
- Language: Zig
- Homepage:
- Size: 221 KB
- Stars: 38
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Gameboy Emulator
Here's a simple Gameboy emulator written in Zig using SDL3. It can run games like Tetris, Zelda or Kirby decently, and doesn't pretend to do much more. Most basic features are implemented, like graphics, sound and controls, but there was no effort to support any complex hardware behavior or bugs. On the other hand the codebase should be very simple to get into and hopefully very readable.
Tetris | Zelda
:-------------------------:|:-------------------------:
 | 
## How to run
This should get you going after cloning the repo:
```bash
zig build -Doptimize=ReleaseFast run --
```
## Controls
| Keyboard key | Gameboy |
|-----------------------|--------------------|
| Esc | Exit |
| WASD | DPad |
| O | A |
| K | B |
| Enter | Start |
| B | Select |
## Rough edges
- ROM-only and MBC1 cartridge are supported, whereas MBC2 has limited support. Everything else is unsupported.
- It's assumed your refresh rate is 60Hz. Failing that, the gameplay speed will be wrong and the audio will get wildly out of sync.
- Sound will slowly accumulate lag over time anyway because 60Hz is not 59.94Hz.