-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompileNEXT.bat
More file actions
59 lines (43 loc) · 1.4 KB
/
compileNEXT.bat
File metadata and controls
59 lines (43 loc) · 1.4 KB
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
@echo off
set tmppath=%~dpn0
rem echo %tmppath%
FOR /F "usebackq" %%i IN (`%~dp0path.bat`) DO SET ZXBC=%%i
SET ZXB="%ZXBC%\zxbasic\zxb.exe"
SET EMU="%ZXBC%Emu\Fuse\fuse.exe"
SET FILE=%1
IF %1 == "" (
exit 1
)
for %%I in (%FILE%) do set fname=%%~nI
for %%I in (%FILE%) do set pname=%%~dpI
for %%I in (%FILE%) do set drive=%%~d
:: PARAMS SENT : %1 full path of basic.bas, %2 -S, %3 Start address
if "%6" == "--debug-array" goto dofuse
if "%7" == "--debug-array" goto dofuse
if "%8" == "--debug-array" goto dofuse
if "%6" == "--emmit-backend" goto emit
if "%7" == "--emmit-backend" goto emit
if "%8" == "--emmit-backend" goto emit
%ZXBC%zxbasic\python\python.exe %ZXBC%Scripts\nextbuild.py %pname%%fname%.bas
if ERRORLEVEL 1 goto pgend
if ERRORLEVEL 1 goto endnow
:: copy %ZXBC%Emu\cspect\zxbc\temp.sna %pname%compiled.sna >>NUL
cd %pname%
if ERRORLEVEL 10 goto endnow
::cd %ZXBC%Emu\cspect\zxbc\
start %ZXBC%Emu\cspect\cspect.exe -w3 -16bit -brk -tv -vsync -nextrom -map=%pname%memory.txt -zxnext -fill=00 -mmc=%pname%data\ %pname%%fname%.NEX
color 06
exgo 0
:endnow
exit 0
:pgend
REM Dont ask why but we need to send the error line twice for BorIDE to recognise it.
%ZXBC%Scripts\errorline.exe %ZXBC%logs\COMPILE.txt /q
exit %ERRORLEVEL%
goto eoscript
:dofuse
%ZXB% %1 -t -B %2 %3 -o %pname%%fname%.tap -a -M %fname%.map
if ERRORLEVEL 1 goto pgend
%EMU% %pname%%fname%.tap
exit 0
:eoscript