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

@@ -32,6 +32,7 @@
#else
#include "hos_sdl.h"
#endif
#include "../gpu/vk/vk_api.h" /* (HOS_OPT_VOLUME: the menu's Master volume) */
#include "hos_paths.h" /* (the game folder: triforce_options.ini, au_menu_output) */
void hos_system_event_init(uint64_t key, int autoclear);
@@ -454,6 +455,19 @@ static int mix_depth(int i, int guard) { /* how many sub mixes lie between thi
return 1 + mix_depth(mixes[i].dest, guard + 1);
}
/* (Triforce) The menu's Master volume as a gain, 0 to 1: the row while the renderer answers, the options file's
master_volume= before it does (the title's first sounds), 1 without either. HOS_AUDIO_VOLUME=<0-100> over both */
int rx_option(int id, int otherwise);
int hos_ini_option(const char *key, int otherwise);
static float master_volume(void) {
static int from_file = -1, from_env = -2;
if (from_env == -2) from_env = getenv("HOS_AUDIO_VOLUME") ? atoi(getenv("HOS_AUDIO_VOLUME")) : -1;
if (from_file < 0) from_file = hos_ini_option("master_volume", 100);
int v = from_env >= 0 ? from_env : rx_option(HOS_OPT_VOLUME, from_file);
v = v < 0 ? 0 : v > 100 ? 100 : v;
return (float)v / 100.0f;
}
static void render_frame(int16_t *pcm, int channels) { /* 240 frames of the device's 2 or 6 channels */
for (int m = 0; m < MAX_MIXES; m++)
if (mixes[m].used) {
@@ -575,6 +589,20 @@ static void render_frame(int16_t *pcm, int channels) { /* 240 frames of the de
lim_env = want < lim_env ? want : lim_env + (want - lim_env) * 0.0004f;
for (int ch = 0; ch < nch; ch++) out[ch][i] *= lim_in * lim_env * lim_out;
}
{ /* (Triforce) the Insert menu's Master volume, over everything the game mixed and after the limiter, so the
limiter works on the game's own levels. A change is ramped across the frame (5 ms): no click */
static float master_now = -1.0f;
const float to = master_volume();
if (master_now < 0.0f) master_now = to;
if (master_now != 1.0f || to != 1.0f) {
const float step = (to - master_now) / FRAME;
for (int i = 0; i < FRAME; i++) {
const float g = master_now + step * (float)(i + 1);
for (int ch = 0; ch < nch; ch++) out[ch][i] *= g;
}
}
master_now = to;
}
for (int i = 0; i < FRAME; i++)
for (int ch = 0; ch < nch; ch++) {
float a = out[ch][i] * 32767.0f;