-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcompile.bat
95 lines (70 loc) · 1.69 KB
/
compile.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@echo off
REM clean this out lol
set perl-path="perl"
if exist "tools\win\perl.exe" (
echo Found perl override, using that for compilation.
set perl-path="tools\win\perl.exe"
)
:check
if exist "rh-jpn.gba" (
goto tools
) else (
goto nofile
)
:tools
mkdir build
copy "rh-jpn.gba" "build\rh-atlus.gba"
echo -- Compile Text --
%perl-path% "tools\abcde\abcde.pl" -cm abcde::Atlas "build\rh-atlus.gba" "src\script.txt"
echo -- Compile Bitmap --
setlocal EnableDelayedExpansion
for /f "skip=1 delims=" %%f in (src/bitmaps_to_compile.md) do (
set "file=%%f"
tools\win\4bmpp.exe -p !file!
)
endlocal
echo -- Compile Graphics --
setlocal EnableDelayedExpansion
for /f "skip=1 delims=" %%f in (src/graphics_to_compile.md) do (
set "file=%%f"
tools\win\DSDecmp.exe -c lz10 !file!.bin !file!
)
endlocal
echo -- Compile Tile Maps ---
setlocal EnableDelayedExpansion
for /f "skip=1 delims=" %%f in (src/tilemaps_to_compile.md) do (
set "file=%%f"
tools\win\rhcomp.exe !file!
)
endlocal
echo -- Compile Audio --
setlocal EnableDelayedExpansion
for /f "skip=1 delims=" %%f in (src/sounds_to_compile.md) do (
set "file=%%f"
echo !file!
ffmpeg -y -i !file!.wav -acodec pcm_s8 -ar 13379 -ac 1 -f s8 !file!.pcm -loglevel error
)
endlocal
echo -- Compile Code --
tools\win\armips.exe src/main.asm
if %ERRORLEVEL% NEQ 0 (
goto fail
)
color 0f
echo Building complete (Press any key to recompile!)
del "build\rh-atlus.gba"
pause > nul
cls
goto check
:nofile
echo Couldn't find a Rhythm Tengoku ROM, please place one in the root of the project to continue.
pause
goto check
:fail
color 4f
echo Building failed (Press any key to recompile!)
del "build\rh-atlus.gba"
pause > nul
color 0f
cls
goto check