Tip: Layer 3 backgrounds and tides disappear when you hit a message box, so plan your level around that. For example, you can add a sublevel without layer 3 at the start/midpoint, and include your message there.
Updated to fix a potential crash when the keyhole effect is activated at certain harmless-looking screen positions. The effect now appears at a configurable hard-coded location, the middle of the screen by default.
Tested with Asar 1.71, Lunar Magic 3.04, SA-1 1.32, Snes9x 1.59.2, GPS 1.4.1.