You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 line
2.1KB

  1. # E05-S04: run the member fixture and check field offsets, two-object
  2. # independence, the concrete-call ABI, and word results.
  3. [CmdletBinding()]
  4. param([int]$Port = 6556, [int]$TimeoutSeconds = 180)
  5. $ErrorActionPreference = "Stop"
  6. $project = Split-Path $PSScriptRoot -Parent
  7. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  8. & (Join-Path $PSScriptRoot "build-member-test.ps1")
  9. $out = Join-Path $project "build\member-test"
  10. $disk = Join-Path $out "member-test.d81"
  11. $failures = @()
  12. $session = Start-Nova128X128 -Autostart $disk -Drive8Image $disk -Port $Port `
  13. -Screenshot (Join-Path $out "member-test-vicii.png")
  14. try {
  15. $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds
  16. Start-Sleep -Milliseconds 500
  17. $screenRam = Read-Nova128Memory $session 0x0400 1000
  18. } finally {
  19. Stop-Nova128X128 $session -SettleSeconds 0
  20. }
  21. if ($mb[2] -ne 0x03) { $failures += "producer $($mb[2]) expected 3" }
  22. if ($mb[3] -ne 0xA5) { $failures += ("status {0:X2} expected A5" -f $mb[3]) }
  23. if ($mb[4] -ne 0 -or $mb[5] -ne 0) { $failures += "code $($mb[4] + 256 * $mb[5]) expected 0" }
  24. for ($i = 0; $i -lt 4; $i++) {
  25. if ($mb[8 + $i] -ne 1) { $failures += "flag $i is $($mb[8 + $i]), expected 1" }
  26. }
  27. if ($mb[12] -ne 0x78) { $failures += ('result low is {0:X2}, expected 78' -f $mb[12]) }
  28. if ($mb[13] -ne 0x56) { $failures += ('result high is {0:X2}, expected 56' -f $mb[13]) }
  29. $rows = for ($r = 0; $r -lt 25; $r++) {
  30. $chars = for ($c = 0; $c -lt 40; $c++) {
  31. $code = $screenRam[$r * 40 + $c]
  32. if ($code -le 0x1F) { [char]($code + 0x40) } elseif ($code -le 0x3F) { [char]$code } else { '?' }
  33. }
  34. (-join $chars).TrimEnd()
  35. }
  36. if (-not ($rows -contains "MEMBER OK")) {
  37. $failures += "screen does not contain 'MEMBER OK'"
  38. }
  39. if ($failures) { throw ("member verification failed:`n " + ($failures -join "`n ")) }
  40. Write-Host "screen:"
  41. $rows | Where-Object { $_ } | ForEach-Object { Write-Host " |$_" }
  42. Write-Host "mailbox: producer 3, PASS, code 0, all 4 member/call flags set"
  43. Write-Host "verified field offsets, two-object independence, concrete-call ABI with argument discard, and word results"

Powered by TurnKey Linux.