diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 3e18c860..77c4e61b 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -27,7 +27,7 @@ Code copied or adapted from another project is listed here with its source, the | deko3d block-linear image layout, as ported in MacNativeGames' `nvn_tex.c` (Apple parts dropped, layout math unchanged; licence text in `games/totk/third_party/d2r_gfx/LICENSE.deko3d`, reproduced in the file header) | https://github.com/devkitPro/deko3d (`source/dk_image.cpp`), via MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/totk/third_party/d2r_gfx/gfx/nvn/nvn_tex.c`, `nvn_tex.h`), Copyright (C) 2018-2020 fincs | zlib | `runtime/nvn_tex.c`, `runtime/nvn_tex.h` | | MacNativeGames texture auto-layout goldens (40 original-SDK size and block-height cases) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/totk/tests/texture_auto_layout/probe.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/nvn_tex_probe.c`; `runtime/nvn_probe.c` (four of the cases, through the procs) | | MacNativeGames block-linear deswizzler (address function; copy loop split out as `tex_bl_copy`) | https://github.com/ly05010419/MacNativeGames @ `b75be8cfa704df3701e86130c8ced268e79d6b11` (`games/totk/third_party/d2r_gfx/gfx/tex/nvn_deswizzle.c`), Copyright (c) 2026 jhaizhou | MIT | `runtime/tex_deswizzle.c`, `runtime/tex.h` | -| SDL 3.4.18, dynamic link, `SDL3.dll` copied next to `totk.exe`. Developer builds use the MSYS2 build (`mingw-w64-ucrt-x86_64-sdl3`, which imports `libiconv-2.dll`, LGPL-2.1, unmodified, copied beside it); the installer release ships the upstream release `SDL3-3.4.18-win32-x64.zip`, which imports no libiconv | https://libsdl.org, Copyright (c) 1997-2026 Sam Lantinga | zlib | `runtime/input_win.c` (gamepad input, rumble, gyro and accelerometer) | +| SDL 3.4.20, dynamic link, `SDL3.dll` copied next to `totk.exe`. Developer builds use the MSYS2 build (`mingw-w64-ucrt-x86_64-sdl3`, which imports `libiconv-2.dll`, LGPL-2.1, unmodified, copied beside it); the installer release ships the upstream release `SDL3-3.4.20-win32-x64.zip`, which imports no libiconv | https://libsdl.org, Copyright (c) 1997-2026 Sam Lantinga | zlib | `runtime/input_win.c` (gamepad input, rumble, gyro and accelerometer) | | libopus (MSYS2 `mingw-w64-ucrt-x86_64-opus`), dynamic link, `libopus-0.dll` copied next to `totk.exe` | https://opus-codec.org, Copyright (c) 2001-2023 Xiph.Org, Skype Limited, Octasic, Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory Maxwell, Mark Borgerding, Erik de Castro Lopo, Mozilla, Amazon | BSD-3-Clause | `runtime/ov_media.c` (nn::codec hardware Opus decoder) | | Dear ImGui 1.91.9 (core and Vulkan back end, unmodified), as vendored by LAS Recomp | https://github.com/ocornut/imgui, via https://github.com/peiikai/LASRecomp @ `da35b83a9611d046a9a681aae668d7085954d37f` (`third_party/imgui/`), Copyright (c) 2014-2025 Omar Cornut | MIT | `runtime/third_party/imgui/` (compiled into `totk.exe` for the in-game menu, `runtime/ui/`) | | SavageWindRecomp settings menu: two-pane option rows (row look, left / right stepping, hold speed-up, description pane), the menu style and tab bar | https://github.com/Revivedx/SavageWindRecomp @ `575ad88e02f9a89a9a885d90039d48af33c982f4` (`runtime/ui/option_rows.mm`, `runtime/ui/menu.mm`), Copyright (c) 2026 Revivedx and the Savage Wind Recomp contributors, Copyright (c) 2026 Peiikai | MIT | `runtime/ui/option_rows.cpp`, `runtime/ui/option_rows.h`, `runtime/ui/menu.cpp` | @@ -74,7 +74,7 @@ These tools run on the developer's or player's machine during the build. They ar | CPython 3.14.9 embeddable package, with `tkinter` and Tcl/Tk 9.0.4 taken from the python.org 3.14.9 installer's component MSI (unpacked, never run); includes `vcruntime140*.dll` (Microsoft, redistributable with Python), OpenSSL, libffi, SQLite, zlib, libtommath | https://www.python.org/downloads/release/python-3149/ | PSF-2.0 (Tcl/Tk: Tcl/Tk licence, BSD-style) | `python/` | | numpy 2.5.4 (with its bundled OpenBLAS), lz4 4.4.5, cryptography 50.0.2 (with its bundled OpenSSL), fontTools 4.68.0, cffi 2.1.1, pycparser 3.11 | PyPI binary wheels, pins in `tools/requirements-installer.txt` | BSD-3-Clause; lz4 BSD-3-Clause; cryptography Apache-2.0 OR BSD-3-Clause; fontTools MIT; cffi MIT; pycparser BSD-3-Clause | `python/Lib/site-packages/` | | llvm-mingw 20261020 (LLVM/Clang/LLD 23, mingw-w64, libc++, libunwind, compiler-rt), x86_64 subset | https://github.com/mstorsjo/llvm-mingw/releases/tag/20261020 | Apache-2.0 with LLVM exception; mingw-w64 ZPL-2.1/BSD/public domain; libc++ and libunwind Apache-2.0 with LLVM exception and MIT/UIUC; winpthreads MIT | `llvm/` | -| SDL 3.4.18 upstream Windows release (`SDL3.dll`) and mingw development package (headers, `libSDL3.dll.a`) | https://github.com/libsdl-org/SDL/releases/tag/release-3.4.18 | zlib | `bin/SDL3.dll`, `runtime/deps/` | +| SDL 3.4.20 upstream Windows release (`SDL3.dll`) and mingw development package (headers, `libSDL3.dll.a`) | https://github.com/libsdl-org/SDL/releases/tag/release-3.4.20 | zlib | `bin/SDL3.dll`, `runtime/deps/` | | libopus 1.6.1 (MSYS2 `mingw-w64-ucrt-x86_64-opus` 1.6.1-2; `libopus-0.dll` imports only KERNEL32 and the UCRT api-ms-win-crt DLLs), headers and import library | https://repo.msys2.org/mingw/ucrt64/ | BSD-3-Clause | `bin/libopus-0.dll`, `runtime/deps/` | | libvpx 1.17.0 (MSYS2 `mingw-w64-ucrt-x86_64-libvpx` 1.17.0-1), headers and static library compiled into `totk.exe`; `libvpx-LICENSE.txt` and `libvpx-PATENTS.txt` come from the v1.17.0 source tag | https://github.com/webmproject/libvpx | BSD-3-Clause with the WebM patent grant | `runtime/deps/`, `licenses/` | | Zstandard 1.5.7 (MSYS2 `mingw-w64-ucrt-x86_64-zstd` 1.5.7-2), headers and static library compiled into `totk.exe`; `zstd-LICENSE.txt` from the package | https://github.com/facebook/zstd | BSD-3-Clause | `runtime/deps/`, `licenses/` | diff --git a/docs/building.md b/docs/building.md index 0c89a0fa..ac1f7c09 100644 --- a/docs/building.md +++ b/docs/building.md @@ -246,7 +246,9 @@ files); a change to the settings passes `totk.exe --probe-cfg` and `python tests when a setting is described neither in `totk.ini.example` nor in [settings.md](settings.md). A change to the mods' ExeFS patches (`tools/exefs_patches.py`, `runtime/mods.c`, the `folded.txt` of `recomp/gen.py`) passes `.venv\Scripts\python tests\exefs_patches_test.py`, which makes its own modules and runs `gen.py` on one with a jump -table (no game files), and `totk.exe --probe-mods`. +table (no game files), and `totk.exe --probe-mods`. A change to the cheat VM or the cheat opcode tables +(`runtime/cheats.c`, `tools/cheats.py`) passes `.venv\Scripts\python tests\cheats_vm_check.py`, which runs both on +cheats of its own with clang from PATH (`--cc` names another). The lifter (`recomp/`) and the CPU headers (`runtime/cpu.h`, `runtime/simd.h`) are checked against Unicorn. Every lifter change passes these, all run with `.venv`: diff --git a/docs/cheats.md b/docs/cheats.md index 93fd61ef..5fa090bc 100644 --- a/docs/cheats.md +++ b/docs/cheats.md @@ -58,7 +58,7 @@ The game's code is compiled ahead of time, so a cheat cannot write new instructi |---|---|---| | code | Opcode 0 writes into main's code | Built into the game at setup as a patch set (`recomp/patches.py`); switches at once. | | key | Code writes inside a button condition (`8` mask, writes, `21` else, the original words, `20`) | A patch set that is on while the cheat is on and the buttons are held. | -| data | Writes data only: heap, main's data, pointer chains, button conditions | Runs in a cheat VM after dmnt's, opcodes 0 to A, every presented frame while on. | +| data | Writes data only: heap, main's data, pointer chains, button conditions | Runs in a cheat VM after dmnt's, opcodes 0 to A and C0 to C3, every presented frame while on. | | master | `{name}` with code writes | A patch set that is always on. | | restore | Writes back only the game's original instructions | Not needed: switching a cheat off restores them. Greyed out. | @@ -66,7 +66,7 @@ A cheat whose code writes call or jump into a code cave the cheat writes itself Not supported, and shown greyed out with the reason: -- the 0xC and 0xF opcode extensions; +- opcode C4 (extended button condition) and the 0xF extensions (FF0 pause, FF1 resume, FFF debug log); - opcode 5 with a register offset; - code writes mixed with other opcodes, except the button pattern above; - code writes that change the CPU flags differently from the game's instruction, or code caves with branches or pc-relative instructions. diff --git a/runtime/cheats.c b/runtime/cheats.c index 53f1d6f3..07862a18 100644 --- a/runtime/cheats.c +++ b/runtime/cheats.c @@ -10,8 +10,9 @@ // (tools/cheats.py has the format). A cheat whose status line is missing or has another content hash was added or // edited after the build: a data cheat runs anyway, a code cheat waits for the setup to run again. // -// Data cheats run in a VM after Atmosphere's dmnt cheat VM (opcodes 0-A; the 0xC.. and 0xF.. extensions are not -// supported), every presented frame while their switch is on, with registers cleared before each cheat. Memory is the +// Data cheats run in a VM after Atmosphere's dmnt cheat VM (opcodes 0-A and C0-C3; C4 and the 0xF.. extensions are not +// supported), every presented frame while their switch is on, with registers and saved registers cleared before each +// cheat; the static registers (C3) stay, shared by all cheats, as dmnt keeps them. Memory is the // guest's, mapped at its own addresses: main's image is written with its pages made writable for the write (read-only // data included, as dmnt writes through the debugger), everything else after mem_query says the guest may read or write // it. Buttons are input_poll's HidNpadButton bits, the same as the cheat format's key masks; they read 0 while the menu @@ -53,6 +54,7 @@ static int g_n, g_cap, g_vm; // g_vm: some cheat needs cheats_frame static char g_file[64]; // ".txt" static char g_dir[PLAT_PATH_MAX]; // the folder of totk.exe, with a trailing separator static int g_files; // mods whose file was read +static uint64_t g_static[256]; // C3's static registers: 0x00-0x7F loaded by cheats, 0x80-0xFF stored by them static uint64_t g_main, g_main_size, g_code_end; // main's image; its code with the padding up to .rodata static uint32_t fnv(const char *s, size_t n) { @@ -96,6 +98,11 @@ static int op_len(const uint32_t *w, int left) { case 5: case 7: n = 2; break; case 9: n = 1 + (((f >> 8) & 0xF) ? (width == 8 ? 2 : 1) : 0); break; case 0xA: n = ((f >> 8) & 0xF) == 2 || ((f >> 8) & 0xF) == 4 || ((f >> 8) & 0xF) == 5 ? 2 : 1; break; + case 0xC: // C0TcSX..: an address word for operand types 0 and 2, the value (two words at width 8) for 4 + if (((f >> 24) & 0xF) != 0) n = 1; + else if (((f >> 8) & 0xF) == 0 || ((f >> 8) & 0xF) == 2) n = 2; + else n = ((f >> 8) & 0xF) == 4 ? (((f >> 20) & 0xF) == 8 ? 3 : 2) : 1; + break; default: n = 1; break; } return n <= left ? n : 0; @@ -105,12 +112,15 @@ static int op_len(const uint32_t *w, int left) { static const char *vm_unsupported(const uint32_t *w, char *buf, int n) { uint32_t f = w[0]; int t = f >> 28, width = (f >> 24) & 0xF; - if (t > 0xA || (t == 5 && ((f >> 12) & 0xF) > 1) || (t == 0xA && ((f >> 8) & 0xF) > 5)) { + int ext = f >> 24; // 0xC0-0xC3 run; C0's width is at bits 20-23 and its operand type (at most 5) at bits 8-11 + if (ext == 0xC0) t = -1, width = (f >> 20) & 0xF; + if ((t > 0xA && (ext < 0xC1 || ext > 0xC3)) || (t == -1 && ((f >> 8) & 0xF) > 5) || + (t == 5 && ((f >> 12) & 0xF) > 1) || (t == 0xA && ((f >> 8) & 0xF) > 5)) { snprintf(buf, n, "opcode %08X is not supported", f); return buf; } if ((t <= 1 || t == 5 || t == 6 || t == 7 || t == 9 || t == 0xA) && width != 1 && width != 2 && width != 4 && - width != 8) { + width != 8) { // C0 too (t -1) snprintf(buf, n, "opcode %08X has a bad width", f); return buf; } @@ -227,7 +237,9 @@ static int compare(int cond, uint64_t a, uint64_t b) { } // From i (after a failed condition, or an else reached while running), the opcode to continue at: after the -// matching else (else_ok) or end. +// matching else (else_ok) or end. Conditions 1, 8 and C0 open a block, as in Atmosphere's dmnt +// (stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp, CheatVirtualMachine::SkipConditionalBlock), which steps +// over whole opcodes so that an operand word reading 20000000 ends nothing. static int skip(const uint32_t *w, int n, int i, int else_ok) { int depth = 0; while (i < n) { @@ -236,17 +248,41 @@ static int skip(const uint32_t *w, int n, int i, int else_ok) { uint32_t f = w[i]; int t = f >> 28; i += len; - if (t == 1 || t == 8) depth++; - else if (t == 2 && ((f >> 24) & 0xF) == 0 && depth-- == 0) return i; - else if (t == 2 && depth == 0 && else_ok) return i; + if (t == 1 || t == 8 || f >> 24 == 0xC0) depth++; + else if (t == 2 && ((f >> 24) & 0xF) == 1) { // else; any other 2x000000 ends, as dmnt decodes is_else + if (depth == 0 && else_ok) return i; + } else if (t == 2 && depth-- == 0) { + return i; + } } return n; } static uint64_t imm64(const uint32_t *w) { return (uint64_t)w[0] << 32 | w[1]; } +// C0TcSX..: if register S operand X, all cut to width T; the operand as Atmosphere's dmnt reads it +// (stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp, CheatVirtualMachine::DecodeNextOpcode and Execute, +// BeginRegisterConditionalBlock). X: 0 region M + a, 1 region M + register r, 2 register R + a, 3 register R + +// register r, 4 the value V, 5 register R. M, R at bits 4-7, r and the top bits of a at bits 0-3. A read the guest +// cannot make compares as 0: dmnt ignores the read's result and compares the zero it started with. +static int reg_cond(const uint32_t *w, const uint64_t *r) { + uint32_t f = w[0]; + int width = (f >> 20) & 0xF, cond = (f >> 16) & 0xF, a4 = (f >> 4) & 0xF, a0 = f & 0xF; + uint64_t src = masked(width, r[(f >> 12) & 0xF]), b = 0, addr; + switch ((f >> 8) & 0xF) { // w[1] exists for types 0, 2 and 4 only (op_len) + case 0: addr = region(a4) + (((uint64_t)a0 << 32) | w[1]); break; + case 1: addr = region(a4) + r[a0]; break; + case 2: addr = r[a4] + (((uint64_t)a0 << 32) | w[1]); break; + case 3: addr = r[a4] + r[a0]; break; + case 4: return compare(cond, src, width == 8 ? imm64(w + 1) : masked(width, w[1])); + default: return compare(cond, src, masked(width, r[a4])); + } + if (!rd(addr, width, &b)) b = 0; + return compare(cond, src, b); +} + static void run(const Cheat *c, uint64_t keys) { - uint64_t r[16] = {0}; + uint64_t r[16] = {0}, saved[16] = {0}; int loop[16] = {0}; const uint32_t *w = c->words; int n = c->n, budget = OPS_PER_RUN; @@ -323,6 +359,44 @@ static void run(const Cheat *c, uint64_t keys) { if (z) r[y] += (uint64_t)width; break; } + case 0xC: // C1-C3 as dmnt's Execute runs SaveRestoreRegister(Mask) and ReadWriteStaticRegister + switch (f >> 24) { + case 0xC0: + if (!reg_cond(w + i, r)) { + i = skip(w, n, i + len, 1); + continue; + } + break; + case 0xC1: { // C10D0Sx0: x 0 register D = saved S, 1 saved D = register S, 2 saved D = 0, + // 3 register D = 0 + int d = (f >> 16) & 0xF, s = (f >> 8) & 0xF, op = (f >> 4) & 0xF; + if (op == 1) saved[d] = r[s]; + else if (op == 2) saved[d] = 0; + else if (op == 3) r[d] = 0; + else r[d] = saved[s]; // dmnt restores for any other x too + break; + } + case 0xC2: { // C2x0XXXX: for each register in the mask X, x as C1 with D = S = that register + int op = (f >> 20) & 0xF; + for (int k = 0; k < 16; k++) { + if (!(f >> k & 1)) continue; + if (op == 1) saved[k] = r[k]; + else if (op == 2) saved[k] = 0; + else if (op == 3) r[k] = 0; + else r[k] = saved[k]; + } + break; + } + case 0xC3: { // C3000XXx: static register XX < 0x80 into register x, else register x into it + int s = (f >> 4) & 0xFF; + if (s < 0x80) r[f & 0xF] = g_static[s]; + else g_static[s] = r[f & 0xF]; + break; + } + default: + return; + } + break; default: return; } diff --git a/runtime/ui_text.c b/runtime/ui_text.c index 00afeec6..cead0c3f 100644 --- a/runtime/ui_text.c +++ b/runtime/ui_text.c @@ -440,7 +440,8 @@ static const char *const text_en[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Forces dynamic vertex input on or off; the default depends on the GPU.", [UI_MENU_VK_DYN_A2C] = "Dynamic alpha to coverage", [UI_MENU_VK_DYN_A2C_DESC] = "Forces dynamic alpha to coverage on or off. Default: off on AMD's driver for RDNA 2 and " - "older, which draws characters black with it, on elsewhere.", + "older, which draws characters black with it, and on Intel's Windows driver for " + "integrated GPUs, which draws coloured noise on foliage; on elsewhere.", [UI_MENU_VK_SUBGROUP_PIN] = "Pin subgroup size", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Fixes the shader subgroup size.", [UI_MENU_TRACE] = "Performance log", [UI_MENU_TRACE_DESC] = "Writes frame timings to a file.", [UI_MENU_FLIGHT] = "Flight recorder", @@ -919,8 +920,9 @@ static const char *const text_ru[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Принудительно включает или выключает динамический ввод вершин; по умолчанию зависит от GPU.", [UI_MENU_VK_DYN_A2C] = "Динамический alpha to coverage", [UI_MENU_VK_DYN_A2C_DESC] = "Принудительно включает или выключает динамический alpha to coverage. По умолчанию " - "выключен на драйвере AMD для RDNA 2 и старше, где с ним персонажи чёрные, и включён " - "на остальных.", + "выключен на драйвере AMD для RDNA 2 и старше, где с ним персонажи чёрные, и на " + "драйвере Intel для Windows на встроенных GPU, где с ним цветной шум на листве; " + "включён на остальных.", [UI_MENU_VK_SUBGROUP_PIN] = "Фиксировать размер подгруппы", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Фиксирует размер подгруппы шейдера.", [UI_MENU_TRACE] = "Журнал производительности", [UI_MENU_TRACE_DESC] = "Пишет время кадров в файл.", @@ -1297,7 +1299,9 @@ static const char *const text_pt_br[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "Força a entrada dinâmica de vértices ligada ou desligada; o padrão depende da GPU.", [UI_MENU_VK_DYN_A2C] = "Alpha to coverage dinâmico", [UI_MENU_VK_DYN_A2C_DESC] = "Força o alpha to coverage dinâmico ligado ou desligado. Padrão: desligado no driver da AMD " - "para RDNA 2 e anteriores, que com ele desenha os personagens pretos, ligado nos demais.", + "para RDNA 2 e anteriores, que com ele desenha os personagens pretos, e no driver da " + "Intel para Windows em GPUs integradas, que desenha ruído colorido na folhagem; " + "ligado nos demais.", [UI_MENU_VK_SUBGROUP_PIN] = "Fixar tamanho do subgrupo", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "Fixa o tamanho do subgrupo dos shaders.", [UI_MENU_TRACE] = "Registro de desempenho", [UI_MENU_TRACE_DESC] = "Grava os tempos de quadro num arquivo.", @@ -1930,7 +1934,8 @@ static const char *const text_zh_hans[UI_TEXT_COUNT] = { [UI_MENU_VK_DYN_VERTEX_DESC] = "强制开关动态顶点输入;默认值取决于显卡。", [UI_MENU_VK_DYN_A2C] = "动态 Alpha 覆盖", [UI_MENU_VK_DYN_A2C_DESC] = "强制开关动态 Alpha 覆盖。默认:AMD RDNA 2 及更早的驱动上为关闭," - "开启会导致人物变黑;其他显卡上为开启。", + "开启会导致人物变黑;Intel 集成显卡的 Windows 驱动上也为关闭,开启会使植被出现彩色噪点;" + "其他显卡上为开启。", [UI_MENU_VK_SUBGROUP_PIN] = "固定子群大小", [UI_MENU_VK_SUBGROUP_PIN_DESC] = "固定着色器的子群大小。", [UI_MENU_TRACE] = "性能日志", diff --git a/runtime/vk.h b/runtime/vk.h index ee50f2cd..523cc6da 100644 --- a/runtime/vk.h +++ b/runtime/vk.h @@ -59,9 +59,10 @@ typedef struct { int amd; // an AMD GPU (vendor 0x1002), any driver int amd_sc; // AMD's Windows driver branch for RDNA 1 and 2 ("AMD proprietary shader compiler") int mesa; // a Mesa driver the game runs on: RADV, ANV or NVK + int intel_igpu_win; // Intel's Windows driver on an integrated GPU (UHD, Iris Xe, Core Ultra graphics) } VkCaps; extern VkCaps vk_caps; -void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, mesa +void vk_caps_driver(VkPhysicalDevice p); // first, before vkCreateDevice: vk_caps.amd, amd_sc, mesa, intel_igpu_win void vk_caps_features(VkPhysicalDeviceFeatures *f); // before vkCreateDevice (TOTK_VK_NO_FLOAT64 clears shaderFloat64) // Before vkCreateDevice, with the driver's graphics pipeline library feature and properties: sets vk_caps.gpl, // 1 = enable the extensions (VK_KHR_pipeline_library, VK_EXT_graphics_pipeline_library) and the feature. diff --git a/runtime/vk_caps.c b/runtime/vk_caps.c index 17fe85d3..bc99712e 100644 --- a/runtime/vk_caps.c +++ b/runtime/vk_caps.c @@ -45,6 +45,8 @@ void vk_caps_driver(VkPhysicalDevice p) { vk_caps.amd_sc = drv.driverID == VK_DRIVER_ID_AMD_PROPRIETARY && strstr(drv.driverInfo, "shader compiler"); vk_caps.mesa = drv.driverID == VK_DRIVER_ID_MESA_RADV || drv.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA || drv.driverID == VK_DRIVER_ID_MESA_NVK; + vk_caps.intel_igpu_win = drv.driverID == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS && + p2.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; } // TOTK_GPL=0 turns graphics pipeline libraries off; they are on wherever the driver has fast linking. AMD's RDNA 1/2 diff --git a/runtime/vk_pipeline.c b/runtime/vk_pipeline.c index 21aa2de9..19e71d23 100644 --- a/runtime/vk_pipeline.c +++ b/runtime/vk_pipeline.c @@ -266,13 +266,19 @@ static int ensure_init(void) { } // TOTK_VK_DYN_VERTEX=0/1 forces dynamic vertex input off or on. Default off on Intel's frozen Windows driver for its // older integrated GPUs (UHD 630, Ice Lake: Vulkan 1.3.215 and older), which draws nothing with it; LAS Recomp - // turns it off there for the same reason. + // turns it off there for the same reason. Also off on Intel's current Windows driver for its integrated GPUs + // (vk_caps.intel_igpu_win): on UHD Graphics (i3-1215U, 101.6129; i3-1305U, 101.7088) and Iris Xe (101.7092) it + // drew black rectangles over walls, trees and floating islands, and vk_dyn_vertex = 0 removed them (issues #970, + // #992, #81). Mesa's ANV on the same GPUs keeps it: a report there (#989) had both switches off and its glitch stayed. const char *dv = cfg_get("TOTK_VK_DYN_VERTEX"); // no fixed default: it depends on the GPU, see above int intel_legacy = c->props.vendorID == 0x8086 && c->props.apiVersion <= VK_MAKE_API_VERSION(0, 1, 3, 215); - int dv_on = dv && *dv ? strcmp(dv, "0") != 0 : !intel_legacy; + int dv_on = dv && *dv ? strcmp(dv, "0") != 0 : !intel_legacy && !vk_caps.intel_igpu_win; P.dyn_vi = dv_on && c->has_vertex_input_dynamic_state && PROC(set_vi, "vkCmdSetVertexInputEXT"); if (!dv_on && c->has_vertex_input_dynamic_state) - rt_log("vk_pipeline: dynamic vertex input off (%s)", dv && *dv ? "TOTK_VK_DYN_VERTEX=0" : "Intel's older Windows driver draws nothing with it"); + rt_log("vk_pipeline: dynamic vertex input off (%s)", + dv && *dv ? "TOTK_VK_DYN_VERTEX=0" + : intel_legacy ? "Intel's older Windows driver draws nothing with it" + : "Intel's Windows driver for integrated GPUs draws black patches with it"); if (c->has_eds3) { P.dyn_clamp = e3.extendedDynamicState3DepthClampEnable && P.f_depth_clamp && PROC(set_clamp, "vkCmdSetDepthClampEnableEXT"); P.dyn_poly = e3.extendedDynamicState3PolygonMode && PROC(set_poly, "vkCmdSetPolygonModeEXT"); @@ -285,12 +291,17 @@ static int ensure_init(void) { // RDNA 2 and older (vk_caps.amd_sc), which applies alpha to coverage while the dynamic state says off: on an RX 590 // (24.9.1) TotK, which never turns it on, drew Link and the NPCs with depth but no colour (black silhouettes) and // dithered other surfaces into checkerboards (issue #67, RX 470/570/580). Taken out of the dynamic state, it goes - // into the pipeline key and the characters draw. + // into the pipeline key and the characters draw. Also off on Intel's Windows driver for its integrated GPUs + // (vk_caps.intel_igpu_win): UHD Graphics and Iris Xe drew coloured noise on branches, foliage and wood with it, and + // vk_dyn_a2c = 0 removed it (issues #970, #992, #419). const char *da = cfg_get("TOTK_VK_DYN_A2C"); // no fixed default: it depends on the driver, see above - int da_on = da && *da ? strcmp(da, "0") != 0 : !vk_caps.amd_sc; + int da_on = da && *da ? strcmp(da, "0") != 0 : !vk_caps.amd_sc && !vk_caps.intel_igpu_win; if (!da_on && P.dyn_a2c) { P.dyn_a2c = 0; - rt_log("vk_pipeline: dynamic alpha to coverage off (%s)", da && *da ? "TOTK_VK_DYN_A2C=0" : "AMD's driver for RDNA 2 and older"); + rt_log("vk_pipeline: dynamic alpha to coverage off (%s)", + da && *da ? "TOTK_VK_DYN_A2C=0" + : vk_caps.amd_sc ? "AMD's driver for RDNA 2 and older" + : "Intel's Windows driver for integrated GPUs draws coloured noise with it"); } #undef PROC static const VkDynamicState core[] = { diff --git a/tests/cheats_vm_check.py b/tests/cheats_vm_check.py new file mode 100644 index 00000000..cf42eb43 --- /dev/null +++ b/tests/cheats_vm_check.py @@ -0,0 +1,312 @@ +"""The data cheat VM of runtime/cheats.c and the opcode tables of tools/cheats.py, without game files. + +tools/cheats.py: opcode lengths and which opcodes the VM runs (vm_ok), and how a whole cheat is classified. +runtime/cheats.c, compiled into a harness with stubs for the rest of the runtime: the same cheats are classified and +measured opcode by opcode (op_len must give the lengths tools/cheats.py gives), then run on a fake main image and heap: +opcode C0 with every operand type, width and condition, its else and the skip over a failed block (nested, and with +operand words that look like 20000000), and C1-C3. + +Run with .venv: python tests/cheats_vm_check.py [--cc ] +""" +import argparse +import os +import subprocess +import sys +import tempfile +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +sys.path.insert(0, str(ROOT / 'tools')) +import cheats # noqa: E402 + +# Issue #973: two cheats for 1.1.0 whose only opcode the VM lacked was C046B400 FFFFFFFF (if r[B] as u32 != -1). +REPORTED = ''' +[Zonai Devices 98] +580F0000 04646C60 +580F1000 00000138 +580F1000 000011A8 +300C0000 0000003C +989BF000 +540B1000 00000000 +C046B400 FFFFFFFF +640F1000 00000000 00000062 +21000000 +780F0000 00000008 +20000000 +310C0000 +[All Materials Collected 98] +580F0000 04646C60 +580F1000 00000138 +580F1000 00000F28 +300C0000 000001FE +989BF000 +540B1000 00000000 +C046B400 FFFFFFFF +640F1000 00000000 00000062 +21000000 +780F0000 00000008 +20000000 +310C0000 +''' + +# (words, kind, note substring): every C0 operand type and width, C1-C3, and what stays unsupported. +CLASSIFY = [ + ('C0150010 00000010', 'data', ''), # X=0 memory + offset, 1 byte + ('C025011B', 'data', ''), # X=1 memory + offset register, 2 bytes + ('C04512B0 00000010', 'data', ''), # X=2 register + offset + ('C08513BC', 'data', ''), # X=3 register + offset register + ('C0151400 00000005', 'data', ''), # X=4 static, 1 byte: one value word + ('C0851400 00000001 00000002', 'data', ''), # X=4 static, 8 bytes: two value words + ('C04515B0', 'data', ''), # X=5 other register + ('C1030A10', 'data', ''), + ('C2100C00', 'data', ''), + ('C3000801', 'data', ''), + ('C0451600', 'unsupported', 'not supported'), # X=6 is no operand type + ('C0351400 00000005', 'unsupported', 'bad width'), + ('C4000000', 'unsupported', 'not supported'), + ('FF000000', 'unsupported', 'not supported'), + ('FF100000', 'unsupported', 'not supported'), +] + + +class StubMain: + """No code in main: tools/cheats.py code_writes sees no instruction writes.""" + + def in_code(self, off): + return False + + +def py_classify(words): + c = cheats.Cheat('t', False, 1) + c.words = words + cheats.classify(StubMain(), c) + return c.kind, c.note + + +def words_of(text): + return [int(w, 16) for w in text.split()] + + +def check_python(): + for c in cheats.parse(REPORTED, 'mod'): + kind, note = py_classify(c.words) + assert (kind, note) == ('data', ''), f'tools/cheats.py: {c.name}: {kind} {note}' + for text, kind, note in CLASSIFY: + got = py_classify(words_of(text)) + assert got[0] == kind and note in got[1], f'tools/cheats.py: {text}: {got}, want {kind} {note}' + if kind == 'data': + assert [len(w) for _, w in cheats.ops(words_of(text))] == [len(words_of(text))], text + print('cheats_vm_check: tools/cheats.py ok', flush=True) + + +HARNESS = r''' +#include +#include "cheats.c" + +// ---- the rest of the runtime, as far as cheats.c reaches it +static uint8_t heap[0x1000] __attribute__((aligned(4096))); +static uint8_t image[0x1000] __attribute__((aligned(4096))); +const char *cfg_get(const char *name) { (void)name; return NULL; } +const char *cfg_value(const char *name) { (void)name; return ""; } +void cfg_set(const char *name, const char *value) { (void)name; (void)value; } +const RtConfig *rt_config(void) { static RtConfig c; return &c; } +const RtGuestLayout *mem_layout(void) { static RtGuestLayout l; l.heap.base = (uintptr_t)heap; return &l; } +uint32_t mem_query(uint64_t a, RtMemoryInfo *out) { + memset(out, 0, sizeof *out); + if (a < (uintptr_t)heap || a >= (uintptr_t)heap + sizeof heap) return 1; + out->base = (uintptr_t)heap, out->size = sizeof heap, out->state = 1, out->perm = 3; + return 0; +} +void rt_fatal(const char *fmt, ...) { (void)fmt; abort(); } +void rt_log(const char *fmt, ...) { (void)fmt; } +void prof_write(void) {} +int ldr_count(void) { return 0; } +const RtLoaded *ldr_module(int i) { (void)i; return NULL; } +int rt_patch_set(const char *name) { (void)name; return -1; } +int rt_patch_enabled(int set) { (void)set; return 0; } +void rt_patch_switch(int set, int on) { (void)set; (void)on; } +void input_poll(uint64_t *b, int32_t *lx, int32_t *ly, int32_t *rx, int32_t *ry) { *b = 0, *lx = *ly = *rx = *ry = 0; } +void mods_scan(void) {} +int mods_count(void) { return 0; } +ModInfo *mods_at(int i) { (void)i; return NULL; } +int mods_exefs_pending(uint32_t *key) { (void)key; return 0; } +int plat_exe_path(char *out, size_t cap) { (void)out; (void)cap; return 0; } +PlatFile *plat_file_open(const char *path) { (void)path; return NULL; } +void plat_file_close(PlatFile *f) { (void)f; } +int64_t plat_file_pread(PlatFile *f, void *buf, uint32_t n, uint64_t off) { (void)f; (void)buf; (void)n; (void)off; return -1; } +uint8_t *plat_file_read(const char *path, uint64_t *size) { (void)path; (void)size; return NULL; } +int plat_file_write(const char *path, const void *data, size_t n) { (void)path; (void)data; (void)n; return 0; } +int plat_file_exists(const char *path) { (void)path; return 0; } +int plat_fs_unlink(const char *path) { (void)path; return 0; } +int plat_fs_list(const char *dir, int (*cb)(const char *, int, uint64_t, void *), void *ctx) { (void)dir; (void)cb; (void)ctx; return 0; } +int plat_spawn(const char *const *argv, const char *cwd) { (void)argv; (void)cwd; return 0; } +_Noreturn void plat_exit(int code) { exit(code); } +int plat_mem_state(uint64_t addr, uint64_t limit, uint64_t *end) { (void)addr; *end = limit; return PLAT_PROT_RW; } +int plat_mem_protect(uint64_t addr, uint64_t n, int prot) { (void)addr; (void)n; (void)prot; return 1; } + +#include "cases.h" + +// The last cheat of text, parsed as cheats_init parses a file. +static Cheat *load(const char *text) { + char *s = strdup(text); + parse(s, "t"); + free(s); + return &g_cheats[g_n - 1]; +} + +static uint32_t u32(const uint8_t *p) { uint32_t v; memcpy(&v, p, 4); return v; } +static uint64_t u64(const uint8_t *p) { uint64_t v; memcpy(&v, p, 8); return v; } + +// Marks after the condition: 1 at heap+0x100 when it held, else 2 at heap+0x104; 3 at heap+0x108 after the end. +#define MARKS " 04100000 00000100 00000001 21000000 04100000 00000104 00000002 20000000 04100000 00000108 00000003" + +// Runs setup + cond + MARKS; want: 1 the condition holds, 0 it fails. +static void cond(const char *setup, const char *op, int want) { + char text[1024]; + snprintf(text, sizeof text, "[c]\n%s %s%s\n", setup, op, MARKS); + memset(heap + 0x100, 0, 0x10); + run(load(text), 0); + uint32_t held = u32(heap + 0x100), other = u32(heap + 0x104), end = u32(heap + 0x108); + if (held != (want ? 1u : 0u) || other != (want ? 0u : 2u) || end != 3) { + fprintf(stderr, "%s %s: marks %u %u %u, want %d\n", setup, op, held, other, end, want); + abort(); + } +} + +int main(void) { + g_main = (uintptr_t)image, g_main_size = sizeof image, g_code_end = g_main; // no code: nothing is a code cheat + for (int k = 0; k < (int)(sizeof cases / sizeof *cases); k++) { + Cheat *c = load(cases[k].text); + CheatKind kind = classify(c); + if (kind != cases[k].kind || !strstr(c->note, cases[k].note)) { + fprintf(stderr, "classify %s: %d (%s), want %d (%s)\n", cases[k].text, kind, c->note, cases[k].kind, cases[k].note); + abort(); + } + for (int i = 0, j = 0; kind == CHEAT_DATA && i < c->n; j++) { + int len = op_len(c->words + i, c->n - i); + if (len != cases[k].lens[j]) { + fprintf(stderr, "op_len %s, opcode %d: %d, tools/cheats.py %d\n", cases[k].text, j, len, cases[k].lens[j]); + abort(); + } + i += len; + } + } + + char hb[64], hb10[64]; // r[B] = the heap's address, r[B] = the heap + 0x10 + snprintf(hb, sizeof hb, "400B0000 %08X %08X", (unsigned)((uintptr_t)heap >> 32), (unsigned)(uintptr_t)heap); + snprintf(hb10, sizeof hb10, "400B0000 %08X %08X", (unsigned)((uintptr_t)heap >> 32), (unsigned)((uintptr_t)heap + 0x10)); + uint64_t v = 0x1122334455667705ull; + memcpy(heap + 0x10, &v, 8); // heap+0x10: 05 77 66 55 44 33 22 11 + memcpy(image + 0x20, &v, 8); + + // X=0 memory + offset: heap (M=1) and main (M=0), each width + cond("400A0000 00000000 00000005", "C015A010 00000010", 1); + cond("400A0000 00000000 00000005", "C016A010 00000010", 0); + cond("400A0000 00000000 00007705", "C025A010 00000010", 1); + cond("400A0000 00000000 55667705", "C045A000 00000020", 1); + cond("400A0000 11223344 55667705", "C085A000 00000020", 1); + cond("400A0000 11223344 55667706", "C085A000 00000020", 0); + // X=1 memory + offset register + cond("400A0000 00000000 55667705 400C0000 00000000 00000010", "C045A11C", 1); + cond("400A0000 00000000 55667705 400C0000 00000000 00000014", "C045A11C", 0); + // X=2 register + offset, X=3 register + offset register + char setup[256]; + snprintf(setup, sizeof setup, "400A0000 00000000 55667705 %s", hb); + cond(setup, "C045A2B0 00000010", 1); + cond(setup, "C045A2B0 00000011", 0); + snprintf(setup, sizeof setup, "400A0000 00000000 55667705 %s 400C0000 00000000 00000010", hb); + cond(setup, "C045A3BC", 1); + snprintf(setup, sizeof setup, "400A0000 00000000 00000005 %s 400C0000 00000000 00000010", hb10); + cond(setup, "C015A3BC", 0); // heap+0x20 holds 0 + // an address the guest cannot read compares as 0, as dmnt's read leaves its zeroed value + cond("400A0000 00000000 00000000 400B0000 00000000 00000000", "C045A2B0 00000000", 1); + cond("400A0000 00000000 00000001 400B0000 00000000 00000000", "C045A2B0 00000000", 0); + // X=4 static: the register and the value cut to the width + cond("400A0000 FFFFFFFF FFFFFF05", "C015A400 00000005", 1); + cond("400A0000 FFFFFFFF FFFFFF05", "C015A400 12345605", 1); + cond("400A0000 FFFFFFFF FFFF7705", "C025A400 00007705", 1); + cond("400A0000 FFFFFFFF 55667705", "C045A400 55667705", 1); + cond("400A0000 00000001 00000002", "C085A400 00000001 00000002", 1); + cond("400A0000 00000001 00000002", "C085A400 00000000 00000002", 0); + // X=5 other register, cut to the width + cond("400A0000 00000000 00000005 400B0000 00000001 00000005", "C045A5B0", 1); + cond("400A0000 00000000 00000005 400B0000 00000001 00000005", "C085A5B0", 0); + // the six conditions, register 5 against 4, 5 and 6; condition 0 or 7 never holds + static const int want[8][3] = {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 0, 1}, {0, 1, 1}, {0, 1, 0}, {1, 0, 1}, {0, 0, 0}}; + for (int c = 0; c < 8; c++) + for (int k = 0; k < 3; k++) { + char op[32]; + snprintf(op, sizeof op, "C04%XA400 %08X", c, 4 + k); + cond("400A0000 00000000 00000005", op, want[c][k]); + } + // a failed block skips a nested C0 with its else and end, and C0 operand words that read 20000000 / 21000000 + cond("400A0000 00000000 00000005", + "C046A400 00000005 C045A400 00000005 04100000 00000100 00000009 21000000 20000000" + " C085A400 21000000 20000000 20000000 C045A010 20000000 20000000 C045A2B0 20000000 20000000", 0); + cond("400A0000 00000000 00000005", "C045A400 00000005 C046A400 00000005 21000000 20000000", 1); + + // C1: save r[A] in slot 3, clear r[A], restore slot 3 into r[B]; clear slot 3 and restore it into r[C] + load("[s]\n400A0000 00000000 0000002A C1030A10 C10A0030 C10B0300 C1030020 C10C0300" + " A4A00410 00000110 A4B00410 00000114 A4C00410 00000118\n"); + memcpy(heap + 0x110, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 12); + run(&g_cheats[g_n - 1], 0); + assert(u32(heap + 0x110) == 0 && u32(heap + 0x114) == 0x2A && u32(heap + 0x118) == 0); + // C2: save A and B, clear A, restore A only; clear the saved B, restore B + load("[m]\n400A0000 00000000 00000007 400B0000 00000000 00000008 C2100C00 C2300C00 C2000400 C2200800 C2000800" + " A4A00410 00000110 A4B00410 00000114\n"); + memset(heap + 0x110, 0xFF, 8); + run(&g_cheats[g_n - 1], 0); + assert(u32(heap + 0x110) == 7 && u32(heap + 0x114) == 0); + // C3: r[1] into static register 0x80, which stays across runs; static register 0x05 (none sets it) into r[2] + load("[st]\n40010000 00000000 00000033 40020000 00000000 00000044 C3000801 C3000052 A8200410 00000120\n"); + memset(heap + 0x120, 0xFF, 8); + run(&g_cheats[g_n - 1], 0); + assert(g_static[0x80] == 0x33 && u64(heap + 0x120) == 0); + // saved registers start at 0 in each run, like the registers + load("[z]\nC10A0300 A8A00410 00000128\n"); + memset(heap + 0x128, 0xFF, 8); + run(&g_cheats[g_n - 1], 0); + assert(u64(heap + 0x128) == 0); + + puts("cheats_vm_check: runtime/cheats.c ok"); + return 0; +} +''' + +KIND = {'data': 'CHEAT_DATA', 'unsupported': 'CHEAT_UNSUPPORTED'} + + +def cases_h(): + """The C table: every classify case and each reported cheat, with tools/cheats.py's kind and opcode lengths.""" + rows = [(' '.join(f'{w:08X}' for w in c.words), 'data', '') for c in cheats.parse(REPORTED, 'mod')] + CLASSIFY + out = ['static const struct { const char *text; CheatKind kind; const char *note; int lens[64]; } cases[] = {'] + for text, kind, note in rows: + try: + lens = [len(w) for _, w in cheats.ops(words_of(text))] + except ValueError: + lens = [] + out.append(f' {{"[t]\\n{text}\\n", {KIND[kind]}, "{note}", {{{", ".join(map(str, lens)) or "0"}}}}},') + return '\n'.join(out + ['};', '']) + + +def check_c(cc): + with tempfile.TemporaryDirectory(prefix='totk-cheats-') as tmp: + folder = Path(tmp) + (folder / 'check.c').write_text(HARNESS) + (folder / 'cases.h').write_text(cases_h()) + exe = folder / ('check.exe' if os.name == 'nt' else 'check') + subprocess.run([cc, '-O1', '-g', '-Wall', '-Wextra', '-Wno-unused-function', '-I', str(folder), + '-I', str(ROOT / 'runtime'), str(folder / 'check.c'), '-o', str(exe)], check=True) + subprocess.run([str(exe)], check=True) + + +def main(): + ap = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + ap.add_argument('--cc', default='clang') + args = ap.parse_args() + check_python() + check_c(args.cc) + + +if __name__ == '__main__': + main() diff --git a/tools/cheats.py b/tools/cheats.py index 30e0bb68..e7ca05b6 100644 --- a/tools/cheats.py +++ b/tools/cheats.py @@ -134,6 +134,9 @@ def ops(words): else: t = (w >> 24) & 0xFF if t == 0xC else (w >> 20) & 0xFFF n = 1 + if t == 0xC0: # C0TcSX..: an address word for operand types 0 and 2, the value (two at width 8) for 4 + x = (w >> 8) & 0xF + n = 2 if x in (0, 2) else (3 if (w >> 20) & 0xF == 8 else 2) if x == 4 else 1 if i + n > len(words): raise ValueError(f'opcode {w:08X} is cut short') out.append((t, words[i:i + n])) @@ -141,7 +144,7 @@ def ops(words): return out -VM_TYPES = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA} +VM_TYPES = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xA, 0xC0, 0xC1, 0xC2, 0xC3} def vm_ok(o): @@ -151,10 +154,12 @@ def vm_ok(o): return f'opcode {w[0]:08X} is not supported' if t == 5 and (w[0] >> 12) & 0xF > 1: return f'opcode {w[0]:08X} (load from a register offset) is not supported' - if t == 0xA and (w[0] >> 8) & 0xF > 5: + if t in (0xA, 0xC0) and (w[0] >> 8) & 0xF > 5: return f'opcode {w[0]:08X} is not supported' if t in (0, 1, 5, 6, 7, 9, 0xA) and (w[0] >> 24) & 0xF not in (1, 2, 4, 8): return f'opcode {w[0]:08X} has a bad width' + if t == 0xC0 and (w[0] >> 20) & 0xF not in (1, 2, 4, 8): + return f'opcode {w[0]:08X} has a bad width' return None diff --git a/tools/make_release.py b/tools/make_release.py index e2faa33e..2b483a7b 100644 --- a/tools/make_release.py +++ b/tools/make_release.py @@ -64,7 +64,7 @@ WORK = MAIN_ROOT / 'toolchain' / 'release-work' # unpacked downloads PGO_DIR = MAIN_ROOT / 'build' / 'pgo' # pgo-.profdata + .json (tools/pgo.py merge) MSYS2 = 'https://repo.msys2.org/mingw/ucrt64/' -SDL_VERSION = '3.4.18' +SDL_VERSION = '3.4.20' LLVM_VERSION = '20261020' MNG_COMMIT = 'b75be8cfa704df3701e86130c8ced268e79d6b11' # MacNativeGames, the shader list (refs/MacNativeGames) # name: (url, sha256) @@ -77,9 +77,9 @@ PINS = { f'llvm-mingw-{LLVM_VERSION}-ucrt-x86_64.zip', 'fd5462b7f5d93b2ff981fcd3f9c7e427e47f3203c64ea91c27bcc444eebd74cd'), 'sdl3-dll': (f'https://github.com/libsdl-org/SDL/releases/download/release-{SDL_VERSION}/SDL3-{SDL_VERSION}-win32-x64.zip', - '75c2c0fc74e7d1206aaedc22893a35887332f4f85f5c8b74fddc10d177985f2c'), + '368bed8b24e44ad9ea372990814f2343fcfb9e468abb7f8f4a3bc146c7304752'), 'sdl3-devel': (f'https://github.com/libsdl-org/SDL/releases/download/release-{SDL_VERSION}/SDL3-devel-{SDL_VERSION}-mingw.tar.gz', - '049b9dd711e3fb3f8d84feb998dfec54a75e17cf539c4a80ff4d058d839771cf'), + 'd2d3bf3fb97a90b22e908a306d7362631ef1bab229d988fe6669595dc29cd9ed'), 'ninja': ('https://github.com/ninja-build/ninja/releases/download/v1.13.2/ninja-win.zip', '07fc8261b42b20e71d1720b39068c2e14ffcee6396b76fb7a795fb460b78dc65'), 'opus': (MSYS2 + 'mingw-w64-ucrt-x86_64-opus-1.6.1-2-any.pkg.tar.zst', @@ -99,7 +99,7 @@ PINS = { } # The component MSI inside the python.org installer that carries Tcl/Tk and tkinter (Burn names its payloads a0..a27). TCLTK_PAYLOAD = ('a12', 'ac87609db3f715404dd41a989c2f1706ea1512f3d86217f938d11c63af8eb505') -SDL3_DLL_SHA256 = '2b4b128d8d510cc2d442693cf848c050d700d43dc667afe9e5fd82b0570d667e' # SDL3.dll inside the SDL zip +SDL3_DLL_SHA256 = '66844f10251cc1c10619ed5d8e4e3224f564900ee6d69ba87d63de782addae40' # SDL3.dll inside the SDL zip # llvm-mingw: what clang and lld need to compile and link totk.exe for x86_64-w64-mingw32 (dynamic LLVM, libc++, compiler-rt). LLVM_BIN = {'clang.exe', 'clang++.exe', 'clang-23.exe', 'ld.lld.exe', 'llvm-ar.exe', 'llvm-ranlib.exe', 'llvm-nm.exe', diff --git a/totk.ini.example b/totk.ini.example index 539205a3..bd0528ad 100644 --- a/totk.ini.example +++ b/totk.ini.example @@ -116,10 +116,12 @@ # vk_validation = 0 # A thread of its own makes the Vulkan calls of each frame, 0 or 1. Default: on, except on AMD GPUs. # vk_recorder = 1 -# Dynamic vertex input, 0 or 1. Default: on, except on Intel's older integrated GPU drivers (Vulkan 1.3.215 and older). +# Dynamic vertex input, 0 or 1. Default: on, except on Intel's Windows driver for integrated GPUs (UHD, Iris Xe), +# which draws black patches with it. # vk_dyn_vertex = 1 # Dynamic alpha to coverage, 0 or 1. Default: on, except on AMD's driver for RDNA 2 and older (RX 400 to RX 6000), -# which applies alpha to coverage while the dynamic state says off and draws the characters black. +# which applies alpha to coverage while the dynamic state says off and draws the characters black, and on Intel's +# Windows driver for integrated GPUs (UHD, Iris Xe), which draws coloured noise on foliage with it. # vk_dyn_a2c = 1 # Pin the shader subgroup size to 32 when the GPU allows it. # vk_subgroup_pin = 1