From e17b72615d238ae31bd390d15e2de03adc8f7f4c Mon Sep 17 00:00:00 2001 From: Marc Robledo Date: Fri, 9 Aug 2024 19:22:34 +0200 Subject: [PATCH] Updated Embedding Rom Patcher JS (markdown) --- Embedding-Rom-Patcher-JS.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Embedding-Rom-Patcher-JS.md b/Embedding-Rom-Patcher-JS.md index 86beeb5..4de8f4c 100644 --- a/Embedding-Rom-Patcher-JS.md +++ b/Embedding-Rom-Patcher-JS.md @@ -1,4 +1,3 @@ -# Embedding Rom Patcher JS in your site If you are self-hosting your own translations and/or hack patches, you can embed Rom Patcher JS and provide a nice solution for your users, allowing them to easily apply your patches to their ROMs without requiring them to download a single file, all thanks to the magic of the web! Take a look at [`index_template.html`](https://github.com/marcrobledo/RomPatcher.js/blob/master/index_template.html) for a template. Basically you need to: @@ -33,7 +32,7 @@ Take a look at [`index_template.html`](https://github.com/marcrobledo/RomPatcher   -## Providing additional patch information +# Providing additional patch information If you want to improve the user experience, you can provide additional information of your patches.
Instead of a simple file path, you can build a JSON object like this: ```js @@ -71,7 +70,7 @@ RomPatcherWeb.initialize(myPatcherSettings, {   -## Events +# Events If you want to go further, you can run your own code via events: ```js const myPatcherSettings={ @@ -98,7 +97,7 @@ In all events, the `romFile` parameter is an instance of [BinFile.js](https://gi   -### Example: Fix ROM endianness +## Example: Fix ROM endianness N64 ROM files are usually stored in `.z64` (Big Endian) or `.n64` (Little Endian) formats. You can make your patcher compatible with both formats by changing the provided ROM file endianness before patching (and then restoring it after patching).
```js const SSB_LITTE_ENDIAN_CRC32 = 0xf0b7c200; @@ -138,7 +137,7 @@ N64 ROM files are usually stored in `.z64` (Big Endian) or `.n64` (Little Endian ```   -### Example: Choose correct patch automatically +## Example: Choose correct patch automatically If your zip file contains several patches for different ROMs, you can make Rom Patcher JS so it picks automatically the patch for the provided ROM. ```js const SML2_CHECKSUM_WORLD = 0xd5ec24e4; @@ -187,7 +186,7 @@ If your zip file contains several patches for different ROMs, you can make Rom P ```   -### Example: Remove header +## Example: Remove header SNES ROM files are usually stored in `.sfc` (headerless) or `.smc` (headered) formats. You can make your patcher compatible with both formats by detecting if the ROM is headered and remove the header before the ROM is validated.
```js RomPatcher.initialize(