

program BigCharacters;

   { writes 4 chars per line in 40 col, 8 chars per line in 80 col }
   { maximum of 3 lines of chars in either mode (3 x 8 = 24 lines) }
   { assuming text starts at x,y = 1,9                             }

type  str40 = string[40];  ScreenType = array[1..16384] of byte;

var   i : integer; s : str40;
      Screen : ScreenType absolute $B800:$0000;
      Graphics : boolean;

      Colr,CharNum,Width : integer;             { global variables   }
      StructChar : char;                        { passed to BigChars }
      Wait       : char;

{--------------------------------------------------------------------}
procedure BigChars (ch : char);

const  PelSeg   = $F000; PelStart = $FA6E;

var    x,y,i,j    : integer;
       Offset     : integer;
       WorkByte   : byte;

begin
      if whereX >= Width then gotoxy (4,whereY+8);

      x := whereX; y := whereY; gotoxy (x,y-8);

      Offset := PelStart + (ord(ch) * 8);

      for i := 0 to 7 do
         begin
              WorkByte := Mem [PelSeg:Offset+i];
              for j := 0 to 7 do
                 begin
                       if WorkByte and $80 <> 0 then write (StructChar)
                                                else write (' ');
                       WorkByte := WorkByte shl 1;
                 end;
              gotoxy (x,whereY+1);
         end;
      gotoxy (x+8,y);       { with x+8 you can get 9 chars per line }

end;
{--------------------------------------------------------------------}

BEGIN
      UsrOutPtr := Ofs (BigChars);

      { use only one of the following four lines }

{     TextMode (c80); TextBackGround (1);  Width := 73; Graphics := false;  }
{     HiRes;          HiResColor (1);      Width := 73; Graphics :=  true;  }
{     TextMode (c40); TextBackGround (1);  Width := 33; Graphics := false;  }
      GraphColorMode; GraphBackGround (0); Width := 33; Graphics :=  true;

      if not Graphics then clrscr;
      gotoxy (1,2);
      if Width = 73 then
         write ('Try This One   : HELLO    THERE    WORLD')
      else
         write ('Try This One   : GOODDAY!');
      gotoxy (1,4);
      write ('Enter a String : ');
      buflen := 24; read (s);
      gotoxy (1,6);
      if Graphics then
         write ('Enter TextColor (1-3)  : ')
      else
         write ('Enter TextColor (0-15) : ');
      buflen := 2; read (Colr);
      gotoxy (1,8);
      write ('Enter Character Number : ');
      buflen := 3; read (CharNum);
      StructChar := chr (CharNum);

      if Graphics then FillChar (Screen,16384,0) else clrscr;

      gotoxy (4,9); TextColor (Colr);
      for i := 1 to Length (s) do write (Usr,s[i]);

      gotoxy (4,24); write ('Press Any Key ');
      read (Kbd,Wait);

END.
