Commit Graph

10 Commits

Author SHA1 Message Date
00131bb85e main keeps its own runtime, tools and tests; the branch's variants stay on port/d3d12-nvidia
After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:

- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
  fixtures are left out.

What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.

Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:58:38 -05:00
b87abdef57 Merge mandy's main into port/d3d12-nvidia
Brings the D3D12 runtime branch (d3d12/, its launcher scripts and notes, and the pull requests reviewed and applied
on it) together with mandy's main.

Conflicts (67 files, none under d3d12/): docs/, make_game.py, runtime/, scripts/build_runtime.ps1, tests/ and
tools/. Every one takes main's side: main is where that code is maintained, and this branch's copies were older
states of the same files or the same pull requests in another form. tests/test_fspx_unpack.py is main's too, as it
tests main's tools/fspx_unpack.py. Nothing under d3d12/ is changed by the merge.

Checked before pushing: python -m compileall over make_game.py, tools and tests; make_game.py --help;
scripts/check_no_game_data.py over the files this adds to main; tests/test_text_write_line_endings.py. The
translator suite, the C++ runtime build and CI have not run on the result.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-27 17:50:37 -05:00
49fa907e4d media: a source resolver that opens local files only
The title's mfplat.dll imports bind to the host, and the host's
MFCreateSourceResolver fetches http, rtsp and other URLs over the
network. Port VIctory's media module (media.rs, GPL-3.0-or-later): a
proxy resolver that refuses anything but a local file with
MF_E_UNSUPPORTED_SCHEME (logged once per scheme and host), rewrites
console paths (GAME:, G:, T:, also as file: URLs) to their host files
through the new rt::fs::read_path, and forwards the rest to the host's
resolver. mfplat.dll stays a host module for LoadLibrary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 02:16:17 -05:00
1d37e033eb file_system: reserve T:'s folder with a create-only call, never reuse one
Xiiano's review of old upstream PR 8161: the folder name (start time to
the millisecond plus process id) is not guaranteed unique, and earlier
runs' folders are kept, so a reused id in the same millisecond would
land in a stale folder and bring ERROR_FILE_EXISTS back. Under Wine
every fresh run gets the same small ids (both run_tiny_game_dir runs
here were pid 32).

rt::fs::reserve_unique_dir(base, stem) makes base\stem with
CreateDirectoryW and takes success as ownership; on ERROR_ALREADY_EXISTS
it tries stem-2, stem-3, ... up to 1000 names, and fails with the Win32
error otherwise. T:'s folder is reserved once per overlay under a mutex
(the first T: call or rt::fs::scratch_dir(), which the startup line
calls), so concurrent first calls share it. A failed reservation is
printed once and T: paths fail with ERROR_INVALID_NAME.
rt::fs::scratch_stem() gives the first name tried.

file_system_test: with stem and stem-2 taken, reserve_unique_dir makes
stem-3, new and empty, then stem-4; a file with the next name counts as
taken; max_tries names taken fail with ERROR_ALREADY_EXISTS; a missing
base is made. T: with folders of this process's own stem and stem-2
already kept takes stem-3 and CREATE_NEW succeeds; eight threads making
their first T: call at once reserve one folder. The second-process test
stays.

Restored from old upstream PR 8161 and ported onto the new main: the
base folder and every candidate go through main's win32_io_path, like
the other creates in file_system.cpp, so a long overlay root keeps
working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:54:37 -05:00
297ad86854 file_system: T: is a folder of each process's own in the overlay
T:\ mapped to <overlay>\.gta6rt-temp, one folder shared by every run and
kept between runs. The title makes its crash dump and crash log there
with CREATE_NEW, and a name an earlier run (or a second process) had
left failed with ERROR_FILE_EXISTS (80), so no report landed (old
upstream issue 7913, measured by Spacecer2 under Wine 11.22).

T:\ now names <overlay>\.gta6rt-temp\<YYYYMMDD-HHMMSS-mmm>-pid<id>, the
process's start time in UTC and its id, made on the first T: call. The
start time keeps a reused process id (Wine hands each fresh prefix the
same small ids) out of an old run's folder. T:\.. cannot climb into the
shared folder, T:\ itself still cannot be removed or moved, and earlier
runs' folders are kept so their crash files can be read. GAME: and G:
are unchanged.

rt::fs::scratch_dir() returns the folder, and the startup line names it:
"console paths: GAME: -> ..., writes -> ..., T: -> ...". The two CMake
checks of that line (run_tiny_game_console_paths, run_tiny_game_dir)
and the synthetic test of the first now expect the T: part.

file_system_test: a CREATE_NEW of a name earlier runs left in
.gta6rt-temp succeeds and lands in the process's own folder; the folder
is stable for the process; a second process (the test started again)
creating the same name on the same overlay succeeds in a folder of its
own; GAME: reads and writes are unchanged. On main these fail with
ERROR_FILE_EXISTS (80), in this process and in the second one.

