# Getting Started
# Prerequisits
- A web server like NGINX or the Apache server included in XAMPP (opens new window)
- Alternatively, for a simpler server use this (opens new window)
- A website behing hosted on that server, or at its most basic, create an empty file named "index.html" (save for later)
# Setup
- Download the github project (opens new window) and unzip it into your webserver hosted folder.
- Choose an emulator (opens new window) 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
<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 = ''; // example: https://dl.dropboxusercontent.com/s/[random-code]/bios.bin
// URL to Game rom
EJS_gameUrl = ''; // example: 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.
# Client Installation
Because this software uses WebAssembly (WASM) applications, it can be ran within a modern browser so there is no installation necessary. Only Safari for Apple devices and Chromium based browsers (Google Chrome, Edge, Brave, etc.) are supported. Other browsers might work, but have not been tested and likely never will be. Gamepads do not function on Firefox (yet!).
- 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:
--kiosk "http://192.168.1.120/"
(example: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --kiosk "http://192.168.1.120/") 3) 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:
--kiosk "http://192.168.1.120/"
(example: run --branch=stable --arch=x86_64 --command=/app/bin/chrome --file-forwarding com.google.Chrome @@u @@ --window-size=1024,640 --force-device-scale-factor=1.25 --device-scale-factor=1.25 --kiosk "http://192.168.1.120/")