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: 149
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),
- un catlist.ini anche poco piu recente della versione del mame che si sta utilizzando
- 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" -CatListPath "D:\mame0278b_64bit\catlist.ini" -RomSourcePath "D:\mame0278b_64bit\roms" -OutputBasePath "E:\roms-smallset" `

Codice: Seleziona tutto


param(
    [string]$XmlPath,
    [string]$RomSourcePath,
    [string]$OutputBasePath,
    [string]$CatListPath,
    [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() }
}

# -------------------------
# CATLIST ARCADE FILTER (STRICT)
# -------------------------
function Load-ArcadeSet($path) {

    $set = New-Object 'System.Collections.Generic.HashSet[string]'
    $inArcade = $false
    $exclude = $false

    $excluded = @(
        "Board Game",
        "Card Game",
        "Electromechanical",
        "Gambling",
        "Medal Game",
        "misc",
        "music game",
        "musical instrument",
        "quiz",
        "redemption game",
        "slot machine",
        "tabletop",
        "ttl",
        "utilities"
    )

    Get-Content $path | ForEach-Object {

        $line = $_.Trim()

        if ($line -match "^\[(.+?)\]") {

            $section = $matches[1]

            $inArcade = $false
            $exclude = $false

            if ($section -like "Arcade:*") {

                foreach ($ex in $excluded) {
                    if ($section -match [regex]::Escape($ex)) {
                        $exclude = $true
                        break
                    }
                }

                if (-not $exclude) {
                    $inArcade = $true
                }
            }

            return
        }

        if ($inArcade -and -not $exclude -and $line -ne "") {
            $set.Add($line.ToLower()) | Out-Null
        }
    }

    return $set
}

# -------------------------
# ARCADE FILTER XML (TECH)
# -------------------------
function IsArcadeGame($m) {

    if ($m.isbios -eq "yes") { return $false }
    if ($m.isdevice -eq "yes") { return $false }
    if ($m.runnable -eq "no") { 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 }

    return $true
}

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

$total = $machines.Count
$index = 0

# -------------------------
# LOAD ARCADE WHITELIST
# -------------------------
$arcadeSet = Load-ArcadeSet $CatListPath

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

    $index++

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

    # filtro tecnico XML
    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 }

    # filtro catlist arcade
    if (-not $arcadeSet.Contains($m.name.ToLower())) {
        continue
    }

    # ROTAZIONE
    $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 }

    # OUTPUT 4 CARTELLE
    $destPath = Join-Path $OutputBasePath "$type`_$orientation"

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

# -------------------------
# END
# -------------------------
Write-Progress -Activity "A.R.C.A.D.E." -Completed

Write-Host ""
Write-Host "COMPLETATO"

Ultima modifica di 0zzy il 30/04/2026, 16:12, modificato 1 volta in totale.
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.
Avatar utente
0zzy

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

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

Messaggio da 0zzy »

Ciao, per filtrare con piu precisone ed escludere le tipologie di giochi come Card Game, Gambling, Medal Game, music game,quiz, slot machine, ecc bisogna per forza di cose dare in input anche un file catlist.ini.
Lo script ora è aggiornato per prendere in ingresso anche tale file.
Rispondi

Torna a “Miscellanea software”