Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird black lines while loading Quartet's border #198

Open
ISSOtm opened this issue Mar 2, 2021 · 4 comments
Open

Weird black lines while loading Quartet's border #198

ISSOtm opened this issue Mar 2, 2021 · 4 comments
Labels
help wanted Extra attention is needed research

Comments

@ISSOtm
Copy link
Member

ISSOtm commented Mar 2, 2021

For some reason, during Quartet's initial load, the border briefly flashes with dark lines. Investigate and document why. (Note: if the bugs ends up fixed on that download page, it's still present in the cracktro.)

Tip: the bug reproduces on Mesen-S, which has both a GB and SNES debugger, so it should be easier to figure out.

@ISSOtm ISSOtm added help wanted Extra attention is needed research labels Mar 2, 2021
@paulb-nl
Copy link

paulb-nl commented Jul 7, 2021

When a new border is loaded the SGB first copies the tilemap of the empty black border at address $028E90 which is filled with tile 1 (address $0020) to VRAM address $7800 (word address $3C00). Normally tile 1 is a non-transparent tile with black palette. After that the new tilemap is copied. So if the black border is selected then it copies it twice.

Quartet puts a transparent tile at tile address $0020 with a single row of non-transparent black pixels at the bottom. When the SGB copies the tilemap of the black border the Gameboy background color is white so the white color is visible through the transparent tile except for the black line at the bottom of the tile.

Then the SGB copies the new tilemap from Quartet which is filled with tile 0 and that tile is fully transparent so the lines disappear.

@ISSOtm
Copy link
Member Author

ISSOtm commented Jul 7, 2021

Then why does it not occur with other games? The cracktro, for example, uses a different border, byt IIRC is not subject to this despite having a non-blank tile 1.

@paulb-nl
Copy link

paulb-nl commented Jul 7, 2021

The cracktro has a non-transparent tile 1 that's why it doesn't occur. Quartet has a transparent tile 1 (except for the bottom row of pixels) so the white background comes through.

Games can avoid this issue by using a non-transparent tile 1 or by making sure that the Gameboy background color is black while using MASK_EN

@ISSOtm
Copy link
Member Author

ISSOtm commented Jul 8, 2021

This should be confirmed in the SGB BIOS (ideally updating sgb-bios so that it can be cited), and then added to the docs. Thanks!

(Another item on my long TODO list; if anyone's willing to do it instead, feel free to ping us for any help.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed research
Projects
None yet
Development

No branches or pull requests

2 participants