For over 5 years , the emscripten project has existed. During the existence of the project has been done a lot of work. Surprise the sophisticated reader has become much more difficult. We have already seen DOOM, Dune 2, TTD, C & C and a lot more in the browser. However, it is still difficult to launch a DOS program in the browser: you need to understand C / C ++ and emscripten not bad. Experiments with Dosbox resulted in an em-dosbox project, most DOS programs are available for the browser. To put an end, it remains only to create an open API for running DOS programs in the browser..dosbox-container { width: 640px; height: 400px; } <div id="dosbox"></div> 01. <script type="text/javascript" src="http://js-dos.com/cdn/js-dos-api.js"></script> 02. <script type="text/javascript"> 03. var dosbox = new Dosbox({ 04. id: "dosbox", 05. onload: function (dosbox) { 06. dosbox.run("http://js-dos.com/cdn/alley_cat.zip", "./CAT.EXE"); 07. }, 08. onrun: function (dosbox, app) { 09. console.log("App '" + app + "' is runned"); 10. } 11. }); 12. </script> 06. dosbox.run("http://js-dos.com/cdn/alley_cat.zip", "./CAT.EXE"); <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>js-dos api</title> <style type="text/css"> .dosbox-container { width: 640px; height: 400px; } .dosbox-container > .dosbox-overlay { background: url(http://js-dos.com/cdn/alley_cat.png); } .dosbox-start { font-size: 35px !important; } </style> </head> <body> <div id="dosbox"></div> <br/> <button onclick="dosbox.requestFullScreen();">Make fullscreen</button> <script type="text/javascript" src="http://js-dos.com/cdn/js-dos-api.js"></script> <script type="text/javascript"> var dosbox = new Dosbox({ id: "dosbox", onload: function (dosbox) { dosbox.run("http://js-dos.com/cdn/alley_cat.zip", "./CAT.EXE"); }, onrun: function (dosbox, app) { console.log("App '" + app + "' is runned"); } }); </script> </body> </html> Source: https://habr.com/ru/post/271363/
All Articles