I've just completed a first version of a sprite 0 hit test ROM suite. In total there are almost 70 different tests performed, covering these main areas:
- Basic behavior
- Relative alignment of background and sprite
- Special cases like background off, left-edge clipping, etc.
- Corner cases and off-by-one errors
- Timing of beginning of frame, pixel, scanline, clearing at VBL
- When multiple pixels hit, which counts as the first hit
sprite_hit_tests.zip
Refer to other documentation for proper behavior or start a new thread if you are wondering about PPU operation (so this thread doesn't get swamped). Reply to this thread if you'd like a better description of what a particular failure code means.
I've improved the result reporting a bit to show the test name and PASS/FAIL. The test framework has also advanced so I can write this kind of test suite quickly (these have taken about 6 hours, where they usually take me days or weeks). This will help when writing future tests.
After writing these tests I've realized that sprite 0 hit allows all sorts of automated tests of the PPU, so I'm having several ideas for more things I can write solid tests for. With sprite 0 hit one can read the entire screen! (though only 60 pixels per frame)
Feedback welcome.
- Basic behavior
- Relative alignment of background and sprite
- Special cases like background off, left-edge clipping, etc.
- Corner cases and off-by-one errors
- Timing of beginning of frame, pixel, scanline, clearing at VBL
- When multiple pixels hit, which counts as the first hit
sprite_hit_tests.zip
Refer to other documentation for proper behavior or start a new thread if you are wondering about PPU operation (so this thread doesn't get swamped). Reply to this thread if you'd like a better description of what a particular failure code means.
I've improved the result reporting a bit to show the test name and PASS/FAIL. The test framework has also advanced so I can write this kind of test suite quickly (these have taken about 6 hours, where they usually take me days or weeks). This will help when writing future tests.
After writing these tests I've realized that sprite 0 hit allows all sorts of automated tests of the PPU, so I'm having several ideas for more things I can write solid tests for. With sprite 0 hit one can read the entire screen! (though only 60 pixels per frame)
Feedback welcome.