Updated Web Emulator

All aspects of programming on the Commander X16.
User avatar
JimmyDansbo
Posts: 476
Joined: Sun Apr 26, 2020 8:10 pm
Location: Denmark
Contact:

Updated Web Emulator

Post by JimmyDansbo »


@SebastianVoges Any chance you could help me understand why this does not work?

https://sebastianvog.github.io/x16-emulator/x16emu.html?manifest=https://cx16.dk/cx16maze/

It just stays at the loading screen

Thanks in advance
Visit my Github repo
or my personal site with CX16/C64/6502 related information.
Feel free to contact me regarding any of my projects or even about meeting up somewhere near Denmark
SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »



5 hours ago, JimmyDansbo said:




@SebastianVoges Any chance you could help me understand why this does not work?



https://sebastianvog.github.io/x16-emulator/x16emu.html?manifest=https://cx16.dk/cx16maze/



It just stays at the loading screen



Thanks in advance



The following exception happened in the browser:

"Access to fetch at 'https://cx16.dk/cx16maze/manifest.json' from origin 'https://sebastianvog.github.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

This is a CORS issue. Basically the browser not allowing to fetch the resources from a different domain.

Not sure how much control you have over your backend, but can you configure the server to allow cross origin requests? This resource might help 

https://enable-cors.org/server.html

Oh and additionally: I made a mistake in my original post. it has to be a manifest.json file not a manifest.xml

but i still think CORS issue need to be fixed as well.

Also, I don't mind hosting for the short-term: https://sebastianvog.github.io/x16-emulator/x16emu.html?manifest=https://x16repos.s3.amazonaws.com/cx16maze/

 
Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »


Once we can get the emulator on the final web domain it should then work for any apps uploaded to the software library at the same domain.
Main Administrator
Site Admin
Posts: 167
Joined: Sun Feb 27, 2022 12:43 am

Updated Web Emulator

Post by Main Administrator »


@SebastianVogesWe have some uploads that are pure BASIC files. Is there a way to load them too via a manifest or does it only work with PRG files?

SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »


@MattGrandisBasic files I think it might not work currently due to how I pass it to the emulator. I can check later to see how this is implemented.  there might need to be an adjustment done, but the same concept should work.

I am also working on just supplying a .zip file to the emulator which can contain all the assets and manifest. I think that would be a bit easier to maintain instead of having to deal with folders. I am halfway done with it but stopped work on that a while ago. I will pick it up over the weekend. 

 

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

Updated Web Emulator

Post by Main Administrator »


Passing a zip file would be great! We've already added a note to our implementation that it only works with PRG files. It is a fantastic feature nonetheless! Thanks for your work!

SebastianVoges
Posts: 33
Joined: Tue Apr 28, 2020 9:14 pm

Updated Web Emulator

Post by SebastianVoges »


@MattGrandis @Perifractic

 I have an updated version here:

https://x16emu.s3.amazonaws.com/x16emu.html?manifest=https://x16repos.s3.amazonaws.com/chase.zip

Support for zip files in the ?manifest parameter was added. (the old way should also still work)

The emulator expects the manifest.json in the root of the zip.

Support for Basic programs was added: 

In the manifest, the basic file has to be specified with 

 "start_bas": "HELLO.BAS"

I also added error logging in the javascript console. If the emulator doesn't start as expected, the logging should hopefully point to the area of failure.

Lastly , I took some work-in-progress speed optimization code from @StephenHorn and Michael Browns Pull Request to make web emulator a lot more usable.

The zipped assets for the web emulator are under https://github.com/sebastianvog/x16-emulator/releases/tag/1.0.0-beta.2

By next weekend I hope to clean up the code,  add  some general readme for the manifest.json format, and create a pull request to get this back into the main x16 GitHub repo.

Cheers,

Sebastian

Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

Updated Web Emulator

Post by Perifractic »


Thanks @SebastianVoges

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

Updated Web Emulator

Post by Main Administrator »


Amazing work, @SebastianVoges! I'll upload that version to our site ASAP. It's going to make handling zip files so much easier for us, we definitely owe you a beverage of your choice!

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

Updated Web Emulator

Post by Main Administrator »


I'm adding the new functionality now. I'll have to adapt some code on the server to add dealing with zip files, so until further notice, the Try it now function might break! I'll give notice here when everything's back to normal again.

Post Reply