Writing · Ep. 4 · 0x1AE7–0x217F · Tools
Building an update that still needs the original game
The English text was working in Astris. I had translated files, image replacements and a couple of fixes to the game's code. The next question was how to put those changes on my Switch.
I wanted an update I could install alongside the original game. Packing the whole translated game into another NSP would have been a different result. The package needed to carry the changes and use the original for everything it left out.
That sounded straightforward until I looked at how a Switch update actually reads its data. A folder of replacement files and an installable update solve the same problem in different ways.
This is the last part of the OreGairu English Patch series, following the bulk translation run. It ends with the patch running on my Switch, but first I had to build a package that could put the right bytes back together.
What I had before packaging
The working mod contained 723 RomFS replacement files and two separate executable addons. A mod loader could find a replacement at the expected path and use it instead of the original file. The addons handled changes that couldn't be made by translating assets alone: horizontal topic-card text and three English prompts in the executable.
That setup was useful while developing the mod. I could replace one message file and test it without rebuilding the whole package.
An update NSP needed more. NSP is the outer package; NCA files inside it carry the content. The update had to describe both its new data and how that data related to the installed base game. Putting loose files into an archive and calling it an update wouldn't supply that relationship.
The first design decision was to separate two outputs: a complete local copy of what the updated game should contain, and the smaller update I wanted to install on my Switch.
First, build something to compare against
The builder started with the verified original files and applied the translated replacements in a separate workspace. It also needed the executable fixes, which I'll come back to below.
The result was the complete intended target. It included everything the updated game would see, whether a file had changed or not. This stayed in the local build workspace as a reference for comparison and testing.
With the original and target available, the builder could ask a concrete question for each file: are its bytes identical, or does the update need to carry new data?
How can a small update describe a much larger game?
The key was to reference unchanged bytes instead of copying them into the update.
The mapper matched files by path and size, then compared their actual contents. Where bytes matched and the storage boundaries allowed it, it recorded a reference to the original. Changed files, filesystem metadata and boundary padding went into the update's own data.
A reference was effectively an instruction: “For this part of the updated filesystem, read from this position in the base game.” Another entry might say to read from the update instead.
Here's a simplified example, not an actual excerpt from the game's tables:
The updated filesystem needs three ranges:
Range A -> read unchanged bytes from the base game
Range B -> read replacement bytes from the update
Range C -> read more unchanged bytes from the base game
Together, A + B + C form the content the game reads.The mkbktr project was a useful reference for constructing updates this way. Its example writer used a single relocation bucket, while this build needed more entries than that could hold. The mapper for this project produced 45,657 entries across 56 buckets. A bucket is a group of entries in the mapping structure; each entry describes where a range comes from.
This implementation favored comparisons that were easy to verify. It wasn't trying to find the smallest possible difference between every pair of binary files. Each span referenced from the base was compared byte for byte before the writer included that reference.
Result | Amount |
|---|---|
Files in the target RomFS | 25,434 |
Unchanged files contributing base references | 24,711 |
Bytes reused through base references | 3,382,258,032 |
Final update NSP | 175,101,648 bytes, or 166.99 MiB |
That explains why an update of about 167 MiB can describe changes to a much larger game. It still needs the original data to fill in the referenced ranges. This wasn't the entire game compressed down to 167 MiB.
The code fixes had to come along too
The image and dialogue replacements weren't the whole patch. Without the executable changes, the English topic cards would still use the original vertical layout, and three prompts would remain Japanese.
Loose IPS files worked with the mod loader, but placing them inside an NSP wouldn't make the update system apply them. The builder instead applied their changes to a copy of the correct version of main, then included the resulting executable content in the update.
After applying the edits, the builder regenerated the hashes for the three NSO segments. NSO is the executable format used by these Switch modules; its segment hashes help check the contents of those sections. The output of this step was replacement ExeFS content with the code fixes already applied.
Giving the update its identity
Next came the metadata. The update needed to identify the base application it belonged to, list its own content and provide a display version.
The final package allowed only three archive members:
Archive | Its job in this update |
|---|---|
Program update NCA | Replacement executable content, changed resources and the mappings back to base data |
Control NCA | Application control information, including a display label identifying the English build |
Meta NCA | The update's content manifest, hashes and base application dependency |
The original game archives, original ticket, keys, firmware, saves and complete target archive stayed out of the final update package. After packing the NSP, the builder parsed it again and checked the hashes of all three members. The output was now an update package, but I still needed to know whether another reader could reconstruct the intended game from it.
One reader passed it. Another found a bug.
The first independent check used hactool. Given the original encrypted Program NCA and the update, it combined their data, checked integrity and extracted the result. The extracted paths and file hashes matched the local target.
That looked promising. Then a separate check using LibHac rejected the first metadata candidate.
Its CNMT reader expected an update-history section. The candidate had omitted that section, so the reader tried to parse past what was available. The fix was an explicit 28-byte empty history header, followed by another validation run.
The corrected package passed both. hactool reconstructed 25,434 RomFS files, six ExeFS files and two Control files. LibHac separately read the complete merged RomFS and ExeFS with strict integrity checks and compared their bytes against the intended target.
The comparison target from the first step was useful again: it gave both checks a concrete answer to compare with. I wasn't relying on the update merely opening without an error.
It's running on my Switch
The file checks answered whether the update reconstructed the intended content. The next test was seeing the game run on the console.
To test the package on its own, existing loose mods and IPS addons need to be disabled so they don't hide a missing change in the NSP.
On 4 November 2026, I got to see it working on my Switch. Komachi's name and dialogue appeared in English on the screen in front of me.

After following bytes through message files, recovering translation jobs and rebuilding archives, I could finally sit down with the game and read it. There's more of the game to play through, but this was the result I wanted to reach when I started.
The project page brings together the experiments and what I learned along the way.
