REM -------------
REM -delete crap-
REM -------------

	DEL .\temp\?*.*

REM --------------------------------------
REM -convert nightmare's .prgs into .bins-
REM --------------------------------------

	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp0.prg     .\includes\nightmar\bins\bmp0.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp1a.prg    .\includes\nightmar\bins\bmp1a.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp1b.prg    .\includes\nightmar\bins\bmp1b.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp2a.prg    .\includes\nightmar\bins\bmp2a.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp2b.prg    .\includes\nightmar\bins\bmp2b.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp0col.prg  .\includes\nightmar\bins\bmp0col.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp1cola.prg .\includes\nightmar\bins\bmp1cola.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp1colb.prg .\includes\nightmar\bins\bmp1colb.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp2cola.prg .\includes\nightmar\bins\bmp2cola.bin
	..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\bmp2colb.prg .\includes\nightmar\bins\bmp2colb.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\d800col.prg  .\includes\nightmar\bins\d800col.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\tune.prg     .\includes\nightmar\bins\tune.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\flippers.prg .\includes\nightmar\bins\flippers.bin
        ..\PCTOOLS\prg2bin.exe .\includes\nightmar\prgs\spring.prg   .\includes\nightmar\bins\spring.bin

REM --------------------------------------
REM -convert ignition's .prgs into .bins-
REM --------------------------------------

	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp0.prg     .\includes\ignition\bins\bmp0.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp1a.prg    .\includes\ignition\bins\bmp1a.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp1b.prg    .\includes\ignition\bins\bmp1b.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp2a.prg    .\includes\ignition\bins\bmp2a.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp2b.prg    .\includes\ignition\bins\bmp2b.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp0col.prg  .\includes\ignition\bins\bmp0col.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp1cola.prg .\includes\ignition\bins\bmp1cola.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp1colb.prg .\includes\ignition\bins\bmp1colb.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp2cola.prg .\includes\ignition\bins\bmp2cola.bin
	..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\bmp2colb.prg .\includes\ignition\bins\bmp2colb.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\d800col.prg  .\includes\ignition\bins\d800col.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\tune.prg     .\includes\ignition\bins\tune.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\flippers.prg .\includes\ignition\bins\flippers.bin
        ..\PCTOOLS\prg2bin.exe .\includes\ignition\prgs\spring.prg   .\includes\ignition\bins\spring.bin

REM -----------------
REM -compile sources-
REM -----------------

        ..\PCTOOLS\64tass.exe -a -o .\temp\nbitmap.prg .\includes\nightmar\source\bitmaps.txt
	..\PCTOOLS\64tass.exe -a -D table=0 -L .\temp\nightmare.txt -o .\temp\table.prg .\sources\main.txt
	..\PCTOOLS\pucrunch.exe -i0 -g0x35 -fdelta -ffast -x $1d00 .\temp\table.prg .\temp\table.prg
REM     ..\PCTOOLS\exomizer2beta\exomizer.exe sfx $1d00 .\temp\table.prg -o .\temp\table.prg
	..\PCTOOLS\64tass.exe .\sources\info.txt -a -o .\temp\info.prg
        ..\PCTOOLS\tslink.exe .\temp\nightmar.prg .\temp\info.prg

        ..\PCTOOLS\64tass.exe -a -o .\temp\ibitmap.prg .\includes\ignition\source\bitmaps.txt
	..\PCTOOLS\64tass.exe -a -D table=1 -L .\temp\ignition.txt  -o .\temp\table.prg .\sources\main.txt
	..\PCTOOLS\pucrunch.exe -i0 -g0x35 -fdelta -ffast -x $1d00 .\temp\table.prg .\temp\table.prg
REM     ..\PCTOOLS\exomizer2beta\exomizer.exe sfx $1d00 .\temp\table.prg -o .\temp\table.prg
	..\PCTOOLS\64tass.exe .\sources\info.txt -a -o .\temp\info.prg
        ..\PCTOOLS\tslink.exe .\temp\ignition.prg .\temp\info.prg

REM -------------------------
REM -copy binaries into .d64-
REM -------------------------

	..\PCTOOLS\c1541 -format "pinballdreams 64,pd" d64 .\temp\pd.d64
	..\PCTOOLS\c1541 -attach .\temp\pd.d64 -write .\temp\ignition.prg     @8:"....ignition...."
	..\PCTOOLS\c1541 -attach .\temp\pd.d64 -write .\temp\nightmar.prg     @8:"...nightmare!..."
	..\PCTOOLS\c1541 -attach .\temp\pd.d64 -write .\includes\griffion.prg @8:".some intro gfx."


REM ----------------------
REM -start the damn thing-
REM ----------------------

	..\..\WinVICE-1.14\x64.exe .\temp\pd.d64

REM -------------
REM -delete bins-
REM -------------

        DEL .\includes\nightmar\bins\?*.*
        DEL .\includes\ignition\bins\?*.*

