Getting Started
Prerequisites
- A web server like NGINX or the Apache server included in XAMPP
- Alternatively, for a simpler server use this
- A website behing hosted on that server, or at its most basic, create an empty file named "index.html" (save for later)
- Or you can use the built-in server here
Setup
- Download the latest release and unzip it into your webserver hosted folder.
- Choose an emulator you want embedded, then copy and paste its code into your "index.html" file and edit the necessary fields. You have the option to edit each of the fields manually or use the Code Editor tool.
Example for NES
If you're using React or Single Page Apps, or google sites, see the Embeding Instructions.
<div style='width:640px;height:480px;max-width:100%'>
<div id='game'></div>
</div>
<script type='text/javascript'>
EJS_player = '#game';
// Can also be fceumm or nestopia
EJS_core = 'nes';
// Lightgun
EJS_lightgun = false; // can be true or false
// URL to BIOS file
EJS_biosUrl = ''; // https://dl.dropboxusercontent.com/s/[random-code]/bios.bin
// URL to Game rom
EJS_gameUrl = ''; // https://dl.dropboxusercontent.com/s/[random-code]/mario.nes
// Path to the data directory
EJS_pathtodata = 'data/';
</script>
<script src='data/loader.js'></script>
Code Editor
A Code Editor feature is included on this website. It's a wizard that will create this html web code for you.
- Select a System
- Fill out the details:
- Upload game rom
- Enter name of the game
- Enter an ad URL (optional)
- Upload bios file (if required)
- Upload custom save state to be loaded on start (optional)
- Generate out file
It will then give you the download link for a zip folder that will include the rom & an index.html file that has your code ready to be copy & pasted into your website.
Built-in Server (Optional)
After cloning the github project, you can run the built-in server by running the following command in the terminal:
Client Installation
Because this software uses WebAssembly (WASM) applications, it can be ran within a modern browser so there is no installation necessary. All major browsers are currently supported!
- To make things a little more seamless, we can create a shortcut file to act as a launcher.
- In the below examples, we will use http://192.168.1.120/ as the address for the webserver hosted on port 80.
Windows
In this example, we will use Google Chrome:
- Right click on Chrome and click "Send to" then "Desktop (create shortcut)"
- Now right click on the new shortcut and in the "Target" field, add this to the end:
- Lastly, rename the shortcut to "EmulatorJS"
To exit 'Kiosk' mode, hit ctrl+W
Android/iOS
- Open your browser and go to the server ip address (example: http://192.168.1.120/)
- After EmulatorJS has loaded in, open your browser settings and click "Add to Home Screen" or something similar.
- Click through any other prompts that may come up, but you should be left with a shortcut on your phone's home screen that acts like an app.
Steam Deck
The process is similar as that of the Windows setup:
- Enter Desktop mode
- Right click on Chrome and add to Steam
- Right click on the Chrome shortcut in Steam and click "Properties"
- Under the "Shortcut" options, find the "Launch Options" text box.
- Add this to the end: