-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Conversation
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.
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. |
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.
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. |
There was a problem hiding this 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]>
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened #592
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. |
This would indeed be a good idea, but to get some improvements in, I'd rather do it in a separate PR. |
Yep, agree! Let's merge this in the meantime. I opened #591 |
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.