This is a set of blocks that imitate the P-Switch Blocks from Super Mario Bros. 3. smb3pswitch.asm is the actual P-Switch, and smb3pswblock.asm is a block that spawns the block. You have to adjust the Map16 number in the .asm file. Various other things can be changed too.
This fixes the problem where it wouldn't spawn if hit with sprites. LX5 fixed it by rewriting it.
Also included with it are additional routine macros (mandatory for this block to work.)
Credit goes to LX5 and Koyuki (Mirumo) for the originals!