From Sega Retro

This file or page has been flagged for relocation to Retro CDN, the Wikimedia Commons-esque service for all Retro wikis. This message is for the benefit of Sega Retro wiki staff.

The RXL (ROM Extension Library) Format of ROM patching, created by saxman, fixes issues that most people find with IPS patches. RXL programs were very specifically designed for software for ROMs. They work like plugins more than anything else, providing a way to share portions of a modified ROM without the need to reprogram the code.

For a long time, IPS patches have been used to distribute hacks. It becomes a bit more complicated when you have to use both an IPS and an expansion file. Software like StealthPatch can use expansion data inside an IPS patch, but many other IPS patchers don't support this. However, this is only a minor issue.

When programming software for ROMs (e.g. running extra instructions to make the game read/write extra information—useful for many things such as level editors), bigger problems come in play. Most software addons for ROMs are designed specifically to be patched at a precise place in the ROM. If it's not patched correctly, it doesn't work. This is especially bad when you're trying to patch a ROM that already has information at the needed address. RXL avoids this problem.

Like IPS patches, the RXL format has fallen out of use due to the adoption of disassembly editing, and high-speed internet connections which make people less concerned about file sizes.

Format Specification

The following is taken from the original RXL format documentation:

The format for RXL files is structured in an orderly fashion, but it can still become rather sophisticated from time to time. So, understanding the format in full detail is recommended for everyone.

The first three bytes are 'RXL'. The fourth byte is the version. This document explains the version '01' format only since it's strongly suggested that you take advantage of the more recent version capabilities. So, make the version equivalent to '01'.

After the first four bytes, you will have to define four strings. So, first you will type the name of your program or technology. When you want to end the string, you simply type 'FF'. After that string, you will have to define another string containing the version. Use 'FF' to end that string. Then you will have to define two more strings -- first being the author, and then any comments you'd like to make; both these strings use 'FF' to end independently.

RXL technology is controlled by basic instructions. A single byte is given to tell it what you want it to do. Then it sets any other need information up from there.

00 - Load external file into ROM
4x - Insert 32-bit address of file 'x'
80 - IPS
81 - Raw data
Fx - Interchangeable address

After this, you will have to specify what you want the open dialog inside the RXL patcher to say. So, you could type something like "Open a BIN file" (minus the quotes). The string is ended by using 'FF'. Then, another string begins. The second string defines the file types that you want the dialog to look for. So, you could type something like "Binary Files|*.bin", or maybe "Super Magic Drive Files|*.smd|Binary Files|*.bin|Text Files|*.txt" (minus the quotes). If you want to have an 'all files' (*.*) file type, you simply only need to put "*.*" as the file description. This must be used as the last file type though. Once you are finished, simply put 'FF' at the end.

The first file you load will be file #0. The next file will be #1, and so on. You can keep a total of 16 files loaded into memory (0-F). You can load more, but if you were to load your 17th file into memory, then 40 (explained below) will no longer be able to point to the first file, but instead will begin pointing to the 17th. Though, the RXL format was designed to read things in order, so you can still have more than 16 addresses by using 4x, but you will be limited to 16 at a single time.

Once you load a file, it will insert it directly into the ROM as-is form. This can be used to load art and other things like that directly into the ROM if needed.

This will reserve 4 bytes that will be used to hold the address of file #x. When you tell the RXL to load a file into the ROM, the address that the file is loaded in the ROM will go into the area where you placed 4x. Replace the 'x' with the file number. The first file you load will be #0. The second will be #1, third will be #2, etc.

	[80] - IPS:
This is basically an IPS patch, but with a few minor changes and additions. After the instruction, you will need to specify two bytes that define the size of the IPS. Then, the main IPS data begins. You start by giving three bytes to which define a 24-bit address. Then, you specify two bytes to which tell it how many bytes to change at the given address. Then, you type the bytes you want to be inserted at that address. When you give the amount of bytes given to the size you specified right after the address, then you will simply need to specify another 24-bit address, and do the same process.

	[81] - RAW DATA:
This is probably the easiest of all simply because there is very little work involved. All you need to do is give two bytes which will define the size of the data. then, you simply insert the exact data you want to be put into the ROM.

This simply allows you to specify an address to which will be given four bytes equivalent to the address specified by the user to add the technology to the ROM. You can do this by simply typing an 'Fx' in place of the first byte of a 24-bit address. Then, you would type the regular 24-bit address after that. You don't need to specify any bytes to give it, or even a size. So, when you patch the ROM, the first four bytes at the address you specified by 'Fx' will be changed to an equivalent 32-bit address of the address specified by the user to where they want the technology to be installed. This is useful to tell the game to jump to that area to read the information installed. To set how many 24-bit interchangeable addresses you want to use, replace 'x' with the number you want to use. You can specify between 1 and 16 addresses. The will be listed one after another.