-
Notifications
You must be signed in to change notification settings - Fork 4
/
Build.bat
52 lines (42 loc) · 1.45 KB
/
Build.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
@ECHO OFF
REM // delete some intermediate assembler output just in case
IF EXIST Sonic.gen del Sonic.gen
IF EXIST Sonic.gen goto LABLERROR3
IF EXIST Sonic.p del Sonic.p
IF EXIST Sonic.p goto LABLERROR2
IF EXIST Sonic.h del Sonic.h
IF EXIST Sonic.h goto LABLERROR1
REM // run the assembler
REM // '-xx' shows the most detailed error output
REM // '-q' shuts up AS
REM // '-c' outputs a shared file (Sonic.h)
REM // '-A' gives us a small speedup
REM // '-U' forces case-sensitivity
REM // '-L' listing to file
REM // '-i .' allows (b)include paths to be absolute
set AS_MSGPATH=AS/Windows/as
set USEANSI=n
REM // allow the user to choose to print error messages out by supplying the -pe parameter
"%AS_MSGPATH%/asw.exe" -xx -q -c -A -L -U -i . Sonic.asm
IF NOT EXIST Sonic.p pause & exit
"%AS_MSGPATH%/p2bin.exe" -p=FF Sonic.p Sonic.gen Sonic.h
IF EXIST Sonic.p del Sonic.p
IF EXIST Sonic.h del Sonic.h
IF NOT EXIST Sonic.gen pause & exit
REM // generate debug information
"AS/Windows/convsym.exe" Sonic.lst Sonic.gen -a -input as_lst
REM // "AS/Windows/rompad.exe" Sonic.gen 255 0
REM // fix the rom header (checksum)
"AS/Windows/fixheader.exe" Sonic.gen
REM // Copy rom to CD folder
copy Sonic.gen _CD
exit /b
:LABLERROR1
echo Failed to build because write access to Sonic.h was denied.
pause & exit
:LABLERROR2
echo Failed to build because write access to Sonic.p was denied.
pause & exit
:LABLERROR3
echo Failed to build because write access to Sonic.gen was denied.
pause