diff --git a/README.md b/README.md index b4c84b87..514ad68e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [js-dos 6.22](https://js-dos.com) =========== -[![Build Status](https://travis-ci.org/caiiiycuk/js-dos.svg?branch=6.22)](https://travis-ci.org/caiiiycuk/js-dos) +[![Build Status](https://travis-ci.org/caiiiycuk/js-dos.svg?branch=6.22)](https://travis-ci.org/caiiiycuk/js-dos) [![By Me A Coffee](/bmc.png)](https://www.buymeacoffee.com/caiiiycuk) 6.22 is a javascript library that allows you to run DOS programs in browser. js-dos provides nice and easy to use javascript api over dosbox. Try our demo app. @@ -195,7 +195,8 @@ By default js-dos uses builtin dosbox [config](https://js-dos.com/6.22/docs/api/ You have option to change frequently used parameters through [DosOptions](https://js-dos.com/6.22/docs/api/generate.html?page=js-dos-options). For example, you can change `cycles` (amount of instructions DOSBox tries to emulate each millisecond): ```javascript - Dos(canvas, { cycles: 1000, }) // also can be "auto", "max" + Dos(canvas, { cycles: 1000, }) // also can be "auto", "max" + // look to DosOptions for other paramters .ready((fs, main) => ...) .catch((message) => console.error(message)); ``` @@ -262,9 +263,13 @@ So, for giving example resolution will be 640x320, but canvas size will be 1280x ### Mouse locking -By default dosbox mouse will follow browser cursor. However you can change this behaviour by providing `autolock=true` in -dosbox.conf. Then mouse starts follow browser cursor after first click (lock), and you can unlock mouse by pressing `CTRL+F10`. +By default dosbox mouse will follow browser cursor without locking. It means that js-dos will not take exclusive control over mouse pointer. However you can change this behaviour by providing `autolock=true` in +`dosbox.conf` or through [DosOptions](https://js-dos.com/6.22/docs/api/generate.html?page=js-dos-options). Then js-dos will take exclusive control and lock mouse inside js-dos container (you can't leave it). This will happen after first click, and you can unlock mouse by pressing `CTRL+F10` or `ESC`. ```javascript + Dos(canvas, { autolock: true }).ready((fs, main) => { + main([...]); + }); +// OR Dos(canvas).ready((fs, main) => { fs.createFile("dosbox.conf", ` [sdl] diff --git a/dist/docs/api/js-dos-ts/js-dos-build.md b/dist/docs/api/js-dos-ts/js-dos-build.md index c01b14a5..3f251d29 100644 --- a/dist/docs/api/js-dos-ts/js-dos-build.md +++ b/dist/docs/api/js-dos-ts/js-dos-build.md @@ -20,8 +20,8 @@ gulpfile.js --> generateBuildInfo ``` export const Build = { - version: "6.22.33 (008ca316c070f0c1d6f35a178dfda2da)", - jsVersion: "51fa69e2fa69b8f9846f0b10a237037f0751188a", + version: "6.22.34 (9a6dff6b54449dbce1df06a85eec9f9a)", + jsVersion: "d90b538345fdd487cf9052d6ffab41a68c648e95", jsSize: 197995, wasmVersion: "6d74a1bed329522e5371acaec19b753f", wasmSize: 1808925, diff --git a/dist/docs/api/js-dos-ts/js-dos-options.md b/dist/docs/api/js-dos-ts/js-dos-options.md index a10eaa5f..c2e8cedf 100644 --- a/dist/docs/api/js-dos-ts/js-dos-options.md +++ b/dist/docs/api/js-dos-ts/js-dos-options.md @@ -25,14 +25,19 @@ export class DosBoxConfig { cycles: Amount of instructions DOSBox tries to emulate each millisecond. Setting this value too high results in sound dropouts and lags. + Cycles can be set in 3 ways: + 'auto' tries to guess what a game needs. It usually works, but can fail for certain games. + 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails. (Example: fixed 4000). + 'max' will allocate as much cycles as your computer is able to handle. + ``` @@ -48,6 +53,14 @@ export class DosBoxConfig { autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) + By default dosbox mouse will follow browser cursor without locking. + It means that js-dos will not take exclusive control over mouse pointer. + However you can change this behaviour by providing `autolock=true` in + `dosbox.conf` or throug h [DosOptions](https://js-dos.com/6.22/docs/api/generate.html?page=js-dos-options). + Then js-dos will take exclusive control and lock mouse inside js-dos container (you can't leave it). + This will happen after first click, and you can unlock mouse by pressing `CTRL+F10` or `ESC`. + + diff --git a/js-dos-ts/js-dos-build.ts b/js-dos-ts/js-dos-build.ts index b43a8f51..4aa76753 100644 --- a/js-dos-ts/js-dos-build.ts +++ b/js-dos-ts/js-dos-build.ts @@ -3,8 +3,8 @@ // gulpfile.js --> generateBuildInfo export const Build = { - version: "6.22.33 (008ca316c070f0c1d6f35a178dfda2da)", - jsVersion: "51fa69e2fa69b8f9846f0b10a237037f0751188a", + version: "6.22.34 (9a6dff6b54449dbce1df06a85eec9f9a)", + jsVersion: "d90b538345fdd487cf9052d6ffab41a68c648e95", jsSize: 197995, wasmVersion: "6d74a1bed329522e5371acaec19b753f", wasmSize: 1808925, diff --git a/js-dos-ts/js-dos-options.ts b/js-dos-ts/js-dos-options.ts index f8c3f646..723d83ee 100644 --- a/js-dos-ts/js-dos-options.ts +++ b/js-dos-ts/js-dos-options.ts @@ -7,14 +7,27 @@ export class DosBoxConfig { public cycles?: number | string; // cycles: Amount of instructions DOSBox tries to emulate each millisecond. // Setting this value too high results in sound dropouts and lags. +// // Cycles can be set in 3 ways: +// // 'auto' tries to guess what a game needs. // It usually works, but can fail for certain games. +// // 'fixed #number' will set a fixed amount of cycles. This is what you usually need if 'auto' fails. // (Example: fixed 4000). +// // 'max' will allocate as much cycles as your computer is able to handle. +// public autolock?: boolean; // autolock: Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock) +// +// By default dosbox mouse will follow browser cursor without locking. +// It means that js-dos will not take exclusive control over mouse pointer. +// However you can change this behaviour by providing `autolock=true` in +// `dosbox.conf` or throug h [DosOptions](https://js-dos.com/6.22/docs/api/generate.html?page=js-dos-options). +// Then js-dos will take exclusive control and lock mouse inside js-dos container (you can't leave it). +// This will happen after first click, and you can unlock mouse by pressing `CTRL+F10` or `ESC`. +// } // tslint:disable-next-line:max-classes-per-file diff --git a/package.json b/package.json index 0fa7f498..b85b8620 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "js-dos", - "version": "6.22.33", + "version": "6.22.34", "description": "Easiest API to run dos programs in browser", "main": "dist/js-dos.js", "types": "dist/typescript/js-dos.ts",