Name the settings, files and tools NX2navi

The names are NX2NAVI, NX2navi or nx2navi: the settings prefix (NX2NAVI_*), the ini file
(nx2navi.ini), the shader translator (nx2navi_xlate), the Windows resources, the installer and the docs. The 8-byte
file magics keep their size (NX2NSANS, NX2NSPRG, NX2NSPRP, NX2NPKEY, NX2NRFS1), so caches and the RomFS index from
older builds are not read. cfg.c and the settings pages took the prefix length as 5; it now follows the prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-06 03:43:15 -05:00
parent 77d0c0b84e
commit c8738a948c
28 changed files with 61 additions and 61 deletions

View File

@@ -28,7 +28,7 @@ BLOCKED_SUFFIXES = {
BLOCKED_NAMES = {"main", "sdk", "rtld", "subsdk0", "subsdk1", "main.npdm"}
# Written by the code generator into every file it emits.
GENERATED_MARKER = "NX2NAVI_RECOMP_" + "GENERATED_FROM_GAME_CODE"
GENERATED_MARKER = "NX2NAVI_" + "GENERATED_FROM_GAME_CODE"
# A prod.keys / title.keys line: name containing key, kek or seed, then hex.
KEY_LINE = re.compile(

View File

@@ -433,7 +433,7 @@ exec "$HERE/python/bin/python3" -m installer.gui "$@"
DESKTOP = '''[Desktop Entry]
Type=Application
Name=NX2navi Recomp Setup
Name=NX2navi Setup
Comment=Builds Ocarina of Time for this PC from your own game files
Exec=AppRun
Icon=nx2navi-setup

View File

@@ -9,8 +9,8 @@ default variant (every texture slot a 2D texture, float vertex inputs and colour
translates every shader for its default bind state: prepare_shader_seed.py all_default), and writes them next to the
build's nx2navi.exe in the record layouts of runtime/gfx_shader.c ("answers met in play"):
seed-programs.bin "NX2NAVISPRG": stage, length, c1 length, runtime code hash, control section, code, c1
seed-answers.bin "NX2NAVISANS": stage, code hash, input id (zero: the runtime computes it), answers, priority
seed-programs.bin "NX2NSPRG": stage, length, c1 length, runtime code hash, control section, code, c1
seed-answers.bin "NX2NSANS": stage, code hash, input id (zero: the runtime computes it), answers, priority
Priority (the pad byte): 0 shaders the list's warm rows flag as title/menu (t), 1 other warm rows (S, C, R), 2 the
rest; a default variant takes its shader's priority. Then it runs `nx2navi.exe --prepare-shaders`, which translates every record into the build's shader cache, writes
@@ -192,11 +192,11 @@ def main():
recs.sort(key=lambda r: r[0]) # stable: list order within a priority
out = a.build.resolve()
with open(out / 'seed-programs.bin', 'wb') as f:
f.write(b'NX2NAVISPRG' + struct.pack('<II', 1, 0))
f.write(b'NX2NSPRG' + struct.pack('<II', 1, 0))
for _, body in progs.values():
f.write(body)
with open(out / 'seed-answers.bin', 'wb') as f:
f.write(b'NX2NAVISANS' + struct.pack('<II', 1, ANS_REC))
f.write(b'NX2NSANS' + struct.pack('<II', 1, ANS_REC))
for _, rec in recs:
f.write(rec)
by = [sum(1 for p, _ in recs if p == i) for i in range(3)]

View File

@@ -6,7 +6,7 @@ MacNativeGames contributors).
Input: <romfs>/index.json ({status, romfs_size, romfs_sha256, files: [{path, offset, size}]}) as tools/extract.py
writes it, and <romfs>/romfs.bin, whose size must match. Output, both in the build directory (never in the repo):
romfs-index.bin NX2NAVIRFS1 layout: header <8sQQ (magic, count, strings offset), count 24-byte rows <QQII (offset,
romfs-index.bin NX2NRFS1 layout: header <8sQQ (magic, count, strings offset), count 24-byte rows <QQII (offset,
size, name offset, name length including the NUL), then the NUL-terminated names; rows sorted by
the UTF-8 bytes of the path, which is the order strcmp sees
romfs_config.h ROMFS_IMAGE_SIZE, ROMFS_IMAGE_SHA256, ROMFS_INDEX_SHA256, ROMFS_FILE_COUNT
@@ -27,7 +27,7 @@ from pathlib import Path
from check_content import GENERATED_MARKER
MAGIC = b'NX2NAVIRFS1'
MAGIC = b'NX2NRFS1'
HEADER = struct.Struct('<8sQQ')
ROW = struct.Struct('<QQII')