Converting a DOS intro to JavaScript/HTML5
One day I had the idea of converting my fr29b DOS intro to JavaScript. Using the canvas element of HTML5, this should be an easy task and offer a good performance as well. To make the port as similar as possible, the standard VGA DOS palette should be supported. Drawing the ARGB values into the canvas can be speed up by using JavaScript typed arrays with an int32 view to write into the image data buffer. The DOS palette can be found in DOSBox source code and converted to a JavaScript usable format with this small code:
The initial framework JavaScript code:
The DOSBox VGA palette is given in 6-bit RGB and needs to be converted to modern RGB 8-bit:
The main loop and the effect itself:
Read other posts