https://github.com/mattcurrie/dmg-acid2 Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} mattcurrie / dmg-acid2 Public * Notifications You must be signed in to change notification settings * Fork 12 * Star 155 The Acid2 test, now for the original Game Boy! License MIT license 155 stars 12 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 3 * Pull requests 1 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights mattcurrie/dmg-acid2 This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 5 Commits img img inc inc mgblib @ mgblib @ 5d829bf 5d829bf src src .gitignore .gitignore .gitmodules .gitmodules LICENSE LICENSE Makefile Makefile README.md README.md View all files Repository files navigation * README * MIT license dmg-acid2 dmg-acid2 is a test for developers of Game Boy (DMG) emulators to verify their emulation of the Game Boy's Pixel Processing Unit (PPU). Download the ROM, or build using RGBDS: git clone --recurse-submodules https://github.com/mattcurrie/dmg-acid2 cd dmg-acid2 && make For testing the Game Boy Color you can try cgb-acid2. Reference Image An accurate DMG emulator should generate output identical to the image below: reference image An accurate CGB emulator running in DMG mode should generate output identical to the image below: reference image A DMG emulator should use these 8-bit values in greyscale images or in RGB components to ensure the images can be compared correctly: $00, $55, $AA, $FF. When emulating a CGB running in DMG mode, you should use this formula to convert each 5-bit CGB palette component to 8-bit: (r << 3) | (r >> 2) * Reference photo from DMG * Reference photo from CGB Emulator Requirements A simple line based renderer is sufficient to generate the correct output. This is NOT a PPU timing torture test requiring T-cycle accuracy, and does NOT perform register writes during the PPU's mode 3. The test uses LY=LYC coincidence interrupts to perform register writes on specific rows of the screen during mode 2 (OAM scan). Guide Hello World! The "Hello World" text is constructed from 10 objects, and the exclaimation mark is part of the background. There is also an additional solid white object where the exclaimation mark is. Due to the 10 object per line limit, the solid white object should not be drawn, allowing the background to show through. Hair The mohawk hair is not visible in the reference image. The hair tiles are part of the background. For rows 8-15, bit 0 of LCDC is reset, so the background should not be displayed, and instead color 0 from BGP should be drawn on the screen. Eyes The eyes consist of four background/window tiles, and objects overlapping color 0 background pixels. The left eye is drawn using the background, and the right eye is drawn using the window (and also the right edge of the head beside the right eye). At the bottom of the eye, the WX register is set to an off-screen value, so the window is hidden until the WX register is set again for drawing the right side of the chin. The background/window tiles for the left half of both eyes have color 0 for the pupil region of the eye. There are two dark grey colored objects that overlap the left half of both eyes that have the OBJ-to-BG Priority (bit 7) set in the OAM flags, so the object will only show through color 0 of the background/ window tile and replaces the white color. The top half of each eye uses tile data from the $8000-8fff region of VRAM. The bottom half of each eye uses tile data from the $8800-97ff region of VRAM. The bottom half of the eye uses tiles with index $a1 and $a2 to test that signed tile indexes are displayed correctly. Moles The moles are not visible in the reference image, but can be seen in the failure case images. The mole beside the left eye is visible if the background tile data is read from $8000-8fff instead of $8800-97ff. The mole left of the nose is not visible because a blank object with a lower X-coordinate has priority, even though it is defined later in OAM than the mole object. The mole right of the nose is not visible because a blank object at the same X coordinate has priority because it occurs earlier in OAM than the mole object. Nose The nose consists of four objects using the same tile data that is flipped vertically and/or horizontally. The top left corner of the nose contains the unflipped tile. Mouth The mouth consists of eight 8x16 objects. The left and right edges of the mouth contain unflipped tile data, and other objects use vertically flipped tile data. For the left side of the mouth, the objects specify tile index 12, and the right side of the mouth specify tile index 13. Because bit 0 of the tile index is ignored for 8x16 objects, the whole mouth effectively uses tile index 12. Chin The right side of the chin is drawn using the window. After the right eye was drawn, the window was hidden by setting WX to an off-screen value. For the right side of the chin, the WX value is restored to an on-screen value. After the chin has been drawn, the window is disabled using bit 5 of the LCDC register so the window does not cover the footer text. For the right side of the chin, the window has been updated to use the tile map from the VRAM beginning at $9800. Because 16 rows of window have already been drawn for the eye, the right side of the chin is rendered starting from address $9840. Footer Text For the footer text, the background is set to use the $9c00-9fff region for the map data, and tile data is set to come from the $8800-97ff region. Failure Examples See the table below for some examples of incorrect behaviour and the corresponding attribute/flag. This is not intended to be an exhaustive list of all possible failures. Failure Failure Description Functionality Tested Example failure Nose missing Object Palette (bit 4) image failure Nose tiles flipped, right Object Horizontal Flip (bit image eyelash flipped 5) failure Nose tiles filpped, mouth Object Vertical Flip (bit image straight, eye whites bottom left 6) wrong failure Eye whites left half wrong Object to Background image Priority (bit 7) failure Hair visible Background Enable (bit 0) image failure Tongue visible Object Enable (bit 1) image failure Half of mouth missing Object Size (bit 2) image failure Footer missing Background Tile Map (bit 3) image failure Eye whites top left quadrant Background/Window Tile Data image wrong (bit 4) failure Half of footer missing Window Enable (bit 5) image failure Right chin missing Window Tile Map (bit 6) image failure Eye displayed instead of right Window internal line image chin counter failure Left mole visible Object Priority Lower X image Coordinate failure Right mole visible Object Priority Same X image Coordinate failure Hello World missing exclaimation 10 object per line limit image mark (!) failure Bit 0 of tile index for image Half of mouth missing 8x16 objects should be ignored Credits Hakon Wium Lie and Ian Hickson for creation of the original Acid2 web standards compliance test. About The Acid2 test, now for the original Game Boy! Resources Readme License MIT license Activity Stars 155 stars Watchers 7 watching Forks 12 forks Report repository Releases 1 Initial Release Latest Apr 18, 2020 Packages 0 No packages published Contributors 2 * @mattcurrie mattcurrie Matt Currie * @tobiasvl tobiasvl Tobias V. Langhoff Languages * Assembly 94.7% * Makefile 5.3% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.