選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

43 行
1.7KB

  1. <#
  2. .SYNOPSIS
  3. Build a target and start it in VICE for interactive testing.
  4. .DESCRIPTION
  5. Starts the emulator listed for the target in project.json with the target's display and
  6. video options, attaches the disk image when there is one, and autostarts the program.
  7. VICE uses your normal VICE settings here (unlike tools/smoke.ps1).
  8. .EXAMPLE
  9. pwsh -File tools/run.ps1
  10. pwsh -File tools/run.ps1 -Target c128-80
  11. #>
  12. [CmdletBinding()]
  13. param(
  14. [string]$Target,
  15. [switch]$NoBuild,
  16. [ValidateSet('pal', 'ntsc')][string]$Video
  17. )
  18. . (Join-Path $PSScriptRoot 'lib.ps1')
  19. try {
  20. $project = Get-ProjectConfig
  21. $t = if ($Target) { Get-ProjectTargets $project $Target } else { @($project.resolved.targets)[0] }
  22. if (-not $NoBuild) { Invoke-TargetBuild $project $t @{} }
  23. if ($t.build.kind -eq 'none' -and -not $t.disk) { throw "Target $($t.id) is built on the Commodore; follow docs/toolchain.md to load it." }
  24. $emu = Get-ToolPath $project $t.emulator.binary
  25. if ($Video) { $t.video = $Video }
  26. $vargs = @(Get-VideoArgs $t) + @($t.emulator.args)
  27. if ($t.emulator.autostart -ne 'disk' -and $t.disk) { $vargs += @('-8', (Get-RepoPath $t.disk.image)) }
  28. $vargs += @('-autostart', (Get-AutostartFile $t))
  29. $quoted = $vargs | ForEach-Object { if ($_ -match '\s') { '"' + $_ + '"' } else { $_ } }
  30. Write-Host "[$($t.id)] starting $($t.emulator.binary) $($quoted -join ' ')"
  31. Start-Process -FilePath $emu -ArgumentList $quoted | Out-Null
  32. Write-Host "Expected: $($t.expectedBehavior)"
  33. } catch [MissingToolException] {
  34. Write-Host $_.Exception.Message -ForegroundColor Yellow
  35. exit 2
  36. } catch {
  37. Write-Host "RUN FAILED: $($_.Exception.Message)" -ForegroundColor Red
  38. exit 1
  39. }

Powered by TurnKey Linux.