home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / htscreen / htmix / vgacols / loadvga.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1992-07-11  |  2.0 KB  |  51 lines

  1. program LoadVGA;
  2.  
  3. {┌──────────────────────────────── INFO ────────────────────────────────────┐}
  4. {│ File    : LOADVGA.PAS                                                    │}
  5. {│ Author  : Harald Thunem                                                  │}
  6. {│ Purpose : Load a VGA palette from file.                                  │}
  7. {│ Updated : July 11 1992                                                   │}
  8. {└──────────────────────────────────────────────────────────────────────────┘}
  9.  
  10. {────────────────────────── Compiler directives ─────────────────────────────}
  11. {$A+   Word align data                                                       }
  12. {$B-   Short-circuit Boolean expression evaluation                           }
  13. {$E-   Disable linking with 8087-emulating run-time library                  }
  14. {$G+   Enable 80286 code generation                                          }
  15. {$R-   Disable generation of range-checking code                             }
  16. {$S-   Disable generation of stack-overflow checking code                    }
  17. {$V-   String variable checking                                              }
  18. {$X-   Disable Turbo Pascal's extended syntax                                }
  19. {$N+   80x87 code generation                                                 }
  20. {$D-   Disable generation of debug information                               }
  21. {────────────────────────────────────────────────────────────────────────────}
  22.  
  23. uses  Dos,
  24.       Strings,
  25.       Colors;
  26.  
  27. var   Path : PathStr;
  28.       Dir  : DirStr;
  29.       Name : NameStr;
  30.       Ext  : ExtStr;
  31.  
  32. begin
  33.   WriteLn('Load VGA Palette v2.0');
  34.   WriteLn;
  35.   if ParamCount<>1 then
  36.   begin
  37.     WriteLn('Wrong number of parameters.');
  38.     WriteLn('Usage : LOADVGA filename[.ext]');
  39.     Halt(1);
  40.   end;
  41.   Path := UpcaseStr(ParamStr(1));
  42.   FSplit(Path,Dir,Name,Ext);
  43.   if Ext='' then
  44.     Path := Dir+Name+'.VGA';
  45.   if ReadDACFile(Path) then
  46.   begin
  47.     SetColorList;
  48.     WriteLn('Palette ',Name,' loaded.');
  49.   end
  50.   else WriteLn('Error loading palette file ',Path);
  51. end.