home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / romfnt15.zip / CUSTCHIP.PAS next >
Pascal/Delphi Source File  |  1993-03-03  |  2KB  |  52 lines

  1. program CustChip;
  2. { A shell to provide custom chipset support. This code will make the
  3.   chipset's shadow ram writable before running ROMFNT }
  4.  
  5. { Use this program if your chipset is not directly supported by ROMFNT, but
  6.   you know the registers and bits to set to control the read only status
  7.   bits in the chipset configuration registers. This information is usually
  8.   found in the technical specifications for the chipset}
  9.  
  10. { by Heinz-Dieter Sander 100031,1457 and Tim Godfrey 72617,2125 }
  11.  
  12. {$M 16384,0,65536} {leave some memory for ROMFNT to run in}
  13. uses crt, dos;
  14.  
  15. {Customize these values for your specific chipset - These are for UMC 481}
  16. const idxport :word = $22; {index port - write register value pointer here}
  17.       umcdata :word = $24; {data port - read/write data after writing index}
  18.  
  19. procedure setbit (index, mask, val: byte);
  20. var x:byte;
  21.  
  22. begin
  23.   port [idxport] := index;
  24.   x := (port [umcdata] and not mask) or val;
  25.  
  26.   port [idxport] := index;
  27.   port [umcdata] := x;
  28. end;
  29.  
  30. var exec_params :string;
  31.     pcnt :integer;
  32.  
  33. begin
  34.   if paramcount > 0 then
  35.    begin
  36.     exec_params := ' -Z '; (* -Z is special option for use w/ ROMFNT *)
  37.     for pcnt := 2 to paramcount do
  38.       exec_params := exec_params+' '+paramstr(pcnt); {pass thru param string}
  39.  
  40. {Customize these values for your specific chipset - These are for UMC 481}
  41.        { index, mask,value}
  42.     setbit($9E, $03, $00); (* set shadow ram in C000-C7FF to read/write *)
  43.     setbit($9C, $03, $00); (* set shadow ram in C000-C7FF to not cacheable *)
  44.  
  45.     exec(paramstr(1), exec_params);
  46.  
  47. {Customize these values for your specific chipset - These are for UMC 481}
  48.     setbit($9E, $03, $03); (* set shadow ram in C000-C7FF to readonly *)
  49.     setbit($9C, $03, $03); (* set shadow ram in C000-C7FF to cacheable again *)
  50.   end;
  51. end.
  52.