That, and one window's start position could be another window's end position, etc. It's gotta do some sort of.. sorting to figure out what to do on a specific scanline in the case of overlaps?
I didn't even know that this was possible, honestly... the way I have it set up, each zone is set up from top to bottom with absolutely no overlap.
Yep, the sort is needed to allow for things to move on the screen ... there's the Sapphire example that I linked to. But it's not a common effect.
HuC is using a bubble-sort that exits early if there are no changes, so it's not *horribly* slow.
You're doing a good job by giving it a pre-sorted list of areas to deal with.
The classic causes for instability in an hsync split like that are ...
1) Running some code that delays the hsync interrupt for too long.
2) Having the interrupt-driven sorting code run at the same time that you're actually calling scroll() to change the screen position, and seeing a partially-written 16-bit value.
3) Letting something else interrupt the sorting code in the middle of its job.
I have no idea which of those situations you're hitting.
I forgot ... did you say whether you were using Squirrel or the System Card Player in timer mode instead of vsync mode?
I'll look at all of this stuff in detail, at some point, but I'll probably only be doing it for the even-newer HuC with the zero-page stack.