dreamlayers / em-dosbox

An Emscripten port of DOSBox
www.dosbox.com
GNU General Public License v2.0
1.22k stars 154 forks source link

Archjs, Virtjs #13

Open arcanis opened 9 years ago

arcanis commented 9 years ago

Hi,

I've started the Virtjs project, which aims to provide a modular way to specify how should an opaque core interact with an external webpage (think of it as a generic audio/video/input interface, that can be filled by multiple implementations, called "devices", some of them available straight away). For example, here is the base Screen interface, and here is the WebGL device.

For instance, Archjs is another project of mine that links these interfaces with emscripted libretro emulation cores, so that the emulators are wrote using C/C++, but the communication with the webpage is actually done with raw Javascript (avoiding any extraneous abstraction).

Using this system, there is no really need of a "template" html page: everything can be instancied with only very few lines of code. Bonus, it can also be used to run an emulator with Node (since we only need to provide a different device implementation, compatible with Node APIs).

Would you be interested in using it? I'd happy to exchange with you on this subject.

dreamlayers commented 9 years ago

I agree with the general principle of integrating Em-DOSBox with something like that. Making the project totally stand-alone makes it harder to integrate into a web site. All sorts of things could be made easier, such as customizing page appearance, managing DOSBox settings and reducing duplication when hosting multiple programs.

I know the Archive.org people have their own loader and want to make it easy to host emulators. They've done some impressive things, like allowing emulators hosted at Archive.org to be used directly from tweets. I'm not sure how much they have done in terms of allowing others to easily host emulators on other sites.

arcanis commented 9 years ago

The advantage of Virtjs APIs over anything else is that the same devices can be used accross many different implementations. For example, assuming that you use the screen device API to render the dosbox output, then you can instantly use a WebGL-based rendering, disable the rendering, render into an output buffer, or even apply post-processing on the output. Zero code required.

hikari-no-yume commented 8 years ago

That would be nice, but that would require patching emscripten's SDL2 implementation.