Skip to content

Commit f415f60

Browse files
committed
Skraper Mixes
1 parent 7aeac15 commit f415f60

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

Skraper Mixes/convert.ps1

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This script will ingest an EmulationStation XML Generated by Skraper
2+
# and extract the Description for use with muOS
3+
# It can ingest multiple XML files and reads them from whatever
4+
# directory this script is run from
5+
6+
# Grab all XML files from current dir
7+
$xmlFiles = Get-ChildItem -Path $PSScriptRoot -Filter *.xml
8+
9+
#Set Output INFO path
10+
# This will out put the Metadata text file in a muOS compliant way
11+
# Replace this with the output folder you'd prefer
12+
$muosInfo = "J:\RG35XX Plus\muOS\Tiny Best Set\Meta\INFO"
13+
14+
# Legacy Text from older muOS versions
15+
# $descText = "# Description of the game or content."
16+
# $kindText = "# The genre of the game separated by commas."
17+
# $timeText = "# Timestamp of last played - This is updated dynamically.`r`nlast="
18+
# $coreText = "# The specific RetroArch core used, this can be any file in the CORE directory.`r`n# Leave it as 'detect' to have it run based on the default core in the 'core.txt' file.`r`ncore=detect"
19+
# $modeText = "# The cpu governor that will be used. Can be one of the following:`r`n# interactive performance powersave userspace`r`n# Leave it as 'detect' to use the default which is 'interactive'`r`nmode=performance"
20+
21+
# Load the XML file
22+
foreach ($xmlFile in $xmlFiles) {
23+
# Extract the system name from the file path
24+
# This will put things in the muOS directory strucure using the XML filename
25+
# as the muOS directory name
26+
# i.e if your ROMs are saved as /ROMS/Gameboy/ name the XMl Gameboy.xml
27+
$systemName = [System.IO.Path]::GetFileNameWithoutExtension($xmlFile.Name)
28+
#Write-Host $systemName
29+
[xml]$xml = Get-Content $xmlFile
30+
31+
foreach ($game in $xml.SelectNodes("//game")) {
32+
$gamePath = $game.SelectSingleNode("path").InnerText
33+
$gameDesc = $game.SelectSingleNode("desc").InnerText #-replace "`r|`n", " " # Early versions stripped linebreaks
34+
$gameGenre = $game.SelectSingleNode("genre").InnerText
35+
36+
# Extracting filename from the path
37+
# This ensures the metadata get's the correct name /INFO/content/System/meta/filename.txt
38+
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($gamePath)
39+
40+
# Created the files!
41+
$outputFolderPath = "$muosInfo\content\$systemName\meta\"
42+
$outputFilePath = Join-Path -Path $outputFolderPath -ChildPath "$fileName.txt"
43+
44+
# Create the directories if needed
45+
if (-not (Test-Path -LiteralPath $outputFolderPath)) {
46+
New-Item -ItemType Directory -Path $outputFolderPath | Out-Null
47+
}
48+
#$content = "$descText`r`ndesc=$gameDesc`r`n`r`n$kindText`r`nkind=$gameGenre`r`n`r`n$timeText`r`n`r`n$coreText`r`n`r`n$modeText"
49+
$content = $gameDesc
50+
Write-Host "Writing $outputFilePath"
51+
Set-Content -LiteralPath $outputFilePath -Value $content
52+
}
53+
}

Skraper Mixes/muOS RG35XX Box.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
<ImageComposition xsi:noNamespaceSchemaLocation="https://www.skraper.net/ImageComposition.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<Information ShortName="muOS Box Art" LongName="muOS Box Art Mix" Description="2DBox + Support" Author="antiKk" />
4+
<Viewport Width="320" Height="240" />
5+
<Drawings>
6+
<Item Type="Box2DFront">
7+
<Display X="80%" Y="95%" Antialiasing="None" Width="80%" Height="80%" KeepRation="true" Anchor="BottomRight" />
8+
</Item>
9+
<Item Type="Region1">
10+
<Display X="85%" Y="5%" Antialiasing="None" Width="20%" Height="20%" KeepRation="true" Anchor="TopRight" />
11+
</Item>
12+
<Item IfSystem="IsInTheList:20,23,57,58,59,114" TestOnly="true">
13+
<Children>
14+
<Item Type="Support">
15+
<Display X="99%" Y="99%" Antialiasing="None" Width="60%" Height="60%" KeepRation="true" Anchor="BottomRight" />
16+
</Item>
17+
</Children>
18+
</Item>
19+
<Item IfSystem="IsNotInTheList:20,23,57,58,59,114" TestOnly="true">
20+
<Children>
21+
<Item Type="Support">
22+
<Display X="99%" Y="99%" Antialiasing="None" Width="35%" Height="35%" KeepRation="true" Anchor="BottomRight" />
23+
</Item>
24+
</Children>
25+
</Item>
26+
</Drawings>
27+
</ImageComposition>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ImageComposition xsi:noNamespaceSchemaLocation="https://www.skraper.net/ImageComposition.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2+
<Information ShortName="muOS Preview Image" LongName="muOS Preview Image Mix" Description="Screenshot" Author="antiKk" />
3+
<Viewport Width="515" Height="275" /> <!-- This is the maximum size of the muOS preview pane. -->
4+
<Drawings>
5+
<Item Type="Screenshot">
6+
<Display X="50%" Y="50%" Width="515" Height="275" Antialiasing="None" KeepRatio="true" Anchor="VCenterHCenter" />
7+
</Item>
8+
</Drawings>
9+
</ImageComposition>

0 commit comments

Comments
 (0)