Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

55 rindas
2.4KB

  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. pwsh -File tools/run.ps1 -Target c64 -TimingBar
  12. .PARAMETER TimingBar
  13. Build with the assembler symbol TIMING_BAR into a separate program (<name>-timing.prg) whose border colour
  14. shows the CPU's work in each frame (see src/main.s). The normal build is not touched.
  15. #>
  16. [CmdletBinding()]
  17. param(
  18. [string]$Target,
  19. [switch]$NoBuild,
  20. [ValidateSet('pal', 'ntsc')][string]$Video,
  21. [switch]$TimingBar
  22. )
  23. . (Join-Path $PSScriptRoot 'lib.ps1')
  24. try {
  25. $project = Get-ProjectConfig
  26. $t = if ($Target) { Get-ProjectTargets $project $Target } else { @($project.resolved.targets)[0] }
  27. if ($TimingBar) {
  28. if ($t.build.kind -ne 'cc65') { throw "-TimingBar needs a cc65 target." }
  29. $t.build.asmDefines = @(@($t.build.asmDefines) + 'TIMING_BAR' | Where-Object { $_ })
  30. foreach ($k in 'labels', 'map') { $t.build[$k] = $t.build[$k] -replace '(\.\w+)$', '-timing$1' }
  31. $t.artifact = $t.artifact -replace '(\.\w+)$', '-timing$1'
  32. $t.disk = $null
  33. }
  34. if (-not $NoBuild) { Invoke-TargetBuild $project $t @{} }
  35. 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." }
  36. $emu = Get-ToolPath $project $t.emulator.binary
  37. if ($Video) { $t.video = $Video }
  38. $vargs = @(Get-VideoArgs $t) + @($t.emulator.args)
  39. if ($t.emulator.autostart -ne 'disk' -and $t.disk) { $vargs += @('-8', (Get-RepoPath $t.disk.image)) }
  40. $vargs += @('-autostart', (Get-AutostartFile $t))
  41. $quoted = $vargs | ForEach-Object { if ($_ -match '\s') { '"' + $_ + '"' } else { $_ } }
  42. Write-Host "[$($t.id)] starting $($t.emulator.binary) $($quoted -join ' ')"
  43. Start-Process -FilePath $emu -ArgumentList $quoted | Out-Null
  44. Write-Host "Expected: $($t.expectedBehavior)"
  45. } catch [MissingToolException] {
  46. Write-Host $_.Exception.Message -ForegroundColor Yellow
  47. exit 2
  48. } catch {
  49. Write-Host "RUN FAILED: $($_.Exception.Message)" -ForegroundColor Red
  50. exit 1
  51. }

Powered by TurnKey Linux.