Skip to content

Repository files navigation

build

A simple script that will download and build the emulatorjs core files

This script will download and build most of the available retroarch cores.

Warning: Some cores do not compile on ARM based systems (such as M series MacBooks and Raspberry Pi). Use only amd64 based systems to compile.

Set up your build environment

VSCode and Dev Containers

This repo contains a devcontainer configuration.

Using docker and VSCode, the repo can be started in a container, where all dependencies are installed for you.

Local

This guide assumes you're using a Debian or Ubuntu type system.

  • Run sudo apt update && sudo apt install jq wget curl gpg p7zip-full binutils-mips-linux-gnu build-essential pkgconf python3 git zip libsdl2-dev

  • Run the enclosed build_env.sh script to configure the build environment. You may need to use sudo to run this script to install system components.

Compiling

Execute the command source ./.emsdk/emsdk_env.sh && bash build.sh in the repo root to begin compiling.

Compilation will be performed in ./compile, and the completed assets will be copied to ./output, with logs in ./output/logs.

Adding new cores

To add a new core, add a stanza like the below:

{
"name": "mame2003",
"extensions": [ "zip" ],
"makeoptions": {
"buildpath": "./",
"makescript": "Makefile",
"arguments": []
},
"options": {
"file": "MAME 2003 (0.78)/MAME 2003 (0.78).opt",
"settings": {
"mame2003_skip_disclaimer": "enabled",
"mame2003_skip_warnings": "enabled"
},
"defaultWebGL2": false,
"supportsMouse": false
},
"license": "LICENSE.md",
"repo": "https://github.com/EmulatorJS/mame2003-libretro",
"branch": "main"
}
AttributeDefinition
nameThe name of the core. This value should be the name of the compiled core .data file.
extensionsAn array of file extensions used by the core
licenseThe path to the repo project license file. This path is relative to the root of the repo.
repoA link to the project repository
branchThe git branch to switch to when building
makeoptionsSettings and options for building the core (see makeoptions table below)
optionsOptions to be set by the emulator (see options table below)

makeoptions

AttributeDefinition
buildpathThe path within the repo to the make script
makescriptThe name of the make script
argumentsAn array of command line options to pass to the make script

options

AttributeDefinition
fileThe relative path and file name for the core options file
settingsA hash table of attributes and their values to write to the core options file
defaultWebGL2A boolean value of if WebGL2 should be defaulted to enabled
supportsMouseA boolean value defining if the core supports a mouse

About

A simple script that will download and build the emulatorjs core files

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages