CPCWiki forum

General Category => Emulators => Topic started by: scruss on 17:46, 16 June 18

Title: easy to deploy JS CPC emulator?
Post by: scruss on 17:46, 16 June 18
I'm trying to have a few CPC programs run in browser-based emulators hosted on my own site. I've been able to do this easily for ZX Spectrum images with JSSpeccy (https://github.com/gasman/jsspeccy2/blob/master/Embedding.txt), but the Amstrad emulators I've looked at have either source or instructions AWOL, or just plain huge (jsmess i am looking at you ...).
Any suggestions for an easier installation?
Title: Re: easy to deploy JS CPC emulator?
Post by: GUNHED on 18:01, 17 June 18
Devilmarkus can do this. He created the JavaCPC emulator. Very nice!

On my homepage there is an integrated emulator, you can email him, maybe he can help you.

That's how if works for me:
http://futureos.cpc-live.com/

Click at "FutureOS online". (Doesn't work with chrome).
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 00:58, 18 June 18
Thanks, but that's Java. I'm looking for JavaScript.
Java doesn't run on any browser on any system I own. I had a couple of JavaCPC deployments on the web, but none of them work now.
Title: Re: easy to deploy JS CPC emulator?
Post by: pelrun on 02:37, 18 June 18
Quote from: scruss on 17:46, 16 June 18
I'm trying to have a few CPC programs run in browser-based emulators hosted on my own site. I've been able to do this easily for ZX Spectrum images with JSSpeccy (https://github.com/gasman/jsspeccy2/blob/master/Embedding.txt), but the Amstrad emulators I've looked at have either source or instructions AWOL, or just plain huge (jsmess i am looking at you ...).
Any suggestions for an easier installation?


@pmeier (http://www.cpcwiki.eu/forum/index.php?action=profile;u=2206) just got vvvv4k running online using Roland, so they might have some insight. I see that the source link on the Roland site is broken, as far as I can tell the current location is actually https://sourceforge.net/projects/emuscriptoria/.
Title: Re: easy to deploy JS CPC emulator?
Post by: mr_lou on 06:17, 18 June 18
Quote from: scruss on 00:58, 18 June 18
Thanks, but that's Java. I'm looking for JavaScript.
Java doesn't run on any browser on any system I own.
Which systems are those?
Title: Re: easy to deploy JS CPC emulator?
Post by: pmeier on 08:24, 18 June 18
No, Roland is written in Javascript and GLP'ed:
https://sourceforge.net/projects/emuscriptoria/ (https://sourceforge.net/projects/emuscriptoria/)
http://roland.retrolandia.net/ (http://roland.retrolandia.net/)

Just download the 6128s.html and _6128s.rom.
Install it on your Apache or run it locally with Firefox. (Other browsers seem more restrictive and require a web server.)

My Roland version supports touch controls: http://timealias.bplaced.net/cpc/ (http://timealias.com/cpc/)
Press F1 for instructions. (F8 for reset.)
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 13:23, 18 June 18
Quote from: mr_lou on 06:17, 18 June 18
Which systems are those?
Linux (x86_64 and armv6l/armv7l), Mac OS and Windows 10. The plugin API that Java applets use has been dead since 2015 (Chrome/Chromium, Firefox and Edge won't recognize them), and it's been absent from the JDK since Java 9.
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 13:49, 18 June 18
Quote from: pmeier on 08:24, 18 June 18
Just download the 6128s.html and _6128s.rom.
Ah, thanks! Got those two files from your site, and indeed I pulled up a full-screen 6128 ... unfortunately, the keys seem to think that the space bar is X, which is not a good look.
Title: Re: easy to deploy JS CPC emulator?
Post by: pmeier on 18:04, 18 June 18
 ;D No, I turned on joystick by default. Just press F2 to disable joystick.
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 15:52, 23 June 18
thanks!

I'm finding the original code from emuscriptoria a bear to build: the non-standard build scripts written in php, reliance on a local patched version of yui-compressor, no docs at all ... may I ask how you managed to generate the 6128s.html and _6128s.rom files? Your version's lovely (and that vvvvvv port is extremely neat), but I don't want to have to advise users about having to hit F2 every time they start.
Title: Re: easy to deploy JS CPC emulator?
Post by: pmeier on 16:18, 23 June 18
Quote from: scruss on 15:52, 23 June 18
thanks!

I'm finding the original code from emuscriptoria a bear to build: the non-standard build scripts written in php, reliance on a local patched version of yui-compressor, no docs at all ... may I ask how you managed to generate the 6128s.html and _6128s.rom files? Your version's lovely (and that vvvvvv port is extremely neat), but I don't want to have to advise users about having to hit F2 every time they start.
Well, looks like you found it out already  :laugh: To build 6128s.html and _6128s.rom.deflate, you need to comment out the blocks in compila.php

Then load the file with your webbrowser. The .htaccess is required, otherwise the rom is not uncrunched (inflated  ;) ). My webspace does not allow that. So you could patch the php file or download the rom from your local apache.
I think installing yui is optional. Otherwise download the jar and add it to the classpath. (I did.)

Or you could use the default Roland emulator, which has joystick turned off by default. I patched it, because I didn't want to tell gamers how to turn on joystick. (Where is F2 on mobile devices??  :picard: )
PS: I found it a little bit tricky to get it compiled, too. And I saw so many different makefile ecosystems before.  :o But good software is always a motivation to look deeper...
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 04:40, 25 June 18
Quote from: pmeier on 16:18, 23 June 18
... But good software is always a motivation to look deeper...
It's kind of hard to say "good software" and "undocumented PHP-based build system" in the same sentence and keep a straight face ...
Anyway, I worked it out. This for a single emulator for the 6128:

Hope this helps someone!
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 18:51, 02 July 18
Probably best asking the author this, but: anyone know the control code (if one exists) to fake a Return press on a CPC? I'd like to see if I can run a one-liner by substituting some BASIC for the run"disc argument. I can get it to accept one line, but the user then has to manually type RUN.
Like this:http://scruss.com/cpc/6128s.html?stardoj.dsk/10%20PRINT%20CHR$(199+2*RND);:%20GOTO%2010 (http://scruss.com/cpc/6128s.html?stardoj.dsk/10%20PRINT%20CHR$(199+2*RND);:%20GOTO%2010)
Title: Re: easy to deploy JS CPC emulator?
Post by: reidrac on 19:54, 02 July 18
Quote from: mr_lou on 06:17, 18 June 18
Which systems are those?

Any using a modern browser; and for good reasons.

* https://support.mozilla.org/en-US/kb/npapi-plugins
* https://java.com/en/download/faq/chrome.xml

So Firefox since March 2917 and Chrome since September 2015. Because those two browsers account for over 70% of the desktop marketshare (these stats are unreliable, but hey! https://en.wikipedia.org/wiki/Usage_share_of_web_browsers), I wouldn't rely on Java on the browser.

I've been looking for a CPC emulator implementation in Javascript for a while, but unfortunately I haven't found anything "good enough" to play my games.

EDIT: actually, MAME looks close enough, but sound is awful; and it is a nightmare to setup.

See: http://clienteretro.consolaviejuna.com/emulador/amstrad/index.html?amstrad&Golden%20Tail&juanjmartinez_goldent.dsk&goldent
Title: Re: easy to deploy JS CPC emulator?
Post by: scruss on 20:48, 02 July 18
The emuscriptoria one is fine for me, but my needs are modest. Once you have it built, it's very easy to deploy
Title: Re: easy to deploy JS CPC emulator?
Post by: mr_lou on 23:18, 02 July 18
Quote from: reidrac on 19:54, 02 July 18
Any using a modern browser; and for good reasons.
Only Applets aren't supported any longer. You can stlll run Webstart Java apps.
Powered by SMFPacks Menu Editor Mod