Triforce v0.8.0

Evil HD (SMAA Ultra, 16x filtering, full textures, ambient occlusion with bounce light, sunlight shafts, foliage drawn 4x as far, the remastered texture pack's loader and the launcher's download of it), FSR 3.1 frame generation for every GPU, Intel XeSS, FSR 4 model choice, ReShade presets, Auto (this PC), HUD placement, the options menu in 13 languages, a second input for every control, hold to toggle, DualSense speaker and haptics, NFC from the player's own dumps, the above-60 fps game fixes, the Debug tab's flight and Inventory fixes, the launcher's full settings, and over 250 fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-25 10:21:32 -06:00
parent 861702476a
commit 4fa4f9188b
881 changed files with 179428 additions and 15581 deletions

View File

@@ -82,6 +82,25 @@ void hos_mem_init(uint64_t image_end) {
uint64_t hos_region_floor(void) { return region_floor; }
/* (Triforce, the control bridge: host/control.c, HOS_CONTROL_MEM) Whether [addr, addr + size) is wholly inside memory the
runtime has handed out for the game: the image, the system region in use (our own objects), the heap, or an address
region (not one being freed). A read or write outside it is refused, never faulted. The classes it may fall in (0 none): */
enum { HOS_MEM_IMAGE = 1, HOS_MEM_SYSTEM, HOS_MEM_HEAP, HOS_MEM_REGION };
int hos_mem_region(uint64_t addr, uint64_t size) {
uint64_t end;
if (!size || __builtin_add_overflow(addr, size, &end) || !hos_guest_range(addr, size)) return 0; /* (the window first) */
if (addr >= hos_image_base && end <= hos_image_end) return HOS_MEM_IMAGE;
int cls = 0;
LOCK();
if (addr >= HOS_SYSTEM_BASE && end <= sys_next) cls = HOS_MEM_SYSTEM;
else if (addr >= HOS_HEAP_BASE && end <= HOS_HEAP_BASE + hos_heap_size) cls = HOS_MEM_HEAP;
else
for (int i = 0; i < nregions && !cls; i++)
if (!regions[i].freeing && addr >= regions[i].addr && end <= regions[i].addr + regions[i].size) cls = HOS_MEM_REGION;
UNLOCK();
return cls;
}
uint64_t hos_sys_alloc(uint64_t size, uint64_t align) {
LOCK();
uint64_t a = (sys_next + align - 1) & ~(align - 1);
@@ -281,6 +300,20 @@ static int64_t region_frees_bare; /* ((Triforce) regions freed without a disca
/* ((Triforce, 11-22, OS-40) the frees that gave their core up for the discard (HOS_DISCARD_KEEP_CORE=0), and how long the
longest waited for its core back; a line every 1,000) */
static int64_t region_frees_away, region_back_longest_ns;
/* ((Triforce) for host/prompts.c's live part: where the game keeps its resources) the address regions held (hos_region_alloc's
and the game's own; not one being freed), at most cap of them into out ({start, end}); how many there are */
int hos_regions(uint64_t (*out)[2], int cap) {
LOCK();
int n = 0;
for (int i = 0; i < nregions; i++) {
if (regions[i].freeing) continue;
if (n < cap) out[n][0] = regions[i].addr, out[n][1] = regions[i].addr + regions[i].size;
n++;
}
UNLOCK();
return n;
}
void hos_region_free(uint64_t addr) {
uint64_t freed_size = 0;
int game = 0, away = 0;