Repository navigation
Give every game its own work folder when the title ID is not found - #386
Merged
Merged
Conversation
1 task done
zynilver
pushed a commit
to zynilver/NX2Apple
that referenced
this pull request
Nov 1, 2026
…rts are repaired The launcher's Controls page (PR LNPANDY#39) writes DM_KEYMAP / DM_PAD_MAP at Play, but nothing on this side read them: the page moved the fields and every game kept its default keys. This brings seedds/nxnative#386's engine side here — dm/host/input_map.h (the key and button maps, pure so a test runs without a keyboard) and front_mac.m using it in place of the fixed key_bit() switch — so the page does what it says. LNPANDY#386 is still open upstream, so front_mac.m and input_map.h are carriers here (OURS for the two new files, patch_front_mac() for the changed one), and the day LNPANDY#386 merges, a sync finds every anchor applied already. Two more things surfaced while checking the suites: * patch_nso.py had lost the NRO header skip (issue LNPANDY#14). It was fixed in 4b86323 and then silently reverted by a sync, because the file was not a carrier: an NRO's text starts at 0x80, and scanning from 0 read the header's build ID as instructions and skipped the last 128 bytes of text. Restored, and patch_nso.py is a carrier now (patch_patch_nso). * patch_tests_makefile() opened with `if 'romfs_arc.c' in t: return skip(...)`, which made the touch-pad test block that follows dead code ever after. Its first addition skips on its own now, so the new t_input_map rule is not skipped as well. docs/env_switches.tsv gains the rows the tool asks for (DM_KEYMAP, DM_PAD_MAP), the two it listed with no meaning (DM_FULL_ROMFS, DM_PROFILE), and the mode change PR LNPANDY#41 needed. Checked: t_input_map 22/22; the full host suite (make -C dm/host/tests run) exits 0; dmhost builds; the Python suite is 350 passed, 17 skipped, 0 failed (test_env_switches and test_nro_header were both failing before this); the sync reports every patcher agreeing with the tree.
zynilver
pushed a commit
to zynilver/NX2Apple
that referenced
this pull request
Nov 1, 2026
…who carries them The section said a build without the engine change ignores DM_KEYMAP / DM_PAD_MAP and plays with the default keys. That was true when PR LNPANDY#39 was written — seedds/nxnative#386 was open and nothing here read them — but 9f7d421 carried LNPANDY#386's engine side into this fork, so it reads them now. It also points at docs/env_switches.tsv, where both names are listed.
This was referenced Nov 1, 2026
lucaszhongsj
pushed a commit
to lucaszhongsj/nxnative
that referenced
this pull request
Nov 19, 2026
input_map.h parses the maps; front_mac.m applies them to keys and controller buttons. Upstream-Status: forwarded seedds#386 Reason: The launcher's Controls page: DM_KEYMAP and DM_PAD_MAP move buttons to other keys and controller buttons (open upstream, seedds#386) Issue: LNPANDY/NX2Apple#386
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix or feature
What and why
Fixes #382. The launcher fell back to the fixed text "game" when it found no title ID. Every such game got the folder
game_buildandgame.app. A second game then hit the shader cache of the first one and the engine refused with "holds the shader libraries of game ..., give each game its own output directory".The reporter's files are named like
01007EF00011E000/01007EF00011E000_v0_420d1c5034ab.nsp, with the ID bare (no brackets) at the start of the name. The bare-ID rule needs the start of the name or a delimiter before the ID. The launcher passed the full path, so the ID after a/never matched and these files fell back to "game".titleIDnow looks at the file name only. A folder named with an ID never stands in for the file, so the update (...E800_v1048576_...) and the DLC (...F001_...) beside the base keep their own IDs. The tests use these names as full paths.For names that really have no ID, I put the naming in one function,
BuildModel.buildKey. All three call sites use it (work folder and app, the iOS games folder, the shell install). With an ID nothing changes:<ID>_buildand<ID>.app. Without one the key is the file name stem, cut to letters, digits,-and_, plus an 8-digit FNV-1a hash of the stem. Different names give different folders. The same name gives the same folder, so a rebuild keeps its cache. The hash is stable across launches.I did not read the title ID from inside the NSP, because the launcher has no NSP reader and I did not want to add a parser. The library and Free space look up
<titleID>_build, so they will not find the<name>-<hash>_buildfolder of such a game. That was also true forgame_build.The Qt front end had the same fallback. I fixed it the same way with
inputs.build_key, which gives the same key as the Mac launcher.Checked
cd frontend && swift build && swift test(670 tests, 0 failures, 16 skipped).python3 -m unittest discover -s frontend-qt/testsandpython3 -m unittest discover tools/testspass. New tests:BuildKeyTests.swiftandBuildKeyTestsintest_inputs.py.Screenshots
None, no visible change.
Scope
dm/,scripts/,docs/,ref/) is added to the repository: a change there is a patch inpatches/(a commit inengine/, thentools/engine.py export, andtools/engine.py checkpasses), with itsUpstream-Statusforwarded seedds/nxnative#..., orpendinguntil that PR is open