From c295a75ff5032d9c68e7765a7b4f8f494dd73ac3 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 24 Feb 2025 10:09:07 +0100 Subject: [PATCH] scrolling: Add note about disabling/re-enabling the window mid-frame 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. --- src/Scrolling.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Scrolling.md b/src/Scrolling.md index 08cb52c2..54cddb1c 100644 --- a/src/Scrolling.md +++ b/src/Scrolling.md @@ -62,3 +62,5 @@ For the window to be displayed on a scanline, the following conditions must be m If the WY condition has already been triggered and at the start of a row the window enable bit was set, then resetting that bit before the WX condition gets triggered on that row yields a nice window glitch pixel where the window would have been activated. + +If the window is disabled for part of the rendering and then re-enabled later on in the same frame then the tile map data used to render the second part will be directly following the rows in memory for the first part with no gaps. This happens regardless of whether the window is disabled by setting its position offscreen or by clearing the window enable bit. For example, if you want to draw one row of tiles using the window at the top of screen and then another row of tiles at the bottom of the screen by disabling the window for the middle portion, then the tile map data used for rendering will be the first and second rows, not the first and 18th.