Author Topic: easy to deploy JS CPC emulator?  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
easy to deploy JS CPC emulator?
« on: 19: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, 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?

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.611
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 718
  • Likes Given: 1876
Re: easy to deploy JS CPC emulator?
« Reply #1 on: 20: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).
« Last Edit: 20:06, 17 June 18 by GUNHED »
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #2 on: 02: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.

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 590
  • Country: au
    • index.php?action=treasury
  • Liked: 298
  • Likes Given: 172
Re: easy to deploy JS CPC emulator?
« Reply #3 on: 04:37, 18 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, 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 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/.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.023
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1189
  • Likes Given: 2414
Re: easy to deploy JS CPC emulator?
« Reply #4 on: 08:17, 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?

Offline pmeier

  • CPC464
  • **
  • Posts: 35
  • Country: de
  • Liked: 24
  • Likes Given: 18
Re: easy to deploy JS CPC emulator?
« Reply #5 on: 10:24, 18 June 18 »
No, Roland is written in Javascript and GLP'ed:
https://sourceforge.net/projects/emuscriptoria/
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.com/cpc/
Press F1 for instructions. (F8 for reset.)


Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #6 on: 15:23, 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.

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #7 on: 15:49, 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.

Offline pmeier

  • CPC464
  • **
  • Posts: 35
  • Country: de
  • Liked: 24
  • Likes Given: 18
Re: easy to deploy JS CPC emulator?
« Reply #8 on: 20:04, 18 June 18 »
 ;D No, I turned on joystick by default. Just press F2 to disable joystick.

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #9 on: 17: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.

Offline pmeier

  • CPC464
  • **
  • Posts: 35
  • Country: de
  • Liked: 24
  • Likes Given: 18
Re: easy to deploy JS CPC emulator?
« Reply #10 on: 18:18, 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...
« Last Edit: 18:27, 23 June 18 by pmeier »

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #11 on: 06:40, 25 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:

  • Download the whole archive using subversion:
    svn checkout svn://svn.code.sf.net/p/emuscriptoria/code/ emuscriptoria-code
  • Copy compila.php to a different name, say compila-6128s.php
  • Edit compila-6128s.php:
    • Comment out the lines in the function yui
    • In function comp, add the line:
      file_put_contents('_'.$out.'.rom', $in);
      above the line:
      file_put_contents('_'.$out.'.rom.deflate', gzdeflate($in));
    • Comment out everything from the first line that says:
      ob_start();
      all the way to the line before the one saying:
      yui('6128s');
    • Comment out everything after the line:
      unlink('6128s.js');
      all the way to the line before the one saying:
      stderr('6128s.html');
    • Comment out everything after the line:
      compg('6128s');
      all the way to the line before the one saying:
      if( $slow ){
  • Build the project using:
    php -n -f compila-6128s.php > /dev/null
    This should result in a few files being created, with the interesting ones being 6128s.html and _6128s.rom
  • Copy these two files to a folder on your webserver
  • In that same folder, create a subfolder called games
  • Copy disk image(s) into the games subfolder
  • You can auto-run a game that uses RUN"DISC on disc.dsk by opening the URL:
    http://…yourdomain…/6128s.html/disk.dsk/run"disc
Hope this helps someone!

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #12 on: 20: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
« Last Edit: 03:21, 03 July 18 by scruss »

Offline reidrac

  • Supporter
  • 6128 Plus
  • *
  • Posts: 754
  • Country: gb
  • Trying to gamedev!
    • index.php?action=treasury
    • usebox.net
  • Liked: 1300
  • Likes Given: 768
Re: easy to deploy JS CPC emulator?
« Reply #13 on: 21:54, 02 July 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
« Last Edit: 21:59, 02 July 18 by reidrac »
Released The Return of Traxtor, Golden Tail, Magica and The Dawn of Kernel for the CPC.

If you like my games and want to show some appreciation, you can always buy me a coffee.

Offline scruss

  • CPC664
  • ***
  • Posts: 78
  • Country: ca
    • index.php?action=treasury
    • We Saw a Chicken ...
  • Liked: 55
  • Likes Given: 14
Re: easy to deploy JS CPC emulator?
« Reply #14 on: 22: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

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.023
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1189
  • Likes Given: 2414
Re: easy to deploy JS CPC emulator?
« Reply #15 on: 01:18, 03 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.