SMask emulation
Merge pull request #4161 from yurydelendik/smask

SMask emulation