ScummVM logo Forum Index - ScummVM website - Contact us - Buy Supported Games: GOG.com Rules - Search - Register - Login curved edge
Folder Forum Index > Other Ports > ScummVM in JavaScript?
ScummVM in JavaScript?
  Author    Thread Reply to topic
shurlogg



Joined: 09 Jun 2007
Posts: 18
ScummVM in JavaScript? 

A JavaScript port of ScummVM may have actually become a lot easier to do than it used to:

https://github.com/kripken/emscripten/wiki

Aparrently, some awesome people have created a tool called Emscripten that compiles LLVM bytecode to JavaScript, so in theory anything that can be compiled with LLVM (including C/C++ code) could be translated to JavaScript. The developers say that it probably still has lots of bugs, and is about 90% slower than the original code, but it may be a first step that could ultimately result in ScummVM running in a web browser.

 Reply with quote  
Post Tue May 31, 2011 2:52 pm 
 View user's profile Send private message
sev
ScummVM Lead


Joined: 21 Sep 2005
Posts: 1924
 

MinGW-built stripped ScummVM binary with all engines and features enabled (SDL port) takes about 20M in size. Fat chance for JavaScript.


Eugene

 Reply with quote  
Post Tue May 31, 2011 5:41 pm 
 View user's profile Send private message Visit poster's website
agf



Joined: 13 May 2011
Posts: 8
 

The project apparently has built in SDL support, so I wonder if a one-engine build with the simplest engine and all features turned off might work?

Does ScummVM work with LLVM-gcc and/or Clang?

Edit: Yeah, works fine with llvm-gcc.

 Reply with quote  
Post Wed Jun 01, 2011 3:38 am 
 View user's profile Send private message
NovaCoder



Joined: 23 Sep 2009
Posts: 74
 

Well if you can get Quake 2 running in a browser, I guess it must be possible to get ScummVM online Wink

I'll then be able to play DOTT all day at work, awesome Razz

 Reply with quote  
Post Wed Jun 01, 2011 11:46 pm 
 View user's profile Send private message
agf



Joined: 13 May 2011
Posts: 8
 

quote:
Originally posted by NovaCoder
Well if you can get Quake 2 running in a browser, I guess it must be possible to get ScummVM online Wink

I'll then be able to play DOTT all day at work, awesome Razz


That's not really running in a browser, and it's not the original source code. It's running in the Java VM and it's a source port to Java.

JavaScript ScummVM would be way cooler Smile.
 Reply with quote  
Post Thu Jun 02, 2011 12:00 am 
 View user's profile Send private message
NovaCoder



Joined: 23 Sep 2009
Posts: 74
 

quote:
Originally posted by agf
quote:
Originally posted by NovaCoder
Well if you can get Quake 2 running in a browser, I guess it must be possible to get ScummVM online Wink

I'll then be able to play DOTT all day at work, awesome Razz


That's not really running in a browser, and it's not the original source code. It's running in the Java VM and it's a source port to Java.

JavaScript ScummVM would be way cooler Smile.


No actually the Quake 2 port is using Javascript...


quote:

Quake II GWT PortÂThe Quake II GWT port brings the 3d gaming experience of Quake II to the browser.
In the port, we use WebGL, the Canvas API, HTML 5 <audio> elements, the local storage API, and WebSockets to demonstrate the possibilities of pure web applications in modern browsers such as Safari and Chrome.

The port is based on the Jake2 project, compiled to Javascript using the Google Web Toolkit (GWT).



Quake 2 port

So it's gone C++ > Java > Javascript Very Happy
 Reply with quote  
Post Fri Jun 03, 2011 2:55 am 
 View user's profile Send private message
juj



Joined: 11 Jun 2013
Posts: 3
 

Hi,

I have now finished a first version/proof-of-concept port of ScummVM over to Javascript using the Emscripten compiler. (I am a Windows maintainer of the Emscripten project, so I've gotten quite familiar with the toolchain over time)

The demo works best in the desktop Firefox browser. The optimized code size for scumm0-6 engine turned out to be about 8MBytes.

The demo link and a technical discussion thread about the port can be found on the emscripten-discuss google mailing list.

Unfortunately I am not able to provide a link because the forum rules suggest I should first contribute a number of forum posts without links before I am empowered to posting a link. I don't think it makes much sense for me to spam a number of threads just to get around an anti-spam feature, so perhaps someone with those powers can find the demo URL and post the link here. Sorry about that, but I didn't make up the forum rules. :/

 Reply with quote  
Post Tue Jun 11, 2013 12:26 pm 
 View user's profile Send private message
sev
ScummVM Lead


Joined: 21 Sep 2005
Posts: 1924
 

The demo is at http://clb.demon.fi/html5scummvm

The discussion group is https://groups.google.com/forum/?fromgroups#!topic/emscripten-discuss/ubv-vHIgYsc

 Reply with quote  
Post Tue Jun 11, 2013 2:44 pm 
 View user's profile Send private message Visit poster's website
juj



Joined: 11 Jun 2013
Posts: 3
 

Thanks sev!

 Reply with quote  
Post Tue Jun 11, 2013 2:50 pm 
 View user's profile Send private message
OmerMor
Got a warning


Joined: 17 Nov 2005
Posts: 139
Location: Israel
 

Amazing!

 Reply with quote  
Post Tue Jun 11, 2013 6:43 pm 
 View user's profile Send private message Visit poster's website
OmerMor
Got a warning


Joined: 17 Nov 2005
Posts: 139
Location: Israel
 

juj,
do you believe it'll be possible to port munt into javascript as well? Of course it'll be very cpu intensive, but scummvm+munt is a winning match.

 Reply with quote  
Post Tue Jun 11, 2013 8:15 pm 
 View user's profile Send private message Visit poster's website
juj



Joined: 11 Jun 2013
Posts: 3
 

I am not familiar with munt, but had a quick look at it. Briefly looking, I don't see anything fundamentally limiting. Generic C/C++ code that does audio wave buffer synthesization without resorting to platform-specific code should be easy to get compiled.

The only thing is that to actually play out audio from the speakers, one needs to use OpenAL or SDL Audio - these are the only currently implemented audio backends to Emscripten, or develop a custom Web Audio -based JS sound API. There is no OSS/ALSA/other linux audio API support in Emscripten, so any code interfacing with those will not work.

 Reply with quote  
Post Thu Jun 13, 2013 9:15 am 
 View user's profile Send private message
lazylazyjoe



Joined: 01 Oct 2007
Posts: 132
 

I tested the MI1 demo with my android phone using the standard web view browser and it seemed to work well.
Nice job and good luck !

 Reply with quote  
Post Sat Jun 15, 2013 2:09 am 
 View user's profile Send private message
  Display posts from previous:      
Reply to topic

Forum Jump:
 



Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Powered by phpBB © 2001, 2006 phpBB Group
Forum design by ScummVM team, icons by raina
curved edge   curved edge