Repository navigation
nxnative for Mac: a game library around the build - #27
Conversation
The Mac front end becomes a small launcher: a library of the finished Mac builds with their eShop key art (blawar/titledb, by title ID) and Play, a calmer build page and settings in one style (Manrope, embedded), a new icon, and the name nxnative (nxnative.app; the release also keeps the old asset name so earlier copies still update). Launch options: the Mac app now carries the IPA's dm/launcher.json (pack_app.py --settings; the iOS-only switches are marked platform:ios), so the launcher shows the iPhone launcher's settings per game and passes them to the app's environment on Play. Progress and Stop: the launcher reads --progress json (counts, totals, time left twice a second); shader_split.py reports its files as it scans them; builds run in a process group of their own, so Stop ends the script and every tool it started, and clears the progress.
A running stage shows how long it has been running, ticking every second in the progress list and the build bar, so a step that works on one large piece still visibly runs. The script's time-left estimate only comes with a new count; it now counts down from when it came and disappears when it runs out, instead of standing still with the count.
The progress count followed pool.map, which yields in job order: one slow job (a large archive range) held the count while the other workers went on, so the launcher showed the split standing still. The jobs are now submitted as futures and counted as they finish, in any order; the results are still collected in job order, so the tables do not change.
… ended The Stop test asked the shell to die of the SIGTERM. When its two children die first, the shell returns from its wait and exits 0 instead, which made the test fail now and then although Stop worked. It now checks what Stop promises: every process of the group is gone within 3 s, before the SIGKILL.
…gress go to seedds The launch-settings list for the Mac app (settings.py, settings.tsv, pack_app.py --settings, its step in the NSP script) and the shader split's progress lines are engine changes. The fork takes those files from upstream on every sync (build_ipa_from_nsp.py and shader_split.py are patch carriers, checked for drift), so carried here they would block the sync or be reverted by it. They are proposed upstream instead (seedds/nxnative#352), and come back with the sync once merged. The launcher works without them: an app without dm/launcher.json shows no launch options, and a step without a count shows its stripes and its clock.
|
Does this PR have a settings panel to change keyboard/controller controls to map? |
|
This is the largest and most thoughtful contribution this fork has received, and it is exactly the direction the project wanted: a library you open like a console, not a build form. I have read it, built it, and run its tests. I want to take it — but not as-is, and I want to be explicit about why, because two of the issues below would bite a real user rather than a test. What I verified
The two things that must change before this merges1. One test fails on a non-English machine — and that is a product problem, not just a test problem.
2. The rename needs a migration path for existing installs.
What I like, specifically
What I will doI am going to take this, in this order: fix the locale-dependent duration (I can do it in the branch, or you can push it — your call), add the release-note line for the rename, run the full Python and Qt suites against the merged tree, and then merge with your commits intact. If you would rather keep iterating on your branch first, say so and I will wait — this is your work and it is good. One question, because it decides whether I can verify the rest: does the library scan a real builds folder on your machine? If you have a few finished |
The formatter follows the system locale, so a Chinese macOS wrote 4秒 into a log whose every other line was English, and the test pinning "4s" failed on any non-English machine (18 tests, 1 failure, reproduced on zh_CN). The abbreviations are now built directly; the numbers are the same, the letters are locale-free. 18 tests, 0 failures.
|
I fixed the locale-dependent test and merged current main into the branch — both pushed here (commits The duration fix: Full verification on the merged tree (your branch + main, which since your base gained 79 game profiles, the runtime-profile work, and this week's Windows fixes — all without a single conflict):
Merging now, with your commits intact and you as the author of the feature. Two notes for after:
|
v0lumehi's PR #27 turned the Mac front end into a launcher library (40 files), and m1guelpf's #24/#26 fixed two HLE entries that games read through as nulls. Neither appeared anywhere in the README, and the first thing a new visitor sees should include who built what beyond the maintainer. Both names link their PRs so the work is one click away; the section ends by pointing at Contributing, since a visible contributor list is also an invitation.
…ssue #29) v0lumehi read the sync script while working on #27/#28 and found a real structural gap: a fix merged here into a vendored file that is neither OURS nor PATCHED is silently reverted the next time upstream touches that file. The concrete instance was PR #26 itself — hle_time.c and its test carry the adjustable-clock entry, neither was protected, and seedds has no such function. Both parts of the suggestion are taken: - hle_time.c and t_time.c join OURS (with a comment saying why, and that they leave if upstream takes the PR). Found by the issue, verified by the code: neither file was in either list. - A new pr-scope workflow fails a PR that edits a vendored file outside OURS/PATCHED and outside the fork-only paths (frontend/, frontend-qt/, .github/workflows/), with the at-risk list and the two ways out. It reads OURS and PATCHED from sync_upstream.py itself, so the check cannot drift from the lists it enforces.
|
@LNPANDY: I ran the scan test against my real games folder:
An older @KohlerVG: the controls remapping is in #39 (Settings → Controls), with the engine side in seedds/nxnative#386. |
…dth for the settings' buttons and controls Controls (asked for in LNPANDY#27): Settings has a Controls card whose Customize... opens a sheet with every keyboard function (sticks and D-pad, then buttons and Shake) and every controller button. A key is set by clicking its field and pressing the key (Esc keeps the old one, x leaves the function on no key); one key holds one function, so the function that had it is left on none, as the host does. A controller button picks the button it sends. The layout is kept in the user defaults, and Play passes only its changes as DM_KEYMAP / DM_PAD_MAP, which the host reads from seedds/nxnative#386 on (input_map.h); a build without it ignores them. The game's own launch options win over the layout if both ever set one variable. Widths: the Settings cards' buttons all have one minimum width, so they stand in one column (Refresh, Change folder..., Check for updates, Check again). In Launch options every control has one column of one width: the two- and three-way choices share it equally, the language list fills it, and the slider with its value fits it, so the controls of a card line up whatever their labels. ControlsTests checks the defaults (nothing passed), a move onto another function's key, a swap, a move back to the default, the controller map, persistence and the labels; the visual QA capture renders the sheet.
nxnative for Mac: a game library around the build
The Mac front end (
frontend/) was a build form. This turns it into a small launcher: a library of your games with their key art, a calmer build page, and Play with per-game launch options. Everything the old app could do is still there; the build runs the samescripts/build_ipa_from_nsp.py.The redesign
~/Library/Application Support/NS Port Builder/artwork/. A custom image (Manage → Change artwork) still comes first; the repository's screenshots and the app icon are the fallbacks.prod.keys), This Mac or iPhone / iPad, and the build button at the end of the page. Settings holds the games folder, the project repository (download and updates as before, from LNPANDY/NX2Apple) and the device dependencies.frontend/make_icon.swift). The app is now called nxnative:nxnative.app, release assetnxnative-macOS-arm64.zip. The CI also uploads the old asset name, so copies from before the rename still find their update.[NOTE] chain-changed, now also read from the JSONsayevents, once per build) and the hint that the output folder is where the build cache lives (under Save to) are carried over into the new pages.Launch options for Mac builds
The button beside Play shows the iPhone launcher's settings per game (frame rate, render scale, console mode, upscaling, language, rumble, the NVN performance switches, the HUD) and Play passes them to the app's environment. Only a choice that differs from the tested default is kept, as on the iPhone. The list comes from
Contents/Resources/dm/launcher.jsonin the Mac app. Packing it is an engine change, so it is proposed upstream instead of here: seedds/nxnative#352; this fork gets it with the sync once merged. Until then a Mac app has no list and the button says so.Progress and Stop
--progress jsonevents instead oflines(which carried a percentage only every 30 s): counts, totals and time left reach the UI twice a second, shown as thick amber bars; a step without a count shows slow diagonal stripes.dotnetorxcodebuildrunning. Builds now start in a process group of their own, and Stop (or quitting the app) ends the group. A stopped build also clears its progress.Tests
swift test --package-path frontend(18 tests): bundle validation, library persistence and folder discovery, launch options, key art lookup (with a local title list), JSON progress, the process group on Stop, and a full fake build. Opt-in render tests produce the screenshots above.dm/,docs/andscripts/are untouched, so the sync's patcher-drift check is unaffected.frontend-qt/tests/test_win.pypasses with the regenerated string table.