This commit is contained in:
Peter Ferrie 2019-04-11 19:59:25 -07:00
parent d86103529e
commit ddc27a378d
3 changed files with 86 additions and 0 deletions

7
bin/changebootloader.js Normal file
View File

@ -0,0 +1,7 @@
a = new ActiveXObject("scripting.filesystemobject")
b = a.opentextfile(WScript.Arguments(0))
c = b.read(0x40)
b.skip(0x200)
d = b.read(a.getfile(WScript.Arguments(0)).size-0x240)
b.close()
b=a.createtextfile(WScript.Arguments(0), 1).write(c+a.opentextfile(WScript.Arguments(1)).read(512)+d)

39
bin/po2do.js Normal file
View File

@ -0,0 +1,39 @@
kMap = [0x00,
0x0E,
0x0D,
0x0C,
0x0B,
0x0A,
0x09,
0x08,
0x07,
0x06,
0x05,
0x04,
0x03,
0x02,
0x01,
0x0F
]
a = new ActiveXObject("scripting.filesystemobject")
for (b = new Enumerator(a.GetFolder(WScript.Arguments(0)).files); !b.atEnd(); b.moveNext())
{
if (a.GetExtensionName(b.item()).toLowerCase() == "po")
{
fi = a.opentextfile(b.item())
fo = a.createtextfile(WScript.Arguments(1)+"\\"+a.GetBaseName(b.item())+".dsk", 1)
for (track = 0; track < 0x23; ++track)
{
sectors = new Array(0x10)
for (dos_sector = 0; dos_sector < 0x10; ++dos_sector)
{
sectors[kMap[dos_sector]] = fi.read(256)
}
for (dos_sector = 0; dos_sector < 0x10; ++dos_sector)
{
fo.write(sectors[dos_sector])
}
}
}
}

40
winmake.bat Normal file
View File

@ -0,0 +1,40 @@
@echo off
rem
rem Anti-M Makefile for Windows
rem assembles source code, optionally builds a disk image
rem
rem a qkumba monstrosity from 2019-04-11
rem
set BUILDDISK=build\anti-m
set VOLUME=ANTI.M
rem third-party tools required to build (must be in path)
rem https://sourceforge.net/projects/acme-crossass/
set ACME=acme
rem https://www.brutaldeluxe.fr/products/crossdevtools/cadius/
rem https://github.com/mach-kernel/cadius
set CADIUS=cadius
if "%1" equ "asm" (
:asm
2>nul md build
%ACME% -r build\anti-m.lst src\anti-m.a
1>nul copy /y res\work.bin "%BUILDDISK%.po"
1>nul copy /y res\_FileInformation.txt build\ >>build\log
%CADIUS% ADDFILE "%BUILDDISK%.po" "/%VOLUME%/" "build\ANTI.M.SYSTEM" >>build\log
%ACME% -r build\proboot.lst src\proboot.a
cscript /nologo bin/changebootloader.js "%BUILDDISK%.po" build\proboot
cscript /nologo bin/po2do.js build\ build\
2>nul del "%BUILDDISK%.po"
goto :EOF
)
if "%1" equ "clean" (
:clean
echo y|1>nul 2>nul rd build /s
goto :EOF
)
echo usage: %0 clean / asm