forked from 0xGlitchbyte/TinyNightmare64
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeme.bat
114 lines (93 loc) · 2.18 KB
/
makeme.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
@echo off
echo Compiling Sausage64
:Setup
set ROOT=C:\ultra
set ALLOWMOVE=1
set MOVEFOLDER=Z:\
set FORCEMOVE=0
set ROMREGISTER=C:\n64roms\nrdc.exe
set ALLOWREGISTER=0
:Don't touch
set gccdir=%ROOT%\gcc
set PATH=%ROOT%\gcc\mipse\bin;%ROOT%\usr\sbin;C:\WINDOWS\system32;
set gccsw=-mips3 -mgp32 -mfp32 -funsigned-char -D_LANGUAGE_C -D_ULTRA64 -D__EXTENSIONS__
set n64align=on
set DEBUG_MODE=0
goto CheckDebugMode
:CheckDebugMode
for /f "tokens=3" %%a in ('find /i "DEBUG_MODE" debug.h') do if not defined debugcheck set "debugcheck=%%a"
if "%debugcheck%"=="1" (
echo Debug mode enabled
set DEBUG_MODE=1
) else if "%debugcheck%"=="0" (
echo Debug mode disabled
) else (
echo Unable to retrieve debug mode
)
echo.
goto CheckDirectories
:CheckDirectories
if not exist %ROOT% (
echo ERROR: Unable to find Ultra64 folder.
goto Finish
)
if not exist %MOVEFOLDER% (
echo WARNING: Unable to find 64Drive folder.
echo.
set ALLOWMOVE=0
)
if not exist %ROMREGISTER% (
echo WARNING: Unable to find NRDC.exe.
echo.
set ALLOWREGISTER=0
)
goto MoveFromOut
:MoveFromOut
if not exist out goto make
cd out >nul 2>&1
move *.o .. >nul 2>&1
move *.out .. >nul 2>&1
move *.n64 .. >nul 2>&1
move *.cvt .. >nul 2>&1
cd..
goto Make
:Make
make
set MAKEERROR=%errorlevel%
echo.
goto ErrorCheck
:ErrorCheck
if "%MAKEERROR%"=="2" (
echo An error occurred during compilation.
)
goto MoveToOut
:MoveToOut
md out >nul 2>&1
move *.o out >nul 2>&1
move *.out out >nul 2>&1
move *.n64 out >nul 2>&1
move *.cvt out >nul 2>&1
if "%MAKEERROR%"=="0" (
echo Project compiled sucessfully!
if "%ALLOWMOVE%"=="1" goto MoveTo64DrivePoll
)
goto Finish
:MoveTo64DrivePoll
if "%FORCEMOVE%"=="1" goto MoveTo64Drive
set /P PROMPT=Move the ROM to the 64Drive Folder[Y/N]?
if /I "%PROMPT%" EQU "N" goto Finish
if /I "%PROMPT%" EQU "Y" goto MoveTo64Drive
goto MoveTo64DrivePoll
:MoveTo64Drive
cd out
for /R "%~dp0out" %%f in (*.n64) do copy /y "%%f" "%MOVEFOLDER%" >nul
if "%FORCEMOVE%"=="0" (
echo Done!
) else (
echo Moving ROM to the 64Drive folder
)
goto Finish
:Finish
echo.
pause
exit