CONST FROM_16500: array [1..4] of byte = ($12,$01,$41,0);
      _21sect: array [1..4] of byte = ($15,$FF,$FF,$1F);
      _19sect: array [1..4] of byte = ($13,$FF,$FF,$07);
      _18sect: array [1..4] of byte = ($12,$FF,$FF,$03);
      _17sect: array [1..4] of byte = ($11,$FF,$FF,$01);
      disklabel: array [1..16+11] of byte = ($46,$41,$53,$54,$46,$4F,$52,$4D,
                                             $41,$54,$54,$45,$44,$20,$20,$20,
                                             $14,$14,$32,$35,$35,$20,$20,$14,
                                             $a0,$a0,$a0);
var I:LONGINT;
    B1,B2:BYTE;
    OUTFILE:FILE OF BYTE;

begin
writeln('This program makes a CLEAN _empty.d64 file.This is useful when you want to copy');
writeln('files to a virtual C64 disk and you want to ZIP it after then. (With simple');
writeln(' SCRATCH the code will remain on the disk, making ZIPping a lot less efficient)');
WRITELN;
WRITELN(' COPYRIGHT BY WERNER ZSOLT.');
WRITELN;
WRITELN(' Contact adress:  MTTT022@URSUS.BKE.HU   (Internet),');
writeln('                  36/1/1823513           (Voice & 14400 Modem)');
 
  ASSIGN(OUTFILE,'_empty.d64');
  REWRITE(OUTFILE);

b1:=0;
FOR I:=1 TO 174848 DO write(outfile,b1);

i:=$16500;
seek(outfile,i);
for b1:=1 to 4 do write(outfile,FROM_16500[b1]);   { bam's entry }

FOR B1:=1 TO 17 DO                      { WRITING OUT THE CLEAN BAM }
   FOR B2:=1 TO 4 DO
     WRITE(OUTFILE,_21sect[B2]);
FOR B1:=1 TO 7 DO
   FOR B2:=1 TO 4 DO
     WRITE(OUTFILE,_19sect[B2]);
FOR B1:=1 TO 6 DO
   FOR B2:=1 TO 4 DO
     WRITE(OUTFILE,_18sect[B2]);
FOR B1:=1 TO 5 DO
   FOR B2:=1 TO 4 DO
     WRITE(OUTFILE,_17sect[B2]);

for b1:=1 to 27 do write(outfile,DISKLABEL[B1]);


i:=$16601;                              { MAKING THE END OF DIR }
seek(outfile,i);
B2:=$FF;
WRITE(OUTFILE,B2);

close(outfile);

end.
