Advertisement
Guest User

Untitled

a guest
Apr 19th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.       xhr.open('GET', 'emulators/dosbox/dosbox.wasm')
  2.       xhr.responseType = 'arraybuffer';
  3.       xhr.addEventListener('load', function(ev) {
  4.         console.log('loaded!', ev);
  5.         var code = xhr.response;
  6.         runExecutable('win.bat', code);
  7.       });
  8.       xhr.send();
  9.  
  10.       function runExecutable(exe, code) {
  11.         var emulator = new Emulator(canvas,
  12.           null,
  13.           new DosBoxLoader(
  14.             DosBoxLoader.emulatorJS("emulators/dosbox/dosbox.wasm.js"),
  15.             DosBoxLoader.locateAdditionalEmulatorJS(function() { return "emulators/dosbox/dosbox.html.mem"; }),
  16.             DosBoxLoader.nativeResolution(1024, 1024),
  17.             DosBoxLoader.mountZip("c", DosBoxLoader.fetchFile("Game File", "systems/ibmpc/win311.zip")),
  18.             DosBoxLoader.startExe(exe)
  19.           )
  20.         );
  21.         emulator.setCallbacks({
  22.           before_emulator: function() {
  23.             Module.wasmBinary = code;
  24.           }
  25.         })
  26.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement