下面代码保存为一个bat文件,放在存放rom的文件夹下运行
@echo off
setlocal enabledelayedexpansion
:menu
cls
echo Please select a game ROM type:
echo 1. FC
echo 2. PSP
echo.
set /p choice="Enter your choice (1 or 2): "
if "%choice%"=="1" (
set "collection=FC"
set "sort_num=022"
set "extensions=nes,7z,zip"
set "launch_command=am start --user 0 ^
-n com.retroarch.aarch64/com.retroarch.browser.retroactivity.RetroActivityFuture ^
-e ROM {file.path} ^
-e LIBRETRO /data/data/com.retroarch.aarch64/cores/nestopia_libretro_android.so ^
-e CONFIGFILE /storage/emulated/0/Android/data/com.retroarch.aarch64/files/retroarch.cfg ^
-e IME com.android.inputmethod.latin/.LatinIME ^
-e DATADIR /data/data/com.retroarch.aarch64 ^
-e APK /data/app/com.retroarch.aarch64-1/base.apk ^
-e SDCARD /storage/emulated/0 ^
-e EXTERNAL /storage/emulated/0/Android/data/com.retroarch.aarch64/files ^
--activity-clear-top"
) else if "%choice%"=="2" (
set "collection=PSP"
set "sort_num=043"
set "extensions=iso,cso,pbp,elf"
set "launch_command=am start --user 0 ^
-n org.ppsspp.ppsspp/.PpssppActivity ^
-a android.intent.action.VIEW ^
-d {file.path}"
) else (
echo Invalid choice. Please try again.
goto menu
)
echo Generating metadata for %collection% ROMs...
(
echo collection: %collection%
echo sort-by: %sort_num%
echo extensions: %extensions%
echo.
echo %launch_command%
echo.
) > metadata.pegasus1.txt
set "dir=%~dp0"
set "file_num=1"
:loop
for %%f in ("%dir%*") do (
set "filename=%%~nf"
set "extension=%%~xf"
echo game: !filename! >> metadata.pegasus1.txt
echo file: !filename!!extension! >> metadata.pegasus1.txt
echo sort-by: 00!file_num! >> metadata.pegasus1.txt
echo developer: >> metadata.pegasus1.txt
echo description: >> metadata.pegasus1.txt
echo. >> metadata.pegasus1.txt
set /a file_num+=1
)
echo File list has been written to metadata.pegasus1.txt
endlocal
pause
选择游戏rom种类