Gekkio / mooneye-gb

A Game Boy research project and emulator written in Rust
GNU General Public License v3.0
892 stars 56 forks source link

Draw window only when both LCDC.0 and LCDC.5 are enabled #164

Open rhysd opened 2 years ago

rhysd commented 2 years ago

Window should be rendered only when LCDC.0 and LCDC.5 are enabled. But mooneye-gb checks only LCDC.5. This PR fixes the point.

PanDocs: https://gbdev.io/pandocs/LCDC.html#ff40---lcdc-lcd-control-rw

rhysd commented 2 years ago

The diff may look a bit complicated, but actually this PR simply moves the if clause for rendering window into the if clause for rendering background so that the window can be rendered only when the background is rendered. (Please check 'Hide whitespace' diff setting in the review page)