From 22d0f97df94d04a4a505a35574cae71f82e38361 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 18 Apr 2018 18:03:06 -0700 Subject: [PATCH] sync makefile with support files --- bin/fixFileInformation.js | 7 +++++++ bin/textnormalize.js | 26 ++++++++++++++++++++++++++ winmake.bat | 36 +++--------------------------------- 3 files changed, 36 insertions(+), 33 deletions(-) create mode 100644 bin/fixFileInformation.js create mode 100644 bin/textnormalize.js diff --git a/bin/fixFileInformation.js b/bin/fixFileInformation.js new file mode 100644 index 0000000..d5a699e --- /dev/null +++ b/bin/fixFileInformation.js @@ -0,0 +1,7 @@ +a=new ActiveXObject("scripting.filesystemobject") +b=a.opentextfile("src/constants.a").readall() +b=b.substr(b.search(c=/kPitchDarkBinaryAddress/)) +d=a.opentextfile(e=WScript.Arguments(0)) +b=d.readall().replace(c,parseInt(b.substr(b.search(/\$/)+1),16).toString(16).toUpperCase()) +d.close() +a.createtextfile(e).write(b) diff --git a/bin/textnormalize.js b/bin/textnormalize.js new file mode 100644 index 0000000..6b91c97 --- /dev/null +++ b/bin/textnormalize.js @@ -0,0 +1,26 @@ +a = new ActiveXObject("scripting.filesystemobject") +fileinfo = "" +for (b = new Enumerator(a.GetFolder(WScript.Arguments(0)).files); !b.atEnd(); b.moveNext()) +{ + f = a.opentextfile(b.item()) + try + { + shortf = a.GetBaseName(b.item()).toUpperCase() + newf = "" + fileinfo += "\r\n" + shortf + "=Type(04),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(C3)" + l = 0 + while (1) + { + lines = f.readline() + !lines.length && (linelength = 0); + l && linelength && (lines += new Array(linelength - lines.length).join(" ")) + newf += lines + "\r" + if (lines.substring(0, 6) == "[info]") linelength = 65 + else if (lines.substring(0, 13) == "[description]") linelength = 78 + l = linelength + } + } + catch(e){} + a.createtextfile("build\\text\\" + shortf, 1).write(newf) +} +a.createtextfile("build\\text\\_FileInformation.txt", 1).write(fileinfo.substring(2)) diff --git a/winmake.bat b/winmake.bat index 1d4d3d0..e96d881 100644 --- a/winmake.bat +++ b/winmake.bat @@ -1,4 +1,3 @@ -0nul copy /y res\"Pitch Dark.master games collection.do.not.edit.2mg" "build\%DISK%" 1>nul copy /y res\_FileInformation.txt build\ +cscript /nologo bin\fixFileInformation.js build\_FileInformation.txt cadius ADDFILE "build\%DISK%" "/PITCH.DARK/" "build\GRUE.SYSTEM" cadius ADDFILE "build\%DISK%" "/PITCH.DARK/" "build\ONBEYOND.SYSTEM" cadius ADDFILE "build\%DISK%" "/PITCH.DARK/" "build\ZINFO.SYSTEM" @@ -56,7 +56,7 @@ if "%1" equ "txt" ( call :dsk :txt 2>nul md build\text -cscript /nologo //e:jscript %~f0 +cscript /nologo bin/textnormalize.js res\text cd build & cadius ADDFOLDER "%DISK%" "/PITCH.DARK/TEXT" text & cd .. if not "%1" equ "" set DISK= goto :EOF @@ -82,41 +82,11 @@ goto :EOF echo usage: %0 clean / asm / dsk / txt / artwork / all goto :EOF -*/ -WScript.echo("") -a = new ActiveXObject("scripting.filesystemobject") -fileinfo = "" -for (b = new Enumerator(a.GetFolder("res\\text").files); !b.atEnd(); b.moveNext()) -{ - f = a.opentextfile(b.item()) - try - { - shortf = a.GetBaseName(b.item()).toUpperCase() - newf = "" - fileinfo += "\r\n" + shortf + "=Type(04),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(C3)" - l = 0 - while (1) - { - lines = f.readline() - !lines.length && (linelength = 0); - l && linelength && (lines += new Array(linelength - lines.length).join(" ")) - newf += lines + "\r" - if (lines.substring(0, 6) == "[info]") linelength = 65 - else if (lines.substring(0, 13) == "[description]") linelength = 78 - l = linelength - } - } - catch(e){} - a.createtextfile("build\\text\\" + shortf, 1).write(newf) -} -a.createtextfile("build\\text\\_FileInformation.txt", 1).write(fileinfo.substring(2)) -/* -bat/jscript hybrid make script for Windows environments +make script for Windows environments a qkumba monstrosity from 2018-03-01 requires ACME, CADIUS https://sourceforge.net/projects/acme-crossass/ https://www.brutaldeluxe.fr/products/crossdevtools/cadius/ https://github.com/mach-kernel/cadius requires ACME, CADIUS to be in path -*/