Triforce v0.4.0

What was merged from NX2navi (DLSS frame generation, AMD FSR 4 in Setup builds, texture detail by video memory, sprint, volume, frame caps, safer saves, the above-60 fixes), the ultrawide HUD at the screen edges, camera speed, movies without the AV1 Video Extension, the 5120x2880 + RenoDX HDR start fix, the renderer work of 11-14 and the first float changes of the lift.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-15 06:39:00 -06:00
parent 183b05d8c4
commit 93eeb714c2
87 changed files with 5947 additions and 153 deletions

View File

@@ -30,6 +30,38 @@ static class Saves
public static string TriforceFolder(string game) => Path.Combine(game, "user", "save", TriforceUid);
/// Triforce commits its save as a transaction (host/save_tx.h): the game's save mount is a working copy in
/// <user>\save-tx\<uid>\work, and a finished commit that could not be put in place yet (ready-<n>, the highest n) waits beside
/// it and is newer than the save folder. The folder of that transaction for a save folder <user>\save\<uid>, or null when
/// the folder is not such a save folder
static string? TriforceTx(string save)
{
var parent = Path.GetDirectoryName(save.TrimEnd('\\'));
if (parent == null || !string.Equals(Path.GetFileName(parent), "save", StringComparison.OrdinalIgnoreCase)) return null;
var user = Path.GetDirectoryName(parent);
return user == null ? null : Path.Combine(user, "save-tx", Path.GetFileName(save.TrimEnd('\\')));
}
/// The save Triforce would load at its next start: a finished commit still waiting, else the save folder
public static string TriforceNewest(string game)
{
var folder = TriforceFolder(game);
try
{
var tx = TriforceTx(folder);
if (tx != null && Directory.Exists(tx))
{
var ready = Directory.GetDirectories(tx, "ready-*")
.Select(d => (Dir: d, M: Regex.Match(Path.GetFileName(d), @"^ready-(\d{1,9})$")))
.Where(r => r.M.Success && IsSaveSet(r.Dir))
.OrderByDescending(r => int.Parse(r.M.Groups[1].Value)).FirstOrDefault();
if (ready.Dir != null) return ready.Dir;
}
}
catch (Exception) { }
return folder;
}
/// A folder holding this game's saves
public static bool IsSaveSet(string dir) =>
Directory.Exists(dir) && (File.Exists(Path.Combine(dir, "option.sav")) || File.Exists(Path.Combine(dir, "slot_00", "progress.sav"))
@@ -266,6 +298,12 @@ static class Saves
}
Directory.CreateDirectory(dst);
CopyTree(src, dst);
// (into Triforce: its working copy and any finished commit still waiting belong to the save that was replaced, and the game
// would put such a commit over the copy at its next start)
if (TriforceTx(dst) is { } tx && Directory.Exists(tx))
{
try { Directory.Delete(tx, true); } catch (Exception) { }
}
return backup;
}

View File

@@ -83,7 +83,7 @@ sealed partial class Shell
var none = offline.Message.Contains("no Triforce release");
NewsMark.Fill = Brush("TextFaint");
NewsLine.Text = none ? "No release is published yet" : "Couldn't check for updates";
NewsDetail.Text = (none ? "" : "GitHub could not be reached. ") + (hasGame ? "You can play what you have." : "You can build with the tools you have.");
NewsDetail.Text = (none ? "" : "The Triforce site could not be reached. ") + (hasGame ? "You can play what you have." : "You can build with the tools you have.");
NewsDetail.Foreground = Brush("TextDim");
}
else if (update)

View File

