[WIP] SMask emulation