looks cool, does it prevent enemies from spawning in the room that's not displayed,
I was thinking of this too, but sadly no, since the sprite spawning is handled by LM.
One thing you can do however is not place sprites using LM, but manually using uberasm tool (loop all 12/22 slots). The provided routines (UberasmTool/libraryLibraryScrollLimits.asm) comes with an output that indicates the beginning or end of the scroll effect:
ScrollLimitMain: Carry flag. This is only set when the transition ends. This is called under gamemode 14
SetScrollBorder: $0D. This is only set during the first frame the transition triggers. This is called during level
I would recommend the latter option, after calling it, check the carry flag or $0D and from there write your own ASM code that do this:
You first delete the sprites (all 12/22 slots) before spawning the new ones (in the screen the player is going to).
Make sure all the sprites in the area processes off-screen (especially if the zone is more than a single screen wide or tall, else they would permanently disappear when despawning until you reenter the scroll zone). This can be done by setting $167A's bit 2 (%-----P--, ORA.b #%00000100 : STA !167A,x).
Note that this method causes the whole area to be limited to 12/22 sprite slots
lx5 Also thanks. I really wanted the camera to behave in a way so you can make L-shaped levels without the camera being able to focus outside the area. This is especially true for boss rooms.
A vanilla method in doing this can be achieved by using separate levels, but I would like hackers to be able to have multiple scroll sections per level, giving it a somewhat seamless transition without the reloading and fading to black.