Procedure InitGraph;Assembler;
  Asm
    mov  ax,13h
    int  10h
  End;

Procedure CloseGraph;Assembler;
  Asm
    mov  ax,3
    int  10h
  End;

CONST
  MinX : word = 0;
  MinY : word = 0;
  MaxX : word = 319;
  MaxY : word = 199;

VAR
  Palette : Array[0..255]of record
            R,G,B: byte;
            end;

Procedure SetPalette; Near;
Var
  x : byte;
Begin
  Port[$3C8] := 0;
  For x := 0 to 255 do
    Begin
      Port[$3C9] := Palette[x].R;
      Port[$3C9] := Palette[x].G;
      Port[$3C9] := Palette[x].B;
    End;
End;

Procedure SetRGBpalette(C,R,G,B:byte);
Begin
  Palette[C].R:=R;
  Palette[C].G:=G;
  Palette[C].B:=B;
End;
{****************************************************************************}

Procedure GeneratePaletteFire;
Var
  x : byte;
Begin
  for x := 0 to 255 do
    Begin
      Palette[x].R := (x * 63) Shr 8;
      Palette[x].G := (x * 22) Shr 8;
      Palette[x].B := 0;
    End;
End;

Procedure GeneratePaletteGreen;
Var
  x : byte;
Begin
  for x := 0 to 255 do
    Begin
      Palette[x].R := 0;
      Palette[x].G := (x * 63) Shr 8;
      Palette[x].B := 0;
    End;
End;
