diff --git a/scripts/build_ipa_from_nsp.py b/scripts/build_ipa_from_nsp.py index 84c62a4..3f44b3d 100755 --- a/scripts/build_ipa_from_nsp.py +++ b/scripts/build_ipa_from_nsp.py @@ -521,7 +521,7 @@ def survey(nsp_dir, app, fam, keys, repo, py, env): if S['ue_decode'][0]: # the manifest has no pak footers, so both kinds are named; the build tells them apart by the footer's version (uepak.py) notes.append(f'{rom["exts"].get(".pak", 0)} Unreal pak(s): version 11 paks keep the shaders Oodle-compressed in shader code archives (Octopath Traveler 0), decoded by booting the game on the Mac; ' 'legacy paks (version 4, DRAGON QUEST XI S) keep them inline in the cooked packages, which the shader split reads through the game\'s own decoder (LZ5) in the Mac host') - if extra: notes.append(f'modules besides main / sdk: {", ".join(f"{n} ({mods[n]["kind"]})" for n in extra)}; the provisional profile loads {G["modules"][0]} (load order main, subsdk*, sdk)') + if extra: notes.append('modules besides main / sdk: {}; the provisional profile loads {} (load order main, subsdk*, sdk)'.format(", ".join(f'{n} ({mods[n]["kind"]})' for n in extra), G["modules"][0])) if rom['mags']['UnityFS'] or 'Unity IL2CPP' in F['markers']: notes.append('Unity: the shaders are Shader objects in UnityFS bundles and data.unity3d, which shader_split.py reads through unityfs.py (written for Unity 2020.3\'s Switch format, also read for 2017.4, 2018.3, 2022.3 and 6000.0; check other Unity versions first)') if F['glslc']: notes.append(f'main has {F["glslc"]} GLSLC compiler output magics (0x19866891): shader_split.py takes those that are whole outputs (13 Sentinels and the KTGL games compile their shaders into main; Unity\'s player has 11 of its own)') if rom['mags']['Trinity pack']: notes.append('Trinity packs (Game Freak, arc/data.trpfs with its index data.trpfd): the shaders are BNSH inside Oodle Mermaid streams; shader_split.py decodes them with the game\'s own OodleLZ_Decompress in the Mac host, which dm/host/hle_oodle.c finds by the library\'s name string') @@ -1463,7 +1463,8 @@ def report_profile_status(g, reg, pkg_ver, derived, provisional, artifact='IPA') if derived: # the modules whose build no registered version has: the rewriter's cuts and the host's fixes made for a registered build's code do not reach them known = {(m, b) for row in reg.builds().values() for m, b in row.items() if m != 'display'} other = [m for m, b in g.builds()[pkg_ver].items() if m != 'display' and (m, b) not in known] - say(f'[RED] this {artifact} uses {pkg_ver} ({disp}), which game profile {reg.id} was not brought up on ({", ".join(f"{v} {b["display"]}" for v, b in reg.builds().items())}): ' + registered_builds = ", ".join(f'{v} {b["display"]}' for v, b in reg.builds().items()) + say(f'[RED] this {artifact} uses {pkg_ver} ({disp}), which game profile {reg.id} was not brought up on ({registered_builds}): ' 'its settings, with this version\'s own shaders' + (f'; {", ".join(other)} {"is a build" if len(other) == 1 else "are builds"} the profile does not register, so the fixes made for ' 'the registered builds\' code (patch_nso.py, the host) do not apply there and the game may not run as well' if other else '; every module is a registered build')) if provisional: @@ -1532,7 +1533,9 @@ def main(args=None): # any other version (no update, another update) is packed from a profile derived from it (derive_profile), with its own shaders pkg_ver = args.package or PACKAGE or max(have, key=vnum) if pkg_ver not in have: raise BuildError(f'the version to pack (-p / PACKAGE) is not in the folder, which holds {", ".join(sorted(have, key=vnum))}') - if pkg_ver not in builds: derived = f'{pkg_ver} is not a version game profile {g.id} registers ({", ".join(f"{v} {b["display"]}" for v, b in builds.items())})' + if pkg_ver not in builds: + registered_builds = ", ".join(f'{v} {b["display"]}' for v, b in builds.items()) + derived = f'{pkg_ver} is not a version game profile {g.id} registers ({registered_builds})' elif not all(v in have for v in need): derived = f'the folder has no {", ".join(v for v in need if v not in have)}, whose files game profile {g.id}\'s shader tables were made from' if derived: say(f'{derived}: packing {pkg_ver} from a profile derived from it') versions = [pkg_ver] if derived else need + ([pkg_ver] if pkg_ver not in need else [])