Browse Source

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

git-svn-id: trunk@19975 -

florian 13 years ago
parent
commit
77f1092ca0
1 changed files with 29 additions and 2 deletions
  1. 29 2
      rtl/gba/sysutils.pp

+ 29 - 2
rtl/gba/sysutils.pp

@@ -5,7 +5,7 @@
 
 
     Sysutils unit for Gameboy Advance.
     Sysutils unit for Gameboy Advance.
     This unit is based on the MorphOS one and is adapted 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
     Copyright (c) 2006 by Francesco Lombardi
 
 
     Based on Amiga version by Carl Eric Codere, and other
     Based on Amiga version by Carl Eric Codere, and other
@@ -29,13 +29,16 @@ interface
 { force ansistrings }
 { force ansistrings }
 {$H+}
 {$H+}
 
 
+{$DEFINE HAS_SLEEP}
+{$DEFINE HAS_OSERROR}
+
 { Include platform independent interface part }
 { Include platform independent interface part }
 {$i sysutilh.inc}
 {$i sysutilh.inc}
 
 
 
 
 implementation
 implementation
 
 
-uses 
+uses
   dos, sysconst;
   dos, sysconst;
 
 
 { Include platform independent implementation part }
 { Include platform independent implementation part }
@@ -234,6 +237,30 @@ begin
 end;
 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
                               Locale Functions
 ****************************************************************************}
 ****************************************************************************}