A new setting starts off: on by default, Steam Deck (1280x800) and other 16:10, 3:2 and 4:3 players would get a
wider view than the game's with a GPU cost nobody measured on the weakest target. The toggle is live, as
resolution.c res_fov_live re-reads it. res_fov_live starts from the game's own view (shown_vp 0), so at 16:9 the
first present writes nothing and logs nothing, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plugin built with default visibility calls its own exported functions
through its PLT. Challenge Mode's Enemy Health Regeneration plugin
(exefs subsdk8) does so for the std::vector<const char*> constructor it
carries, and the service run counted that as a library call outside the
reviewed list, so the plugin was refused and its whole mod stayed off.
runtime/loader.c resolve binds such a JUMP_SLOT straight to the plugin's
own definition (a host override still wins and stays counted), and
tools/exefs_plugins.py plt_imports maps the PLT stub to that code, so
the reach check follows into it instead of naming an import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gameplay_tweaks.c map_zoom_allowed zooms only on the map that menu_cursor.c finds in eui's open screens, and with menu_cursor = 0 that scan did not run, so the scroll wheel neither zoomed the map nor did the mouse move its cursor, with gameplay_map_zoom = 1 set. menu_cursor_poll now scans for the map while that zoom is on, as it scans for the dialogue box for dialogue_click; the pointer, the menus, the strips and the camera stay off with menu_cursor = 0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #971, SDL passes gamepad events to the game while its window has no focus (SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS). On Linux the window is SDL's, and under Steam the focus goes to Steam's overlay and menus while they are open (the Quick Access menu in SteamOS's Game Mode): the game took the presses meant for them too, which 0.4.1 did not.
The new setting pad_background (auto, 1, 0; read at start) decides the hint. auto, the default, keeps it on unless Steam started the game (SteamGameId or SteamOverlayGameId in the environment, set for Steam games and non-Steam shortcuts alike); 1 keeps the gamepad playing behind other windows under Steam too, 0 pauses it everywhere. input_map.c input_pad_background_pick holds the decision and cfg_probe checks it. On Windows the game window is not SDL's, and nothing changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A game resolution whose shape the fifteen listed sizes did not cover (13:6 on a phone streamed to, 4:3) drew 16:9 with bars: neither the setup's Shapes step (installer/screens.py shape_size) nor the game's background generator (runtime/romfs.c romfs_folders_prepare) made a layout for it, though tools/ultrawide_layout.py handles any aspect ratio and runtime/romfs.c overlay_init already loads a folder of the exact size. cfg.c cfg_shape_size and screens.py shape_size now give an unlisted shape from 4:3 to 32:9 its own size, so both make romfs-patches-<w>x<h> for it; a display of an unlisted shape still keeps the 1920x1080 default and gets no folder. The list gains 4:3 (1440x1080, 1600x1200, 2048x1536, 2732x2048) and 19.5:9 and 20:9 phone sizes (2340x1080, 3120x1440, 2400x1080, 3200x1440), in the menu's game resolution row too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The expect line of such a word says `* *` (tools/exefs_plugins.py plugin_lines), recomp/patches.py carries it into
RT_PLUGIN_WRITES as a flag, and runtime/plugin_init.c check_writes accepts any value there through
runtime/plugin_writes.h plugin_write_find. Hook branches in .text and pointers into a plugin's .text keep the exact
match. Zonai Fieldworks' Self Recall takes its storage off a pool size at main+0x3ad6eb8 that grows with the texture
heap of render_scale, so its plugin went off at every start with a grown heap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #1402 reports a GPU hang on Intel (Mesa ANV) right after the startup logo on game 1.2.1, which the pass marks put in one dispatch of cs 75be3722f62cb67e. #994 reports the same freeze on Intel's Windows driver with 1.2.1, while 1.4.3 boots. The cause is not found yet. skip_cs takes the named dispatches out so a tester can confirm the shader is the cause and get past it, at the cost of what the shader would write. An id shorter than 16 hex digits matches every shader whose id starts with it. The log names each listed id and the first dispatch skipped of each. The setting is registered in cfg.c, documented as Risky in docs/settings.md, and docs/agents/symptoms.md gets a row for the freeze.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the unwritten-read rule every read that stays merged comes from a draw that samples a target it also writes,
the case Savage Wind runs the same way on every GPU. Shrine on the RDNA2 iGPU (AMD Windows driver, 1080p): passes
581 -> 128 a frame, GPU time unchanged (37.2 ms off, 38.0 and 36.5 ms on), the picture the same. PR #1237 measured
the waterfall on RADV at 1105 -> 117 passes and GPU 8.3 -> 4.1 ms, and an RTX 4080 shrine at +3% mean fps with the
1% low 83 -> 98. barrier_merge = 0 brings back a full barrier at each such Barrier.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
spirv_demote turned every OpKill inside a selection into OpDemoteToHelperInvocation on AMD's Windows driver. A
demoted fragment runs the rest of the shader, so every alpha-tested draw (grass, foliage, hair) paid for its
discarded pixels. The cloud fringe of #164 came from OpImageQueryLod after the discard. Now a discard is demoted only
when an OpImageQueryLod, an explicit derivative or a function call follows it in its function; the rest keep the
plain discard, as before 0.4.1. On the field save 1 of 128 shaders with a discard is demoted, and the picture keeps
the fix.
demote has a row in the settings table and a description in totk.ini.example, so demote = 0 or 1 in the ini no
longer logs an unknown key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The option draws the particles and the dust over the upscaler's picture; the fog layer and the clouds' composite
before them decide sky or surface from the jittered scene depth and belong under the upscaler with either engine.
DLSS is not yet checked on NVIDIA hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The upscaler ran at the first pass into the light target after the lighting. The fog layer and the half-size clouds'
composite that follow it decide per pixel from the scene depth, still jittered, whether a pixel is sky; over the
upscaler's steady picture a sky pixel on a silhouette took the surface's side in some frames and got no clouds there,
a bright dot that the upscaler never resolved. effects_point now waits for the first full-size pass without depth into
the light target and runs before the next pass with a depth (the particles), behind TOTK_DLAA_FX_COMPOSITE: on by
default with FSR, off with DLSS until measured on NVIDIA hardware. Frame dumps at 2560x1440 with FSR 4: ridge pixels
brighter than both sides fall from 34 % of the columns to 15 %.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #1369: the settings row still said 64 KiB though LAZY_CHUNK is 1 MiB, and two changes ran for every player.
ipc.c and svc.c readable() ask the OS again unless TOTK_HEAP_LAZY is on (mem_heap_lazy), and fs_host.c write_file calls
mem_heap_commit, which commits the buffer's reserved heap chunks in lazy mode and does nothing otherwise, instead of
mem_thaw.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the switch off, the draw path now pays one load of vk_caps.null_attach per gkey_fill and per empty slot in
target_wmask instead of a call into vk_exec.c, and vk_exec_pass_begin one flag test per pass. The switch is read in
vk_caps_init, before the pipeline prewarm makes the first key.
With it on, only empty slots below the pass's last target get a dummy, which is where the pipelines'
colorAttachmentCount ends (vk_pipeline.c target_count); a pass without colour targets keeps none, so a depth-only or
attachment-free pass never gets a 16384-wide image. All empty slots of a pass share one view, and an image serves
every pass it covers with its sample count: 1.4.3 at 1600x896 makes one image of 1.75 MiB instead of three. The
images are destroyed in destroy_all before the allocator goes, and the log line gives each one's size.
The settings row no longer states that empty slots caused #1343: the dumps do not show it. totk.ini.example gets
the player entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
restbl_cache now defaults to 0. Its key adds the path and identity of the running exe (a dev or source build that
changes the merge code keeps the VERSION string, so the port version alone served the old table), the RomFS image's
identity, the number of shipped tables and the overlays of the port's own folders, which the old filter left out.
The table's SHA-256 is taken from the bytes the build wrote instead of a read back from disk. A miss logs why the
table is built again. totk.ini.example and docs/settings.md describe the setting, its default and what the key does
not see (a rewrite that keeps size and write time).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A player who had reflex = on on an AMD GPU got nothing from it before #1416 and would have got Anti-Lag after an
update without asking for it. on and boost now enable NVIDIA Reflex alone and log the same line as before when it is
missing; auto picks Reflex or Anti-Lag. The Anti-Lag entry point loads with atomics, since the game thread and the
present thread both make the first call, and the TOTK_TRACE=perf latency line keeps its old text unless Anti-Lag is
on. The menu description, docs/settings.md and totk.ini.example say which value turns on what.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FSR 4 is a fourth engine of the scene upscaler beside DLSS and FSR 3.1 and takes their frame point, jitter, per-object
motion vectors, mip bias, fsr_sharpness, FXAA skip and dynamic resolution hold. The PR's dlaa_backend setting, its
FSR 3 through the DLL and its separate Upscalers row are left out: dev builds FSR 3.1 from the SDK 1.1.4 sources.
Checked on an RX 9070: FSR 4.1.2 at quality, 1280x720 -> 1920x1080, picture clean; without the DLLs the upscaler stays
off with a log line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The barrier costs about 5% of the frame rate on an Iris Xe and was only tested there. TOTK_ANV_VS_BARRIER and anv_vs_barrier still force it on with 1 and off with 0. docs/settings.md says what it fixes, what it costs and that only Intel GPUs with Mesa ANV on Linux are affected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PR's FSR 4 path (runtime/vk_ffx.c over AMD's FSR SDK 2.4 signed libraries, ffx_api_min.h, the cooperative
matrix and float8 device extensions in vk_device.c), its setup step that downloads amd_fidelityfx_loader_vk.dll and
amd_fidelityfx_upscaler_vk.dll, its notices and the FXAA copy shader hash 0x9d065204aac9766b now serve dev's own
scene upscaler as UPSCALER_FSR4. FSR 4 goes through vk_dlaa.c fsr_evaluate beside FSR 3.1: the same frame point,
jitter, motion vectors with the per-object pass, camera from vk_fg_camera, mip bias, fsr_sharpness, FXAA skip and
dynamic resolution hold.
Dropped from the PR: the dlaa_backend setting, FSR 3 through the DLL and the separate Upscalers row. vk_ffx.c pins
FSR 4 only; a device the libraries offer no FSR 4 for runs with the upscaler off and the menu says so. It keeps one
context per output size with dynamic resolution, like vk_fsr3.cpp, waits on the SDK's ring depth and is released
before the device goes. The menu's scene upscaler row gets "AMD FSR 4" (Windows; marked when the libraries or the
GPU are missing). The setup's FSR box and its strings are in all eleven installer catalogs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zonai Fieldworks was refused at several steps; each is now handled:
1. The start-up asked GetInfo 6, 7, 16 and 17 and SetHeapSize; runtime/plugin_init.c serves them.
2. Its start-up calls main where the lift has no function start. The tool names those addresses (--entries-out) and
the installer lifts again with them as `entry` lines, up to four rounds (installer/steps.py PLUGIN_ENTRY_ROUNDS).
3. Branch hooks into the middle of game functions (far-jump veneers) and pointer swaps in main's data are accepted
hook kinds; the veneer targets seed the plugin's lift, and an Orig trampoline counts as a seed.
4. Code the start-up writes into the plugin's own .text (hook pads it switches to during play) is found by comparing
the image before and after the init, and seeds the lift (init_code). Without it the game stopped with "no function
at guest pc" when a feature switched on.
5. recomp/gen.py: a branch-out alternative on a flag-writing site leaves with the flags from before the site; an inline
hook may sit on a blr.
6. nn::fs::MountSdCard mounts <profile>/sdcard (runtime/fs_host.c), and nn::settings language codes are answered
(runtime/ov_system.c).
The import check now also allows what the game's main imports (--exefs, game_imports): the game runs on those paths,
so the runtime serves them. Left out: nn::ro, the C runtime start, the thread-local allocator hook and the shader
compiler. Break in code the hooks reach is allowed (an abort ends the game with the reason, as on the Switch), and
RenameFile, DeleteDirectoryRecursively, Commit and Unmount join the SD card calls. Checked: Zonai Fieldworks, The Second
Quest, Challenge Mode and Material Columns on 1.4.3, Full Inventory Expansion, Quick Weapon Durability and Magic of the
Kingdom on 1.2.1 accepted; UltraCam's init still crashes its service run. Plain lift unchanged; probes 4/4 on both
versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reflex setting gains an auto value. With auto, on or boost the device uses NVIDIA Reflex when the driver has VK_NV_low_latency2, otherwise AMD Anti-Lag 2 when it has VK_AMD_anti_lag (Mesa RADV, AMD's Windows driver); with neither it does nothing. Anti-Lag marks the INPUT stage where the window texture is acquired and the PRESENT stage just before vkQueuePresentKHR, with the pacer's frame limit as maxFPS. The default stays off. The menu row is renamed Low Latency in all four languages.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
On an HD 520 with Intel's legacy Windows driver (101.2125, Vulkan 1.3.215) the game faults inside vkCmdBeginRendering
(igvk64.dll+0x5cfab2/+0x5cfab9, frames +0x5c42dd and +0x548235) right after the logo, with the recorder on or off and
with import or mirror memory. The driver reads an attachment entry of the pass that is null. vk_exec_pass_begin leaves
imageView VK_NULL_HANDLE in every colour slot without a target, which Vulkan allows, and the first pass of a boot that
has one is the 1600x896 scene G-buffer pass (slots 2 and 4 empty), the render area of the reported crash.
With TOTK_NULL_ATTACH=1 such a slot gets a view of a dummy R8_UNORM image of the pass's size, layer and sample count
(one per shape, made once, GENERAL, DONT_CARE load and store), and the pipelines name that format for it with the writes
masked off (vk_pipeline.c gkey_fill, target_wmask), so views and pipelines agree. Off by default: nothing changes, and
pipeline keys stay as they were. Untested on the affected driver; Iris Xe (101.7092) plays the same with it on.