Triforce v0.8.5

A Randomizer page in the launcher, a new title screen with Mods and Save Select tabs, scaling changes applied in game, the Jabu-Jabu bars fixed, renderer frame-time work and the brightness-flash fix, and fixes from the 0.8.4 reports.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-28 10:54:41 -06:00
parent 2df08c751e
commit b527e29adb
203 changed files with 18821 additions and 2051 deletions

View File

@@ -127,6 +127,8 @@ public sealed class NupSource : IGameSource
string Name(uint offset, uint count)
{
// ((Triforce, 11-26) a name inside the strings area and of a name's length: a damaged index made each read a megabyte)
if (count > 1024 || stringsAt + (long)offset + count > index.Capacity) throw new InvalidDataException("the package's index names something outside its names");
var bytes = new byte[count];
index.ReadArray(stringsAt + offset, bytes, 0, (int)count);
return Encoding.UTF8.GetString(bytes);
@@ -145,6 +147,10 @@ public sealed class NupSource : IGameSource
return known;
var first = index.ReadUInt32(dirsAt + 24L * dir + 8);
var count = index.ReadUInt32(dirsAt + 24L * dir + 12);
// ((Triforce, 11-26) the children inside the children's table (between kidsAt and the names), before anything is
// allocated for them: a 300-byte file asked for tens of GB here)
if ((long)first + count > (stringsAt - kidsAt) / 4 || count > dirCount + fileCount)
throw new InvalidDataException("the package's index lists children outside its table");
var kids = new uint[count];
index.ReadArray(kidsAt + 4L * first, kids, 0, (int)count);
var names = new Dictionary<string, uint>((int)count, StringComparer.Ordinal);
@@ -241,6 +247,7 @@ public sealed class NupSource : IGameSource
if (stored <= 0 || stored > length - offset)
throw new InvalidDataException(romfsPath + ": its compressed data runs past the end of the package");
var frame = ReadAt(offset, (int)stored);
if (size > Zs.MaxUnpacked) throw new InvalidDataException(romfsPath + ": larger than any file of the game");
var output = new byte[size];
using var z = new Decompressor();
if (z.Unwrap(frame, output) != size)