home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug024.arc / BALOADER.PAS < prev    next >
Pascal/Delphi Source File  |  1979-12-31  |  2KB  |  91 lines

  1. Program BALoader (Output);
  2.  
  3. {Written by Peter Dean (Member 700)}
  4. {Date 12/06/86}
  5.  
  6. Type
  7.     Strng = String[12];
  8. Const
  9.      SF64x16 : Array[1..15] of Byte =
  10.            (107,64,81,55,18,9,16,17,72,15,90,15,0,0,0);
  11.      SF80x25 : Array[1..15] of Byte =
  12.            (107,80,87,55,26,5,24,25,72,10,105,10,32,0,0);
  13.      ScreenRam = $F000;
  14.      PCGram = $F800;
  15. Var
  16.    BAbuffer : Array[1..128] of Byte;
  17.    BAfilvar : File;
  18.    BAcount,BArecord,Loop,BApcg,BAscreen : Integer;
  19.    Count : Byte;
  20.    OK : Boolean;
  21.  
  22. Procedure BeeArtistic(BAfile : Strng);
  23. Procedure Restore;
  24. begin
  25.      InLine ($3E/1/$D3/$0B/$11/$F800/$21/$F000/01/$800/$7E/$2F/
  26.              $12/$13/$23/$0B/$79/$B0/$20/$F6/$3E/00/$D3/$0B)
  27. end; {Restore}
  28.  
  29. Procedure ScreenFormat(Screen : byte);
  30. begin
  31.      For Count := 14 DownTo 1 do
  32.         begin
  33.              Port[12] := Count-1;
  34.              if Screen=1 then Port[13] := SF64x16[Count];
  35.              if Screen=2 then Port[13] := SF80x25[Count]
  36.         end {for}
  37. end; {ScreenFormat}
  38.  
  39. begin
  40.      BAcount:=128; BAscreen:=0; BApcg:=0;
  41.      ClrScr;
  42.  
  43.      {*** Check File Exists ***}
  44.      Assign(BAfilvar,BAfile);
  45.      {$I-} Reset(BAfilvar) {$I+};
  46.      OK := (IOResult = 0);
  47.      if not OK then Exit;
  48.  
  49.      ScreenFormat(1);
  50.  
  51.      {*** Skip COM Loader Section ***}
  52.      BlockRead(BAfilvar,BAbuffer,1,BArecord);
  53.  
  54.      Repeat
  55.            BlockRead(BAfilvar,BAbuffer,1,BArecord);
  56.  
  57.            For Loop := 1 to 128 do
  58.               begin
  59.                    BAcount := BAcount + 1;
  60.  
  61.                    {*** Load PCG Data into Memory ***}
  62.                    if (BAcount>128) and (BAcount<2178) then
  63.                       begin
  64.                            Mem[PCGram + BApcg]:= BAbuffer[Loop];
  65.                            BApcg := BApcg + 1
  66.                       end; {if}
  67.  
  68.                    {*** Load Screen Characters onto Screen ***}
  69.                    if (BAcount>2177) and (BAcount<3202) then
  70.                       begin
  71.                            Mem[ScreenRam+BAscreen] := BAbuffer[Loop];
  72.                            BAscreen := BAscreen + 1
  73.                       end {if}
  74.               end {For}
  75.  
  76. {*** Loop Until End of File ***}
  77.      Until BArecord = 0;
  78.      Close(BAfilvar);
  79.  
  80.      Repeat
  81.      Until KeyPressed;
  82.      ClrScr;
  83.      ScreenFormat(2);
  84.      Restore;
  85.      Restore
  86. end; {BeeArtistic}
  87.  
  88. begin
  89.      BeeArtistic('HAMBURG.COM')
  90. end.
  91.