Mealybug Tearoom Tests
Game Boy emulator test ROMs.
This project contains some test ROMs I wrote to verify the correctness of my Game Boy emulator - Beaten Dying Moon.
Currently the tests focus on changes made to the PPU registers during STAT mode 3. This allows you to verify correct timing of the background tile and sprite data fetches as each scanline is rendered.
These tests examine very specific PPU behaviour/timings, so will give different results on a DMG compared to a CGB. Currently there are only expected result screenshots for when running on a DMG.
These tests are written to be easily automated. See the usage section below for details.
Pictures are always interesting so here are screenshots showing the expected results:
- RGBDS is required if you want to build the test ROMs yourself
- A Game Boy emulator and/or real Game Boy and flash cart to test on
Clone or download the project and run
makefrom the root directory. The test ROMs will be placed in the
builddirectory. You can also download an archive of the ROMs.
Check the results. You can check in the
expecteddirectory for screenshots from my Game Boy emulator (which I believe to be correct), and the
photosdirectory contains blurry photos of the ROMs running on real devices. My logic analyzer is in the post so I can try capturing screenshots from the real device :)
Automated testing can be achieved using the
comparecommand from imagemagick to get the number of pixels that are different when comparing the expected image to a screenshot from an emulator. The screenshot from the emulator can be generated when the
LD B,Bsoftware breakpoint is encountered. The screenshot from the emulator should use these colour values in greyscale images or in RGB components to ensure the images can be compared correctly:
An example imagemagick compare command is below.
resultwill contain the number of pixels that differ between the two images, so
result=$(compare -metric AE emulator-screenshot.png expected-result.png NULL: 2>&1)