mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:58:37 +00:00
Remove the title's executable addresses #984 brought in; read them from the environment
#984 (273b3bdf9) put RVAs and file offsets of the retail executable into code, docs and scripts.
The code paths that need one now read it from an environment variable and are off when it is
unset; the docs and examples say the location is measured locally.
- runtime/src/main.cpp: the hang-watchdog kick takes its trap and kick RVAs from
LEONIDA_TITLE_WATCHDOG_KICK="<trap RVA>,<kick RVA>" (hex), still only when the trap
instruction is at the first one. Unset, the watchdog stays armed, as before by default;
LEONIDA_TITLE_WATCHDOG=1 keeps it armed, and LEONIDA_TITLE_WATCHDOG=0 without the RVAs says
once that it needs them. The LEONIDA_PEEK example uses placeholders.
- runtime/shims/startup_trace.h: the transient-pool dump fires at the int3 that
LEONIDA_POOL_DIAG_AT names (`<module>+0x<offset>`, as the trace prints it), off when unset.
- scripts/windows-boot/boot.ps1: LEONIDA_PEEK's default comes from LEONIDA_GAME_STATE_RVA and
LEONIDA_SESSION_STATE_RVA (no peek when unset), and the RESULT digest matches those values;
the examples and README use placeholders.
- runtime/README.md documents LEONIDA_TITLE_WATCHDOG_KICK and LEONIDA_POOL_DIAG_AT.
- docs/fspx.md, docs/d3d12_vulkan.md, docs/movies.md, docs/embedded_shaders.md and a comment in
runtime/shims/d3d12_xs_alloc_size.h drop the addresses and offsets.
This follows the same change on the earlier integration branch (#1495).
This commit is contained in:
@ -96,7 +96,7 @@ enough for the bundled middleware's `d3d12_xs` calls, not for the game. The laye
|
||||
out)`, `n` = 1..4 records of 0x14c bytes: a u32 tag, then the payload at +4) patches a copy of that stream and creates
|
||||
the PSO through the same path. Tags 0 (`D3D12_DEPTH_STENCIL_DESC`, on DEPTH_STENCIL or DEPTH_STENCIL1), 1
|
||||
(`D3D12_RASTERIZER_DESC`), 2 (`D3D12_BLEND_DESC`) and 3 (sample mask) are the TomBox layout (GPL-3.0,
|
||||
`create_derived_pso_x`), checked against the title's record writes in the retail build (RVA 0x2479f40): tag 1 is the
|
||||
`create_derived_pso_x`), checked against the title's record writes in the retail build: tag 1 is the
|
||||
rasterizer (0x2c bytes, always record 0 when present), tag 0 the DEPTH_STENCIL (0x34), tag 2 the BLEND (0x148). Tag 3 (sample mask, from TomBox)
|
||||
is served although that function does not write it. Tag 5 (0x16 bytes: 16 zero bytes, then the StencilReadMask and
|
||||
StencilWriteMask bytes at the DEPTH_STENCIL offsets 0x10/0x11, then zeros) overlays only those two bytes of the base's
|
||||
|
||||
@ -294,8 +294,8 @@ The last line also gets `--wave64-emulate` and the fallback flags of the build,
|
||||
emulated modules made at the default cap, `RadixAlloc` is refused (`declares 37084 bytes of workgroup memory`,
|
||||
`0x80004001`) after 28 creations.
|
||||
|
||||
**Packed pixel shaders.** The executable also holds two native pixel shaders in SGD5 records. Their header file
|
||||
offsets are `0x688ecf6` and `0x688f17f`. Both stored lengths include the 12-byte header. Raw deflate yields a
|
||||
**Packed pixel shaders.** The executable also holds two native pixel shaders in SGD5 records (their file offsets
|
||||
are measured locally and not kept here). Both stored lengths include the 12-byte header. Raw deflate yields a
|
||||
complete DXBC of 1,324 or 1,052 bytes. Their FSSM SHA-256 keys are
|
||||
`cae1e27820adde6a6cb35e308290164ad8cf7107f0fe147d50a2053d7ceeb4b8` and
|
||||
`879cb2e326c5e5333935a0b2b1dd9c3c2adc1b03e546d1f84f993d912b4f66b0`. The first is
|
||||
|
||||
@ -250,7 +250,7 @@ with a blob holding the dword 0, so the DLL creates no compute scratch buffer; w
|
||||
Not done here: using kind 0 at run time beyond what the translated module already carries (its thread-group size
|
||||
and `RSRC2`).
|
||||
|
||||
**Slot 57 (`DeserializeGraphicsPipelineStateX`, graphics FSPX).** At `game_scarlett_master.exe+0x2477578`, the retail
|
||||
**Slot 57 (`DeserializeGraphicsPipelineStateX`, graphics FSPX).** At one call site (measured locally), the retail
|
||||
title calls device slot 57 (`+0x1c8`) with `IID_ID3D12PipelineState` (`{765a30f3-f624-4c6f-a828-ace948622445}`) and a
|
||||
104-byte description (`+0x00..+0x60`) populated from the zlib-compressed pipeline library in `shaders.rpf`
|
||||
([shader_library.md](shader_library.md): 25,471 graphics records + 2,693 compute records):
|
||||
|
||||
@ -322,8 +322,8 @@ The loader-side runs behind these numbers are recorded in [`runtime/test/bink_de
|
||||
1-, 2-, and 4-track samples; later frames were not swept and may return 7,680 or 0 bytes). Which language or mix
|
||||
role the game assigns to track IDs `0, 1, 2, 3` at run time remains unknown.
|
||||
- **Startup playback.** In two boots the title opened the archive twice about 1.2 s after entering the loader.
|
||||
The separately loaded `Bink2Scarlett.dll` opens metadata at title RVA `0x442ebe6`; playback retains the handle
|
||||
at `0x442f056` and registers mapped frame buffers at `0x442f9b8`. The frame wrapper at `0x2ef0e0` has a CPU
|
||||
The separately loaded `Bink2Scarlett.dll` opens the metadata from the title; playback retains the handle
|
||||
and registers mapped frame buffers. The title's frame wrapper has a CPU
|
||||
multi-worker decode and wait path and a synchronous fallback. Three rotating sets of linear R8 planes (one
|
||||
3840×2160 and two 1920×1080 per set) reach the slot-133 texture uploader. `VS_Bink` / `PS_BinkNoAlpha` bind
|
||||
the three plane descriptors at table offsets 0x20, 0x40 and 0x60 and draw to an RGBA8 intermediate. The UI
|
||||
|
||||
@ -334,7 +334,8 @@ ones marked *diagnostic* only add log lines or exist to compare a run with and w
|
||||
| `LEONIDA_SHADOW_FULL_WALK` | unset | *Diagnostic.* `1` queries every page of the title-memory shadows at every refresh, as before unchanged generations were skipped. |
|
||||
| `LEONIDA_STRICT_REPLAY` | unset | *Diagnostic.* `1` makes a draw or dispatch with an unresolvable resource fail its command list (`src/vulkan_replay.h`); by default it is dropped and logged. |
|
||||
| `LEONIDA_VOLUME_MIPS` | on | The XG layout of a 3D texture with mips or a block format is computed (`shims/xg_xs_layout.h`). `0` refuses it. |
|
||||
| `LEONIDA_TITLE_WATCHDOG` | unset (armed) | The title's own hang watchdog stays armed by default, as on the console: if the game's main loop does not report for 30 seconds, the title ends itself. `0` makes `gta6rt --run` keep it from firing while the game thread waits for the driver, for example on the first boot after a driver update (`src/main.cpp`), and only in the build the watchdog was measured in. |
|
||||
| `LEONIDA_TITLE_WATCHDOG_KICK` | unset (armed) | The title's own hang watchdog stays armed by default, as on the console: if the game's main loop does not report for 30 seconds, the title ends itself. `<trap RVA>,<kick RVA>` (hex, measured locally and not kept in the repository) makes `gta6rt --run` keep it from firing while the game thread waits for the driver, for example on the first boot after a driver update (`src/main.cpp`), and only when the watchdog's trap instruction is at the first RVA. `LEONIDA_TITLE_WATCHDOG=1` keeps it armed even then. |
|
||||
| `LEONIDA_POOL_DIAG_AT` | unset | *Diagnostic.* `<module>+0x<offset>` of the title's transient-pool assert, as the trace prints it (measured locally): the trace dumps the pool's resource list when that int3 is hit (`shims/startup_trace.h`). |
|
||||
| `LEONIDA_PEEK_SECONDS` | `10` | *Diagnostic.* The period of the `LEONIDA_PEEK` thread (`src/main.cpp`), which prints 8-byte values of the title's image. |
|
||||
| `LEONIDA_INPUT_LOG` | on | The GameInput shim logs every press in `LEONIDA_INPUT_SCRIPT`'s form (`name@seconds`), so a session played by hand can be replayed. `0` turns the lines off. |
|
||||
| `LEONIDA_LOG_ALLOCINFO` | unset | *Diagnostic.* `1` logs every device slot 25 call (`GetResourceAllocationInfo`) with its thread, description and sizes (`shims/d3d12_xs_device.cpp`). |
|
||||
|
||||
@ -175,7 +175,7 @@ inline UINT64 console_depth_stencil_size(const D3D12_RESOURCE_DESC& desc) {
|
||||
//
|
||||
// Why exact: the title keeps this size in its streaming tables and reads exactly that many bytes of the texture
|
||||
// from its archives through DirectStorage; a compressed chunk must be read whole, and the title stops on an int3
|
||||
// (game+0x4ffd879) when the size it was given is smaller than the chunk. Measured with a debugger at that int3: a
|
||||
// when the size it was given is smaller than the chunk. Measured with a debugger at that int3: a
|
||||
// request of 0x2000 bytes for a chunk that spans 0x4000, the PC answer for the texture being half the console's.
|
||||
inline bool console_texture_layout(const D3D12_RESOURCE_DESC& desc, UINT64& size, UINT64& alignment) {
|
||||
constexpr UINT gpu_written = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL |
|
||||
|
||||
@ -165,8 +165,10 @@ inline std::string debug_text(const EXCEPTION_RECORD& r) {
|
||||
return utf8_from_ansi(a, static_cast<int>(n ? n - 1 : strlen(a)));
|
||||
}
|
||||
|
||||
// LOCAL DIAGNOSTIC for one of the title's asserts (docs/re/answers.md, "transient pool"): at the int3 at
|
||||
// game+0x2473e88 the title has just computed the peak of a list of resources with lifetimes against a fixed pool.
|
||||
// LOCAL DIAGNOSTIC for one of the title's asserts (docs/re/answers.md, "transient pool"): at that assert's int3
|
||||
// the title has just computed the peak of a list of resources with lifetimes against a fixed pool. The int3's
|
||||
// location is measured locally and not kept here: LEONIDA_POOL_DIAG_AT names it as the trace prints it
|
||||
// (`<module>+0x<offset>`), and the dump is off without it.
|
||||
// rdi = the list (24-byte records: entry pointer, u32 size rounded to 64 KiB), r13 = the count, rax = the peak,
|
||||
// rcx = the pool size. An entry is {record pointer, ..., u32 first pass at +16, u32 last pass at +20}; a record has
|
||||
// its usage word at +14, kind word at +16 and, for a texture, width/height/depth words at +56/+58/+60, the dimension
|
||||
@ -202,8 +204,13 @@ inline void dump_transient_pool(const CONTEXT& c) {
|
||||
inline void log_exception(const EXCEPTION_POINTERS& info) {
|
||||
const EXCEPTION_RECORD& r = *info.ExceptionRecord;
|
||||
try {
|
||||
if (r.ExceptionCode == EXCEPTION_BREAKPOINT && info.ContextRecord &&
|
||||
where(reinterpret_cast<uint64_t>(r.ExceptionAddress)).ends_with("master.exe+0x2473e88"))
|
||||
static const std::string pool_diag_at = [] {
|
||||
char at[128]{};
|
||||
const DWORD n = GetEnvironmentVariableA("LEONIDA_POOL_DIAG_AT", at, sizeof(at));
|
||||
return n && n < sizeof(at) ? std::string(at, n) : std::string();
|
||||
}();
|
||||
if (r.ExceptionCode == EXCEPTION_BREAKPOINT && info.ContextRecord && !pool_diag_at.empty() &&
|
||||
where(reinterpret_cast<uint64_t>(r.ExceptionAddress)).ends_with(pool_diag_at))
|
||||
dump_transient_pool(*info.ContextRecord);
|
||||
if (r.ExceptionCode == kDbgPrint || r.ExceptionCode == kDbgPrintWide) {
|
||||
const ULONG_PTR fallback = wide_fallback;
|
||||
|
||||
@ -32,24 +32,45 @@
|
||||
|
||||
namespace {
|
||||
|
||||
// The retail executable (1.0.2.1) runs a hang watchdog thread (function at RVA 0x2215a60): when the game's main loop
|
||||
// has not set its "kick" byte (RVA 0x71b6331) for 30 one-second ticks, it calls a crash callback and then writes to
|
||||
// address 0 (`movl $0, 0` at RVA 0x2215c35). Under the runtime the game thread can legitimately stall for longer than
|
||||
// that, e.g. while the driver compiles pipelines against a cold cache (first boot after a driver update), and the
|
||||
// title then kills itself. By default the watchdog stays armed, as on the console. With LEONIDA_TITLE_WATCHDOG=0, and
|
||||
// only when that exact trap instruction sits where it does in this build, a runtime thread sets the kick byte twice a
|
||||
// second so the title's watchdog never fires.
|
||||
constexpr std::uint32_t kWatchdogTrapRva = 0x2215c35;
|
||||
constexpr std::uint32_t kWatchdogKickRva = 0x71b6331;
|
||||
// The retail title runs a hang watchdog thread: when the game's main loop has not set its "kick" byte for 30
|
||||
// one-second ticks, it calls a crash callback and then writes to address 0 (`movl $0, 0`). Under the runtime the
|
||||
// game thread can legitimately stall for longer than that, e.g. while the driver compiles pipelines against a cold
|
||||
// cache (first boot after a driver update), and the title then kills itself. By default the watchdog stays armed, as
|
||||
// on the console. The two places are measured locally and not kept in the repository:
|
||||
// LEONIDA_TITLE_WATCHDOG_KICK="<trap RVA>,<kick RVA>" (hex) names them, and only when that exact trap instruction
|
||||
// sits at the first one does a runtime thread set the byte at the second twice a second, so the title's watchdog
|
||||
// never fires. Unset, or with LEONIDA_TITLE_WATCHDOG=1, the watchdog stays armed.
|
||||
constexpr unsigned char kWatchdogTrap[] = {0xC7, 0x04, 0x25, 0, 0, 0, 0, 0, 0, 0, 0}; // movl $0, 0x0
|
||||
|
||||
bool watchdog_rvas(std::uint32_t& trap_rva, std::uint32_t& kick_rva) {
|
||||
char value[64]{};
|
||||
const DWORD n = GetEnvironmentVariableA("LEONIDA_TITLE_WATCHDOG_KICK", value, sizeof(value));
|
||||
if (!n || n >= sizeof(value)) return false;
|
||||
char* rest = nullptr;
|
||||
const unsigned long long trap = std::strtoull(value, &rest, 16);
|
||||
if (!rest || *rest != ',') return false;
|
||||
const unsigned long long kick = std::strtoull(rest + 1, &rest, 16);
|
||||
if (!rest || *rest || !trap || !kick || trap > 0xFFFFFFFFull || kick > 0xFFFFFFFFull) return false;
|
||||
trap_rva = static_cast<std::uint32_t>(trap);
|
||||
kick_rva = static_cast<std::uint32_t>(kick);
|
||||
return true;
|
||||
}
|
||||
|
||||
void keep_title_watchdog_kicked(std::uint8_t* base) {
|
||||
char value[4]{};
|
||||
if (GetEnvironmentVariableA("LEONIDA_TITLE_WATCHDOG", value, sizeof(value)) != 1 || value[0] != '0') return;
|
||||
char keep[4]{};
|
||||
const DWORD keep_length = GetEnvironmentVariableA("LEONIDA_TITLE_WATCHDOG", keep, sizeof(keep));
|
||||
if (keep_length == 1 && keep[0] == '1') return;
|
||||
std::uint32_t kWatchdogTrapRva = 0, kWatchdogKickRva = 0;
|
||||
if (!watchdog_rvas(kWatchdogTrapRva, kWatchdogKickRva)) {
|
||||
if (keep_length == 1 && keep[0] == '0')
|
||||
std::fprintf(stderr, "[rt] loader: LEONIDA_TITLE_WATCHDOG=0 needs LEONIDA_TITLE_WATCHDOG_KICK=<trap RVA>,"
|
||||
"<kick RVA> (hex); the title's hang watchdog stays armed\n");
|
||||
return;
|
||||
}
|
||||
MEMORY_BASIC_INFORMATION trap{}, kick{};
|
||||
if (!VirtualQuery(base + kWatchdogTrapRva, &trap, sizeof(trap)) || trap.State != MEM_COMMIT ||
|
||||
std::memcmp(base + kWatchdogTrapRva, kWatchdogTrap, sizeof(kWatchdogTrap)) != 0)
|
||||
return; // not the build this was measured on: leave the title's watchdog alone
|
||||
return; // not the trap the RVAs name: leave the title's watchdog alone
|
||||
const DWORD writable = PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY;
|
||||
if (!VirtualQuery(base + kWatchdogKickRva, &kick, sizeof(kick)) || kick.State != MEM_COMMIT ||
|
||||
!(kick.Protect & writable))
|
||||
@ -67,11 +88,11 @@ void keep_title_watchdog_kicked(std::uint8_t* base) {
|
||||
const_cast<std::uint8_t*>(byte), 0, nullptr);
|
||||
if (thread) {
|
||||
CloseHandle(thread);
|
||||
std::fprintf(stderr, "[rt] loader: keeping the title's hang watchdog kicked (LEONIDA_TITLE_WATCHDOG=0; unset or 1 keeps it armed)\n");
|
||||
std::fprintf(stderr, "[rt] loader: keeping the title's hang watchdog kicked (LEONIDA_TITLE_WATCHDOG_KICK)\n");
|
||||
}
|
||||
}
|
||||
|
||||
// LEONIDA_PEEK="0x9e1dac0:3,0x7446510,0x98f828c" (diagnostic): a thread prints the 8-byte values at these RVAs of the
|
||||
// LEONIDA_PEEK="<rva>:3,<rva>,<rva>" (diagnostic): a thread prints the 8-byte values at these RVAs of the
|
||||
// title's image (":n" = n consecutive values) every LEONIDA_PEEK_SECONDS (default 10). For answering "what does this
|
||||
// global hold at run time" without a debugger: the reverse-engineering notes (docs/re/requests.md) ask for exactly
|
||||
// that. Reads are checked; nothing is written.
|
||||
|
||||
@ -15,7 +15,7 @@ powershell -NoProfile -File scripts\windows-boot\boot.ps1 -DryRun -GameDir D:\GT
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name first -Seconds 200 -GameDir D:\GTA6pkg -Shaders E:\leonida-work\shaders\spirv
|
||||
|
||||
# Extra or changed switches: trailing KEY=VALUE arguments (KEY= removes one), as run-boot.sh takes them.
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name split -Seconds 120 LEONIDA_PRESENT_PLANE1=0 "LEONIDA_PEEK=0x7446510,0x98f828c,0x78b2818"
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name split -Seconds 120 LEONIDA_PRESENT_PLANE1=0 "LEONIDA_PEEK=<rva>,<rva>,<rva>"
|
||||
|
||||
# Every parameter.
|
||||
Get-Help -Full .\scripts\windows-boot\boot.ps1
|
||||
@ -38,7 +38,7 @@ Only when your shell has not set them already (`-DryRun` prints the final list):
|
||||
| `LEONIDA_PIPELINE_CACHE_BYTES` | `4294967296` | pipeline cache size limit |
|
||||
| `LEONIDA_STARTUP_CACHE_CHECKPOINTS` | `1` | save the pipeline cache during startup |
|
||||
| `LEONIDA_PIPELINE_CACHE_DIR` | `<out>\pipeline-cache` | one warmed cache shared by every build you boot |
|
||||
| `LEONIDA_PEEK` / `_SECONDS` | `0x7446510,0x98f828c` / `5` | game state and session state (low dword), the two numbers every RESULT reports |
|
||||
| `LEONIDA_PEEK` / `_SECONDS` | the game-state and session-state RVAs from `LEONIDA_GAME_STATE_RVA` and `LEONIDA_SESSION_STATE_RVA` (measured locally, not kept here; unset: no peek) / `5` | game state and session state (low dword), the two numbers every RESULT reports |
|
||||
| `LEONIDA_DEVICE_FAULT` | `1` | on device loss: `VK_EXT_device_fault` info, checkpoints, last replay steps |
|
||||
| `LEONIDA_KEYBOARD_PAD` | `always` (with an input script) | keyboard as a pad even unfocused, so the script's presses arrive |
|
||||
| `LEONIDA_CAPTURE_EVERY` / `_LIMIT` | `60` / `40` | a swapchain read-back every 60 presents, at most 40 |
|
||||
@ -72,7 +72,7 @@ frames: 14 captured, 0 non-black; last mean rgb 0.00 0.00 0.00; brightest 0.00
|
||||
states only, which is what goes into a RESULT on the board; the logs, traces, captures and dumps can quote the game
|
||||
and stay on your machine ([AGENTS.md](../../AGENTS.md), "No game data").
|
||||
|
||||
How to read the states: game state `0x7446510` goes 1, 2 (init), 3 (running); session state goes 0, 1, 3 (landing
|
||||
How to read the states: game state goes 1, 2 (init), 3 (running); session state goes 0, 1, 3 (landing
|
||||
screen waiting for A), `d` after A. `docs/linux_proton.md` (the same stages apply natively)
|
||||
section 2 has the healthy sequence with times and section 3 "which blank do you have".
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
|
||||
.PARAMETER EnvPairs
|
||||
Any further arguments, each KEY=VALUE, as scripts/linux-boot/run-boot.sh takes them. These work with
|
||||
powershell -File too: ... -Name x LEONIDA_PRESENT_PLANE1=0 "LEONIDA_PEEK=0x7446510,0x75e8eb0".
|
||||
powershell -File too: ... -Name x LEONIDA_PRESENT_PLANE1=0 "LEONIDA_PEEK=<rva>,<rva>".
|
||||
Applied after -SetEnv. KEY= removes the variable for this boot.
|
||||
|
||||
.PARAMETER NoCapture
|
||||
@ -97,7 +97,7 @@
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name first -Seconds 200 -GameDir D:\GTA6pkg -Shaders E:\leonida-work\shaders\spirv
|
||||
|
||||
.EXAMPLE
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name stall -Seconds 90 -Stacks 40,80 "LEONIDA_PEEK=0x7446510,0x75e8eb0,0x75e8ea0,0x9844898"
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -Name stall -Seconds 90 -Stacks 40,80 "LEONIDA_PEEK=<rva>,<rva>"
|
||||
|
||||
.EXAMPLE
|
||||
powershell -NoProfile -File scripts\windows-boot\boot.ps1 -DigestOnly -Name first
|
||||
@ -234,7 +234,8 @@ $defaults = [ordered]@{
|
||||
LEONIDA_PIPELINE_CACHE_BYTES = "4294967296"
|
||||
LEONIDA_STARTUP_CACHE_CHECKPOINTS = "1"
|
||||
LEONIDA_PIPELINE_CACHE_DIR = (Join-Path $OutDir "pipeline-cache")
|
||||
LEONIDA_PEEK = "0x7446510,0x98f828c" # game state, session state (low dword)
|
||||
# LEONIDA_PEEK: the game-state and session-state RVAs (measured locally, not kept in the repository) when
|
||||
# LEONIDA_GAME_STATE_RVA and LEONIDA_SESSION_STATE_RVA name them; see below.
|
||||
LEONIDA_PEEK_SECONDS = "5"
|
||||
LEONIDA_DEVICE_FAULT = "1" # device-loss report (VK_EXT_device_fault, checkpoints)
|
||||
LEONIDA_CAPTURE_EVERY = "60"
|
||||
@ -243,6 +244,9 @@ $defaults = [ordered]@{
|
||||
DISABLE_VULKAN_OBS_CAPTURE = "1"
|
||||
}
|
||||
if ($InputScript) { $defaults["LEONIDA_KEYBOARD_PAD"] = "always" }
|
||||
$gameStateRva = "$env:LEONIDA_GAME_STATE_RVA".ToLowerInvariant() -replace '^0x', ''
|
||||
$sessionStateRva = "$env:LEONIDA_SESSION_STATE_RVA".ToLowerInvariant() -replace '^0x', ''
|
||||
if ($gameStateRva -and $sessionStateRva) { $defaults["LEONIDA_PEEK"] = "0x$gameStateRva,0x$sessionStateRva" }
|
||||
# Per-run values: always this script's (from its parameters), whatever the shell has.
|
||||
$perRun = [ordered]@{
|
||||
LEONIDA_CAPTURE = $(if ($NoCapture) { "" } else { $Capture })
|
||||
@ -393,8 +397,8 @@ if (Test-Path -LiteralPath $LogFile) {
|
||||
$game = "?"; $session = "?"
|
||||
foreach ($v in $valRx.Matches($m.Groups[2].Value)) {
|
||||
$rva = $v.Groups[1].Value; $val = $v.Groups[2].Value
|
||||
if ($rva -eq "7446510") { $game = $val }
|
||||
elseif ($rva -eq "98f828c" -and $val -ne "?") {
|
||||
if ($gameStateRva -and $rva -eq $gameStateRva) { $game = $val }
|
||||
elseif ($sessionStateRva -and $rva -eq $sessionStateRva -and $val -ne "?") {
|
||||
$low = $val.PadLeft(16, '0').Substring(8).TrimStart('0') # the session state is the low dword
|
||||
$session = $(if ($low) { $low } else { "0" })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user