Skip to content

BUGS-NYU/gbemu-demo

Repository files navigation

Slightly broken GB emulator

This works on macOS/Linux and Windows 11 through WSLg (Sorry old Windows users!)

  1. Clone this repo (https://github.com/BUGS-NYU/gbemu-demo)
  2. Build it (install make first)
    • To run the game, after running make, run ./build/gbemu tetris.gb
  3. Two instructions are broken in opcodes.cc, try to fix them!
  4. Get Tetris working!

Your goal is to fix two broken instructions (_opcode_adc(u8 value), _opcode_and(u8 value)). Use the pandocs for help.

Original readme below

gbemu

gbemu is a Nintendo Gameboy emulator written in C++. It was written as an exercise (and for fun!) so its goals are exploration of modern C++ and clean code rather than total accuracy.

Building

Building the emulator requires cmake and SDL and has been tested on macOS and Debian. To compile the project, run:

$ make

This builds two versions of the emulator:

  • gbemu - the main emulator, using SDL for graphics and input
  • gbemu-test - a headless version of the emulator for debugging & running tests

Playing

usage: gbemu <rom_file> [--debug] [--trace] [--silent] [--exit-on-infinite-jr] [--print-serial-output]

arguments:
  --debug                   Enable the debugger
  --exit-on-infinite-jr     Stop emulation if an infinite JR loop is detected
  --print-serial-output     Print data sent to the serial port
  --trace                   Enable trace logging
  --silent                  Disable logging

The key bindings are: , , , , X, Z, Enter, Backspace.

Tests

The emulator is tested using Blargg's tests - these can be ran with ./scripts/run_test_roms.

The test it fails is due to the lack of a timer implementation.

Missing features

Currently, gbemu only supports Gameboy games. I'm working on Gameboy Color support off-and-on at the moment. There's also no audio support yet.

Screenshots

Menu Gameplay

About

Fix the two broken opcodes (AND and ADC)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages