{"id":15622451,"url":"https://github.com/superilu/dojs","last_synced_at":"2025-05-15T04:08:08.760Z","repository":{"id":36192328,"uuid":"170185910","full_name":"SuperIlu/DOjS","owner":"SuperIlu","description":"A MS-DOS Creative Coding IDE/platform based on JavaScript ","archived":false,"fork":false,"pushed_at":"2025-03-29T17:03:51.000Z","size":95424,"stargazers_count":890,"open_issues_count":14,"forks_count":34,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-14T05:57:20.283Z","etag":null,"topics":["3dfx","allegro","djgpp","dos","dzcomm","freedos","glide","hacktoberfest","javascript","ms-dos","msdos","mujs","p5js","processing","retro","retrocomputing","retrogaming","voodoo-card"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperIlu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-11T19:11:35.000Z","updated_at":"2025-04-09T13:28:56.000Z","dependencies_parsed_at":"2023-02-12T05:01:37.416Z","dependency_job_id":"b0275a23-92e4-44e5-9ee5-1abc64263dac","html_url":"https://github.com/SuperIlu/DOjS","commit_stats":{"total_commits":60,"total_committers":6,"mean_commits":10.0,"dds":0.4,"last_synced_commit":"cdc7c7fdb080c54c26cc4b60566c335441d29401"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperIlu%2FDOjS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperIlu%2FDOjS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperIlu%2FDOjS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperIlu%2FDOjS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperIlu","download_url":"https://codeload.github.com/SuperIlu/DOjS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254270656,"owners_count":22042860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dfx","allegro","djgpp","dos","dzcomm","freedos","glide","hacktoberfest","javascript","ms-dos","msdos","mujs","p5js","processing","retro","retrocomputing","retrogaming","voodoo-card"],"created_at":"2024-10-03T09:54:03.680Z","updated_at":"2025-05-15T04:08:03.740Z","avatar_url":"https://github.com/SuperIlu.png","language":"C","readme":"# DOjS\n## A DOS JavaScript Canvas with sound.\n[DOjS](https://github.com/SuperIlu/DOjS) is a JavaScript programming environment for systems running MS-DOS, [FreeDOS](http://freedos.org/) or any DOS based Windows (like 95, 98, ME). There are experimental ports for Linux and Win32 (Windows 98 or never) as well.\nIt features an integrated editor, graphics \u0026 sound output, mouse/keyboard/joystick input and more (see below).\nIt was inspired by [Processing](https://processing.org/) which is described on [Wikipedia](https://en.wikipedia.org/wiki/Processing_(programming_language)) as:\n\n\u003e Processing is an open-source graphical library and integrated development environment (IDE) / playground built for the electronic arts, new media art, and visual design communities with the purpose of teaching non-programmers the fundamentals of computer programming in a visual context.\n\nIt also has a p5js compatibility mode where some of the functions of [p5js](https://p5js.org/) are available and scripts can have a similar structure to Processing sketches.\n\nYou can type in a script with the builtin or your favorite text editor and then run it on a DOS command prompt.\n\nDOjS is pronounces like [doge](https://en.wikipedia.org/wiki/Doge_(meme)), but ending with an \"s\".\n\nDOjS was only possible due to the work of these people/projects:\n  * [MuJS](https://mujs.com/) JavaScript interpreter\n  * The [Allegro library](https://liballeg.org/) and [Allegro XC](https://github.com/msikma/allegro-4.2.2-xc)\n  * [DJGPP](http://www.delorie.com/djgpp/) from DJ Delorie and the [Linux compile scripts](https://github.com/jwt27/build-gcc) by jwt27.\n  * The people that contributed to [p5js](https://p5js.org/).\n  * The Glide source cleanup of [Ozkan Sezer](https://github.com/sezero/glide).\n  * [AllegroPNG](http://alpng.sourceforge.net/) PNG loader for Allegro\n  * [DZCOMM](http://dzcomm.sourceforge.net/) COM port library\n  * [libcpuid](https://github.com/anrieff/libcpuid) for cpuid module\n  * [curl](https://curl.se/) and [OpenSSL](https://www.openssl.org/) for curl module\n  * [cylindrix](https://sourceforge.net/projects/cylindrix/) for IPX module\n  * [nanosvg](https://github.com/memononen/nanosvg) for SVG loading\n  * [noise](https://github.com/stegu/perlin-noise) for perlin noise generation\n  * [genann](https://github.com/codeplea/genann) for neural network engine\n  * [SQLite](https://www.sqlite.org/index.html) for sqlite module\n  * [Watt32](https://github.com/gvanem/Watt-32.git) for TCP/IP networking\n  * [zip](https://github.com/kuba--/zip) for ZIP file access\n  * [zlib](http://zlib.net/) for compression\n  * [libjpeg](http://ijg.org/) for JPEG loading\n  * [AnimatedGIF](https://github.com/bitbank2/AnimatedGIF/) for rendering GIF animations.\n  * [PL_MPEG](https://github.com/phoboslab/pl_mpeg) for mpeg1 decoding\n  * [pdfgen](https://github.com/AndreRenaud/PDFGen) for PDF rendering.\n  * [micromod](https://github.com/martincameron/micromod) for MOD playback.\n  * [ibxm](https://github.com/martincameron/micromod) for MOD, S3M and XM playback.\n  * [ini](https://github.com/rxi/ini) for INI file reading.\n  * [Mesa](https://www.mesa3d.org/) for OpenGL\n  * [libwebp](https://chromium.googlesource.com/webm/libwebp) for WebP decoding/encoding\n  * [libtiff](https://gitlab.com/libtiff/libtiff) for TIFF decoding/encoding\n  * [jasper](https://github.com/jasper-software/jasper) for Jpeg 2000 and Sun Raster decoding/encoding\n  * [NOISE.SYS](https://github.com/robrwo/noise.sys) for a better entropy source for TLS.\n\n## Contact\nYou can find me on [Mastodon](https://mastodon.social/@dec_hl) in [DOjS Matrix](https://matrix.to/#/#dojs:tchncs.de) or in the [DOjS Discord](https://discord.gg/J7MUTap9fM) if you want...\n\n# Download and quick start\n**You can find binary releases on the [GitHub release page](https://github.com/SuperIlu/DOjS/releases).** Just extract the contents of the archive and run `DOjS.exe`.\n\nDOjS runs in [Dosbox](https://www.dosbox.com/) and on real hardware or a virtual machine with MS-DOS, [FreeDOS](https://www.freedos.org/) or any DOS based Windows like Windows 95/98/ME. To use 3Dfx/Glide support you need a Voodoo card or [DOSBox-X](https://github.com/joncampbell123/dosbox-x/releases) (see below).\n\nIf you run it on real hardware you need at least a **80386 with 4MB**. I recommend a **Pentium class machine (\u003e= 100MHz) with at least 32MB RAM**. The example files run fine on an Athlon 1GHz and with 256MB RAM.\n\nThe following hardware/functions are available:\n  * 8/16/24 and 32 bit 2D graphics. On 24/32bit display modes alpha channel transparency is available.\n  * BMP, PCX, TGA, QOI and PNG image reading and writing, JPEG and SVG loading\n  * GRX font loading and rendering\n  * Keyboard input\n  * Mouse input\n  * Joystick/Joyport input\n  * File IO\n  * MIDI output\n  * WAV output\n  * Audio input/sampling\n  * Allegro 3D rendering (software)\n  * 3dfx/Glide3 3D rendering output (hardware)\n  * Mesa/OpenGL wrapper with 3dfx based hardware acceleration\n  * p5js compatibility\n  * direct io-port access (inb, outb, etc)\n  * LPT or parallel port access (bi-directional)\n  * COM or serial port access\n  * IPX and TCP/IP networking\n  * ZIP file access\n  * GIF-Animation, FLC/FLI, MPEG1 or OggVorbis playback\n  * HTTPS support through libcurl and mbedTLS\n  * PDF generation\n\n## Examples\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_003.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_010.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_019.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_034.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_004.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_013.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_025.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/gltixy.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_009.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_018.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/dojs_026.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\u003cimg src=\"https://github.com/SuperIlu/DOjS/raw/master/images/ogl02.png\" alt=\"DOjS example\" width=\"200\"\u003e\n\nSee [DOStodon](https://github.com/SuperIlu/DOStodon) for an complex examples. It is a full Mastodon client implemented using DOjS.\n\n## A minimal script\nYou can find the following example in `examples/exampl.js`:\n```javascript\n/*\n** This function is called once when the script is started.\n*/\nfunction Setup() {\n    pink = new Color(241, 66, 244, 255); // define the color pink\n}\n\n/*\n** This function is called repeatedly until ESC is pressed or Stop() is called.\n*/\nfunction Loop() {\n    ClearScreen(EGA.BLACK);\n    TextXY(SizeX() / 2, SizeY() / 2, \"Hello World!\", pink, NO_COLOR);\n\n    TextXY(10, 10, \"rate=\" + GetFramerate(), EGA.BLACK, EGA.LIGHT_BLUE);\n}\n\n/*\n** This function is called on any input.\n*/\nfunction Input(event) {\n    str = JSON.stringify(event);\n}\n```\nOpen this script with `DOjS.EXE examples\\exampl.js` or use `DOjS.EXE -r examples\\exampl.js` to run it without starting the integrated editor first. If the script does not exist the editor loads the template for a new script.\n\n## p5js compatibility\nIf you want to write scripts using the syntax of [p5js](https://p5js.org/) you need to use `Include('p5');` as first line of your script. You can find the following example in `examples/examplp5.js`:\n\n```javascript\nInclude('p5');\n\n/*\n** This function is called once when the script is started.\n*/\nfunction setup() {\n    pink = color(241, 66, 244); // define the color pink\n}\n\n/*\n** This function is called repeatedly until ESC is pressed or Stop() is called.\n*/\nfunction draw() {\n    background(EGA.BLACK);\n    stroke(pink);\n    fill(pink);\n    text(\"Hello p5js World!\", width / 2, height / 2);\n\n    stroke(EGA.LIGHT_BLUE);\n    fill(EGA.LIGHT_BLUE);\n    text(\"rate=\" + getFrameRate(), 10, 10);\n}\n```\n\nMore info can be found at the end of this README in the section **Usage** and in the API documentation. Take a look at the `examples/` as well.\n\n## additional packages\nDOjS has a very simple integrated package manager (DPM). It can be started with `DPM.BAT`.\nA working packet driver is needed to connect to the package index and download packages using HTTPS.\nPackages (and the package index) are fetched from the [DOjS/jSH package repository](https://github.com/SuperIlu/DOjSHPackages).\nDownloaded packages are put into `JSBOOT.ZIP` in the `PACKAGE/` directory.\nFeel free to submit any packages you want to include in that repository using a pull request.\nDPM commands:\n  * installed - list installed packages.\n  * remove    - remove package.\n  * fetch     - fetch package index from server.\n  * install   - install a package (and its dependencies) from package index.\n  * list      - list available packages in index.\n  * setindex  - set index URL (HTTP or HTTPS).\n  * help      - this help.;\n  * quit      - exit dpm.\n\n## 3dfx/Glide support\nDOjS supports most of the Glide3 API that was used with [3dfx](https://en.wikipedia.org/wiki/3dfx_Interactive) accelerator cards. The following hardware is supported:\n  * Voodoo 1 [tested]\n  * Voodoo 2 [tested]\n  * Voodoo 3 [tested]\n  * Voodoo 4 [tested by [tunguska](https://twitter.com/tunguska82)]\n  * Voodoo 5 [tested by [tunguska](https://twitter.com/tunguska82)]\n  * Voodoo Rush (all versions) [tested]\n  * Voodoo Banshee (PCI and AGP) [tested]\n\nAdditionally you can use [DOSBox-X](https://github.com/joncampbell123/dosbox-x/releases) which emulates a Voodoo 1 card. Glide functions can be found in the 3dfx-module in the documentation, Javascript support functions have a \"FX\" prefix, all native functions are prefixed with \"fx\". Detailed Glide3-API documentation can be found on the internet, e.g. on [FalconFly Central](http://falconfly.3dfx.pl/reference.htm). **Make sure you grab the Glide3 SDK and not Glide2!**\n\nYou can use the included DOS version of `TEXUS.EXE` to convert bitmaps to `3df` texture files that can be loaded as textures.\n\n**!!! Attention !!!**\n3dfx/Glide3 support ONLY works in plain DOS, NOT in the DOS/command window of Windows 9x! Be sure to always boot into a pure DOS prompt before trying to use any of the fx-functions!\nBefore using 3dfx/Glide3 support you need to copy the appropriate `GLIDE3X.DXE` into the same directory as `DOJS.EXE`. You can do so by using the `V_XXX.BAT` scripts in the distribution ZIP archive.\n\n# Software created with DOjS\n- DutchTux has created a GUI toolkit for DOjS: https://github.com/dutchtux3000/jiyuai\n- I created a Mastodon client for MS-DOS using DOjS: https://github.com/SuperIlu/DOStodon\n- I made a text adventure with DOjS: https://superilu.itch.io/spacebutton\n- And also a match-numbers-game: https://superilu.itch.io/numgam\n\n# Compilation\nYou can compile DOjS on any modern Linux (the instructions below are for Debian based distributions) or on Windows 10 using Windows Subsystem for Linux (WSL).\nSetup Windows Subsystem for Linux (WSL) according to [this](https://docs.microsoft.com/en-us/windows/wsl/install-win10) guide (I used Ubuntu 18.04 LTS).\n\n## Preparation\nBuild and install DJGPP 12.2.0 according to [this](https://github.com/jwt27/build-djgpp) guide.\nInstall [NVM](https://github.com/nvm-sh/nvm#installing-and-updating). You also need a [CMake \u003e= 3.20](https://cmake.org/download/).\nI used the following command lines to update/install my dependencies:\n```bash\nsudo apt-get update\nsudo apt-get dist-upgrade\nsudo apt-get install bison flex curl gcc g++ make texinfo zlib1g-dev g++ unzip htop screen git bash-completion build-essential zip dos2unix python3\nnvm install node\nnpm install -g jsdoc\nnpm install -g better-docs\n```\n\nAnd the following commands to build and install DJGPP to `/home/ilu/cross`.:\n```bash\ngit clone https://github.com/jwt27/build-djgpp.git\ncd build-djgpp\n./build-djgpp.sh --target=i586-pc-msdosdjgpp --prefix=/home/ilu/cross all\n```\n\n## Getting \u0026 Compiling DOjS\nOpen a shell/command line in the directory where you want the source to reside.\n\nCheckout DOjS from Github:\n```bash\ngit clone https://github.com/SuperIlu/DOjS.git\n```\n\nMake sure DJGPP is in your PATH and DJDIR is set (e.g. I have these lines in my ~/.profile):\n```\n# DJGPP\nexport PATH=/home/ilu/djgpp/bin/:/home/ilu/djgpp/i586-pc-msdosdjgpp/bin/:$PATH\nexport DJDIR=/home/ilu/djgpp/\n```\n\nIf you used Windows-Tools to check out DOjS from git you may need to fix the newlines of the shell scripts by using `make fixnewlines`.\n\nNow you are ready to compile DOjS with `make clean all`. This might take some time as the dependencies are quite large.\n`make distclean` will clean dependencies as well. `make zip` will create the distribution ZIP and `make doc` will re-create the HTML help.\n\n## Compile the Linux version of DOjS\nThere is an experimental Linux version of DOjS. It only supports a subset of the DOS version and should be considered ALPHA! See [this](README_Linux.md) file for more information.\n\n## Compile the Win32 version of DOjS\nThere is an experimental Win32 (Windows98 or never) version of DOjS. It only supports a subset of the DOS version and should be considered ALPHA! See [this](README_win32.md) file for more information.\n\n# Notes\n## 3dfx/Glide3\nIn order to compile DOjS you need Glide3 includes and binaries. The ones included with the DOjS sources were created using my [glide repository](https://github.com/SuperIlu/glide) on GitHub. \n\n## GRX Fonts\nDOjS comes pre-bundled with all fonts included with GRX (files ending with \".FNT\"). If you want/need additional fonts you can find a very simple tool to convert TTF/BDF fonts to GRX format [here](https://github.com/SuperIlu/GrxFntConv). Results may vary...\nA minimal version capable of converting BDF fonts to FNT is included with DOjS (`FONTCONV.EXE`).\nYou can find information on how to convert a TTF to BDF [here](https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display/conversion).\n\n## Live coding\nIf you run DOjS on a computer with network interface and a matching packet driver you can (sort of) live code using the [VSCode](https://code.visualstudio.com/) extension in `vscode\\livedojs-0.0.4.vsix`. You need to start `DOjS -r examples/websvr.js` and then set the IP address in VSCode using the command `DOjS: Set hostname`. Live coding sketches must look like below to work:\n```\n// livedojs\nexports.Setup = function () {\n}\n\nexports.Loop = function () {\n    ClearScreen(EGA.BLACK);\n\n    FilledBox(10, 10, 70, 20, EGA.GREEN);\n}\n```\n  * The first line must be exactly `// livedojs`\n  * The file must end with `.js`\n  * Only `Setup()` and `Loop()` are available, `Input()` does not work.\n  * p5js compatibility does not work, you must code using DOjS native API\n  * If the hostname is set the sketch will be automatically be uploaded on save\n  * The sketch can be uploaded using `DOjS: Upload sketch` manually\n  * you can access the JSLOG.TXT of the running server by using `DOjS: get logfile`\n\n# History\nSee the [changelog](/CHANGELOG.md) for the projects history.\n\n# Planed work\n  * Stack trace selector in the editor\n  * TCP/IP remote logging/debugging.\n  * add FFT module\n  * add webp decoder (https://github.com/webmproject/libwebp/blob/main/doc/api.md)\n  * Add ZIP file functions (e.g. https://libzip.org/users/ or https://github.com/kuba--/zip).\n    * Implement 3df file loading from ZIP\n  * add/implement some more math functions\n    * https://mathjs.org/\n    * https://github.com/evanw/lightgl.js\n  * Fix bugs!\n  * Anything fun...\n    * http://www.speech.cs.cmu.edu/flite/\n    * http://speect.sourceforge.net/\n    * http://espeak.sourceforge.net/\n\n# Licenses\nSee [LICENSE](LICENSE) file for all licenses and details.\n\n## DOjS\nAll code from me is released under **MIT license**.\n\n## MuJS\nMuJS is released under **ISC license**. See *COPYING* in the MuJS folder for details.\n\n## Allegro\nAllegro 4 is released under the **Giftware license** (https://liballeg.org/license.html).\n\n## GRX fonts\nThe GRX fonts are under **MIT and other licenses**. See copying.grx in `LICENSE` for details.\nThe converted fonts from the Linux Font Project are in the public domain.\n\n## IPX and dosbuffer sub-system\nThis code is taken from the game [Cylindrix](https://www.allegro.cc/depot/Cylindrix) by Hotwarez LLC, Goldtree Enterprises.\nIt was [released](https://sourceforge.net/projects/cylindrix/) under **GPLv2**.\n\n## CWSDPMI.EXE\n[CWSDPMI](http://sandmann.dotster.com/cwsdpmi/) DPMI host is licensed under **GPL**. The documentation states:\n\u003e The files in this binary distribution may be redistributed under the GPL (with source) or without the source code provided.\n\n## 3dfx/Glide3\nThe code is licensed under \"3DFX GLIDE Source Code General Public License\".\nSource code is available at https://github.com/SuperIlu/glide\n\n## DZComm\nDZComm serial library is release as **gift-ware**. See *readme.txt* in the dzcomm folder for details.\n\n## Logo\nThe DOjS logo dog was downloaded from [Pexels](https://www.pexels.com/photo/animal-cachorro-doge-pug-1753686/) and kindly provided by Iago Garcia Garcia.\n\nThe logo font is [Comic relief](https://www.fontsquirrel.com/fonts/comic-relief) by Jeff Davis provided under **SIL OPEN FONT LICENSE Version 1.1**.\n\n## WAVs\nAll WAV files were downloaded from [BigSoundBank](https://bigsoundbank.com/) and are licensed under [WTFPL](https://bigsoundbank.com/droit.html)\n  * https://bigsoundbank.com/detail-0283-song-of-rooster.html\n  * https://bigsoundbank.com/detail-1102-bell-bike-5.html\n  * https://bigsoundbank.com/detail-1023-explosion-far-away.html\n\n## MIDs\nThe MIDI files were downloaded from the [FreeDOOM](https://github.com/freedoom/freedoom) project and are licensed under [this](https://github.com/freedoom/freedoom/blob/master/COPYING.adoc) license.\n\n## p5js and examples\np5js is is released under **LGPL**. \n\nThe examples are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-nc-sa/4.0/).\n\n## zlib\n[zlib](http://www.zlib.net/) is released under [zlib license](http://www.zlib.net/zlib_license.html).\n\n## alpng\nCopyright (c) 2006 Michal Molhanec\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute\nit freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented;\n     you must not claim that you wrote the original software.\n     If you use this software in a product, an acknowledgment\n     in the product documentation would be appreciated but\n     is not required.\n\n  2. Altered source versions must be plainly marked as such,\n     and must not be misrepresented as being the original software.\n\n  3. This notice may not be removed or altered from any\n     source distribution.\n\n## zip code\nSee UNLICENSE in zip directory.\n\n## WATTCP\nSee manual.txt in watt32 directory.\n\n## OpenSSL\nThe OpenSSL toolkit stays under a double license, i.e. both the conditions of\nthe OpenSSL License and the original SSLeay license apply to the toolkit.\n\n## cURL\nSee COPYING in curl directory.\n\n## genann\nSee LICENSE in neural.dxelib.\n\n## sqlite\nSee LICENSE.md in sqlite.dxelib.\n\n## libcpuid\nSee COPYING in cpuid.dxelib.\n\n## nanosvg\nSee LICENSE.txt in nanosvg.dxelib.\n\n## noise\nSee LICENSE.md in noise.dxelib.\n\n## libjpeg\nSee README in jpeg-9f directory.\n\n## gifanim\nSee LICENSE in gifanim.dxelib.\n\n## libtiff\nSee LICENSE.md in tiff directory.\n\n## Jasper\nSee LICENSE.txt in jasper directory\n\n# Usage\n## Command line\n```\nUsage: DOjS.EXE [\u003cflags\u003e] \u003cscript\u003e [script parameters]\n    -r             : Do not invoke the editor, just run the script.\n    -l             : Use 50-line mode in the editor.\n    -w \u003cwidth\u003e     : Screen width: 320 or 640, Default: 640.\n    -b \u003cbpp\u003e       : Bit per pixel:8, 16, 24, 32. Default: 32.\n    -s             : No wave sound.\n    -f             : No FM sound.\n    -a             : Disable alpha (speeds up rendering).\n    -x             : Allow raw disk write (CAUTION!)\n    -t             : Disable TCP-stack\n    -n             : Disable JSLOG.TXT.\n    -j \u003cfile\u003e      : Redirect JSLOG.TXT to \u003cfile\u003e.\n```\n\n## dojs.ini\nAll command line options can also be provided in `dojs.ini` (which is read at startup from the current directory). See the included example for details.\n\n## Editor keys\n```\n    F1        : Open/Close help\n    SHIFT-F1  : Function context help\n    F3        : Save script\n    F4        : Run script\n    F7        : Find text\n    F9        : Show/Close logfile\n    F10       : Quit\n\n    Shift-F4       : Truncate logfile and run script\n    Shift-F7       : Find again\n    CTRL-D         : Delete current line\n    SHIFT+Movement : Select text, releasing SHIFT deselects\n    CTRL-C         : Copy selection\n    CTRL-X         : Cut selection\n    CTRL-V         : Paste\n    CTRL-LEFT      : Previous word\n    CTRL-RIGHT     : Next word\n    CTRL/PAGE-UP   : One page up\n    CTRL/PAGE-DOWN : One page down\n    HOME           : Go to start of line\n    END            : Go to end of line\n    CTRL-HOME      : Go to start of line\n    CTRL-END       : Go to end of line\n    TAB            : Insert spaces until next TAB-stop at cursor\n    SHIFT-TAB      : Reduce indentation of line\n\n    TAB size is 4.\n    The help viewer will remember the current position.\n\n    The logfile can be truncated by pressing DEL in the log viewer.\n```\n\n## Scripts and resources\nScripts, as well as resources can either be stored in the file system or in ZIP files. To load data from a zip file the format is `\u003cZIP filename\u003e=\u003cZIP entry name\u003e` (e.g. `data.zip=mypic.bmp`). DOjS can be started with a script, a script in a ZIP file or no parameters. If the script was loaded from a ZIP file the running script can obtain resources from the same ZIP file by using `ZipPrefix()` to obtain paths refering to that ZIP. If the script was not started from a ZIP `ZipPrefix()` just passes through the file name (thus loading the file from HDD). If no arameters are supplied DOjS will first try to load `\u003cname of the EXE\u003e.ZIP=MAIN.JS` and then `JSBOOT.ZIP=MAIN.JS`.\nExamples:\n  * `DOJS.EXE -r script.js` will start `script.js` from the HDD, `ZipPrefix(\"pic.bmp\")` will yield `pic.bmp`.\n  * `DOJS.EXE -r data.zip=script.js` will start `script.js` from the ZIP file `data.zip`, `ZipPrefix(\"pic.bmp\")` will yield `data.zip=pic.bmp`.\n  * `HURTZ.EXE` DOjS was renamed to `HURTZ.EXE`. It will start `MAIN.JS` from the ZIP file `HURTZ.ZIP`, `ZipPrefix(\"pic.bmp\")` will yield `HURTZ.ZIP=pic.bmp`.\n  * `DOJS.EXE` The script was added to `JSBOOT.ZIP`. DOjS will start `MAIN.JS` from the ZIP file `JSBOOT.ZIP`, `ZipPrefix(\"pic.bmp\")` will yield `JSBOOT.ZIP=pic.bmp`.\n\n## API documentation\nYou can find the full API doc in the [doc/html/](http://htmlpreview.github.io/?https://github.com/SuperIlu/DOjS/blob/master/doc/html/index.html) directory.\nGo to the p5.js hompage for [p5.js reference](https://p5js.org/reference/).\n\n## Script format\nScripts need to provide three functions: `Setup()`, `Loop()` and `Input()`. Scripts are loaded and executed top-own. After that `Setup()` is called once and then `Loop()` repeatedly. `Input()` is called whenever mouse of keyboard input happens.\n\n### Setup()\nThis function is called once at startup. It can initialize variables, setup hardware, etc.\n\n### Loop()\nThis function is called after setup repeatedly until `Stop()` is called. After calling `Stop()` the program ends when `Loop()` exits.\n\n### Input(event)\nThis function is called whenever mouse/keyboard input happens.\n\n## IPX networking\nDOjS supports IPX networking. Node addresses are arrays of 6 numbers between 0-255. Default socket number and broadcast address definitions can be found in `jsboot/ipx.js`.\n\n## Drawing functions\nSee API doc for details.\n\n## Processing/p5js compatibility layer\nAdd `Include('p5');` as first line to your script. After that you have (limited) [p5.js](https://p5js.org/reference/) compatibility.\nThings that don't work:\n  * Anything 3D (objects, lights camera, etc)\n  * Key release events work different for Allegro and are simulated for p5js.\n  * Only simple vertices are supported.\n  * no DOM\n\n## Logfile\nAll output via `Print()` and `Println()` is sent to the file `JSLOG.TXT`. You can use `Debug()` instead and output is only generated when you set the global variable `DEBUG=true`.\n\n## Remote logging/debugging\nThis feature allows you to debug a running script via IPX networking and a second machine. To use remote logging do the following:\n  * Put both machines on the same network.\n  * Run `DOJS.EXE -r JSBOOT\\LOGVIEW.JS` on one machine.\n  * Enable debugging by setting `DEBUG=true` and enable remote debugging by `REMOTE_DEBUG=true`. You can either modify `JSBOOT\\FUNC.JS` or change the variables at the very beginning of your script.\n\nThis works fine with two instances of DOSBox as well.\nPlease note that if the log messages are transmitted to fast the receiving instance of DOJS might skip some of these when displaying.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperilu%2Fdojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperilu%2Fdojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperilu%2Fdojs/lists"}