Compare commits

...

12 Commits

Author SHA1 Message Date
thelamer
ec4c5d9028 add atari800 references 2024-01-27 15:03:54 -08:00
thelamer
9d685e55f9 Update readme to fix gateway links and add section for rom hacks 2024-01-27 10:25:01 -08:00
thelamer
ad770cdc87 typo 2022-01-18 10:15:48 -08:00
thelamer
91a172afa4 update example 2022-01-17 12:57:11 -08:00
thelamer
10e76c14b1 add notes on threaded yabause and link to source code 2022-01-06 15:10:22 -08:00
thelamer
ac744ff06e add notes on threaded emulators 2022-01-04 14:19:59 -08:00
thelamer
e0b0ecbe9c update build process and example to pull out deps 2021-12-02 12:15:09 -08:00
thelamer
c8ff4e9e40 unused folder 2021-11-26 13:15:11 -08:00
thelamer
96e65aa76c add gw core 2021-11-26 12:44:43 -08:00
thelamer
9218fbeed2 update for pre-compiled cores 2021-11-26 12:36:47 -08:00
thelamer
b8596c8b9b update spectrum bios 2021-11-26 10:03:34 -08:00
thelamer
6b3ca849c3 do not include overlays as they dont work in web 2021-11-23 09:54:16 -08:00
2 changed files with 67 additions and 60 deletions

View File

