In browser
#
1. Using js-dos apiTo run bundle
you just need a one line of code:
Dos
receives HTMLDivElement and use it to create the player UI. To run bundle
just use its method run
specifying the url of jsdos bundle.
To use js-dos you need to add js-dos.js
script and js-dos.css
files (releases) to
html page.
info
By default, js-dos will load wasm modules relatively from current path,
you should specify variable pathPrefix
if you want to load them from different place:
Complete example:
#
2. Using emulators-ui (without js-dos services)js-dos v7 is based on emulators
and emulators-ui
packages. It provide additinal services over this two packages, if you don't need them, then you can use emulators
and emulators-ui
packages directly.
To change code above to use emulators
and emulators-ui
just change scripts imports to:
Complete example:
#
3. Using emulatorsIn case you don't want to use the browser API of js-dos project, you can use just the emulators
package. Read the guide to how we use emulators
to estimate js-dos performance.