@@ -202,7 +202,7 @@ sealed partial class Shell
SavesInfo.Text = "Copying...";
try
{
var from = into ? pick.Folder : tri;
var from = into ? pick.Folder : Saves.TriforceNewest(game);
var to = into ? tri : pick.Folder;
var label = into ? "Triforce before " + pick.Name : pick.Name + " before Triforce";
var backup = await Task.Run(() => Saves.Copy(from, to, backups, label));

View File

@@ -67,7 +67,7 @@ sealed partial class Shell
Show(FetchPage);
stage.All(false);
FetchUnknown(true);
FetchState("Gathering the stones", "Asking GitHub for the newest Triforce.", "Checking for updates");
FetchState("Gathering the stones", "Asking for the newest Triforce.", "Checking for updates");
FetchCancel.Content = "Cancel";
await Shot(dir, "02-gather-checking");
@@ -78,7 +78,7 @@ sealed partial class Shell
stage.All(false);
FetchUnknown(false);
FetchTitle.Text = "GitHub could not be reached";
FetchTitle.Text = "The Triforce site could not be reached";
FetchNote.Text = "Check your internet connection, then try again.";
FetchNote.Foreground = Brush("Bad");
FetchStep.Text = "";

View File

@@ -241,8 +241,11 @@ sealed partial class Shell
{
if (DlssTick.IsChecked != true) { Install.Set("Dlss", "0"); return; }
DlssTick.IsChecked = false;
Ask("NVIDIA DLSS is NVIDIA's, under NVIDIA's own license (github.com/NVIDIA/DLSS, LICENSE.txt). Its files are downloaded to " +
"this PC; a game folder built with them must not be shared. Do you accept NVIDIA's license?", "I accept", T(S.Back),
// (11-15: the tick brings DLSS frame generation too: NVIDIA's Streamline (MIT) and nvngx_dlssg.dll, under the NVIDIA RTX
// SDKs License as DLSS itself: nx2/make_game.py fetch_streamline_sdk, scripts/streamline_sdk.py)
Ask("NVIDIA DLSS and DLSS frame generation are NVIDIA's, under NVIDIA's own licenses (github.com/NVIDIA/DLSS, LICENSE.txt; " +
"github.com/NVIDIA-RTX/Streamline, license.txt). Their files are downloaded to this PC; a game folder built with them " +
"must not be shared. Do you accept NVIDIA's licenses?", "I accept", T(S.Back),
() => { DlssTick.IsChecked = true; Install.Set("Dlss", "1"); });
};
SetupBack.Click += (_, _) => ShowHome(homeOffline);
@@ -447,7 +450,7 @@ sealed partial class Shell
FetchUnknown(false);
FetchCancel.IsEnabled = true;
var offline = e is HttpRequestException || e is TaskCanceledException && !cancelled;
FetchTitle.Text = cancelled ? "Stopped" : offline ? "GitHub could not be reached" : "Something went wrong";
FetchTitle.Text = cancelled ? "Stopped" : offline ? "The Triforce site could not be reached" : "Something went wrong";
FetchNote.Text = cancelled ? "Nothing was changed." : offline ? "Check your internet connection, then try again." : e.Message;
FetchNote.Foreground = Brush(cancelled ? "Text" : "Bad");
FetchStep.Text = "";
@@ -793,6 +796,10 @@ sealed partial class Shell
// (NVIDIA DLSS chosen: its SDK fetched first, only what is missing, and built in; a build and an update alike)
var dlss = DlssChosen;
if (dlss && !args.Contains("--fetch-ngx-sdk")) args.AddRange(new[] { "--fetch-ngx-sdk", "--accept-nvidia-license" });
// (11-15: AMD FSR 4 in every build: its code is built in and AMD's two signed libraries (MIT license) are fetched
// from AMD's repository and put beside the game: nx2/make_game.py --fsr, scripts/fsr_sdk.py. The Upscaler row offers
// it only on a card AMD's library says runs it)
if (!args.Contains("--fsr") && !args.Contains("--no-fsr")) args.Add("--fsr");
Program.Log("build: make_game.py " + string.Join(" ", args) + " (tools " + tools.Root + ")");
runner = new Runner(tools, args, dlss ? NgxSdk : null);
ShowClock();