A plugin's write into main's data that points at no plugin code is matched by place only at start (#1437, #1388)

The expect line of such a word says `* *` (tools/exefs_plugins.py plugin_lines), recomp/patches.py carries it into
RT_PLUGIN_WRITES as a flag, and runtime/plugin_init.c check_writes accepts any value there through
runtime/plugin_writes.h plugin_write_find. Hook branches in .text and pointers into a plugin's .text keep the exact
match. Zonai Fieldworks' Self Recall takes its storage off a pool size at main+0x3ad6eb8 that grows with the texture
heap of render_scale, so its plugin went off at every start with a grown heap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Valiantsin DzerakhandClaude Opus 5.5 committed 2026-11-24 21:46:33 +03:00
1 parent 7da078d1ab
commit cc749d8679
6 files changed
+139 -25

No files matched your search

+4 -2
View File
@@ -112,8 +112,10 @@ ahead of time, after the design in [#845](https://github.com/valentderah/totk-pc
reason, and the other plugins are built in.
2. At every start each plugin's start-up runs again, before the game's own start-up code, in the same setting: it
sees the game's own instructions, as in its service run. Its redirects are compared with the record of the
rebuild. When they match, the mod's code sites go on. When they do not, the plugin stays off for this run, the
mod's row says why, and the next start runs the rebuild.
rebuild. A value it writes into the game's data that redirects nothing (a size, a counter) only has to land at
the recorded place, since the game may hold another value there at this start, for example a memory pool that
grows with `render_scale`. When they match, the mod's code sites go on. When they do not, the plugin stays off for
this run, the mod's row says why, and the next start runs the rebuild, which runs the plugin's service run again.
3. The plugin keeps what its start-up made (its memory, its tables), so its code works as on the Switch. The start
costs about 50 ms per plugin; the game runs no differently without a plugin.
4. Removing a plugin mod from the mods folder starts the rebuild at the next start, which builds the game without