GBcon is an Original GameBoy emulator for unix-like platforms written in c++.
Written for fun.
GBcon requires SDL2
git clone https://github.com/connnnor/GBcon
cd GBcon
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=..
make && make install$ ./GBcon --help
Allowed options:
--help Display help message
-b [ --bios ] arg path to bios
-r [ --rom ] arg path to rom
-l [ --log ] arg log directory
-d [ --dbg ] start emu in debugger
-s [ --scale ] arg (=2) display scale. 1, 2, 4
$ ./GBcon --bios gb_bios.gb --rom tetris.gbkeys are up, down, left, right, a, s, enter, and right shift
- Passes most of blargg's cpu_instr test roms. Currently fails 02-interrupts.gb since the timer is not implemented.
- Memory Bank Controllers: MBC1, MBC3, MBC5.
- Text based debugger
- Cartridge save support
- Sound
- Memory Bank Controllers: MBC2, MBC6, MBC7, MM01, RTC support
- Accurate intra cycle timing
Automated tests use rspec to launch GBcon, load a test rom (blargg's) and interact with the debugger to exit when the test ROM is complete. blargg's test roms can be found here. Blargg's roms print their console output to the GameBoy serial port which GBcon dumps upon exit.
The tests require a few binaries are placed in the test/resources directory. like:
tests/resources/
├── blarggs
│ ├── cgb_sound.gb
│ ├── cpu_instrs.gb
│ ├── dmg_sound.gb
│ ├── instr_timing.gb
│ ├── interrupt_time.gb
│ ├── mem_timing.gb
│ └── oam_bug.gb
└── gb_bios.bin
To run rspec tests, do:
rspec
- Broken random number generation
- Choppy horizontal scrolling graphics
Link to FlappyBoy game in second screenshot
- GameBoy CPU Manual An essential resource for most of development. A few inaccuracies.
- TDD for C++ in CMake And GoogleTest
- A Look At The Game Boy Bootstrap: Let The Fun Begin! Very useful guide during initial CPU debugging
- DECODING Z80 OPCODES Used for implementing the 0xCB instruction decoding (note the 0xCB instructions are not exactly the same between Gameboy and z80. For opcodes 0xCB30 - 0xCB37 Gameboy has SWAP instructions; z80 has SLLs.
- TCAGBD

