-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
@echo off | ||
cls | ||
chcp 1252 >nul 2>&1 | ||
mkdir "%rootpath%\TMP" >nul 2>&1 | ||
|
||
echo\ | ||
"%rootpath%\BAT\Diagbox" gd 0e | ||
echo Do you want to change the default directory^? | ||
"%rootpath%\BAT\Diagbox" gd 07 | ||
echo ^(Useful if your games are on another hard drive or path^) | ||
CHOICE /C YN | ||
echo\ | ||
if !errorlevel!==1 ( | ||
echo Example: E:\ | ||
set /p "HDDPATH=Enter the path where yours CD DVD folder located:" | ||
if "!HDDPATH!"=="" set "HDDPATH=" | ||
) else (set HDDPATH=%rootpath%) | ||
|
||
set filepath="!HDDPATH!\DVD\*.iso" "!HDDPATH!\DVD\*.cue" "!HDDPATH!\CD\*.iso" "!HDDPATH!\CD\*.cue" | ||
|
||
if not exist "!HDDPATH!\CHT" md "!HDDPATH!\CHT" >nul 2>&1 | ||
if exist "!HDDPATH!\CHT\*.cht" ( | ||
echo\ | ||
"%rootpath%\BAT\Diagbox" gd 0e | ||
echo CHTs have been detected, they will be modified, do you want to continue^? | ||
"%rootpath%\BAT\Diagbox" gd 07 | ||
CHOICE /C YN /M "Select Option:" | ||
if !errorlevel!==1 set overwrittenCHT=yes | ||
if !errorlevel!==2 set overwrittenCHT=no | ||
) else (set overwrittenCHT=yes) | ||
|
||
if !overwrittenCHT!==yes ( | ||
cd /d "!HDDPATH!\CHT" & for %%F in (*.cht) do if %%~zF==0 (del "%%F" >nul 2>&1) | ||
|
||
REM Get iso file | ||
"%rootpath%\BAT\busybox" ls -p !filepath! 2>&1| "%rootpath%\BAT\busybox" grep -v /| "%rootpath%\BAT\busybox" sed "/No such file or directory/d" | "%rootpath%\BAT\busybox" sed "s/.*\\\(.*\)/\1\t&/" >>"%rootpath%\TMP\GameslistTMP.txt" & type "%rootpath%\TMP\GameslistTMP.txt" | "%rootpath%\BAT\busybox" sort | "%rootpath%\BAT\busybox" cut -f 2- >"%rootpath%\TMP\Gameslist.txt" | ||
for %%F in ("%rootpath%\TMP\Gameslist.txt") do if %%~zF==0 ( | ||
echo\ | ||
echo\ | ||
echo No .ISO file was found in CD Or DVD Folder. | ||
echo\ | ||
) else ( | ||
|
||
for /f "usebackq delims=" %%f in ("%rootpath%\TMP\Gameslist.txt") do ( | ||
|
||
setlocal DisableDelayedExpansion | ||
set fpath=%%f | ||
set filename=%%~nxf | ||
set fname=%%~nf | ||
setlocal EnableDelayedExpansion | ||
|
||
echo\ | ||
echo\ | ||
echo !filename! | ||
|
||
if "!filename!"=="!fname!.cue" ( | ||
"%rootpath%\BAT\7-Zip\7z" x -bso0 "!fpath!" -o"%rootpath%\TMP" "!fname!.iso" -r -y | ||
set "fpath=!rootpath!\TMP\!fname!.iso" | ||
) | ||
|
||
REM Get Gameid from SYSTEM.CNF | ||
"%rootpath%\BAT\7-Zip\7z" x -bso0 "!fpath!" -o"%rootpath%\TMP" SYSTEM.CNF -r -y >nul 2>&1 | ||
"%rootpath%\BAT\busybox" grep -o "[A-Z][A-Z][A-Z][A-Z]_[0-9][0-9][0-9].[0-9][0-9]" "%rootpath%\TMP\SYSTEM.CNF" > "%rootpath%\TMP\gameidelf.txt" & set /p gameidelf=<"%rootpath%\TMP\gameidelf.txt" | ||
|
||
REM Get ELF | ||
"%rootpath%\BAT\7-Zip\7z" x -bso0 "!fpath!" -o"%rootpath%\TMP" !gameidelf! -r -y >nul 2>&1 | ||
REM Get mastercode | ||
"%rootpath%\BAT\mastercode_finder_cmd" -v "%rootpath%\TMP\!gameidelf!" | "%rootpath%\BAT\busybox" grep "Recommended mastercode" | "%rootpath%\BAT\busybox" cut -c26-999 > "%rootpath%\TMP\Mastercode.txt" & set /p Mastercode=<"%rootpath%\TMP\Mastercode.txt" | ||
REM Get Game Version | ||
"%rootpath%\BAT\busybox" grep "VER" "%rootpath%\TMP\SYSTEM.CNF" | "%rootpath%\BAT\busybox" sed "s/ //g" | "%rootpath%\BAT\busybox" cut -c5-999 | "%rootpath%\BAT\busybox" sed "s/\s*$//" > "%rootpath%\TMP\VER.txt" & set /p GAMEVER=<"%rootpath%\TMP\VER.txt" | ||
REM Get CRC | ||
"%rootpath%\BAT\PS2ELFCRC.exe" "%rootpath%\TMP\!gameidelf!" | "%rootpath%\BAT\busybox" sed "s/[^:]*://g; s/ //g" > "%rootpath%\TMP\CRC.txt" & set /p CRC=<"%rootpath%\TMP\CRC.txt" | ||
|
||
echo Mastercode: [!Mastercode!] | ||
echo Gameid: [!gameidelf!] | ||
echo Game Version: [!GAMEVER!] | ||
echo CRC: [!CRC!] | ||
|
||
copy "!HDDPATH!\CHT\!gameidelf!.cht" "%rootpath%\TMP\!gameidelf!.cht" >nul 2>&1 | ||
|
||
echo "!fname! /VER !GAMEVER! /ID !gameidelf! /CRC !CRC!"| "%rootpath%\BAT\busybox" iconv -f windows-1252 -t utf-8 > "!HDDPATH!\CHT\!gameidelf!.cht" | ||
echo Mastercode>> "!HDDPATH!\CHT\!gameidelf!.cht" | ||
echo !Mastercode!>> "!HDDPATH!\CHT\!gameidelf!.cht" | ||
|
||
if exist "%rootpath%\TMP\!gameidelf!.cht" ( | ||
"%rootpath%\BAT\busybox" sed -i "1d" "%rootpath%\TMP\!gameidelf!.cht" | ||
"%rootpath%\BAT\busybox" sed -i -e "/Mastercode/{N;d;}" "%rootpath%\TMP\!gameidelf!.cht" | ||
"%rootpath%\BAT\busybox" sed -i "$a" "!HDDPATH!\CHT\!gameidelf!.cht" | ||
"%rootpath%\BAT\busybox" sed -i "/./,$^!d" "%rootpath%\TMP\!gameidelf!.cht" | ||
type "%rootpath%\TMP\!gameidelf!.cht" >> "!HDDPATH!\CHT\!gameidelf!.cht" | ||
) | ||
for %%f in ("%rootpath%\TMP\*") do del "%%f" >nul 2>&1 | ||
endlocal | ||
endlocal | ||
) | ||
REM Removes only blank lines from the last line of a file | ||
"%rootpath%\BAT\busybox" sed -i -e :a -e "/^^\n*$/{$d;N;ba" -e "}" "!HDDPATH!\CHT\*.cht" | ||
) | ||
rmdir /Q/S "%rootpath%\TMP" >nul 2>&1 | ||
echo\ | ||
echo\ | ||
PAUSE | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
@echo off | ||
chcp 65001 >nul 2>&1 | ||
IF NOT EXIST "%rootpath%\TMP" MD "%rootpath%\TMP" | ||
|
||
echo\ | ||
"%rootpath%\BAT\Diagbox" gd 0e | ||
echo Do you want to change the default directory^? | ||
"%rootpath%\BAT\Diagbox" gd 07 | ||
echo ^(Useful if your APPS folder are on another HDD^) | ||
CHOICE /C YN | ||
echo\ | ||
if !errorlevel!==1 ( | ||
echo Example: E:\ | ||
set /p "HDDPATH=Enter the root path where yours APPS folder:" | ||
) | ||
if not defined HDDPATH set HDDPATH=%rootpath% | ||
|
||
echo\ | ||
"%rootpath%\BAT\Diagbox" gd 0e | ||
echo Do you want to add a prefix^? in front of shortcut names | ||
"%rootpath%\BAT\Diagbox" gd 07 | ||
CHOICE /C YN | ||
IF !ERRORLEVEL!==1 ( | ||
echo\ | ||
echo Select Prefix option | ||
echo 1 = [APP] | ||
echo 2 = CUSTOM | ||
echo 3 = Nothing | ||
CHOICE /C 123 | ||
IF !ERRORLEVEL!==1 set prefix=[APP] | ||
IF !ERRORLEVEL!==2 echo\& set /p "prefix=Enter your prefix:" | ||
IF !ERRORLEVEL!==3 set "prefix=" | ||
|
||
echo\ | ||
echo As it will be displayed Example: !Prefix!My APP | ||
echo Confirm^? | ||
CHOICE /C YN | ||
IF !ERRORLEVEL!==2 goto OPLManagement >nul 2>&1 | ||
) | ||
|
||
dir /b /o:n "!HDDPATH!\POPS\*.VCD" > "%rootpath%\TMP\PS1GamesTMP.txt" | ||
echo\ | ||
echo\ | ||
echo.------------------------------------------- | ||
cd /d "!HDDPATH!\APPS" & dir /b /o:n *.ELF> "%rootpath%\TMP\ELF.ELFTMP" 2>nul || REM echo .ELF Files NOT FOUND | ||
for /f "usebackq delims=" %%f in ("%rootpath%\TMP\ELF.ELFTMP") do ( | ||
|
||
setlocal DisableDelayedExpansion | ||
set filename=%%f | ||
set APPELF=%%~nf | ||
setlocal EnableDelayedExpansion | ||
|
||
IF NOT EXIST "!APPELF!" ( | ||
md "!APPELF!" | ||
move "!filename!" "!APPELF!" >nul 2>&1 | ||
) else ( | ||
"%rootpath%\BAT\DiagBox" gd 0c | ||
echo Application Already exist [!APPELF!] | ||
"%rootpath%\BAT\DiagBox" gd 07 | ||
) | ||
endlocal | ||
endlocal | ||
) | ||
|
||
dir /b /o:n "!HDDPATH!\APPS\*" > "%rootpath%\TMP\APPFolder.txt" | ||
for /f "usebackq delims=" %%f in ("%rootpath%\TMP\APPFolder.txt") do ( | ||
|
||
setlocal DisableDelayedExpansion | ||
set APPFolder=%%f | ||
setlocal EnableDelayedExpansion | ||
|
||
IF NOT EXIST "!HDDPATH!\POPS\!APPFolder!.VCD" ( | ||
IF EXIST "!APPFolder!\*.ELF" ( | ||
dir /b /on "!HDDPATH!\APPS\!APPfolder!\*.ELF"> "%rootpath%\TMP\ELF.ELFTMP" & set /P BOOTELF=<"%rootpath%\TMP\ELF.ELFTMP" | ||
|
||
IF EXIST "!APPFolder!\title.cfg" ( | ||
"%rootpath%\BAT\busybox" sed -i -e "s/title=.*/title=/g; s/title=/title=!Prefix!!APPFolder!/g" "!APPfolder!\title.cfg" | ||
"%rootpath%\BAT\busybox" sed -i -e "s/boot=.*/boot=/g; s/boot=/boot=!BOOTELF!/g" "!APPfolder!\title.cfg" | ||
) else ( | ||
echo title=!Prefix!!APPFolder!>"!APPfolder!\title.cfg" | ||
echo boot=!BOOTELF!>>"!APPfolder!\title.cfg" | ||
) | ||
|
||
"%rootpath%\BAT\DiagBox" gd 0a | ||
echo [!APPfolder!\!BOOTELF!] | ||
"%rootpath%\BAT\Diagbox" gd 07 | ||
) else ( | ||
"%rootpath%\BAT\DiagBox" gd 0c | ||
echo [!APPfolder!] .ELF Files NOT FOUND | ||
"%rootpath%\BAT\DiagBox" gd 07 | ||
) | ||
) | ||
endlocal | ||
endlocal | ||
) | ||
chcp 1252 >nul 2>&1 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.