Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

51 linhas
1.8KB

  1. # E07-S02: prepare a disposable development disk and autostart the Nova128
  2. # compiler in x128.
  3. #
  4. # The session is strictly sequential: this launcher refuses to start while an
  5. # editor session owns the same image, waits for x128 to exit and for the image
  6. # to flush, and rebuilds the disposable image from its clean source.
  7. [CmdletBinding()]
  8. param(
  9. [string]$CompilerPrg = "",
  10. [string]$DiskImage = "",
  11. [int]$LimitCycles = 0,
  12. [string]$Screenshot = "",
  13. [string]$Keys = "",
  14. [int]$KeyDelay = 3000,
  15. [switch]$Warp,
  16. [switch]$SkipPrepare
  17. )
  18. $ErrorActionPreference = "Stop"
  19. $project = Split-Path $PSScriptRoot -Parent
  20. $build = Join-Path $project "build"
  21. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Launcher.psm1") -Force
  22. if ($CompilerPrg -eq "") { $CompilerPrg = Join-Path $build "n128c.prg" }
  23. if ($DiskImage -eq "") { $DiskImage = Join-Path $build "newlang-dev.d81" }
  24. $CompilerPrg = [IO.Path]::GetFullPath($CompilerPrg)
  25. $DiskImage = [IO.Path]::GetFullPath($DiskImage)
  26. if (-not (Test-Path -LiteralPath $CompilerPrg -PathType Leaf)) {
  27. throw "compiler program not found: $CompilerPrg (build N128C.PRG first)"
  28. }
  29. $null = Get-Nova128ViceTool "x128"
  30. if (-not $SkipPrepare) {
  31. & (Join-Path $PSScriptRoot "prepare-disk.ps1") -OutputImage $DiskImage `
  32. -CompilerPrg $CompilerPrg -RequireCompiler | Out-Host
  33. }
  34. $session = $null
  35. try {
  36. $session = Enter-Nova128ImageSession -Image $DiskImage -Kind "compiler"
  37. $null = Invoke-Nova128Emulator -Emulator "x128" -Program $CompilerPrg `
  38. -DiskImage $DiskImage -Screenshot $Screenshot -LimitCycles $LimitCycles `
  39. -Keys $Keys -KeyDelay $KeyDelay -Warp:$Warp
  40. } finally {
  41. if ($session) { Exit-Nova128ImageSession -Session $session }
  42. }
  43. Write-Host "compiler session closed and the image is flushed"
  44. Write-Host "close this session before editing or inspecting the disk again"

Powered by TurnKey Linux.