您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

47 行
1.9KB

  1. # E06-S01: run the interface value ABI fixture and check its mailbox.
  2. [CmdletBinding()]
  3. param([int]$Port = 6557, [int]$TimeoutSeconds = 180)
  4. $ErrorActionPreference = "Stop"
  5. $project = Split-Path $PSScriptRoot -Parent
  6. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  7. & (Join-Path $PSScriptRoot "build-interface-test.ps1")
  8. $out = Join-Path $project "build\interface-test"
  9. $disk = Join-Path $out "interface-test.d81"
  10. $failures = @()
  11. $session = Start-Nova128X128 -Autostart $disk -Drive8Image $disk -Port $Port `
  12. -Screenshot (Join-Path $out "interface-test-vicii.png")
  13. try {
  14. $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds
  15. Start-Sleep -Milliseconds 500
  16. $screenRam = Read-Nova128Memory $session 0x0400 1000
  17. } finally {
  18. Stop-Nova128X128 $session -SettleSeconds 0
  19. }
  20. if ($mb[2] -ne 0x03) { $failures += "producer $($mb[2]) expected 3" }
  21. if ($mb[3] -ne 0xA5) { $failures += ("status {0:X2} expected A5" -f $mb[3]) }
  22. if ($mb[4] -ne 0 -or $mb[5] -ne 0) { $failures += "code $($mb[4] + 256 * $mb[5]) expected 0" }
  23. for ($i = 0; $i -lt 6; $i++) {
  24. if ($mb[8 + $i] -ne 1) { $failures += "phase $i flag is $($mb[8 + $i]), expected 1" }
  25. }
  26. $rows = for ($r = 0; $r -lt 25; $r++) {
  27. $chars = for ($c = 0; $c -lt 40; $c++) {
  28. $code = $screenRam[$r * 40 + $c]
  29. if ($code -le 0x1F) { [char]($code + 0x40) } elseif ($code -le 0x3F) { [char]$code } else { '?' }
  30. }
  31. (-join $chars).TrimEnd()
  32. }
  33. if (-not ($rows -contains "INTERFACE OK")) {
  34. $failures += "screen does not contain 'INTERFACE OK'"
  35. }
  36. if ($failures) { throw ("interface verification failed:`n " + ($failures -join "`n ")) }
  37. Write-Host "screen:"
  38. $rows | Where-Object { $_ } | ForEach-Object { Write-Host " |$_" }
  39. Write-Host "mailbox: producer 3, PASS, code 0, all 6 interface ABI flags set"
  40. Write-Host "verified little-endian layout, canonical null, copy, slot order, IF_RESULT, and argument order"

Powered by TurnKey Linux.