Skip to content

Commit

Permalink
Add romhacks support and doc it along with a bugfix for people identi…
Browse files Browse the repository at this point in the history
…fying stuff with no metadata at all
  • Loading branch information
thelamer committed Jan 26, 2024
1 parent 37d2b56 commit 600b15a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions frontend/js/libretro.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ io.on('connection', async function (socket) {
}
let fileExtension = path.extname(file);
let name = path.basename(file, fileExtension);
if (! fs.existsSync(dataRoot + dir + filePath)) {
await fsw.mkdir(dataRoot + dir + filePath);
}
await fsw.writeFile(dataRoot + dir + filePath + name + extension, fileData);
// Render game for client
getRomData([dir, file]);
Expand Down
20 changes: 16 additions & 4 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@
<div class="readme">
<h2>Support</h2>
<p>For general support please use our <a href="https://discord.gg/YWrKVTn">Discord Server</a>, if you would like to report a bug or have a feature request please do that on <a href="https://github.com/linuxserver/emulatorjs/issues">GitHub</a>.</p>
<p>If you are upgrading from previous versions and not seein a performance increase please do a hard reload on your browser and delete the retroarch.cfg file from the file browser icon (top left of frontent interface folder icon).</p>
<p>If you are upgrading from previous versions and not seeing a performance increase please do a hard reload on your browser and delete the retroarch.cfg file from the file browser icon (top left of frontent interface folder icon).</p>
<p>If you are upgrading from previous versions the n64 core has been switched to a libretro core you will need to change the config file to have '"emulator": "libretro-mupen64plus_next"' under the defaults section of the n64 config to use the new core.</p>
<h2>Basic controls</h2>
<p>For all libretro based emulators you can use F1 on your keyboard, start+select+L+R on a gamepad , or the touch button on the top left in touchscreen devices to bring up the in game menu.</p>
<p>All saves and any settings are stored in your actual web browser by the URL you are using to access this container, to ensure sram is dumped on exit always try to exit the game with back instead of closing the browser window. On libretro based emulators you can perform saves and savestates from the menu.</p>
<p>Xbox users on Edge hold the start button for 3 seconds to exit gamepad controls and if you want to re-enter again press the start button again with your cursor hovering over the game and select the option to use gamepad controls. After you launch a game press the select button a couple times to ensure the B button does not trigger a back action or drop you from fullscreen.</p>
<p>Scrolling large collections can be sped up by holding right while scrolling up or down when using a keyboard or your controller on Xbox. For touch devices panning is supported by holding and dragging up or down.</p>
<p>You can also scroll by letter using the right and left shoulder buttons on a controller or Page Up/Page Down on a keyboard.</p>
<h2>Browser support</h2>
<p>Only Safari for Apple devices and Chromium based browsers are supported. Other browsers might work, but have not been tested and likely never will be. Gamepads do not function on Firefox.
<p>Only Safari for Apple devices and Chromium based browsers are supported. Other browsers might work, but have not been tested and likely never will be. Gamepads do not function on Firefox, this is a known issue as they do very non standard mapping like dpad button presses to a fake anaolgue joypad.</p>
<h2>If you enjoy this</h2>
<p>Consider <a href="https://retroarch.com/index.php?page=donate">supporting</a> libretro they do the heavy lifting. Also take a look at helping with art assets <a href="https://github.com/linuxserver/emulatorjs">Here</a>.</p>
<h2>Experimental Emulators</h2>
Expand All @@ -60,14 +61,25 @@ <h2>Rom Identification basics</h2>
</ol>
<p>From there you can hop into the frontend interface (default port 80) to browse and play your collection.</p>
<p>In general this application is referencing metadata based on commonly used identifying metrics for rom files, mostly these revolve around checksums (specifically sha1) of the rom files themselves. This metadata is compiled from lists on no-intro.org for roms and redump.org for CD based games. Now no system is perfect, but the aim is to have community participation expand these lists with the data from their own rom sets. After scanning in your roms you may notice that many of them are un-identified using this metadata, if you took the time to link them to the correct reference information please consider providing your resulting reference data to Github <a href="https://github.com/linuxserver/emulatorjs">Here</a>.</p>
<h2>Rom Hacks Support</h2>
<p>Retroarch supports <a href="https://docs.libretro.com/guides/softpatching/">Softpatching</a>, 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:</p>
<ul>
<li>Invictus.smc - base rom file to be patched in this case SMW.</li>
<li>Invictus.bps - Patch file to be applied.</li>
</ul>
<p>Multiple patch files can be applied as long as they follow this naming scheme ending in the order to be loaded IE:</p>
<ul>
<li>Invictus.smc - base rom file to be patched in this case SMW.</li>
<li>Invictus.bps - First patch file to be applied.</li>
<li>Invictus.bps1 - Second patch file to be applied.</li>
</ul>
<h2>Multi Disk Games</h2>
<p>The only web emulators that supports multiple CD games are psx and saturn, in order to function please rename your chd files before scanning them in to the same name with the extension .disk1,.disk2,.disk3,etc. IE:</p>
<ul>
<li>/data/psx/roms/GAMENAME.disk1</li>
<li>/data/psx/roms/GAMENAME.disk2</li>
<li>/data/psx/roms/GAMENAME.disk3</li>
</ul>
<p>In general saturn emulation is not functional, it is extremely slow as is and many games will not load properly. Some are kind of playable on Xbox, hopefully this improves over time</p>
<h2>MAME roms with chds</h2>
<p>The web based arcade emulator is MAME 2003-Plus, in general most games will work if you use full non-merged roms. Some games require additional chd files though. In order to get these to load with the web frontend 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 <b>zip kinst.multizip kinst.zip kinst.chd</b> then move the resulting file to your roms directory. This multizip file will be unpacked before the emulator is loaded into the directory it is looking for the files.</p>
<h2>Doom wads with multiple wads</h2>
Expand Down Expand Up @@ -159,7 +171,7 @@ <h1>Choose a folder. Drag and drop files or right click to upload.</h1>
<h2>Custom Metadata</h2>
<p>When you identify roms or upload custom artwork from the rom management interface all of that data is stored as custom metadata in your container. You can see the systems you have put the work into either skinning or identifying on the left. On top of that when you upload custom art assets from this web interface those items are added to the local IPFS server running in this Docker container. To share this data with the world you will need to forward port 4001 to a public IP address.</p>
<h2>Help us out</h2>
<p>You went through the process of linking up roms and cleaning up the artwork the way you like it, odds are another person would appreciate not doing the same work you did. If you are able to please share your metadata to <a href="https://github.com/linuxserver/emulatorjs/issues">GitHub</a> or hop on our <a href="https://discord.gg/YWrKVTn">Discord Server</a> and share it there. We can help with file optimization and getting stuff pinned to IPFS permanently. Just copy and paste the metadata to something like <a href="https://www.textdrop.link/">Text Drop</a> or <a href="https://pastebin.com/">Paste Bin</a>.</p>
<p>You went through the process of linking up roms and cleaning up the artwork the way you like it, odds are another person would appreciate not doing the same work you did. If you are able to please share your metadata to <a href="https://github.com/linuxserver/emulatorjs/issues">GitHub</a> or hop on our <a href="https://discord.gg/YWrKVTn">Discord Server</a> and share it there. We can help with file optimization and getting stuff pinned to IPFS permanently. Just copy and paste the metadata to something like <a href="https://pastebin.com/">Paste Bin</a>.</p>
</div>
</div>
<script src="socket.io/socket.io.js"></script>
Expand Down

0 comments on commit 600b15a

Please sign in to comment.