Skip to main content

Bundle creation

note
Historical background


Previous version (6.22) has a very simple API to run a DOS program in the browser.
BUT, before starting it you need to perform some setup:

  • download game archive (usually zip)
  • extract it
  • configure dos file system
  • configure dosbox options (cycles, renderer type, etc.)
  • configure controllers (mouse, keyboard type, etc.)

Often gameplay quality depends on good configuration.

Starting from js-dos v7, the API expects a js-dos bundle that already contains all configuration needed to start the DOS program. js-dos bundle is just a ZIP archive that contains the game itself and a js-dos configuration file (same as dosbox.conf file). For example, digger.jsdos contains:

.jsdos/dosbox.conf - dosbox configuration file (required)
.jsdos/jsods.json - additional configuration (optional)
DIGGER.COM - game file
note

File .jsdos/dosbox.conf is required. js-dos would not start if this file does not exist.

You can generate a js-dos bundle programmatically. But, we recommend you use our bundle generator Moreover you can search our database to see if someone already uploaded a js-dos bundle for a program.

Game Studio#

Game Studio is part of DOS.Zone community project. It's a recommended tool for creating js-dos bundles.

js-dos bundles generated with game studio always support the latest features that js-dos have. It generate configuration files for you.

Bundles that are generated by game studio is not licensed, you can use them whatever you want.

Read more on dos.zone

Advanced configuration#

.jsdos/dosbox.conf#

note

File .jsdos/dosbox.conf is required. js-dos would not start if this file does not exist.

This file is a regular dosbox configuration. Not all features are supported, but we will work on it.

.jsdos/jsdos.json#

This file contains additional configuration that does not exist in the dosbox configuration file. For example, it's used to configure gestures mapping. If you used game studio to create bundles then it will also contain all information from dosbox.conf. And it looks like:

{
// ...
"gestures": [
{
"joystickId": 0,
"event": "dir:up",
"mapTo": 265
},
// ...

This file can contain any configuration that you want. You can access it with Command Interface. For example:

const ci = await Dos(/*element*/).run(/*bundle url*/);
const config = await ci.config();
console.log(config.gestures);

This snippet will print information about gestures that config has. It's a very powerful feature, it can be used to add new optional features to js-dos. Read how to add client-side features in emulators-ui Contributing guide.