system.pp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2006 by Francesco Lombardi.
  4. System unit for Gameboy Advance
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit System;
  12. interface
  13. {$define __ARM__} (* For future usage! *)
  14. {$define FPC_IS_SYSTEM}
  15. {$i gbabiosh.inc}
  16. {$i systemh.inc}
  17. {$define fpc_softfpu_interface}
  18. {$i softfpu.pp}
  19. {$undef fpc_softfpu_interface}
  20. const
  21. LineEnding = #10;
  22. LFNSupport = true;
  23. CtrlZMarksEOF: boolean = false;
  24. DirectorySeparator = '/';
  25. DriveSeparator = ':';
  26. PathSeparator = ';';
  27. FileNameCaseSensitive = false;
  28. maxExitCode = 255;
  29. MaxPathLen = 255;
  30. AllFilesMask = '*';
  31. sLineBreak : string[1] = LineEnding;
  32. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
  33. const
  34. UnusedHandle = $ffff;
  35. StdInputHandle = 0;
  36. StdOutputHandle = 1;
  37. StdErrorHandle = $ffff;
  38. var
  39. argc: LongInt = 0;
  40. argv: PPChar;
  41. envp: PPChar;
  42. errno: integer;
  43. implementation
  44. {$define fpc_softfpu_implementation}
  45. {$i softfpu.pp}
  46. {$undef fpc_softfpu_implementation}
  47. { we get these functions and types from the softfpu code }
  48. {$define FPC_SYSTEM_HAS_float64}
  49. {$define FPC_SYSTEM_HAS_float32}
  50. {$define FPC_SYSTEM_HAS_flag}
  51. {$define FPC_SYSTEM_HAS_extractFloat64Frac0}
  52. {$define FPC_SYSTEM_HAS_extractFloat64Frac1}
  53. {$define FPC_SYSTEM_HAS_extractFloat64Exp}
  54. {$define FPC_SYSTEM_HAS_extractFloat64Sign}
  55. {$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
  56. {$define FPC_SYSTEM_HAS_extractFloat32Exp}
  57. {$define FPC_SYSTEM_HAS_extractFloat32Sign}
  58. {$i system.inc}
  59. {$i gbabios.inc}
  60. {$ifdef FPC_HAS_FEATURE_PROCESSES}
  61. function GetProcessID: SizeUInt;
  62. begin
  63. end;
  64. {$endif}
  65. {*****************************************************************************
  66. Misc. System Dependent Functions
  67. *****************************************************************************}
  68. procedure System_exit;
  69. begin
  70. end;
  71. {*****************************************************************************
  72. ParamStr/Randomize
  73. *****************************************************************************}
  74. { number of args }
  75. function paramcount : longint;
  76. begin
  77. paramcount:=0;
  78. end;
  79. { argument number l }
  80. function paramstr(l : longint) : string;
  81. begin
  82. paramstr:='';
  83. end;
  84. { set randseed to a new pseudo random value }
  85. procedure randomize;
  86. begin
  87. end;
  88. {$ifdef FPC_HAS_FEATURE_TEXTIO}
  89. procedure SysInitStdIO;
  90. begin
  91. OpenStdIO(Input,fmInput,StdInputHandle);
  92. OpenStdIO(Output,fmOutput,StdOutputHandle);
  93. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  94. end;
  95. {$endif}
  96. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  97. begin
  98. result := stklen;
  99. end;
  100. begin
  101. StackLength := CheckInitialStkLen(InitialStkLen);
  102. StackBottom := StackTop - StackLength;
  103. { OS specific startup }
  104. { Setup heap }
  105. InitHeap;
  106. SysInitExceptions;
  107. { Setup stdin, stdout and stderr }
  108. SysInitStdIO;
  109. { Reset IO Error }
  110. InOutRes:=0;
  111. initvariantmanager;
  112. end.