Updated Web Emulator

All aspects of programming on the Commander X16.
Post Reply
SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »


Hi, I updated the web version x16 emulator at https://sebastianvog.github.io/x16-emulator/x16emu.html

It has the latest R37 code, and some web assembly related fixes (audio, rendering on hdpi displays)

As an added feature for developers, who would like to show case their work online, you can now point a remote web folder to the emulator.

As example I used @SlithyMatt awesome ChaseVault game and put the chase vault files on a static web site and then pass in that URL via the ?manifest parameter

  https://sebastianvog.github.io/x16-emulator/x16emu.html?manifest=https://x16repos.s3.amazonaws.com/chasevault/

The web emulator expects/loads a manifest.json file from that location, loads all resources and then executes it. The manifest structure looks like this

{

  "manifest_version": "1.0",

  "name": "Chase Vault",

  "author": "Matt Heffernan",

  "app_version": "0.4",

  "license": "GPL 3",

  "start_prg": "CHASVALT.PRG",

  "resources": [

    "CHASVALT.PRG",

    "BITMAP.BIN",

    "MUSIC.BIN",

    "PAL.BIN",

    "SPRTATTR.BIN",

    "SPRITES.BIN",

    "STARTBG.BIN",

    "TILEMAP.BIN",

    "TILES.BIN",

    "WINMUSIC.BIN"

  ]

}

The format of the manifest is subject to change. This was a first shot at this. 

Let me know what you think. I hope this will be useful to showcase/share application with the community for easy consumption in a web browser.

cheers,

Sebastian
Yuki
Posts: 126
Joined: Mon Apr 27, 2020 1:50 am

Updated Web Emulator

Post by Yuki »


Oh, that's pretty cool. Maybe we can have some sort of "Try it" button in the download section by reading such a manifest in the zip file?
Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »



30 minutes ago, Juju said:




Oh, that's pretty cool. Maybe we can have some sort of "Try it" button in the download section by reading such a manifest in the zip file?



Nice work Sebastian! And yes that's exactly what this feature is being developed for. We are aiming to have exactly that; a "Try it now" button in the software library that will load any program this way.
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

Updated Web Emulator

Post by SlithyMatt »


Very cool! Any plans to add sound support?
SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »



6 hours ago, SlithyMatt said:




Very cool! Any plans to add sound support?



I have been looking into it and sound for WebAssembly is supported now(with issues).

Browsers don't allow playing of sound without prior user-interaction. There  is a audio icon (top left in fullscreen mode), which will toggle on/off the audio portion of the core emulator.. If you click it, the sound will start playing (not immediately sometimes, in ChaseVault you sometimes have to lose a life and then audio will start up again ).  Currently the audio output is  distorted, so something in the audio init is not correct for WebAssembly. I will look into it this weekend. Performance is also browser dependent, there is a noticeable slow down in Safari for me, whereas Chrome seems to run smoother.

 
Main Administrator
Site Admin
Posts: 167
Joined: Sun Feb 27, 2022 12:43 am

Updated Web Emulator

Post by Main Administrator »


Hi @SebastianVoges! Impressive work! We have a copy of the emulator running on this site, available via the Try It Online Here button on the home page. Are you keeping the version on your Github page current? If so, maybe it would make sense to link directly there instead of having to keep our own version current, @Perifractic?
SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »



13 minutes ago, MattGrandis said:




Hi @SebastianVoges! Impressive work! We have a copy of the emulator running on this site, available via the Try It Online Here button on the home page. Are you keeping the version on your Github page current? If so, maybe it would make sense to link directly there instead of having to keep our own version current, @Perifractic?



 I plan on keeping it current to the latest official release of the x16  emulator and plus changes on my end that might not have merged back yet to the main x16 emulator repo .  At some point I will move away from using GitHub pages as a static web-server and host the web emulator on AWS. It probably will also make sense to have a stable production version which lines up with official Emulator Releases and a development version which can change frequently.

 
SlithyMatt
Posts: 913
Joined: Tue Apr 28, 2020 2:45 am

Updated Web Emulator

Post by SlithyMatt »



2 hours ago, SebastianVoges said:




Currently the audio output is  distorted, so something in the audio init is not correct for WebAssembly.



That's an issue that plagues Linux, too. It has to do with some bad assumptions in SDL. What you can do is cut down the sample rate so that you may have lower fidelity, but less distortion and "wobbliness".
SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »



12 minutes ago, SlithyMatt said:




That's an issue that plagues Linux, too. It has to do with some bad assumptions in SDL. What you can do is cut down the sample rate so that you may have lower fidelity, but less distortion and "wobbliness".



oh, that's good to know, ty!
Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »



5 hours ago, MattGrandis said:




Hi @SebastianVoges! Impressive work! We have a copy of the emulator running on this site, available via the Try It Online Here button on the home page. Are you keeping the version on your Github page current? If so, maybe it would make sense to link directly there instead of having to keep our own version current, @Perifractic?



Yes I believe we do currently link directly to Sebastian's version (I changed it a few days ago) ?
Post Reply