# E06-S04: run the conversion fixture in x128 and check its mailbox. [CmdletBinding()] param([int]$Port = 6561, [int]$TimeoutSeconds = 180) $ErrorActionPreference = "Stop" $project = Split-Path $PSScriptRoot -Parent Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force & (Join-Path $PSScriptRoot "build-convert-test.ps1") $out = Join-Path $project "build\convert-test" $disk = Join-Path $out "convert-test.d81" $failures = @() $session = Start-Nova128X128 -Autostart $disk -Drive8Image $disk -Port $Port ` -Screenshot (Join-Path $out "convert-test-vicii.png") try { $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds Start-Sleep -Milliseconds 500 $screenRam = Read-Nova128Memory $session 0x0400 1000 } finally { Stop-Nova128X128 $session -SettleSeconds 0 } if ($mb[2] -ne 0x03) { $failures += "producer $($mb[2]) expected 3" } if ($mb[3] -ne 0xA5) { $failures += ("status {0:X2} expected A5" -f $mb[3]) } if ($mb[4] -ne 0 -or $mb[5] -ne 0) { $failures += "code $($mb[4] + 256 * $mb[5]) expected 0" } for ($i = 0; $i -lt 6; $i++) { if ($mb[8 + $i] -ne 1) { $failures += "phase $i flag is $($mb[8 + $i]), expected 1" } } $rows = for ($r = 0; $r -lt 25; $r++) { $chars = for ($c = 0; $c -lt 40; $c++) { $code = $screenRam[$r * 40 + $c] if ($code -le 0x1F) { [char]($code + 0x40) } elseif ($code -le 0x3F) { [char]$code } else { '?' } } (-join $chars).TrimEnd() } if (-not ($rows -contains "CONVERT OK")) { $failures += "screen does not contain 'CONVERT OK'" } if ($failures) { throw ("conversion verification failed:`n " + ($failures -join "`n ")) } Write-Host "screen:" $rows | Where-Object { $_ } | ForEach-Object { Write-Host " |$_" } Write-Host "mailbox: producer 3, PASS, code 0, all 6 conversion flags set" Write-Host "verified class and null conversion, verbatim copy, field, array elements, argument push, and the result area"