{***************************************************************
  Проект игры Planet "MK"

  http://www.megainformatic.boom.ru
  http://www.megainformaticsite.pochta.ru

  26/07/2007, 15/10/2007, 14/12/2007
  
****************************************************************}
program pmk;

uses
  Windows,
  Main in 'Main.pas';

{$R pmk.res}

function MungeFPCW(out pwOldCW: Word): Boolean;
var
  wTemp, wSave: Word;
begin
  Result:= False;

  asm
    fstcw wSave
  end;

  if ((wSave and $300) <> 0) or     // Not single mode
     ($3f <> (wSave and $3f)) or    // Exceptions enabled
     ((wSave and $C00) <> 0) then   // Not round to nearest mode
  begin
    asm
        mov ax, wSave
        and ax, not 300h    // single mode
        or  ax, 3fh         // disable all exceptions
        and ax, not 0C00h   // round to nearest mode
        mov wTemp, ax
        fldcw   wTemp
    end;
    Result:= True;
  end;
  pwOldCW:= wSave;
end;

var
  Old80087: Word;

  hPrevInst: LongWord;

begin
  MungeFPCW(Old80087); //clear the BUG (by Alexey Barkovoy) from SkinnedMesh Sample
                       //unit D3DGUI.pas
                       //procedure SFrame.SetTime(fGlobalTime: Single);
                       //remaked line else Result:= B * Frac(A / B); // Floating exception rased in D3D fcomp mode
                       //by Alexey Barkovoy Delphi Converter of SkinnedMesh sample

  hPrevInst := 0;
{$WARN SYMBOL_PLATFORM OFF}
  ExitCode := WinMain(HInstance, hPrevInst, CmdLine, CmdShow);
{$WARN SYMBOL_PLATFORM ON}
end.
