Advertisement
Aergan

Untitled

Aug 28th, 2015
2,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. @echo off
  2. setlocal enableDelayedExpansion
  3.  
  4. :: Shifty's RetroArch Playlist Script
  5. ::
  6. :: This script will create per-system ROM playlists, the files used to display system columns in the RetroArch XMB UI
  7. :: It exists to work around the romset checksumming that is forced in the current (1.2.2 at time of writing) build of RetroArch
  8. :: Put simply, this will let you create playlists with ROMs that the Add Content > Scan Directory/File process would usually ignore
  9. ::
  10. :: WARNING: This script is not compatible with the Add Content > Scan Directory/File process
  11. :: It will erase existing playlists as part of the generation process, so make sure to back them up beforehand if necessary
  12.  
  13. :: Change these to point to your RetroArch and top-level ROM directories
  14. set RADir=C:\Users\aerga\OneDrive\Consoles\RetroArch
  15. set ROMDir=\\SKYWARP\Console
  16.  
  17. :: For each RetroArch core, add one of these blocks below:
  18. :: set RomDirs[n]=
  19. :: set CoreLibs[n]=
  20. :: set CoreNames[n]=
  21. :: set PlaylistNames[n]=
  22. :: set SupportedExtensions[n]=
  23. ::
  24. :: The numbers in square brackets need to start at 0, and be incremented by 1 for each block added
  25. :: RomDirs[n] should be set to the ROM subdirectory for this core (ex. "SNES" will cause the script to scan ROMDir\SNES)
  26. :: CoreLibs[n] should be set to the core's DLL filename (in RetroArch\cores)
  27. :: CoreNames[n] should be set to the human-readable name of the RetroArch core (bracketed names in the RetroArch 'Load Core' menu)
  28. :: PlaylistNames[n] should be set to the RetroArch name of this core's platform (look at the icon filenames in RetroArch\assets\xmb\monochrome\png\)
  29. :: SupportedExtensions[n] should be set to the supported extensions for this core, prefixed with the wildcard (*) character (available in the RetroArch Information -> Core Info menu)
  30. ::
  31. :: Example Config
  32. :: The config below will create playlist files for SNES, MegaDrive/Genesis and Sega Master System ROMs
  33. ::
  34.  
  35. set RomDirs[0]=GW
  36. set PlaylistNames[0]=Nintendo - Game and Watch
  37. set SupportedExtensions[0]=*.mgw
  38.  
  39. set RomDirs[1]=GB
  40. set PlaylistNames[1]=Nintendo - Game Boy
  41. set SupportedExtensions[1]=*.gb
  42.  
  43. set RomDirs[2]=GBA
  44. set PlaylistNames[2]=Nintendo - Game Boy Advance
  45. set SupportedExtensions[2]=*.gba
  46.  
  47. set RomDirs[3]=GBC
  48. set PlaylistNames[3]=Nintendo - Game Boy Color
  49. set SupportedExtensions[3]=*.gbc
  50.  
  51. set RomDirs[4]=MAME
  52. set PlaylistNames[4]=Arcade (various)
  53. set SupportedExtensions[4]=*.zip *.chd *.7z
  54.  
  55. set RomDirs[5]=MASTERSYSTEM
  56. set PlaylistNames[5]=Sega - Master System - Mark III
  57. set SupportedExtensions[5]=*.sms
  58.  
  59. set RomDirs[6]=MEGADRIVE
  60. set PlaylistNames[6]=Sega - Mega Drive - Genesis
  61. set SupportedExtensions[6]=*.smd
  62.  
  63. set RomDirs[7]=N64
  64. set PlaylistNames[7]=Nintendo - Nintendo 64
  65. set SupportedExtensions[7]=*.n64
  66.  
  67. set RomDirs[8]=NDS
  68. set PlaylistNames[8]=Nintendo - Nintendo DS Decrypted
  69. set SupportedExtensions[8]=*.nds
  70.  
  71. set RomDirs[9]=NES
  72. set PlaylistNames[9]=Nintendo - Nintendo Entertainment System
  73. set SupportedExtensions[9]=*.nes
  74.  
  75. set RomDirs[10]=ports
  76. set PlaylistNames[10]=DOOM
  77. set SupportedExtensions[10]=*.wad
  78.  
  79. set RomDirs[11]=PSP
  80. set PlaylistNames[11]=Sony - PlayStation Portable
  81. set SupportedExtensions[11]=*.iso
  82.  
  83. set RomDirs[12]=PSX
  84. set PlaylistNames[12]=Sony - PlayStation
  85. set SupportedExtensions[12]=*.cue
  86.  
  87. set RomDirs[13]=SEGA32X
  88. set PlaylistNames[13]=Sega - 32X
  89. set SupportedExtensions[13]=*.32x
  90.  
  91. set RomDirs[14]=SEGACD
  92. set PlaylistNames[14]=Sega - CD
  93. set SupportedExtensions[14]=*.cue
  94.  
  95. set RomDirs[15]=SNES
  96. set PlaylistNames[15]=Nintendo - Super Nintendo Entertainment System
  97. set SupportedExtensions[15]=*.sfc
  98.  
  99. REM set RomDirs[]=
  100. REM set PlaylistNames[]=
  101. REM set SupportedExtensions[]=*.
  102.  
  103. :: You can safely ignore everything below here.
  104. echo ============================================
  105. echo Shifty's RetroArch Playlist Script
  106. echo ============================================
  107. echo.
  108. echo Configured Playlists:
  109.  
  110. set "x=0"
  111. :InfoLoop
  112. if defined RomDirs[%x%] (
  113. echo !PlaylistNames[%x%]!
  114.  
  115. set /a "x+=1"
  116. GOTO :InfoLoop
  117. )
  118.  
  119. echo.
  120.  
  121. PAUSE
  122.  
  123. echo.
  124.  
  125. set "x=0"
  126.  
  127. :MainLoop
  128. if defined RomDirs[%x%] (
  129. echo ============================================
  130. echo !PlaylistNames[%x%]!
  131. echo ============================================
  132.  
  133. del "%RADir%\playlists\!PlaylistNames[%x%]!.lpl";
  134. echo Deleted %RADir%\playlists\!PlaylistNames[%x%]!.lpl
  135. echo.
  136.  
  137. echo Entering %ROMDir%\!RomDirs[%x%]!
  138. echo.
  139. echo Adding:
  140.  
  141. pushd "%ROMDir%\!RomDirs[%x%]!"
  142. for /R %%f in (!SupportedExtensions[%x%]!) do (
  143. echo %%~nf%%~xf
  144. (
  145. echo %ROMDIR%%%~pf%%~nf%%~xf
  146. echo %%~nf
  147. echo DETECT
  148. echo DETECT
  149. echo 0^|crc
  150. echo !PlaylistNames[%x%]!.lpl
  151. ) >> "%RADir%\playlists\!PlaylistNames[%x%]!.lpl"
  152. )
  153. popd
  154.  
  155. echo.
  156. echo Writing %RADir%\playlists\!PlaylistNames[%x%]!.lpl
  157. echo. >> "%RADir%\playlists\!PlaylistNames[%x%]!.lpl"
  158.  
  159. echo.
  160.  
  161. set /a "x+=1"
  162. GOTO :MainLoop
  163. )
  164.  
  165. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement