JavaScript is required

Main Options


The selector of the element you want the emulator to be placed in.

  • Type: string
  • Default: 
  • Example: EJS_player = '#game'


URL to ROM file.

  • Type: string
  • Default: 
  • Example: EJS_gameUrl = 'someFile.nes'


The path to the data folder. Version 4.0 and up will set this to the same path to the folder your loader.js file is in if not specified.

  • Type: string
  • Default: data/
  • Example: EJS_pathtodata = '/data/'


Set the emulator UI to a certian language. More information available here.

  • Type: string
  • Default: en-US


You can set the paths to the files used by the emulator. This is useful if you want to host the files in a different why than the default, like a blob or a cdn.

  • Type: object
  • Default: The default paths are used.
  • Example:
EJS_paths = {
    "GameManager.js": "blob:",
    "emulator.min.css": "blob:",
    "emulator.min.js": "",
    "gamepad.js": "",
    "loader.js": "",
    "nipplejs.js": "",
    "shaders.js": "",
    "": "",
    "storage.js": "",
    "version.json": ""

Note the example above will not work the paths are just for example purposes.


Sets the defauly volume for the emulator. 0=muted, 1=max

  • Type: number
  • Default: 0.5
  • Example: EJS_volume = 1

Game Options


Set this to the title of the game. This will be used when saving states and taking screenshots.

  • Type: string
  • Default: The name of the ROM file
  • Example: EJS_gameName = 'pong'


Default cheats to be stored in the cheat manager screen.

  • Type: array
  • Default: []
  • Example:
EJS_cheats = [
    ["name", "value"],
    ["name2", "value2"]


Set to true to start the game in fullscreen mode.

  • Type: boolean
  • Default: false
  • Example: EJS_fullscreenOnLoaded = true


Set to true to start the game when the page is loaded. Note that if the user has not interacted with the page, the emulator will freeze until they have done so.

  • Type: boolean
  • Default: false
  • Example: EJS_startOnLoaded = true

Core Options


Desired target system.

  • Type: string
  • Default: 
  • Example: EJS_core = 'nes'


URL to bios file.

  • Type: string
  • Default: ''
  • Example: EJS_biosUrl = 'someFile.bin'


URL to game patch file.

  • Type: string
  • Default: ''
  • Example: EJS_gamePatchUrl = 'someFile.patch'


Runs the core using threads. This may improve performance. This is only supported in some cores: pcsx_rearmed, mgba, mupen64plus_next, opera, yabause, mednafen_psx_hw, parallel-n64. Settings this when not supported will cause network errors at the moment.

  • Type: boolean
  • Default: false
  • Example: EJS_threads = true


This is a url to the game parent data. For additional files needed for the game emulation.

  • Type: string
  • Default: 


URL to save state. To be loaded on game start.

  • Type: string
  • Default: ''
  • Example: EJS_loadStateURL = 'save.state'

UI Options


Emulator hex color theme.

  • Type: string
  • Default: #1AAFFF
  • Example: EJS_color = '#00FF80'


This can be used to align the start button. It can be top, center, bottom.

  • Type: string
  • Default: bottom
  • Example: EJS_alignStartButton = "center"


Url to a file you want to have as the background at the "Play Now" screen. Must be a Absolute path or a Relative Path from the pathtodata folder.

  • Type: string
  • Default: 
  • Example: EJS_backgroundImage = 'loadScreen.png'


This will blur the background image to fit the all aspect ratios. Also known as frame blur. This will override the EJS_backgroundColor.

  • Type: boolean
  • Default: 
  • Example: EJS_backgroundBlur = true


This will set the background color of the emulator. In the start and loadings screens. Can be a css color like #000 or rgba(150,150,150,0.6).

  • Type: string
  • Default: #333
  • Example: EJS_backgroundColor = '#000'


URL to ad page. Will show this page when the page is loaded.

  • Type: string
  • Default: ''
  • Example: EJS_AdUrl = 'ad.html'


Duration (in milliseconds) the ad iframe will stay before it automatically closes. Setting to 0 will disable auto-close. Setting to -1 will close the ad immediately.

  • Type: number
  • Default: 10000
  • Example: EJS_AdTimer = 1000


This will set the ad mode. There 3 values 0 1 2

0 will only show the ad on the start screen and not the loading screen.

1 will only show the ad on the loading screen.

2 will show on both.

  • Type: number
  • Default: 2
  • Example: EJS_AdMode = 0


This will set the size of the ad. An array with the first value is the width and the second is the height. It can be any css option %, vh, px etc.

  • Type: array
  • Default: ["300px", "250px"]
  • Example: EJS_AdSize = ["800px", "500px"];

Advanced Options


The limit to game cache (per rom) in bytes

  • Type: number
  • Default: 1073741824 (1 GB)
  • Example: EJS_CacheLimit = 1024


A function that can be run to change the adUrl on the fly or delete it. A use case would be if the user is using an ad blocker you can change the adUrl to a different url (like to show a message) or delete it.

The first parameter is the url to change it the second you can set it to true to delete the ad.

  • Type: function
  • Default: 
  • Example: EJS_adBlocked("");


This is a function that will be called when the emulator is ready. This is useful if you want to do something when the emulator is ready.

  • Type: function
  • Default: 
  • Example: EJS_ready = function() {console.log("The emulator is ready!")}


Function to be called when save state button pressed.

  • Type: function
  • Default: 
  • Call Arguments: An array containing a screenshot and a save state
  • Example: EJS_onSaveState = function(e) {console.log("save state button pressed!")}


Function to be called when load state button pressed.

  • Type: function
  • Default: 
  • Example: EJS_onLoadState = function(e) {console.log("load state button pressed!")}


Function to be called when game is started.

  • Type: function
  • Default: 
  • Example: EJS_onGameStart = function(e) {console.log("The game has started!")}


Sets the default controller mapping. More information about controller mapping is located here.

  • Type: object
  • Default/Example:
EJS_defaultControls = {
        0: {
            0: {
                'value': 'x',
                'value2': 'BUTTON_2'
            1: {
                'value': 's',
                'value2': 'BUTTON_4'
            2: {
                'value': 'v',
                'value2': 'SELECT'
            3: {
                'value': 'enter',
                'value2': 'START'
            4: {
                'value': 'up arrow',
                'value2': 'DPAD_UP'
            5: {
                'value': 'down arrow',
                'value2': 'DPAD_DOWN'
            6: {
                'value': 'left arrow',
                'value2': 'DPAD_LEFT'
            7: {
                'value': 'right arrow',
                'value2': 'DPAD_RIGHT'
            8: {
                'value': 'z',
                'value2': 'BUTTON_1'
            9: {
                'value': 'a',
                'value2': 'BUTTON_3'
            10: {
                'value': 'q',
                'value2': 'LEFT_TOP_SHOULDER'
            11: {
                'value': 'e',
                'value2': 'RIGHT_TOP_SHOULDER'
            12: {
                'value': 'tab',
                'value2': 'LEFT_BOTTOM_SHOULDER'
            13: {
                'value': 'r',
                'value2': 'RIGHT_BOTTOM_SHOULDER'
            14: {
                'value': '',
                'value2': 'LEFT_STICK',
            15: {
                'value': '',
                'value2': 'RIGHT_STICK',
            16: {
                'value': 'h',
                'value2': 'LEFT_STICK_X:+1'
            17: {
                'value': 'f',
                'value2': 'LEFT_STICK_X:-1'
            18: {
                'value': 'g',
                'value2': 'LEFT_STICK_Y:+1'
            19: {
                'value': 't',
                'value2': 'LEFT_STICK_Y:-1'
            20: {
                'value': 'l',
                'value2': 'RIGHT_STICK_X:+1'
            21: {
                'value': 'j',
                'value2': 'RIGHT_STICK_X:-1'
            22: {
                'value': 'k',
                'value2': 'RIGHT_STICK_Y:+1'
            23: {
                'value': 'i',
                'value2': 'RIGHT_STICK_Y:-1'
            24: {
                'value': '1'
            25: {
                'value': '2'
            26: {
                'value': '3'
            27: {
                'value': 'add'
            28: {
                'value': 'space'
            29: {
                'value': 'subtract'
        1: {},
        2: {},
        3: {}


Sets the location of what buttons. More information about the virual gamepad button customization is located here.

  • Type: object
  • Default: {}


  • Type: string
  • Default: ``

Default behaviour (when option is undefined) not changed (core name will be used).

Available control schemes: nes gb gba snes n64 gba nds vb segaMD segaCD sega32x segaMS segaGG segaSaturn 3do atari2600 atari7800 lynx jaguar arcade mame


Shows/hides buttons.

  • Type: object
  • Default: {}
  • Example: The following example will hide all the buttons except for the volume slider and fullscreen button.
EJS_Buttons = {
    playPause: false,
    restart: false,
    mute: false,
    settings: false,
    fullscreen: true,
    saveState: false,
    loadState: false,
    screenRecord: false,
    gamepad: false,
    cheat: false,
    volume: true,
    saveSavFiles: true,
    loadSavFiles: true
    quickSave: false,
    quickLoad: false,
    screenshot: false,
    cacheManager: false


Sets the default settings menu options.

  • Type: object
  • Default: {}
  • Note: Available options and values will be logged when the emulator is started. Load the emulator page with EJS_DEBUG_XX on, click the play button, then on load there should be a log in the console supported menu options. If you use the one that logs on page load, not all options will be available and not all options will be supported.
  • Example:
EJS_defaultOptions = {
    'save-state-slot': 4,
    'save-state-location': 'keep in browser'

Debug Options


You can set this to true to enable debug mode. This will log a lot of information to the console and use the unminified scripts. This is useful for debugging issues with the emulator. And it is recommended to use this when you are contibuting to the project.

  • Type: boolean
  • Default: false
  • Example: EJS_DEBUG_XX = true


For debugging and adding new languages. Set it to true and it will enable the missing translations in the console logs.

  • Type: boolean
  • Default: false
  • Example: EJS_settingsLanguage = true


This is an array of missing translations. This is used for debugging and adding new languages. You can get the array by using console.log(EJS_missingLang).

  • Type: array
  • Default: []
  • Example: console.log(EJS_missingLang);


Automatically reset the console after x seconds.

  • Type: boolean
  • Default: false
  • Example: EJS_softLoad = true;


Custom text for the start button.

  • Type: string
  • Default: Start Game
  • Example: EJS_startButtonName = "Start {game name}"