system.pp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. ExtensionSeparator = '.';
  27. PathSeparator = ';';
  28. AllowDirectorySeparators : set of char = ['\','/'];
  29. AllowDriveSeparators : set of char = [':'];
  30. FileNameCaseSensitive = false;
  31. maxExitCode = 255;
  32. MaxPathLen = 255;
  33. AllFilesMask = '*';
  34. sLineBreak : string[1] = LineEnding;
  35. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
  36. const
  37. UnusedHandle = $ffff;
  38. StdInputHandle = 0;
  39. StdOutputHandle = 1;
  40. StdErrorHandle = $ffff;
  41. var
  42. argc: LongInt = 0;
  43. argv: PPChar;
  44. envp: PPChar;
  45. errno: integer;
  46. implementation
  47. {$define fpc_softfpu_implementation}
  48. {$i softfpu.pp}
  49. {$undef fpc_softfpu_implementation}
  50. { we get these functions and types from the softfpu code }
  51. {$define FPC_SYSTEM_HAS_float64}
  52. {$define FPC_SYSTEM_HAS_float32}
  53. {$define FPC_SYSTEM_HAS_flag}
  54. {$define FPC_SYSTEM_HAS_extractFloat64Frac0}
  55. {$define FPC_SYSTEM_HAS_extractFloat64Frac1}
  56. {$define FPC_SYSTEM_HAS_extractFloat64Exp}
  57. {$define FPC_SYSTEM_HAS_extractFloat64Sign}
  58. {$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
  59. {$define FPC_SYSTEM_HAS_extractFloat32Exp}
  60. {$define FPC_SYSTEM_HAS_extractFloat32Sign}
  61. {$i system.inc}
  62. {$i gbabios.inc}
  63. {$ifdef FPC_HAS_FEATURE_PROCESSES}
  64. function GetProcessID: SizeUInt;
  65. begin
  66. end;
  67. {$endif}
  68. {*****************************************************************************
  69. Misc. System Dependent Functions
  70. *****************************************************************************}
  71. procedure System_exit;
  72. begin
  73. end;
  74. {*****************************************************************************
  75. ParamStr/Randomize
  76. *****************************************************************************}
  77. { number of args }
  78. function paramcount : longint;
  79. begin
  80. paramcount:=0;
  81. end;
  82. { argument number l }
  83. function paramstr(l : longint) : string;
  84. begin
  85. paramstr:='';
  86. end;
  87. { set randseed to a new pseudo random value }
  88. procedure randomize;
  89. begin
  90. end;
  91. {$ifdef FPC_HAS_FEATURE_TEXTIO}
  92. procedure SysInitStdIO;
  93. begin
  94. OpenStdIO(Input,fmInput,StdInputHandle);
  95. OpenStdIO(Output,fmOutput,StdOutputHandle);
  96. OpenStdIO(StdOut,fmOutput,StdOutputHandle);
  97. end;
  98. {$endif}
  99. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  100. begin
  101. result := stklen;
  102. end;
  103. begin
  104. StackLength := CheckInitialStkLen(InitialStkLen);
  105. StackBottom := StackTop - StackLength;
  106. { OS specific startup }
  107. { Setup heap }
  108. InitHeap;
  109. SysInitExceptions;
  110. { Setup stdin, stdout and stderr }
  111. SysInitStdIO;
  112. { Reset IO Error }
  113. InOutRes:=0;
  114. { Arguments }
  115. InitSystemThreads;
  116. initvariantmanager;
  117. end.