nba-emu / NanoBoyAdvance

A cycle-accurate Nintendo Game Boy Advance emulator.
GNU General Public License v3.0
955 stars 53 forks source link

Disabling sprites test gives incorrect results #357

Open alyosha-tas opened 4 months ago

alyosha-tas commented 4 months ago

I started making tests for examining the effect of disabling sprites midscanline. Currently Nanoboy Advance renders addtional scanlines of sprites even when disabled.

Here is the test: https://github.com/alyosha-tas/gba-tests/blob/master/ppu/Sprite_Disable_Midline.gba

The results should look like this:

correct_boxes

fleroviux commented 4 months ago

This probably is related to the weird latching of DISPCNT enable bits that I never understood why the hardware even behaves the way it does. Apparently back when I researched this I decided that sprites unlike backgrounds should check only the latched DISPCNT enable bits and not AND them with the current enable bits unlike backgrounds... I'm not sure why I concluded that but it's likely why the test is breaking