GithubHelp home page GithubHelp logo

caiiiycuk / js-dos Goto Github PK

View Code? Open in Web Editor NEW
972.0 32.0 117.0 200.79 MB

The best API for running dos programs in browser

Home Page: https://js-dos.com

TypeScript 95.64% CSS 2.85% JavaScript 0.44% HTML 1.07%
js browser dosbox dos

js-dos's Introduction

js-dos v8

Build

The simplest API to run DOS/Win 9x programs in browser or node. js-dos provides full-featured DOS player that can be easily installed and used to get your DOS program up and running in browser quickly. js-dos provide many advanced features like multiplayer and cloud storage. All available features are enabled for any integration and free.

The key features:

  • Works in worker or render thread
  • Support execution in Node and Browsers
  • Multiple backends: DOSBox, DOSBox-X
  • Mobile support (v8 - WIP, v7 - production)
  • Able to run very big games (like Diablo, etc.)
  • Multiplayer support
  • Cloud storage
  • WebAssembly and pure JS versions

Watch the video

Documentation

Demo:

DOS.Zone

Development

  1. You need to install node dependencies and put emulators@beta into public/emulators.
yarn
cp -rv node_modules/emulators/dist/* public/emulators
  1. Run yarn run vite and open http://localhost:3000 js-dos is ready!

Community

js-dos's People

Contributors

caiiiycuk avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-dos's Issues

zip file structure

In testing the app, I was able to run Rogue, as it is a single file. Another test that is failing is Quick Basic 7.1, with a nested folder structure. I'm wondering if js-dos has inherent ability to allow a program to access other files in the zip? Some files are across different folders and require loading as well. What is the limitation on folder structure?

Feature request: multiplayer support

Hello, great job, would be awesome let users to create their room and share the game with their friends, or just a bridge to make possible a multiplayer game when the game got the feature.

Mouse problem

Hello!

The current version of js-dos (6.22.14) works fine, except for one thing - the mouse does not respond to movements and clicks. (I tested it on different computers and in different browsers. The test project is a good old strategy - Fantasy General )

Meanwhile, in an older version of js-dos (for example, a project from a closed issue ), the mouse works without problems.

According to the data from the .conf file in version 6.22.14 - autolock: true and sensitivity: 100, which, I believe, is enough for interaction.
In addition - from a mobile phone I can interact and move the cursor in a test project.
Maybe I'm just missing some obvious things, but I need your help.)

code

can i use your code on my website

Duke Nukem 3D doesn't run

I try running Duke Nukem 3D, it gets to 100% and after that the equal sign keeps going back and forth forever. Help!

Application Works in Dosbox but Not JS-Dosbox

I'm not sure if there is a configuration change on my end that will fix this or not.
I'm using an application called Quick Yagi 4, which works great in native dosbox.

However, inside JS-Dosbox it locks up as soon as I try to calculate a yagi.
The software can be found here: http://www.hamuniverse.com/quickyagiqy4.html

Steps to re-create issue:

Run setup
Select VGA
Run QY4
Select Enter
Select A
Select A
Select M
Select 3
Select Y
Select 3
Select 5

It is here that it locks up inside js-dosbox

Different usage

Hi,

is it possible to use this to have a simple terminal window, in/out to/from a web Service?
Sorry, no gamer.

With best regards

Gerhard

Usage on electron

I can't get this to work with electron.
I tried to follow the react example, but I keep getting some errors.

Here is the log:

I guess this error is about the storage of user progress,
but I'm not sure why it fails since electron supports the IndexDB api:

const openRequest = this.indexedDB.open("js-dos-cache (" + version + ")", 1);
openRequest.onerror = (event) => {
onerror("Can't open cache database");
};

ERR! Can't initalize cache, cause: Can't open cache database

Looks like the extraction works ๐Ÿ‘

js-dos.js:1 [INFO] Resolving DosBox 2.5%
js-dos.js:1 [INFO] Resolving DosBox 42.7%
js-dos.js:1 [INFO] Resolving DosBox 82%
js-dos.js:1 [INFO] Resolving DosBox 82%
js-dos.js:1 [INFO] Resolving DosBox 84.6%
js-dos.js:1 [INFO] Resolving DosBox 100%
js-dos.js:1 [INFO] Resolving DosBox 100%
js-dos.js:1 [INFO] Resolving DosBox 100%
js-dos.js:1 [INFO] DosBox resolved

What's this about?

js-dos.js:1 Uncaught TypeError: e is not a constructor
    at e.ondosbox (js-dos.js:1)
    at js-dos.js:1
    ...

Anyway thanks for this awesome project โœŒ๏ธ

Games freezes

I tried it on two games and they both crashed.
The First one is Beneath a Steel Sky and the second one was Horror Zombies from the Crypt , the first one froze in the title screen and the second one frozen in the password screen.
Thanks in advance.

DOS-box loading issues

I've tried to test latest distributive (6.22.10) on the three various hostings and have faced very strange problem:
dos-box stucking at 20-80% percent, depends on browser. Mozilla - 22,6%, Safari - 20,2, Chrome-80,8.
For example: http://zapuskdva.shn-host.ru/dist3/
There is no error information in console, when it getting stuck.
And,most bizzare thing - js-dos 6.22.10 have worked perfectly on previous shn-host site of mine.

document the controls for each game

E.g. I have no idea what the action/attack key is for Horror Zombies. And mention that in Windows Tetris the arrow keys don't work.

Amazing work!

the ; keyboard key does not work

Is there any way to set custom keyboard mappings? this is an important key because you can't navigate to C:\ or ; in any code editors like QBasic. I've tried in both Chrome and Edge and neither browser registers the key. does anyone else have this issue?

Thanks

Pre-Built Version

Hi. I don't have access to a Linux machine that I can run the bootstrap project on at the moment. Is there a pre-built version or something that I can just upload straight to my website? I really want to upgrade to v6.22 so I can make use of the saved data feature you added.

cannot compile

/usr/local/rvm/rubies/ruby-2.1.10/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2290:in `raise_if_conflicts': Unable to activate jekyll-sitemap-0.11.0, because addressable-2.5.2 conflicts with addressable (~> 2.4.0) (Gem::ConflictError)

Dr. Sbaitso

sbaitso.zip
I've been trying to get Dr. Sbaito to run but it just kicks me back to the run prompt without any complaints. Any idea of what may be wrong?

add f117 :)

I'll try to dig it up in my archives probably...

Mouse does not work in Fullscreen Mode

Hello,

It looks like there are more problems with JS DOS. I have spotted issues with Chrome and Firefox, both on Windows and Mac OS X). In mouse-driven games, if you switch to the Fullscreen Mode, the cursor does not react to mouse moves and stays frozen in the top-left part of the screen.

The only browser that worked fine was Safari on Mac OS X.

Two issues (Fullscreen/Mouse focus, Changing size of canvas)

Hi! First off thanks for the awesome and easy to use API.

Just got these two issues I was hoping you knew some tricks for ^^

  1. Going into fullscreen seems to lock the mouse into the top left corner of the screen, and disables it. Using the default plunkr example, as well as tried
document.getElementById("fullscreen_btn").addEventListener("click", function() {
    dosbox.requestFullScreen();

to no luck.

  1. The css seems to get ignored for resizing canvas. It works for the loading, but then game always resizes to 640x400 once everything downloaded.

Thanks for any ideas!

Cannot Destroy/Kill DosBox Process

I've tried removing the canvas from the DOM but the DosBox processes are still running in the background despite there not being a DOM object to display it.

Is there a method to kill the DosBox instance? I have yet to find this in the docs.

Screenshot resolution

Hello!
When I try to get a screenshot (right mouse button on canvas -> save the image) on dosify.me (22.28 version, i suppose) - I get an image with a resolution of 320x200.
If I remember correctly - in the 22.19 version of js-dos, the screenshots was in 640x400 format.
Can I manually set the resolution for screenshots or maybe you can add this feature to the future version?

MouseEvent thread safety

Thread insecurity when SDL process mouse event. When I send a mock mouse click event to canvas, with a mousedown and a mouseup. If I send it no delay, it not work correctly.
Like this:

canvas.dispatchEvent(downEvent);
canvas.dispatchEvent(upEvent);

This code can word correctly:

canvas.dispatchEvent(downEvent);
setTimeout(()=>{
  canvas.dispatchEvent(upEvent);
},200);

There may be problems with the mouse event queue here.

INLINE void Mouse_AddEvent(Bit8u type) {
if (mouse.events<QUEUE_SIZE) {
if (mouse.events>0) {
/* Skip duplicate events */
if (type==MOUSE_HAS_MOVED) return;
/* Always put the newest element in the front as that the events are
* handled backwards (prevents doubleclicks while moving)
*/
for(Bitu i = mouse.events ; i ; i--)
mouse.event_queue[i] = mouse.event_queue[i-1];
}
mouse.event_queue[0].type=type;
mouse.event_queue[0].buttons=mouse.buttons;
mouse.events++;
}
if (!mouse.timer_in_progress) {
mouse.timer_in_progress = true;
PIC_AddEvent(MOUSE_Limit_Events,MOUSE_DELAY);
PIC_ActivateIRQ(MOUSE_IRQ);
}
}

