Introducing RVMPlayer: A Powerful Web-based Emulator for Classic Computer Systems
New Version available v0.1.1
We have released a new version; check the changelog here.
Introduction
Introducing RVMPlayer: an emulator built with WebAssembly and WebGL2, designed for seamless integration into your web pages and compatible with all modern browsers.
RVMPlayer is an innovative emulator designed to be embedded in web pages, allowing users to run and enjoy classic games from systems like the Amstrad CPC 6128 and the ZX Spectrum +3 directly in their browsers. With a focus on web integration, RVMPlayer streamlines the emulation experience and enables website visitors to play their favorite retro games without the need for additional software installation.
In particular, RVMPlayer is intended for use by homebrew game developers who want to showcase their creations on the web. By embedding RVMPlayer in their websites, developers can provide a seamless and accessible platform for users to try out and enjoy their homebrew games. Currently in its 0.1.1 version and at an early stage of development, RVMPlayer will expand to include more machines compatible with Retro Virtual Machine in future updates.
How to embed?
1. Add the ‘.min.js’ file of the machine.
The URL structure of the RVMPlayer CDN is as follows: https://cdn.rvmplayer.org/rvmplayer_<<machine>>.<<version>>.min.js
, where machine
can be either cpc6128
or plus3
, and version
can be in the form 0.1.1
to only download that specific version or 0.1
to download the last revision of the 0.1
version. If no version is specified, the last available version will be downloaded (note that this is not recommended for production use).
Examples:
<!--To download version 0.1.1 of the emulator for the CPC6128 machine:-->
<script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.0.1.1.min.js'></script>
<!--To download the last available revision of the version 0.1 of the emulator
for the Plus3 machine:-->
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.0.1.min.js'></script>
<!--To download the last available version-->
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.min.js'></script>
2. Make a container with a fixed width
<body>
<div class='container' style='width: 800px; height: 600px;'></div>
</body>
RVMPlayer always uses a 4:3 aspect ratio, which is the standard for the machines it emulates. This ensures that the games are displayed with their original aspect ratio, just as they were intended to be played.
3. Call the function with the container, the function name is rvmPlayer_ + the machine name (cpc6128 or plus3)
<script>
const container=document.querySelector('.container')
rvmPlayer_cpc6128(container,{
//Parameters
})
</script>
Parameters
- disk: (object) – Contains information about the disk to be used in the emulator.
- type: (string) (‘dsk’ | ‘hfe’) – Specifies the type of disk file to be loaded. Can be either ‘dsk’ or ‘hfe’.
- url: (string) – The URL of the disk file to be loaded into the emulator.
- pause: (boolean) – Determines whether to show or hide the pause button in the emulator interface.
- video: (boolean) – Controls whether to show or hide the video button in the emulator interface.
- videoMode: (string) – (’tv’ | ‘hd’) – Sets the default video mode for the emulator. Can be either ’tv’ for a more classic look or ‘hd’ for a sharper, modern appearance.
- warpFrames: (number) – Indicates the number of frames to run in fast warp mode for quick game loading. Speed is measured in frames per second (50 fps).
- command: (string) – Specifies the command to be entered in the BASIC interpreter upon starting the emulator. Use ‘/n’ to represent the Enter key.
Complete Example
<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: './my-disk.dsk',
},
command: 'run"disc\n',
warpFrames: 20*50
})
</script>
</body>
</html>
Limitations
- Only DSK or HFE floppy disks are currently supported. Cartridges, tapes, and snapshots are not yet supported.
- Currently, only the following machines are supported (more will be added soon):
- Amstrad CPC 6128
- ZX Spectrum +3
- A good GPU is needed to run RVMPlayer, and there may be issues with integrated Intel GPUs.
- A modern CPU is recommended for optimal performance, with an Intel i5-4000+ being the recommended minimum.
- Don’t work in iOS or Android (yet)
We are working hard to improve RVMPlayer and address these limitations. Stay tuned for updates!
CDN’s URL
It is important to note that the RVMPlayer .min.js files are hosted on a global content delivery network (Cloudflare CDN), with servers distributed around the world. This ensures fast and efficient delivery of the files to users, regardless of their geographic location. Additionally, users are free to download the files and host them on their own servers if they prefer.
<!-- Current version (v0.1.1) -->
<script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.min.js'></script>
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.min.js'></script>
<!-- v0.1.x Fixes with no breaking changes (v0.1.1)-->
<script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.0.1.min.js'></script>
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.0.1.min.js'></script>
<!-- v0.1.1 Fixed version-->
<script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.0.1.1.min.js'></script>
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.0.1.1.min.js'></script>
<!-- v0.1.0 Fixed version-->
<script src='https://cdn.rvmplayer.org/rvmplayer.cpc6128.0.1.0.min.js'></script>
<script src='https://cdn.rvmplayer.org/rvmplayer.plus3.0.1.0.min.js'></script>
LICENSE (BSD-3)
Copyright (c)2023 Juan Carlos González Amestoy
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.