Browse Source

+ sysutils.sleep for gba
+ dummy sysutils.getlastoserror for gba

git-svn-id: trunk@19975 -

florian 13 năm trước cách đây
mục cha
commit
77f1092ca0
1 tập tin đã thay đổi với 29 bổ sung2 xóa
  1. 29 2
      rtl/gba/sysutils.pp

+ 29 - 2
rtl/gba/sysutils.pp

@@ -5,7 +5,7 @@
 
     Sysutils unit for Gameboy Advance.
     This unit is based on the MorphOS one and is adapted for Gameboy Advance
-    simply by stripping out all stuff inside funcs and procs. 
+    simply by stripping out all stuff inside funcs and procs.
     Copyright (c) 2006 by Francesco Lombardi
 
     Based on Amiga version by Carl Eric Codere, and other
@@ -29,13 +29,16 @@ interface
 { force ansistrings }
 {$H+}
 
+{$DEFINE HAS_SLEEP}
+{$DEFINE HAS_OSERROR}
+
 { Include platform independent interface part }
 {$i sysutilh.inc}
 
 
 implementation
 
-uses 
+uses
   dos, sysconst;
 
 { Include platform independent implementation part }
@@ -234,6 +237,30 @@ begin
 end;
 
 
+Procedure Sleep(Milliseconds : Cardinal);
+var
+  i,j : Cardinal;
+  calib : Cardinal;
+begin
+{$warning no idea if this calibration value is correct (FK) }
+{ I estimated it roughly on the CPU clock of 16 MHz and 1+3 clock cycles for the loop }
+  calib:=4000000;
+  for i:=1 to Milliseconds do
+    asm
+      ldr r0,calib
+    .L1:
+      sub r0,r0,#1
+      bne .L1
+    end;
+end;
+
+Function GetLastOSError : Integer;
+
+begin
+  Result:=-1;
+end;
+
+
 {****************************************************************************
                               Locale Functions
 ****************************************************************************}