I am not good at C++. I hope this will be useful to you.

Add saving feature

Please add a saving feature Similar to Jdosbox.
Basically make it download the files in a temporary folder in the windows /mac user profile, when the user close /open the page and enter a new session to run a game /app it should check for the folder if it exist then it run the saved app , If not it has to download it.
this will give the user the ability to save his progress/setting.

DOSBox appears to launch but error upon loading game (from examples on homepage)

All 4 of the games I tried starting gave the following error in the browser console:

js-dos-api.js:173 Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!

I'm using Windows 10, latest version of Chrome as of 9/26/17.

Ignoring certain kb characters

Another weird bug that only happens in js-dos / em-dosbox. With the same app at http://cups.avoidspikes.com/ go to Field->Read Scalar Field and try to enter the text field for F=. Certain characters are rejected -_+=;:'" This seems to happen for any text field. I guess I will have to build my own em-dosbox and sort it out...strange that it works in DOSbox-0.74.

Any known issues with SCI games?

I'm trying to run a home-built game that was built with the SCI engine (old style Sierra) and that does run in DosBox. I have the following file in place on my server:

http://testerstories.com/files/testquest.html

If you click Start, you'll see that it loads up the SCIV.exe and then once everything is loaded up (no errors in the console), I just get dumped at a DosBox Z:\ prompt.

There is a TestQuest.exe in that zip file as well but I don't call that because that's just a DosBox executable wrapped up to read a dosbox.conf file. But all that conf file does is call "sciv.exe" anyway, which is the same thing I'm doing with the page above. The line I have in place in the script is:

dosbox.run("http://testerstories.com/files/TestQuest.zip", "./SCIV.EXE");

Again, the game definitely runs in DosBox on its own so I wasn't sure if this had something to do with SCI or with a specific configuration that I might not be aware of.

Theme Hospital stuck at mounting/Memory crash chrome

Hi,

I've been trying to get Theme hospital running on a webpage but i've run across an issue. In internet explorer it gets stuck mounting hospital.exe and in chrome it crashes after downloading the file/starts launching. Am i missing something ?

Regards,

Patrick

A game can not be loaded at full

Hi!

I tried to use js-dos.com to play an installed game "Grand Prix 2" on my site. But it just can not be loaded till the start of the game. Instead, I get "Z:>" on the screen.

image

OpenTTD

It would be neat to have OpenTTD running in the browser, please make it possible<3

Mouse mapping bug

I have found one app where some of the mouse mapping is incorrect under js-dos, but it works fine in DOSBox-0.74 and DOSBox-r4006. It's probably a bug in em-dosbox. It appears to be related to the DOS interrupt 0x33 that sets the mouse extents AX=7 and AX=8. There is an example app at http://cups.avoidspikes.com/ ... if you dismiss the opening dialog and then select Graphs->Path Integral. Then left-click in the upper left plot area to create a polyline. You can see the mousedown and the mousedrag coordinates don't match. I should probably create an issue with the em-dosbox github, but I haven't built em-dosbox yet. Does your build of em-dosbox uses SDL or SDL2 support? It might be related to that. Thanks!

Cookie/localStorage consent screen

Could you please add the option to replace the "Click to start" link with a simple cookie and/or localStorage consent screen, where it warns about the use of cookies and localStorage, and the user has to click a link saying "I consent" to start the game?

Edit: I don't actually need this feature now, as I've stopped the page from loading the applet if they haven't already clicked on my cookie consent button. It might still be useful for others though.

Mouse tracking

Similarly to this issue: #21

The mouse tracking seems off in some cases, one example:

https://www.dosgamesarchive.com/play/shooting-gallery/

Whether regular-sized or full screen, the mouse cursor in-game doesn't track with the visible Windows cursor. The difference between the game cursor and OS cursor is greater as the cursor approaches the bottom right corner.

I'm not sure if this is an emulator issue or a configuration issue? Thanks again for any assistance.

Send keyboard event from script

Hi, is possible to simulate key press by sending events directly from script? I would like to do DOS emulator for mobile phones and I need to map touches a gestures to keyboard events.

Adding the Ability to Read from a Folder

You`ve made it so you need to input a URL, what if the web client I have, does not have the ability to download that zip, and store it? Would there be a way to do the same thing, but directly with a folder.

General Setup on a Webserver

I'm trying to implement this on my website. For testing, I've just used the example given on the JS-Dos website, and I have that set as my index.html page, so its the only this that shows up. I have my own ZIP folder with Oregon Trail, however, the DOSBOX just hangs at Mount 100% . Any thoughts on this? I've tried multiple games without luck.

Configuration (cycles)

Hi, thank you for your work in creating this useful script!

Is there a way to specify the cycles when running a game? I can create a batch file inside the zip, ex:

cycles 1000
game.exe

But is there any more efficient way to specify it in the code? Thank you for your help.

Is there a way to pass arguments to the executable?

I'd like to be able to pass command-line arguments to the executable. Is this possible? I've tried this:

dosbox.run("qb11.zip", "./QBASIC.EXE /RUN MYFILE.BAS");

and this:

dosbox.run("qb11.zip", "./QBASIC.EXE", "/RUN MYFILE.BAS");

and even this:

dosbox.run("qb11.zip", "./QBASIC.EXE", ["/RUN", "MYFILE.BAS"]);

but none of these seem to have any effect.

Thanks!

Bootable disk images?

I have some raw hard disk images, I'd love to use, but I don't see any good way to accomplish this.

I tried to do something like this in dosbox.conf

[autoexec]
mount d: "."
d:
z:imgmount c win21r.img -t hdd -size 512,16,2,512
boot -l c:

But it just crashed out. The zip file I'm trying to use is here win21russian_z.zip.

Thanks for any/all help! Love this javascript DOSBox!

requestAnimationFrame error

"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"

how can i pass this error?

i have wordpress site and just copy js-dos codes. game monted and there is no problem with that but i always get that error.

thanks for the answer,

JS-DOS doesn't work on Firefox version 60

Hello,

I noticed that there are problems with Firefox (version 60, 64-bit) on Mac OS X (10.13.4) and Windows 7 64-bit, when running js-dos emulator. The emulator just won't run and will give you an error "A web page is slowing down your browser. What would you like to do? [Stop it] [Wait]". Can you check it on your instances of Firefox?

I have a suspicion that this might be related to the new Firefox (aka Quantum). So far other platforms tested:

FF 52 on Windows XP - works fine.
FF 57 on Windows 7 32bit - works fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.