"Turha on ovea avata" was originally made for MS/DOS using the MIDAS sound library and common "mode 13" rendering in standard 320x200x256 VGA resolution. Porting the graphics rendering from the original C++ code was trivial, just a matter of mapping the VGA-sized buffer on a SDL_Surface and rewriting the assembly code for manipulating the VGA palette registers for the corresponding SDL palette function calls. The sound system, MIDAS, had to be replaced with libxmp for proper SDL audio output and demo synchronization, because the visuals are synced to the current playing position number in the Impulse Tracker-formatted soundtrack. This was then all compiled using Emscripten, which is a LLVM-based compiler system that compiles C and C++ into JavaScript, including support for libSDL out of the box. You can find a well-written tutorial for Emscripten porting on Jari Komppa's website.