Files
dolphin/Run-Wii-IOS-LLE.ps1
T

49 lines
1.6 KiB
PowerShell

param(
[string]$BuildDirectory = '.starlet_msvc2',
[string]$UserDirectory = '.starlet_user3',
[switch]$DisableJIT,
[switch]$Wait
)
$repoRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$dolphinPath = Join-Path $repoRoot "$BuildDirectory\Binaries\DolphinNoGUI.exe"
$userPath = Join-Path $repoRoot $UserDirectory
if (-not (Test-Path -LiteralPath $dolphinPath)) {
throw "DolphinNoGUI.exe is missing: $dolphinPath"
}
$dolphin = Start-Process -FilePath $dolphinPath -ArgumentList @(
'-u', $userPath,
'-n', '0000000100000002',
'-C', "Dolphin.Core.WiiStarletJIT=$(-not $DisableJIT)",
# Keep the next BootMii run diagnostic rather than observational. BootMii reports its loader
# stages and panic codes through GPIO bits 16-23; the Starlet bus logs those writes under IOS.
'-C', 'Logger.Options.WriteToFile=True',
'-C', 'Logger.Options.Verbosity=4',
'-C', 'Logger.Logs.IOS=True',
'-v', 'D3D',
'-p', 'win32'
) -WorkingDirectory $repoRoot -PassThru
$dolphin.PriorityClass = 'High'
# Windows otherwise tends to schedule the ARM interpreter on an efficient core
# of this hybrid CPU. Logical processors 0-3 are its two performance cores.
$processorName = (Get-ItemPropertyValue `
-LiteralPath 'HKLM:\HARDWARE\DESCRIPTION\System\CentralProcessor\0' `
-Name 'ProcessorNameString' -ErrorAction SilentlyContinue)
if ($processorName -match '12th Gen Intel\(R\) Core\(TM\) i7-1255U') {
$dolphin.ProcessorAffinity = [IntPtr]0xF
}
Write-Host "Dolphin IOS LLE started (PID $($dolphin.Id))."
if ($Wait) {
$dolphin.WaitForExit()
exit $dolphin.ExitCode
}