forked from Ryuzaki-MrL/OldSNES
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_blarg.bat
71 lines (68 loc) · 2.84 KB
/
make_blarg.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@echo off
:begin
cls
echo OldSNES -- SNES VC for Old 3DS users
echo Currently using: BlargSNES
set /p "title=Game Title: "
if not exist "input\%title%\*.smc" if not exist "input\%title%\*.sfc" (
echo ERROR: Missing rom file.
echo Make sure you have a rom file in input\%title% folder.
pause
exit
)
set long=%title%
set /p "long=Description: "
set /p "author=Publisher: "
set /p "serial=Product Code: "
set /p "id=Unique Id: "
if not exist "output\%title%" mkdir "output\%title%"
if not exist romfs mkdir romfs
del /f /q romfs
if exist "input\%title%\*.smc" (
copy /b "input\%title%\*.smc" romfs\rom.smc >NUL 2>NUL
) else (
copy /b "input\%title%\*.sfc" romfs\rom.smc >NUL 2>NUL
)
if exist "input\%title%\*.bmp" copy /b "input\%title%\*.bmp" romfs\blargSnesBorder.bmp >NUL 2>NUL
if exist "input\%title%\*.ini" copy /b "input\%title%\*.ini" romfs\blargSnes.ini >NUL 2>NUL
if exist "input\%title%\icon.png" ( set file=icon.png
) else if exist "input\%title%\icon.bin" ( set file=icon.bin
) else if exist "input\%title%\icon.jpg" ( set file=icon.jpg
) else if exist "input\%title%\icon.jpeg" ( set file=icon.jpeg
) else if exist "input\%title%\banner.bin" ( set file=banner.bin
) else if exist "input\%title%\banner.png" ( set file=banner.png
) else if exist "input\%title%\banner.jpg" ( set file=banner.jpg
) else if exist "input\%title%\banner.jpeg" ( set file=banner.jpeg
) else (
echo ERROR: Icon image not found.
pause
exit
)
if "%file%"=="icon.bin" set useBin=T
if "%file%"=="banner.bin" set useBin=T
if not "%useBin%"=="T" (
tools\convert "input\%title%\%file%" -resize 40x40! output\tempicon.png
tools\convert tools\icon.png output\tempicon.png -gravity center -composite "output\%title%\icon.png"
del output\tempicon.png
tools\bannertool makesmdh -s "%title%" -l "%long%" -p "%author%" -i "output\%title%\icon.png" -o "icon.bin" >NUL 2>NUL
if not exist "output\%title%\banner.bin" tools\3dstool -c -f "output\%title%\banner.bin" -t banner --banner-dir banner
)
(echo %title%)>romfs\rom.txt
if not exist cia mkdir cia
if "%useBin%"=="T" (
tools\makerom -f cia -target t -rsf "tools\custom.rsf" -o "cia\%title%.cia" -exefslogo -icon "input\%title%\icon.bin" -banner "input\%title%\banner.bin" -elf "tools\blargSnes.elf" -DAPP_TITLE="%title%" -DAPP_PRODUCT_CODE="%serial%" -DAPP_UNIQUE_ID="0x%id%" -DAPP_ROMFS="romfs"
) else (
tools\makerom -f cia -target t -rsf "tools\custom.rsf" -o "cia\%title%.cia" -exefslogo -icon "icon.bin" -banner "output\%title%\banner.bin" -elf "tools\blargSnes.elf" -DAPP_TITLE="%title%" -DAPP_PRODUCT_CODE="%serial%" -DAPP_UNIQUE_ID="0x%id%" -DAPP_ROMFS="romfs" >NUL 2>NUL
del icon.bin
)
del /f /q romfs
if exist banner\backup (
copy /b banner\backup banner >NUL 2>NUL
rmdir /s /q banner\backup
)
echo Done
pause
cls
choice /C YN /M "Do you want to build another CIA?"
IF ERRORLEVEL 2 exit
IF ERRORLEVEL 1 goto begin