Skip to content

Launch options: a game's mods (#34) - #57

Merged
LNPANDY merged 4 commits into
LNPANDY:mainfrom
v0lumehi:pr-34-mods
Oct 27, 2026
Merged

LNPANDY merged 4 commits into
LNPANDY:mainfrom
v0lumehi:pr-34-mods

Conversation

@v0lumehi

@v0lumehi v0lumehi commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #34. Builds on #56, which builds on #55 and #54. The change here is the last commit.

A Mods section between the basic and the advanced settings lists the folders in the game's mods folder, each with a switch. The folder is <games folder>/mods/<title ID>/, or Application Support when there is no games folder.

Play passes the mods that are switched on as DM_ROMFS_OVERLAY, which the host already reads (hle_fs.c). Reads look in those folders first, in list order, so when two mods replace the same file, the one higher in the list wins.

Where a mod's files are found:

  • <mod>/romfs
  • an Atmosphère layout: <mod>/atmosphere/contents/<title ID>/romfs or <mod>/contents/<title ID>/romfs
  • the mod folder itself

A mod with only exefs/ changes the game's code, which the rewriter does not take. It is listed, and its switch stays off.

The save-safety policy you asked for

  • Kept per game: which mods are on is stored per game in the library. It never changes between sessions unless the player changes it.
  • The note under the section: a mod changes the files the game reads, including its saves, so back up the saves before switching one on or off; a save made with a mod may not load without it.
  • Show saves opens the game's save folder (~/Library/Application Support/nxnative/<title ID>/save, from dm/mac/launcher.c) for that backup.

Open mods folder creates the folder and opens it in the Finder. Refresh reads the folder again. A controller reaches every switch and button.

Checked

  • swift test: 30 tests pass.
  • LaunchOptionsTests covers the four layouts, leaving out a code-only mod, and DM_ROMFS_OVERLAY in list order.
  • Reviewed in the running Mac app (a preview build with all four PRs). A real mod has not been played with yet.

