Have a Game Boy emulator you want to test for accuracy? This collection of compiled Game Boy test roms might help. It includes (in alphabetical order):
- AGE test roms
by me - Blargg's test roms
by Shay Green (a.k.a. Blargg) - cgb-acid2,
cgb-acid-hell and
dmg-acid2
by Matt Currie - firstwhite
by Damian Yerrick - Gambatte test suite
(as the original Gambatte repository is not public anymore we use
pokemon-speedrunning/gambatte-core
instead)
by sinamas - Mealybug Tearoom Tests
by Matt Currie - Mooneye Test Suite
by Joonas Javanainen - Mooneye Test Suite (wilbertpol)
by Joonas Javanainen and wilbertpol - rtc3test
by aaaaaa123456789 - SameSuite
by Lior Halphon
For each test rom we have to consider:
- Hardware: What Game Boy devices is a test compatible to? This is quite important as some tests will not run on all devices.
- Exit Condition: When is a test finished?
- Test Success/Failure: How do we identify test success and failure?
AGE test roms
test roms are located at age-test-roms/
inside the released zip file.
They are compiled with RGBDS.
Hardware: Tests have been verified on DMG-CPU-08 (DMG-CPU C blob), CPU-CGB-02 (CPU CGB B) and CPU-CGB-06 (CPU CGB E). Test names indicate compatible devices.
Exit Condition:
Each test rom executes opcode 0x40: LD B, B
when finished.
Test Success:
A test succeeds if the Game Boy's CPU registers contain the following
Fibonacci numbers: B = 3, C = 5, D = 8, E = 13, H = 21, L = 34
Blargg's test roms
are located at blargg/
inside the released zip file.
Hardware: Tests have been verified on DMG-CPU-08 (DMG-CPU C blob), CPU-CGB-02 (CPU CGB B) and CPU-CGB-06 (CPU CGB E).
Exit Condition: Each test has to run for a specific amount of (emulated) time:
test (cgb) | emulated seconds | CGB-B | CGB-E |
---|---|---|---|
cgb_sound |
37 | ❌1. | ✅2. |
cpu_instrs |
31 | ✅ | ✅ |
halt_bug |
2 | ✅ | ✅ |
instr_timing |
1 | ✅ | ✅ |
interrupt_time |
2 | ✅ | ✅ |
mem_timing |
3 | ✅ | ✅ |
mem_timing-2 |
4 | ✅ | ✅ |
cgb_sound
(CGB-B): Test case 3 fails with code04
. Test cases are repeated infinitely, the test never really finishes.cgb_sound
(CGB-E): Test cases are repeated infinitely, the test never really finishes.
test (dmg) | emulated seconds | DMG-C |
---|---|---|
cpu_instrs |
55 | ✅ |
dmg_sound |
36 | ✅3. |
halt_bug |
2 | ✅ |
instr_timing |
1 | ✅ |
interrupt_time |
2 | ❌4. |
mem_timing |
3 | ✅ |
mem_timing-2 |
4 | ✅ |
oam_bug |
todo | ✅ |
dmg_sound
(DMG-C): Test cases are repeated infinitely, the test never really finishes.interrupt_time
(DMG-C): Fails with checksum7F8F4AAF
(in case anyone is interested). This is a CGB-only rom, so failure was expected.
Test Success: A test has finished successfully if the emulator's screen matches the respective screenshot. For details on the screenshot RGB values please have a look at Gambatte screenshot colors below (screenshots were made using Gambatte's color correction).
cgb-acid2,
cgb-acid-hell,
dmg-acid2 and the
Mealybug Tearoom Tests
are located at cgb-acid2/
, cgb-acid-hell/
, dmg-acid2/
and
mealybug-tearoom-tests/
respectively.
They are compiled with RGBDS.
Hardware:
cgb-acid2
and dmg-acid2
don't require any T-cycle accurate timing and thus
probably work on any device.
However, I could not yet verify this.
For
Mealybug Tearoom Tests
there are
device specific results
provided
(note that we copy these screenshots next to the respective test roms when
bundling a release zip).
Exit Condition:
Each of these test roms executes opcode 0x40: LD B, B
when finished.
Test Success:
For each test rom there is a screenshot of the expected result.
Some tests come with multiple screenshots to cover different Game Boy hardware.
Matt Currie uses the formula
(X << 3) | (X >> 2)
for each Game Boy Color RGB channel.
DMG screenshots use RGB values #000000
, #555555
, #AAAAAA
and #FFFFFF
instead of greenish Game Boy colors.
The firstwhite
test rom is located at firstwhite/
inside the released zip file.
Hardware: According to the readme, the test should succeed on about every Game Boy device except for the Super Game Boy.
Exit Condition: In my experience the test result is visible nearly immediately. Terminating the test after half a second of emulation time should be more than enough.
Test Success:
The test succeeds when only a white screen is visible.
A corresponding screenshot is available.
You should use the formula (X << 3) | (X >> 2)
for each Game Boy Color RGB channel
and the RGB values #000000
, #555555
, #AAAAAA
and #FFFFFF
for DMG shades to make sure the screenshot matches.
Gambatte
test roms are located at gambatte/
inside the released zip file.
Hardware:
Test roms produce results for DMG (identified by dmg08
),
CGB (identified by cgb04c
) or both.
For details please have a look at
testrunner.cpp: main().
Based on the file names I guess Gambatte tests have been verified on
DMG-CPU-08 (unknown CPU version) and
CGB-CPU-04 (CPU CGB C).
Exit Condition: All Gambatte test roms finish after 15 Game Boy LCD frames (see testrunner.cpp: runTestRom()). That equals 1053360 Game Boy clock cycles or ~252 emulated milliseconds.
Test Success: There are different types of Gambatte test roms:
- Audio tests are identified by their file name containing
_outaudio0
or_outaudio1
. Depending on the_outaudio
value they are expected to either produce audio output or remain completely silent. - Tests displaying a hexadecimal result value on screen are identified by their
file name containing
_out<hex>
. The emulator screen has to be compared against a monochrome pattern found in testrunner.cpp to determine test success. - For some tests a
png
screenshot file with matching file name can be found next to the rom file.
Your emulator should use the RGB values #000000
, #555555
, #AAAAAA
and
#FFFFFF
as DMG shades instead of the classic greenish Game Boy colors to
compare the screenshots.
Gambatte calculates Game Boy Color RGB values using these formulas:
channel | formula |
---|---|
red | (R * 13 + G * 2 + B) / 2 |
green | (G * 3 + B) * 2 |
blue | (R * 3 + G * 2 + B * 11) / 2 |
The Mooneye Test Suite
is located at mooneye-test-suite/
inside the released zip file.
The test roms are compiled with WLA DX.
Hardware:
Tests limited to specific devices will contain a hint in their file name.
For example,
acceptance/boot_regs-dmgABC.gb
is tailored to
DMG-CPU A, B and C
while acceptance/boot_regs-sgb.gb
works only on
SGB devices.
Please see Test naming
for further details.
Exit Condition:
Each Mooneye test rom executes opcode 0x40: LD B, B
when finished.
The maximal runtime for a test is 120 emulated seconds (see
mooneye_suite.rs).
Test Success:
A test succeeds if the Game Boy's CPU registers contain the following
Fibonacci numbers: B = 3, C = 5, D = 8, E = 13, H = 21, L = 34
The Mooneye Test Suite extended by wilbertpol
is located at mooneye-test-suite-wilbertpol/
inside the released zip file.
Test roms are compiled with WLA DX v9.6
as more recent versions of WLA-DX are not compatible.
The test suite works similar to the original Mooneye Test Suite
with one exception regarding the Exit Condition:
instead of executing opcode 0x40: LD B, B
to indicate a finished test,
opcode 0xED (undefined)
is executed
(this is how the Mooneye Test Suite
worked back in 2016).
The rtc3test rom
is located at rtc3test/
inside the released zip file.
We have to use RGBDS v0.4
for compilation as the code is not compatible to
current RGBDS versions.
Hardware: The rom examines MBC3's real time clock and not the Game Boy hardware by itself. It should behave similar on all Game Boy devices.
Exit Condition: rtc3test consist of three sub-tests. At startup the user has to select the sub-test to run. You will have to emulate pressing the respective Game Boy buttons and after that wait for the sub-test to finish.
The procedure should be the same on all Game Boy devices.
sub-test | press buttons | test duration (seconds) |
---|---|---|
basic tests | A | 13 |
range tests | down, A | 8 |
sub-second writes | down, down, A | 26 |
Test Success:
For each sub-test there is a screenshot of the expected result.
CGB screenshots were created using the formula
(X << 3) | (X >> 2)
for each Game Boy Color RGB channel.
DMG screenshots use RGB values #000000
, #555555
, #AAAAAA
and #FFFFFF
instead of the greenish DMG LCD colors.
SameSuite
test roms are located at same-suite/
inside the released zip file.
They are compiled with RGBDS.
Hardware: Some SameSuite apu tests only work on CPU CGB E. I could not find any compatibility information for non-apu tests.
Exit Condition:
Each test rom executes opcode 0x40: LD B, B
when finished.
Test Success:
A test succeeds if the Game Boy's CPU registers contain the following
Fibonacci numbers: B = 3, C = 5, D = 8, E = 13, H = 21, L = 34