No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

48 líneas
1.7KB

  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. [switch]$Warp,
  14. [switch]$SkipPrepare
  15. )
  16. $ErrorActionPreference = "Stop"
  17. $project = Split-Path $PSScriptRoot -Parent
  18. $build = Join-Path $project "build"
  19. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Launcher.psm1") -Force
  20. if ($CompilerPrg -eq "") { $CompilerPrg = Join-Path $build "n128c.prg" }
  21. if ($DiskImage -eq "") { $DiskImage = Join-Path $build "newlang-dev.d81" }
  22. $CompilerPrg = [IO.Path]::GetFullPath($CompilerPrg)
  23. $DiskImage = [IO.Path]::GetFullPath($DiskImage)
  24. if (-not (Test-Path -LiteralPath $CompilerPrg -PathType Leaf)) {
  25. throw "compiler program not found: $CompilerPrg (build N128C.PRG first)"
  26. }
  27. $null = Get-Nova128ViceTool "x128"
  28. if (-not $SkipPrepare) {
  29. & (Join-Path $PSScriptRoot "prepare-disk.ps1") -OutputImage $DiskImage `
  30. -CompilerPrg $CompilerPrg -RequireCompiler | Out-Host
  31. }
  32. $session = $null
  33. try {
  34. $session = Enter-Nova128ImageSession -Image $DiskImage -Kind "compiler"
  35. $null = Invoke-Nova128Emulator -Emulator "x128" -Program $CompilerPrg `
  36. -DiskImage $DiskImage -Screenshot $Screenshot -LimitCycles $LimitCycles -Warp:$Warp
  37. } finally {
  38. if ($session) { Exit-Nova128ImageSession -Session $session }
  39. }
  40. Write-Host "compiler session closed and the image is flushed"
  41. Write-Host "close this session before editing or inspecting the disk again"

Powered by TurnKey Linux.