…tings (LNPANDY#37)

The sheet listed every row of the app's launcher.json in one column of
sections (Game, Controls, Performance), so the settings a player changes
most sat among the ones only a tuning session needs. The basic ones come
first now, in their sections: frame rate, render scale, console mode,
language and rumble. The rest is behind an Advanced settings row that
says how many it holds and opens them in place.

Which rows are basic comes from the list when it says so (a row's level,
seedds/nxnative#399: settings.tsv's optional level column), else from
the launcher's own list of those five. Apps packed before the column
show the same split.

LaunchOptionsTests: the default split, and a level in launcher.json
winning over it.
, LNPANDY#36)

LNPANDY#35 Display mode: Window or Fullscreen for a Mac game, under the render
scale. The host starts fullscreen when DM_FULLSCREEN is set at all
(front_mac.m), so Window leaves the variable out instead of setting it
empty. A list from settings.tsv will carry the row once it has a
platform condition (seedds/nxnative#352); until then the launcher adds it
to a list that has none.

LNPANDY#36 Render scale in pixels: with the game's base size, the row shows
0.75 as 1200x675 and says what it is a share of ("75% of 1600x900
docked"), for the console mode chosen (1280x720 handheld for Breath of
the Wild). The base size comes from the row's base (seedds/nxnative#399:
a profile's render_base, written by settings.py), else from the game's
profile in the repository, so apps packed before still show pixels. A
game without one keeps the percentage. Play goes through the same list,
so Display mode reaches the app.

LaunchOptionsTests: Display mode's place and its unset Window, the
pixels docked and handheld from the profile, and the percentage without
a base size.
A Mac on a TV needs no keyboard now. A game controller moves a focus
through the library, Settings and both sheets: the D-pad or left stick
goes to the nearest control in that direction (held, it repeats), A
activates it, and on a control that holds a value (a choice, a slider, a
switch, the language, a controller button's mapping) left and right
change the value. L and R switch the pages, X opens the selected game's
launch options, B closes a sheet or goes back. The buttons are named by
position, as the game names them (front_mac.m): A on the right, B at the
bottom. Moving onto a game's card selects it and scrolls it into view;
the sheets and Settings scroll to the focus. A hint at the bottom of the
library names the buttons while a controller is connected.

macOS gives SwiftUI controls keyboard focus only with Full Keyboard
Access on, so the focus is the launcher's own (PadFocus): each control a
controller can reach reports its frame in its scope (the window or one
sheet). Left and right stay in the row; up and down prefer the same
column. The cream ring shows only after a controller was used, so mouse
users never see it, and the collection row keeps room for it at its
edges. Input counts only while the launcher is the active app:
GameController gives a controller to the app in front, so the launcher
never acts behind a game it started. The Builds page is left out:
choosing the game files needs the Finder anyway.

PadFocusTests: the default focus, moves in a row and between rows, values
on left / right, and a new scope starting without a focus; the visual QA
renders the sheet with the focus shown.
A Mods section between the basic and the advanced settings lists the
folders in the game's mods folder (<games folder>/mods/<title ID>/, or
Application Support without a games folder), each with a switch. Play
passes the mods switched on as DM_ROMFS_OVERLAY, which the host already
reads (hle_fs.c): reads look in those folders first, in the list's
order, so where two mods replace one file the one higher in the list
wins. A mod's files are found in <mod>/romfs, in an Atmosphere layout
(<mod>/atmosphere/contents/<title ID>/romfs, <mod>/contents/<title
ID>/romfs) or in the folder itself; a mod with only exefs/ changes the
game's code, which the rewriter does not take, so it is listed and its
switch stays off.

Saves: which mods are on is kept per game in the library, so it does not
change between sessions on its own. A mod changes the files the game
reads, its saves included, so the note under the section says so and to
back up the saves before switching one, and Show saves opens them
(dm/mac/launcher.c's ~/Library/Application Support/nxnative/<title
ID>/save). Open mods folder creates the folder and opens it; Refresh
reads it again. A controller reaches every switch and button (LNPANDY#38).

LaunchOptionsTests: the four layouts, the code-only mod left out, and
DM_ROMFS_OVERLAY in list order.
@LNPANDY

LNPANDY commented Oct 27, 2026

Copy link
Copy Markdown
Owner

All four are merged, in the order you built them: #54 → 88a18aaa, #55 → b68f6996, #56 → 8ccce071, #57 → de3c0d77. #48 too, as 37157419.

What I verified on each, on top of current main (nothing was taken on the CI run alone):

  • every branch merged into today's main with no conflicts, including the ones that touched LauncherView.swift and ContentView.swift after your rebase
  • swift build -c release clean and swift test green at each step: 26 → 28 → 31 → 32 tests, 0 failures
  • after all four: tool suite 352, iOS 31, Qt 122, and sync_upstream.py reports every patcher agreeing with the tree

Three things I checked specifically, because they are the failure modes I would expect:

  • The level column is backwards compatible. LaunchSetting.level is optional and falls back to basicByDefault, so an app packed before launcher.json: a level for the settings shown first, and the render scale's base size seedds/nxnative#399 shows the same split. Good call sending the schema change upstream instead of only fixing it here.
  • DM_ROMFS_OVERLAY is split on :, which is what rom_overlay_path in hle_fs.c uses (strtok_r(roots, ":", …)), and the mods list joins with ":" in list order. First match wins in the host loop, so "higher in the list wins" is right.
  • The gamepad cannot drive the launcher behind a running game. fire() gates on NSApp.isActive, and GameController gives input to the frontmost app — so this is safe for the exact case that worried me (a controller that keeps moving the library while a game runs).

Two notes, neither a change request:

  • PR Launch options: a game's mods (#34) #57's body says a real mod has not been played with yet, only the four folder layouts and the environment string. That is honest and I merged on it, but it means DM_ROMFS_OVERLAY end to end is still unproven — if you have a mod that replaces something visible early (a font, a title screen), that is the cheapest proof.
  • Gamepad.swift repeats a direction after 0.4 s, then every 0.12 s. That felt right in the capture; if it feels fast on a real couch, the two constants are at the top and nothing else depends on them.

The next release will carry all of this. If you have more queued, send them the same way — the stacked-PR shape worked well here, and reviewing them in order took one pass each.

LNPANDY added a commit that referenced this pull request Oct 27, 2026
The update machinery was already here — checkAppUpdate finds the newest release, performAppUpdate
downloads it, swaps the bundle and relaunches — but the only signal was a status line naming a
tag. A user whose app worked had no way to judge whether the new version mattered, so "Update to
v0.4.8" was a leap of faith, and most people took the leap only when something broke.

Now a found update opens a sheet: the version they have, the one on offer, the release notes for
their interface language, Open the release page, Later, and Update now. It opens from the launch
check and from Check for updates, so an old install learns what changed without visiting GitHub.

The notes are the release body, which this project writes in both languages
(docs/RELEASE-NOTES-GUIDE.md). UpdateSheet.lines splits them by the `**中文**` / `**English**`
markers rather than by looking for Han characters — the first version did the latter and handed an
English reader the Chinese paragraph, because that line contains both. A body with no markers is
shown whole instead of being split in half.

Six tests cover the split, including the two cases that failed on the first attempt (a monolingual
body, and inline **bold** inside a marked paragraph). Checked against the real v0.4.7 body: 19 lines
each way, aligned.

appVersion 0.4.7 → 0.4.8: today's merges (#28, #48, #54–#57, #59, #60 and the #52/#53 fixes) were
shipping under a version number that also names the 0.4.7 release, so a bug report could not say
which one it came from.
@v0lumehi
v0lumehi deleted the pr-34-mods branch November 1, 2026 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Launch options: a Mods section (per-game RomFS mods through DM_ROMFS_OVERLAY)

2 participants