Benvenuto Ospite,
per utilizzare il Forum ed avere accesso a tutte le sezioni e poter aprire un tuo Topic, rispondere nelle varie discussioni, mandare o ricevere Messaggi Privati devi seguire pochi passaggi:


Leggi il nostro Regolamento -> PREMI QUI <-
Segui il link su come Iscriversi -> PREMI QUI <-


Ricordati di aggiornare l'Avatar usando una immagine che ti distingua nel Forum

[SCRIPT] A.R.C.A.M.A.D.O.

Problemi e soluzioni su configurazioni software, firmware
Avatar utente
0zzy

Donatore
Affezionato
Affezionato
Messaggi: 148
Iscritto il: 16/01/2015, 14:40
Medaglie: 1
Città: VE
Grazie Inviati: 5 volte
Grazie Ricevuti: 2 volte

[SCRIPT] A.R.C.A.M.A.D.O.

Messaggio da 0zzy »

Diamo un senso a questo CIGS al 50%

Vi lascio questo script powershell che fa cose che gia altre utility fanno, ma siamo nel 2026, vuoi non usare l'ai?

Lo script A.R.C.A.M.A.D.O.(Automated Retro Compatibility & Arcade Machine Asset Distribution Orchestrator), prende in input:
- il file xml del mame (che devi aver gia creato),
- la directory dove hai il tuo romset full (chiaramente della stessa versione del mame dal quale hai estratto l'xml)
- la directory dove verranno ricopiate le sole roms di giochi arcade perfetti e imperfetti ad esclusione di bios, device, console, laserdisc, pinball e porcaria varia

Nella directory di output le roms saranno poi sudddivise in quattro sotto directory parent-orrizzontali, parent-verticali, clone-orrizzontali, clone-verticali

Lo script si lancia come qualsiasi altro script powershell

.\ARCAMADO.ps1 -XmlPath "D:\mame0278b_64bit\mame-gamelist.xml" -RomSourcePath "D:\mame0278b_64bit\roms" -OutputBasePath "E:\roms-smallset" `

Codice: Seleziona tutto


param(
    [string]$XmlPath,
    [string]$RomSourcePath,
    [string]$OutputBasePath,
    [string]$DriverStatus,
    [string]$Emulation
)

# -------------------------
# FILTRI GIOCABILITÀ
# -------------------------
$allowedStatus = @("good", "imperfect")
$allowedEmu    = @("good", "imperfect")

if ($DriverStatus) {
    $allowedStatus = $DriverStatus.Split(",") | ForEach-Object { $_.Trim().ToLower() }
}

if ($Emulation) {
    $allowedEmu = $Emulation.Split(",") | ForEach-Object { $_.Trim().ToLower() }
}

# -------------------------
# ARCADE FILTER BASE
# -------------------------
function IsArcadeGame($m) {

    if ($m.isbios -eq "yes") { return $false }
	
    if ($m.isdevice -eq "yes") { return $false }

    if ($m.sourcefile -match "console|computer|home|bios|handheld") { return $false }

    if ($m.sourcefile -match "laserdisc|ld-|pinball|slot|pachinko|electro") { return $false }

    if ($m.runnable -eq "no") { return $false }

    return $true
}

# -------------------------
# LOAD XML
# -------------------------
[xml]$xml = Get-Content $XmlPath
$machines = $xml.SelectNodes("//machine")

$total = $machines.Count
$index = 0

# -------------------------
# LOOP PRINCIPALE
# -------------------------
foreach ($m in $machines) {

    $index++

    Write-Progress `
        -Activity "A.R.C.A.M.A.D.O." `
        -Status "$index / $total : $($m.name)" `
        -PercentComplete (($index / $total) * 100)

    if (-not (IsArcadeGame $m)) { continue }

    if (-not $m.driver) { continue }

    $status = if ($m.driver.status) { $m.driver.status.ToLower() } else { "" }
    $emu    = if ($m.driver.emulation) { $m.driver.emulation.ToLower() } else { "" }

    if (-not ($allowedStatus -contains $status)) { continue }
    if (-not ($allowedEmu -contains $emu)) { continue }

    # ROTAZIONE SCHERMO
    $rotate = 0
    if ($m.display.rotate) {
        $r = $m.display.rotate
        if ($r -is [Array]) { $rotate = [int]$r[0] }
        else { $rotate = [int]$r }
    }

    $orientation = if ($rotate -eq 90 -or $rotate -eq 270) { "vertical" } else { "horizontal" }

    # parent / clone
    $type = if ($m.cloneof) { "clone" } else { "parent" }

    # ROM FILE
    $romFile = "$($m.name).zip"
    $sourceFile = Join-Path $RomSourcePath $romFile

    if (-not (Test-Path $sourceFile)) { continue }

    # DESTINAZIONE
    $destPath = Join-Path $OutputBasePath "$type`_$orientation"

    New-Item -ItemType Directory -Force -Path $destPath | Out-Null

    Copy-Item $sourceFile $destPath -Force
}

# -------------------------
# FINE
# -------------------------
Write-Progress -Activity "A.R.C.A.M.A.D.O." -Completed

Write-Host "`nCOMPLETATO"


Avatar utente
DigDug

Donatore
Moderatore
Moderatore
Messaggi: 3701
Iscritto il: 23/07/2005, 19:24
Medaglie: 1
Città: Rimini
Grazie Inviati: 40 volte
Grazie Ricevuti: 172 volte

Re: [SCRIPT] A.R.C.A.M.A.D.O.

Messaggio da DigDug »

Bello! Grazie.
Rispondi

Torna a “Miscellanea software”