forked from lenticularis39/axpbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Windows github action to use winpcap and run test of axpbox rom
- Loading branch information
Remy van Elst
committed
May 1, 2024
1 parent
f3bd6f4
commit 53182e3
Showing
7 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Download the firmware | ||
Invoke-WebRequest -Uri 'http://raymii.org/s/inc/downloads/es40-srmon/cl67srmrom.exe' -OutFile 'cl67srmrom.exe' | ||
|
||
# Start AXPbox | ||
Start-Process '..\..\..\build\Release\axpbox' -ArgumentList 'run' -NoNewWindow -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt | ||
|
||
# Wait for AXPbox to start | ||
Start-Sleep -Seconds 5 | ||
|
||
# Connect to terminal | ||
Start-Process -FilePath 'nc' -ArgumentList '-t', '127.0.0.1', '21000' -NoNewWindow -RedirectStandardOutput 'axp.log' | ||
|
||
# Wait for the last line of log to become P00>>> | ||
$timeout = 600 | ||
while ($true) { | ||
if ($timeout -eq 0) { | ||
Write-Host "waiting for SRM prompt timed out" -ForegroundColor Red | ||
exit 1 | ||
} | ||
|
||
echo "=== start axp.log ===" | ||
Get-Content -Path 'axp.log' -Raw | ||
echo "=== end axp.log ===" | ||
|
||
$content = Get-Content -Path 'axp.log' -Raw | ||
$contentWithoutNullBytes = $content -replace '\0', '' | ||
|
||
if ($contentWithoutNullBytes -match "P00>>>") { | ||
break | ||
} | ||
|
||
Start-Sleep -Seconds 1 | ||
$timeout-- | ||
} | ||
|
||
Stop-Process -Name 'nc' | ||
|
||
# Diff logs | ||
Write-Host -NoNewline -ForegroundColor DarkRed "" | ||
Compare-Object -ReferenceObject (Get-Content 'axp_correct.log') -DifferenceObject (Get-Content 'axp.log') | Format-Table | ||
Write-Host -NoNewline -ForegroundColor DarkGreen "diff clean" | ||
$result = $LASTEXITCODE | ||
Write-Host -NoNewline -ForegroundColor White "" | ||
|
||
Remove-Item -Path 'axp.log', 'cl67*', '*.rom' | ||
exit $result |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# via: https://github.com/3gstudent/Winpcap_Install | ||
|
||
Set-Location -Path $PSScriptRoot | ||
|
||
if ($env:PROCESSOR_ARCHITECTURE -eq "x86") { | ||
Move-Item -Path "npf_x86.sys" -Destination "$env:SystemRoot\system32\drivers\npf.sys" | ||
} elseif ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") { | ||
Move-Item -Path "npf_x64.sys" -Destination "$env:SystemRoot\system32\drivers\npf.sys" | ||
} | ||
|
||
if (Test-Path "$env:SystemRoot\system32\drivers\npf.sys") { | ||
Write-Host "Move success!" | ||
} else { | ||
Write-Host "Move error!" | ||
exit 1 | ||
} | ||
|
||
New-Service -Name "npf" -BinaryPathName "$env:SystemRoot\system32\drivers\npf.sys" -StartupType "Automatic" -DisplayName "NetGroup Packet Filter Driver" | Out-Null | ||
|
||
Start-Service -Name "npf" |
Binary file not shown.
Binary file not shown.
Binary file not shown.