@ -4,16 +4,18 @@ This repository collects the assets used in [https://github.com/linuxserver/emul
# Example
```
<button onclick="load()">Load Game</button>
<div id="game"></div>
<script type="text/javascript">
EJS_player = '#game';
EJS_gameUrl = '/your/game/rom.zip';
EJS_core = 'snes9x';
function load() {
var script = document.createElement('script');
script.src = 'js/libretro.js'
document.getElementsByTagName('head')[0].appendChild(script);
}
</script>
<script src="js/vendor/jquery.min.js"></script>
<script src="js/vendor/jquery.hotkeys.js"></script>
<script src="js/vendor/browserfs.min.js"></script>
<script src="js/libretro.js"></script>
```
Simply extract the release into the root of your webserver and try this test page for the `snes9x` emulator.
@ -21,12 +23,14 @@ Simply extract the release into the root of your webserver and try this test pag
# Supported emulators
* 81- [https://github.com/libretro/81-libretro](https://github.com/libretro/81-libretro)
* atari800- [https://github.com/libretro/libretro-atari800](https://github.com/libretro/libretro-atari800)
* bluemsx- [https://github.com/libretro/blueMSX-libretro](https://github.com/libretro/blueMSX-libretro)
* fceumm- [https://github.com/libretro/libretro-fceumm](https://github.com/libretro/libretro-fceumm)
* fuse- [https://github.com/libretro/fuse-libretro](https://github.com/libretro/fuse-libretro)
* gambatte- [https://github.com/libretro/gambatte-libretro](https://github.com/libretro/gambatte-libretro)
* gearboy- [https://github.com/libretro/Gearboy](https://github.com/libretro/Gearboy)
* genesis_plus_gx- [https://github.com/libretro/Genesis-Plus-GX](https://github.com/libretro/Genesis-Plus-GX)
* gw- [https://github.com/libretro/gw-libretro](https://github.com/libretro/gw-libretro)
* handy- [https://github.com/libretro/libretro-handy](https://github.com/libretro/libretro-handy)
* mame2003_plus- [https://github.com/libretro/mame2003-plus-libretro](https://github.com/libretro/mame2003-plus-libretro)
* mednafen_ngp- [https://github.com/libretro/beetle-ngp-libretro](https://github.com/libretro/beetle-ngp-libretro)
@ -35,6 +39,8 @@ Simply extract the release into the root of your webserver and try this test pag
* mednafen_vb- [https://github.com/libretro/beetle-vb-libretro](https://github.com/libretro/beetle-vb-libretro)
* mednafen_wswan- [https://github.com/libretro/beetle-wswan-libretro](https://github.com/libretro/beetle-wswan-libretro)
* melonds- [https://github.com/libretro/melonDS](https://github.com/libretro/melonDS)
* melonds_threaded- [https://github.com/libretro/melonDS](https://github.com/libretro/melonDS)
* mupen64plus_next - [https://github.com/libretro/mupen64plus-libretro-nx](https://github.com/libretro/mupen64plus-libretro-nx)
* o2em- [https://github.com/libretro/libretro-o2em](https://github.com/libretro/libretro-o2em)
* prboom- [https://github.com/libretro/libretro-prboom](https://github.com/libretro/libretro-prboom)
* prosystem- [https://github.com/libretro/prosystem-libretro](https://github.com/libretro/prosystem-libretro)
@ -45,6 +51,7 @@ Simply extract the release into the root of your webserver and try this test pag
* vecx- [https://github.com/libretro/libretro-vecx](https://github.com/libretro/libretro-vecx)
* virtualjaguar- [https://github.com/libretro/virtualjaguar-libretro](https://github.com/libretro/virtualjaguar-libretro)
* yabause- [https://github.com/libretro/yabause](https://github.com/libretro/yabause)
* yabause_threaded- [https://github.com/libretro/yabause](https://github.com/libretro/yabause)
# Variables and usage
@ -57,7 +64,7 @@ Simply extract the release into the root of your webserver and try this test pag
## Basic setup
By default the script renders in a canvas element and an unstyled fullscreen button with the class `full-button`. Feel free to hide the button or style it absolute to where you need it on your page. The user of the game can bring up the libretro menu by pressing F1 on a keyboard or start+select+L+R on a controller.
The user of the game can bring up the libretro menu by pressing F1 on a keyboard or start+select+L+R on a controller.
You can define scripts to run after startup by using the onGameStart option, IE to go fullscreen on load:
```
@ -81,25 +88,63 @@ All of the code is open, feel free to modify it to your needs, but do not come h
# Bios files for cores
These can be loaded as is no need to extract or modify them, they will be unzipped to the system directory before core load.
i
* atari800- [https://gateway.pinata.cloud/ipfs/QmXMs7meQMTpKxVbRGPX6b5Lj4Yh4iJhP69K5MbXqM23vS?filename=atari800.zip](https://gateway.pinata.cloud/ipfs/QmXMs7meQMTpKxVbRGPX6b5Lj4Yh4iJhP69K5MbXqM23vS?filename=atari800.zip)
* bluemsx- [https://gateway.pinata.cloud/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip](https://gateway.pinata.cloud/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip)
* bluemsx- [https://gateway.pinata.cloud/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip](https://gateway.pinata.cloud/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip)
* fceumm- [https://gateway.pinata.cloud/ipfs/QmPk9EKQ2aRVHJX91PTJfmfBDiHRzeWuZExT36BAk2sNZL?filename=nes.zip](https://gateway.pinata.cloud/ipfs/QmPk9EKQ2aRVHJX91PTJfmfBDiHRzeWuZExT36BAk2sNZL?filename=nes.zip)
* fuse- [https://gateway.pinata.cloud/ipfs/QmYutEB17S7d9gjkPPZj6YGV9XKWZNC3Uoaycxj3352dVh?filename=spectrum.zip](https://gateway.pinata.cloud/ipfs/QmYutEB17S7d9gjkPPZj6YGV9XKWZNC3Uoaycxj3352dVh?filename=spectrum.zip)
* gambatte- [https://gateway.pinata.cloud/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip](https://gateway.pinata.cloud/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip)
* gearboy- [https://gateway.pinata.cloud/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip](https://gateway.pinata.cloud/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip)
* genesis_plus_gx- [https://gateway.pinata.cloud/ipfs/Qmct6NWgAbSvWW9XenBfJ8U15GiwEgDLNFKhCnhL6TFiad?filename=sega.zip](https://gateway.pinata.cloud/ipfs/Qmct6NWgAbSvWW9XenBfJ8U15GiwEgDLNFKhCnhL6TFiad?filename=sega.zip)
* handy- [https://gateway.pinata.cloud/ipfs/QmTaUUheMwLj5JqTqiZLzUfdUBj9xWikyZY4s72RGfKb9d?filename=lynxboot.img](https://gateway.pinata.cloud/ipfs/QmTaUUheMwLj5JqTqiZLzUfdUBj9xWikyZY4s72RGfKb9d?filename=lynxboot.img)
* mednafen_pce_fast- [https://gateway.pinata.cloud/ipfs/QmVZuSTmjWBbFvsgkV7fp4R1ZmjveK9Fap4Nxi6DhbpZPT?filename=pce.zip](https://gateway.pinata.cloud/ipfs/QmVZuSTmjWBbFvsgkV7fp4R1ZmjveK9Fap4Nxi6DhbpZPT?filename=pce.zip)
* mednafen_psx- [https://gateway.pinata.cloud/ipfs/QmfQTsRzaE4T9LUWnKara8KVyXmoUn2RXzmSHYtDYN8Jr6?filename=psx.zip](https://gateway.pinata.cloud/ipfs/QmfQTsRzaE4T9LUWnKara8KVyXmoUn2RXzmSHYtDYN8Jr6?filename=psx.zip)
* melonds- [https://gateway.pinata.cloud/ipfs/QmciBpXM6i1nPSyjKv7tJYmWS7NGXtfKX2EtFmTJ4iomas?filename=nds.zip](https://gateway.pinata.cloud/ipfs/QmciBpXM6i1nPSyjKv7tJYmWS7NGXtfKX2EtFmTJ4iomas?filename=nds.zip)
* o2em- [https://gateway.pinata.cloud/ipfs/QmcXRfDzhsEnWnMykpVwQc86kZXKXgbWMKuXf3HNzXnWKN?filename=odyssey2.zip](https://gateway.pinata.cloud/ipfs/QmcXRfDzhsEnWnMykpVwQc86kZXKXgbWMKuXf3HNzXnWKN?filename=odyssey2.zip)
* prboom- [https://gateway.pinata.cloud/ipfs/QmaYzUXDqtjYDhveavbyh34EtJsfa8smuQayvfHKDoruBE?filename=prboom.wad](https://gateway.pinata.cloud/ipfs/QmaYzUXDqtjYDhveavbyh34EtJsfa8smuQayvfHKDoruBE?filename=prboom.wad)
* prosystem- [https://gateway.pinata.cloud/ipfs/QmcHsJd8dzc4gKwd3cmibFBAgBw3X7pswzdLsWSBG8Ngs7?filename=atari7800.zip](https://gateway.pinata.cloud/ipfs/QmcHsJd8dzc4gKwd3cmibFBAgBw3X7pswzdLsWSBG8Ngs7?filename=atari7800.zip)
* snes9x- [https://gateway.pinata.cloud/ipfs/Qme4WxcE38pAZePr3jbHp4h3c9Bu23K7Gt7PNkVHU4x14e?filename=snes.zip](https://gateway.pinata.cloud/ipfs/Qme4WxcE38pAZePr3jbHp4h3c9Bu23K7Gt7PNkVHU4x14e?filename=snes.zip)
* vba_next- [https://gateway.pinata.cloud/ipfs/QmYtDaErc2RzWBYLmcwfKD81NSVjqBsGD6cJCk3kNzDyuk?filename=gba.zip](https://gateway.pinata.cloud/ipfs/QmYtDaErc2RzWBYLmcwfKD81NSVjqBsGD6cJCk3kNzDyuk?filename=gba.zip)
* yabause- [https://gateway.pinata.cloud/ipfs/QmWfQo5YDDx7w4PRHFCLUcWWuhiD6L42h2AGm3RojJwXKo?filename=saturn.zip](https://gateway.pinata.cloud/ipfs/QmWfQo5YDDx7w4PRHFCLUcWWuhiD6L42h2AGm3RojJwXKo?filename=saturn.zip)
* bluemsx- [https://ipfs.infura.io/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip](https://ipfs.infura.io/ipfs/QmUeCQ3vWxe7F1FZzspLSAvHE42cqoo5xEGK3FdEv5pbUp?filename=msx.zip)
* fceumm- [https://ipfs.infura.io/ipfs/QmPk9EKQ2aRVHJX91PTJfmfBDiHRzeWuZExT36BAk2sNZL?filename=nes.zip](https://ipfs.infura.io/ipfs/QmPk9EKQ2aRVHJX91PTJfmfBDiHRzeWuZExT36BAk2sNZL?filename=nes.zip)
* fuse- [https://ipfs.infura.io/ipfs/QmY49yeFFJTK1485PwWPqVom5nBWwFGabY64GiBo1H991H?filename=spectrum.zip](https://ipfs.infura.io/ipfs/QmY49yeFFJTK1485PwWPqVom5nBWwFGabY64GiBo1H991H?filename=spectrum.zip)
* gambatte- [https://ipfs.infura.io/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip](https://ipfs.infura.io/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip)
* gearboy- [https://ipfs.infura.io/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip](https://ipfs.infura.io/ipfs/QmYXjcLTGdtG9JtDGVg42cWFkW6feYufRPQYGSe6ifESY8?filename=gb.zip)
* genesis_plus_gx- [https://ipfs.infura.io/ipfs/Qmct6NWgAbSvWW9XenBfJ8U15GiwEgDLNFKhCnhL6TFiad?filename=sega.zip](https://ipfs.infura.io/ipfs/Qmct6NWgAbSvWW9XenBfJ8U15GiwEgDLNFKhCnhL6TFiad?filename=sega.zip)
* handy- [https://ipfs.infura.io/ipfs/QmTaUUheMwLj5JqTqiZLzUfdUBj9xWikyZY4s72RGfKb9d?filename=lynxboot.img](https://ipfs.infura.io/ipfs/QmTaUUheMwLj5JqTqiZLzUfdUBj9xWikyZY4s72RGfKb9d?filename=lynxboot.img)
* mednafen_pce_fast- [https://ipfs.infura.io/ipfs/QmVZuSTmjWBbFvsgkV7fp4R1ZmjveK9Fap4Nxi6DhbpZPT?filename=pce.zip](https://ipfs.infura.io/ipfs/QmVZuSTmjWBbFvsgkV7fp4R1ZmjveK9Fap4Nxi6DhbpZPT?filename=pce.zip)
* mednafen_psx- [https://ipfs.infura.io/ipfs/QmfQTsRzaE4T9LUWnKara8KVyXmoUn2RXzmSHYtDYN8Jr6?filename=psx.zip](https://ipfs.infura.io/ipfs/QmfQTsRzaE4T9LUWnKara8KVyXmoUn2RXzmSHYtDYN8Jr6?filename=psx.zip)
* melonds- [https://ipfs.infura.io/ipfs/QmciBpXM6i1nPSyjKv7tJYmWS7NGXtfKX2EtFmTJ4iomas?filename=nds.zip](https://ipfs.infura.io/ipfs/QmciBpXM6i1nPSyjKv7tJYmWS7NGXtfKX2EtFmTJ4iomas?filename=nds.zip)
* o2em- [https://ipfs.infura.io/ipfs/QmcXRfDzhsEnWnMykpVwQc86kZXKXgbWMKuXf3HNzXnWKN?filename=odyssey2.zip](https://ipfs.infura.io/ipfs/QmcXRfDzhsEnWnMykpVwQc86kZXKXgbWMKuXf3HNzXnWKN?filename=odyssey2.zip)
* prboom- [https://ipfs.infura.io/ipfs/QmaYzUXDqtjYDhveavbyh34EtJsfa8smuQayvfHKDoruBE?filename=prboom.wad](https://ipfs.infura.io/ipfs/QmaYzUXDqtjYDhveavbyh34EtJsfa8smuQayvfHKDoruBE?filename=prboom.wad)
* prosystem- [https://ipfs.infura.io/ipfs/QmcHsJd8dzc4gKwd3cmibFBAgBw3X7pswzdLsWSBG8Ngs7?filename=atari7800.zip](https://ipfs.infura.io/ipfs/QmcHsJd8dzc4gKwd3cmibFBAgBw3X7pswzdLsWSBG8Ngs7?filename=atari7800.zip)
* snes9x- [https://ipfs.infura.io/ipfs/Qme4WxcE38pAZePr3jbHp4h3c9Bu23K7Gt7PNkVHU4x14e?filename=snes.zip](https://ipfs.infura.io/ipfs/Qme4WxcE38pAZePr3jbHp4h3c9Bu23K7Gt7PNkVHU4x14e?filename=snes.zip)
* vba_next- [https://ipfs.infura.io/ipfs/QmYtDaErc2RzWBYLmcwfKD81NSVjqBsGD6cJCk3kNzDyuk?filename=gba.zip](https://ipfs.infura.io/ipfs/QmYtDaErc2RzWBYLmcwfKD81NSVjqBsGD6cJCk3kNzDyuk?filename=gba.zip)
* yabause- [https://ipfs.infura.io/ipfs/QmWfQo5YDDx7w4PRHFCLUcWWuhiD6L42h2AGm3RojJwXKo?filename=saturn.zip](https://ipfs.infura.io/ipfs/QmWfQo5YDDx7w4PRHFCLUcWWuhiD6L42h2AGm3RojJwXKo?filename=saturn.zip)
# Rom Hacks Support
Retroarch supports [Softpatching](https://docs.libretro.com/guides/softpatching/), which will apply a patchfile to the base rom on launch. In order to leverage this feature you will need to prepare a custom zip file ending with the file extension ".patchzip". Lets take a popular hack "Invictus" as an example for snes. You will need to create a zip file named "Invictus.smc.patchzip" (note the two file extensions with smc indicating the extension of the base rom) containing the following files:
* Invictus.smc - base rom file to be patched in this case SMW.
* Invictus.bps - Patch file to be applied.
Multiple patch files can be applied as long as they follow this naming scheme ending in the order to be loaded IE:
* Invictus.smc - base rom file to be patched in this case SMW.
* Invictus.bps - First patch file to be applied.
* Invictus.bps1 - Second patch file to be applied.
# MAME roms with chds
mame_2003_plus roms need to be **full non-merged** roms in order to function. These are the zips that contain everything from the bios, to parent, to clones. In order to get games with chd files to load we have a custom file format that can be loaded by the extension ".multizip". To create this file simply zip the rom zip and the chd file (no folders) into a single file. IE if you had the file kinst.zip and the folder kinst/kinst.chd simply move the kinst.zip file into the kinst folder and create the archive using `zip kinst.multizip kinst.zip kinst.chd`. This multizip file will be unpacked before the emulator is loaded into the directory it is looking for the files.
# Threaded emulators
Some emulators might have a threaded option, in order for these to function on the client they need to have specific security headers set on the actual web host of the files so `SharedArrayBuffer` can be used in the clientside browser. They also need to be served from an HTTPS endpoint as these are the sandboxing requirements for modern browsers.
In Nodejs:
```
app.use(function(req, res, next) {
res.header("Cross-Origin-Embedder-Policy", "require-corp");
res.header("Cross-Origin-Opener-Policy", "same-origin");
next();
});
```
In NGINX:
```
add_header Cross-Origin-Opener-Policy same-origin;
add_header Cross-Origin-Embedder-Policy require-corp;
```
# Code Reference
The source code these cores are build against is located [HERE](https://github.com/thelamer/retrostash).

View File

@ -1,43 +1,10 @@
#! /bin/bash
# Working emulators for retroarch
retroarchemus="\
fceumm
snes9x
mednafen_vb
gearboy
vba_next
gambatte
genesis_plus_gx
handy
mame2003_plus
mednafen_ngp
mednafen_wswan
o2em
prboom
tyrquake
vecx
bluemsx"
IFS=$'\n'
# Setup build dirs
rootdir=$(pwd)'/buildout/'
mkdir -p ${rootdir}{data,js/vendor,retrotmp,emulatorjstmp}
mkdir -p ${rootdir}{data,js,emulatorjstmp}
## Grab frontend blobs
# Libretro emscripten
cd ${rootdir}retrotmp
wget https://buildbot.libretro.com/nightly/emscripten/RetroArch.7z
7z x RetroArch.7z
sed -i 's/wasmBinaryFile="/wasmBinaryFile="data\//g' retroarch/*.js
for emu in $retroarchemus; do
mv retroarch/${emu}_libretro.* "${rootdir}/data/"
done
cd retroarch/assets/frontend/bundle/
zip -r frontend.zip assets/xmb/monochrome assets/ozone shaders filters info autoconfig overlay assets/menu_widgets
mv frontend.zip "${rootdir}/data/"
cd "${rootdir}"
rm -Rf retrotmp
# Custom cores
wget https://github.com/linuxserver/libretro-cores/archive/master.tar.gz
tar xf \
@ -53,11 +20,6 @@ tar xf \
mv \
${rootdir}/emulatorjstmp/frontend/js/libretro.js \
${rootdir}/js/
mv \
${rootdir}/emulatorjstmp/frontend/js/vendor/browserfs.min.js \
${rootdir}/emulatorjstmp/frontend/js/vendor/jquery.hotkeys.js \
${rootdir}/emulatorjstmp/frontend/js/vendor/jquery.min.js \
${rootdir}/js/vendor/
rm -Rf ${rootdir}/emulatorjstmp/
# Make tarball for release
cd ${rootdir}