Files
pokemon/scripts/setup-playnite-pc-hack.ps1
T
ginnoirandClaude Opus 4.8 809600a04d feat: ROM-hack dedup, conflict resolution, and vault library_path resync
Catalog cleanup pass across gb/gbc/gba/nds/3ds:
- Standardize nonstandard hack filenames to `Pokemon - <Name> [Hack].<ext>`;
  remove verified byte-identical duplicates (conform-rom-names.sh).
- Resolve 9 version-conflicts via side-by-side emulator comparison
  (resolve-version-conflicts.sh): promote newer builds, keep genuine
  distinct hacks, fix a mislabeled Dark Rising slot (was the Digimon
  crossover "Worlds Collide"), and rebuild Mega Power 5.77 + HeartGold
  Generations v2.0 fresh from their patches.
- Resync 286 vault notes' `library_path` to the real on-disk [Hack] files
  and fix 15 stale platform fields (resync-vault-library-paths.py).
- Regenerate MOC tables + wiki/catalog.json (396 notes).

Also includes pending Playnite PC-hack setup/repair scripts.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:29:05 -05:00

54 lines
2.0 KiB
PowerShell

<#
.SYNOPSIS
Configure RomM plugin mapping for PC hacks. Emulator must be added in Playnite UI (see below).
Playnite must be fully closed before running (only touches RomM plugin config.json).
#>
$ErrorActionPreference = 'Stop'
$RommConfig = Join-Path $env:LOCALAPPDATA 'Playnite\ExtensionsData\9700aa21-447d-41b4-a989-acd38f407d9f\config.json'
$DestPath = 'C:\Users\MattC\roms\windows'
$PlatformSpec = 'pc_windows'
if (-not (Test-Path $RommConfig)) { throw "RomM config not found: $RommConfig" }
$emu = Get-Content -Raw $RommConfig | ConvertFrom-Json | ForEach-Object { $_.Mappings } |
Where-Object { $_.PlatformId -eq $PlatformSpec } | Select-Object -First 1
if (-not $emu -or -not $emu.EmulatorId) {
Write-Host @'
Add the Playnite emulator first (Library -> Configure Emulators -> Add):
Name: Pokemon PC Hack Launcher
Install: C:\Users\MattC\Documents\pokemon\scripts
Profile: Default
Platforms: PC (Windows)
Extensions: zip
Executable: C:\Program Files\PowerShell\7\pwsh.exe
Arguments: -ExecutionPolicy Bypass -File "C:\Users\MattC\Documents\pokemon\scripts\launch-pc-hack.ps1" "{ImagePath}"
Working dir: {InstallDir}
Then in RomM plugin settings, map pc_windows -> that emulator, destination
'@ + $DestPath + @', Auto-extract ON.
Or re-run this script after the emulator exists (it reads EmulatorId from an existing pc_windows mapping).
'@
exit 1
}
$cfg = Get-Content -Raw $RommConfig | ConvertFrom-Json
$m = $cfg.Mappings | Where-Object { $_.PlatformId -eq $PlatformSpec } | Select-Object -First 1
if (-not $m) {
Write-Host 'No pc_windows mapping yet — add it in RomM plugin settings after creating the emulator.'
exit 1
}
$m.DestinationPath = $DestPath
$m.AutoExtract = $true
$m.Enabled = $true
$m.SyncSaves = $false
New-Item -ItemType Directory -Force -Path $DestPath | Out-Null
$cfg | ConvertTo-Json -Depth 8 -Compress | Set-Content -Encoding UTF8 $RommConfig
Write-Host "RomM pc_windows mapping updated (destination $DestPath, AutoExtract on)."