home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug024.arc
/
BALOADER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1979-12-31
|
2KB
|
91 lines
Program BALoader (Output);
{Written by Peter Dean (Member 700)}
{Date 12/06/86}
Type
Strng = String[12];
Const
SF64x16 : Array[1..15] of Byte =
(107,64,81,55,18,9,16,17,72,15,90,15,0,0,0);
SF80x25 : Array[1..15] of Byte =
(107,80,87,55,26,5,24,25,72,10,105,10,32,0,0);
ScreenRam = $F000;
PCGram = $F800;
Var
BAbuffer : Array[1..128] of Byte;
BAfilvar : File;
BAcount,BArecord,Loop,BApcg,BAscreen : Integer;
Count : Byte;
OK : Boolean;
Procedure BeeArtistic(BAfile : Strng);
Procedure Restore;
begin
InLine ($3E/1/$D3/$0B/$11/$F800/$21/$F000/01/$800/$7E/$2F/
$12/$13/$23/$0B/$79/$B0/$20/$F6/$3E/00/$D3/$0B)
end; {Restore}
Procedure ScreenFormat(Screen : byte);
begin
For Count := 14 DownTo 1 do
begin
Port[12] := Count-1;
if Screen=1 then Port[13] := SF64x16[Count];
if Screen=2 then Port[13] := SF80x25[Count]
end {for}
end; {ScreenFormat}
begin
BAcount:=128; BAscreen:=0; BApcg:=0;
ClrScr;
{*** Check File Exists ***}
Assign(BAfilvar,BAfile);
{$I-} Reset(BAfilvar) {$I+};
OK := (IOResult = 0);
if not OK then Exit;
ScreenFormat(1);
{*** Skip COM Loader Section ***}
BlockRead(BAfilvar,BAbuffer,1,BArecord);
Repeat
BlockRead(BAfilvar,BAbuffer,1,BArecord);
For Loop := 1 to 128 do
begin
BAcount := BAcount + 1;
{*** Load PCG Data into Memory ***}
if (BAcount>128) and (BAcount<2178) then
begin
Mem[PCGram + BApcg]:= BAbuffer[Loop];
BApcg := BApcg + 1
end; {if}
{*** Load Screen Characters onto Screen ***}
if (BAcount>2177) and (BAcount<3202) then
begin
Mem[ScreenRam+BAscreen] := BAbuffer[Loop];
BAscreen := BAscreen + 1
end {if}
end {For}
{*** Loop Until End of File ***}
Until BArecord = 0;
Close(BAfilvar);
Repeat
Until KeyPressed;
ClrScr;
ScreenFormat(2);
Restore;
Restore
end; {BeeArtistic}
begin
BeeArtistic('HAMBURG.COM')
end.