Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xhr.open('GET', 'emulators/dosbox/dosbox.wasm')
- xhr.responseType = 'arraybuffer';
- xhr.addEventListener('load', function(ev) {
- console.log('loaded!', ev);
- var code = xhr.response;
- runExecutable('win.bat', code);
- });
- xhr.send();
- function runExecutable(exe, code) {
- var emulator = new Emulator(canvas,
- null,
- new DosBoxLoader(
- DosBoxLoader.emulatorJS("emulators/dosbox/dosbox.wasm.js"),
- DosBoxLoader.locateAdditionalEmulatorJS(function() { return "emulators/dosbox/dosbox.html.mem"; }),
- DosBoxLoader.nativeResolution(1024, 1024),
- DosBoxLoader.mountZip("c", DosBoxLoader.fetchFile("Game File", "systems/ibmpc/win311.zip")),
- DosBoxLoader.startExe(exe)
- )
- );
- emulator.setCallbacks({
- before_emulator: function() {
- Module.wasmBinary = code;
- }
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement