How to have DOS Box show in my browser

The place to ask for technical support and offer assistance
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: How to have DOS Box show in my browser

Post by DOSGuy »

Don't worry about all that manifest stuff, just make an ordinary ZIP file and change the extension to JAR. If you sign the JAR file -- which you pretty much have to -- Java will create the manifest. If you aren't signing the applet and JAR files, then just follow the instructions on deathshadow's website and the jDosbox website and everything you need is there. As I said, though, your browser will probably refuse to run jDosbox unless you pay for a security certificate. Signing the applet is another huge topic of study and can be a bit of a nightmare. Thanks to overzealous efforts to protect the world from the dangers of Java, it's no longer easy (if it ever was) to put jDosbox on a website.

I mentioned that your browser might not let you run jDosbox if the applet and JAR file aren't signed by the same trusted certificate. That's only half the story! If the applet isn't at least self-signed, Java itself will not allow you to use the mouse (which is mandatory for about half of the games on this site) and it won't allow use of the recompiling core, which means that it will run many times slower (forget about running Tomb Raider or anything with Pentium-level system requirements).

A high school computer teacher once told the class that techy types are eager to share their knowledge, but they expect you to be at a certain level first otherwise you're wasting their time. (Snobbish but true.) You have at your disposal an excellent tutorial from deathshadow and the documentation on jDosbox's website. I'm not going to create a step-by-step tutorial, but if you can put something online, I'll take a look at it. If you can't get far enough to give me something to look at, you'll have to raise your skill level until you can understand the tutorials, or find someone else to help you first. But seriously, you can do it. I'm almost entirely self-taught; when I need to learn a new language I read a book or search Google.

