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;
}