Jump to content
Visual Boy Advance-M
ILOVEPIE

JS-VBA-M: World's First Working Webgl based JS GBA emulator!

What do you think of this?  

3 members have voted

  1. 1. What do you think of this?

    • It's Awsome!
    • It Sucks!
      0


Recommended Posts

[align=center]JS-VBA-M[/align]

 

 

Hey guys just thought I'd share a project I'm working on. I am porting VBA-M to Javascript using the Emscripten C/C++ to javascript compiler and a modified version of the VBA-M SDL code.

 

Runs natively in browser with no plugins required!

 

Development Progress Picture (I am using Pokemon Ruby as the testcase):

[align=center]dev_progress.png

 

[video=youtube]

[/align]

 

 

Progress:

 

- Get JS-VBA-M to compile. Done.

 

- Fix the command line arguments parsing code. Done.

 

- Get it to load a game and run it. Done.

 

- Get it to display the FPS meter. Done.

 

- Get it to display the game. Done.

 

- Get it to run at at least 48% speed (the cross-compiler promises the program will run at most 4x slower than native when the optimization options are configured correctly, so as my computer runs VBA-M at 87% speed, the JS version should run at 48% speed at it's slowest). WIP (still fiddling with compiler optimization options (getting ~38% speed on my laptop)).

 

- Streamline the build system and fix the cmake files to work correctly with emscripten. Todo.

 

Working Version:

http://dl.dropbox.com/u/20328726/vbamjs/index.html

Share this post


Link to post
Share on other sites

Nice, although Emscripten does not really mean ported. It means you "compiled" it to JavaScript really. I had been working on my own JS GBA emulator, although I've been AFK on IodineGBA (and github in general) for about a month.

 

Also it's not the first: https://github.com/jpfau/gbajs

 

Problem with emscripten is that there are certain conventions that work on the LLVM level that do not work well on the JS level. Low level heap/stack ops often do not play well when compiled via emscripten to js. Not to mention there are many programming conventions fast in C/C++ that are slow in JS that could be substituted with other conventions in JS.

Share this post


Link to post
Share on other sites

Nice, although Emscripten does not really mean ported. It means you "compiled" it to JavaScript really. I had been working on my own JS GBA emulator, although I've been AFK on IodineGBA (and github in general) for about a month.

 

Also it's not the first: https://github.com/jpfau/gbajs

 

Problem with emscripten is that there are certain conventions that work on the LLVM level that do not work well on the JS level. Low level heap/stack ops often do not play well when compiled via emscripten to js. Not to mention there are many programming conventions fast in C/C++ that are slow in JS that could be substituted with other conventions in JS.

While that is very true, Emscripten when set up correctly will automatically convert those things to the correct faster versions in javascript... I get almost a 20% speedup by compiling with some of the options...

I'm getting 20% of the actual device speed with just the default optimisations... im thinking of trying -02 with some other custom optimisations...

Share this post


Link to post
Share on other sites

Impressive, but I advise to pay attention to what grantg sez

 

I know what I'm doing, the thing is Grant is right that emscripten has these problems... In some cases.

This is not one of them.

 

But thanks!

 

I just found out it works correctly on the Droidx if you use Opra Mobile.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×