param([string]$MasmRoot = 'F:\MASM32\masm32') $ErrorActionPreference = 'Stop' $root = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path Push-Location $root try { & 'C:\Python314\python.exe' tools\tests\prepare_billiards_module.py if ($LASTEXITCODE -ne 0) { throw 'Billiards helper preparation failed' } $assembler = "$MasmRoot\bin\ml.exe" $modernAssembler = 'C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.51.36231\bin\Hostx64\x86\ml.exe' if (Test-Path -LiteralPath $modernAssembler) { $assembler = $modernAssembler } & $assembler /c /coff /Cp /nologo /I. /Fobuild\billiards\module.obj tools\tests\billiards_module.asm if ($LASTEXITCODE -ne 0) { throw 'Billiards module assembly failed' } $sdk = Get-ChildItem -LiteralPath "${env:ProgramFiles(x86)}\Windows Kits\10\Lib" -Directory | Sort-Object Name -Descending | Where-Object { Test-Path -LiteralPath (Join-Path $_.FullName 'um\x86\kernel32.lib') } | Select-Object -First 1 $libraries = @() $libraries += '/LIBPATH:' + (Join-Path $sdk.FullName 'um\x86') $libraries += "/LIBPATH:$MasmRoot\lib" & "$MasmRoot\bin\link.exe" /nologo /SUBSYSTEM:CONSOLE /ENTRY:BilliardsModuleStart@0 @libraries /OUT:build\billiards\module.exe build\billiards\module.obj build\billiards\helpers.obj kernel32.lib winmm.lib user32.lib ws2_32.lib gdi32.lib if ($LASTEXITCODE -ne 0) { throw 'Billiards module link failed' } & .\build\billiards\module.exe if ($LASTEXITCODE -ne 0) { throw "Eight-ball native regression failed at case $LASTEXITCODE" } Write-Output 'PASS: fresh MASM billiards with real native graphics/input helpers' } finally { Pop-Location }