Multi-window HDMA — both windows' edges driven per scanline.
Port of krom (Peter Lemon)'s WindowMultiHDMA demo (PeterLemon/SNES, PPU/Window/WindowMultiHDMA). One HDMA channel in 4-register mode streams WH0-WH3 ($2126-$2129) — BOTH windows' left/right edges — every scanline band, cutting a grid of portholes into BG1. The green backdrop (CGRAM color 0) shows wherever the combined window mask disables the layer; the D-pad scrolls the artwork underneath the static mask.
Window algebra (krom's exact setup): W1 and W2 both enabled on BG1 and both INVERTED, combined with AND — the layer is masked where (outside W1) AND (outside W2), i.e. visible inside either window.
- SNES Concepts
- HDMA_MODE_4REG: one channel drives 4 consecutive PPU registers/line
- Two windows animated per scanline (hdmaWindowShape covers only one)
- W12SEL / WBGLOG / TMW via windowEnable/windowSetInvert/ windowSetLogic/windowSetMainMask
- Backdrop color as the "outside the windows" fill
- What to Observe
- A grid of rectangular portholes over a color-ring artwork; green everywhere else. D-pad scrolls the rings behind the fixed portholes.
- Modules Used
- console, dma, background, hdma, window, input
- See also
- https://github.com/PeterLemon/SNES — original demo
-
window.h, hdma.h (HDMA_MODE_4REG)