sysutils.pp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 by Karoly Balogh
  4. Sysutils unit for Gameboy Advance.
  5. This unit is based on the MorphOS one and is adapted for Gameboy Advance
  6. simply by stripping out all stuff inside funcs and procs.
  7. Copyright (c) 2006 by Francesco Lombardi
  8. Based on Amiga version by Carl Eric Codere, and other
  9. parts of the RTL
  10. See the file COPYING.FPC, included in this distribution,
  11. for details about the copyright.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. **********************************************************************}
  16. unit sysutils;
  17. interface
  18. {$MODE objfpc}
  19. {$MODESWITCH OUT}
  20. { force ansistrings }
  21. {$H+}
  22. {$DEFINE HAS_SLEEP}
  23. {$DEFINE HAS_OSERROR}
  24. { Include platform independent interface part }
  25. {$i sysutilh.inc}
  26. implementation
  27. uses
  28. dos, sysconst;
  29. { Include platform independent implementation part }
  30. {$i sysutils.inc}
  31. {****************************************************************************
  32. File Functions
  33. ****************************************************************************}
  34. function FileOpen(const FileName: string; Mode: Integer): LongInt;
  35. begin
  36. result := -1;
  37. end;
  38. function FileGetDate(Handle: LongInt) : LongInt;
  39. begin
  40. result := -1;
  41. end;
  42. function FileSetDate(Handle, Age: LongInt) : LongInt;
  43. begin
  44. result := -1;
  45. end;
  46. function FileCreate(const FileName: string) : LongInt;
  47. begin
  48. result := -1;
  49. end;
  50. function FileCreate(const FileName: string; Rights: integer): LongInt;
  51. begin
  52. result := -1;
  53. end;
  54. function FileCreate(const FileName: string; ShareMode: integer; rights : integer): LongInt;
  55. begin
  56. result := -1;
  57. end;
  58. function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;
  59. begin
  60. result := -1;
  61. end;
  62. function FileWrite(Handle: LongInt; const Buffer; Count: LongInt): LongInt;
  63. begin
  64. result := -1;
  65. end;
  66. function FileSeek(Handle, FOffset, Origin: LongInt) : LongInt;
  67. begin
  68. result := -1;
  69. end;
  70. function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;
  71. begin
  72. result := -1;
  73. end;
  74. procedure FileClose(Handle: LongInt);
  75. begin
  76. end;
  77. function FileTruncate(Handle: THandle; Size: Int64): Boolean;
  78. begin
  79. result := false;
  80. end;
  81. function DeleteFile(const FileName: string) : Boolean;
  82. begin
  83. result := false;
  84. end;
  85. function RenameFile(const OldName, NewName: string): Boolean;
  86. begin
  87. result := false;
  88. end;
  89. (****** end of non portable routines ******)
  90. Function FileAge (Const FileName : String): Longint;
  91. begin
  92. result := -1;
  93. end;
  94. Function FileExists (Const FileName : String) : Boolean;
  95. Begin
  96. result := false;
  97. end;
  98. Function FindFirst (Const Path : String; Attr : Longint; Out Rslt : TSearchRec) : Longint;
  99. begin
  100. result := -1;
  101. end;
  102. Function FindNext (Var Rslt : TSearchRec) : Longint;
  103. begin
  104. result := -1;
  105. end;
  106. Procedure FindClose (Var F : TSearchrec);
  107. begin
  108. end;
  109. Function FileGetAttr (Const FileName : String) : Longint;
  110. begin
  111. result := -1;
  112. end;
  113. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  114. begin
  115. result := -1;
  116. end;
  117. {****************************************************************************
  118. Disk Functions
  119. ****************************************************************************}
  120. Procedure AddDisk(const path:string);
  121. begin
  122. end;
  123. Function DiskFree(Drive: Byte): int64;
  124. Begin
  125. result := -1;
  126. End;
  127. Function DiskSize(Drive: Byte): int64;
  128. Begin
  129. result := -1;
  130. End;
  131. Function GetCurrentDir : String;
  132. begin
  133. result := '';
  134. end;
  135. Function SetCurrentDir (Const NewDir : String) : Boolean;
  136. begin
  137. result := false;
  138. end;
  139. Function CreateDir (Const NewDir : String) : Boolean;
  140. begin
  141. result := false;
  142. end;
  143. Function RemoveDir (Const Dir : String) : Boolean;
  144. begin
  145. result := false;
  146. end;
  147. function DirectoryExists(const Directory: string): Boolean;
  148. begin
  149. result := false;
  150. end;
  151. {****************************************************************************
  152. Misc Functions
  153. ****************************************************************************}
  154. procedure sysBeep;
  155. begin
  156. end;
  157. Procedure Sleep(Milliseconds : Cardinal);
  158. var
  159. i,j : Cardinal;
  160. calib : Cardinal;
  161. begin
  162. {$warning no idea if this calibration value is correct (FK) }
  163. { I estimated it roughly on the CPU clock of 16 MHz and 1+3 clock cycles for the loop }
  164. calib:=4000000;
  165. for i:=1 to Milliseconds do
  166. asm
  167. ldr r0,calib
  168. .L1:
  169. sub r0,r0,#1
  170. bne .L1
  171. end;
  172. end;
  173. Function GetLastOSError : Integer;
  174. begin
  175. Result:=-1;
  176. end;
  177. {****************************************************************************
  178. Locale Functions
  179. ****************************************************************************}
  180. Procedure GetLocalTime(var SystemTime: TSystemTime);
  181. begin
  182. end ;
  183. function SysErrorMessage(ErrorCode: Integer): String;
  184. begin
  185. { Result:=StrError(ErrorCode);}
  186. result := '';
  187. end;
  188. {****************************************************************************
  189. OS utility functions
  190. ****************************************************************************}
  191. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  192. begin
  193. result := '';
  194. end;
  195. Function GetEnvironmentVariableCount : Integer;
  196. begin
  197. result := -1;
  198. end;
  199. Function GetEnvironmentString(Index : Integer) : String;
  200. begin
  201. result := '';
  202. end;
  203. function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString;Flags:TExecuteFlags=[]): integer;
  204. begin
  205. result := -1;
  206. end;
  207. function ExecuteProcess (const Path: AnsiString;
  208. const ComLine: array of AnsiString;Flags:TExecuteFlags=[]): integer;
  209. begin
  210. result := -1;
  211. end;
  212. {****************************************************************************
  213. Initialization code
  214. ****************************************************************************}
  215. Initialization
  216. InitExceptions;
  217. Finalization
  218. DoneExceptions;
  219. end.