param([string]$MasmRoot = 'F:\MASM32\masm32', [switch]$Benchmark) $ErrorActionPreference = 'Stop' $root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path Push-Location $root try { & 'C:\Python314\python.exe' tools\tests\prepare_world_dressing_probe.py if ($LASTEXITCODE -ne 0) { throw 'World probe preparation failed' } & "$MasmRoot\bin\ml.exe" /c /coff /Cp /nologo /I. /Fobuild\world\probe.obj tools\tests\world_dressing_probe.asm if ($LASTEXITCODE -ne 0) { throw 'World probe assembly failed' } $sdkRoot = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\10\Lib' $sdk = Get-ChildItem -LiteralPath $sdkRoot -Directory | Sort-Object Name -Descending | Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'um\x86\kernel32.lib') } | Select-Object -First 1 $libraries = @() if ($sdk) { $libraries += '/LIBPATH:' + (Join-Path $sdk.FullName 'um\x86') } $libraries += "/LIBPATH:$MasmRoot\lib" $entry = if ($Benchmark) { '/ENTRY:WorldDressingBenchmarkStart@0' } else { '/ENTRY:WorldDressingProbeStart@0' } & "$MasmRoot\bin\link.exe" /nologo /SUBSYSTEM:CONSOLE $entry @libraries /OUT:build\world\probe.exe build\world\probe.obj build\world\base.obj kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib if ($LASTEXITCODE -ne 0) { throw 'World probe link failed' } & .\build\world\probe.exe if ($Benchmark) { Write-Output "Native street preview benchmark: $LASTEXITCODE ms/frame (40 frames)" return } if ($LASTEXITCODE -ne 0) { throw "World probe failed: $LASTEXITCODE" } Write-Output 'PASS: native before/after hall, fixed wall decor and street scale captures' } finally { Pop-Location }