{"id":18793330,"url":"https://github.com/mattcurrie/dmg-acid2","last_synced_at":"2025-04-13T09:36:48.102Z","repository":{"id":147654759,"uuid":"256661986","full_name":"mattcurrie/dmg-acid2","owner":"mattcurrie","description":"  😀 The Acid2 test, now for the original Game Boy! 😀","archived":false,"fork":false,"pushed_at":"2024-05-23T20:52:52.000Z","size":1271,"stargazers_count":200,"open_issues_count":4,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T01:09:38.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattcurrie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-04-18T03:33:18.000Z","updated_at":"2025-03-26T18:39:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"57b54e51-e476-4528-9f57-9a0fdf5866de","html_url":"https://github.com/mattcurrie/dmg-acid2","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattcurrie%2Fdmg-acid2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattcurrie%2Fdmg-acid2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattcurrie%2Fdmg-acid2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattcurrie%2Fdmg-acid2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattcurrie","download_url":"https://codeload.github.com/mattcurrie/dmg-acid2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248691492,"owners_count":21146373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T21:24:26.163Z","updated_at":"2025-04-13T09:36:48.067Z","avatar_url":"https://github.com/mattcurrie.png","language":"Assembly","funding_links":[],"categories":["Emulator Development","仿真器开发"],"sub_categories":["Testing","测试"],"readme":"# dmg-acid2\ndmg-acid2 is a test for developers of Game Boy (DMG) emulators to verify their\nemulation of the Game Boy's Pixel Processing Unit (PPU).\n\n[Download the ROM](https://github.com/mattcurrie/dmg-acid2/releases/download/v1.0/dmg-acid2.gb),\nor build using [RGBDS](https://github.com/rednex/rgbds):\n\n```\ngit clone --recurse-submodules https://github.com/mattcurrie/dmg-acid2\ncd dmg-acid2 \u0026\u0026 make\n```\n\nFor testing the Game Boy Color you can try [cgb-acid2](https://github.com/mattcurrie/cgb-acid2).\n\n## Reference Image\nAn accurate DMG emulator should generate output identical to the image below:\n\n![reference image](img/reference-dmg.png)\n\nAn accurate CGB emulator running in DMG mode should generate output identical\nto the image below:\n\n![reference image](img/reference-cgb.png)\n\nA DMG emulator should use these 8-bit values in greyscale images or in RGB\ncomponents to ensure the images can be compared correctly: \n`$00`, `$55`, `$AA`, `$FF`.\n\nWhen emulating a CGB running in DMG mode, you should use this formula to\nconvert each 5-bit CGB palette component to 8-bit: \n`(r \u003c\u003c 3) | (r \u003e\u003e 2)`\n\n* [Reference photo from DMG](https://github.com/mattcurrie/dmg-acid2/raw/master/img/photo-dmg.jpg) \n* [Reference photo from CGB](https://github.com/mattcurrie/dmg-acid2/raw/master/img/photo-cgb.jpg)\n\n## Emulator Requirements\nA simple line based renderer is sufficient to generate the correct output. This\nis NOT a [PPU timing torture test requiring T-cycle accuracy](https://github.com/mattcurrie/mealybug-tearoom-tests),\nand does NOT perform register writes during the PPU's mode 3.\n\nThe test uses LY=LYC coincidence interrupts to perform register writes on\nspecific rows of the screen during mode 2 (OAM scan).\n\n## Guide\n\n### Hello World!\nThe \"Hello World\" text is constructed from 10 objects, and the exclaimation\nmark is part of the background. There is also an additional solid white object\nwhere the exclaimation mark is. Due to the 10 object per line limit, the solid\nwhite object should not be drawn, allowing the background to show through.\n\n### Hair\nThe mohawk hair is not visible in the reference image. The hair tiles are \npart of the background. For rows 8-15, bit 0 of LCDC is reset, so the\nbackground should not be displayed, and instead color 0 from BGP should be\ndrawn on the screen.\n\n### Eyes\nThe eyes consist of four background/window tiles, and objects overlapping color\n0 background pixels.\n\nThe left eye is drawn using the background, and the right eye is drawn using\nthe window (and also the right edge of the head beside the right eye). At the\nbottom of the eye, the WX register is set to an off-screen value, so the window\nis hidden until the WX register is set again for drawing the right side of the\nchin.\n\nThe background/window tiles for the left half of both eyes have color 0 for the\npupil region of the eye. There are two dark grey colored objects that overlap\nthe left half of both eyes that have the OBJ-to-BG Priority (bit 7) set in the\nOAM flags, so the object will only show through color 0 of the background/\nwindow tile and replaces the white color.\n\nThe top half of each eye uses tile data from the $8000-8fff region of VRAM. The\nbottom half of each eye uses tile data from the $8800-97ff region of VRAM. \nThe bottom half of the eye uses tiles with index $a1 and $a2 to test that\nsigned tile indexes are displayed correctly.\n\n### Moles\nThe moles are not visible in the reference image, but can be seen in the\nfailure case images.\n\nThe mole beside the left eye is visible if the background tile data is read \nfrom $8000-8fff instead of $8800-97ff.\n\nThe mole left of the nose is not visible because a blank object with a lower\nX-coordinate has priority, even though it is defined later in OAM than the mole\nobject.\n\nThe mole right of the nose is not visible because a blank object at the same X\ncoordinate has priority because it occurs earlier in OAM than the mole object.\n\n### Nose\nThe nose consists of four objects using the same tile data that is flipped\nvertically and/or horizontally. The top left corner of the nose contains the\nunflipped tile.\n\n### Mouth\nThe mouth consists of eight 8x16 objects. The left and right edges of the mouth\ncontain unflipped tile data, and other objects use vertically flipped tile\ndata.\n\nFor the left side of the mouth, the objects specify tile index 12, and the right\nside of the mouth specify tile index 13. Because bit 0 of the tile index is\nignored for 8x16 objects, the whole mouth effectively uses tile index 12.\n\n### Chin\nThe right side of the chin is drawn using the window. After the right eye was\ndrawn, the window was hidden by setting WX to an off-screen value. For the\nright side of the chin, the WX value is restored to an on-screen value. After\nthe chin has been drawn, the window is disabled using bit 5 of the LCDC\nregister so the window does not cover the footer text.\n\nFor the right side of the chin, the window has been updated to use the tile map\nfrom the VRAM beginning at $9800.  Because 16 rows of window have already been\ndrawn for the eye, the right side of the chin is rendered starting from address\n$9840.\n\n### Footer Text\nFor the footer text, the background is set to use the $9c00-9fff region for\nthe map data, and tile data is set to come from the $8800-97ff region.\n\n## Failure Examples\nSee the table below for some examples of incorrect behaviour and the\ncorresponding attribute/flag. This is not intended to be an exhaustive list of\nall possible failures.\n\n| Failure Example | Failure Description | Functionality Tested |\n| --------------- | ------------------- | -------------------- |\n| ![failure image](img/failures/obj-palette.png) | Nose missing | Object Palette (bit 4) |\n| ![failure image](img/failures/obj-horizontal-flip.png) | Nose tiles flipped, right eyelash flipped | Object Horizontal Flip (bit 5) |\n| ![failure image](img/failures/obj-vertical-flip.png) | Nose tiles filpped, mouth straight, eye whites bottom left wrong | Object Vertical Flip (bit 6) |\n| ![failure image](img/failures/obj-to-bg-priority.png) | Eye whites left half wrong | Object to Background Priority (bit 7) |\n| ![failure image](img/failures/bg-enable.png) | Hair visible | Background Enable (bit 0) |\n| ![failure image](img/failures/obj-enable.png) | Tongue visible | Object Enable (bit 1) |\n| ![failure image](img/failures/obj-size.png) | Half of mouth missing | Object Size (bit 2) |\n| ![failure image](img/failures/bg-map.png) | Footer missing | Background Tile Map (bit 3) |\n| ![failure image](img/failures/tile-sel.png) | Eye whites top left quadrant wrong | Background/Window Tile Data (bit 4) |\n| ![failure image](img/failures/win-enable.png) | Half of footer missing | Window Enable (bit 5) |\n| ![failure image](img/failures/win-map.png) | Right chin missing | Window Tile Map (bit 6) |\n| ![failure image](img/failures/win-line-counter.png) | Eye displayed instead of right chin | Window internal line counter |\n| ![failure image](img/failures/obj-priority-lower-x.png) | Left mole visible | Object Priority Lower X Coordinate |\n| ![failure image](img/failures/obj-priority-same-x.png) | Right mole visible | Object Priority Same X Coordinate |\n| ![failure image](img/failures/10-obj-limit.png) | Hello World missing exclaimation mark (!) | 10 object per line limit |\n| ![failure image](img/failures/8x16-obj-tile-index-bit-0.png) | Half of mouth missing | Bit 0 of tile index for 8x16 objects should be ignored |\n\n## Credits\nHåkon Wium Lie and Ian Hickson for creation of the original \n[Acid2](http://www.acidtests.org/) web standards compliance test.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattcurrie%2Fdmg-acid2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattcurrie%2Fdmg-acid2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattcurrie%2Fdmg-acid2/lists"}