procedure thermo(tmp:byte); forward;

procedure Init_Tisch1;
  var t : byte;
begin
  for t:=0 to 255 do set_rgb_color(t,pal[t].r,pal[t].g,pal[t].b );
  {}
  Kurven := 0;
  Lichter1[250] := 0;  Lichter1[251] := 0;  Lichter1[252] := 0;
  Lichter2[247] := 0;  Lichter2[248] := 0;  Lichter2[249] := 0;
  Lichter3[244] := 0;  Lichter3[245] := 0;  Lichter3[246] := 0;
  Licht4   := 0;
  PushUp := true;
  Bonus    := 0;
  MAXFarbe := 234; {235-255}
  temp := 3;
  thermo(temp);
  PCSspe[1] := 0;
  PCSspe[2] := 0;
  PCSspe[3] := 0;
  special := 0;
  BumpCount := 0;
end;

{z :-> 0-6 }
procedure thermo(tmp : byte);
  var z : byte;
begin
  for z := 1 to 6 do
    if z <= tmp then begin
          port[$3c8] := 55+z;
          port[$3c9] := 0;port[$3c9] := 47; port[$3c9] := 47;
        end else begin
            port[$3c8] := 55+z;
            port[$3c9] := 50; port[$3c9] := 0; port[$3c9] := 0;
          end;
  if temp = 0 then begin
      display('ATTENTION:');
      repeat led_anzeige; until led_status = 0;
      delay(2000);
      display('TEMP. OVERHEAT!');
      repeat led_anzeige; until led_status = 0;
      delay(2000);
      display('TURNED FIRE OFF!');
      repeat led_anzeige; until led_status = 0;
      delay(2000);
      PushUp := false;
      set_rgb_color(40,10,10,60);
      set_rgb_color(41,10,10,50);
      set_rgb_color(42,10,10,40);
      set_rgb_color(43,10,10,30);
    end;
end;

procedure flameflacker;
begin
  port[$3c8] := 40;
  port[$3c9] := 45+random(15);
  port[$3c9] := 0;
  port[$3c9] := 0;

  port[$3c8] := 41;
  port[$3c9] := 45+random(15);
  port[$3c9] := 8+random(15);
  port[$3c9] := 0;

  port[$3c8] := 42;
  port[$3c9] := 45+random(15);
  port[$3c9] := 22+random(15);
  port[$3c9] := 0;

  port[$3c8] := 43;
  port[$3c9] := 45+random(15);
  port[$3c9] := 38+random(13);
  port[$3c9] := 0;

end;



