From 77f1092ca0f915ca7cb190475254beeaa6912ef1 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 5 Jan 2012 17:29:41 +0000 Subject: [PATCH] + sysutils.sleep for gba + dummy sysutils.getlastoserror for gba git-svn-id: trunk@19975 - --- rtl/gba/sysutils.pp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/rtl/gba/sysutils.pp b/rtl/gba/sysutils.pp index ec48df6e18..66496ed8de 100644 --- a/rtl/gba/sysutils.pp +++ b/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 ****************************************************************************}