For those wondering what keeps me so busy, I work for the federal government and I can't apply for the jobs I want without a degree or diploma, so I've taken two years of leave without pay to take Internet Applications and Web Development even though I develop internet applications for a living. I spend all day teaching my fellow students how to program and write code, and I'm willing to be a teacher in that situation. At the end of the day, I have books to read and assignments to submit, while maintaining a house by myself and trying to cook meals for roughly a dollar. (Hint, if a recipe calls for ground beef, use ground pork.) I'm trying to avoid losing my house and also eat with no income, and I'm trying to get perfect grades so I can get a scholarship. My only vehicle is a bicycle, and I still have to bike across the city three times a week for swimming because I'm a triathlete. Between studying, training, and trying to keep myself alive, I don't have a lot of time for anyone who isn't paying me or going on a date with me. (Yes ladies, I'm single!)

Incidentally, one of my professors has asked me to spend 10 minutes showing this website to my database class and explaining some of the SQL queries that show how it all works!
Today entirely the maniac there is no excuse with the article.
Malvineous
8-bit mega nerd
Posts: 292
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: How to have DOS Box show in my browser

Post by Malvineous »

@DOSGuy: When the time comes to renew the certificate, you might want to take a look at Let's Encrypt. It looks like it's about to launch and aims to be a free certificate issuer, with the goal to get as many sites using https:// as possible. I'm guessing the same certificates will work for signing the Java applets.
NY00123
5-bit member
Posts: 43
Joined: July 4th, 2015, 11:05 am

Re: How to have DOS Box show in my browser

Post by NY00123 »

Thanks for the update DOSGuy. It's great to have the chance to read about what you're going through! Anything you can do for having a place for living and ways to feed yourself is really what matters.

Now, about embedding DOSBox applets, I've considered telling the following before this thread was opened, so I can probably mention that now. These days, not only it may be somewhat more difficult to get the Java applets up and running than before, but the latest versions of browsers like Chrome no longer support the Java plug-in, following the removal of NPAPI plug-in support. Other plug-ins are also impacted.

As a plugin-free alternative (at least for certain recent browsers' versions), one may try out an Emscripten port of DOSBox: https://github.com/dreamlayers/em-dosbox

This port has been used by the Internet Archive for archival of thousands of DOS games. Given some of the contents found there, though, I'm not sure it's sufficiently safe that I link to the site. It's claimed that the Internet Archive got a DMCA exemption, which is used as a permit for hosting not just freeware/shareware games, but also ones that generally shouldn't be publicly distributed. I can't confirm anything for sure, though.
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: How to have DOS Box show in my browser

Post by developertn »

God, Jesus Christ, is number one.
Jesus!

Well, DOSGuy, I hear ya. Taking 2 years without pay to do what you love is a beaut. Unfortunately we all have to feed or else we die. Personally, I'm on welfare. If for some reason you can't get a job you can apply for financial assistance. They will help you out. In Houston, they are called "Public Health and Human Services". I guess what they intended in that is they care about your health and they are humane people. So please check the local areas around where you are. They should have something to assist the poor.

In fact I have a disability that prevents me from working in the regular stores. So that is why you see me produce so many freewares. They give a minimum allowance enough to pay for my family. In exchange they expect me to chip in where I can. So I specifically use my programming day skills for the public domain.

Now they say the public domain is second place. When you have nothing it is better than paying $50 bucks per game for SEGA, and such. In fact since I gave away my proprietary WinRAR 3.93 recently, I'm using 7-Zip now. It is not full luxury deluxe featured. However, I love it. Give it a go for the underdogs right? :lol:

Here in The United States especially in Houston the people care about the poor. Once a year there are times when even the USPS hold food pickups if I'm not mistaken? The United States Postal Service are hard working people.
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: How to have DOS Box show in my browser

Post by DOSGuy »

Malvineous wrote:@DOSGuy: When the time comes to renew the certificate, you might want to take a look at Let's Encrypt. It looks like it's about to launch and aims to be a free certificate issuer, with the goal to get as many sites using https:// as possible. I'm guessing the same certificates will work for signing the Java applets.
It's a totally different process. To get the Java signature I had to take government-issued photo ID to a notary public. Certificates for HTTPS have a much lower cost and a much lower standard of certainty. Code signing certificates cost anywhere from hundreds to thousands of dollars and require a high level of authentication. Seriously, I'm surprised they didn't finger print me and take a stool sample.
Today entirely the maniac there is no excuse with the article.
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: How to have DOS Box show in my browser

Post by DOSGuy »

developertn wrote:If for some reason you can't get a job you can apply for financial assistance.
I have a job! I don't have time to be a full-time student, amateur athlete, single home owner, and go to work. I'm on leave without pay. I have no income, but I have far too many assets to qualify for financial assistance at this time. Thankfully I was approved for a student loan, so that's my financial assistance.
Today entirely the maniac there is no excuse with the article.
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: How to have DOS Box show in my browser

Post by developertn »

DOSGuy wrote:
Malvineous wrote:@DOSGuy: When the time comes to renew the certificate, you might want to take a look at Let's Encrypt. It looks like it's about to launch and aims to be a free certificate issuer, with the goal to get as many sites using https:// as possible. I'm guessing the same certificates will work for signing the Java applets.
It's a totally different process. To get the Java signature I had to take government-issued photo ID to a notary public. Certificates for HTTPS have a much lower cost and a much lower standard of certainty. Code signing certificates cost anywhere from hundreds to thousands of dollars and require a high level of authentication. Seriously, I'm surprised they didn't finger print me and take a stool sample.
God, Jesus Christ, is number one!
JESUS!

Well, being a permanent residence of The United States of America I had to get my finger printed and my palms too :lol: Also in order to qualify for government assistance I need a yearly drug screening in addition to a mental sanity check every 3 months. So I'm on a tight bond. There's no moving for me.
Malvineous
8-bit mega nerd
Posts: 292
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: How to have DOS Box show in my browser

Post by Malvineous »

DOSGuy wrote:It's a totally different process. To get the Java signature I had to take government-issued photo ID to a notary public. Certificates for HTTPS have a much lower cost and a much lower standard of certainty. Code signing certificates cost anywhere from hundreds to thousands of dollars and require a high level of authentication. Seriously, I'm surprised they didn't finger print me and take a stool sample.
Hahaha that's interesting, I thought it was just an ordinary certificate. But I guess now I think about it, you wouldn't want any old site to be able to run code without warning so I guess it makes sense that it's a bit more stringent.
User avatar
MrFlibble
Forum Administrator
Posts: 1798
Joined: December 9th, 2010, 7:19 am

Re: How to have DOS Box show in my browser

Post by MrFlibble »

Wow, I did not realise that running Java stuff in browsers requires so much effort these days. I never really liked Java though, and I don't use it, so I think it's okay :)

I also wanted to suggest EM-DOSBox but NY00123 did that already. I suppose that using EM-DOSBox does not involve any complicated certifying processes, however it is my understanding that currently its performance is less robust than that of jDOSBox. (TBH I haven't tried either, so I can only judge by what other people say about it.)
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: How to have DOS Box show in my browser

Post by DOSGuy »

jsDosbox has a fraction of the performance of jDosbox. I don't know about EM-DOSBox, other than that the sound was so awful that the Internet Archive disabled it to stop the complaints. If there was a JavaScript alternative to jDosbox I would use it, but nothing seems to be comparable yet.
Today entirely the maniac there is no excuse with the article.
User avatar
MrFlibble
Forum Administrator
Posts: 1798
Joined: December 9th, 2010, 7:19 am

Re: How to have DOS Box show in my browser

Post by MrFlibble »

DOSGuy wrote:I don't know about EM-DOSBox, other than that the sound was so awful that the Internet Archive disabled it to stop the complaints.
Heh, I didn't know even that :)
NY00123
5-bit member
Posts: 43
Joined: July 4th, 2015, 11:05 am

Re: How to have DOS Box show in my browser

Post by NY00123 »

DOSGuy wrote:I don't know about EM-DOSBox, other than that the sound was so awful that the Internet Archive disabled it to stop the complaints. If there was a JavaScript alternative to jDosbox I would use it, but nothing seems to be comparable yet.

I remember experiencing sound problems as described by you beforehand. Today, I've briefly tested a few games from the Internet Archive in "Firefox 41.0" and "Chromium 45.0.2454.85 Ubuntu 14.04". On my first try of a game (under Firefox), sounds appeared to be muted, but maybe it's just the system volume being quite low. I've had working sound in all other runs, with no much noticeable stutters (if any). Weirdly enough, there is a button in the applet letting you toggle the sounds, but it doesn't seem to work as expected.

The same applies to a few tests of mine while running an applet that starts Major Stryker, uploaded by a developer of em-dosbox, although I've maybe had a few sound stutters in Chromium and possibly also Firefox (popup windows/messages show by the browser may contribute to this): http://www.vogons.org/viewtopic.php?p=3 ... be#p339939

I'm afraid I'm also unaware of a comparable alternative. One difficulty I've heard about sound support, is that the emulators generate the sound on-the-fly, rather than loading existing sound data. This may have been improved up to some level, but I haven't tested enough to be sure.
developertn
9-bit ubernerd
Posts: 833
Joined: March 23rd, 2015, 4:23 pm

Re: How to have DOS Box show in my browser

Post by developertn »

Well, being a professional aspiring developer I've been hard at work studying and paying my dues. According to my programming books on sounds it states that a sound frequency at 7 hertz will kill an unhatched egg. So taking all precautions I've decided against using sounds in many if not all of my recent programs. In my older programs when you turn off the sound it rapidly goes down to zero frequency. So you end up hitting 7 for a brief moment. According to my real dad if you do it too often the annoyance factor will still stunt the bird's growth.
Malvineous
8-bit mega nerd
Posts: 292
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: How to have DOS Box show in my browser

Post by Malvineous »

NY00123 wrote:One difficulty I've heard about sound support, is that the emulators generate the sound on-the-fly, rather than loading existing sound data. This may have been improved up to some level, but I haven't tested enough to be sure.
This is actually a pretty difficult problem to solve well in the environment. The closer you get to real-time audio, the more sensitive everything becomes to the slightest change in timing. In a web browser, it might suddenly decide to save your session data at random, or a page in another tab refreshes itself, and that takes 1ms longer than the last cycle, your audio buffer empties, and you get a stutter in the emulator's audio output. This is why programs like software MIDI synthesisers always try to run with "real-time" priority, so that no matter what happens, they always get to top up the audio buffer before it runs dry. Of course that's not possible in a web browser, so I don't think it's something you can easily fix.

Not unless you increase the buffer size of course, but then it's weird when the delay in doing so causes you to hear a sound effect five seconds after you expected to!
User avatar
MrFlibble
Forum Administrator
Posts: 1798
Joined: December 9th, 2010, 7:19 am

Re: How to have DOS Box show in my browser

Post by MrFlibble »

Frankly I've never liked the idea of playing games in a browser. Of course it's more accessible to users than installing the game to the HDD, or installing and configuring DOSBox beforehand in the case of DOS games. But honestly this should not be anything more than a way to demonstrate the game, not play it regularly like that IMO.
Post Reply