Skip to content

scrolling: Add note about disabling/re-enabling the window mid-frame #584

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

Merged
merged 2 commits into from
Mar 8, 2025

Conversation

bpeel
Copy link
Contributor

@bpeel bpeel commented Feb 24, 2025

Hi,

In a game I’m making I wanted to have the window be displayed at the top and bottom of the screen while showing the background layer for the middle part so that I could scroll it freely. I wasted quite a bit of time thinking it wasn’t working because I made the wrong assumption that it would use the tile map data from the bottom of the screen after re-enabling the window. I was wondering if it might be worth explicitly mentioning the actual behaviour in the Pandocs in case someone else runs into the same problem.

Adds a note explaining how the tile map is used if the window is
disabled and then re-enabled for a portion of the frame.
@avivace avivace requested review from LIJI32 and ISSOtm February 24, 2025 12:51
@alloncm
Copy link
Contributor

alloncm commented Feb 25, 2025

Hi, I'm not sure if I understand correctly but I think this behavior is already explained here, by the window internal line counter.

Perhaps this information should be more visible / moved to other page.

@bpeel
Copy link
Contributor Author

bpeel commented Feb 26, 2025

Hi, I'm not sure if I understand correctly but I think this behavior is already explained here, by the window internal line counter.

Oh! I must have read that at some point but didn’t remember it and then didn’t think to look at that page when trying to figure out why disabling the window didn’t seem to be working. I think it explains the workings better and more succinctly than my attempt.

Perhaps this information should be more visible / moved to other page.

Yes, I think it would be nice to move that information to the part about “mid-frame behaviour” because it is more directly related to that.

Copy link
Member

@ISSOtm ISSOtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this addition!

Co-authored-by: Eldred Habert <[email protected]>
Comment on lines +66 to +67
The way the Window selects which line of its tilemap to render may be surprising: the Y position is selected by an internal counter, which is reset to 0 during VBlank and **only** incremented when the Window starts being rendered on a given scanline.
In particular, this means that hiding the Window mid-frame in any way (via either `WX` or `LCDC`, usually to display a status bar at the top *and* bottom of the screen) will also inhibit incrementing that Y-position counter.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also reference this tip in the Tile Maps page or even move it / merge them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, this is now a "repetition", we could actually merge it there and link it from here or just keep it here and link it from there.. maybe let's open an issue about this so we don't block this one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #592

@nummacway
Copy link

Shouldn't this explain the Window's mid-scanline behaviour (changing LCDC.5, WX and WY mid-scanline) as well? Mid-scanline behaviour is explained for scrolling.

@ISSOtm
Copy link
Member

ISSOtm commented Mar 7, 2025

This would indeed be a good idea, but to get some improvements in, I'd rather do it in a separate PR.

@avivace
Copy link
Member

avivace commented Mar 8, 2025

Shouldn't this explain the Window's mid-scanline behaviour (changing LCDC.5, WX and WY mid-scanline) as well? Mid-scanline behaviour is explained for scrolling.

Yep, agree! Let's merge this in the meantime. I opened #591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants