Uzem ported to HTML5/JavaScript

The Uzebox now have a fully functional emulator! Download and discuss it here.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

D3thAdd3r wrote:You have this thing beat, wow.

Works perfect on my PC. On my phone using firefox or the generic builtin browser it throws an exception and wont run for whatever reason.
:D

It worked fine without messing with the memory settings when I ran it from localhost, but when I uploaded it to uzebox.net, it kept telling me that I needed to increase the TOTAL_MEMORY setting, so I tweaked that inside the uzem.html file. I kept on doubling it until it didn't crash, and I ended up having to bump it to 512MB for some strange reason. That's probably why it doesn't run on your phone.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by uze6666 »

Awesome, great work again on having the sd interface working! Very cool to see Alter Ego running in my browser. :D

A couple questions. I guess there's a way to change the look of that page html page at some point, it a bit dull. What about having multiple games? Is it possible to have some sort of menu to pick games?
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

uze6666 wrote:Awesome, great work again on having the sd interface working! Very cool to see Alter Ego running in my browser. :D

A couple questions. I guess there's a way to change the look of that page html page at some point, it a bit dull. What about having multiple games? Is it possible to have some sort of menu to pick games?
Thanks!

Yes, it's possible to edit the HTML page, and it should be possible to add a menu to select which game you want to play, though we probably wouldn't want to pack every game inside one download, so we'd have to figure out a way to asynchronously download a game into a virtual filesystem, map that filesystem, and then figure out how to get the emulator to refresh. That's a whole other can of worms that I haven't opened yet.

I was thinking maybe having a background graphic that looks like a Uzebox themed arcade game, but with the OpenGL window where the screen would be could look pretty cool.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by uze6666 »

Artcfox wrote:
uze6666 wrote:
I was thinking maybe having a background graphic that looks like a Uzebox themed arcade game, but with the OpenGL window where the screen would be could look pretty cool.
Ah yes, good idea, that would be pretty neat! :)
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

uze6666 wrote:
Artcfox wrote:
uze6666 wrote:
I was thinking maybe having a background graphic that looks like a Uzebox themed arcade game, but with the OpenGL window where the screen would be could look pretty cool.
Ah yes, good idea, that would be pretty neat! :)
Or each game page could have a different custom background designed as it were an arcade game cabinet. Like box art, but cabinet art!

Different games may require different compile options, so I'm not 100% sure we can make a one-size fits all, though we might be able to run each with different additional command line arguments that change the behavior of the emulator. I'll have to experiment more.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

I added a new wiki page describing the entire start-to-finish process of publishing a Uzebox game to the web including:
  • Installing prerequisites
  • Building Emscripten
  • Configuring Uzem to be built with Emscripten
  • Preloading the virtual filesystem with the necessary game files
  • Configuring the command line arguments inside the generated uzem.html file
  • Testing the web version of Uzem
  • Publishing the web version of Uzem online
  • Errors you may encounter
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by uze6666 »

Well done. Hopefully it's not too hard to attain the same thing under Windows.
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

Here is the latest web version (speed limiter removed) with all of the optimizations done by everyone so far combined: bugz-too-fast2

The only optimizations not included are the u8, u16, s16 -> native int size changes in avr::exec(), which should give it another ~10% speed boost when implemented correctly.

The great news is that this is starting to become playable on a $199 Chromebook! :D

Edit: The u8, u16, s16 -> native int size changes actually slow it down.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Uzem ported to HTML5/JavaScript

Post by D3thAdd3r »

I really can't believe it, it runs too fast in a web browser on this junk hardware I'm on right now. Also, this game is absurdly difficult at this speed :shock:
User avatar
Artcfox
Posts: 1382
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Uzem ported to HTML5/JavaScript

Post by Artcfox »

D3thAdd3r wrote:I really can't believe it, it runs too fast in a web browser on this junk hardware I'm on right now. Also, this game is absurdly difficult at this speed :shock:
The problem is it can either be too fast, or too slow. If I request 60 fps, then the browser considers it low priority and only calls the routines when it feels like. If I tell it "call me as fast as you can" then it runs too fast. Attempting to delay until it's the "right time" causes it to not work, because it doesn't like delays.
Post Reply