Restored from old upstream PR 8161 and ported onto the new main: the
folder is made through main's win32_io_path, so long overlay roots keep
working, and the scratch-folder check of the write-open path is kept.
Main's long-overlay T: check now finds scratch.bin in the process's own
folder below .gta6rt-temp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 06:54:36 -05:00
50c4cfefe2 Merge pull request #4327 from Maxime Mansiet
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:13:35 -05:00
2521a683b0 xgameruntime: keep persistent local storage out of GAME:\
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
2026-11-23 04:41:49 +01:00
c0b821cda7 file_system: CopyFile2 checks its parameter block before the destination
Review on #3655 (kacper-serewis, daemosofchaos, on Windows 11):

- A parameter block shorter than COPYFILE2_EXTENDED_PARAMETERS (dwSize
  0, 4, 31) made the fallback copy and return S_OK, where the host's
  CopyFile2 returns E_INVALIDARG and writes nothing. Both paths now
  check it first, before copy_paths prepares the destination.
- The fallback silently dropped COPY_FILE_SKIP_ALTERNATE_STREAMS and
  copied the stream. Its flags are now sorted: passed on (the ones both
  calls define), dropped (requests that leave the contents as
  CopyFileExW writes them: no offload, compressed traffic, sparse copy,
  ...), or refused with ERROR_NOT_SUPPORTED before anything is written
  (SKIP_ALTERNATE_STREAMS, DIRECTORY, OPEN_AND_COPY_REPARSE_POINT,
  IGNORE_SOURCE_ENCRYPTION, unknown bits, a longer V2 block).
- A cancel flag already set is answered by the fallback itself, since
  Wine 9's CopyFileExW doesn't read it.

rt::fs::force_copy_file2_fallback lets the test run the fallback on
Windows, where the host has CopyFile2 (Maraco91 noted it couldn't be
reached there). file_system_test runs its CopyFile2 checks both ways:
no block, short blocks, fail-if-exists with a hint flag, a set cancel
flag, and in the fallback the refused flags and block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jcpJWD4phrXJyDgED6
2026-11-22 21:54:00 +00:00
c9fbc9d07e gta6rt: GAME: paths for folders, moves, copies and attributes (RT-97 follow-up)
The calls docs/runtime_imports.md listed as not mapped now follow the RT-97
rules, under kernel32, kernelbase and the api-ms-win-core-file-* sets:

- CreateDirectory/CreateDirectoryEx make the folder in the overlay; a name the
  title can already see, package-only folders included, is ERROR_ALREADY_EXISTS.
- RemoveDirectory needs the folder empty in the title's view. An overlay folder
  is removed; a package folder is hidden by a .gta6rt-dir marker file inside its
  marker folder and stays on disk (deleted() now also checks that file, on top
  of the regular-file rule from 3f26a95a).
- MoveFile/MoveFileEx write the destination in the overlay; a moved package file
  is copied there and its old name deleted by a marker. MOVEFILE_WRITE_THROUGH
  flushes that copy and the marker before returning (review on #1742). Package
  folders are not moved (ERROR_ACCESS_DENIED), GAME: <-> host is
  ERROR_NOT_SAME_DEVICE and MOVEFILE_DELAY_UNTIL_REBOOT is ERROR_INVALID_PARAMETER.
- CopyFile/CopyFileEx/CopyFile2 read like a read and write a GAME: destination
  in the overlay; fail-if-exists counts names only the package has.
- SetFileAttributes sets the overlay copy (copy-up or folder mirror first).

file_system: 123/123 checks. No game files.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 18:42:08 +03:00
a98f9925b0 gta6rt: map GAME: console paths, and send writes to an overlay (RT-97)
A mapped title names its files on the console's drives, but nothing mapped them: the file calls went
straight to the host and --game-dir was only used to find modules, so the first file a title opens at boot
would fail. New shims for CreateFile*, FindFirstFile*/FindNextFile*/FindClose, GetFileAttributes*/
GetFileAttributesEx* and DeleteFile* (kernel32, kernelbase and the api-ms-win-core-file sets) map a GAME:
path under --game-dir, and send every open that can write and every delete to --overlay (default
<game-dir>\overlay), which reads and listings prefer. A write-open copies the package file into the overlay
first, so OPEN_EXISTING keeps its bytes, and a delete of a package file leaves a marker instead of removing
it, so the package is never modified. A path that climbs above GAME: with ".." or names another drive is
refused with ERROR_INVALID_NAME. A path without the prefix is still a host path.

The prefixes and the overlay come from ivall/xcl (GPL-2.0-only), as facts only, no code.

file_system ctest: 43 checks over folders in %TEMP%, covering mapping and case, copy-up and read
preference, a new file in folders the package lacks, delete and re-create, the merged listing, host-path
passthrough, the escape refusal and the narrow variants.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 13:11:57 +01:00