Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ method, scope and caveats. No game data is included.
| [d3d12_command_objects.md](d3d12_command_objects.md) | Measured command queue/list/fence/`PresentX` surface; verified vs prior art vs open. |
| [xbox_d3d12_xs.md](xbox_d3d12_xs.md) | The `d3d12_xs` graphics ABI quoted from Microsoft's public GDK reference: root signatures, state objects, DXIL libraries, hit groups, shader cache sessions; which pages are missing or NDA-gated. |
| [runtime_imports.md](runtime_imports.md) | The 16 shipped modules' measured imports and shim/host/unimplemented split. |
| [linux_proton.md](linux_proton.md) | Building and booting under Proton/Wine on Linux, a healthy boot's timeline, and the test report of one Linux and two Windows machines |
| [linux_proton.md](linux_proton.md) | Building and booting under Proton/Wine on Linux, one bounded game run with `scripts/run_game_wine.sh`, a healthy boot's timeline, and the test report of one Linux and two Windows machines |
| [xmem_exe_calls.md](xmem_exe_calls.md) | How the retail executable calls `xmem.dll`: call sites and constant arguments per import (`tools/import_call_sites.py`), the 23 `XMemVirtualAlloc` calls that all pass an attribute word, and the inferred shape of the physical-page family. |
| [exe_fail_fast.md](exe_fail_fast.md) | Where the retail executable stops itself (`int3`) on an import's result: 78 sites over 27 imports (`tools/import_fail_fast.py`), grouped by how `main` binds each import (all 13 non-host fatal-checked imports now bind to shims; 0 unbound). |
| [audio_hal_exe_calls.md](audio_hal_exe_calls.md) | How the retail executable calls the 22 audio coprocessor, texture layout and DirectStorage imports that have no shim: call sites, constant arguments, and the four calls with a negative-result branch. |
Expand Down
1 change: 1 addition & 0 deletions docs/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ names; the build lists anything it can't find before it starts.
| Shader translator, its tests and the GPU test tools (`vk_harness`, `vk_pipeline_check`, ...) | Native, GCC or Clang | CI (`linux-gpu-tools`: GCC, tests on llvmpipe); Clang builds them too, but no CI job uses it yet |
| `rpf9dump` (asset export) | Native, .NET 8 or newer | CI builds it on Windows only (the `check` job) |
| `gta6rt`, its shims and their tests | Windows program, under Wine or Proton | Cross-built with clang-cl and xwin; CI runs the Windows build under Wine on pushes to `main` |
| `scripts/run_game_wine.sh`: one retail run under Wine, headless or visible, counts only ([linux_proton.md](linux_proton.md#running-the-game-under-wine-with-one-command)) | Native (`bash`) around the Windows `gta6rt` | `tests/test_run_game_wine.py` and `tests/test_game_run_summary.py`, without the game |

## Build the port

Expand Down
46 changes: 46 additions & 0 deletions docs/linux_proton.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,52 @@ Three setup mistakes each give a blank or empty picture without an error: the ex
from the library (`exe/index.json`), a build without SDL3 (no pad), and a BCPack predictor file that was never
generated (`tools/build_dstorage_history.py`; without it the loading art and most BC7 textures stay empty).

## Running the game under Wine with one command

`scripts/run_game_wine.sh` makes one bounded, silent run of the retail game under Wine and prints counts only. It
complements `scripts/run_wine_session.sh` (the runtime's unit tests under Wine) and the `systemd --user` boot
wrappers described above: it needs no fixed paths, and its output is a summary that can go into an issue.

```sh
scripts/run_game_wine.sh --build <build folder or checkout> --exe <game executable> --game-dir <package folder> \
--shaders <translated library> --out <new run folder> --device 1002:744c --seconds 600
```

`--help` lists every input. Each path comes from an argument or from `LEONIDA_GAME_EXE`, `LEONIDA_GAME_DIR` and
`LEONIDA_SHADERS`; `WINE` names another Wine (Proton's `files/bin/wine`), and `WINEPREFIX` (or `--prefix`) a prefix to
reuse instead of a new one in the run folder.

What it needs:

- **Wine** (the `wine` on `PATH`, or `WINE`), `timeout`, `flock`, `setsid` and Python 3.
- **A Vulkan driver** for the GPU (Mesa's RADV was tested). `--device VID:DID` pins it through
`MESA_VK_DEVICE_SELECT`; without it the script warns that Mesa picks the device.
- **A display.** By default the run is headless: a private `kwin_wayland --virtual --xwayland` session under
`dbus-run-session`, with its own `XDG_RUNTIME_DIR` in the run folder, so nothing appears on the desktop. Its
rootless Xwayland offers DRI3, which RADV needs to present; Xvfb has none, so without `kwin_wayland` the script
says what is missing instead of falling back. `--visible` opens the window on the current `DISPLAY` instead.
- **A runtime build**: a folder with `gta6rt.exe` and `gta6rt_tls_host.dll`, or a checkout, whose `runtime/` it
cross-builds first with clang-cl and xwin (`XWIN_DIR`, see [linux.md](linux.md#the-runtime-under-wine-or-proton)).

What it does:

- **Sound off:** Wine's audio drivers are disabled through `WINEDLLOVERRIDES`, PulseAudio, PipeWire and ALSA point
at nothing, and `LEONIDA_AUDIO=silent` makes the runtime serve its silent output endpoint
([runtime_imports.md](runtime_imports.md)); the summary says whether it was served.
- **Limits:** a hard time limit (`--seconds`, then SIGTERM and SIGKILL 10 s later), a lock so one run happens at a
time (`--lock`, by default in `XDG_RUNTIME_DIR`), and teardown of Wine and the whole session on exit, time-out or
signal.
- **Traces:** `gta6rt --run` with `--trace` and `--trace-d3d12`, a fresh `--overlay` and save folder in the run
folder. Every other `LEONIDA_*` variable reaches the runtime unchanged, so `LEONIDA_INPUT_SCRIPT=a@210,a@240`
presses A as above. Arguments after `--` go to `gta6rt`.
- **Summary:** `tools/game_run_summary.py` prints the run time, how it ended, exceptions by code, D3D12 calls by
outcome, presents, the most frequent failing calls and the `[rt]` lines by category with numbers masked. It never
prints a log line. `--screenshot-every S` captures the game window into the run folder (ImageMagick's `import` and
`xprop`).

The run folder's `stderr.log`, `boot.jsonl` and screenshots can show or quote what the title prints, so they stay on
your machine; share the summary.

## What a healthy boot looks like (Linux machine)

| Time | Stage |
Expand Down
Loading
Loading