ReStreet: FIFA Street (2012) recompiled for Windows PC, with online play, a launcher with friends, chat and rooms. Bring your own game.
fix: support local source builds without release backend binaries
SamuelitoDaVila7623540553ad
diff --git a/Installer/BuildFifaStreet.ps1 b/Installer/BuildFifaStreet.ps1index 6be79df..ef85fe3 100644--- a/Installer/BuildFifaStreet.ps1+++ b/Installer/BuildFifaStreet.ps1@@ -7,6 +7,11 @@ param([string]$Workspace,+ [switch]$SourceBuild,++ [ValidateSet('D3D12', 'Vulkan')]+ [string]$GraphicsApi = 'D3D12',+[ValidateRange(1, 64)][int]$Jobs = 2)@@ -41,12 +46,12 @@ $installerRoot = Split-Path -Parent $MyInvocation.MyCommand.Path$template = Join-Path $installerRoot "recomp-template"$rexGlueSource = if ($env:REXSDK_DIR) { [IO.Path]::GetFullPath($env:REXSDK_DIR) } else {- "C:\Users\Samuel M\Desktop\FIFASTREET - 2012\ReXGlue"+ Join-Path (Split-Path $installerRoot -Parent) "ReXGlue"}$bundledSdk = Join-Path $installerRoot 'sdk'$bundledTools = Join-Path $installerRoot 'compiler'-$useBundledSdk = Test-Path -LiteralPath (Join-Path $bundledSdk 'bin\rexglue.exe')+$useBundledSdk = !$SourceBuild -and (Test-Path -LiteralPath (Join-Path $bundledSdk 'bin\rexglue.exe'))$llvmBin = if (Test-Path -LiteralPath $bundledTools) { Join-Path $bundledTools 'bin' } else { "C:\Program Files\LLVM\bin" }$clang = Join-Path $llvmBin "clang.exe"@@ -202,7 +207,8 @@ Push-Location $workProjecttry {# Generate sources before configuration so CMake discovers both binaries.- $codegen = if ($useBundledSdk) { Join-Path $bundledSdk 'bin\rexglue.exe' } else { Join-Path $rexGlueSource 'out\win-amd64\rexglue.exe' }+ $codegen = if ($useBundledSdk) { Join-Path $bundledSdk 'bin\rexglue.exe' } else { Join-Path $rexGlueSource 'out\win-amd64\Release\rexglue.exe' }+ if (!$useBundledSdk -and !(Test-Path -LiteralPath $codegen)) { $codegen = Join-Path $rexGlueSource 'out\win-amd64\rexglue.exe' }if (!(Test-Path -LiteralPath $codegen)) { throw "ReXGlue code generator not found: $codegen" }$fingerprintPath = Join-Path $workProject 'codegen-inputs.sha256'$fingerprintInputs = @($manifestPath, $codegen)@@ -218,7 +224,10 @@ try {[IO.File]::WriteAllText($fingerprintPath, $fingerprint, [Text.UTF8Encoding]::new($false))}- $sdkArguments = if ($useBundledSdk) { @('-DREXSDK_DIR=', "-DCMAKE_PREFIX_PATH=$bundledSdk") } else { @("-DREXSDK_DIR=$rexGlueSource") }+ $sdkArguments = if ($useBundledSdk) { @('-DREXSDK_DIR=', "-DCMAKE_PREFIX_PATH=$bundledSdk") } else {+ @("-DREXSDK_DIR=$rexGlueSource", "-DREXGLUE_USE_D3D12=$($GraphicsApi -eq 'D3D12')", "-DREXGLUE_USE_VULKAN=$($GraphicsApi -eq 'Vulkan')",+ "-DREXGLUE_OUTPUT_DIRECTORY=$workProject/out/build/win-amd64-release/runtime")+ }Invoke-BuildTool 'cmake' (@('--preset', 'win-amd64-release') + $sdkArguments + @("-DCMAKE_C_COMPILER=$clang","-DCMAKE_CXX_COMPILER=$clangxx", '-DCMAKE_C_FLAGS=-mssse3', '-DCMAKE_CXX_FLAGS=-mssse3')@@ -269,6 +278,15 @@ Get-ChildItem -LiteralPath $buildFolder -Filter '*.dll' -File |Where-Object { $_.Name -notin @('rexruntime.dll', 'rexgpu-xenos.dll') } |Copy-Item -Destination $Output -Force+# Source builds use the paired runtime/GPU DLLs compiled by this invocation.+if (!$useBundledSdk) {+ . (Join-Path $installerRoot 'InstallSourceBackend.ps1')+ Install-SourceBackend -RuntimeDirectory (Join-Path $buildFolder 'runtime') -Output $Output -GraphicsApi $GraphicsApi+ Stop-Transcript | Out-Null+ Write-Host "Source build complete: $Output ($GraphicsApi)"+ return+}+# Install both validated graphics backends.$bundledBackends = Join-Path $bundledSdk 'backends'$outputBackends = Join-Path $Output 'Backends'diff --git a/Installer/InstallSourceBackend.ps1 b/Installer/InstallSourceBackend.ps1new file mode 100644index 0000000..9d5fa27--- /dev/null+++ b/Installer/InstallSourceBackend.ps1@@ -0,0 +1,20 @@+function Install-SourceBackend {+ param(+ [Parameter(Mandatory = $true)][string]$RuntimeDirectory,+ [Parameter(Mandatory = $true)][string]$Output,+ [ValidateSet('D3D12', 'Vulkan')][string]$GraphicsApi = 'D3D12'+ )+ # Validate the pair before copying any backend files.+ foreach ($name in @('rexruntime.dll', 'rexgpu-xenos.dll')) {+ if (!(Test-Path -LiteralPath (Join-Path $RuntimeDirectory $name) -PathType Leaf)) {+ throw "Source backend is missing $name in $RuntimeDirectory"+ }+ }+ $backend = Join-Path $Output "Backends\$GraphicsApi"+ New-Item -ItemType Directory -Path $backend -Force | Out-Null+ # Include runtime dependencies such as TracyClient.dll from the same build.+ Get-ChildItem -LiteralPath $RuntimeDirectory -Filter '*.dll' -File | ForEach-Object {+ Copy-Item -LiteralPath $_.FullName -Destination $backend -Force+ Copy-Item -LiteralPath $_.FullName -Destination $Output -Force+ }+}diff --git a/Installer/README.md b/Installer/README.mdindex cd004fe..b9dae26 100644--- a/Installer/README.md+++ b/Installer/README.md@@ -1,9 +1,15 @@-# Installer source+# Installer sourceThis folder contains the English Windows installer, its local-build script and the public recompilation template. The installer takes a user's own Xbox 360 FIFA Street ISO and produces the PC build locally.Read [the build guide](../docs/BUILDING.md) for SDK preparation and single-file packaging. Supply `tools/extract-xiso.exe` locally. `bundle.zip` is generated by `BuildSetup.ps1` and must not be committed.+For development from a clone, use the [source build walkthrough](../docs/BUILDING.md#source-build-walkthrough)+and `BuildFifaStreet.ps1 -SourceBuild`. This mode builds and installs its own+Direct3D 12 runtime/GPU pair and dependencies. It does not require `Installer/sdk`+or the release DLL hashes. Without a bundled SDK, this source mode is also selected+automatically. The bundled installer path retains its release integrity checks.+The GUI validates the ISO, copies extracted data, applies the start-screen/main-menu credits, then recompiles the main executable and the required guest modules.The current pipeline builds:diff --git a/Installer/TestSourceBackend.ps1 b/Installer/TestSourceBackend.ps1new file mode 100644index 0000000..d52735f--- /dev/null+++ b/Installer/TestSourceBackend.ps1@@ -0,0 +1,28 @@+$ErrorActionPreference = 'Stop'+. (Join-Path $PSScriptRoot 'InstallSourceBackend.ps1')+$testRoot = Join-Path $env:TEMP ('FifaSourceBackendTest_' + [guid]::NewGuid().ToString('N'))+$runtime = Join-Path $testRoot 'runtime'+$output = Join-Path $testRoot 'output'+New-Item -ItemType Directory -Path $runtime -Force | Out-Null+[IO.File]::WriteAllText((Join-Path $runtime 'rexruntime.dll'), 'local runtime')+$rejected = $false+try { Install-SourceBackend -RuntimeDirectory $runtime -Output $output } catch { $rejected = $true }+if (!$rejected -or (Test-Path $output)) { throw 'An incomplete backend must fail before installation.' }+foreach ($name in @('rexgpu-xenos.dll', 'TracyClient.dll')) {+ [IO.File]::WriteAllText((Join-Path $runtime $name), $name)+}+Install-SourceBackend -RuntimeDirectory $runtime -Output $output+foreach ($name in @('rexruntime.dll', 'rexgpu-xenos.dll', 'TracyClient.dll')) {+ foreach ($destination in @($output, (Join-Path $output 'Backends\D3D12'))) {+ if ((Get-FileHash (Join-Path $runtime $name)).Hash -ne (Get-FileHash (Join-Path $destination $name)).Hash) {+ throw "Source backend copy differs: $name"+ }+ }+}+Write-Host "PASS: missing-pair rejection, paired backend and runtime dependency installation. Test files: $testRoot"+Install-SourceBackend -RuntimeDirectory $runtime -Output $output -GraphicsApi Vulkan+if (!(Test-Path (Join-Path $output 'Backends\Vulkan\rexgpu-xenos.dll')) -or+ !(Test-Path (Join-Path $output 'Backends\D3D12\rexgpu-xenos.dll'))) {+ throw 'Installing Vulkan must preserve the Direct3D 12 backend.'+}+Write-Host 'PASS: separate graphics backend directories.'diff --git a/README.md b/README.mdindex ee26158..1534813 100644--- a/README.md+++ b/README.md@@ -16,6 +16,9 @@## About+To compile the game yourself, follow the [source build walkthrough](docs/BUILDING.md#source-build-walkthrough).+It uses your extracted ISO and builds its own Direct3D 12 runtime; no release SDK bundle is required.+## v0.4.0 ExperimentalThe v0.4.0 installer includes precompiled game binaries for faster installation, updates that preserve saves and preferences, and English, Spanish, French, German and Italian selection in the launcher. See [the changelog](CHANGELOG.md) and [credits](CREDITS.md).diff --git a/docs/BUILDING.md b/docs/BUILDING.mdindex f5125fb..1ed0ec1 100644--- a/docs/BUILDING.md+++ b/docs/BUILDING.md@@ -1,9 +1,96 @@-# Building from source+# Building from sourceThe usual player workflow uses the release installer and a personal ISO. These instructions describe development and packaging. They do not include game data or generated guest code.## Developer prerequisites+For a development build, follow **Source build walkthrough** below. This builds+Direct3D 12 from source and does not need the release backend DLLs or their hashes.+Installer packaging is a separate release-maintainer workflow.++## Source build walkthrough++Use Windows x64 and a short repository path, for example `C:\src\fifa-street-pc`.+Install Git, .NET 8 SDK, Visual Studio C++ Build Tools with Windows SDK,+LLVM/Clang 18 or newer, CMake 3.25 or newer and Ninja. Open **Developer PowerShell+for VS** with the x64 toolchain, and run all commands from the repository root.+LLVM is expected at `C:\Program Files\LLVM`; CMake and Ninja must be on PATH.++If you have not cloned the project yet:++```powershell+git clone https://gitlab.com/samuelitodavila-group/fifa-street-pc.git+Set-Location fifa-street-pc+```++1. Prepare ReXGlue using the pinned revision and patch in **Prepare ReXGlue** below.+ Apply the patch once to a fresh checkout; do not apply it again on later builds.+2. Build the code generator and SDK with Direct3D 12 explicitly selected:++ ```powershell+ $env:PATH = "C:\Program Files\LLVM\bin;$env:PATH"+ cmake -S ReXGlue --preset win-amd64 -DREXGLUE_USE_D3D12=ON -DREXGLUE_USE_VULKAN=OFF+ cmake --build ReXGlue/out/build/win-amd64 --config Release --parallel 2+ ```++3. Place `extract-xiso.exe` in `Installer/tools/`. Extract your ISO into+ `dist/GameData` (replace the ISO path):++ ```powershell+ New-Item -ItemType Directory -Path dist -Force+ .\Installer\tools\extract-xiso.exe -x -d "$PWD\dist\GameData" "D:\Games\FIFA Street.iso"+ ```++ Stop if extraction fails. `dist/GameData` must contain `default.xex`,+ `fifadllzf.xex.dll`, and+ `dlc/dlc_FootballCompEng/dlc/FootballCompEng/FootballCompEngzf.xex.dll`.+ An existing extracted folder with these files can be used instead.++4. Generate and compile the game and its two guest modules:++ ```powershell+ $env:REXSDK_DIR = (Resolve-Path .\ReXGlue).Path+ .\Installer\BuildFifaStreet.ps1 -SourceBuild -GameData "$PWD\dist\GameData" -Output "$PWD\dist\Game" -Jobs 2+ ```++ The script also builds and installs its own Direct3D 12 runtime/GPU pair and+ runtime dependencies. No `Installer/sdk` bundle is needed. It prints the+ build workspace and full diagnostic log paths. Keep that workspace to resume+ with `-Workspace` after fixing a compilation error. `-Jobs 2` limits memory+ pressure; increase it only if sufficient RAM is available.++5. Build the launcher and copy the default game configuration:++ ```powershell+ dotnet publish Launcher/FifaStreetLauncher/FifaStreetLauncher.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o dist+ Copy-Item Installer/payload/Game/fifastreet.toml dist/Game/fifastreet.toml+ .\dist\FifaStreetLauncher.exe+ ```++ Select **Direct3D 12** and press **PLAY**. The output layout is `dist/Game`,+ `dist/GameData`, and the launcher in `dist`. This source workflow installs+ Direct3D 12 by default. To also build Vulkan, repeat step 4 with+ `-GraphicsApi Vulkan` and the same output directory. Use a new workspace for+ each graphics API; both backend folders remain available to the launcher.+ Vulkan adds the SDK's Vulkan dependencies and build requirements. Select the+ backend you built in the launcher. This workflow does not apply the graphical+ installer's menu-credit patch.++Troubleshooting:++- `clang.exe not found`: install LLVM in the path above.+- `ReXGlue code generator not found`: complete step 2; the script checks both+ `ReXGlue/out/win-amd64/Release/rexglue.exe` and the single-config output path.+- Windows SDK/linker errors: use the x64 Visual Studio developer terminal.+- Missing original module: check the extracted directory structure, including DLC.+- Backend hash mismatch: use `-SourceBuild`; release-bundle validation deliberately+ retains the official hash checks.++Run the backend installation regression check with:+`pwsh -NoProfile -File Installer/TestSourceBackend.ps1`.++## Release packaging prerequisites+- Windows x64, Git and the .NET 8 SDK with Windows desktop support.- Microsoft C++ Build Tools and Windows SDK, available through a developer terminal.- LLVM/Clang, CMake and Ninja.