I have good, bad and ugly news about the Towns layer wrap stuff.

The bad: turns out that the preliminary fix caused a small number of nasty one-line glitches in other games.

The good: I just fixed those, and the new code is not only simpler and more elegant, it also works much better with layer 1 sprites and vertical scrolling. And as a bonus, I have refactored the layer zoom code to be much less repetitive and implemented all 16 levels of zoom supported by the hardware, not only the first 5.

The ugly: I just spent two hours trying to fix all the one-line glitches... only to discover that some of them (the misplaced lines in the Vain Dream intro, for example) were NOT caused by the wrapping code, but by some other change between 0.192 and now. I still don't know which one, exactly. I'll try to take a look at it tomorrow.