Search | Sailfish OS | Running | PineTime | All Posts

RetroVM Player as Wasm!

October 27, 2023 — Nico Cartron

Previous tests

I already tested RetroVM in a previous article, and found it really nice.
Although it runs on Linux, MacOS and Windows, you still need to install it.

Wouldn't it be cool to run it in a browser, like CrocoDS which I tested in yet another article?

Web Assembly to the rescue!

This is where Web Assembly (Wasm) comes handy - this technology allows you running applications in your browser. I'm not going to explain it all, but will rather point you to Wikipedia.

And indeed, Juan Carlos, RetroVM's author, has released RVMPlayer using Wasm, so I figured out it would be nice to test it and see how it performs.

Configuration

Everything is explained on the RVM website.

Available emulators

Juan Carlos has made available both the ZX Spectrum plus3 and the Amstrad CPC 6128 emulators.

Of course I am testing the CPC!

Working example

As of writing this, there's just a typo in the Complete Example section, where the <script src> part contains a /player which is not needed.

Here's an example with L'aigle d'Or:

<html>
  <head>
        <script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.0.1.1.min.js'></script>
  </head>
  <body>
        <div class='container' style='position: relative; width: 800px; height: 600px;'></div>
        <script>
          const c=document.querySelector('.container')
          //Load a Amstrad CPC game and warp 20 seconds
          rvmPlayer_cpc6128(c,{
            disk: {
              type: 'dsk',
              url: './aigledor.dsk',
            },
            command: 'run"aigle\n',
            warpFrames: 20*50
          })
        </script>
  </body>
</html>

Testing!

As you can see in the above code, I am testing with L'Aigle d'Or from Loriciels.
That's actually the next game I wanted to test and write about, so perfect use case!

When opening my Firefox and pointing to the website where the JS is running, I was greeted with this window:

and when clicking that arrow, a familiar blue screen came up:

After a few seconds, I saw yet another familiar screen, and even the sound worked fine, with the very nice jingle from Loriciels - really cool to have this running fine on my FreeBSD laptop! :)

And finally, I could start playing the game, which worked flawlessly:

Wrap Up

A wonderful work from Juan Carlos, it's super useful to have the emulator running in a web browser, as it means I can play on the go :)

I'll use it for my upcoming test of L'aigle d'Or to validate everything works fine, but I'm confident that's the case.

Giving back

The project has a Contribute section, where you can either become a Patreon, or give one time with either Paypal or Ko-fi.

I'm glad to see Juan Carlos is also using Ko-fi, and I just gave to the project because of its awesomeness - and you should definitely, too!


Tags: Retrogaming, Amstrad


I don't have any commenting system, but email me (nicolas at ncartron dot org) your comments!
If you like my work, you can buy me a coffee!