home *** CD-ROM | disk | FTP | other *** search
- program logopat;
-
- { LOGOPAT by Erich Neuwirth }
- { Changes IBM LOGO so that it can run on EGA, VGA and MCGA cards. }
- { It also removes a bug which only showed up on 386 machines. }
- { Just runb it will create LOGOVGA.COM, which VGA cards and 286 machines. }
-
- { Developed through some hints found on the Compuserve LOGOFORUM }
-
- { (C) 1990 Erich Neuwirth }
- { BITNET (EARN): A4422DAB@AWIUNI11 }
- { INTERNET: a4422dab@Helios.EDVZ.UniVie.AC.AT }
- { Institute for Statistics and Computer Science }
- { UNIVERSITY OF VIENNA, UNIVERSITAETSSTR. 5/9, A-1010 VIENNA, AUSTRIA }
-
- type string8 = string[8];
-
- type registers = record
- ax,bx,cx,dx,bp,si,di,ds,es,flags : integer
- end;
-
- const hexval : array[0..15] of char = ('0','1','2','3','4','5','6',
- '7','8','9','A','B','C','D','E','F');
-
-
- const pat1 : array[1..4] of byte = ($E9,$00,$00,$90);
-
-
- const pat2 : array[1..12] of byte =
- ($50,$B4,$12,$B3,$10,$CD,$10,$80,$FB,$10,$58,$74);
-
- var i : integer;
- logofile, logoout : file of byte;
- b,alo,ahi,slo,shi : byte;
- size,size1,size2 : integer;
- filnam : string8;
-
- function exists(var filname:string8): boolean;
- var fil : file;
- begin
- assign(fil,filname);
- {$I-}
- reset(fil);
- {$I+}
- if ioresult<>0 then exists:=false else exists:=true;
- end;
-
- procedure getaddress;
- var regvars: registers;
- segaddr, offset,
- i : integer;
- begin
- regvars.ax:=$1130;
- regvars.bx:=$0300;
- Intr($10,regvars);
- segaddr:=regvars.es;
- offset:=regvars.bp;
- shi:=hi(segaddr);
- slo:=lo(segaddr);
- ahi:=hi(offset);
- alo:=lo(offset);
- write('BIOS fonttable at address ');
- writeln(
- hexval[shi div 16],
- hexval[shi mod 16],
- hexval[slo div 16],
- hexval[slo mod 16],':',
- hexval[ahi div 16],
- hexval[ahi mod 16],
- hexval[alo div 16],
- hexval[alo mod 16]);
- end;
-
- begin
- textcolor(7);
- textbackground(0);
- write('LOGOPAT ');
- writeln(' (C) 1990 Erich Neuwirth');
- writeln('changes LOGO.COM (IBM LOGO) und creates LOGOVGA.COM.');
- writeln;
- writeln('Should only be applied to LOGO.COM dated 10/1/1983');
- writeln('with file length 59120 byte.');
- writeln;
- writeln('The new program runs on machines with a 386');
- writeln('and with EGA or VGA.');
- writeln('The changes have to be applied separately ');
- writeln('for different EGA and VGA cards.');
- writeln('The new program will NOT run on machines with CGA.');
- writeln;
- filnam:='LOGO.COM';
- if (not exists(filnam)) then
- begin
- writeln('File LOGO.COM not available,');
- writeln('therefore it cannot be changed.');
- halt;
- end;
-
- getaddress;
- assign(logofile,'LOGO.COM');
- assign(logoout,'LOGOVGA.COM');
- reset(logofile);
- rewrite(logoout);
-
- size:=filesize(logofile);
- size1:=lo(size);
- size2:=hi(size);
- for i:=1 to $e6b do begin read(logofile,b); write(logoout,b) end;
- read(logofile,b);
- write(logoout,slo);
- read(logofile,b);
- write(logoout,shi);
- for i:=1 to 3 do begin read(logofile,b); write(logoout,b) end;
- read(logofile,b);
- write(logoout,alo);
- read(logofile,b);
- write(logoout,ahi);
- for i:=1 to ($794b-7-$e6b) do begin read(logofile,b); write(logoout,b) end;
- for i:=1 to 4 do begin read(logofile,b); write(logoout,pat1[i]) end;
- writeln('Adapted for 386.');
-
- for i:=1 to ($4c67 - $2af) do begin read(logofile,b); write(logoout,b) end;
- read(logofile,b);
- write(logoout,slo);
- read(logofile,b);
- write(logoout,shi);
- for i:=1 to 12 do begin read(logofile,b); write(logoout,b) end;
- read(logofile,b);
- write(logoout,alo);
- read(logofile,b);
- write(logoout,ahi);
- { for i:=1 to $4c67 do begin read(logofile,b); write(logoout,b) end;
- }
- for i:=1 to ($2af-16) do begin read(logofile,b); write(logoout,b) end;
- for i:=1 to 12 do begin read(logofile,b); write(logoout,pat2[i]) end;
- writeln('Adapted for VGA.');
-
- for i:=1 to $212e do begin read(logofile,b); write(logoout,b) end;
-
-
- close(logofile);
- flush(logoout);
- close(logoout);
- writeln;
- end.
-