-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.ps1
More file actions
28 lines (22 loc) · 912 Bytes
/
run.ps1
File metadata and controls
28 lines (22 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# PowerShell run script for OpenDOS
$IMG_NAME = "opendos.img"
function Write-ColorOutput($ForegroundColor) {
$fc = $host.UI.RawUI.ForegroundColor
$host.UI.RawUI.ForegroundColor = $ForegroundColor
if ($args) {
Write-Output $args
}
$host.UI.RawUI.ForegroundColor = $fc
}
if (-not (Test-Path $IMG_NAME)) {
Write-ColorOutput Red "Error: $IMG_NAME not found!"
Write-ColorOutput Yellow "Please build the image first using build.sh in WSL or Linux."
exit 1
}
Write-ColorOutput Cyan "Starting QEMU with OpenDOS..."
# Try with audio first
& qemu-system-i386 -drive file=$IMG_NAME,format=raw -serial stdio -d int -audiodev dsound,id=ds1 -machine pcspk-audiodev=ds1
if ($LASTEXITCODE -ne 0) {
Write-ColorOutput Yellow "Note: If audio doesn't work, you can run without audio:"
Write-ColorOutput Yellow "qemu-system-i386 -drive file=$IMG_NAME,format=raw -serial stdio"
}