home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / LOGOPAT1.ZIP / LOGOPAT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-01-27  |  3.9 KB  |  146 lines

  1. {$R-}    {Range checking off}
  2. {$B+}    {Boolean complete evaluation on}
  3. {$S+}    {Stack checking on}
  4. {$I+}    {I/O checking on}
  5. {$N-}    {No numeric coprocessor}
  6. {$M 65500,16384,655360} {Turbo 3 default stack and heap}
  7.  
  8. program logopat;
  9.  
  10.  
  11. Uses
  12.   Crt, {Unit found in TURBO.TPL}
  13.   Dos; {Unit found in TURBO.TPL}
  14.  
  15. type string8 = string[8];
  16.  
  17. { type regs = Registers; }
  18.  
  19. const hexval : array[0..15] of char = ('0','1','2','3','4','5','6',
  20.              '7','8','9','A','B','C','D','E','F');
  21.  
  22.  
  23. const pat1 : array[1..4] of byte = ($E9,$00,$00,$90);
  24.  
  25.  
  26. const pat2 : array[1..12] of byte =
  27.       ($50,$B4,$12,$B3,$10,$CD,$10,$80,$FB,$10,$58,$74);
  28.  
  29.    var i : integer;
  30.    logofile, logoout : file of byte;
  31.    b,alo,ahi,slo,shi : byte;
  32.    size,size1,size2 : integer;
  33.    filnam : string8;
  34.  
  35. function exists(var filname:string8): boolean;
  36. var fil : file;
  37. begin
  38.      assign(fil,filname);
  39.      {$I-}
  40.      reset(fil);
  41.      {$I+}
  42.      if ioresult<>0 then exists:=false else exists:=true;
  43. end;
  44.  
  45. procedure getaddress;
  46. var      regvars:   registers;
  47.          segaddr, offset,
  48.          i : integer;
  49. begin
  50.      regvars.ax:=$1130;
  51.      regvars.bx:=$0300;
  52.      Intr($10,regvars);
  53.      segaddr:=regvars.es;
  54.      offset:=regvars.bp;
  55.      shi:=hi(segaddr);
  56.      slo:=lo(segaddr);
  57.      ahi:=hi(offset);
  58.      alo:=lo(offset);
  59.      write('BIOS fonttable at address ');
  60.      writeln(
  61.              hexval[shi div 16],
  62.              hexval[shi mod 16],
  63.              hexval[slo div 16],
  64.              hexval[slo mod 16],':',
  65.              hexval[ahi div 16],
  66.              hexval[ahi mod 16],
  67.              hexval[alo div 16],
  68.              hexval[alo mod 16]);
  69. end;
  70.  
  71.    begin
  72.    textcolor(7);
  73.    textbackground(0);
  74.    write('LOGOPAT ');
  75.    writeln('                                                (C) 1990 Erich Neuwirth');
  76.    writeln('changes LOGO.COM (IBM LOGO) und creates LOGOVGA.COM.');
  77.    writeln;
  78.    writeln('Should only be applied to LOGO.COM dated 10/1/1983');
  79.    writeln('with file length 59120 byte.');
  80.    writeln;
  81.    writeln('The new program runs on machines with a 386');
  82.    writeln('and with EGA or VGA.');
  83.    writeln('The changes have to be applied separately ');
  84.    writeln('for different EGA and VGA cards.');
  85.    writeln('The new program will NOT run on machines with CGA.');
  86.    writeln;
  87.    filnam:='LOGO.COM';
  88.    if (not exists(filnam)) then
  89.    begin
  90.       writeln('File LOGO.COM not available,');
  91.       writeln('therefore it cannot be changed.');
  92.       halt;
  93.    end;
  94.  
  95.    getaddress;
  96.    assign(logofile,'LOGO.COM');
  97.    assign(logoout,'LOGOVGA.COM');
  98.    reset(logofile);
  99.    rewrite(logoout);
  100.  
  101.    size:=filesize(logofile);
  102.    size1:=lo(size);
  103.    size2:=hi(size);
  104.    for i:=1 to $e6b do 
  105.       begin read(logofile,b); write(logoout,b) end;
  106.    read(logofile,b);
  107.    write(logoout,slo);
  108.    read(logofile,b);
  109.    write(logoout,shi);
  110.    for i:=1 to 3 do begin read(logofile,b); write(logoout,b) end;
  111.    read(logofile,b);
  112.    write(logoout,alo);
  113.    read(logofile,b);
  114.    write(logoout,ahi);
  115.    for i:=1 to ($794b-7-$e6b) do 
  116.       begin read(logofile,b); write(logoout,b) end;
  117.    for i:=1 to 4 do 
  118.       begin read(logofile,b); write(logoout,pat1[i]) end;
  119.    writeln('Adapted for 386.');
  120.  
  121.    for i:=1 to ($4c67 - $2af) do 
  122.       begin read(logofile,b); write(logoout,b) end;
  123.    read(logofile,b);
  124.    write(logoout,slo);
  125.    read(logofile,b);
  126.    write(logoout,shi);
  127.    for i:=1 to 12 do 
  128.       begin read(logofile,b); write(logoout,b) end;
  129.    read(logofile,b);
  130.    write(logoout,alo);
  131.    read(logofile,b);
  132.    write(logoout,ahi);
  133.    for i:=1 to ($2af-16) do 
  134.       begin read(logofile,b); write(logoout,b) end;
  135.    for i:=1 to 12 do begin 
  136.       read(logofile,b); write(logoout,pat2[i]) end;
  137.    writeln('Adapted for VGA.');
  138.    for i:=1 to $212e do 
  139.       begin read(logofile,b); write(logoout,b) end;
  140.  
  141.  
  142.    close(logofile);
  143.    close(logoout);
  144.    writeln;
  145.    end.
  146.