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

@@ -0,0 +1,98 @@
"""Linux playback discovery for the Output device row, with a fake SDL device list; no hardware or game.
python -I -B tests/test_linux_audio_output.py --cc clang
host/audio_output_devices.c's list and its resolve take Linux's devices from host/hos_sdl.c (hos_sdl_output_*), and the
waveOut stand-in (host/posix/win32_posix.c) opens the one chosen, closes its stream with the handle and says when it is
gone. The SDL side itself is a host test (real PipeWire/PulseAudio/ALSA playback).
"""
import argparse
from pathlib import Path
import subprocess
import sys
import tempfile
RUN_ALL_ARGS = ["--cc", "clang"]
ROOT = Path(__file__).resolve().parents[1]
PREFIX = r'''
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
#include <string.h>
#undef _WIN32
#include "audio_output_devices.h"
typedef int SRWLOCK;
typedef unsigned long DWORD;
#define MAX_PATH 260
#define SRWLOCK_INIT 0
static void AcquireSRWLockExclusive(SRWLOCK *p) { assert(!*p); *p=1; }
static void ReleaseSRWLockExclusive(SRWLOCK *p) { assert(*p); *p=0; }
#define AcquireSRWLockShared AcquireSRWLockExclusive
#define ReleaseSRWLockShared ReleaseSRWLockExclusive
static DWORD hos_game_path_a(char *path, DWORD n) { (void)n; path[0] = 0; return 0; }
extern int hos_sdl_output_count(void) __attribute__((weak));
extern int hos_sdl_output_info(int, char *, int, char *, int) __attribute__((weak));
extern int hos_sdl_output_resolve(const char *) __attribute__((weak));
'''
METADATA = r'''
int hos_sdl_output_count(void) { return 2; }
int hos_sdl_output_info(int i, char *id, int cap, char *name, int ncap) {
if (i < 0 || i > 1) return 0;
snprintf(id,cap,"sdl:pipewire:%s",i ? "Headphones" : "Speakers");
snprintf(name,ncap,"%s",i ? "Headphones" : "Speakers");
return 1;
}
int hos_sdl_output_resolve(const char *id) { return !strcmp(id,"sdl:pipewire:Headphones") ? 7 : -1; }
int main(void) {
int count=hos_audio_output_count();
printf("Linux playback count: %d (expected 2)\n",count); fflush(stdout);
assert(count==2);
char id[2048], name[1024], small[2];
assert(hos_audio_output_info(1,id,sizeof id,name,sizeof name));
assert(!strcmp(name,"Headphones") && !strcmp(id,"sdl:pipewire:Headphones"));
assert(!hos_audio_output_info(2,id,sizeof id,name,sizeof name));
assert(!hos_audio_output_info(1,small,sizeof small,name,sizeof name));
assert(hos_audio_output_resolve("sdl:pipewire:Headphones")==7);
assert(hos_audio_output_resolve("missing")==-1);
puts("PASS Linux metadata bridge");
return 0;
}
'''
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--cc', default='clang')
args = parser.parse_args()
devices = (ROOT/'host/audio_output_devices.c').read_text(encoding='utf-8')
devices = devices[devices.index('typedef struct { char *id, *name; } OutputDevice;'):]
# (the stand-in's open, write and close: by the device, the stream closed with the handle, a gone device told)
posix = (ROOT/'host/posix/win32_posix.c').read_text(encoding='utf-8')
wave = posix[posix.index("/* ---- waveOut on SDL's audio"):]
opened = wave[wave.index('MMRESULT waveOutOpen'):wave.index('MMRESULT waveOutPrepareHeader')]
assert 'hos_sdl_audio_open_device(device,' in opened, 'waveOutOpen opens the device it is given'
write = wave[wave.index('MMRESULT waveOutWrite'):wave.index('MMRESULT waveOutReset')]
assert 'if (!hos_sdl_audio_alive(w->audio)) return MMSYSERR_NODRIVER;' in write
close = wave[wave.index('MMRESULT waveOutClose'):]
assert close.index('hos_sdl_audio_close(w->audio)') < close.index('pthread_mutex_destroy(&w->mu)') < close.index('free(w)')
sdl = (ROOT/'host/hos_sdl.c').read_text(encoding='utf-8')
channels = sdl[sdl.index('int hos_sdl_audio_channels(void) {'):]
channels = channels[:channels.index('\n}')]
assert 'playback_chosen_channels()' in channels, "the chosen device's channels on Linux"
with tempfile.TemporaryDirectory(prefix='linux-audio-output-') as temporary:
folder = Path(temporary)
c = folder/'metadata.c'
exe = folder/('metadata' + ('.exe' if sys.platform == 'win32' else ''))
c.write_text(PREFIX + devices + METADATA, encoding='utf-8')
subprocess.run([args.cc, '-std=c11', '-Wall', '-Wextra', '-Werror', '-Wno-unused-function', '-I', str(ROOT/'host'),
str(c), '-o', str(exe)], check=True, timeout=90)
subprocess.run([str(exe)], check=True, timeout=20)
print('ok')
return 0
if __name__ == '__main__':
sys.exit(main())