|
- # E04-S01: build the PRG/MAP writer test and a disk with collision fixtures.
- [CmdletBinding()]
- param()
-
- $ErrorActionPreference = "Stop"
- $project = Split-Path $PSScriptRoot -Parent
- Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
-
- $out = Join-Path $project "build\output-test"
- $link = Invoke-Nova128Link -Name "output-test" -BuildDir $out `
- -Config (Join-Path $project "cfg\compiler.cfg") -Sources @(
- (Join-Path $project "src\compiler\mmu.s"),
- (Join-Path $project "src\compiler\diskio.s"),
- (Join-Path $project "src\compiler\output.s"),
- (Join-Path $project "src\runtime\startup.s"),
- (Join-Path $project "tests\codegen\output-test.s"))
-
- $oldPrg = Join-Path $out "old-collide.prg"
- $oldMap = Join-Path $out "old-collide.map"
- [IO.File]::WriteAllBytes($oldPrg, [byte[]](0x4B, 0x45, 0x45, 0x50)) # "KEEP"
- [IO.File]::WriteAllBytes($oldMap, [byte[]](0x4B, 0x45, 0x45, 0x50, 0x4D, 0x41, 0x50)) # "KEEPMAP"
-
- New-Nova128Disk -Path (Join-Path $out "output-test.d81") -Files @(
- @{ Name = "OUTPUTTEST"; Path = $link.Program; Type = "prg" },
- @{ Name = "collide.prg"; Path = $oldPrg; Type = "prg" },
- @{ Name = "collide.map"; Path = $oldMap; Type = "seq" })
-
- Write-Host ("built {0}" -f $link.Program)
- Write-Host ("disk {0}" -f (Join-Path $out "output-test.d81"))
|