ReStreet: FIFA Street (2012) recompiled for Windows PC, with online play, a launcher with friends, chat and rooms. Bring your own game.
Add multi-backend launcher and v0.3.0 updates
SamuelitoDaVila15b5bda959a8
diff --git a/Installer/BuildFifaStreet.ps1 b/Installer/BuildFifaStreet.ps1index 479a48f..7e98a48 100644--- a/Installer/BuildFifaStreet.ps1+++ b/Installer/BuildFifaStreet.ps1@@ -36,10 +36,13 @@ function Invoke-BuildTool {}$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"}+$bundledSdk = Join-Path $installerRoot 'sdk'$bundledTools = Join-Path $installerRoot 'compiler'$useBundledSdk = Test-Path -LiteralPath (Join-Path $bundledSdk 'bin\rexglue.exe')@@ -47,21 +50,33 @@ $llvmBin = if (Test-Path -LiteralPath $bundledTools) { Join-Path $bundledTools '$clang = Join-Path $llvmBin "clang.exe"$clangxx = Join-Path $llvmBin "clang++.exe"-if (!(Test-Path $clang)) { throw "clang.exe not found at $clang" }-if (!(Test-Path $clangxx)) { throw "clang++.exe not found at $clangxx" }++if (!(Test-Path $clang)) {+ throw "clang.exe not found at $clang"+}++if (!(Test-Path $clangxx)) {+ throw "clang++.exe not found at $clangxx"+}$env:PATH = "$llvmBin;$env:PATH"if ($useBundledSdk) { $env:PATH = "$(Join-Path $bundledSdk 'bin');$env:PATH" }$shortTempRoot = if ($env:FIFA_BUILD_ROOT) { $env:FIFA_BUILD_ROOT } else { "C:\FSTRB" }-if (!(Test-Path $shortTempRoot)) { New-Item -ItemType Directory -Path $shortTempRoot -Force | Out-Null }++if (!(Test-Path $shortTempRoot)) {+ New-Item -ItemType Directory -Path $shortTempRoot -Force | Out-Null+}$resume = ![string]::IsNullOrWhiteSpace($Workspace)$workRoot = if ($resume) { [IO.Path]::GetFullPath($Workspace) } else {Join-Path $shortTempRoot ([guid]::NewGuid().ToString("N").Substring(0, 8))}+$workProject = Join-Path $workRoot "FifaStreetRex"-if ($resume -and !(Test-Path -LiteralPath (Join-Path $workProject 'CMakeLists.txt'))) { throw "Invalid build workspace: $workRoot" }+if ($resume -and !(Test-Path -LiteralPath (Join-Path $workProject 'CMakeLists.txt'))) {+ throw "Invalid build workspace: $workRoot"+}$GameData = [IO.Path]::GetFullPath($GameData)$Output = [IO.Path]::GetFullPath($Output)@@ -71,20 +86,38 @@ Write-Host " FIFA Street PC - Recomp Build"Write-Host "======================================"Write-Host ""-if (!(Test-Path $GameData)) { throw "GameData does not exist: $GameData" }+if (!(Test-Path $GameData)) {+ throw "GameData does not exist: $GameData"+}$defaultXex = Join-Path $GameData "default.xex"$fifaDll = Join-Path $GameData "fifadllzf.xex.dll"$footballCompDll = Join-Path $GameData "dlc\dlc_FootballCompEng\dlc\FootballCompEng\FootballCompEngzf.xex.dll"-if (!(Test-Path $defaultXex)) { throw "default.xex was not found." }-if (!(Test-Path $fifaDll)) { throw "fifadllzf.xex.dll was not found." }-if (!(Test-Path $footballCompDll)) { throw "FootballCompEngzf.xex.dll was not found. This module is required for World Tour." }-if (!(Test-Path $template)) { throw "recomp-template was not found: $template" }-if (!$useBundledSdk -and !(Test-Path $rexGlueSource)) { throw "ReXGlue source was not found: $rexGlueSource" }+if (!(Test-Path $defaultXex)) {+ throw "default.xex was not found."+}++if (!(Test-Path $fifaDll)) {+ throw "fifadllzf.xex.dll was not found."+}++if (!(Test-Path $footballCompDll)) {+ throw "FootballCompEngzf.xex.dll was not found. This module is required for World Tour."+}++if (!(Test-Path $template)) {+ throw "recomp-template was not found: $template"+}++if (!$useBundledSdk -and !(Test-Path $rexGlueSource)) {+ throw "ReXGlue source was not found: $rexGlueSource"+}Write-Host "[1/6] Preparing temporary workspace..."+New-Item -ItemType Directory -Path $workProject -Force | Out-Null+Get-ChildItem -LiteralPath $template | Where-Object { $_.Name -ne 'fifastreet_manifest.toml' } |Copy-Item -Destination $workProject -Recurse -Force@@ -100,7 +133,9 @@ trap {}Write-Host "[2/6] Preparing manifest..."+$manifestPath = Join-Path $workProject "fifastreet_manifest.toml"+$gameDataUnix = $GameData.Replace("\", "/").Replace('"', '\"')$manifest = @"@@ -129,7 +164,9 @@ includes = []$manifest = $manifest.Replace("`r`n", "`n")$manifestChanged = !$resume -or [IO.File]::ReadAllText($manifestPath).Replace("`r`n", "`n").Trim() -ne $manifest.Trim()-if ($manifestChanged) { [System.IO.File]::WriteAllText($manifestPath, $manifest, [System.Text.UTF8Encoding]::new($false)) }+if ($manifestChanged) {+ [System.IO.File]::WriteAllText($manifestPath, $manifest, [System.Text.UTF8Encoding]::new($false))+}Write-Host ""Write-Host "Manifest:"@@ -137,20 +174,33 @@ Get-Content $manifestPathWrite-Host ""Write-Host "[3/6] Cleaning previous generated code..."+$generatedDefault = Join-Path $workProject "generated\default"$generatedDll = Join-Path $workProject "generated\fifadllzf_xex"$generatedFootballComp = Join-Path $workProject "generated\FootballCompEngzf_xex"-foreach ($generated in @($generatedDefault,$generatedDll,$generatedFootballComp)) {- if (!$resume -and (Test-Path $generated)) {- if (![IO.Path]::GetFullPath($generated).StartsWith($workProject + '\', [StringComparison]::OrdinalIgnoreCase)) { throw 'Unsafe generated path' }- Remove-Item $generated -Recurse -Force- }+if (!$resume -and (Test-Path $generatedDefault)) {+ if (![IO.Path]::GetFullPath($generatedDefault).StartsWith($workProject + '\', [StringComparison]::OrdinalIgnoreCase)) { throw 'Unsafe generated path' }+ Remove-Item $generatedDefault -Recurse -Force+}++if (!$resume -and (Test-Path $generatedDll)) {+ if (![IO.Path]::GetFullPath($generatedDll).StartsWith($workProject + '\', [StringComparison]::OrdinalIgnoreCase)) { throw 'Unsafe generated path' }+ Remove-Item $generatedDll -Recurse -Force+}++if (!$resume -and (Test-Path $generatedFootballComp)) {+ if (![IO.Path]::GetFullPath($generatedFootballComp).StartsWith($workProject + '\', [StringComparison]::OrdinalIgnoreCase)) { throw 'Unsafe generated path' }+ Remove-Item $generatedFootballComp -Recurse -Force}Write-Host "[4/6] Configuring build..."+Push-Location $workProject+try {++ # 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' }if (!(Test-Path -LiteralPath $codegen)) { throw "ReXGlue code generator not found: $codegen" }if ($manifestChanged -or !(Test-Path -LiteralPath (Join-Path $generatedDefault 'sources.cmake')) -or@@ -168,46 +218,124 @@ try {Write-Host ""Write-Host "[5/6] Compiling FIFA Street..."Write-Host ""+Invoke-BuildTool 'cmake' @('--build', '--preset', 'win-amd64-release', '--parallel', "$Jobs")++}+finally {+ Pop-Location}-finally { Pop-Location }$buildFolder = Join-Path $workProject "out\build\win-amd64-release"+$exe = Join-Path $buildFolder "fifastreet.exe"+$dll = Join-Path $buildFolder "fifastreet_fifadllzf_xex.dll"$footballCompOut = Join-Path $buildFolder "fifastreet_FootballCompEngzf_xex.dll"-if (!(Test-Path $exe)) { throw "The build finished but fifastreet.exe was not found." }-if (!(Test-Path $dll)) { throw "The build finished but fifastreet_fifadllzf_xex.dll was not found." }-if (!(Test-Path $footballCompOut)) { throw "The build finished but fifastreet_FootballCompEngzf_xex.dll was not found." }+if (!(Test-Path $exe)) {+ throw "The build finished but fifastreet.exe was not found."+}++if (!(Test-Path $dll)) {+ throw "The build finished but fifastreet_fifadllzf_xex.dll was not found."+}++if (!(Test-Path $footballCompOut)) {+ throw "The build finished but fifastreet_FootballCompEngzf_xex.dll was not found."+}Write-Host ""Write-Host "[6/6] Installing game binaries..."-New-Item -ItemType Directory -Path $Output -Force | Out-Null++New-Item `+ -ItemType Directory `+ -Path $Output `+ -Force | Out-Null+Copy-Item $exe $Output -Force+# Copy the recompiled game modules.Get-ChildItem -LiteralPath $buildFolder -Filter '*.dll' -File |Where-Object { $_.Name -notin @('rexruntime.dll', 'rexgpu-xenos.dll') } |Copy-Item -Destination $Output -Force-$validatedRuntimeRoot = Join-Path $bundledSdk 'bin'-$validatedRuntime = Join-Path $validatedRuntimeRoot 'rexruntime.dll'-$validatedGpu = Join-Path $validatedRuntimeRoot 'rexgpu-xenos.dll'-if (!(Test-Path -LiteralPath $validatedRuntime)) { throw "Validated rexruntime.dll was not found: $validatedRuntime" }-if (!(Test-Path -LiteralPath $validatedGpu)) { throw "Validated rexgpu-xenos.dll was not found: $validatedGpu" }+# Install both validated graphics backends.+$bundledBackends = Join-Path $bundledSdk 'backends'+$outputBackends = Join-Path $Output 'Backends'++New-Item -ItemType Directory -Path $outputBackends -Force | Out-Null++$expectedBackends = @{+ 'D3D12' = @{+ RuntimeHash = '790B6B1B13765249160E53DCE6F28AF0F03B66D5D1AEDB1054949C50B13F04E8'+ GpuHash = '461A88F1D27C605106453B0F3C92BD72BD4BC166DCDC0BBF01E825BCEFB8418D'+ }+ 'Vulkan' = @{+ RuntimeHash = '115722CC5905D07FC6A6212B47692FFE6405DD1BA9F87CDA97F8DA2C25E4767A'+ GpuHash = '71FA61D82FF6134F1F407D682ACEBAC01F2B3B2DCEFCC34151A0C082B746BDD2'+ }+}++foreach ($backendName in @('D3D12', 'Vulkan')) {+ $sourceBackend = Join-Path $bundledBackends $backendName+ $destinationBackend = Join-Path $outputBackends $backendName++ $sourceRuntime = Join-Path $sourceBackend 'rexruntime.dll'+ $sourceGpu = Join-Path $sourceBackend 'rexgpu-xenos.dll'++ if (!(Test-Path -LiteralPath $sourceRuntime)) {+ throw "$backendName rexruntime.dll was not found: $sourceRuntime"+ }-Copy-Item $validatedRuntime (Join-Path $Output 'rexruntime.dll') -Force-Copy-Item $validatedGpu (Join-Path $Output 'rexgpu-xenos.dll') -Force+ if (!(Test-Path -LiteralPath $sourceGpu)) {+ throw "$backendName rexgpu-xenos.dll was not found: $sourceGpu"+ }++ $runtimeHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $sourceRuntime).Hash+ $gpuHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $sourceGpu).Hash++ if ($runtimeHash -ne $expectedBackends[$backendName].RuntimeHash) {+ throw "$backendName rexruntime.dll is not the validated runtime."+ }+ if ($gpuHash -ne $expectedBackends[$backendName].GpuHash) {+ throw "$backendName rexgpu-xenos.dll is not the validated GPU backend."+ }++ New-Item -ItemType Directory -Path $destinationBackend -Force | Out-Null++ Copy-Item -LiteralPath $sourceRuntime `+ -Destination (Join-Path $destinationBackend 'rexruntime.dll') `+ -Force++ Copy-Item -LiteralPath $sourceGpu `+ -Destination (Join-Path $destinationBackend 'rexgpu-xenos.dll') `+ -Force+}++# D3D12 is the launcher's default graphics API, so install it as the+# initially active backend beside fifastreet.exe.+Copy-Item `+ -LiteralPath (Join-Path $outputBackends 'D3D12\rexruntime.dll') `+ -Destination (Join-Path $Output 'rexruntime.dll') `+ -Force++Copy-Item `+ -LiteralPath (Join-Path $outputBackends 'D3D12\rexgpu-xenos.dll') `+ -Destination (Join-Path $Output 'rexgpu-xenos.dll') `+ -ForceWrite-Host ""Write-Host "======================================"Write-Host " BUILD COMPLETE"Write-Host "======================================"Write-Host ""+Write-Host "Created:"Write-Host " $(Join-Path $Output 'fifastreet.exe')"Write-Host " $(Join-Path $Output 'fifastreet_fifadllzf_xex.dll')"Write-Host " $(Join-Path $Output 'fifastreet_FootballCompEngzf_xex.dll')"+Write-Host ""Write-Host "Temporary workspace:"Write-Host $workRootdiff --git a/Installer/BuildSetup.ps1 b/Installer/BuildSetup.ps1index 187ab4d..710030b 100644--- a/Installer/BuildSetup.ps1+++ b/Installer/BuildSetup.ps1@@ -22,32 +22,72 @@ dotnet publish (Join-Path $projectRoot 'Launcher\FifaStreetLauncher\FifaStreetLaif ($LASTEXITCODE -ne 0) { throw 'Falha ao publicar o launcher.' }Get-ChildItem -LiteralPath (Join-Path $stage 'payload') -Filter '*.pdb' | Remove-Item+# Use the installed public SDK layout, with the current runtime and code generator.Copy-Item -LiteralPath (Join-Path $projectRoot 'ReXGlue\out\install\win-amd64') -Destination (Join-Path $stage 'sdk') -Recurse$current = Join-Path $projectRoot 'ReXGlue\out\win-amd64'foreach ($name in @('rexglue.exe','rexruntime.dll','rexgpu-xenos.dll','TracyClient.dll')) { Copy-Item -LiteralPath (Join-Path $current $name) -Destination (Join-Path $stage 'sdk\bin') -Force }Get-ChildItem -LiteralPath $current -Filter '*.lib' | Copy-Item -Destination (Join-Path $stage 'sdk\lib') -Force+# Package both graphics backends validated with FIFA Street.+$backendRoot = Join-Path $stage 'sdk\backends'+$d3d12Package = Join-Path $backendRoot 'D3D12'+$vulkanPackage = Join-Path $backendRoot 'Vulkan'+New-Item -ItemType Directory -Path $d3d12Package -Force | Out-Null+New-Item -ItemType Directory -Path $vulkanPackage -Force | Out-Null++$d3d12 = Join-Path $projectRoot 'ReXGlue\out\win-amd64-d3d12\Release'$vulkan = Join-Path $projectRoot 'ReXGlue\out\win-amd64-vulkan\Release'-foreach ($name in @('rexruntime.dll','rexgpu-xenos.dll')) {- Copy-Item -LiteralPath (Join-Path $vulkan $name) -Destination (Join-Path $stage 'sdk\bin') -Force-}-$expectedRuntimeHashes = @{- 'rexruntime.dll' = '115722CC5905D07FC6A6212B47692FFE6405DD1BA9F87CDA97F8DA2C25E4767A'- 'rexgpu-xenos.dll' = '71FA61D82FF6134F1F407D682ACEBAC01F2B3B2DCEFCC34151A0C082B746BDD2'++$expectedBackends = @{+ 'D3D12' = @{+ Source = $d3d12+ Destination = $d3d12Package+ RuntimeHash = '790B6B1B13765249160E53DCE6F28AF0F03B66D5D1AEDB1054949C50B13F04E8'+ GpuHash = '461A88F1D27C605106453B0F3C92BD72BD4BC166DCDC0BBF01E825BCEFB8418D'+ }+ 'Vulkan' = @{+ Source = $vulkan+ Destination = $vulkanPackage+ RuntimeHash = '115722CC5905D07FC6A6212B47692FFE6405DD1BA9F87CDA97F8DA2C25E4767A'+ GpuHash = '71FA61D82FF6134F1F407D682ACEBAC01F2B3B2DCEFCC34151A0C082B746BDD2'+ }}-foreach ($name in $expectedRuntimeHashes.Keys) {- $packaged = Join-Path $stage "sdk\bin\$name"- $actual = (Get-FileHash -Algorithm SHA256 -LiteralPath $packaged).Hash- if ($actual -ne $expectedRuntimeHashes[$name]) {- throw "$name is not the validated FIFA Street runtime. Expected $($expectedRuntimeHashes[$name]), got $actual"++foreach ($backendName in @('D3D12', 'Vulkan')) {+ $backend = $expectedBackends[$backendName]++ foreach ($name in @('rexruntime.dll', 'rexgpu-xenos.dll')) {+ $source = Join-Path $backend.Source $name++ if (!(Test-Path -LiteralPath $source)) {+ throw "$backendName backend is missing: $source"+ }++ Copy-Item -LiteralPath $source -Destination $backend.Destination -Force+ }++ $runtimeFile = Join-Path $backend.Destination 'rexruntime.dll'+ $gpuFile = Join-Path $backend.Destination 'rexgpu-xenos.dll'++ $runtimeHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $runtimeFile).Hash+ $gpuHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $gpuFile).Hash++ if ($runtimeHash -ne $backend.RuntimeHash) {+ throw "$backendName rexruntime.dll hash mismatch. Expected $($backend.RuntimeHash), got $runtimeHash"+ }++ if ($gpuHash -ne $backend.GpuHash) {+ throw "$backendName rexgpu-xenos.dll hash mismatch. Expected $($backend.GpuHash), got $gpuHash"}}++# Keep the Vulkan import libraries in the SDK used to compile the game.+# The runtime DLLs themselves are installed from sdk\backends.foreach ($name in @('rexruntime.lib','rexgpu-xenos.lib')) {Copy-Item -LiteralPath (Join-Path $vulkan $name) -Destination (Join-Path $stage 'sdk\lib') -Force}Copy-Item -LiteralPath (Join-Path $projectRoot 'ReXGlue\include\rex') -Destination (Join-Path $stage 'sdk\include') -Recurse -ForceGet-ChildItem -LiteralPath (Join-Path $stage 'sdk\bin') -Filter 'rexglue.before*' | Remove-Item-New-Item -ItemType Directory -Path (Join-Path $stage 'compiler\bin') -Force | Out-Nullforeach ($name in @('clang.exe','clang++.exe','lld-link.exe','llvm-rc.exe','llvm-mt.exe')) { Copy-Item -LiteralPath "C:\Program Files\LLVM\bin\$name" -Destination (Join-Path $stage 'compiler\bin') }New-Item -ItemType Directory -Path (Join-Path $stage 'compiler\lib\clang') -Force | Out-Null@@ -55,7 +95,6 @@ Copy-Item -LiteralPath 'C:\Program Files\LLVM\lib\clang\23' -Destination (Join-Pforeach ($name in @('cmake.exe','cmcldeps.exe')) { Copy-Item -LiteralPath "C:\Program Files\CMake\bin\$name" -Destination (Join-Path $stage 'compiler\bin') }Copy-Item -LiteralPath 'C:\Program Files\CMake\share' -Destination (Join-Path $stage 'compiler\share') -RecurseCopy-Item -LiteralPath 'C:\Users\Samuel M\miniconda3\Library\bin\ninja.exe' -Destination (Join-Path $stage 'compiler\bin')-New-Item -ItemType Directory -Path (Join-Path $stage 'licenses') -Force | Out-NullCopy-Item -LiteralPath (Join-Path $root 'FifaStreetSetupTool\ThirdParty\MonoGame-LICENSE.txt') -Destination (Join-Path $stage 'licenses\MonoGame-LZX-MS-PL.txt')Copy-Item -LiteralPath (Join-Path $projectRoot 'ReXGlue\LICENSE') -Destination (Join-Path $stage 'licenses\ReXGlue.txt')diff --git a/Installer/README.md b/Installer/README.mdindex bbcb68b..cd004fe 100644--- a/Installer/README.md+++ b/Installer/README.md@@ -1,9 +1,21 @@-# Installer source+# Installer source-This folder contains the English Windows installer, its local-build script and the public recompilation template. The installer takes a user's ISO and produces the game locally.+This 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.-The GUI validates the ISO, copies extracted data, applies the start-screen/main-menu credits, then compiles both game modules. `CreditPatch.cs` verifies supported menu hashes and rebuilds the companion archive index. The small embedded recipe contains credit differences, not complete proprietary archives.+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:++- `fifastreet.exe`+- `fifastreet_fifadllzf_xex.dll`+- `fifastreet_FootballCompEngzf_xex.dll`++`FootballCompEngzf.xex.dll` is discovered in the game's DLC tree and is required for the validated World Tour flow.++The v0.3.0 package includes validated **Direct3D 12** and **Vulkan** ReXGlue backend pairs under `Game/Backends/`. `BuildSetup.ps1` and `BuildFifaStreet.ps1` verify the expected backend SHA-256 hashes before packaging/installing them. Direct3D 12 is installed as the initially active backend; the launcher switches backend DLLs when required.++`CreditPatch.cs` verifies supported menu hashes and rebuilds the companion archive index. The small embedded recipe contains credit differences, not complete proprietary archives.The third-party LZX decoder retains its Ms-PL notice. Original installer source uses the root MIT license. Game data, original executables and generated guest code are excluded.diff --git a/Installer/recomp-template/CMakeLists.txt b/Installer/recomp-template/CMakeLists.txtindex f160996..49eb2b0 100644--- a/Installer/recomp-template/CMakeLists.txt+++ b/Installer/recomp-template/CMakeLists.txt@@ -10,6 +10,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)include(generated/rexglue.cmake)+# Sourcesset(FIFASTREET_SOURCESsrc/main.cpp)@@ -34,11 +35,17 @@ endif()rexglue_setup_target(fifastreet GPU_PLUGINS xenos)target_include_directories(fifastreet PRIVATE src)+# The source SDK keeps ImGui private to rexruntime; its public UI headers+# still require the include directory when compiling the host application.+# Propagate headers only, keeping the ImGui objects in the shared runtime.if(TARGET imgui::imgui)target_include_directories(fifastreet PRIVATE$<TARGET_PROPERTY:imgui::imgui,INTERFACE_INCLUDE_DIRECTORIES>)endif()+# Guest SIMD code must be optimized even when using the debug runtime. Keep+# debug symbols and checked runtime libraries while avoiding unoptimized SIMD+# wrappers in the game and its separately compiled DLL.if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")target_compile_options(fifastreet PRIVATE -O2)if(TARGET fifastreet_recomp)@@ -46,6 +53,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")endif()endif()+# FIFA Street DLL-specific kernel stubs.if(TARGET fifastreet_fifadllzf_xex)if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")target_compile_options(fifastreet_fifadllzf_xex PRIVATE -O2)diff --git a/Installer/recomp-template/fifastreet_manifest.toml b/Installer/recomp-template/fifastreet_manifest.tomlindex 225755c..0c809a0 100644--- a/Installer/recomp-template/fifastreet_manifest.toml+++ b/Installer/recomp-template/fifastreet_manifest.toml@@ -1,4 +1,4 @@-# Generated by ReXGlue v0.10.0.2-dev.gc94f5eb on 2026-09-30 00:37:42 UTC.+# Generated by ReXGlue v0.10.0.2-dev.gc94f5eb on 2026-09-30 00:37:42 UTC.[project]name = "fifastreet"diff --git a/Launcher/FifaStreetLauncher/LauncherForm.cs b/Launcher/FifaStreetLauncher/LauncherForm.csindex a0b9b69..8c18cc3 100644--- a/Launcher/FifaStreetLauncher/LauncherForm.cs+++ b/Launcher/FifaStreetLauncher/LauncherForm.cs@@ -1,1469 +1,1621 @@-using System;-using System.Collections.Generic;-using System.Diagnostics;-using System.Drawing;-using System.Drawing.Drawing2D;-using System.IO;-using System.Linq;-using System.Runtime.InteropServices;-using System.Text.Json;-using System.Windows.Forms;--namespace FifaStreetLauncher;--public class LauncherForm : Form-{- private readonly Color Bg = Color.FromArgb(10, 12, 16);- private readonly Color Surface = Color.FromArgb(18, 22, 28);- private readonly Color SurfaceAlt = Color.FromArgb(24, 29, 36);- private readonly Color Border = Color.FromArgb(48, 57, 68);- private readonly Color Accent = Color.FromArgb(133, 255, 72);- private readonly Color AccentHover = Color.FromArgb(111, 229, 53);- private readonly Color TextPrimary = Color.FromArgb(245, 247, 250);- private readonly Color TextSecondary = Color.FromArgb(151, 161, 175);-- private readonly ComboBox resolutionBox = new();- private readonly ComboBox refreshBox = new();- private readonly ComboBox displayModeBox = new();- private readonly ComboBox monitorBox = new();- private readonly ComboBox gpuBox = new();- private readonly List<int> gpuAdapterIndices = new();- private readonly ComboBox postEffectBox = new();- private readonly ComboBox readbackResolveBox = new();-- private readonly CheckBox vsyncBox = new();- private readonly CheckBox vrrBox = new();- private readonly CheckBox msaaBox = new();- private readonly CheckBox readbackMemexportBox = new();- private readonly CheckBox readbackMemexportFastBox = new();- private readonly CheckBox clearMemoryPageStateBox = new();- private readonly CheckBox occlusionQueryBox = new();- private readonly CheckBox asyncShadersBox = new();-- private readonly TextBox gamePathBox = new();- private readonly TextBox exePathBox = new();-- private readonly Label statusLabel = new();- private readonly Label hardwareLabel = new();- private readonly Label advancedChevron = new();-- private readonly RoundedPanel advancedPanel = new();- private readonly ModernButton advancedButton = new();- private readonly RoundedPanel compatibilityPanel = new();- private readonly ModernButton compatibilityButton = new();-- private bool advancedVisible;- private bool compatibilityVisible;- private string renderTargetPath = "rov";-- private string SettingsPath =>- Path.Combine(AppContext.BaseDirectory, "settings.json");-- public LauncherForm()- {- Text = "FIFA Street Launcher";- using (var icon = typeof(LauncherForm).Assembly.GetManifestResourceStream("fifastreet.ico")!)- Icon = new Icon(icon);- ClientSize = new Size(1250, 690);- MinimumSize = new Size(1266, 729);- MaximumSize = new Size(1266, 930);- StartPosition = FormStartPosition.CenterScreen;- FormBorderStyle = FormBorderStyle.FixedSingle;- MaximizeBox = false;- BackColor = Bg;- ForeColor = TextPrimary;- Font = new Font("Segoe UI", 10F);- AutoScaleMode = AutoScaleMode.Dpi;-- BuildInterface();- WireEvents();- LoadDefaults();- LoadSettings();- UpdateSummary();- UpdateStatus("Ready to play", true);- }-- private void BuildInterface()- {- SuspendLayout();-- var brand = new Label- {- Text = "FIFA STREET",- Font = new Font("Segoe UI", 30F, FontStyle.Bold),- ForeColor = TextPrimary,- AutoSize = true,- Location = new Point(40, 30)- };- Controls.Add(brand);-- var subtitle = new Label- {- Text = "NATIVE PC RECOMP",- Font = new Font("Segoe UI Semibold", 9F),- ForeColor = Accent,- AutoSize = true,- Location = new Point(44, 84)- };- Controls.Add(subtitle);-- var topLine = new Panel- {- BackColor = Accent,- Location = new Point(40, 112),- Size = new Size(860, 2)- };- Controls.Add(topLine);-- var readyDot = new Label- {- Text = "●",- ForeColor = Accent,- AutoSize = true,- Font = new Font("Segoe UI", 10F, FontStyle.Bold),- Location = new Point(726, 45)- };- Controls.Add(readyDot);-- statusLabel.AutoSize = true;- statusLabel.Font = new Font("Segoe UI Semibold", 9.5F);- statusLabel.ForeColor = TextSecondary;- statusLabel.Location = new Point(746, 46);- Controls.Add(statusLabel);-- hardwareLabel.Text = "Detecting hardware...";- hardwareLabel.ForeColor = TextSecondary;- hardwareLabel.Font = new Font("Segoe UI", 9.5F);- hardwareLabel.AutoEllipsis = true;- hardwareLabel.TextAlign = ContentAlignment.MiddleRight;- hardwareLabel.Location = new Point(500, 75);- hardwareLabel.Size = new Size(400, 52);- Controls.Add(hardwareLabel);-- var displayCard = CreateCard(new Point(40, 145), new Size(410, 330));- Controls.Add(displayCard);-- AddSectionHeader(displayCard, "DISPLAY", "Display settings", 24, 20);-- AddFieldLabel(displayCard, "Resolution", 24, 82);- ConfigureCombo(resolutionBox, 24, 106, 362);- displayCard.Controls.Add(resolutionBox);-- AddFieldLabel(displayCard, "Refresh rate", 24, 150);- ConfigureCombo(refreshBox, 24, 174, 175);- displayCard.Controls.Add(refreshBox);-- AddFieldLabel(displayCard, "Display mode", 211, 150);- ConfigureCombo(displayModeBox, 211, 174, 175);- displayCard.Controls.Add(displayModeBox);-- AddFieldLabel(displayCard, "Monitor", 24, 218);- ConfigureCombo(monitorBox, 24, 242, 362);- displayCard.Controls.Add(monitorBox);-- ConfigureCheck(vsyncBox, "VSync", 24, 288);- ConfigureCheck(vrrBox, "VRR / Tearing", 198, 288);- displayCard.Controls.Add(vsyncBox);- displayCard.Controls.Add(vrrBox);-- var graphicsCard = CreateCard(new Point(470, 145), new Size(430, 330));- Controls.Add(graphicsCard);-- AddSectionHeader(graphicsCard, "GRAPHICS", "Quality and presentation", 24, 20);-- AddFieldLabel(graphicsCard, "GPU", 24, 82);- ConfigureCombo(gpuBox, 24, 106, 382);- graphicsCard.Controls.Add(gpuBox);-- AddFieldLabel(graphicsCard, "Post-processing", 24, 150);- ConfigureCombo(postEffectBox, 24, 174, 382);- graphicsCard.Controls.Add(postEffectBox);-- ConfigureCheck(msaaBox, "Native 2x MSAA", 24, 233);- graphicsCard.Controls.Add(msaaBox);-- var fpsTitle = new Label- {- Text = "FPS",- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 9F),- AutoSize = true,- Location = new Point(24, 280)- };- graphicsCard.Controls.Add(fpsTitle);-- var fpsInfo = new Label- {- Text = "Controlled by the game, VSync and refresh rate",- ForeColor = TextSecondary,- Font = new Font("Segoe UI", 8.7F),- AutoSize = true,- Location = new Point(67, 281)- };- graphicsCard.Controls.Add(fpsInfo);-- advancedButton.Text = "ADVANCED SETTINGS";- advancedButton.Location = new Point(40, 497);- advancedButton.Size = new Size(235, 40);- advancedButton.FillColor = SurfaceAlt;- advancedButton.HoverColor = Color.FromArgb(34, 41, 50);- advancedButton.BorderColor = Border;- advancedButton.ForeColor = TextPrimary;- advancedButton.Font = new Font("Segoe UI Semibold", 9F);- advancedButton.Radius = 10;- Controls.Add(advancedButton);-- advancedChevron.Text = "⌄";- advancedChevron.ForeColor = TextSecondary;- advancedChevron.Font = new Font("Segoe UI", 13F, FontStyle.Bold);- advancedChevron.AutoSize = true;- advancedChevron.Location = new Point(249, 505);- advancedChevron.BackColor = Color.Transparent;- advancedChevron.Cursor = Cursors.Hand;- Controls.Add(advancedChevron);-- compatibilityButton.Text = "COMPATIBILITY";- compatibilityButton.Location = new Point(290, 497);- compatibilityButton.Size = new Size(205, 40);- compatibilityButton.FillColor = SurfaceAlt;- compatibilityButton.HoverColor = Color.FromArgb(34, 41, 50);- compatibilityButton.BorderColor = Border;- compatibilityButton.ForeColor = TextPrimary;- compatibilityButton.Font = new Font("Segoe UI Semibold", 9F);- compatibilityButton.Radius = 10;- Controls.Add(compatibilityButton);-- ConfigureAdvancedPanel();- Controls.Add(advancedPanel);-- ConfigureCompatibilityPanel();- Controls.Add(compatibilityPanel);-- var logsButton = new ModernButton- {- Text = "OPEN LOGS",- Location = new Point(40, 576),- Size = new Size(150, 42),- FillColor = SurfaceAlt,- HoverColor = Color.FromArgb(34, 41, 50),- BorderColor = Border,- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 9F),- Radius = 10- };- logsButton.Click += (_, _) => OpenLogs();- Controls.Add(logsButton);-- var folderButton = new ModernButton- {- Text = "OPEN FOLDER",- Location = new Point(750, 576),- Size = new Size(150, 42),- FillColor = SurfaceAlt,- HoverColor = Color.FromArgb(34, 41, 50),- BorderColor = Border,- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 9F),- Radius = 10- };- folderButton.Click += (_, _) => OpenGameFolder();- Controls.Add(folderButton);-- var playButton = new ModernButton- {- Text = "PLAY",- Location = new Point(305, 558),- Size = new Size(330, 76),- FillColor = Accent,- HoverColor = AccentHover,- BorderColor = Accent,- ForeColor = Color.FromArgb(9, 14, 8),- Font = new Font("Segoe UI", 18F, FontStyle.Bold),- Radius = 14- };- playButton.Click += (_, _) => LaunchGame();- Controls.Add(playButton);-- var footer = new Label- {- Text = "FIFA Street • Native PC Recomp Launcher",- ForeColor = Color.FromArgb(92, 102, 116),- Font = new Font("Segoe UI", 8.5F),- AutoSize = true,- Location = new Point(40, 653)- };- Controls.Add(footer);-- foreach (Control control in Controls) control.Left += 310;- using var resource = typeof(LauncherForm).Assembly.GetManifestResourceStream("cover.jpg")!;- using var cover = Image.FromStream(resource);- var artwork = new MessiPicture- {- Image = new Bitmap(cover), Bounds = new Rectangle(0, 0, 310, ClientSize.Height),- Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left- };- Controls.Add(artwork);- FormClosed += (_, _) => artwork.Image?.Dispose();- var credit = new Label- {- Text = "PORTED BY: SAMUELITODAVILA", AutoSize = true,- ForeColor = Accent, Font = new Font("Segoe UI", 8.5F),- Location = new Point(905, 653), Tag = "credit"- };- Controls.Add(credit);-- ResumeLayout(false);- PerformLayout();- }-- private void ConfigureAdvancedPanel()- {- advancedPanel.Location = new Point(40, 548);- advancedPanel.Size = new Size(860, 126);- advancedPanel.FillColor = Surface;- advancedPanel.BorderColor = Border;- advancedPanel.Radius = 14;- advancedPanel.Visible = false;-- AddFieldLabel(advancedPanel, "Game executable", 22, 18);- exePathBox.Location = new Point(22, 42);- exePathBox.Size = new Size(688, 27);- StyleTextBox(exePathBox);- advancedPanel.Controls.Add(exePathBox);-- var browseExe = new ModernButton- {- Text = "BROWSE",- Location = new Point(724, 39),- Size = new Size(112, 34),- FillColor = SurfaceAlt,- HoverColor = Color.FromArgb(34, 41, 50),- BorderColor = Border,- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 8.5F),- Radius = 8- };- browseExe.Click += (_, _) => BrowseExe();- advancedPanel.Controls.Add(browseExe);-- AddFieldLabel(advancedPanel, "Game data folder", 22, 76);- gamePathBox.Location = new Point(22, 98);- gamePathBox.Size = new Size(688, 27);- StyleTextBox(gamePathBox);- advancedPanel.Controls.Add(gamePathBox);-- var browseGame = new ModernButton- {- Text = "BROWSE",- Location = new Point(724, 95),- Size = new Size(112, 34),- FillColor = SurfaceAlt,- HoverColor = Color.FromArgb(34, 41, 50),- BorderColor = Border,- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 8.5F),- Radius = 8- };- browseGame.Click += (_, _) => BrowseGame();- advancedPanel.Controls.Add(browseGame);- }-- private void ConfigureCompatibilityPanel()- {- compatibilityPanel.Location = new Point(40, 548);- compatibilityPanel.Size = new Size(860, 182);- compatibilityPanel.FillColor = Surface;- compatibilityPanel.BorderColor = Border;- compatibilityPanel.Radius = 14;- compatibilityPanel.Visible = false;-- AddSectionHeader(- compatibilityPanel,- "COMPATIBILITY",- "Renderer options for textures, lighting, black screens and stutter",- 22,- 15- );-- AddFieldLabel(compatibilityPanel, "Readback Resolve", 22, 70);- ConfigureCombo(readbackResolveBox, 22, 94, 205);- compatibilityPanel.Controls.Add(readbackResolveBox);-- ConfigureCheck(readbackMemexportBox, "Memory Export", 260, 72);- ConfigureCheck(readbackMemexportFastBox, "Fast MemExport", 430, 72);- ConfigureCheck(clearMemoryPageStateBox, "Memory Page State", 615, 72);-- compatibilityPanel.Controls.Add(readbackMemexportBox);- compatibilityPanel.Controls.Add(readbackMemexportFastBox);- compatibilityPanel.Controls.Add(clearMemoryPageStateBox);-- ConfigureCheck(occlusionQueryBox, "Occlusion Queries", 260, 112);- ConfigureCheck(asyncShadersBox, "Async Shaders", 430, 112);-- compatibilityPanel.Controls.Add(occlusionQueryBox);- compatibilityPanel.Controls.Add(asyncShadersBox);-- var hint = new Label- {- Text = "Try None, Some, Fast, then Full. Full is the most accurate option, but may significantly reduce performance.",- ForeColor = TextSecondary,- Font = new Font("Segoe UI", 8.5F),- AutoSize = true,- Location = new Point(22, 151)- };- compatibilityPanel.Controls.Add(hint);- }-- private void WireEvents()- {- advancedButton.Click += (_, _) => ToggleAdvanced();- advancedChevron.Click += (_, _) => ToggleAdvanced();- compatibilityButton.Click += (_, _) => ToggleCompatibility();-- monitorBox.SelectedIndexChanged += (_, _) =>- {- DetectDisplayModes();- UpdateSummary();- };-- resolutionBox.SelectedIndexChanged += (_, _) => UpdateSummary();- refreshBox.SelectedIndexChanged += (_, _) => UpdateSummary();- gpuBox.SelectedIndexChanged += (_, _) => UpdateSummary();- displayModeBox.SelectedIndexChanged += (_, _) => UpdateSummary();- }-- private void ToggleAdvanced()- {- if (compatibilityVisible)- {- compatibilityVisible = false;- compatibilityPanel.Visible = false;- }-- advancedVisible = !advancedVisible;- advancedPanel.Visible = advancedVisible;- advancedChevron.Text = advancedVisible ? "⌃" : "⌄";-- if (advancedVisible)- {- ClientSize = new Size(1250, 805);- advancedPanel.Location = new Point(350, 548);- MoveBottomControls(691, 673, 788);- }- else- {- ClientSize = new Size(1250, 690);- MoveBottomControls(576, 558, 653);- }- }-- private void ToggleCompatibility()- {- if (advancedVisible)- {- advancedVisible = false;- advancedPanel.Visible = false;- advancedChevron.Text = "⌄";- }-- compatibilityVisible = !compatibilityVisible;- compatibilityPanel.Visible = compatibilityVisible;-- if (compatibilityVisible)- {- ClientSize = new Size(1250, 865);- compatibilityPanel.Location = new Point(350, 548);- MoveBottomControls(748, 730, 848);- }- else- {- ClientSize = new Size(1250, 690);- MoveBottomControls(576, 558, 653);- }- }-- private void MoveBottomControls(int secondaryY, int playY, int footerY)- {- foreach (Control control in Controls)- {- if (control is ModernButton button)- {- if (button.Text == "OPEN LOGS" || button.Text == "OPEN FOLDER")- button.Top = secondaryY;- else if (button.Text == "PLAY")- button.Top = playY;- }- else if (control is Label label &&- (label.Text.StartsWith("FIFA Street •", StringComparison.Ordinal) || label.Tag as string == "credit"))- {- label.Top = footerY;- }- }- }-- private RoundedPanel CreateCard(Point location, Size size)- {- return new RoundedPanel- {- Location = location,- Size = size,- FillColor = Surface,- BorderColor = Border,- Radius = 16- };- }-- private void AddSectionHeader(Control parent, string title, string subtitle, int x, int y)- {- var titleLabel = new Label- {- Text = title,- ForeColor = TextPrimary,- Font = new Font("Segoe UI Semibold", 11F, FontStyle.Bold),- AutoSize = true,- Location = new Point(x, y)- };- parent.Controls.Add(titleLabel);-- var subtitleLabel = new Label- {- Text = subtitle,- ForeColor = TextSecondary,- Font = new Font("Segoe UI", 8.8F),- AutoSize = true,- Location = new Point(x, y + 26)- };- parent.Controls.Add(subtitleLabel);- }-- private void AddFieldLabel(Control parent, string text, int x, int y)- {- var label = new Label- {- Text = text,- ForeColor = TextSecondary,- Font = new Font("Segoe UI Semibold", 8.7F),- AutoSize = true,- Location = new Point(x, y)- };- parent.Controls.Add(label);- }-- private void ConfigureCombo(ComboBox box, int x, int y, int width)- {- box.Location = new Point(x, y);- box.Size = new Size(width, 30);- box.DropDownStyle = ComboBoxStyle.DropDownList;- box.FlatStyle = FlatStyle.Flat;- box.BackColor = SurfaceAlt;- box.ForeColor = TextPrimary;- box.Font = new Font("Segoe UI", 9.7F);- box.DrawMode = DrawMode.OwnerDrawFixed;- box.ItemHeight = 22;- box.DrawItem += (_, e) =>- {- using var background = new SolidBrush(SurfaceAlt);- e.Graphics.FillRectangle(background, e.Bounds);- string text = e.Index >= 0 ? box.Items[e.Index]?.ToString() ?? "" : box.Text;- TextRenderer.DrawText(e.Graphics, text, box.Font, e.Bounds, TextPrimary,- TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);- e.DrawFocusRectangle();- };- box.IntegralHeight = false;- box.DropDownHeight = 240;- }-- private void ConfigureCheck(CheckBox box, string text, int x, int y)- {- box.Text = text;- box.Location = new Point(x, y);- box.AutoSize = true;- box.ForeColor = TextPrimary;- box.BackColor = Color.Transparent;- box.Font = new Font("Segoe UI Semibold", 9.2F);- box.Cursor = Cursors.Hand;- }-- private void StyleTextBox(TextBox box)- {- box.BackColor = SurfaceAlt;- box.ForeColor = TextPrimary;- box.BorderStyle = BorderStyle.FixedSingle;- box.Font = new Font("Segoe UI", 9F);- }-- private void LoadDefaults()- {- exePathBox.Text =- Path.Combine(AppContext.BaseDirectory, "Game", "fifastreet.exe");-- gamePathBox.Text =- Path.Combine(AppContext.BaseDirectory, "GameData");-- displayModeBox.Items.AddRange(new object[]- {- "Fullscreen",- "Windowed"- });- displayModeBox.SelectedIndex = 0;-- monitorBox.Items.Clear();- foreach (var screen in Screen.AllScreens)- {- string primary = screen.Primary ? " • Primary" : "";- monitorBox.Items.Add(- $"{monitorBox.Items.Count}: {screen.DeviceName}{primary}"- );- }-- if (monitorBox.Items.Count > 0)- monitorBox.SelectedIndex = 0;-- DetectDisplayModes();- DetectGpus();-- postEffectBox.Items.AddRange(new object[]- {- "None",- "FXAA",- "FXAA Extreme"- });- postEffectBox.SelectedIndex = 0;-- readbackResolveBox.Items.AddRange(new object[]- {- "None",- "Some",- "Fast",- "Full"- });- readbackResolveBox.SelectedIndex = 3; // Full: validated FIFA Street configuration-- readbackMemexportBox.Checked = true;- readbackMemexportFastBox.Checked = true;- clearMemoryPageStateBox.Checked = false;- occlusionQueryBox.Checked = true;- asyncShadersBox.Checked = true;-- vsyncBox.Checked = true;- vrrBox.Checked = false;- msaaBox.Checked = false;- }-- private void DetectGpus()- {- gpuBox.Items.Clear();- gpuAdapterIndices.Clear();- gpuBox.Items.Add("Automatic");- gpuAdapterIndices.Add(-1);-- try- {- foreach (var gpu in DxgiAdapters.Enumerate())- {- gpuBox.Items.Add(- $"Adapter {gpu.Index}: {gpu.Name}"- );- gpuAdapterIndices.Add(checked((int)gpu.Index));- }- }- catch- {- // Automatic selection remains available when DXGI enumeration fails.- }-- gpuBox.Items.Add("WARP (Software)");- gpuAdapterIndices.Add(-2);- gpuBox.SelectedIndex = 0;- }-- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]- private struct DEVMODE- {- private const int CCHDEVICENAME = 32;- private const int CCHFORMNAME = 32;-- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]- public string dmDeviceName;-- public short dmSpecVersion;- public short dmDriverVersion;- public short dmSize;- public short dmDriverExtra;- public int dmFields;-- public int dmPositionX;- public int dmPositionY;- public int dmDisplayOrientation;- public int dmDisplayFixedOutput;-- public short dmColor;- public short dmDuplex;- public short dmYResolution;- public short dmTTOption;- public short dmCollate;-- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHFORMNAME)]- public string dmFormName;-- public short dmLogPixels;- public int dmBitsPerPel;- public int dmPelsWidth;- public int dmPelsHeight;- public int dmDisplayFlags;- public int dmDisplayFrequency;-- public int dmICMMethod;- public int dmICMIntent;- public int dmMediaType;- public int dmDitherType;- public int dmReserved1;- public int dmReserved2;- public int dmPanningWidth;- public int dmPanningHeight;- }-- [DllImport("user32.dll", CharSet = CharSet.Ansi)]- private static extern bool EnumDisplaySettings(- string deviceName,- int modeNum,- ref DEVMODE devMode- );-- private const int ENUM_CURRENT_SETTINGS = -1;-- private void DetectDisplayModes()- {- string? oldResolution = resolutionBox.SelectedItem?.ToString();- string? oldRefresh = refreshBox.SelectedItem?.ToString();-- resolutionBox.Items.Clear();- refreshBox.Items.Clear();-- var resolutions = new HashSet<string>();- var refreshRates = new SortedSet<int>();-- Screen screen =- monitorBox.SelectedIndex >= 0 &&- monitorBox.SelectedIndex < Screen.AllScreens.Length- ? Screen.AllScreens[monitorBox.SelectedIndex]- : Screen.PrimaryScreen!;-- int modeNum = 0;-- while (true)- {- DEVMODE mode = CreateDevMode();-- if (!EnumDisplaySettings(- screen.DeviceName,- modeNum,- ref mode))- {- break;- }-- if (mode.dmPelsWidth >= 1280 &&- mode.dmPelsHeight >= 720 &&- mode.dmBitsPerPel >= 32)- {- resolutions.Add(- $"{mode.dmPelsWidth}x{mode.dmPelsHeight}"- );-- if (mode.dmDisplayFrequency > 20 &&- mode.dmDisplayFrequency < 1000)- {- refreshRates.Add(mode.dmDisplayFrequency);- }- }-- modeNum++;- }-- foreach (string resolution in resolutions- .OrderBy(x =>- {- var p = x.Split('x');- return int.Parse(p[0]) * int.Parse(p[1]);- }))- {- resolutionBox.Items.Add(resolution);- }-- foreach (int hz in refreshRates)- {- refreshBox.Items.Add(hz.ToString());- }-- if (resolutionBox.Items.Count == 0)- {- resolutionBox.Items.AddRange(new object[]- {- "1280x720",- "1600x900",- "1920x1080",- "2560x1440",- "3840x2160"- });- }-- if (refreshBox.Items.Count == 0)- {- refreshBox.Items.AddRange(new object[]- {- "30", "50", "60", "75", "100",- "120", "144", "165", "180", "200", "240"- });- }-- if (!string.IsNullOrWhiteSpace(oldResolution) &&- resolutionBox.Items.Contains(oldResolution))- {- resolutionBox.SelectedItem = oldResolution;- }- else- {- string currentResolution =- $"{screen.Bounds.Width}x{screen.Bounds.Height}";-- if (resolutionBox.Items.Contains(currentResolution))- resolutionBox.SelectedItem = currentResolution;- else if (resolutionBox.Items.Count > 0)- resolutionBox.SelectedIndex = resolutionBox.Items.Count - 1;- }-- if (!string.IsNullOrWhiteSpace(oldRefresh) &&- refreshBox.Items.Contains(oldRefresh))- {- refreshBox.SelectedItem = oldRefresh;- }- else- {- DEVMODE currentMode = CreateDevMode();-- if (EnumDisplaySettings(- screen.DeviceName,- ENUM_CURRENT_SETTINGS,- ref currentMode))- {- string currentHz =- currentMode.dmDisplayFrequency.ToString();-- if (refreshBox.Items.Contains(currentHz))- refreshBox.SelectedItem = currentHz;- }-- if (refreshBox.SelectedIndex < 0 &&- refreshBox.Items.Count > 0)- {- refreshBox.SelectedIndex = 0;- }- }- }-- private static DEVMODE CreateDevMode()- {- return new DEVMODE- {- dmDeviceName = new string('\0', 32),- dmFormName = new string('\0', 32),- dmSize = (short)Marshal.SizeOf<DEVMODE>()- };- }-- internal static int RenderScale(int width, int height) =>- Math.Clamp((int)Math.Ceiling(Math.Max(width / 1280.0, height / 720.0)), 1, 8);-- private void UpdateSummary()- {- string gpu = gpuBox.SelectedItem?.ToString() ?? "Automatic GPU";- if (gpu.StartsWith("Adapter ", StringComparison.Ordinal))- {- int colon = gpu.IndexOf(':');- if (colon >= 0 && colon + 1 < gpu.Length)- gpu = gpu[(colon + 1)..].Trim();- }-- string resolution = resolutionBox.SelectedItem?.ToString() ?? "Resolution";- string hz = refreshBox.SelectedItem?.ToString() ?? "--";-- var dimensions = resolution.Split('x');- string internalSize = dimensions.Length == 2 && int.TryParse(dimensions[0], out int w) && int.TryParse(dimensions[1], out int h)- ? $"{Environment.NewLine}Internal render resolution: {1280 * RenderScale(w, h)}x{720 * RenderScale(w, h)}" : "";- hardwareLabel.Text = $"{gpu} • {resolution} • {hz} Hz{internalSize}";- }-- private void UpdateStatus(string text, bool ok)- {- statusLabel.Text = text;- statusLabel.ForeColor = ok ? TextSecondary : Color.FromArgb(255, 120, 120);- }-- private void LaunchGame()- {- try- {- string exe = exePathBox.Text.Trim();- string gameRoot = gamePathBox.Text.Trim();-- if (!File.Exists(exe))- {- ShowError("fifastreet.exe was not found.");- return;- }-- if (!Directory.Exists(gameRoot))- {- ShowError("The game data folder does not exist.");- return;- }-- if (!File.Exists(Path.Combine(gameRoot, "default.xex")))- {- MessageBox.Show(- "The selected folder does not contain default.xex.",- "Invalid folder",- MessageBoxButtons.OK,- MessageBoxIcon.Warning- );- return;- }-- if (string.IsNullOrWhiteSpace(resolutionBox.Text) ||- !resolutionBox.Text.Contains('x'))- {- ShowError("Select a valid resolution.");- return;- }-- var resolution = resolutionBox.Text.Split('x');- int width = int.Parse(resolution[0]);- int height = int.Parse(resolution[1]);- string refresh = refreshBox.Text;-- bool fullscreen =- displayModeBox.SelectedItem?.ToString() == "Fullscreen";-- int monitor = Math.Max(0, monitorBox.SelectedIndex);-- int adapter = gpuBox.SelectedIndex >= 0- ? gpuAdapterIndices[gpuBox.SelectedIndex] : -1;-- string postEffect = postEffectBox.SelectedIndex switch- {- 1 => "fxaa",- 2 => "fxaa_extreme",- _ => "none"- };-- string readbackResolve = readbackResolveBox.SelectedIndex switch- {- 1 => "some",- 2 => "fast",- 3 => "full",- _ => "none"- };-- string logsDir = Path.Combine(- Path.GetDirectoryName(exe)!,- "Logs"- );-- Directory.CreateDirectory(logsDir);-- string logFile =- Path.Combine(logsDir, "fifastreet.log");-- var startInfo = new ProcessStartInfo- {- FileName = exe,- WorkingDirectory = Path.GetDirectoryName(exe)!,- UseShellExecute = false- };-- // ReXGlue aplica a configuração por esta ordem:- // argumentos CLI -> ficheiro TOML -> variáveis de ambiente.- // Portanto, usar REX_* aqui garante que as escolhas do launcher- // têm prioridade sobre qualquer configuração guardada no jogo.-- startInfo.Environment["REX_GAME_DATA_ROOT"] = gameRoot;- startInfo.Environment["REX_VIDEO_MODE_WIDTH"] = width.ToString();- startInfo.Environment["REX_VIDEO_MODE_HEIGHT"] = height.ToString();- // Display size and internal Xbox 360 rendering are configured separately.- startInfo.Environment["REX_DRAW_RESOLUTION_SCALE_X"] = RenderScale(width, height).ToString();- startInfo.Environment["REX_DRAW_RESOLUTION_SCALE_Y"] = RenderScale(width, height).ToString();- startInfo.Environment["REX_WINDOW_WIDTH"] = width.ToString();- startInfo.Environment["REX_WINDOW_HEIGHT"] = height.ToString();- startInfo.Environment["REX_VIDEO_MODE_REFRESH_RATE"] = refresh;- startInfo.Environment["REX_FULLSCREEN"] =- fullscreen ? "true" : "false";- startInfo.Environment["REX_MONITOR"] = monitor.ToString();- startInfo.Environment["REX_VSYNC"] =- vsyncBox.Checked ? "true" : "false";- startInfo.Environment["REX_D3D12_ALLOW_VARIABLE_REFRESH_RATE_AND_TEARING"] =- vrrBox.Checked ? "true" : "false";- startInfo.Environment["REX_NATIVE_2X_MSAA"] =- msaaBox.Checked ? "true" : "false";- startInfo.Environment["REX_SWAP_POST_EFFECT"] = postEffect;- startInfo.Environment["REX_D3D12_ADAPTER"] = adapter.ToString();- startInfo.Environment["REX_RENDER_TARGET_PATH_D3D12"] = renderTargetPath;-- // Compatibilidade / coerência GPU.- startInfo.Environment["REX_READBACK_RESOLVE"] = readbackResolve;- startInfo.Environment["REX_READBACK_MEMEXPORT"] =- readbackMemexportBox.Checked ? "true" : "false";- startInfo.Environment["REX_READBACK_MEMEXPORT_FAST"] =- readbackMemexportFastBox.Checked ? "true" : "false";- startInfo.Environment["REX_CLEAR_MEMORY_PAGE_STATE"] =- clearMemoryPageStateBox.Checked ? "true" : "false";- startInfo.Environment["REX_OCCLUSION_QUERY_ENABLE"] =- occlusionQueryBox.Checked ? "true" : "false";- startInfo.Environment["REX_ASYNC_SHADER_COMPILATION"] =- asyncShadersBox.Checked ? "true" : "false";-- startInfo.Environment["REX_LOG_VERBOSE"] = "false";- startInfo.Environment["REX_LOG_LEVEL"] = "info";- startInfo.Environment["REX_LOG_FRAME_STATS"] = "true";- startInfo.Environment["REX_BIND_DEBUG_OVERLAY"] = "Home";- startInfo.Environment["REX_LOG_FILE"] = logFile;-- // Mantemos game_data_root também como argumento porque esta- // aplicação já confirmou que o aceita diretamente.- startInfo.ArgumentList.Add($"--game_data_root={gameRoot}");-- SaveSettings();-- string launcherDebug = Path.Combine(- logsDir,- "launcher_settings.txt"- );-- File.WriteAllText(- launcherDebug,- $"Resolution={width}x{height}{Environment.NewLine}" +- $"InternalResolution={1280 * RenderScale(width, height)}x{720 * RenderScale(width, height)}{Environment.NewLine}" +- $"RefreshRate={refresh}{Environment.NewLine}" +- $"Fullscreen={fullscreen}{Environment.NewLine}" +- $"Monitor={monitor}{Environment.NewLine}" +- $"VSync={vsyncBox.Checked}{Environment.NewLine}" +- $"VRR={vrrBox.Checked}{Environment.NewLine}" +- $"MSAA={msaaBox.Checked}{Environment.NewLine}" +- $"PostEffect={postEffect}{Environment.NewLine}" +- $"Adapter={adapter}{Environment.NewLine}" +- $"RenderTargetPath={renderTargetPath}{Environment.NewLine}" +- $"ReadbackResolve={readbackResolve}{Environment.NewLine}" +- $"ReadbackMemexport={readbackMemexportBox.Checked}{Environment.NewLine}" +- $"ReadbackMemexportFast={readbackMemexportFastBox.Checked}{Environment.NewLine}" +- $"ClearMemoryPageState={clearMemoryPageStateBox.Checked}{Environment.NewLine}" +- $"OcclusionQueries={occlusionQueryBox.Checked}{Environment.NewLine}" +- $"AsyncShaders={asyncShadersBox.Checked}{Environment.NewLine}"- );-- UpdateStatus("Starting FIFA Street...", true);-- var process = Process.Start(startInfo);-- UpdateStatus(- process != null- ? $"Running • PID {process.Id}"- : "Could not start the game",- process != null- );- }- catch (Exception ex)- {- UpdateStatus("Launch failed", false);-- MessageBox.Show(- ex.Message,- "Error starting FIFA Street",- MessageBoxButtons.OK,- MessageBoxIcon.Error- );- }- }-- private void ShowError(string message)- {- UpdateStatus("Check your settings", false);-- MessageBox.Show(- message,- "FIFA Street Launcher",- MessageBoxButtons.OK,- MessageBoxIcon.Error- );- }-- private void BrowseExe()- {- using var dialog = new OpenFileDialog- {- Filter = "FIFA Street executable|fifastreet.exe|Executables|*.exe"- };-- if (dialog.ShowDialog() == DialogResult.OK)- exePathBox.Text = dialog.FileName;- }-- private void BrowseGame()- {- using var dialog = new FolderBrowserDialog- {- Description = "Select the folder containing default.xex"- };-- if (dialog.ShowDialog() == DialogResult.OK)- gamePathBox.Text = dialog.SelectedPath;- }-- private void OpenLogs()- {- string exe = exePathBox.Text.Trim();-- if (!File.Exists(exe))- return;-- string logs = Path.Combine(- Path.GetDirectoryName(exe)!,- "Logs"- );-- Directory.CreateDirectory(logs);-- Process.Start(new ProcessStartInfo- {- FileName = "explorer.exe",- Arguments = $"\"{logs}\"",- UseShellExecute = true- });- }-- private void OpenGameFolder()- {- string exe = exePathBox.Text.Trim();-- if (!File.Exists(exe))- return;-- Process.Start(new ProcessStartInfo- {- FileName = "explorer.exe",- Arguments = $"\"{Path.GetDirectoryName(exe)}\"",- UseShellExecute = true- });- }-- private void SaveSettings()- {- try- {- var settings = new LauncherSettings- {- ExePath = exePathBox.Text,- GamePath = gamePathBox.Text,- Resolution = resolutionBox.Text,- RefreshRate = refreshBox.Text,- Fullscreen = displayModeBox.SelectedIndex == 0,- Monitor = monitorBox.SelectedIndex,- Gpu = gpuBox.SelectedIndex,- GpuUsesDxgi = true,- RenderTargetPath = renderTargetPath,- PostEffect = postEffectBox.SelectedIndex,- ReadbackResolve = readbackResolveBox.SelectedIndex,- ReadbackMemexport = readbackMemexportBox.Checked,- ReadbackMemexportFast = readbackMemexportFastBox.Checked,- ClearMemoryPageState = clearMemoryPageStateBox.Checked,- OcclusionQueries = occlusionQueryBox.Checked,- AsyncShaders = asyncShadersBox.Checked,- VSync = vsyncBox.Checked,- VRR = vrrBox.Checked,- MSAA = msaaBox.Checked- };-- string json = JsonSerializer.Serialize(- settings,- new JsonSerializerOptions- {- WriteIndented = true- }- );-- File.WriteAllText(SettingsPath, json);- }- catch- {- }- }-- private void LoadSettings()- {- try- {- if (!File.Exists(SettingsPath))- return;-- var settings =- JsonSerializer.Deserialize<LauncherSettings>(- File.ReadAllText(SettingsPath)- );-- if (settings == null)- return;-- if (settings.RenderTargetPath is "rov" or "rtv")- renderTargetPath = settings.RenderTargetPath;-- exePathBox.Text = settings.ExePath ?? exePathBox.Text;- gamePathBox.Text = settings.GamePath ?? gamePathBox.Text;-- displayModeBox.SelectedIndex =- settings.Fullscreen ? 0 : 1;-- if (settings.Monitor >= 0 &&- settings.Monitor < monitorBox.Items.Count)- {- monitorBox.SelectedIndex = settings.Monitor;- }-- DetectDisplayModes();-- SelectItem(resolutionBox, settings.Resolution);- SelectItem(refreshBox, settings.RefreshRate);-- if (settings.GpuUsesDxgi && settings.Gpu >= 0 &&- settings.Gpu < gpuBox.Items.Count)- {- gpuBox.SelectedIndex = settings.Gpu;- }-- if (settings.PostEffect >= 0 &&- settings.PostEffect < postEffectBox.Items.Count)- {- postEffectBox.SelectedIndex = settings.PostEffect;- }-- if (settings.ReadbackResolve >= 0 &&- settings.ReadbackResolve < readbackResolveBox.Items.Count)- {- readbackResolveBox.SelectedIndex = settings.ReadbackResolve;- }-- readbackMemexportBox.Checked = settings.ReadbackMemexport;- readbackMemexportFastBox.Checked = settings.ReadbackMemexportFast;- clearMemoryPageStateBox.Checked = settings.ClearMemoryPageState;- occlusionQueryBox.Checked = settings.OcclusionQueries;- asyncShadersBox.Checked = settings.AsyncShaders;-- vsyncBox.Checked = settings.VSync;- vrrBox.Checked = settings.VRR;- msaaBox.Checked = settings.MSAA;- }- catch- {- }- }-- private static void SelectItem(ComboBox box, string? value)- {- if (string.IsNullOrWhiteSpace(value))- return;-- int index = box.Items.IndexOf(value);-- if (index >= 0)- box.SelectedIndex = index;- }-- private sealed class MessiPicture : PictureBox- {- protected override void OnPaint(PaintEventArgs e)- {- if (Image == null) return;- e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;- var crop = new RectangleF(Image.Width * 100f / 1280f, Image.Height * 225f / 1819f,- Image.Width * 640f / 1280f, Image.Height * 1260f / 1819f);- e.Graphics.DrawImage(Image, ClientRectangle, crop, GraphicsUnit.Pixel);- }- }-}--public class LauncherSettings-{- public string? ExePath { get; set; }- public string? GamePath { get; set; }- public string? Resolution { get; set; }- public string? RefreshRate { get; set; }- public bool Fullscreen { get; set; } = true;- public int Monitor { get; set; }- public int Gpu { get; set; }- public bool GpuUsesDxgi { get; set; }- public string RenderTargetPath { get; set; } = "rov";- public int PostEffect { get; set; }- public int ReadbackResolve { get; set; } = 1;- public bool ReadbackMemexport { get; set; } = true;- public bool ReadbackMemexportFast { get; set; } = true;- public bool ClearMemoryPageState { get; set; } = false;- public bool OcclusionQueries { get; set; } = true;- public bool AsyncShaders { get; set; } = true;- public bool VSync { get; set; } = true;- public bool VRR { get; set; } = false;- public bool MSAA { get; set; } = false;-}--public class RoundedPanel : Panel-{- public Color FillColor { get; set; } = Color.FromArgb(18, 22, 28);- public Color BorderColor { get; set; } = Color.FromArgb(48, 57, 68);- public int Radius { get; set; } = 16;-- public RoundedPanel()- {- DoubleBuffered = true;- BackColor = Color.Transparent;- }-- protected override void OnPaint(PaintEventArgs e)- {- base.OnPaint(e);-- e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;-- Rectangle rect = ClientRectangle;- rect.Width -= 1;- rect.Height -= 1;-- using var path = CreateRoundedRectangle(rect, Radius);- using var fill = new SolidBrush(FillColor);- using var border = new Pen(BorderColor, 1F);-- e.Graphics.FillPath(fill, path);- e.Graphics.DrawPath(border, path);- }-- protected override void OnResize(EventArgs eventargs)- {- base.OnResize(eventargs);- Invalidate();- }-- private static GraphicsPath CreateRoundedRectangle(Rectangle rect, int radius)- {- int diameter = radius * 2;-- var path = new GraphicsPath();-- if (diameter <= 0)- {- path.AddRectangle(rect);- return path;- }-- var arc = new Rectangle(rect.Location, new Size(diameter, diameter));-- path.AddArc(arc, 180, 90);-- arc.X = rect.Right - diameter;- path.AddArc(arc, 270, 90);-- arc.Y = rect.Bottom - diameter;- path.AddArc(arc, 0, 90);-- arc.X = rect.Left;- path.AddArc(arc, 90, 90);-- path.CloseFigure();-- return path;- }-}--public class ModernButton : Button-{- public Color FillColor { get; set; } = Color.FromArgb(24, 29, 36);- public Color HoverColor { get; set; } = Color.FromArgb(34, 41, 50);- public Color BorderColor { get; set; } = Color.FromArgb(48, 57, 68);- public int Radius { get; set; } = 10;-- private bool hovered;-- public ModernButton()- {- FlatStyle = FlatStyle.Flat;- FlatAppearance.BorderSize = 0;- Cursor = Cursors.Hand;- UseVisualStyleBackColor = false;- DoubleBuffered = true;- BackColor = Color.Transparent;-- MouseEnter += (_, _) =>- {- hovered = true;- Invalidate();- };-- MouseLeave += (_, _) =>- {- hovered = false;- Invalidate();- };- }-- protected override void OnPaint(PaintEventArgs pevent)- {- pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;-- Rectangle rect = ClientRectangle;- rect.Width -= 1;- rect.Height -= 1;-- using var path = CreateRoundedRectangle(rect, Radius);- using var fill = new SolidBrush(hovered ? HoverColor : FillColor);- using var border = new Pen(BorderColor, 1F);-- pevent.Graphics.FillPath(fill, path);- pevent.Graphics.DrawPath(border, path);-- TextRenderer.DrawText(- pevent.Graphics,- Text,- Font,- ClientRectangle,- ForeColor,- TextFormatFlags.HorizontalCenter |- TextFormatFlags.VerticalCenter |- TextFormatFlags.EndEllipsis- );- }-- private static GraphicsPath CreateRoundedRectangle(Rectangle rect, int radius)- {- int diameter = radius * 2;-- var path = new GraphicsPath();-- if (diameter <= 0)- {- path.AddRectangle(rect);- return path;- }-- var arc = new Rectangle(rect.Location, new Size(diameter, diameter));-- path.AddArc(arc, 180, 90);-- arc.X = rect.Right - diameter;- path.AddArc(arc, 270, 90);-- arc.Y = rect.Bottom - diameter;- path.AddArc(arc, 0, 90);-- arc.X = rect.Left;- path.AddArc(arc, 90, 90);-- path.CloseFigure();-- return path;- }-}+using System;+using System.Collections.Generic;+using System.Diagnostics;+using System.Drawing;+using System.Drawing.Drawing2D;+using System.IO;+using System.Linq;+using System.Runtime.InteropServices;+using System.Text.Json;+using System.Windows.Forms;++namespace FifaStreetLauncher;++public class LauncherForm : Form+{+ private readonly Color Bg = Color.FromArgb(10, 12, 16);+ private readonly Color Surface = Color.FromArgb(18, 22, 28);+ private readonly Color SurfaceAlt = Color.FromArgb(24, 29, 36);+ private readonly Color Border = Color.FromArgb(48, 57, 68);+ private readonly Color Accent = Color.FromArgb(133, 255, 72);+ private readonly Color AccentHover = Color.FromArgb(111, 229, 53);+ private readonly Color TextPrimary = Color.FromArgb(245, 247, 250);+ private readonly Color TextSecondary = Color.FromArgb(151, 161, 175);++ private readonly ComboBox resolutionBox = new();+ private readonly ComboBox refreshBox = new();+ private readonly ComboBox displayModeBox = new();+ private readonly ComboBox monitorBox = new();+ private readonly ComboBox graphicsApiBox = new();+ private readonly ComboBox gpuBox = new();+ private readonly List<int> gpuAdapterIndices = new();+ private readonly ComboBox postEffectBox = new();+ private readonly ComboBox internalResolutionBox = new();++ private readonly CheckBox vsyncBox = new();+ private readonly CheckBox vrrBox = new();+ private readonly CheckBox msaaBox = new();+ private readonly CheckBox readbackMemexportBox = new();+ private readonly CheckBox readbackMemexportFastBox = new();+ private readonly CheckBox clearMemoryPageStateBox = new();+ private readonly CheckBox occlusionQueryBox = new();+ private readonly CheckBox asyncShadersBox = new();++ private readonly TextBox gamePathBox = new();+ private readonly TextBox exePathBox = new();++ private readonly Label statusLabel = new();+ private readonly Label hardwareLabel = new();+ private readonly Label advancedChevron = new();++ private readonly RoundedPanel advancedPanel = new();+ private readonly ModernButton advancedButton = new();+ private readonly RoundedPanel compatibilityPanel = new();+ private readonly ModernButton compatibilityButton = new();++ private bool advancedVisible;+ private bool compatibilityVisible;++ private string SettingsPath =>+ Path.Combine(AppContext.BaseDirectory, "settings.json");++ public LauncherForm()+ {+ Text = "FIFA Street Launcher";+ using (var icon = typeof(LauncherForm).Assembly.GetManifestResourceStream("fifastreet.ico")!)+ Icon = new Icon(icon);+ ClientSize = new Size(1250, 720);+ MinimumSize = new Size(1266, 759);+ MaximumSize = new Size(1266, 960);+ StartPosition = FormStartPosition.CenterScreen;+ FormBorderStyle = FormBorderStyle.FixedSingle;+ MaximizeBox = false;+ BackColor = Bg;+ ForeColor = TextPrimary;+ Font = new Font("Segoe UI", 10F);+ AutoScaleMode = AutoScaleMode.Dpi;++ BuildInterface();+ WireEvents();+ LoadDefaults();+ LoadSettings();+ UpdateSummary();+ UpdateStatus("Ready to play", true);+ }++ private void BuildInterface()+ {+ SuspendLayout();++ var brand = new Label+ {+ Text = "FIFA STREET",+ Font = new Font("Segoe UI", 30F, FontStyle.Bold),+ ForeColor = TextPrimary,+ AutoSize = true,+ Location = new Point(40, 30)+ };+ Controls.Add(brand);++ var subtitle = new Label+ {+ Text = "NATIVE PC RECOMP",+ Font = new Font("Segoe UI Semibold", 9F),+ ForeColor = Accent,+ AutoSize = true,+ Location = new Point(44, 84)+ };+ Controls.Add(subtitle);++ var topLine = new Panel+ {+ BackColor = Accent,+ Location = new Point(40, 112),+ Size = new Size(860, 2)+ };+ Controls.Add(topLine);++ var readyDot = new Label+ {+ Text = "●",+ ForeColor = Accent,+ AutoSize = true,+ Font = new Font("Segoe UI", 10F, FontStyle.Bold),+ Location = new Point(726, 45)+ };+ Controls.Add(readyDot);++ statusLabel.AutoSize = true;+ statusLabel.Font = new Font("Segoe UI Semibold", 9.5F);+ statusLabel.ForeColor = TextSecondary;+ statusLabel.Location = new Point(746, 46);+ Controls.Add(statusLabel);++ hardwareLabel.Text = "Detecting hardware...";+ hardwareLabel.ForeColor = TextSecondary;+ hardwareLabel.Font = new Font("Segoe UI", 9.5F);+ hardwareLabel.AutoEllipsis = true;+ hardwareLabel.TextAlign = ContentAlignment.MiddleRight;+ hardwareLabel.Location = new Point(455, 72);+ hardwareLabel.Size = new Size(445, 24);+ Controls.Add(hardwareLabel);++ var displayCard = CreateCard(new Point(40, 145), new Size(420, 360));+ Controls.Add(displayCard);++ AddSectionHeader(displayCard, "DISPLAY", "Display settings", 24, 20);++ AddFieldLabel(displayCard, "Resolution", 24, 82);+ ConfigureCombo(resolutionBox, 24, 106, 372);+ displayCard.Controls.Add(resolutionBox);++ AddFieldLabel(displayCard, "Refresh rate", 24, 150);+ ConfigureCombo(refreshBox, 24, 174, 180);+ displayCard.Controls.Add(refreshBox);++ AddFieldLabel(displayCard, "Display mode", 216, 150);+ ConfigureCombo(displayModeBox, 216, 174, 180);+ displayCard.Controls.Add(displayModeBox);++ AddFieldLabel(displayCard, "Monitor", 24, 218);+ ConfigureCombo(monitorBox, 24, 242, 372);+ displayCard.Controls.Add(monitorBox);++ ConfigureCheck(vsyncBox, "VSync", 24, 300);+ ConfigureCheck(vrrBox, "VRR / Tearing", 216, 300);+ displayCard.Controls.Add(vsyncBox);+ displayCard.Controls.Add(vrrBox);++ var graphicsCard = CreateCard(new Point(480, 145), new Size(420, 360));+ Controls.Add(graphicsCard);++ AddSectionHeader(graphicsCard, "GRAPHICS", "Quality and presentation", 24, 20);++ AddFieldLabel(graphicsCard, "Graphics API", 24, 82);+ ConfigureCombo(graphicsApiBox, 24, 106, 120);+ graphicsCard.Controls.Add(graphicsApiBox);++ AddFieldLabel(graphicsCard, "GPU", 156, 82);+ ConfigureCombo(gpuBox, 156, 106, 240);+ graphicsCard.Controls.Add(gpuBox);++AddFieldLabel(graphicsCard, "Post-processing", 24, 150);+ConfigureCombo(postEffectBox, 24, 174, 372);+graphicsCard.Controls.Add(postEffectBox);++AddFieldLabel(graphicsCard, "Internal Resolution", 24, 218);+ConfigureCombo(internalResolutionBox, 24, 242, 372);+graphicsCard.Controls.Add(internalResolutionBox);++ConfigureCheck(msaaBox, "Native 2x MSAA", 24, 300);+graphicsCard.Controls.Add(msaaBox);++var fpsTitle = new Label+{+ Text = "FPS",+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 9F),+ AutoSize = true,+ Location = new Point(24, 330)+};+graphicsCard.Controls.Add(fpsTitle);++var fpsInfo = new Label+{+ Text = "Controlled by the game, VSync and refresh rate",+ ForeColor = TextSecondary,+ Font = new Font("Segoe UI", 8.7F),+ AutoSize = true,+ Location = new Point(67, 331)+ };+ graphicsCard.Controls.Add(fpsInfo);++ advancedButton.Text = "ADVANCED SETTINGS";+ advancedButton.Location = new Point(40, 525);+ advancedButton.Size = new Size(205, 40);+ advancedButton.FillColor = SurfaceAlt;+ advancedButton.HoverColor = Color.FromArgb(34, 41, 50);+ advancedButton.BorderColor = Border;+ advancedButton.ForeColor = TextPrimary;+ advancedButton.Font = new Font("Segoe UI Semibold", 9F);+ advancedButton.Radius = 10;+ Controls.Add(advancedButton);++ advancedChevron.Text = "⌄";+ advancedChevron.ForeColor = TextSecondary;+ advancedChevron.Font = new Font("Segoe UI", 13F, FontStyle.Bold);+ advancedChevron.AutoSize = true;+ advancedChevron.Location = new Point(219, 533);+ advancedChevron.BackColor = Color.Transparent;+ advancedChevron.Cursor = Cursors.Hand;+ Controls.Add(advancedChevron);++ compatibilityButton.Text = "COMPATIBILITY";+ compatibilityButton.Location = new Point(255, 525);+ compatibilityButton.Size = new Size(205, 40);+ compatibilityButton.FillColor = SurfaceAlt;+ compatibilityButton.HoverColor = Color.FromArgb(34, 41, 50);+ compatibilityButton.BorderColor = Border;+ compatibilityButton.ForeColor = TextPrimary;+ compatibilityButton.Font = new Font("Segoe UI Semibold", 9F);+ compatibilityButton.Radius = 10;+ Controls.Add(compatibilityButton);++ ConfigureAdvancedPanel();+ Controls.Add(advancedPanel);++ ConfigureCompatibilityPanel();+ Controls.Add(compatibilityPanel);++ var logsButton = new ModernButton+ {+ Text = "OPEN LOGS",+ Location = new Point(40, 590),+ Size = new Size(150, 42),+ FillColor = SurfaceAlt,+ HoverColor = Color.FromArgb(34, 41, 50),+ BorderColor = Border,+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 9F),+ Radius = 10+ };+ logsButton.Click += (_, _) => OpenLogs();+ Controls.Add(logsButton);++ var folderButton = new ModernButton+ {+ Text = "OPEN FOLDER",+ Location = new Point(750, 590),+ Size = new Size(150, 42),+ FillColor = SurfaceAlt,+ HoverColor = Color.FromArgb(34, 41, 50),+ BorderColor = Border,+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 9F),+ Radius = 10+ };+ folderButton.Click += (_, _) => OpenGameFolder();+ Controls.Add(folderButton);++ var playButton = new ModernButton+ {+ Text = "PLAY",+ Location = new Point(280, 575),+ Size = new Size(380, 72),+ FillColor = Accent,+ HoverColor = AccentHover,+ BorderColor = Accent,+ ForeColor = Color.FromArgb(9, 14, 8),+ Font = new Font("Segoe UI", 18F, FontStyle.Bold),+ Radius = 14+ };+ playButton.Click += (_, _) => LaunchGame();+ Controls.Add(playButton);++ var footer = new Label+ {+ Text = "FIFA Street • Native PC Recomp Launcher",+ ForeColor = Color.FromArgb(92, 102, 116),+ Font = new Font("Segoe UI", 8.5F),+ AutoSize = true,+ Location = new Point(40, 674)+ };+ Controls.Add(footer);++ foreach (Control control in Controls) control.Left += 310;+ using var resource = typeof(LauncherForm).Assembly.GetManifestResourceStream("cover.jpg")!;+ using var cover = Image.FromStream(resource);+ var artwork = new MessiPicture+ {+ Image = new Bitmap(cover), Bounds = new Rectangle(0, 0, 310, ClientSize.Height),+ Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left+ };+ Controls.Add(artwork);+ FormClosed += (_, _) => artwork.Image?.Dispose();+ var credit = new Label+ {+ Text = "PORTED BY: SAMUELITODAVILA", AutoSize = true,+ ForeColor = Accent, Font = new Font("Segoe UI", 8.5F),+ Location = new Point(730, 674), Tag = "credit"+ };+ Controls.Add(credit);++ ResumeLayout(false);+ PerformLayout();+ }++ private void ConfigureAdvancedPanel()+ {+ advancedPanel.Location = new Point(40, 575);+ advancedPanel.Size = new Size(860, 126);+ advancedPanel.FillColor = Surface;+ advancedPanel.BorderColor = Border;+ advancedPanel.Radius = 14;+ advancedPanel.Visible = false;++ AddFieldLabel(advancedPanel, "Game executable", 22, 18);+ exePathBox.Location = new Point(22, 42);+ exePathBox.Size = new Size(688, 27);+ StyleTextBox(exePathBox);+ advancedPanel.Controls.Add(exePathBox);++ var browseExe = new ModernButton+ {+ Text = "BROWSE",+ Location = new Point(724, 39),+ Size = new Size(112, 34),+ FillColor = SurfaceAlt,+ HoverColor = Color.FromArgb(34, 41, 50),+ BorderColor = Border,+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 8.5F),+ Radius = 8+ };+ browseExe.Click += (_, _) => BrowseExe();+ advancedPanel.Controls.Add(browseExe);++ AddFieldLabel(advancedPanel, "Game data folder", 22, 76);+ gamePathBox.Location = new Point(22, 98);+ gamePathBox.Size = new Size(688, 27);+ StyleTextBox(gamePathBox);+ advancedPanel.Controls.Add(gamePathBox);++ var browseGame = new ModernButton+ {+ Text = "BROWSE",+ Location = new Point(724, 95),+ Size = new Size(112, 34),+ FillColor = SurfaceAlt,+ HoverColor = Color.FromArgb(34, 41, 50),+ BorderColor = Border,+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 8.5F),+ Radius = 8+ };+ browseGame.Click += (_, _) => BrowseGame();+ advancedPanel.Controls.Add(browseGame);+ }++ private void ConfigureCompatibilityPanel()+ {+ compatibilityPanel.Location = new Point(40, 575);+ compatibilityPanel.Size = new Size(860, 182);+ compatibilityPanel.FillColor = Surface;+ compatibilityPanel.BorderColor = Border;+ compatibilityPanel.Radius = 14;+ compatibilityPanel.Visible = false;++ AddSectionHeader(+ compatibilityPanel,+ "COMPATIBILITY",+ "Renderer options for textures, lighting, black screens and stutter",+ 22,+ 15+ );++ ConfigureCheck(readbackMemexportBox, "Memory Export", 260, 72);+ ConfigureCheck(readbackMemexportFastBox, "Fast MemExport", 430, 72);+ ConfigureCheck(clearMemoryPageStateBox, "Memory Page State", 615, 72);++ compatibilityPanel.Controls.Add(readbackMemexportBox);+ compatibilityPanel.Controls.Add(readbackMemexportFastBox);+ compatibilityPanel.Controls.Add(clearMemoryPageStateBox);++ ConfigureCheck(occlusionQueryBox, "Occlusion Queries", 260, 112);+ ConfigureCheck(asyncShadersBox, "Async Shaders", 430, 112);++ compatibilityPanel.Controls.Add(occlusionQueryBox);+ compatibilityPanel.Controls.Add(asyncShadersBox);++ var hint = new Label+ {+ Text = "Readback Resolve is fixed to Full for FIFA Street compatibility.",+ ForeColor = TextSecondary,+ Font = new Font("Segoe UI", 8.5F),+ AutoSize = true,+ Location = new Point(22, 151)+ };+ compatibilityPanel.Controls.Add(hint);+ }++ private void WireEvents()+ {+ advancedButton.Click += (_, _) => ToggleAdvanced();+ advancedChevron.Click += (_, _) => ToggleAdvanced();+ compatibilityButton.Click += (_, _) => ToggleCompatibility();++ monitorBox.SelectedIndexChanged += (_, _) =>+ {+ DetectDisplayModes();+ UpdateSummary();+ };++ graphicsApiBox.SelectedIndexChanged += (_, _) =>+ {+ UpdateGraphicsApiState();+ UpdateSummary();+ };++ resolutionBox.SelectedIndexChanged += (_, _) => UpdateSummary();+internalResolutionBox.SelectedIndexChanged += (_, _) => UpdateSummary();+refreshBox.SelectedIndexChanged += (_, _) => UpdateSummary();+gpuBox.SelectedIndexChanged += (_, _) => UpdateSummary();++gpuBox.DropDown += (_, _) =>+{+ int width = gpuBox.Width;++ using Graphics graphics = gpuBox.CreateGraphics();++ foreach (var item in gpuBox.Items)+ {+ int itemWidth = (int)Math.Ceiling(+ graphics.MeasureString(+ item?.ToString() ?? string.Empty,+ gpuBox.Font).Width);++ width = Math.Max(width, itemWidth + 40);+ }++ gpuBox.DropDownWidth = Math.Min(width, 500);+};+displayModeBox.SelectedIndexChanged += (_, _) => UpdateSummary();+ }++ private void ToggleAdvanced()+ {+ if (compatibilityVisible)+ {+ compatibilityVisible = false;+ compatibilityPanel.Visible = false;+ }++ advancedVisible = !advancedVisible;+ advancedPanel.Visible = advancedVisible;+ advancedChevron.Text = advancedVisible ? "⌃" : "⌄";++ if (advancedVisible)+ {+ ClientSize = new Size(1250, 846);+ advancedPanel.Location = new Point(350, 575);+ MoveBottomControls(721, 703, 808);+ }+ else+ {+ ClientSize = new Size(1250, 720);+ MoveBottomControls(590, 575, 674);+ }+ }++ private void ToggleCompatibility()+ {+ if (advancedVisible)+ {+ advancedVisible = false;+ advancedPanel.Visible = false;+ advancedChevron.Text = "⌄";+ }++ compatibilityVisible = !compatibilityVisible;+ compatibilityPanel.Visible = compatibilityVisible;++ if (compatibilityVisible)+ {+ ClientSize = new Size(1250, 902);+ compatibilityPanel.Location = new Point(350, 575);+ MoveBottomControls(777, 759, 864);+ }+ else+ {+ ClientSize = new Size(1250, 720);+ MoveBottomControls(590, 575, 674);+ }+ }++ private void MoveBottomControls(int secondaryY, int playY, int footerY)+ {+ foreach (Control control in Controls)+ {+ if (control is ModernButton button)+ {+ if (button.Text == "OPEN LOGS" || button.Text == "OPEN FOLDER")+ button.Top = secondaryY;+ else if (button.Text == "PLAY")+ button.Top = playY;+ }+ else if (control is Label label &&+ (label.Text.StartsWith("FIFA Street •", StringComparison.Ordinal) || label.Tag as string == "credit"))+ {+ label.Top = footerY;+ }+ }+ }++ private RoundedPanel CreateCard(Point location, Size size)+ {+ return new RoundedPanel+ {+ Location = location,+ Size = size,+ FillColor = Surface,+ BorderColor = Border,+ Radius = 16+ };+ }++ private void AddSectionHeader(Control parent, string title, string subtitle, int x, int y)+ {+ var titleLabel = new Label+ {+ Text = title,+ ForeColor = TextPrimary,+ Font = new Font("Segoe UI Semibold", 11F, FontStyle.Bold),+ AutoSize = true,+ Location = new Point(x, y)+ };+ parent.Controls.Add(titleLabel);++ var subtitleLabel = new Label+ {+ Text = subtitle,+ ForeColor = TextSecondary,+ Font = new Font("Segoe UI", 8.8F),+ AutoSize = true,+ Location = new Point(x, y + 26)+ };+ parent.Controls.Add(subtitleLabel);+ }++ private void AddFieldLabel(Control parent, string text, int x, int y)+ {+ var label = new Label+ {+ Text = text,+ ForeColor = TextSecondary,+ Font = new Font("Segoe UI Semibold", 8.7F),+ AutoSize = true,+ Location = new Point(x, y)+ };+ parent.Controls.Add(label);+ }++ private void ConfigureCombo(ComboBox box, int x, int y, int width)+ {+ box.Location = new Point(x, y);+ box.Size = new Size(width, 30);+ box.DropDownStyle = ComboBoxStyle.DropDownList;+ box.FlatStyle = FlatStyle.Flat;+ box.BackColor = SurfaceAlt;+ box.ForeColor = TextPrimary;+ box.Font = new Font("Segoe UI", 9.7F);+ box.DrawMode = DrawMode.OwnerDrawFixed;+ box.ItemHeight = 22;+ box.DrawItem += (_, e) =>+ {+ using var background = new SolidBrush(SurfaceAlt);+ e.Graphics.FillRectangle(background, e.Bounds);+ string text = e.Index >= 0 ? box.Items[e.Index]?.ToString() ?? "" : box.Text;+ TextRenderer.DrawText(e.Graphics, text, box.Font, e.Bounds, TextPrimary,+ TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis);+ e.DrawFocusRectangle();+ };+ box.IntegralHeight = false;+ box.DropDownHeight = 240;+ }++ private void ConfigureCheck(CheckBox box, string text, int x, int y)+ {+ box.Text = text;+ box.Location = new Point(x, y);+ box.AutoSize = true;+ box.ForeColor = TextPrimary;+ box.BackColor = Color.Transparent;+ box.Font = new Font("Segoe UI Semibold", 9.2F);+ box.Cursor = Cursors.Hand;+ }++ private void StyleTextBox(TextBox box)+ {+ box.BackColor = SurfaceAlt;+ box.ForeColor = TextPrimary;+ box.BorderStyle = BorderStyle.FixedSingle;+ box.Font = new Font("Segoe UI", 9F);+ }++ private void LoadDefaults()+ {+ exePathBox.Text =+ Path.Combine(AppContext.BaseDirectory, "Game", "fifastreet.exe");++ gamePathBox.Text =+ Path.Combine(AppContext.BaseDirectory, "GameData");++ displayModeBox.Items.AddRange(new object[]+ {+ "Fullscreen",+ "Windowed"+ });+ displayModeBox.SelectedIndex = 0;++ graphicsApiBox.Items.AddRange(new object[]+ {+ "Direct3D 12",+ "Vulkan"+ });+ graphicsApiBox.SelectedIndex = 0;++ monitorBox.Items.Clear();+ foreach (var screen in Screen.AllScreens)+ {+ string primary = screen.Primary ? " • Primary" : "";+ monitorBox.Items.Add(+ $"{monitorBox.Items.Count}: {screen.DeviceName}{primary}"+ );+ }++ if (monitorBox.Items.Count > 0)+ monitorBox.SelectedIndex = 0;++ DetectDisplayModes();+ DetectGpus();++ postEffectBox.Items.AddRange(new object[]+{+ "None",+ "FXAA",+ "FXAA Extreme"+});+ postEffectBox.SelectedIndex = 0;++ internalResolutionBox.Items.AddRange(new object[]+{+ "1x - Native (1280 x 720)",+ "2x - 2560 x 1440",+ "3x - 3840 x 2160",+ "4x - 5120 x 2880"+});+ internalResolutionBox.SelectedIndex = 0;+++ readbackMemexportBox.Checked = true;+ readbackMemexportFastBox.Checked = true;+ clearMemoryPageStateBox.Checked = false;+ occlusionQueryBox.Checked = true;+ asyncShadersBox.Checked = false;++ vsyncBox.Checked = false;+ vrrBox.Checked = false;+ msaaBox.Checked = false;+ }++ private void DetectGpus()+ {+ gpuBox.Items.Clear();+ gpuAdapterIndices.Clear();+ gpuBox.Items.Add("Automatic");+ gpuAdapterIndices.Add(-1);++ try+ {+ foreach (var gpu in DxgiAdapters.Enumerate())+ {+ gpuBox.Items.Add(+ $"Adapter {gpu.Index}: {gpu.Name}"+ );+ gpuAdapterIndices.Add(checked((int)gpu.Index));+ }+ }+ catch+ {+ // Automatic selection remains available when DXGI enumeration fails.+ }++ gpuBox.Items.Add("WARP (Software)");+ gpuAdapterIndices.Add(-2);+ gpuBox.SelectedIndex = 0;+ }++ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]+ private struct DEVMODE+ {+ private const int CCHDEVICENAME = 32;+ private const int CCHFORMNAME = 32;++ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHDEVICENAME)]+ public string dmDeviceName;++ public short dmSpecVersion;+ public short dmDriverVersion;+ public short dmSize;+ public short dmDriverExtra;+ public int dmFields;++ public int dmPositionX;+ public int dmPositionY;+ public int dmDisplayOrientation;+ public int dmDisplayFixedOutput;++ public short dmColor;+ public short dmDuplex;+ public short dmYResolution;+ public short dmTTOption;+ public short dmCollate;++ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CCHFORMNAME)]+ public string dmFormName;++ public short dmLogPixels;+ public int dmBitsPerPel;+ public int dmPelsWidth;+ public int dmPelsHeight;+ public int dmDisplayFlags;+ public int dmDisplayFrequency;++ public int dmICMMethod;+ public int dmICMIntent;+ public int dmMediaType;+ public int dmDitherType;+ public int dmReserved1;+ public int dmReserved2;+ public int dmPanningWidth;+ public int dmPanningHeight;+ }++ [DllImport("user32.dll", CharSet = CharSet.Ansi)]+ private static extern bool EnumDisplaySettings(+ string deviceName,+ int modeNum,+ ref DEVMODE devMode+ );++ private const int ENUM_CURRENT_SETTINGS = -1;++ private void DetectDisplayModes()+ {+ string? oldResolution = resolutionBox.SelectedItem?.ToString();+ string? oldRefresh = refreshBox.SelectedItem?.ToString();++ resolutionBox.Items.Clear();+ refreshBox.Items.Clear();++ var resolutions = new HashSet<string>();+ var refreshRates = new SortedSet<int>();++ Screen screen =+ monitorBox.SelectedIndex >= 0 &&+ monitorBox.SelectedIndex < Screen.AllScreens.Length+ ? Screen.AllScreens[monitorBox.SelectedIndex]+ : Screen.PrimaryScreen!;++ int modeNum = 0;++ while (true)+ {+ DEVMODE mode = CreateDevMode();++ if (!EnumDisplaySettings(+ screen.DeviceName,+ modeNum,+ ref mode))+ {+ break;+ }++ if (mode.dmPelsWidth >= 1280 &&+ mode.dmPelsHeight >= 720 &&+ mode.dmBitsPerPel >= 32)+ {+ resolutions.Add(+ $"{mode.dmPelsWidth}x{mode.dmPelsHeight}"+ );++ if (mode.dmDisplayFrequency > 20 &&+ mode.dmDisplayFrequency < 1000)+ {+ refreshRates.Add(mode.dmDisplayFrequency);+ }+ }++ modeNum++;+ }++ // Always expose common output resolutions up to 4K,+ // even when the current monitor does not advertise them.+ resolutions.Add("1280x720");+ resolutions.Add("1920x1080");+ resolutions.Add("2560x1440");+ resolutions.Add("3200x1800");+ resolutions.Add("3840x2160");++ foreach (string resolution in resolutions+ .OrderBy(x =>+ {+ var p = x.Split('x');+ return int.Parse(p[0]) * int.Parse(p[1]);+ }))+ {+ resolutionBox.Items.Add(resolution);+ }++ foreach (int hz in refreshRates)+ {+ refreshBox.Items.Add(hz.ToString());+ }++ if (resolutionBox.Items.Count == 0)+ {+ resolutionBox.Items.AddRange(new object[]+ {+ "1280x720",+ "1600x900",+ "1920x1080",+ "2560x1440",+ "3200x1800",+ "3840x2160"+ });+ }++ if (refreshBox.Items.Count == 0)+ {+ refreshBox.Items.AddRange(new object[]+ {+ "30", "50", "60", "75", "100",+ "120", "144", "165", "180", "200", "240"+ });+ }++ if (!string.IsNullOrWhiteSpace(oldResolution) &&+ resolutionBox.Items.Contains(oldResolution))+ {+ resolutionBox.SelectedItem = oldResolution;+ }+ else+ {+ string currentResolution =+ $"{screen.Bounds.Width}x{screen.Bounds.Height}";++ if (resolutionBox.Items.Contains(currentResolution))+ resolutionBox.SelectedItem = currentResolution;+ else if (resolutionBox.Items.Count > 0)+ resolutionBox.SelectedIndex = resolutionBox.Items.Count - 1;+ }++ if (!string.IsNullOrWhiteSpace(oldRefresh) &&+ refreshBox.Items.Contains(oldRefresh))+ {+ refreshBox.SelectedItem = oldRefresh;+ }+ else+ {+ DEVMODE currentMode = CreateDevMode();++ if (EnumDisplaySettings(+ screen.DeviceName,+ ENUM_CURRENT_SETTINGS,+ ref currentMode))+ {+ string currentHz =+ currentMode.dmDisplayFrequency.ToString();++ if (refreshBox.Items.Contains(currentHz))+ refreshBox.SelectedItem = currentHz;+ }++ if (refreshBox.SelectedIndex < 0 &&+ refreshBox.Items.Count > 0)+ {+ refreshBox.SelectedIndex = 0;+ }+ }+ }++ private static DEVMODE CreateDevMode()+ {+ return new DEVMODE+ {+ dmDeviceName = new string('\0', 32),+ dmFormName = new string('\0', 32),+ dmSize = (short)Marshal.SizeOf<DEVMODE>()+ };+ }++ private void UpdateGraphicsApiState()+ {+ bool isD3D12 = graphicsApiBox.SelectedIndex != 1;++ // GPU adapter selection is currently specific to the D3D12 backend.+ // Vulkan uses automatic device selection (REX_VULKAN_DEVICE=-1).+ gpuBox.Enabled = isD3D12;++ if (!isD3D12)+ {+ gpuBox.BackColor = Color.FromArgb(34, 38, 43);+ }+ else+ {+ gpuBox.BackColor = Color.FromArgb(24, 28, 32);+ }+ }+ private void UpdateSummary()+ {+ string gpu;++ if (graphicsApiBox.SelectedIndex == 1)+ {+ gpu = "Automatic GPU (Vulkan)";+ }+ else+ {+ gpu = gpuBox.SelectedItem?.ToString() ?? "Automatic GPU";++ if (gpu.StartsWith("Adapter ", StringComparison.Ordinal))+ {+ int colon = gpu.IndexOf(':');+ if (colon >= 0 && colon + 1 < gpu.Length)+ gpu = gpu[(colon + 1)..].Trim();+ }+ }++ string resolution = resolutionBox.SelectedItem?.ToString() ?? "Resolution";+ string hz = refreshBox.SelectedItem?.ToString() ?? "--";++ hardwareLabel.Text =+ $"{gpu} • {resolution} • {hz} Hz";+ }++ private void UpdateStatus(string text, bool ok)+ {+ statusLabel.Text = text;+ statusLabel.ForeColor = ok ? TextSecondary : Color.FromArgb(255, 120, 120);+ }++ private void LaunchGame()+ {+ try+ {+ string exe = exePathBox.Text.Trim();+ string gameRoot = gamePathBox.Text.Trim();++ if (!File.Exists(exe))+ {+ ShowError("fifastreet.exe was not found.");+ return;+ }++ if (!Directory.Exists(gameRoot))+ {+ ShowError("The game data folder does not exist.");+ return;+ }++ if (!File.Exists(Path.Combine(gameRoot, "default.xex")))+ {+ MessageBox.Show(+ "The selected folder does not contain default.xex.",+ "Invalid folder",+ MessageBoxButtons.OK,+ MessageBoxIcon.Warning+ );+ return;+ }++ // Select the validated ReXGlue graphics backend.+ string graphicsApi = graphicsApiBox.SelectedIndex == 1+ ? "Vulkan"+ : "D3D12";++ string backendDirectory = Path.Combine(+ Path.GetDirectoryName(exe)!,+ "Backends",+ graphicsApi);++ string backendRuntime = Path.Combine(+ backendDirectory,+ "rexruntime.dll");++ string backendGpu = Path.Combine(+ backendDirectory,+ "rexgpu-xenos.dll");++ if (!File.Exists(backendRuntime) || !File.Exists(backendGpu))+ {+ MessageBox.Show(+ $"The {graphicsApi} graphics backend is missing.\n\n" ++ $"Expected files in:\n{backendDirectory}",+ "FIFA Street Launcher",+ MessageBoxButtons.OK,+ MessageBoxIcon.Error);+ return;+ }++ string executableDirectory = Path.GetDirectoryName(exe)!;++ File.Copy(+ backendRuntime,+ Path.Combine(executableDirectory, "rexruntime.dll"),+ true);++ File.Copy(+ backendGpu,+ Path.Combine(executableDirectory, "rexgpu-xenos.dll"),+ true);++ if (string.IsNullOrWhiteSpace(resolutionBox.Text) ||+ !resolutionBox.Text.Contains('x'))+ {+ ShowError("Select a valid resolution.");+ return;+ }++ var resolution = resolutionBox.Text.Split('x');+ int width = int.Parse(resolution[0]);+ int height = int.Parse(resolution[1]);+ string refresh = refreshBox.Text;++ bool fullscreen =+ displayModeBox.SelectedItem?.ToString() == "Fullscreen";++ int monitor = Math.Max(0, monitorBox.SelectedIndex);++ int adapter = gpuBox.SelectedIndex >= 0+ ? gpuAdapterIndices[gpuBox.SelectedIndex] : -1;++ string postEffect = postEffectBox.SelectedIndex switch+ {+ 1 => "fxaa",+ 2 => "fxaa_extreme",+ _ => "none"+ };+++ string logsDir = Path.Combine(+ Path.GetDirectoryName(exe)!,+ "Logs"+ );++ Directory.CreateDirectory(logsDir);++ string logFile =+ Path.Combine(logsDir, "fifastreet.log");++ var startInfo = new ProcessStartInfo+ {+ FileName = exe,+ WorkingDirectory = Path.GetDirectoryName(exe)!,+ UseShellExecute = false+ };++ // ReXGlue aplica a configuração por esta ordem:+ // argumentos CLI -> ficheiro TOML -> variáveis de ambiente.+ // Portanto, usar REX_* aqui garante que as escolhas do launcher+ // têm prioridade sobre qualquer configuração guardada no jogo.++ startInfo.Environment["REX_GAME_DATA_ROOT"] = gameRoot;+ startInfo.Environment["REX_VIDEO_MODE_WIDTH"] = width.ToString();+ startInfo.Environment["REX_VIDEO_MODE_HEIGHT"] = height.ToString();+ // The display size does not change the Xbox 360 render targets.+ int internalResolutionScale = Math.Max(1, internalResolutionBox.SelectedIndex + 1);++startInfo.Environment["REX_DRAW_RESOLUTION_SCALE_X"] =+ internalResolutionScale.ToString();++startInfo.Environment["REX_DRAW_RESOLUTION_SCALE_Y"] =+ internalResolutionScale.ToString();+ startInfo.Environment["REX_WINDOW_WIDTH"] = width.ToString();+ startInfo.Environment["REX_WINDOW_HEIGHT"] = height.ToString();+ startInfo.Environment["REX_VIDEO_MODE_REFRESH_RATE"] = refresh;+ startInfo.Environment["REX_FULLSCREEN"] =+ fullscreen ? "true" : "false";+ startInfo.Environment["REX_MONITOR"] = monitor.ToString();+ startInfo.Environment["REX_VSYNC"] =+ vsyncBox.Checked ? "true" : "false";+ startInfo.Environment["REX_NATIVE_2X_MSAA"] =+ msaaBox.Checked ? "true" : "false";+ startInfo.Environment["REX_SWAP_POST_EFFECT"] = postEffect;++ if (graphicsApi == "D3D12")+ {+ // Validated D3D12 configuration.+ startInfo.Environment["REX_D3D12_ALLOW_VARIABLE_REFRESH_RATE_AND_TEARING"] =+ vrrBox.Checked ? "true" : "false";+ startInfo.Environment["REX_D3D12_ADAPTER"] = adapter.ToString();++ // Do not force ROV/RTV. The validated D3D12 build uses+ // ReXGlue's automatic render target path selection.+ startInfo.Environment["REX_RENDER_TARGET_PATH_D3D12"] = "";+ }+ else+ {+ // Validated Vulkan configuration.+ // Vulkan device stays automatic; DXGI adapter indices are+ // not interchangeable with Vulkan device indices.+ startInfo.Environment["REX_VULKAN_DEVICE"] = "-1";+ startInfo.Environment["REX_RENDER_TARGET_PATH_VULKAN"] = "fbo";+ }++ // Compatibilidade / coerência GPU.+ startInfo.Environment["REX_READBACK_RESOLVE"] = "full";+ startInfo.Environment["REX_READBACK_MEMEXPORT"] =+ readbackMemexportBox.Checked ? "true" : "false";+ startInfo.Environment["REX_READBACK_MEMEXPORT_FAST"] =+ readbackMemexportFastBox.Checked ? "true" : "false";+ startInfo.Environment["REX_CLEAR_MEMORY_PAGE_STATE"] =+ clearMemoryPageStateBox.Checked ? "true" : "false";+ startInfo.Environment["REX_OCCLUSION_QUERY_ENABLE"] =+ occlusionQueryBox.Checked ? "true" : "false";+ startInfo.Environment["REX_ASYNC_SHADER_COMPILATION"] =+ asyncShadersBox.Checked ? "true" : "false";++ startInfo.Environment["REX_LOG_VERBOSE"] = "false";+ startInfo.Environment["REX_LOG_LEVEL"] = "info";+ startInfo.Environment["REX_LOG_FRAME_STATS"] = "true";+ startInfo.Environment["REX_BIND_DEBUG_OVERLAY"] = "Home";+ startInfo.Environment["REX_LOG_FILE"] = logFile;++ // Mantemos game_data_root também como argumento porque esta+ // aplicação já confirmou que o aceita diretamente.+ startInfo.ArgumentList.Add($"--game_data_root={gameRoot}");++ SaveSettings();++ string launcherDebug = Path.Combine(+ logsDir,+ "launcher_settings.txt"+ );++ File.WriteAllText(+ launcherDebug,+ $"Resolution={width}x{height}{Environment.NewLine}" ++ $"InternalResolution={1280 * internalResolutionScale}x{720 * internalResolutionScale} ({internalResolutionScale}x){Environment.NewLine}" ++ $"RefreshRate={refresh}{Environment.NewLine}" ++ $"Fullscreen={fullscreen}{Environment.NewLine}" ++ $"Monitor={monitor}{Environment.NewLine}" ++ $"VSync={vsyncBox.Checked}{Environment.NewLine}" ++ $"VRR={vrrBox.Checked}{Environment.NewLine}" ++ $"MSAA={msaaBox.Checked}{Environment.NewLine}" ++ $"PostEffect={postEffect}{Environment.NewLine}" ++ $"Adapter={adapter}{Environment.NewLine}" ++ $"ReadbackResolve=full (fixed){Environment.NewLine}" ++ $"ReadbackMemexport={readbackMemexportBox.Checked}{Environment.NewLine}" ++ $"ReadbackMemexportFast={readbackMemexportFastBox.Checked}{Environment.NewLine}" ++ $"ClearMemoryPageState={clearMemoryPageStateBox.Checked}{Environment.NewLine}" ++ $"OcclusionQueries={occlusionQueryBox.Checked}{Environment.NewLine}" ++ $"AsyncShaders={asyncShadersBox.Checked}{Environment.NewLine}"+ );++ UpdateStatus("Starting FIFA Street...", true);++ var process = Process.Start(startInfo);++ UpdateStatus(+ process != null+ ? $"Running • PID {process.Id}"+ : "Could not start the game",+ process != null+ );+ }+ catch (Exception ex)+ {+ UpdateStatus("Launch failed", false);++ MessageBox.Show(+ ex.Message,+ "Error starting FIFA Street",+ MessageBoxButtons.OK,+ MessageBoxIcon.Error+ );+ }+ }++ private void ShowError(string message)+ {+ UpdateStatus("Check your settings", false);++ MessageBox.Show(+ message,+ "FIFA Street Launcher",+ MessageBoxButtons.OK,+ MessageBoxIcon.Error+ );+ }++ private void BrowseExe()+ {+ using var dialog = new OpenFileDialog+ {+ Filter = "FIFA Street executable|fifastreet.exe|Executables|*.exe"+ };++ if (dialog.ShowDialog() == DialogResult.OK)+ exePathBox.Text = dialog.FileName;+ }++ private void BrowseGame()+ {+ using var dialog = new FolderBrowserDialog+ {+ Description = "Select the folder containing default.xex"+ };++ if (dialog.ShowDialog() == DialogResult.OK)+ gamePathBox.Text = dialog.SelectedPath;+ }++ private void OpenLogs()+ {+ string exe = exePathBox.Text.Trim();++ if (!File.Exists(exe))+ return;++ string logs = Path.Combine(+ Path.GetDirectoryName(exe)!,+ "Logs"+ );++ Directory.CreateDirectory(logs);++ Process.Start(new ProcessStartInfo+ {+ FileName = "explorer.exe",+ Arguments = $"\"{logs}\"",+ UseShellExecute = true+ });+ }++ private void OpenGameFolder()+ {+ string exe = exePathBox.Text.Trim();++ if (!File.Exists(exe))+ return;++ Process.Start(new ProcessStartInfo+ {+ FileName = "explorer.exe",+ Arguments = $"\"{Path.GetDirectoryName(exe)}\"",+ UseShellExecute = true+ });+ }++ private void SaveSettings()+ {+ try+ {+ var settings = new LauncherSettings+ {+ ExePath = exePathBox.Text,+ GamePath = gamePathBox.Text,+ Resolution = resolutionBox.Text,+ RefreshRate = refreshBox.Text,+ Fullscreen = displayModeBox.SelectedIndex == 0,+ Monitor = monitorBox.SelectedIndex,+ GraphicsApi = graphicsApiBox.SelectedIndex,+ Gpu = gpuBox.SelectedIndex,+ GpuUsesDxgi = true,+ PostEffect = postEffectBox.SelectedIndex,+ InternalResolutionScale = internalResolutionBox.SelectedIndex,+ ReadbackMemexport = readbackMemexportBox.Checked,+ ReadbackMemexportFast = readbackMemexportFastBox.Checked,+ ClearMemoryPageState = clearMemoryPageStateBox.Checked,+ OcclusionQueries = occlusionQueryBox.Checked,+ AsyncShaders = asyncShadersBox.Checked,+ VSync = vsyncBox.Checked,+ VRR = vrrBox.Checked,+ MSAA = msaaBox.Checked+ };++ string json = JsonSerializer.Serialize(+ settings,+ new JsonSerializerOptions+ {+ WriteIndented = true+ }+ );++ File.WriteAllText(SettingsPath, json);+ }+ catch+ {+ }+ }++ private void LoadSettings()+ {+ try+ {+ if (!File.Exists(SettingsPath))+ return;++ var settings =+ JsonSerializer.Deserialize<LauncherSettings>(+ File.ReadAllText(SettingsPath)+ );++ if (settings == null)+ return;++ exePathBox.Text = settings.ExePath ?? exePathBox.Text;+ const string oldDefaultExe = @"C:\Users\Samuel M\Desktop\FIFASTREET - 2012\Jogo\FifaStreetRex\out\build\win-amd64-debug\fifastreet.exe";+ string releaseExe = oldDefaultExe.Replace("win-amd64-debug", "win-amd64-release");+ if (string.Equals(exePathBox.Text, oldDefaultExe, StringComparison.OrdinalIgnoreCase)+ && File.Exists(releaseExe))+ exePathBox.Text = releaseExe;+ gamePathBox.Text = settings.GamePath ?? gamePathBox.Text;++ displayModeBox.SelectedIndex =+ settings.Fullscreen ? 0 : 1;++ if (settings.Monitor >= 0 &&+ settings.Monitor < monitorBox.Items.Count)+ {+ monitorBox.SelectedIndex = settings.Monitor;+ }++ DetectDisplayModes();++ SelectItem(resolutionBox, settings.Resolution);+ SelectItem(refreshBox, settings.RefreshRate);++ if (settings.GraphicsApi >= 0 &&+ settings.GraphicsApi < graphicsApiBox.Items.Count)+ {+ graphicsApiBox.SelectedIndex = settings.GraphicsApi;+ }++ if (settings.GpuUsesDxgi && settings.Gpu >= 0 &&+ settings.Gpu < gpuBox.Items.Count)+ {+ gpuBox.SelectedIndex = settings.Gpu;+ }++ if (settings.PostEffect >= 0 &&+ settings.PostEffect < postEffectBox.Items.Count)+ {+ postEffectBox.SelectedIndex = settings.PostEffect;+ }+if (settings.InternalResolutionScale >= 0 &&+ settings.InternalResolutionScale < internalResolutionBox.Items.Count)+{+ internalResolutionBox.SelectedIndex = settings.InternalResolutionScale;+}++ readbackMemexportBox.Checked = settings.ReadbackMemexport;+ readbackMemexportFastBox.Checked = settings.ReadbackMemexportFast;+ clearMemoryPageStateBox.Checked = settings.ClearMemoryPageState;+ occlusionQueryBox.Checked = settings.OcclusionQueries;+ asyncShadersBox.Checked = settings.AsyncShaders;++ vsyncBox.Checked = settings.VSync;+ vrrBox.Checked = settings.VRR;+ msaaBox.Checked = settings.MSAA;+ }+ catch+ {+ }+ }++ private static void SelectItem(ComboBox box, string? value)+ {+ if (string.IsNullOrWhiteSpace(value))+ return;++ int index = box.Items.IndexOf(value);++ if (index >= 0)+ box.SelectedIndex = index;+ }++ private sealed class MessiPicture : PictureBox+ {+ private const float CropX = 100f / 1280f;+ private const float CropY = 225f / 1819f;+ private const float CropWidth = 640f / 1280f;++ protected override void OnPaint(PaintEventArgs e)+ {+ if (Image == null || ClientSize.Width <= 0 || ClientSize.Height <= 0)+ return;++ e.Graphics.Clear(Color.FromArgb(10, 12, 16));+ e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;+ e.Graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;++ float sourceX = Image.Width * CropX;+ float sourceY = Image.Height * CropY;+ float sourceWidth = Image.Width * CropWidth;++ // Preserve the same horizontal framing. Expanding the launcher+ // reveals more of the source image vertically without stretching.+ float scale = ClientSize.Width / sourceWidth;+ float sourceHeight = ClientSize.Height / scale;+ float availableHeight = Image.Height - sourceY;+ sourceHeight = Math.Min(sourceHeight, availableHeight);++ var sourceRect = new RectangleF(sourceX, sourceY, sourceWidth, sourceHeight);+ float destinationHeight = sourceHeight * scale;+ var destinationRect = new RectangleF(0, 0, ClientSize.Width, destinationHeight);++ e.Graphics.DrawImage(Image, destinationRect, sourceRect, GraphicsUnit.Pixel);+ }+ }+}++public class LauncherSettings+{+ public string? ExePath { get; set; }+ public string? GamePath { get; set; }+ public string? Resolution { get; set; }+ public string? RefreshRate { get; set; }+ public bool Fullscreen { get; set; } = true;+ public int Monitor { get; set; }+ public int GraphicsApi { get; set; } = 0;+ public int Gpu { get; set; }+ public bool GpuUsesDxgi { get; set; }+ public int PostEffect { get; set; }+ public int InternalResolutionScale { get; set; } = 0;+ public bool ReadbackMemexport { get; set; } = true;+ public bool ReadbackMemexportFast { get; set; } = true;+ public bool ClearMemoryPageState { get; set; } = false;+ public bool OcclusionQueries { get; set; } = true;+ public bool AsyncShaders { get; set; } = true;+ public bool VSync { get; set; } = true;+ public bool VRR { get; set; } = false;+ public bool MSAA { get; set; } = false;+}++public class RoundedPanel : Panel+{+ public Color FillColor { get; set; } = Color.FromArgb(18, 22, 28);+ public Color BorderColor { get; set; } = Color.FromArgb(48, 57, 68);+ public int Radius { get; set; } = 16;++ public RoundedPanel()+ {+ DoubleBuffered = true;+ BackColor = Color.Transparent;+ }++ protected override void OnPaint(PaintEventArgs e)+ {+ base.OnPaint(e);++ e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;++ Rectangle rect = ClientRectangle;+ rect.Width -= 1;+ rect.Height -= 1;++ using var path = CreateRoundedRectangle(rect, Radius);+ using var fill = new SolidBrush(FillColor);+ using var border = new Pen(BorderColor, 1F);++ e.Graphics.FillPath(fill, path);+ e.Graphics.DrawPath(border, path);+ }++ protected override void OnResize(EventArgs eventargs)+ {+ base.OnResize(eventargs);+ Invalidate();+ }++ private static GraphicsPath CreateRoundedRectangle(Rectangle rect, int radius)+ {+ int diameter = radius * 2;++ var path = new GraphicsPath();++ if (diameter <= 0)+ {+ path.AddRectangle(rect);+ return path;+ }++ var arc = new Rectangle(rect.Location, new Size(diameter, diameter));++ path.AddArc(arc, 180, 90);++ arc.X = rect.Right - diameter;+ path.AddArc(arc, 270, 90);++ arc.Y = rect.Bottom - diameter;+ path.AddArc(arc, 0, 90);++ arc.X = rect.Left;+ path.AddArc(arc, 90, 90);++ path.CloseFigure();++ return path;+ }+}++public class ModernButton : Button+{+ public Color FillColor { get; set; } = Color.FromArgb(24, 29, 36);+ public Color HoverColor { get; set; } = Color.FromArgb(34, 41, 50);+ public Color BorderColor { get; set; } = Color.FromArgb(48, 57, 68);+ public int Radius { get; set; } = 10;++ private bool hovered;++ public ModernButton()+ {+ FlatStyle = FlatStyle.Flat;+ FlatAppearance.BorderSize = 0;+ Cursor = Cursors.Hand;+ UseVisualStyleBackColor = false;+ DoubleBuffered = true;+ BackColor = Color.Transparent;++ MouseEnter += (_, _) =>+ {+ hovered = true;+ Invalidate();+ };++ MouseLeave += (_, _) =>+ {+ hovered = false;+ Invalidate();+ };+ }++ protected override void OnPaint(PaintEventArgs pevent)+ {+ pevent.Graphics.SmoothingMode = SmoothingMode.AntiAlias;++ Rectangle rect = ClientRectangle;+ rect.Width -= 1;+ rect.Height -= 1;++ using var path = CreateRoundedRectangle(rect, Radius);+ using var fill = new SolidBrush(hovered ? HoverColor : FillColor);+ using var border = new Pen(BorderColor, 1F);++ pevent.Graphics.FillPath(fill, path);+ pevent.Graphics.DrawPath(border, path);++ TextRenderer.DrawText(+ pevent.Graphics,+ Text,+ Font,+ ClientRectangle,+ ForeColor,+ TextFormatFlags.HorizontalCenter |+ TextFormatFlags.VerticalCenter |+ TextFormatFlags.EndEllipsis+ );+ }++ private static GraphicsPath CreateRoundedRectangle(Rectangle rect, int radius)+ {+ int diameter = radius * 2;++ var path = new GraphicsPath();++ if (diameter <= 0)+ {+ path.AddRectangle(rect);+ return path;+ }++ var arc = new Rectangle(rect.Location, new Size(diameter, diameter));++ path.AddArc(arc, 180, 90);++ arc.X = rect.Right - diameter;+ path.AddArc(arc, 270, 90);++ arc.Y = rect.Bottom - diameter;+ path.AddArc(arc, 0, 90);++ arc.X = rect.Left;+ path.AddArc(arc, 90, 90);++ path.CloseFigure();++ return path;+ }+}diff --git a/README.md b/README.mdindex 18d9efd..12023af 100644--- a/README.md+++ b/README.md@@ -1,4 +1,4 @@-<div align="center">+<div align="center"><img src="docs/images/project-icon.png" alt="FIFA Street" width="64">@@ -16,7 +16,7 @@## About-I'm bringing FIFA Street (2012) to Windows PC using ReXGlue. I've built a graphical installer and a dedicated launcher with display, graphics and compatibility settings.+I'm bringing FIFA Street (2012) to Windows PC using ReXGlue. The project includes a graphical installer and a dedicated launcher with Direct3D 12 and Vulkan support, display settings, independent internal-resolution scaling and compatibility controls.The installer uses your own Xbox 360 ISO to extract the game files, apply my menu credits and compile the game locally. I don't include an ISO, original game data or generated game binaries in this repository or installer.@@ -24,7 +24,7 @@ The installer uses your own Xbox 360 ISO to extract the game files, apply my menThe latest experimental release is available from the [release page](https://github.com/samuelitodavila/fifa-street-pc/releases).-**You'll need:** Windows x64, your own Xbox 360 FIFA Street ISO, a Vulkan-capable GPU and at least 12 GB free on the destination drive, plus extra space for temporary and build files.+**You'll need:** Windows x64, your own Xbox 360 FIFA Street ISO, a compatible Direct3D 12 or Vulkan GPU and at least 12 GB free on the destination drive, plus extra space for temporary and build files.1. Run **FifaStreetSetup.exe**.2. Select your ISO and a new or empty installation folder.@@ -33,11 +33,48 @@ The latest experimental release is available from the [release page](https://gitThe installer includes its .NET runtime, SDK and compiler tools. Installation time varies by system.+## Graphics backends++v0.3.0 Experimental packages two validated ReXGlue graphics backends:++- **Direct3D 12** — default backend, with GPU-adapter selection in the launcher.+- **Vulkan** — uses automatic Vulkan device selection.++The launcher switches the validated `rexruntime.dll` and `rexgpu-xenos.dll` pair automatically when the graphics API is changed.++Full resolve readback is fixed to the validated configuration for both backends.++## Resolution controls++Output resolution and internal rendering resolution are configured independently.++**Output Resolution** controls the video/window output. Common modes exposed by the launcher include:++- 1280x720+- 1920x1080+- 2560x1440+- 3200x1800+- 3840x2160++**Internal Resolution** controls the integer render scale relative to FIFA Street's 1280x720 base:++- 1x — 1280x720+- 2x — 2560x1440+- 3x — 3840x2160+- 4x — 5120x2880++Higher settings are exposed for testing and do not imply a performance guarantee. Output resolution does not automatically change the internal rendering scale.+## World Tour fix-The current build recompiles the additional **FootballCompEngzf** competition-engine module used by World Tour. This fixes the crash previously encountered when progressing through the Bronze/Silver/Gold World Tour flow.+The current build recompiles the additional **FootballCompEngzf** competition-engine module used by World Tour. This fixes the crash/return-to-menu previously encountered during Bronze/Silver/Gold World Tour progression.-A clean end-to-end installation from an original Xbox 360 ISO has been completed successfully with the current pipeline. The resulting installation was launched through the included launcher, and **Practice** and **World Tour** were tested successfully.+The installer now builds the main executable plus:++- `fifastreet_fifadllzf_xex.dll`+- `fifastreet_FootballCompEngzf_xex.dll`++A clean end-to-end installation from an original Xbox 360 ISO has been completed successfully with the current multi-backend pipeline. Direct3D 12, Vulkan, Practice and World Tour were tested successfully from that installation.## Screenshots and gameplay@@ -55,11 +92,15 @@ I've recorded gameplay from my PC build.## Current status-The current installer pipeline has been validated from ISO extraction through credit patching, local recompilation and first launch. It builds the main executable plus the `fifadllzf` and `FootballCompEngzf` guest modules.+The v0.3.0 installer pipeline has been validated from ISO extraction through credit patching, local recompilation, multi-backend packaging and first launch.++A clean installation was tested with both Direct3D 12 and Vulkan. 2560x1440 output with 2x internal rendering was specifically exercised during backend validation. World Tour was also retested successfully on the final clean multi-backend installation.++This remains an experimental port. Performance depends on hardware, drivers, output resolution and internal scale. 3x/4x internal rendering and 4K output should not be interpreted as guaranteed 60 FPS modes.-The package uses the validated Vulkan runtime/GPU pair and the known-good full resolve-readback configuration. More hardware, controllers, audio, saves, venues and long-session testing is still welcome; see [known issues and validation](docs/STATUS.md).+See [known issues and validation](docs/STATUS.md) for the current validation scope.-If you encounter a problem, [open an issue](https://github.com/samuelitodavila/fifa-street-pc/issues) with your hardware, Windows and driver versions, settings and relevant logs. Please don't upload ISOs or game files.+If you encounter a problem, [open an issue](https://github.com/samuelitodavila/fifa-street-pc/issues) with your hardware, Windows and driver versions, selected graphics API/settings and relevant logs. Please don't upload ISOs or game files.## Credits and licencediff --git a/docs/BUILDING.md b/docs/BUILDING.mdindex a1f4600..6763cab 100644--- a/docs/BUILDING.md+++ b/docs/BUILDING.md@@ -1,4 +1,4 @@-# 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.@@ -6,87 +6,119 @@ The usual player workflow uses the release installer and a personal ISO. These i- 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. The development package uses LLVM 23 resource files; set `-ClangResourceVersion` for a different installed version only after checking compatibility.+- LLVM/Clang, CMake and Ninja.- The ReXGlue checkout and dependencies, including the project patch.- A locally built or obtained `extract-xiso.exe` from [XboxDev/extract-xiso](https://github.com/XboxDev/extract-xiso), placed in `Installer/tools/`.- Your own supported game ISO or extracted `GameData` for game builds.-The generalized packaging script has been syntax-checked. Its portable path changes have not been validated by a fresh SDK build on another PC.-## Prepare ReXGlueFrom the repository root:-```powershell-git clone --recursive https://github.com/rexglue/rexglue-sdk.git ReXGlue-git -C ReXGlue checkout c94f5ebdcb3c9d1a460ca48e04f9758448f8d518-git -C ReXGlue submodule update --init --recursive-git -C ReXGlue apply --check ../patches/rexglue-local-changes.patch-git -C ReXGlue apply ../patches/rexglue-local-changes.patch-```+ git clone --recursive https://github.com/rexglue/rexglue-sdk.git ReXGlue+ git -C ReXGlue checkout c94f5ebdcb3c9d1a460ca48e04f9758448f8d518+ git -C ReXGlue submodule update --init --recursive+ git -C ReXGlue apply --check ../patches/rexglue-local-changes.patch+ git -C ReXGlue apply ../patches/rexglue-local-changes.patch++The recorded project patch has been checked and applied successfully against this ReXGlue base. It contains project-specific code-generation, graphics, memory, runtime, scaling, diagnostics and window/input compatibility changes.++Do not assume a newer ReXGlue revision is compatible with the patch.-This commit identifies the development checkout. The patch records project-specific changes, including graphics compatibility, draw scaling, diagnostics and window restoration. Follow [ReXGlue's build documentation](https://github.com/rexglue/rexglue-sdk/wiki/Getting-Started) for its toolchain/dependency prerequisites. Do not assume a newer SDK is compatible with the recorded patch.+## Build the base SDKBuild and install the base SDK in a configured Windows C++ developer terminal:-```powershell-cmake -S ReXGlue --preset win-amd64-cmake --build ReXGlue/out/build/win-amd64 --config Release --parallel 2-cmake --install ReXGlue/out/build/win-amd64 --config Release-```+ cmake -S ReXGlue --preset win-amd64+ cmake --build ReXGlue/out/build/win-amd64 --config Release --parallel 2+ cmake --install ReXGlue/out/build/win-amd64 --config Release++## Build the Direct3D 12 backend++The v0.3.0 package contains a separate validated Direct3D 12 runtime/GPU pair.++Use the project's configured Clang/Ninja ReXGlue build with Direct3D 12 enabled and Vulkan disabled. Keep `rexruntime.dll` and `rexgpu-xenos.dll` from the same build together.++The release packaging script expects the validated Direct3D 12 pair under the project's D3D12 backend output directory and verifies its SHA-256 hashes before packaging.++Validated release hashes:++- `rexruntime.dll`: `790B6B1B13765249160E53DCE6F28AF0F03B66D5D1AEDB1054949C50B13F04E8`+- `rexgpu-xenos.dll`: `461A88F1D27C605106453B0F3C92BD72BD4BC166DCDC0BBF01E825BCEFB8418D`++## Build the Vulkan backend++Build the separate Vulkan renderer/runtime using the project's Clang/Ninja configuration. Keep the runtime and GPU DLL from the same build together.++The release packaging script expects the validated Vulkan pair under the project's Vulkan backend output directory and verifies its SHA-256 hashes before packaging.-Build the separate Vulkan renderer/runtime used by the package:+Validated release hashes:-```powershell-cmake -S ReXGlue -B ReXGlue/out/build/win-amd64-vulkan -G "Ninja Multi-Config" `- -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ `- -DREXGLUE_USE_VULKAN=ON -DREXGLUE_USE_D3D12=OFF `- -DREXGLUE_BUILD_TESTS=OFF -DREXGLUE_ENABLE_PERF_COUNTERS=ON `- -DREXGLUE_OUTPUT_DIRECTORY="$PWD/ReXGlue/out/win-amd64-vulkan"-cmake --build ReXGlue/out/build/win-amd64-vulkan --config Release --parallel 2-```+- `rexruntime.dll`: `115722CC5905D07FC6A6212B47692FFE6405DD1BA9F87CDA97F8DA2C25E4767A`+- `rexgpu-xenos.dll`: `71FA61D82FF6134F1F407D682ACEBAC01F2B3B2DCEFCC34151A0C082B746BDD2`-The packager uses the installed base SDK layout and code generator, then replaces the runtime/GPU libraries and their import libraries with the Vulkan build. Keep the DLLs and `.lib` files from the same build together.+The runtime and GPU DLL from each backend must remain paired.## Build the launcher-```powershell-dotnet publish Launcher/FifaStreetLauncher/FifaStreetLauncher.csproj `- -c Release -r win-x64 --self-contained true `- -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true `- -o dist/launcher-```+ dotnet publish Launcher/FifaStreetLauncher/FifaStreetLauncher.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -o dist/launcher++The launcher expects installed backend pairs under:++ Game/Backends/D3D12/+ Game/Backends/Vulkan/++It activates the selected pair beside `fifastreet.exe` before starting the game.## Package the installerThe source images and icon are tracked. Compiled SDK tools, `extract-xiso.exe`, compiler binaries and `bundle.zip` remain local and excluded from Git.-```powershell-./Installer/BuildSetup.ps1 `- -Output "$PWD/dist/FifaStreetSetup-Windows-x64.exe" `- -LLVMRoot "C:/Program Files/LLVM" `- -CMakeRoot "C:/Program Files/CMake" `- -NinjaPath "C:/Tools/ninja.exe" `- -ClangResourceVersion "23"-```+ ./Installer/BuildSetup.ps1 -Output "C:\Users\Samuel M\Desktop\FIFASTREET - 2012\Installer/dist/FifaStreetSetup.exe"++The packaging script creates the public-tool bundle, publishes the launcher and publishes the self-contained installer.++The v0.3.0 packaging pipeline also:++- includes the validated Direct3D 12 and Vulkan backend pairs;+- verifies all four backend DLL hashes;+- keeps the backend pairs in separate package directories;+- installs Direct3D 12 as the initial active backend;+- rejects game archive/executable extensions from the public bundle.-The script creates the public-tool bundle, publishes the launcher and publishes the self-contained installer. It rejects game archive/executable extensions in the bundle. Review exact-version third-party notices before distributing a public release.+Review exact-version third-party notices before distributing a public release.The installer embeds `credit-patch.json.gz` and the managed LZX decoder. The recipe is the small difference needed for the two credit menus; it is not a copy of either menu archive. No original game font or modified BIG archive is included.## Compile from extracted game data-```powershell-$env:REXSDK_DIR = "$PWD/ReXGlue"-./Installer/BuildFifaStreet.ps1 `- -GameData "C:/Private/FIFA Street/GameData" `- -Output "C:/Private/FIFA Street/Game" -Jobs 2-```+Set `REXSDK_DIR` to the prepared ReXGlue SDK and run `Installer/BuildFifaStreet.ps1` with your private extracted `GameData` and an output directory.-This builds the game binaries from local data. The graphical installer additionally applies the menu credits before recompilation. Do not commit the extracted files or generated guest source.+The build pipeline produces:++ fifastreet.exe+ fifastreet_fifadllzf_xex.dll+ fifastreet_FootballCompEngzf_xex.dll++`FootballCompEngzf.xex.dll` is read from the game's DLC tree and recompiled as an independent guest module for World Tour.++The graphical installer additionally applies the menu credits before recompilation. Do not commit extracted files or generated guest source.## Verify before publishing-Use [STATUS.md](STATUS.md) as the validation record. Check the full ISO-to-install workflow, menu credits, requested internal resolution, window restoration, controller/audio/save behavior and shortcut creation. Preserve build logs when a check fails.+Use [STATUS.md](STATUS.md) as the validation record.++For a release, verify:++- complete ISO-to-install workflow;+- start-screen/main-menu credits;+- all three recompiled outputs;+- Direct3D 12 launch;+- Vulkan launch;+- backend switching;+- output/internal-resolution independence;+- World Tour;+- public-package game-file exclusion;+- ReXGlue patch application against the recorded base.Upload the installer as a Release asset; commit source, documentation, screenshots and notices. See [GitHub presentation](GITHUB-PRESENTATION.md).diff --git a/docs/RELEASE-NOTES.md b/docs/RELEASE-NOTES.mdindex 7983b4a..ba38024 100644--- a/docs/RELEASE-NOTES.md+++ b/docs/RELEASE-NOTES.md@@ -1,23 +1,105 @@-# FIFA Street Recompiled v0.2.0 Experimental+# FIFA Street Recompiled v0.3.0 Experimental-This experimental update fixes the World Tour failure found in the previous PC build.+v0.3.0 is a major experimental update to the FIFA Street PC recompilation project. It introduces a new multi-backend launcher and installer, Direct3D 12 support alongside Vulkan, independent output/internal resolution controls, updated ReXGlue compatibility changes and the previously completed World Tour correction.-## Changes+## Highlights-- Fixed the World Tour crash/return-to-menu encountered during Bronze/Silver/Gold progression.-- Added discovery and recompilation of `FootballCompEngzf.xex.dll`, the additional competition-engine module used by World Tour.-- The installer now builds and validates `fifastreet_FootballCompEngzf_xex.dll` alongside the main executable and `fifastreet_fifadllzf_xex.dll`.-- Kept the validated Vulkan runtime/GPU pair.-- Kept `readback_resolve = "full"` as the validated resolve-readback configuration.-- Completed a clean end-to-end installation from an original Xbox 360 FIFA Street ISO.-- Confirmed launcher startup, menus, Practice and World Tour on the clean installation.+- Added **Direct3D 12** as a validated graphics backend.+- Kept **Vulkan** as a validated graphics backend.+- Added graphics-API selection directly to the launcher.+- Added automatic switching of the validated ReXGlue runtime/GPU DLL pair.+- Reworked the launcher UI.+- Separated **Output Resolution** from **Internal Resolution**.+- Added internal rendering scales from **1x to 4x**.+- Added common output modes through **3840x2160**, including 3200x1800.+- Full resolve readback is fixed to the validated configuration.+- Updated the installer to package and verify both graphics backends.+- Updated the ReXGlue project patch and verified that it applies cleanly against the recorded `c94f5eb` base.+- Retained the World Tour `FootballCompEngzf` correction.-## Installation+## Graphics backends-Download **FifaStreetSetup.exe**, run it, select your own Xbox 360 FIFA Street ISO and choose a new or empty installation directory.+The release package now contains separate:-No ISO, original game data, XEX files, BIG/BH archives or generated game binaries are distributed with this project.+- `Game/Backends/D3D12`+- `Game/Backends/Vulkan`-## Status+backend directories.-This is still an experimental PC port. Broader hardware, controller, audio, save, venue and long-session testing is still in progress.+The launcher copies the selected backend's `rexruntime.dll` and `rexgpu-xenos.dll` into the active game directory before launch.++Direct3D 12 is the default graphics API. GPU-adapter selection is available for D3D12.++Vulkan uses automatic device selection.++Both backends were launched successfully from the final clean multi-backend installation.++## Resolution changes++Output resolution no longer determines the internal render scale.++Available internal scales are:++- **1x** — 1280x720+- **2x** — 2560x1440+- **3x** — 3840x2160+- **4x** — 5120x2880++Common output modes exposed by the launcher include:++- 1280x720+- 1920x1080+- 2560x1440+- 3200x1800+- 3840x2160++2560x1440 output with 2x internal rendering was specifically tested during backend validation.++Higher internal scales and 4K output are available for testing, but this release does not claim that every combination maintains 60 FPS.++## World Tour++The installer continues to discover and recompile:++`dlc/dlc_FootballCompEng/dlc/FootballCompEng/FootballCompEngzf.xex.dll`++into:++`fifastreet_FootballCompEngzf_xex.dll`++This addresses the previous World Tour crash/return-to-menu during Bronze/Silver/Gold progression.++World Tour was retested successfully on the final clean v0.3.0 multi-backend installation.++## Installer changes++The installer now packages validated Direct3D 12 and Vulkan ReXGlue backend pairs and verifies their SHA-256 hashes.++It still performs the complete local workflow from the user's own Xbox 360 ISO:++1. Extract the ISO.+2. Apply the start-screen and main-menu credits.+3. Recompile the main executable.+4. Recompile `fifadllzf.xex.dll`.+5. Recompile `FootballCompEngzf.xex.dll`.+6. Install both graphics backends.+7. Install the launcher.++No ISO, original game data, XEX files, BIG/BH archives or generated game binaries are distributed with the project.++## Validation++The final v0.3.0 release-candidate installer was tested through a clean installation.++Confirmed in that installation:++- successful ISO extraction and recompilation;+- launcher startup;+- Direct3D 12 launch;+- Vulkan launch;+- automatic backend DLL switching;+- 2560x1440 output with 2x internal rendering;+- Practice;+- World Tour.++The project remains experimental. Broader GPU/driver, controller, audio, save, venue, resolution and long-session testing is still welcome.diff --git a/docs/STATUS.md b/docs/STATUS.mdindex 245d3a1..147064f 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -1,21 +1,25 @@-# Validation and known limitations+# Validation and known limitations-Last updated: **2 October 2026**. The project remains experimental, but the current installer pipeline has now completed a clean end-to-end validation.+Last updated: **2 October 2026**. The project remains experimental. v0.3.0 has completed a clean end-to-end validation of the new multi-backend installer and launcher.## Confirmed evidence| Check | Result | Scope ||---|---|---|-| Current full ISO installation | **Passed** | ISO extraction, credit patch, local recompilation, packaging and first launch |+| Current full ISO installation | **Passed** | ISO extraction, credit patch, local recompilation, multi-backend packaging and first launch || Main game executable | **Passed** | `fifastreet.exe` produced by the installer || Main guest DLL | **Passed** | `fifastreet_fifadllzf_xex.dll` produced by the installer || World Tour competition DLL | **Passed** | `fifastreet_FootballCompEngzf_xex.dll` produced from `FootballCompEngzf.xex.dll` |-| World Tour | **Passed in tested flow** | Bronze/Silver/Gold progression no longer returns to the menu at the previous failure point |-| Practice | **Passed** | Launched successfully from the clean installation |-| Credits in the game | **Passed** | Start-screen and main-menu credit patch present |-| Vulkan runtime packaging | **Passed** | Installer pins the runtime/GPU pair validated with FIFA Street |-| Resolve readback | **Passed in current configuration** | `readback_resolve = "full"` is the validated configuration |-| Launcher | **Passed** | Clean installation launched successfully through the included launcher |+| World Tour | **Passed in tested flow** | Previous Bronze/Silver/Gold failure corrected; World Tour retested successfully on the final clean installation |+| Practice | **Passed** | Launched successfully from a clean installation |+| Credits in the game | **Passed** | Start-screen and main-menu `PORTED BY: SAMUELITODAVILA` credit present |+| Direct3D 12 backend | **Passed** | Packaged backend launched successfully from the final clean installation |+| Vulkan backend | **Passed** | Packaged backend launched successfully from the final clean installation |+| Backend switching | **Passed** | Launcher selected the requested backend and activated the corresponding validated runtime/GPU DLL pair |+| Resolve readback | **Passed in current configuration** | Full resolve readback is fixed by the launcher |+| Output/internal resolution separation | **Passed** | 2560x1440 output with 1x and 2x internal settings exercised independently |+| Launcher | **Passed** | Graphics API selection, backend activation and launch tested |+| ReXGlue project patch | **Passed** | Patch `--check` and application succeeded against clean ReXGlue `c94f5eb` || Game-file exclusion | **Passed** | Public package excludes ISO, original XEX, BIG/BH archives and generated game binaries |## World Tour correction@@ -24,7 +28,9 @@ World Tour loads an additional competition-engine module from the game's DLC tre`dlc/dlc_FootballCompEng/dlc/FootballCompEng/FootballCompEngzf.xex.dll`-Earlier builds recompiled the main executable and `fifadllzf.xex.dll` but did not provide a recompiled host module for this dynamically loaded guest DLL. The current pipeline detects that module, includes it in the ReXGlue manifest, generates its guest source and builds:+Earlier builds recompiled the main executable and `fifadllzf.xex.dll` but did not provide a recompiled host module for this dynamically loaded guest DLL.++The current pipeline detects the module, includes it in the ReXGlue manifest, generates its guest source and builds:`fifastreet_FootballCompEngzf_xex.dll`@@ -32,7 +38,7 @@ The `fifadllzf`-specific stubs are intentionally not attached to this independen## Current clean-install validation-The current setup was tested through the complete player-facing path:+The v0.3.0 setup was tested through the complete player-facing path:1. Select an original FIFA Street Xbox 360 ISO.2. Extract the game data.@@ -40,37 +46,80 @@ The current setup was tested through the complete player-facing path:4. Recompile the main executable.5. Recompile `fifadllzf.xex.dll`.6. Recompile `FootballCompEngzf.xex.dll`.-7. Install the validated Vulkan runtime/GPU pair.+7. Install both validated graphics backends.8. Start the dedicated launcher.-9. Launch the game.-10. Test menus, Practice and World Tour.+9. Launch and test Direct3D 12.+10. Switch to Vulkan and launch again.+11. Test gameplay and World Tour.That workflow completed successfully on the developer's test system.-## Renderer/runtime configuration+## Graphics backends++The release package contains separate validated backend directories:++`Game/Backends/D3D12`++`Game/Backends/Vulkan`++The launcher copies the selected backend's `rexruntime.dll` and `rexgpu-xenos.dll` beside `fifastreet.exe` before launch.-The release packaging script verifies the validated runtime files before creating the installer:+Direct3D 12 is the default backend. Vulkan uses automatic Vulkan-device selection.++### Direct3D 12 validated files++- `rexruntime.dll` SHA-256: `790B6B1B13765249160E53DCE6F28AF0F03B66D5D1AEDB1054949C50B13F04E8`+- `rexgpu-xenos.dll` SHA-256: `461A88F1D27C605106453B0F3C92BD72BD4BC166DCDC0BBF01E825BCEFB8418D`++### Vulkan validated files- `rexruntime.dll` SHA-256: `115722CC5905D07FC6A6212B47692FFE6405DD1BA9F87CDA97F8DA2C25E4767A`- `rexgpu-xenos.dll` SHA-256: `71FA61D82FF6134F1F407D682ACEBAC01F2B3B2DCEFCC34151A0C082B746BDD2`-The current known-good game configuration uses full resolve readback.+The installer verifies these hashes before packaging/installing the backends.++## Renderer configuration++Full resolve readback is the validated configuration and is fixed by the launcher.++For Direct3D 12, the validated configuration uses ReXGlue's automatic render-target-path selection.++For Vulkan, the validated configuration uses the `fbo` render-target path and automatic Vulkan device selection.++Fast readback was rejected during development because it produced visible graphical corruption.++## Resolution model++Output resolution and internal rendering scale are independent.++The launcher exposes common output modes through 3840x2160, including 3200x1800.++Internal resolution is based on the game's 1280x720 render base:++- 1x — 1280x720+- 2x — 2560x1440+- 3x — 3840x2160+- 4x — 5120x2880++2560x1440 output with 2x internal rendering was specifically tested with the current backends. Higher combinations remain available for testing but are not a performance guarantee.## Remaining validation-- Test more World Tour events and a longer career progression.+- Test more World Tour events and longer career progression.- Exercise prerequisite installation on additional clean Windows systems.- Verify more complete matches, venues, audio, controller mappings, saves and repeated launches.-- Validate individual graphics controls and ultrawide output.+- Validate additional graphics-control combinations and ultrawide output.+- Expand Direct3D 12 and Vulkan testing across more GPU vendors and driver versions.- Record supported ISO regions/revisions. The credit recipe rejects unknown menu hashes.-- Continue hardware/driver testing beyond the developer's current system.+- Continue performance testing across output/internal-resolution combinations.## Known limitations-- No universal hardware/driver or frame-rate guarantee.+- No universal hardware, driver or frame-rate guarantee.+- 3x/4x internal rendering and 4K output are not guaranteed 60 FPS modes.- No verified online-play support.-- The renderer uses integer multiples of the game's 1280×720 base for internal scaling.-- Some SDK controls may not apply to the Vulkan backend or may need title-specific testing.+- Internal scaling uses integer multiples of the game's 1280x720 base.+- Some advanced SDK controls remain title/backend-specific and require further validation.- Generated recompilation warnings remain and should continue to be investigated.- Cancellation/failure may leave incomplete diagnostic workspaces.- Free-space requirements depend on extraction, compilation and temporary packaging.diff --git a/docs/TESTING.md b/docs/TESTING.mdindex 2f15ba6..7f78c5b 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -7,12 +7,56 @@ The recorded results are in [STATUS.md](STATUS.md). These steps describe checks1. Use a personal supported Xbox 360 ISO and a new, empty installation folder.2. Record installer version, start/end times, Windows version, CPU, GPU/driver, free space and ISO region/revision.3. Confirm extraction, menu-credit patching and compilation finish successfully.-4. Confirm `Game/fifastreet.exe` and `Game/fifastreet_fifadllzf_xex.dll` exist, with runtime libraries.-5. Test the optional desktop shortcut and **OPEN LAUNCHER**.-6. Repeat separately on a clean Windows machine to test missing C++ prerequisites.+4. Confirm the following files exist:+ - `Game/fifastreet.exe`+ - `Game/fifastreet_fifadllzf_xex.dll`+ - `Game/fifastreet_FootballCompEngzf_xex.dll`+5. Confirm `Game/Backends/D3D12` and `Game/Backends/Vulkan` each contain `rexruntime.dll` and `rexgpu-xenos.dll`.+6. Confirm the initial root runtime/GPU pair corresponds to Direct3D 12.+7. Test the optional desktop shortcut and **OPEN LAUNCHER**.+8. Repeat separately on a clean Windows machine to test missing C++ prerequisites.For cancellation, use a disposable new destination, cancel during extraction/build, and confirm the active child process stops. Partial installation files can remain. Do not reuse that destination as a completed game.+## Backend switching++Test both graphics APIs from the same clean installation.++### Direct3D 12++1. Select **Direct3D 12**.+2. Confirm GPU-adapter selection is enabled.+3. Press **PLAY**.+4. Confirm the game starts and renders correctly.+5. Record the active root runtime/GPU hashes if validating a release package.++### Vulkan++1. Select **Vulkan**.+2. Confirm the launcher uses automatic Vulkan device selection.+3. Press **PLAY**.+4. Confirm the game starts and renders correctly.+5. Confirm the active root runtime/GPU pair has changed to the packaged Vulkan pair.++Switch back to Direct3D 12 and repeat when validating backend switching in both directions.++## Resolution testing++Output resolution and internal rendering resolution must be tested separately.++The launcher exposes internal scales:++- 1x — 1280x720+- 2x — 2560x1440+- 3x — 3840x2160+- 4x — 5120x2880++Test output modes supported by the display, including 1280x720, 1920x1080, 2560x1440, 3200x1800 and 3840x2160 where applicable.++Changing output resolution must not implicitly change the selected internal scale.++Record both values in performance reports.+## Credits and content checksThe local patch test was run on copies of the original `data1.big` and `data1.bh`, using the packaged installer's `--credit-test <GameDataFolder> <LogPath>` developer entry point. Wait for the process to exit before inspecting the log.@@ -26,14 +70,27 @@ Audit the distributable bundle separately for game ISOs, original XEX files, BIG## Launcher and game1. Confirm the start screen and main menu display **PORTED BY: SAMUELITODAVILA**.-2. Choose 1280×720, 1920×1080, 2560×1440 and 3840×2160 where the display supports them. Record the internal size shown by the launcher and the runtime's actual render-scale behavior.-3. Test both fullscreen and windowed mode. Minimize/restore repeatedly from the menu and during play; the game should repaint and remain responsive.-4. Play a complete match. Check controls, sound, transitions and results.-5. Save, close the game, relaunch and load the saved state.-6. Test additional modes/venues and controllers individually. Record unsupported options and reproduction steps.+2. Confirm Direct3D 12 and Vulkan can each launch the game.+3. Confirm full resolve readback remains active.+4. Test fullscreen and windowed mode. Minimize/restore repeatedly from the menu and during play.+5. Play a complete match. Check controls, sound, transitions and results.+6. Enter World Tour and exercise the progression path that previously failed.+7. Save, close the game, relaunch and load the saved state.+8. Test additional modes/venues and controllers individually. Record unsupported options and reproduction steps.++## ReXGlue patch++Before a release, verify the project patch against the recorded ReXGlue base:++ git -C ReXGlue apply --check ../patches/rexglue-local-changes.patch+ git -C ReXGlue apply ../patches/rexglue-local-changes.patch++The v0.3.0 patch was checked and applied successfully against ReXGlue commit `c94f5eb`.## Performance reporting-Use a repeatable scene and settings, identify hardware/driver, report resolution and internal scale, and distinguish a cold shader cache from a warm cache. A screenshot of recent FPS is useful evidence of that moment, not a sustained benchmark.+Use a repeatable scene and settings, identify hardware/driver and graphics API, and report output resolution and internal scale separately.++Distinguish a cold shader cache from a warm cache. A screenshot of recent FPS is useful evidence of that moment, not a sustained benchmark.-The supplied gameplay capture shows **78.3 recent FPS**. No general performance guarantee is inferred from it.+Do not infer a universal performance guarantee from a single machine. In particular, availability of 3x/4x internal scaling or 4K output does not imply that those combinations maintain 60 FPS.diff --git a/patches/rexglue-local-changes.patch b/patches/rexglue-local-changes.patchindex 2b24c59..55a89da 100644--- a/patches/rexglue-local-changes.patch+++ b/patches/rexglue-local-changes.patch@@ -1903,11 +1903,123 @@ index 1fda053..c5d6777 100644// Allocate from the heap. Not sure why XAM does this specially, perhaps// it keeps stuff in a separate heap?+diff --git a/src/kernel/xboxkrnl/xboxkrnl_modules.cpp b/src/kernel/xboxkrnl/xboxkrnl_modules.cpp+index dcd2001..97dd0ed 100644+--- a/src/kernel/xboxkrnl/xboxkrnl_modules.cpp++++ b/src/kernel/xboxkrnl/xboxkrnl_modules.cpp+@@ -85,6 +85,13 @@ u32 XexGetModuleSection_entry(mapped_void hmodule, mapped_string name, mapped_u3++ u32 XexLoadImage_entry(mapped_string module_name, u32 module_flags, u32 min_version,+ mapped_u32 hmodule_ptr) {++++ REXKRNL_ERROR(++ "FIFA TRACE XexLoadImage: module='{}' flags=0x{:08X} min_version=0x{:08X}",++ module_name.value(),++ module_flags,++ min_version);+++ X_STATUS result = X_STATUS_NO_SUCH_FILE;++ uint32_t hmodule = 0;+@@ -118,7 +125,13 @@ u32 XexLoadImage_entry(mapped_string module_name, u32 module_flags, u32 min_vers++ *hmodule_ptr = hmodule;++- return result;++REXKRNL_ERROR(++ "FIFA TRACE XexLoadImage RESULT: module='{}' result=0x{:08X} hmodule=0x{:08X}",++ module_name.value(),++ static_cast<uint32_t>(result),++ hmodule);++++return result;+ }++ u32 XexUnloadImage_entry(mapped_void hmodule) {+@@ -170,6 +183,13 @@ u32 XexGetProcedureAddress_entry(mapped_void hmodule, u32 ordinal, mapped_u32 ou+ module = XModule::GetFromHModule(REX_KERNEL_STATE(), hmodule);+ }+ if (module) {++ REXKRNL_ERROR(++ "FIFA TRACE XexGetProcedureAddress: module='{}' hmodule=0x{:08X} "++ "ordinal=0x{:08X} caller=0x{:08X}",++ module->name(),++ static_cast<uint32_t>(hmodule),++ ordinal,++ caller_address);+ uint32_t ptr;+ if (is_string_name) {+ ptr = module->GetProcAddressByName(string_name);+@@ -177,6 +197,13 @@ u32 XexGetProcedureAddress_entry(mapped_void hmodule, u32 ordinal, mapped_u32 ou+ ptr = module->GetProcAddressByOrdinal(ordinal, caller_address);+ }+ if (ptr) {++ REXKRNL_ERROR(++ "FIFA TRACE XexGetProcedureAddress RESULT: module='{}' "++ "ordinal=0x{:08X} -> ptr=0x{:08X} caller=0x{:08X}",++ module->name(),++ ordinal,++ ptr,++ caller_address);+ *out_function_ptr = ptr;+ result = X_STATUS_SUCCESS;+ } else {diff --git a/src/system/function_dispatcher.cpp b/src/system/function_dispatcher.cpp-index bd43109..ffa5eeb 100644+index bd43109..3e903e8 100644--- a/src/system/function_dispatcher.cpp+++ b/src/system/function_dispatcher.cpp-@@ -179,8 +179,10 @@ uint64_t FunctionDispatcher::ExecuteInterrupt(ThreadState* thread_state, uint32_+@@ -35,6 +35,18 @@ FunctionDispatcher* GetBoundFunctionDispatcher() {+ } // namespace++ static void InvalidFunctionTrap(PPCContext& ctx, uint8_t* /*base*/) {++ REXCPU_ERROR(++ "INVALID INDIRECT CALL: target={:08X} LR={:08X} CTR={:08X} "++ "r1={:08X} r2={:08X} r3={:08X} r11={:08X} r12={:08X}",++ ctx.last_indirect_target,++ static_cast<uint32_t>(ctx.lr),++ static_cast<uint32_t>(ctx.ctr.u64),++ static_cast<uint32_t>(ctx.r1.u64),++ static_cast<uint32_t>(ctx.r2.u64),++ static_cast<uint32_t>(ctx.r3.u64),++ static_cast<uint32_t>(ctx.r11.u64),++ static_cast<uint32_t>(ctx.r12.u64));+++ REX_FATAL("Call to invalid or unregistered function at guest address 0x{:08X}",+ ctx.last_indirect_target);+ }+@@ -61,11 +73,26 @@ bool FunctionDispatcher::Execute(ThreadState* thread_state, uint32_t address) {+ SCOPE_profile_cpu_f("cpu");+ PROFILE_FUNCTION_DISPATCHED();++- PPCFunc* fn = GetFunction(address);+- if (!fn) {+- REXCPU_ERROR("Execute({:08X}): function not in function table", address);+- return false;+- }++ PPCFunc* fn = GetFunction(address);++if (!fn) {++ auto* ctx = thread_state->context();++++ REXCPU_ERROR(++ "EXECUTE MISS: address={:08X} last_indirect_target={:08X} "++ "LR={:08X} CTR={:08X} r1={:08X} r2={:08X} "++ "r3={:08X} r11={:08X} r12={:08X}",++ address,++ ctx->last_indirect_target,++ static_cast<uint32_t>(ctx->lr),++ static_cast<uint32_t>(ctx->ctr.u64),++ static_cast<uint32_t>(ctx->r1.u64),++ static_cast<uint32_t>(ctx->r2.u64),++ static_cast<uint32_t>(ctx->r3.u64),++ static_cast<uint32_t>(ctx->r11.u64),++ static_cast<uint32_t>(ctx->r12.u64));++++ return false;++}++ auto* ctx = thread_state->context();+ auto* previous_thread_state = ThreadState::Get();+@@ -179,8 +206,10 @@ uint64_t FunctionDispatcher::ExecuteInterrupt(ThreadState* thread_state, uint32_// rexglue function table management@@ -1920,7 +2032,7 @@ index bd43109..ffa5eeb 100644bool is_entrypoint) {std::lock_guard<std::recursive_mutex> lock(dispatch_mutex_);-@@ -190,25 +192,39 @@ bool FunctionDispatcher::InitializeFunctionTable(uint32_t code_base, uint32_t co+@@ -190,25 +219,39 @@ bool FunctionDispatcher::InitializeFunctionTable(uint32_t code_base, uint32_t coreturn false;}@@ -1972,7 +2084,7 @@ index bd43109..ffa5eeb 100644REXLOG_ERROR("Failed to initialize guest memory function table");return false;}-@@ -226,11 +242,13 @@ bool FunctionDispatcher::InitializeFunctionTable(uint32_t code_base, uint32_t co+@@ -226,11 +269,13 @@ bool FunctionDispatcher::InitializeFunctionTable(uint32_t code_base, uint32_t coentrypoint_code_base_ = code_base;}