Jump to content

Photo

Embedding 6502.ts in other webpages


7 replies to this topic

#1 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • 369 posts
  • Location:Germany

Posted Sun Jun 11, 2017 3:55 PM

As I am going to use it for another project (http://atariage.com/...on-our-website/), I am planning on adding an interface for embedding 6502.ts in other webpages. Before going ahead and deciding on an API, I wanted to ask if anybody else is interested in this and, if yes, whether you have any particular suggestions how the interface should look like and what options it should provide  :)

 

The basic setup I have in mind is a Javascript library that you load on your webpage and that gives you access to the emulator as a library. You have to include a canvas element on your page; then you start the emulator with a cartridge image and a bit of configuration, and you're set. However, the details are still variable. Is anybody else interested in using this?



#2 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 12,154 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Sun Jun 11, 2017 5:36 PM

I've a few pages on my site, like Homebrews Online, that use JStella; though it hasn't worked in a while (probably due to browser changes and /or security settings).

 

When it worked it was pretty slick - all the buttons on Artie the Atari were functional.  When it was powered off you could change the game, at which point the game the instructions below Artie would also be changed.

 

It'd be nice to get that working again :)



#3 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • Topic Starter
  • 369 posts
  • Location:Germany

Posted Mon Jun 12, 2017 3:40 PM

I've a few pages on my site, like Homebrews Online, that use JStella; though it hasn't worked in a while (probably due to browser changes and /or security settings).

 

When it worked it was pretty slick - all the buttons on Artie the Atari were functional.  When it was powered off you could change the game, at which point the game the instructions below Artie would also be changed.

 

It'd be nice to get that working again :)

 

I just took a look; I think hooking up 6502.ts should be no issue (with the only catch that the keybindings are different and cannot be configured atm ;) ). I'll post here once I come up with a first version of the embedding API, then we can see whether this works for you (or make any necessary changes).



#4 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • Topic Starter
  • 369 posts
  • Location:Germany

Posted Mon Jan 8, 2018 5:10 PM

It has been a while, but I finally have a embedded version of Stellerator running :) The full documentation (including API docs) is available here, but I'll add a few remarks here anyway:

 

  • Check out the example page and its source to get started. The emulator instance is exposed as windows.stellerator, so you can open the developer tools and play with it.
  • There are two scripts that you have to download and host alongside your web page. One needs to be loaded via a script tag, the other (the web worker) is loaded by the emulator at runtime. You can grab the scripts from the Github releases page.
  • If you have a javascript application with a dedicated build process, you can also grab the module from NPM and include it in your build. Note that you still have to host the web worker script.
  • The emulator runs fine in recent versions of Chrome, Firefox and Safari. Edge works but currently has severe performance issues.

If you try this out and encounter any issues or have suggestions on how to improve the documentation, please comment in this thread or open an issue on GitHub.


Edited by DirtyHairy, Mon Jan 8, 2018 5:11 PM.


#5 SpiceWare OFFLINE  

SpiceWare

    Draconian

  • 12,154 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Wed Jan 10, 2018 2:39 PM

Great, I'll see about updating my site to use it.

 

Have you solved the issue with joystick controls in iOS yet?  Last time I tried it (Sunday the 7th) they were still inverted.



#6 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • Topic Starter
  • 369 posts
  • Location:Germany

Posted Thu Jan 11, 2018 3:23 AM

Great, I'll see about updating my site to use it.

 

Have you solved the issue with joystick controls in iOS yet?  Last time I tried it (Sunday the 7th) they were still inverted.

 

 

Great, drop me a note if you encounter any issues.

 

I have not yet done anything on the gamepad issue. However, I have thought that I could include a set of nonstandard mappings for known combinations of controller / OS. I'll drop you a note when I get to adding this, I'll need some information about the gamepad's ID and the data the browser identifies itself with :) I also want to grab one of our company test devices these days and check out the audio issues on iOS.


Edited by DirtyHairy, Thu Jan 11, 2018 3:23 AM.


#7 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • Topic Starter
  • 369 posts
  • Location:Germany

Posted Thu Jan 11, 2018 4:17 PM

Just a short followup on iOS audio: I found some time to snatch a test device and fiddle with it before leaving work today. I still need some testing and polishing, but I have a workaround and will publish an update this weekend. However, it will still require a touch anywhere on the page before playing audio, that's what is enforced by Apple.

 

I tested an iPhone 6s must say that I was very impressed by how smooth they emu runs --- the interface remains silky smooth, and I didn't get a single audio dropout. No way to compare this to android where the interface jerks and I couldn't get more then one second of sustained full speed ;) I'll also add fullscreen by tapping to Stellerator and fix interface on mobile, and will be looking at touch controls soon.


Edited by DirtyHairy, Thu Jan 11, 2018 4:19 PM.


#8 DirtyHairy ONLINE  

DirtyHairy

    Moonsweeper

  • Topic Starter
  • 369 posts
  • Location:Germany

Posted Sat Jan 13, 2018 4:07 PM

I just published 0.9.8. It includes the promised iOS audio fix: audio starts once you tap anywhere on the display (this is unavoidable and enforced by Apple). In addition, I have made changes to the Stellerator UI to display properly on phone-sized devices.

 

However, I have excluded click-for-fullscreen for the time being as I had to find out that iOS does not support the HTML5 fullscreen API  :roll: . I have hacked around this by displaying the canvas element above everything else, but the browser toolbar will still interfere. This is a known problem on iOS, and there is not much that can be done about it. I think it will still work sort-of fine once I have touch support (at the expense of manually scrolling the display to remove the toolbar), but there is not much point before that. I'll also add support for adding Stellerator as a home screen application, which will also get rid of the toolbar if it is launched that way  :P .

 

Speaking of touch, I think I have finally come up with an input scheme that might be practical for actual gaming (that's what has been keeping me from working on this so far). I have started the implementation, but it may still take some to to be ready for prime time.


Edited by DirtyHairy, Sat Jan 13, 2018 4:09 PM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users